GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSimFiles.h
Go to the documentation of this file.
1 //__________________________________________________________________________
2 /*!
3 
4 \class GSimFiles
5 
6 \brief Holds GENIE simulation outputs (cross-section ROOT files, simulated
7  event samples in GHEP, GST or other format) typically used as inputs
8  in physics validation / tuning apps.
9 
10  The file lists are stored in XML format as shown below.
11 
12  Simulation results from multiple version of the code or from multiple
13  physics models can be stored.
14 
15  <?xml version="1.0" encoding="ISO-8859-1"?>
16  <genie_simulation_outputs>
17  <model name="a_model_name">
18  <xsec_file> /path/model_1/xsec.root </xsec_file>
19  <evt_file format="gst"> /path/model_1/evtfile0.root </evt_file>
20  <evt_file format="gst"> /path/model_1/evtfile1.root </evt_file>
21  <evt_file format="gst"> /path/model_1/evtfile2.root </evt_file>
22  ...
23  </model>
24  <model name="another_model_name">
25  <xsec_file> /path/model_2/xsec.root </xsec_file>
26  <evt_file format="gst"> /path/model_2/evtfile0.root </evt_file>
27  <evt_file format="gst"> /path/model_2/evtfile1.root </evt_file>
28  <evt_file format="gst"> /path/model_2/evtfile2.root </evt_file>
29  ...
30  </model>
31  ...
32  </genie_simulation_outputs>
33 
34 \author Costas Andreopoulos <c.andreopoulos \at cern.ch>
35  University of Liverpool
36 
37 \created Oct 12, 2009
38 
39 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
40  For the full text of the license visit http://copyright.genie-mc.org
41 */
42 //__________________________________________________________________________
43 
44 #ifndef _GSIM_FILES_H_
45 #define _GSIM_FILES_H_
46 
47 #include <iostream>
48 #include <string>
49 #include <vector>
50 
51 #include <TChain.h>
52 #include <TTree.h>
53 #include <TFile.h>
54 
55 using std::ostream;
56 using std::string;
57 using std::vector;
58 
59 namespace genie {
60 
61 class GSimFiles;
62 ostream & operator << (ostream & stream, const GSimFiles & gsimf);
63 
64 class GSimFiles
65 {
66 public:
67  GSimFiles(bool chain=true, const int nmaxmodels=10);
68  ~GSimFiles(void);
69 
70  int NModels (void) const;
71  int FindModelID (string tag) const;
72  string ModelTag (int imodel) const;
73  TFile * XSecFile (int imodel) const;
74  string XSecFileName (int imodel) const;
75  TChain * EvtChain (int imodel) const;
76  vector<string> & EvtFileNames (int imodel) const;
77  const string & PathToXMLFile(void) const;
78  void Print (ostream & stream) const;
79  bool LoadFromFile (string xmlfile);
80 
81  friend ostream & operator << (ostream & stream, const GSimFiles & gsimf);
82 
83 private:
84 
85  void Init (const int nmaxmodels);
86  void CleanUp (void);
87 
88  bool fDoChain;
89  int fNModels;
90  vector<string> * fModelTag;
91  vector<TFile*> * fXSecFile;
92  vector<string> * fXSecFileName;
93  vector<TChain*> * fEvtChain;
94  vector<vector<string> > * fEvtFileNames;
95  string fPath2XMLFile;
96 };
97 
98 } // genie namespace
99 
100 #endif // _GSIM_FILES_H_
vector< TFile * > * fXSecFile
Definition: GSimFiles.h:91
Holds GENIE simulation outputs (cross-section ROOT files, simulated event samples in GHEP...
string ModelTag(int imodel) const
Definition: GSimFiles.cxx:61
vector< TChain * > * fEvtChain
Definition: GSimFiles.h:93
void Init(const int nmaxmodels)
Definition: GSimFiles.cxx:254
vector< string > * fModelTag
Definition: GSimFiles.h:90
vector< string > & EvtFileNames(int imodel) const
Definition: GSimFiles.cxx:81
int NModels(void) const
Definition: GSimFiles.cxx:45
friend ostream & operator<<(ostream &stream, const GSimFiles &gsimf)
Definition: GSimFiles.cxx:27
TChain * EvtChain(int imodel) const
Definition: GSimFiles.cxx:76
const string & PathToXMLFile(void) const
Definition: GSimFiles.cxx:86
string XSecFileName(int imodel) const
Definition: GSimFiles.cxx:71
bool LoadFromFile(string xmlfile)
Definition: GSimFiles.cxx:91
void Print(ostream &stream) const
Definition: GSimFiles.cxx:236
int FindModelID(string tag) const
Definition: GSimFiles.cxx:50
string fPath2XMLFile
Definition: GSimFiles.h:95
void CleanUp(void)
Definition: GSimFiles.cxx:273
vector< vector< string > > * fEvtFileNames
Definition: GSimFiles.h:94
GSimFiles(bool chain=true, const int nmaxmodels=10)
Definition: GSimFiles.cxx:34
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
TFile * XSecFile(int imodel) const
Definition: GSimFiles.cxx:66
vector< string > * fXSecFileName
Definition: GSimFiles.h:92