HighLAND
Public Member Functions | Public Attributes | List of all members
Header Class Reference

This class handles POT info, SoftwareVersion and IsMC. More...

#include <Header.hxx>

Inheritance diagram for Header:
DataSample

Public Member Functions

 Header ()
 constructor
 
void IncrementPOTBySpill (const AnaSpillC &spill)
 
void IncrementPOTByFile (Double_t pot, bool bySpillPOT=true)
 
void ReadHeader (const std::string &file)
 Read the "header" tree from the given file, but reset POT counting first.
 
void ReadHeader (TTree *tree)
 
bool AddHeader (const std::string &file, bool bySpillPOT=false)
 Read the "header" tree from the given file and increment the existing POT counting.
 
bool AddHeader (TTree *tree, bool bySpillPOT=false)
 
Double_t GetPOT ()
 This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts.
 
Int_t GetNSpills ()
 This is the method used externaly. It corresponds to POT that passed beam and ND280 quality cuts.
 
Double_t GetPOTNoCut ()
 Get the total recorded POT, before any quality cuts.
 
Double_t GetPOTCountedPerFile ()
 Get the total recorded POT counted per file.
 
Double_t GetPOTBadBeam ()
 Get the total POT that was removed due to bad beam quality.
 
Double_t GetPOTBadND280 ()
 Get the total POT that was removed due to bad ND280 quality.
 
Double_t GetPOTGoodBeamGoodND280 ()
 Get the total POT that passed beam and ND280 quality cuts.
 
void SetPOTGoodBeamGoodND280 (Double_t good)
 Set the total POT that passed beam and ND280 quality cuts.
 
Double_t GetPOT0KA ()
 Get the total POT that passed beam and ND280 quality cuts, at 0KA horn current.
 
Double_t GetPOT200KA ()
 Get the total POT that passed beam and ND280 quality cuts, at 200KA horn current.
 
Double_t GetPOT250KA ()
 Get the total POT that passed beam and ND280 quality cuts, at 250KA horn current.
 
Double_t GetPOTMinus250KA ()
 Get the total POT that passed beam and ND280 quality cuts, at -250KA horn current.
 
Double_t GetPOTOtherKA ()
 
Int_t GetSpillNoCut ()
 Get the total recorded spills, before any quality cuts.
 
Int_t GetSpillBadBeam ()
 Get the total spills that was removed due to bad beam quality.
 
Int_t GetSpillBadND280 ()
 Get the total spills that was removed due to bad ND280 quality.
 
Int_t GetSpillGoodBeamGoodND280 ()
 Get the total spills that passed beam and ND280 quality cuts.
 
void DumpPOT ()
 Print the POT information.
 
void Reset ()
 Reset all the information in the header.
 
bool SetIsMC (bool isMC)
 Set the Data/MC mode.
 
bool GetIsMC () const
 returns the Data/MC mode
 
bool SetSoftwareVersion (const std::string &ver)
 Set the software version.
 
const std::string & GetSoftwareVersion ()
 Returns the software version.
 

Public Attributes

Double_t _POT_CountedPerFile
 POT info.
 
Double_t _POT_NoCut
 
Double_t _POT_BadBeam
 
Double_t _POT_BadND280
 
Double_t _POT_GoodBeamGoodND280
 
Double_t _POT_0KA
 
Double_t _POT_200KA
 
Double_t _POT_250KA
 
Double_t _POT_m250KA
 
Double_t _POT_OtherKA
 
Int_t _Spill_NoCut
 Spill info.
 
Int_t _Spill_BadBeam
 
Int_t _Spill_BadND280
 
Int_t _Spill_GoodBeamGoodND280
 
bool _IsMC
 data or MC mode
 
std::string _SoftwareVersion
 The software version used to create the original oaAnalysis file of the last input file.
 
bool _isFirstFile
 iternal variable that tell us whether a file has been added previously
 

Detailed Description

This class handles POT info, SoftwareVersion and IsMC.

Definition at line 10 of file Header.hxx.

Member Function Documentation

§ GetPOTOtherKA()

Double_t Header::GetPOTOtherKA ( )
inline

