GFluxFileConfigI.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file GFluxFileConfigI.cxx
3 /// \brief GENIE interface for uniform flux exposure iterface
4 ///
5 /// \version $Id: $
6 /// \author Robert Hatcher <rhatcher \at fnal.gov>
7 /// Fermi National Accelerator Laboratory
8 ///
9 /// \update 2015-03-17 initial version
10 ////////////////////////////////////////////////////////////////////////
11 
14 #include "TMath.h"
15 
16 namespace genie {
17 namespace flux {
18 
20  : fPdgCList(new PDGCodeList)
21  , fPdgCListRej(new PDGCodeList)
22  , fXMLbasename("")
23  , fNCycles(0)
24  , fICycle(0)
25  , fZ0(-3.4e38)
26  { ; }
27 
29 
31  { fXMLbasename = xmlbasename; }
32 
33  //___________________________________________________________________________
34  void GFluxFileConfigI::LoadBeamSimData(const std::set<std::string>& fileset,
35  const std::string& config )
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  }
43 
44  //___________________________________________________________________________
46  const std::string& config )
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  }
53 
54  //___________________________________________________________________________
55  void GFluxFileConfigI::GetBranchInfo(std::vector<std::string>& /* branchNames */,
56  std::vector<std::string>& /* branchClassNames */,
57  std::vector<void**>& /* branchObjPointers */)
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  }
66 
67  //___________________________________________________________________________
69  {
70  return 0;
71  }
72 
73  //___________________________________________________________________________
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  }
85  //___________________________________________________________________________
86  void GFluxFileConfigI::SetNumOfCycles(long int ncycle)
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  }
99  //___________________________________________________________________________
101  {
102  fPdgCList->Copy(particles);
103 
104  LOG("Flux", pINFO)
105  << "Declared list of neutrino species: " << *fPdgCList;
106  }
107 
108 } // namespace flux
109 } // namespace genie
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
std::string fXMLbasename
XML file that might hold config param_sets.
Definition: config.py:1
string filename
Definition: shutoffs.py:106
virtual void SetNumOfCycles(long int ncycle)
limit cycling through input files
Loaders::FluxType flux
A list of PDG codes.
Definition: PDGCodeList.h:33
virtual void SetXMLFileBase(std::string xmlbasename="")
virtual void SetUpstreamZ(double z0)
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
static constexpr double L
#define pINFO
Definition: Messenger.h:63
long int fNCycles
times to cycle through the ntuple(s)
virtual void GetBranchInfo(std::vector< std::string > &branchNames, std::vector< std::string > &branchClassNames, std::vector< void ** > &branchObjPointers)
virtual void SetFluxParticles(const PDGCodeList &particles)
specify list of flux neutrino species
void Copy(const PDGCodeList &list)
copy / print
enum BeamMode string