HighLAND
Header.hxx
1 #ifndef Header_hxx
2 #define Header_hxx
3 
4 #include <CoreDataClasses.hxx>
5 #include <TChain.h>
6 
7 /// This class handles POT info, SoftwareVersion and IsMC
8 
9 //-------------------------------------------------------------------
10 class Header{
11 public :
12 
13 
14  /// constructor
15  Header();
16 
17  virtual ~Header(){}
18 
19  /// Record the POT for the current spill, based on information in the AnaBeam
20  /// member of the current AnaSpill.
21  void IncrementPOTBySpill(const AnaSpillC& spill);
22 
23  /// Directly increment the good POT. Use this for MC files, which don't have
24  /// beam information.
25  void IncrementPOTByFile(Double_t pot, bool bySpillPOT=true);
26 
27  /// Read the "header" tree from the given file, but reset POT counting first
28  void ReadHeader(const std::string& file);
29  void ReadHeader(TTree* tree);
30 
31  /// Read the "header" tree from the given file and increment the existing POT counting
32  bool AddHeader(const std::string& file, bool bySpillPOT=false);
33  bool AddHeader(TTree* tree, bool bySpillPOT=false);
34 
35  /// This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts.
36  Double_t GetPOT() { return GetPOTGoodBeamGoodND280(); }
37 
38  /// This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts.
39  Int_t GetNSpills() { return GetSpillGoodBeamGoodND280(); }
40 
41  /// Get the total recorded POT, before any quality cuts.
42  Double_t GetPOTNoCut() { return _POT_NoCut; }
43 
44  /// Get the total recorded POT counted per file
46 
47  /// Get the total POT that was removed due to bad beam quality.
48  Double_t GetPOTBadBeam() { return _POT_BadBeam; }
49 
50  /// Get the total POT that was removed due to bad ND280 quality.
51  Double_t GetPOTBadND280() { return _POT_BadND280; }
52 
53  /// Get the total POT that passed beam and ND280 quality cuts.
54  Double_t GetPOTGoodBeamGoodND280() { return _POT_GoodBeamGoodND280; }
55 
56  /// Set the total POT that passed beam and ND280 quality cuts.
57  void SetPOTGoodBeamGoodND280(Double_t good) {_POT_GoodBeamGoodND280 = good;}
58 
59  /// Get the total POT that passed beam and ND280 quality cuts, at 0KA horn current.
60  Double_t GetPOT0KA() { return _POT_0KA; }
61 
62  /// Get the total POT that passed beam and ND280 quality cuts, at 200KA horn current.
63  Double_t GetPOT200KA() { return _POT_200KA; }
64 
65  /// Get the total POT that passed beam and ND280 quality cuts, at 250KA horn current.
66  Double_t GetPOT250KA() { return _POT_250KA; }
67 
68  /// Get the total POT that passed beam and ND280 quality cuts, at -250KA horn current.
69  Double_t GetPOTMinus250KA() { return _POT_m250KA; }
70 
71  /// Get the total POT that passed beam and ND280 quality cuts, at a horn current
72  /// that isn't 0KA, 200KA or 250KA.
73  Double_t GetPOTOtherKA() { return _POT_OtherKA; }
74 
75  /// Get the total recorded spills, before any quality cuts.
76  Int_t GetSpillNoCut() { return _Spill_NoCut; }
77 
78  /// Get the total spills that was removed due to bad beam quality.
79  Int_t GetSpillBadBeam() { return _Spill_BadBeam; }
80 
81  /// Get the total spills that was removed due to bad ND280 quality.
82  Int_t GetSpillBadND280() { return _Spill_BadND280; }
83 
84  /// Get the total spills that passed beam and ND280 quality cuts.
85  Int_t GetSpillGoodBeamGoodND280() { return _Spill_GoodBeamGoodND280; }
86 
87  /// Print the POT information.
88  void DumpPOT();
89 
90  /// Reset all the information in the header
91  void Reset();
92 
93  /// Set the Data/MC mode
94  bool SetIsMC(bool isMC);
95 
96  /// returns the Data/MC mode
97  bool GetIsMC() const{return _IsMC;}
98 
99  /// Set the software version
100  bool SetSoftwareVersion(const std::string& ver);
101 
102  /// Returns the software version
103  const std::string& GetSoftwareVersion(){return _SoftwareVersion;}
104 
105  public:
106 
107  /// POT info
109  Double_t _POT_NoCut;
110  Double_t _POT_BadBeam;
111  Double_t _POT_BadND280;
112  Double_t _POT_GoodBeamGoodND280;
113  Double_t _POT_0KA;
114  Double_t _POT_200KA;
115  Double_t _POT_250KA;
116  Double_t _POT_m250KA;
117  Double_t _POT_OtherKA;
118 
119  /// Spill info
121  Int_t _Spill_BadBeam;
122  Int_t _Spill_BadND280;
123  Int_t _Spill_GoodBeamGoodND280;
124 
125  /// data or MC mode
126  bool _IsMC;
127 
128  /// The software version used to create the original oaAnalysis file of the last input file
129  std::string _SoftwareVersion;
130 
131  /// iternal variable that tell us whether a file has been added previously
132  bool _isFirstFile; //!
133 
134 };
135 
136 #endif
137 
138 
Double_t GetPOTGoodBeamGoodND280()
Get the total POT that passed beam and ND280 quality cuts.
Definition: Header.hxx:54
Double_t GetPOTMinus250KA()
Get the total POT that passed beam and ND280 quality cuts, at -250KA horn current.
Definition: Header.hxx:69
Int_t _Spill_NoCut
Spill info.
Definition: Header.hxx:120
void Reset()
Reset all the information in the header.
Definition: Header.cxx:13
const std::string & GetSoftwareVersion()
Returns the software version.
Definition: Header.hxx:103
Double_t GetPOT0KA()
Get the total POT that passed beam and ND280 quality cuts, at 0KA horn current.
Definition: Header.hxx:60
bool SetSoftwareVersion(const std::string &ver)
Set the software version.
Definition: Header.cxx:257
Double_t GetPOTBadBeam()
Get the total POT that was removed due to bad beam quality.
Definition: Header.hxx:48
void IncrementPOTByFile(Double_t pot, bool bySpillPOT=true)
Definition: Header.cxx:150
Header()
constructor
Definition: Header.cxx:7
This class handles POT info, SoftwareVersion and IsMC.
Definition: Header.hxx:10
Int_t GetSpillBadBeam()
Get the total spills that was removed due to bad beam quality.
Definition: Header.hxx:79
Int_t GetSpillGoodBeamGoodND280()
Get the total spills that passed beam and ND280 quality cuts.
Definition: Header.hxx:85
Double_t _POT_CountedPerFile
POT info.
Definition: Header.hxx:108
std::string _SoftwareVersion
The software version used to create the original oaAnalysis file of the last input file...
Definition: Header.hxx:129
bool _isFirstFile
iternal variable that tell us whether a file has been added previously
Definition: Header.hxx:132
bool GetIsMC() const
returns the Data/MC mode
Definition: Header.hxx:97
Double_t GetPOT()
This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts...
Definition: Header.hxx:36
void IncrementPOTBySpill(const AnaSpillC &spill)
Definition: Header.cxx:163
Double_t GetPOT200KA()
Get the total POT that passed beam and ND280 quality cuts, at 200KA horn current. ...
Definition: Header.hxx:63
bool _IsMC
data or MC mode
Definition: Header.hxx:126
Double_t GetPOTNoCut()
Get the total recorded POT, before any quality cuts.
Definition: Header.hxx:42
Double_t GetPOTCountedPerFile()
Get the total recorded POT counted per file.
Definition: Header.hxx:45
Double_t GetPOTBadND280()
Get the total POT that was removed due to bad ND280 quality.
Definition: Header.hxx:51
Int_t GetSpillBadND280()
Get the total spills that was removed due to bad ND280 quality.
Definition: Header.hxx:82
bool SetIsMC(bool isMC)
Set the Data/MC mode.
Definition: Header.cxx:242
void SetPOTGoodBeamGoodND280(Double_t good)
Set the total POT that passed beam and ND280 quality cuts.
Definition: Header.hxx:57
Double_t GetPOT250KA()
Get the total POT that passed beam and ND280 quality cuts, at 250KA horn current. ...
Definition: Header.hxx:66
Int_t GetSpillNoCut()
Get the total recorded spills, before any quality cuts.
Definition: Header.hxx:76
Double_t GetPOTOtherKA()
Definition: Header.hxx:73
bool AddHeader(const std::string &file, bool bySpillPOT=false)
Read the "header" tree from the given file and increment the existing POT counting.
Definition: Header.cxx:132
Int_t GetNSpills()
This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts...
Definition: Header.hxx:39
void ReadHeader(const std::string &file)
Read the "header" tree from the given file, but reset POT counting first.
Definition: Header.cxx:141
void DumpPOT()
Print the POT information.
Definition: Header.cxx:226