GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GFluxFileConfigI.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Robert Hatcher <rhatcher@fnal.gov>
7  Fermi National Accelerator Laboratory
8 */
9 //____________________________________________________________________________
10 
13 #include "TMath.h"
14 
15 namespace genie {
16 namespace flux {
17 
19  : fPdgCList(new PDGCodeList)
20  , fPdgCListRej(new PDGCodeList)
21  , fXMLbasename("")
22  , fNCycles(0)
23  , fICycle(0)
24  , fZ0(-3.4e38)
25  { ; }
26 
28 
29  void GFluxFileConfigI::SetXMLFileBase(std::string xmlbasename)
30  { fXMLbasename = xmlbasename; }
31 
32  //___________________________________________________________________________
33  void GFluxFileConfigI::LoadBeamSimData(const std::set<std::string>& fileset,
34  const std::string& config )
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  }
42 
43  //___________________________________________________________________________
44  void GFluxFileConfigI::LoadBeamSimData(const std::string& filename,
45  const std::string& config )
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  }
52 
53  //___________________________________________________________________________
54  void GFluxFileConfigI::GetBranchInfo(std::vector<std::string>& /* branchNames */,
55  std::vector<std::string>& /* branchClassNames */,
56  std::vector<void**>& /* branchObjPointers */)
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  }
65 
66  //___________________________________________________________________________
68  {
69  return 0;
70  }
71 
72  //___________________________________________________________________________
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  }
84  //___________________________________________________________________________
85  void GFluxFileConfigI::SetNumOfCycles(long int ncycle)
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  }
98  //___________________________________________________________________________
100  {
101  fPdgCList->Copy(particles);
102 
103  LOG("Flux", pINFO)
104  << "Declared list of neutrino species: " << *fPdgCList;
105  }
106 
107 } // namespace flux
108 } // namespace genie
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
std::string fXMLbasename
XML file that might hold config param_sets.
virtual void SetNumOfCycles(long int ncycle)
limit cycling through input files
A list of PDG codes.
Definition: PDGCodeList.h:32
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:96
#define pINFO
Definition: Messenger.h:62
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