GENIEGenerator
Loading...
Searching...
No Matches
genie::flux::GFluxFileConfigI Class Referenceabstract

#include <GFluxFileConfigI.h>

Inheritance diagram for genie::flux::GFluxFileConfigI:
[legend]
Collaboration diagram for genie::flux::GFluxFileConfigI:
[legend]

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
virtual void SetFluxParticles (const PDGCodeList &particles)
 specify list of flux neutrino species
virtual void SetUpstreamZ (double z0)
virtual void SetNumOfCycles (long int ncycle)
 limit cycling through input files

Protected Attributes

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

Detailed Description

Author
Robert Hatcher <rhatcher \at fnal.gov> Fermi National Accelerator Laboratory
Created:\n 2015-03-17
License:\n Copyright (c) 2003-2025, 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

◆ GFluxFileConfigI()

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 { ; }
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
std::string fXMLbasename
XML file that might hold config param_sets.
PDGCodeList * fPdgCListRej
list of nu pdg-codes seen but rejected

References fICycle, fNCycles, fPdgCList, fPdgCListRej, fXMLbasename, and fZ0.

◆ ~GFluxFileConfigI()

genie::flux::GFluxFileConfigI::~GFluxFileConfigI ( )
virtual

Definition at line 27 of file GFluxFileConfigI.cxx.

27{ ; }

Member Function Documentation

◆ GetBranchInfo()

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**)&fCurMyClass;

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 }

Referenced by main().

◆ GetMetaDataTree()

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 }

Referenced by main().

◆ GetXMLFileBase()

virtual std::string genie::flux::GFluxFileConfigI::GetXMLFileBase ( ) const
inlinevirtual

Definition at line 56 of file GFluxFileConfigI.h.

56{ return fXMLbasename; }

References fXMLbasename.

◆ LoadBeamSimData() [1/3]

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

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

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

References LoadBeamSimData().

◆ LoadBeamSimData() [2/3]

void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::string & filename,
const std::string & det_loc )
virtual

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

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 }

◆ LoadBeamSimData() [3/3]

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.

Referenced by LoadBeamSimData(), LoadDetectorPosition(), and main().

◆ PrintConfig()

virtual void genie::flux::GFluxFileConfigI::PrintConfig ( )
pure virtual

print the current configuration

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

Referenced by main().

◆ SetFluxParticles()

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 }
#define pINFO
Definition Messenger.h:62
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96

References fPdgCList, LOG, and pINFO.

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

◆ SetNumOfCycles()

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 }

References fNCycles.

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

◆ SetUpstreamZ()

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 }

References fZ0.

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

◆ SetXMLFileBase()

void genie::flux::GFluxFileConfigI::SetXMLFileBase ( std::string xmlbasename = "")
virtual

Definition at line 29 of file GFluxFileConfigI.cxx.

30 { fXMLbasename = xmlbasename; }

References fXMLbasename.

Referenced by genie::flux::GNuMIFlux::LoadConfig(), and genie::flux::GNuMIFlux::SetDefaults().

Member Data Documentation

◆ fICycle

◆ fNCycles

◆ fPdgCList

◆ fPdgCListRej

◆ fXMLbasename

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

XML file that might hold config param_sets.

Definition at line 98 of file GFluxFileConfigI.h.

Referenced by GetXMLFileBase(), GFluxFileConfigI(), and SetXMLFileBase().

◆ fZ0

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

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