1 #include "MichelElectronEffSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "EventBoxTracker.hxx" 4 #include "ToyBoxTracker.hxx" 5 #include "SubDetId.hxx" 7 #include "EventBoxId.hxx" 8 #include "SystematicUtils.hxx" 9 #include "Parameters.hxx" 10 #include "VersioningUtils.hxx" 15 _computecounters=comp;
18 _fgd1eff =
new BinnedParams(
"FGD1MichelElectronEff", BinnedParams::k1D_EFF_SYMMETRIC, versionUtils::Extension());
20 _fgd1pur =
new BinnedParams(
"FGD1MichelElectronPur", BinnedParams::k1D_EFF_SYMMETRIC, versionUtils::Extension());
22 if(versionUtils::prod6_systematics){
23 _fgd2eff =
new BinnedParams(
"FGD2MichelElectronEff", BinnedParams::k1D_EFF_SYMMETRIC, versionUtils::Extension());
25 _fgd2pur =
new BinnedParams(
"FGD2MichelElectronPur", BinnedParams::k1D_EFF_SYMMETRIC, versionUtils::Extension());
32 if(versionUtils::prod6_systematics){
40 _prod5Cut = ND::params().
GetParameterI(
"psycheSystematics.Prod5Cuts");
56 if(versionUtils::prod6_systematics){
70 if (trueNME<0 ) trueNME=0;
76 UInt_t NME=EventBox->nFGDMichelElectrons[box.
DetectorFV];
79 Int_t effindex,purindex;
81 bool dopur=
false; _fgd1pur->
GetBinValues((
float)runPeriod, purparams, purindex);
83 doeff= _fgd1eff->
GetBinValues((
float)runPeriod, effparams, effindex);
84 dopur= _fgd1pur->
GetBinValues((
float)runPeriod, purparams, purindex);
88 if(versionUtils::prod6_systematics){
89 doeff= _fgd2eff->
GetBinValues((
float)runPeriod, effparams, effindex);
90 dopur= _fgd2pur->
GetBinValues((
float)runPeriod, purparams, purindex);
96 bool found= ( NME>0 );
99 eventWeight *= systUtils::ComputeEffLikeWeight(found, toy,
GetIndex(), 0, effparams);
101 if(_computecounters){
104 else if(box.
DetectorFV == SubDetId::kFGD2 && versionUtils::prod6_systematics)
111 bool found = (trueNME>0);
114 eventWeight *= systUtils::ComputeEffLikeWeight(found, toy,
GetIndex(), purindex, purparams);
116 if(_computecounters){
119 else if(box.
DetectorFV == SubDetId::kFGD2 && versionUtils::prod6_systematics)
AnaTrueVertexB * TrueVertex
Int_t GetIndex() const
Return the index of this systematic.
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
Int_t GetNMichelElectrons(const AnaTrueVertexB &trueVertex, SubDetId::SubDetEnum det=SubDetId::kFGD1)
Get the number of true michel electrons.
SubDetId_h DetectorFV
Indicate the FV we are interested in.
void SetNParameters(int N)
Set the number of systematic parameters associated to this systematic.
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
bool UpdateEfficiencyCounter(Int_t index, bool correct)
Update the efficiency variables _ncorrect and _nwrong.
AnaVertexB * Vertex
For storing the reconstructed vertex.
int GetRunPeriod(int run, int subrun=-1)
Returns the run period (sequentially: 0,1,2,3,4,5 ...)
MichelElectronEffSystematics(bool computecounters=false)
void InitializeEfficiencyCounter()
Initialize counters.
Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
Int_t GetNBins()
Get the number of bins.