1 #include "TPCTrackEffSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "EventBoxTracker.hxx" 4 #include "BasicUtils.hxx" 5 #include "SystematicUtils.hxx" 6 #include "SubDetId.hxx" 8 #include "Parameters.hxx" 68 if (tpcnum == SubDetId::kTPC2) tpc_rec=2;
69 else if (tpcnum == SubDetId::kTPC3) tpc_rec=3;
70 else if (tpcnum == SubDetId::kTPC1) tpc_rec=1;
77 if (tpcnum == SubDetId::kTPC2) tpc_rec=2;
78 else if (tpcnum == SubDetId::kTPC3) tpc_rec=3;
79 else if (tpcnum == SubDetId::kTPC1) tpc_rec=1;
84 if(tpc_true==tpc_rec)
break;
86 if(tpc_true==tpc_rec && tpc_rec>-1) found=
true;
87 if(tpc_rec==-1) tpc_rec=tpc_true;
91 if(!
GetBinValues((Float_t)tpc_rec, params, index))
continue;
97 eventWeight *= systUtils::ComputeEffLikeWeight(found, toy,
GetIndex(), index, params);
115 if(truePart.
Charge==0)
return false;
118 if( truePart.
Momentum < 60. )
return false;
125 if( length < 180. )
return false;
129 Float_t dist=-9999999;
134 if(sep>dist) dist=sep;
139 if((dist)<900)
return false;
169 IDs[0] = EventBoxTracker::kTracksWithTPC;
179 IDs[0] = EventBoxTracker::kTrueParticlesChargedInTPCInBunch;
bool InActive
If the particle passes through an active part of the subdetector.
Int_t GetIndex() const
Return the index of this systematic.
int nDetCrossings
The number of DetCrossing objects.
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
Float_t ExitPosition[4]
for each subdetector tell the exit position
bool _full_correlations
value of psycheSystematics.Tracker.FullCorrelations parameter
Int_t SelectionEnabledIndex
The enabled index of this selection this ToyBox belongs to.
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.
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
AnaTPCParticleB * TPCSegments[NMAXTPCS]
The TPC segments that contributed to this global track.
void SetNParameters(int N)
Set the number of systematic parameters associated to this systematic.
bool _computecounters
The systematic source parameters.
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
Float_t Momentum
The initial momentum of the true particle.
bool CheckTrueRecoAssociation(const AnaTrueObjectC &trueTrack, const AnaRecObjectC &track) const
Check the true-reco association.
float GetSeparationSquared(const Float_t *pos1, const Float_t *pos2)
Calculate the distance between two points.
Int_t ID
The ID of the trueObj, which corresponds to the ID of the TTruthParticle that created it...
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.
int nTPCSegments
How many TPC tracks are associated with this track.
Representation of a true Monte Carlo trajectory/particle.
Int_t GetRelevantTrueObjectGroups(const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
Get the TrueTrackGroup IDs array for this systematic.
Float_t EntrancePosition[4]
for each subdetector tell the entrance position
Int_t SuccessfulBranch
The branch that is successful for this toy in the selection this ToyBox belongs to.
AnaDetCrossingB ** DetCrossings
SubDetEnum
Enumeration of all detector systems and subdetectors.
Int_t PDG
The PDG code of this particle.
Int_t ParentPDG
The PDG code of this particle's immediate parent, or 0 if there is no parent.
Representation of a global track.
Int_t nRelevantTrueObjects
Array of Relevant True RecObjects for each systematic.
static SubDetId::SubDetEnum GetSubdetectorEnum(unsigned long BitField)
Get the single subdetector that this track is from.
Representation of a TPC segment of a global track.
TPCTrackEffSystematics(bool computecounters=false)
Int_t GetRelevantRecObjectGroups(const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
Get the TrackGroup IDs array for this systematic.
Float_t GetTrueLinearLengthInTPC(const AnaTrueParticleB &trueTrack, Float_t &distz)
Return the true linear length traversed in the TPC.
bool IsRelevantTrueObject(const AnaEventC &event, const AnaTrueObjectC &trueTrack) const
Is this true track relevant for this systematic ?
Int_t nRelevantRecObjects
----—— Relevant rec objects and true objects for each systematic ------------—— ...
void InitializeEfficiencyCounter()
Initialize counters.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
Float_t Charge
The true charge of the particle.
virtual bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaTrueObjectC *, SystId_h syst_index, Int_t branch=0) const
Is this true track relevant for a given systematic (after selection, called for each toy) ...
Weight_h ComputeWeight(const ToyExperiment &, const AnaEventC &, const ToyBoxB &)
Int_t GetNBins()
Get the number of bins.