HighLAND
SandMuonsSystematics.cxx
1 #include "SandMuonsSystematics.hxx"
2 #include "ND280AnalysisUtils.hxx"
3 //********************************************************************
4 SandMuonsSystematics::SandMuonsSystematics():BinnedParams("SandMuons",k1D_SYMMETRIC,versionUtils::Extension()){
5 //********************************************************************
6  SetNParameters(GetNBins());
7 }
8 
9 //********************************************************************
11 //********************************************************************
12 
13  (void)box;
14 
15  Weight_h eventWeight=1;
16 
17  const AnaEventB& event = *static_cast<const AnaEventB*>(&eventBB);
18 
19  if(!event.GetIsSandMC() ) return eventWeight;
20 
21  // Get the sand MC mode (from 0 to 2)
22  int sandMode = anaUtils::GetSandMode(event.EventInfo.Run);
23  Float_t sand_corr,sand_corr_error;
24  Int_t index;
25  // Get the sand muons correction values for this run period
26  if (!GetBinValues(sandMode, sand_corr, sand_corr_error,index)) return eventWeight;
27 
28  // compute the weight
29  eventWeight.Systematic = 1 + sand_corr + sand_corr_error * toy.GetToyVariations(_index)->Variations[index];
30  eventWeight.Correction = 1 + sand_corr;
31  // std::cout<<sandMode<<" "<<eventWeight<<std::endl;
32  return eventWeight;
33 }
34 
Int_t _index
The index of this systematic (needed by SystematicsManager);.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
void SetNParameters(int N)
Set the number of systematic parameters associated to this systematic.
Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
int GetSandMode(int run)
Returns the sans muon modes (sequentially: 0,1,2)