1 #include "nueOOFVSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "ToyBoxTracker.hxx" 4 #include "BasicUtils.hxx" 5 #include "SubDetId.hxx" 6 #include "FiducialVolumeDefinition.hxx" 7 #include "VersioningUtils.hxx" 15 _fgd1 =
new BinnedParams(
"OOFV_reco_fgd1_p6B",BinnedParams::k1D_SYMMETRIC);
17 _fgd2 =
new BinnedParams(
"OOFV_reco_fgd2_p6B",BinnedParams::k1D_SYMMETRIC);
19 _rate =
new BinnedParams(
"nueOOFV_rate" ,BinnedParams::k1D_SYMMETRIC);
20 npars+=_rate->GetNBins();
24 for (
int i=0;i<9;i++){
25 if (!_fgd1->
GetBinValues(i, _reco_corr[0][i], _reco_error[0][i],_reco_index[0][i])) _reco_index[0][i]=-1;
26 if (!_fgd2->
GetBinValues(i, _reco_corr[1][i], _reco_error[1][i],_reco_index[1][i])) _reco_index[1][i]=-1;
28 if (_reco_index[0][i]>=0) _reco_index[0][i] += _rate->GetNBins();
29 if (_reco_index[1][i]>=0) _reco_index[1][i] += _rate->GetNBins();
84 double Zmin_lastmodule,zup,zdown;
90 fgd_det_min = DetDef::fgd1min;
91 fgd_det_max = DetDef::fgd1max;
92 Zmin_lastmodule = fgd_det_max[2]-DetDef::fgdXYModuleWidth;
99 fgd_det_min = DetDef::fgd2min;
100 fgd_det_max = DetDef::fgd2max;
101 Zmin_lastmodule = 1780;
105 else return eventWeight;
107 lastmodule=( pos[2] >Zmin_lastmodule && pos[2] < fgd_det_max[2]);
111 if ((tvertex[2] > fgd_det_min[2] && tvertex[2] < fgd_det_max[2]) &&
112 (tvertex[0] > fgd_det_min[0] && tvertex[0] < fgd_det_max[0]) &&
113 (tvertex[1] > fgd_det_min[1] && tvertex[1] < fgd_det_max[1]))
116 else if ((tvertex[2] > zup && tvertex[2] < fgd_det_min[2]) &&
117 (tvertex[0] > -1335 && tvertex[0] < 1335) &&
118 (tvertex[1] > -1280.5 && tvertex[1] < 1280.5))
121 else if((tvertex[2] > fgd_det_max[2] && tvertex[2] < zdown) &&
122 (tvertex[0] > -1335 && tvertex[0] < 1335) &&
123 (tvertex[1] > -1280.5 && tvertex[1] < 1280.5))
130 else if(tdir[2]<=-0.5)
133 else if(tdir[2]>-0.5 && tdir[2]<0.5)
136 else if(fabs(tdir[0]/tdir[2])<0.07 || fabs(tdir[1]/tdir[2])<0.07)
149 if (!_rate->GetBinValues(GetDetNumber(detector), _rate_corr[0][0], _rate_error[0][0],_rate_index[0][0])) _rate_index[0][0]=-1;
151 if (_reco_index[fgd][categ]>=0){
153 eventWeight.Correction *= (1+ _reco_corr[fgd][categ]);
155 if (_rate_index[0][0]>=0){
157 eventWeight.Correction *= (1+ _rate_corr[0][0]);
161 if (eventWeight.Systematic < 0) eventWeight.Systematic = 0;
Int_t _index
The index of this systematic (needed by SystematicsManager);.
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t PositionStart[4]
The reconstructed start position of the particle.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
Apply the systematic.
static bool IsFGDDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a FGD or not.
static bool IsP0DDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a SMRDP0D or not.
SubDetId_h DetectorFV
Indicate the FV we are interested in.
Int_t GParentPDG
The PDG code of this particle's grandparent, or 0 if there is no grandparent.
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
void SetNParameters(int N)
Set the number of systematic parameters associated to this systematic.
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
SubDetId::SubDetEnum GetDetector(const Float_t *pos)
Return the detector in which the position is.
static bool IsPECALDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a P0D ECAL or not.
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
Float_t Position[4]
The position the true interaction happened at.
static bool IsTPCDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a TPC or not.
static bool IsECALDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a ECAL or not.
SubDetEnum
Enumeration of all detector systems and subdetectors.
Int_t ParentPDG
The PDG code of this particle's immediate parent, or 0 if there is no parent.
static bool IsTECALDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a Tracker ECAL or not.
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
bool InDetVolume(SubDetId::SubDetEnum det, const Float_t *pos)
Float_t Position[4]
The initial position of the true particle.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
bool InFiducialVolume(SubDetId::SubDetEnum det, const Float_t *pos, const Float_t *FVdefmin, const Float_t *FVdefmax)
Float_t Direction[3]
The initial direction of the true particle.
Int_t GetNBins()
Get the number of bins.
static bool IsSMRDDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a SMRD or not.