Public Member Functions | Protected Attributes | List of all members
genie::flux::GFluxFileConfigI Class Referenceabstract

#include <GFluxFileConfigI.h>

Inheritance diagram for genie::flux::GFluxFileConfigI:
genie::flux::GNuMIFlux genie::flux::GSimpleNtpFlux

Public Member Functions

 GFluxFileConfigI ()
 
virtual ~GFluxFileConfigI ()
 
virtual void LoadBeamSimData (const std::vector< std::string > &filenames, const std::string &det_loc)=0
 
virtual void LoadBeamSimData (const std::set< std::string > &filenames, const std::string &det_loc)
 
virtual void LoadBeamSimData (const std::string &filename, const std::string &det_loc)
 
virtual void SetXMLFileBase (std::string xmlbasename="")
 
virtual std::string GetXMLFileBase () const
 
virtual void GetBranchInfo (std::vector< std::string > &branchNames, std::vector< std::string > &branchClassNames, std::vector< void ** > &branchObjPointers)
 
virtual TTree * GetMetaDataTree ()
 
virtual void PrintConfig ()=0
 print the current configuration More...
 
virtual void SetFluxParticles (const PDGCodeList &particles)
 specify list of flux neutrino species More...
 
virtual void SetUpstreamZ (double z0)
 
virtual void SetNumOfCycles (long int ncycle)
 limit cycling through input files More...
 

Protected Attributes

PDGCodeListfPdgCList
 list of neutrino pdg-codes to generate More...
 
PDGCodeListfPdgCListRej
 list of nu pdg-codes seen but rejected More...
 
std::string fXMLbasename
 XML file that might hold config param_sets. More...
 
long int fNCycles
 

times to cycle through the ntuple(s)

More...
 
long int fICycle
 
double fZ0
 

Detailed Description

Author
Robert Hatcher <rhatcher fnal.gov> Fermi National Accelerator Laboratory

2015-03-17

Copyright (c) 2003-2020, The GENIE Collaboration for the full text of the license visit http://copyright.genie-mc.org

Definition at line 31 of file GFluxFileConfigI.h.

Constructor & Destructor Documentation

genie::flux::GFluxFileConfigI::GFluxFileConfigI ( )

Definition at line 18 of file GFluxFileConfigI.cxx.

19  : fPdgCList(new PDGCodeList)
20  , fPdgCListRej(new PDGCodeList)
21  , fXMLbasename("")
22  , fNCycles(0)
23  , fICycle(0)
24  , fZ0(-3.4e38)
25  { ; }
std::string fXMLbasename
XML file that might hold config param_sets.
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
long int fNCycles
times to cycle through the ntuple(s)
PDGCodeList * fPdgCListRej
list of nu pdg-codes seen but rejected
genie::flux::GFluxFileConfigI::~GFluxFileConfigI ( )
virtual

Definition at line 27 of file GFluxFileConfigI.cxx.

27 { ; }

Member Function Documentation

void genie::flux::GFluxFileConfigI::GetBranchInfo ( std::vector< std::string > &  branchNames,
std::vector< std::string > &  branchClassNames,
std::vector< void ** > &  branchObjPointers 
)
virtual

allow caller to copy current status / ntuple entry info in the output file by providing copies of internal info

Assumes that branch object pointers will not change which may require either a copy be made or, if using the class directly for reading the branch, one must force ROOT to not autodelete: myns::MyClassType* fCurrMyClass = new myns::MyClassType; myTree->SetBranchAddress("bname",&fCurMyClass); //? TBranch* b = myTree->GetBranch("bname"); //? b->SetAutoDelete(false);

ensure vectors are sized sufficiently (or use .push_back()) branchNames[i] = "bname" branchClassNames[i] = "myns::MyClassType" branchObjPointers[i] = (void**)

Reimplemented in genie::flux::GNuMIFlux, and genie::flux::GSimpleNtpFlux.

Definition at line 54 of file GFluxFileConfigI.cxx.

57  {
58  // allow flux driver to report back current status and/or ntuple entry
59  // info for possible recording in the output file by supplying
60  // the class name, and a pointer to the object that will be filled
61  // as well as a suggested name for the branch.
62 
63  // default is not to supply anything
64  }
TTree * genie::flux::GFluxFileConfigI::GetMetaDataTree ( )
virtual

Reimplemented in genie::flux::GNuMIFlux, and genie::flux::GSimpleNtpFlux.

Definition at line 67 of file GFluxFileConfigI.cxx.

68  {
69  return 0;
70  }
virtual std::string genie::flux::GFluxFileConfigI::GetXMLFileBase ( ) const
inlinevirtual

Definition at line 56 of file GFluxFileConfigI.h.

56 { return fXMLbasename; }
std::string fXMLbasename
XML file that might hold config param_sets.
virtual void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::vector< std::string > &  filenames,
const std::string det_loc 
)
pure virtual

