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

GENIE interface for uniform flux exposure iterface. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Tools/Flux/GFluxFileConfigI.h"

Inheritance diagram for genie::flux::GFluxFileConfigI:
genie::flux::GDk2NuFlux genie::flux::GDk2NuFlux 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

GENIE interface for uniform flux exposure iterface.

Unified flux exposure interface to be used by flux drivers that can support such.

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

2015-03-17 initial version

Version
Id

Definition at line 29 of file GFluxFileConfigI.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file GFluxFileConfigI.cxx.

20  : fPdgCList(new PDGCodeList)
21  , fPdgCListRej(new PDGCodeList)
22  , fXMLbasename("")
23  , fNCycles(0)
24  , fICycle(0)
25  , fZ0(-3.4e38)
26  { ; }
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 28 of file GFluxFileConfigI.cxx.

28 { ; }

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, genie::flux::GSimpleNtpFlux, genie::flux::GDk2NuFlux, and genie::flux::GDk2NuFlux.

Definition at line 55 of file GFluxFileConfigI.cxx.

Referenced by GetXMLFileBase(), and main().

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

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

Definition at line 68 of file GFluxFileConfigI.cxx.

Referenced by GetXMLFileBase(), and main().

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

Definition at line 54 of file GFluxFileConfigI.h.

References fXMLbasename, GetBranchInfo(), GetMetaDataTree(), PrintConfig(), SetFluxParticles(), SetNumOfCycles(), and SetUpstreamZ().

54 { 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, genie::flux::GDk2NuFlux, and genie::flux::GDk2NuFlux.

Referenced by LoadBeamSimData(), main(), genie::flux::GSimpleNtpFlux::SumWeight(), and genie::flux::GNuMIFlux::SumWeight().

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

Definition at line 34 of file GFluxFileConfigI.cxx.

References LoadBeamSimData().

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

Definition at line 45 of file GFluxFileConfigI.cxx.

References LoadBeamSimData().

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

print the current configuration

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

Referenced by GetXMLFileBase(), and main().

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

specify list of flux neutrino species

Definition at line 100 of file GFluxFileConfigI.cxx.

References genie::PDGCodeList::Copy(), fPdgCList, LOG, and pINFO.

Referenced by GetXMLFileBase(), main(), and genie::flux::GDk2NuFlux::SetDefaults().

101  {
102  fPdgCList->Copy(particles);
103 
104  LOG("Flux", pINFO)
105  << "Declared list of neutrino species: " << *fPdgCList;
106  }
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:97
#define pINFO
Definition: Messenger.h:63
void Copy(const PDGCodeList &list)
copy / print
void genie::flux::GFluxFileConfigI::SetNumOfCycles ( long int  ncycle)
virtual

limit cycling through input files

Definition at line 86 of file GFluxFileConfigI.cxx.

References fNCycles, and CLHEP::L.

Referenced by GetXMLFileBase(), main(), genie::flux::GDk2NuFlux::SetDefaults(), and genie::flux::GSimpleNtpFlux::SetDefaults().

87  {
88  // The flux ntuples can be recycled for a number of times to boost
89  // generated event statistics without requiring enormous beam simulation
90  // statistics.
91  // That option determines how many times the driver is going to cycle
92  // through the input flux ntuple.
93  // With ncycle=0 the flux ntuple will be recycled an infinite amount of
94  // times so that the event generation loop can exit only on a POT or
95  // event num check.
96 
97  fNCycles = TMath::Max(0L, ncycle);
98  }
static constexpr double L
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 74 of file GFluxFileConfigI.cxx.

References fZ0.

Referenced by fill_simple(), GetXMLFileBase(), main(), genie::flux::GDk2NuFlux::SetDefaults(), and genie::flux::GSimpleNtpFlux::SetDefaults().

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

Definition at line 30 of file GFluxFileConfigI.cxx.

References fXMLbasename.

Referenced by genie::flux::GDk2NuFlux::SetDefaults().

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

Member Data Documentation

long int genie::flux::GFluxFileConfigI::fICycle
protected
long int genie::flux::GFluxFileConfigI::fNCycles
protected
PDGCodeList* genie::flux::GFluxFileConfigI::fPdgCList
protected
PDGCodeList* genie::flux::GFluxFileConfigI::fPdgCListRej
protected
std::string genie::flux::GFluxFileConfigI::fXMLbasename
protected

XML file that might hold config param_sets.

Definition at line 96 of file GFluxFileConfigI.h.

Referenced by GetXMLFileBase(), and SetXMLFileBase().

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

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

Definition at line 100 of file GFluxFileConfigI.h.

Referenced by genie::flux::GDk2NuFlux::GenerateNext_weighted(), genie::flux::GSimpleNtpFlux::GenerateNext_weighted(), genie::flux::GDk2NuFlux::PrintConfig(), and SetUpstreamZ().


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