Get the total POT that passed beam and ND280 quality cuts, at a horn current that isn't 0KA, 200KA or 250KA.

Definition at line 73 of file Header.hxx.

73 { return _POT_OtherKA; }

§ IncrementPOTByFile()

void Header::IncrementPOTByFile ( Double_t  pot,
bool  bySpillPOT = true 
)

Directly increment the good POT. Use this for MC files, which don't have beam information.

Definition at line 150 of file Header.cxx.

150  {
151 //********************************************************************
152 
153  _POT_CountedPerFile += pot;
154 
155  // When no POT information by spill exists (prod5 MC) POT counting is done by file
156  if (!bySpillPOT){
157  _POT_NoCut += pot;
158  _POT_GoodBeamGoodND280 += pot;
159  }
160 }
Double_t _POT_CountedPerFile
POT info.
Definition: Header.hxx:108

§ IncrementPOTBySpill()

void Header::IncrementPOTBySpill ( const AnaSpillC spill)

Record the POT for the current spill, based on information in the AnaBeam member of the current AnaSpill.

Definition at line 163 of file Header.cxx.

163  {
164 //********************************************************************
165 
166  (void)spill;
167 /*
168  const AnaBeamB& beam = *spill.Beam;
169  const AnaEventInfoB& info = *spill.EventInfo;
170 
171  if (beam.POTSincePreviousSavedSpill > 1e+16) {
172  std::cout << "WARNING: POT is suspiciously large for run " << info.Run << ", subrun " << info.SubRun << ", event " << info.Event << ": " << beam.POTSincePreviousSavedSpill << ". POT will not be counted for this event." << std::endl;
173  return;
174  }
175 
176  if (beam.POTSincePreviousSavedSpill < 0) {
177  std::cout << "WARNING: POT is negative for run " << info.Run << ", subrun " << info.SubRun << ", event " << info.Event << ": " << beam.POTSincePreviousSavedSpill << ". POT will not be counted for this event." << std::endl;
178  return;
179  }
180 
181  // For real data
182  if (!spill.GetIsMC()) {
183 
184  _POT_NoCut += beam.POTSincePreviousSavedSpill;
185  _Spill_NoCut += beam.SpillsSincePreviousSavedSpill;
186 
187  if (beam.GoodSpill == 0) {
188  _POT_BadBeam += beam.POTSincePreviousSavedSpill;
189  _Spill_BadBeam += beam.SpillsSincePreviousSavedSpill;
190  return;
191  }
192 
193  if (!spill.DataQuality->GoodDaq) {
194  _POT_BadND280 += beam.POTSincePreviousSavedSpill;
195  _Spill_BadND280 += beam.SpillsSincePreviousSavedSpill;
196  return;
197  }
198 
199  if (beam.GoodSpill == 100) {
200  _POT_0KA += beam.POTSincePreviousSavedSpill;
201  } else if (beam.GoodSpill == 1) {
202  _POT_250KA += beam.POTSincePreviousSavedSpill;
203  } else if (beam.GoodSpill == 2) {
204  _POT_200KA += beam.POTSincePreviousSavedSpill;
205  } else if (beam.GoodSpill == -1) {
206  _POT_m250KA += beam.POTSincePreviousSavedSpill;
207  } else {
208  _POT_OtherKA += beam.POTSincePreviousSavedSpill;
209  }
210 
211  _POT_GoodBeamGoodND280 += beam.POTSincePreviousSavedSpill;
212  _Spill_GoodBeamGoodND280 += beam.SpillsSincePreviousSavedSpill;
213  }
214  else{
215  // For MC there is no information about magnet current, Spill and DQ are always good
216  _Spill_NoCut += beam.SpillsSincePreviousSavedSpill;
217  _Spill_GoodBeamGoodND280 += beam.SpillsSincePreviousSavedSpill;
218 
219  _POT_NoCut += beam.POTSincePreviousSavedSpill;
220  _POT_GoodBeamGoodND280 += beam.POTSincePreviousSavedSpill;
221  }
222 */
223 }

The documentation for this class was generated from the following files: