1 #include "FGDHybridTrackEffSystematics.hxx" 2 #include "ND280AnalysisUtils.hxx" 3 #include "EventBoxTracker.hxx" 4 #include "SystematicUtils.hxx" 5 #include "ToyBoxTracker.hxx" 7 #include "EventBoxId.hxx" 11 FGDHybridTrackEffSystematics::FGDHybridTrackEffSystematics(
bool comp):
EventWeightBase(1){
14 _computecounters=comp;
15 _fgd1 =
new BinnedParams(
"FGD1HybridTrackEff_p6B",BinnedParams::k2D_EFF_ASSYMMETRIC);
16 _fgd2 =
new BinnedParams(
"FGD2HybridTrackEff_p6B",BinnedParams::k2D_EFF_ASSYMMETRIC);
20 _fgd1->InitializeEfficiencyCounter();
21 _fgd2->InitializeEfficiencyCounter();
39 _fgd1->InitializeEfficiencyCounter();
40 _fgd2->InitializeEfficiencyCounter();
44 if(!maintrack)
return eventWeight;
61 Float_t pdg=(Float_t)trueTrack->
PDG;
62 bool found = (recoTrack);
67 if(!_fgd1->GetBinValues(fabs(pdg),costheta, params, index))
continue;
70 _fgd1->UpdateEfficiencyCounter(index,found);
73 if(!_fgd2->GetBinValues(fabs(pdg),costheta, params, index))
continue;
75 _fgd2->UpdateEfficiencyCounter(index,found);
78 else return eventWeight;
80 eventWeight *= systUtils::ComputeEffLikeWeight(
true, toy,
GetIndex(), index, params);
91 EventBoxB* EventBox =
event.EventBoxes[EventBoxId::kEventBoxTracker];
96 AnaRecObjectC* track = EventBox->RecObjectsInGroup[EventBoxTracker::kTracksWithTPC][i];
110 if (det == SubDetId::kFGD1){
111 IDs[0] = EventBoxTracker::kTracksWithFGD1AndNoTPC;
114 else if (det == SubDetId::kFGD2){
115 IDs[0] = EventBoxTracker::kTracksWithFGD2AndNoTPC;
118 else if (det == SubDetId::kFGD){
119 IDs[0] = EventBoxTracker::kTracksWithFGD1AndNoTPC;
120 IDs[1] = EventBoxTracker::kTracksWithFGD2AndNoTPC;
133 if (det == SubDetId::kFGD1){
134 IDs[0] = EventBoxTracker::kTrueParticlesChargedInFGD1AndNoTPCInBunch;
137 else if (det == SubDetId::kFGD2){
138 IDs[0] = EventBoxTracker::kTrueParticlesChargedInFGD2AndNoTPCInBunch;
141 else if (det == SubDetId::kFGD){
142 IDs[0] = EventBoxTracker::kTrueParticlesChargedInFGD1AndNoTPCInBunch;
143 IDs[1] = EventBoxTracker::kTrueParticlesChargedInFGD2AndNoTPCInBunch;
Weight_h ComputeWeight(const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
Int_t GetRelevantTrueObjectGroups(const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
Get the TrueTrackGroup IDs array for this systematic.
Int_t GetIndex() const
Return the index of this systematic.
Int_t SelectionEnabledIndex
The enabled index of this selection this ToyBox belongs to.
virtual bool CheckTrueRecoAssociation(const AnaTrueObjectC &trueRecObject, const AnaRecObjectC &track) const
Criteria for true-reco association for this systematic.
SubDetId_h DetectorFV
Indicate the FV we are interested in.
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
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.
Int_t nRecObjectsInGroup[NMAXRECOBJECTGROUPS]
----—— RecObjects and TrueRecObjects used in the selection and systematics ------------—— ...
Representation of a true Monte Carlo trajectory/particle.
Int_t SuccessfulBranch
The branch that is successful for this toy in the selection this ToyBox belongs to.
Int_t PDG
The PDG code of this particle.
Representation of a global track.
Int_t nRelevantTrueObjects
Array of Relevant True RecObjects for each systematic.
bool IsRelevantTrueObject(const AnaEventC &event, const AnaTrueObjectC &trueTrack) const
Is this true track relevant for this systematic ?
Float_t DirectionStart[3]
The reconstructed start direction of the particle.
AnaRecObjectC ** RelevantTrueObjectsReco
Int_t GetRelevantRecObjectGroups(const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
Get the TrackGroup IDs array for this systematic.
Float_t ScalarProduct(Float_t *array1, Float_t *array2, Int_t size=3)
Scalar product of two Float_t arrays. Provided their size.
Float_t Direction[3]
The initial direction of the true particle.
SubDetId_h GetDetectorFV(Int_t ibranch=0) const
Get the detector in which the Fiducial Volume is defined.