GFluxFileConfigI.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file GFluxFileConfigI.h
3 /// \class genie::flux::GFluxFileConfigI
4 /// \brief GENIE interface for uniform flux exposure iterface
5 ///
6 /// Unified flux exposure interface to be used by flux drivers
7 /// that can support such.
8 ///
9 /// \author Robert Hatcher <rhatcher \at fnal.gov>
10 /// Fermi National Accelerator Laboratory
11 ///
12 /// \created 2015-03-17 initial version
13 /// \version $Id: $
14 ////////////////////////////////////////////////////////////////////////
15 
16 #ifndef GENIE_FLUX_GFLUXFILECONFIGI_H
17 #define GENIE_FLUX_GFLUXFILECONFIGI_H
18 
19 #include <string>
20 #include <vector>
21 #include <set>
22 
24 class TTree;
25 
26 namespace genie {
27 namespace flux {
28 
30 
31  public:
32 
34  virtual ~GFluxFileConfigI();
35 
36  //
37  // define the GFluxFileConfigI interface:
38  //
39 
40  /// first is primary method for loading root flux ntuple files and config
41  /// others are alternatives that can be overloaded but have
42  /// sensible defaults to fall back to calling the vector version
43 
44  virtual void LoadBeamSimData(const std::vector<std::string>& filenames,
45  const std::string& det_loc) = 0;
46 
47  virtual void LoadBeamSimData(const std::set<std::string>& filenames,
48  const std::string& det_loc);
49 
50  virtual void LoadBeamSimData(const std::string& filename,
51  const std::string& det_loc);
52 
53  virtual void SetXMLFileBase(std::string xmlbasename="");
54  virtual std::string GetXMLFileBase() const { return fXMLbasename; }
55 
56  /// allow caller to copy current status / ntuple entry info
57  /// in the output file by providing copies of internal info
58  ///
59  /// Assumes that branch object pointers will not change
60  /// which may require either a copy be made or, if using the class
61  /// directly for reading the branch, one must force ROOT to
62  /// not autodelete:
63  /// myns::MyClassType* fCurrMyClass = new myns::MyClassType;
64  /// myTree->SetBranchAddress("bname",&fCurMyClass);
65  /// //? TBranch* b = myTree->GetBranch("bname");
66  /// //? b->SetAutoDelete(false);
67  ///
68  /// ensure vectors are sized sufficiently (or use .push_back())
69  /// branchNames[i] = "bname"
70  /// branchClassNames[i] = "myns::MyClassType"
71  /// branchObjPointers[i] = (void**)&fCurMyClass;
72 
73  virtual void GetBranchInfo(std::vector<std::string>& branchNames,
74  std::vector<std::string>& branchClassNames,
75  std::vector<void**>& branchObjPointers);
76 
77  virtual TTree* GetMetaDataTree(); //
78 
79  /// print the current configuration
80  virtual void PrintConfig() = 0;
81 
82  /// specify list of flux neutrino species
83  virtual void SetFluxParticles(const PDGCodeList & particles);
84 
85  /// set flux neutrino initial z position (upstream of the detector)
86  /// pushed back from the normal flux window
87  virtual void SetUpstreamZ(double z0);
88 
89  /// limit cycling through input files
90  virtual void SetNumOfCycles(long int ncycle);
91 
92  protected: // visible to derived classes
93 
94  PDGCodeList * fPdgCList; ///< list of neutrino pdg-codes to generate
95  PDGCodeList * fPdgCListRej; ///< list of nu pdg-codes seen but rejected
96  std::string fXMLbasename; ///< XML file that might hold config param_sets
97  long int fNCycles; ///< # times to cycle through the ntuple(s)
98  long int fICycle; ///< current file cycle
99  ///< default 0 = infinitely
100  double fZ0; ///< configurable starting z position for
101  ///< each flux neutrino (in detector coord system)
102  };
103 
104 } // namespace flux
105 } // namespace genie
106 
107 #endif //GENIE_FLUX_GFLUXFILECONFIGI_H
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.
virtual void PrintConfig()=0
print the current configuration
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
long int fNCycles
times to cycle through the ntuple(s)
virtual std::string GetXMLFileBase() const
virtual void GetBranchInfo(std::vector< std::string > &branchNames, std::vector< std::string > &branchClassNames, std::vector< void ** > &branchObjPointers)
GENIE interface for uniform flux exposure iterface.
PDGCodeList * fPdgCListRej
list of nu pdg-codes seen but rejected
virtual void SetFluxParticles(const PDGCodeList &particles)
specify list of flux neutrino species
enum BeamMode string