HighLAND
CT4POTCorrection.cxx
1 #include "CT4POTCorrection.hxx"
2 #include "Parameters.hxx"
3 #include "Versioning.hxx"
4 #include "DataClasses.hxx"
5 
6 //********************************************************************
7 CT4POTCorrection::CT4POTCorrection() : CorrectionBase() {
8 //********************************************************************
9  MRrunLower = ND::params().GetParameterI("highlandCorrections.CT4POTCorrection.MRrunLower");
10  MRrunUpper = ND::params().GetParameterI("highlandCorrections.CT4POTCorrection.MRrunUpper");
11 }
12 
13 //********************************************************************
15 //********************************************************************
16 
17 #if !VERSION_HAS_OFFICIAL_POT
18  AnaSpill* spill = static_cast<AnaSpill*>(&spillC);
19  AnaBeam* beam = static_cast<AnaBeam*>(spill->Beam);
20  int MRrun = beam->BeamRunNumber;
21 
22  if (spill->GetIsMC() && MRrun >= MRrunLower && MRrun <= MRrunUpper) {
23  beam->POT = beam->POTCT4;
24  }
25 #else
26  (void)spillC;
27 #endif
28 
29 }
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
Definition: Parameters.cxx:217
All corrections should be registered with the CorrectionManager.
Float_t POTCT4
The POT from CT4 for this spill. This is only needed for P5 files.
AnaBeamB * Beam
The beam quality flags for this spill.
Int_t BeamRunNumber
bool GetIsMC() const
Return whether this spill is from Monte Carlo or not.
void Apply(AnaSpillC &spill)
Apply the correction to the spill.
Representation of the beam information, including POT and quality.
Float_t POT
The POT for this spill. For data, this comes from the Beam Summary Data.