GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
genie::flux::GFluxFileConfigI Class Referenceabstract

#include <GFluxFileConfigI.h>

Inheritance diagram for genie::flux::GFluxFileConfigI:
Inheritance graph
[legend]
Collaboration diagram for genie::flux::GFluxFileConfigI:
Collaboration graph
[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 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
Created:
2015-03-17
License:
Copyright (c) 2003-2024, 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.

Referenced by main().

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.

Referenced by main().

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

Definition at line 56 of file GFluxFileConfigI.h.

References fXMLbasename.

Referenced by genie::flux::GNuMIFluxXMLHelper::LoadConfig().

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.

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

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.

References LoadBeamSimData().

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
void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::string &  filename,
const std::string &  det_loc 
)
virtual

Definition at line 44 of file GFluxFileConfigI.cxx.

References LoadBeamSimData().

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
virtual void genie::flux::GFluxFileConfigI::PrintConfig ( )
pure virtual

print the current configuration

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

Referenced by main().

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

specify list of flux neutrino species

Definition at line 99 of file GFluxFileConfigI.cxx.

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

Referenced by main().

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.

References fNCycles.

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

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.

References fZ0.

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

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.

References fXMLbasename.

Referenced by genie::flux::GNuMIFlux::LoadConfig().

30  { 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 98 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 102 of file GFluxFileConfigI.h.

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


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