1 #include "P0dTrackerOOFVSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "BasicUtils.hxx" 4 #include "SubDetId.hxx" 5 #include "FiducialVolumeDefinition.hxx" 6 #include "VersioningUtils.hxx" 7 #include "ToyBoxTracker.hxx" 10 const double p0d_fv_minz = -2969;
11 const double p0d_fv_maxz = -1264;
14 P0dTrackerOOFVSystematics::P0dTrackerOOFVSystematics():
EventWeightBase(1){
17 _name =
"P0DCCQEOOFV";
20 sprintf(dirname,
"%s/data",getenv(
"P0DNUMUCCANALYSISROOT"));
23 _p0d->SetType(BinnedParams::k1D_SYMMETRIC);
24 _p0d->SetName(
"P0DCCOOFV_reco");
28 _rate->SetType(BinnedParams::k2D_SYMMETRIC);
29 _rate->SetName(
"P0DCCOOFV_rate");
32 npars = _p0d->GetNBins();
33 npars += _rate->GetNBins();
34 SetNParameters(npars);
35 for (
int i=0;i<9;i++){
36 if (!_p0d->GetBinValues(i, _reco_corr[i], _reco_error[i],_reco_index[i])) _reco_index[i]=-1;
38 if (_reco_index[i]>=0) _reco_index[i] += _rate->GetNBins();
45 Int_t P0dTrackerOOFVSystematics::GetBeamNumber(Int_t runperiod,
AnaTrackB *maintrack){
103 Float_t* p0d_det_min = DetDef::p0dmin;
104 Float_t* p0d_det_max = DetDef::p0dmax;
107 double Zmin_p0d_fv,Zmax_p0d_fv;
108 p0d_det_min = DetDef::p0dmin;
109 p0d_det_max = DetDef::p0dmax;
110 Zmin_p0d_fv = p0d_fv_minz;
111 Zmax_p0d_fv = p0d_fv_maxz;
142 if (!_rate->GetBinValues(GetBeamNumber(runPeriod,box.
MainTrack), GetDetNumber(detector), _rate_corr, _rate_error,_rate_index)) _rate_index=-1;
144 if (_reco_index[categ]>=0){
145 eventWeight.Systematic *= (1+ _reco_corr[categ] + _reco_error[categ]*toy.
GetToyVariations(_index)->
Variations[_reco_index[categ]]);
146 eventWeight.Correction *= (1+ _reco_corr[categ]);
150 eventWeight.Correction *= (1+ _rate_corr);
156 if (eventWeight.Systematic < 0) eventWeight.Systematic = 0;
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
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.
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
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.
Float_t Charge
The reconstructed charge of the particle.
virtual const ToyBoxTracker & box(Int_t isel=-1) const
Returns the ToyBoxTracker.
Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
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.
int GetRunPeriod(int run, int subrun=-1)
Returns the run period (sequentially: 0,1,2,3,4,5 ...)
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.
Representation of a global track.
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)
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)
static bool IsSMRDDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a SMRD or not.