1 #include "p0dCCQEOOFVSystematics.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;
17 _name =
"P0DCCQEOOFV";
20 sprintf(dirname,
"%s/data",getenv(
"P0DNUMUCCQEANALYSISROOT"));
23 _p0d->
SetType(BinnedParams::k1D_SYMMETRIC);
24 _p0d->
SetName(
"P0DCCQEOOFV_reco");
28 _rate->
SetType(BinnedParams::k2D_SYMMETRIC);
29 _rate->
SetName(
"P0DCCQEOOFV_rate");
35 for (
int i=0;i<9;i++){
38 if (_reco_index[i]>=0) _reco_index[i] += _rate->
GetNBins();
45 Int_t p0dCCQEOOFVSystematics::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;
144 if (_reco_index[categ]>=0){
146 eventWeight.Correction *= (1+
_reco_corr[categ]);
156 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 * 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.
void SetType(TypeEnum type)
Set the type.
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.
void SetName(const std::string &name)
Set the name.
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.
Float_t _rate_corr
Mean of the rate correction.
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
Float_t _reco_corr[9]
Mean of the reco eff correction.
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.
void Read(const std::string &inputDirName, const std::string &extension="")
Read from a file the systematic source values.
Representation of a global track.
Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
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)
Float_t _rate_error
Uncertainty on the rate correction.
Float_t _reco_error[9]
Uncertainty on the reco eff correction.
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)
std::string _name
The name of this systematic.
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.