first is primary method for loading root flux ntuple files and config others are alternatives that can be overloaded but have sensible defaults to fall back to calling the vector version

Implemented in genie::flux::GNuMIFlux, and genie::flux::GSimpleNtpFlux.

void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::set< std::string > &  filenames,
const std::string det_loc 
)
virtual

Definition at line 33 of file GFluxFileConfigI.cxx.

35  {
36  // Loads a beam simulation root file into the GFluxFileConfig driver.
37  // have a set<> want a vector<>
38  std::vector<std::string> filevec;
39  std::copy(fileset.begin(),fileset.end(),std::back_inserter(filevec));
40  LoadBeamSimData(filevec,config); // call the one that takes a vector
41  }
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
static Config * config
Definition: config.cpp:1054
T copy(T const &v)
void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::string filename,
const std::string det_loc 
)
virtual

Definition at line 44 of file GFluxFileConfigI.cxx.

46  {
47  // Loads a beam simulation root file into the GFluxFileConfig driver.
48  std::vector<std::string> filevec;
49  filevec.push_back(filename);
50  LoadBeamSimData(filevec,config); // call the one that takes a vector
51  }
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
string filename
Definition: train.py:213
static Config * config
Definition: config.cpp:1054
virtual void genie::flux::GFluxFileConfigI::PrintConfig ( )
pure virtual

print the current configuration

Implemented in genie::flux::GNuMIFlux, and genie::flux::GSimpleNtpFlux.

void genie::flux::GFluxFileConfigI::SetFluxParticles ( const PDGCodeList particles)
virtual

specify list of flux neutrino species

Definition at line 99 of file GFluxFileConfigI.cxx.

100  {
101  fPdgCList->Copy(particles);
102 
103  LOG("Flux", pINFO)
104  << "Declared list of neutrino species: " << *fPdgCList;
105  }
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pINFO
Definition: Messenger.h:62
void Copy(const PDGCodeList &list)
copy / print
void genie::flux::GFluxFileConfigI::SetNumOfCycles ( long int  ncycle)
virtual

limit cycling through input files

Definition at line 85 of file GFluxFileConfigI.cxx.

86  {
87  // The flux ntuples can be recycled for a number of times to boost
88  // generated event statistics without requiring enormous beam simulation
89  // statistics.
90  // That option determines how many times the driver is going to cycle
91  // through the input flux ntuple.
92  // With ncycle=0 the flux ntuple will be recycled an infinite amount of
93  // times so that the event generation loop can exit only on a POT or
94  // event num check.
95 
96  fNCycles = TMath::Max(0L, ncycle);
97  }
long int fNCycles
times to cycle through the ntuple(s)
void genie::flux::GFluxFileConfigI::SetUpstreamZ ( double  z0)
virtual

set flux neutrino initial z position (upstream of the detector) pushed back from the normal flux window

Definition at line 73 of file GFluxFileConfigI.cxx.

74  {
75  // The flux neutrino position (x,y) is given on the user specified
76  // flux window. This method sets the preferred user coord starting z
77  // position upstream of detector face. Each flux neutrino will be
78  // backtracked from the initial flux window to the input z0.
79  // If the value is unreasonable (> 10^30) then the ray is left on
80  // the flux window.
81 
82  fZ0 = z0;
83  }
void genie::flux::GFluxFileConfigI::SetXMLFileBase ( std::string  xmlbasename = "")
virtual

Definition at line 29 of file GFluxFileConfigI.cxx.

30  { fXMLbasename = xmlbasename; }
std::string fXMLbasename
XML file that might hold config param_sets.

Member Data Documentation

long int genie::flux::GFluxFileConfigI::fICycle
protected

current file cycle default 0 = infinitely

Definition at line 100 of file GFluxFileConfigI.h.

long int genie::flux::GFluxFileConfigI::fNCycles
protected

times to cycle through the ntuple(s)

Definition at line 99 of file GFluxFileConfigI.h.

PDGCodeList* genie::flux::GFluxFileConfigI::fPdgCList
protected

list of neutrino pdg-codes to generate

Definition at line 96 of file GFluxFileConfigI.h.

PDGCodeList* genie::flux::GFluxFileConfigI::fPdgCListRej
protected

list of nu pdg-codes seen but rejected

Definition at line 97 of file GFluxFileConfigI.h.

std::string genie::flux::GFluxFileConfigI::fXMLbasename
protected

XML file that might hold config param_sets.

Definition at line 98 of file GFluxFileConfigI.h.

double genie::flux::GFluxFileConfigI::fZ0
protected

configurable starting z position for each flux neutrino (in detector coord system)

Definition at line 102 of file GFluxFileConfigI.h.


The documentation for this class was generated from the following files: