1 #include "TPCECalMatchEffSystematics.hxx" 2 #include "CutUtils.hxx" 3 #include "SystematicUtils.hxx" 10 SystBoxTPCECalMatchEff::SystBoxTPCECalMatchEff(){
13 RelevantTrueECalDetCrossed = NULL;
17 SystBoxTPCECalMatchEff::~SystBoxTPCECalMatchEff(){
20 if (RelevantTrueECalDetCrossed)
21 delete [] RelevantTrueECalDetCrossed;
22 RelevantTrueECalDetCrossed = NULL;
26 TPCECalMatchEffSystematics::TPCECalMatchEffSystematics(
bool comp):
BinnedParams(
"TPCECalMatchEff",k3D_EFF_ASSYMMETRIC){
29 _computecounters=comp;
42 uniqueID =
event.UniqueID;
52 if(
_systBoxes[isel][ibranch][uniqueID])
return;
69 uniqueID =
event.UniqueID;
81 if (box.RelevantTrueECalDetCrossed)
delete box.RelevantTrueECalDetCrossed;
88 box.RelevantTrueECalDetCrossed[itrk] = SubDetId::kInvalid;
90 if (!trueTrack)
continue;
95 box.RelevantTrueECalDetCrossed[itrk] = det[0];
118 std::cout <<
"TPCECalMatchEffSystematics::Apply(): " << SystBox->
nRelevantTrueObjects<< std::endl;
128 if (!truePart || !recoTrack)
continue;
137 if (ecal_det==SubDetId::kInvalid)
continue;
142 if (!tpcTrack)
continue;
147 int pdg = truePart->
PDG;
158 else if(pdg == -2212)
175 std::cout<<
"tpc-ecal found "<< found<<
" eventWeight "<<eventWeight<<std::endl;
202 if(necal_det!=1)
return false;
218 if (!cutUtils::TrackQualityCut(*static_cast<const AnaTrackB*>(&track)))
return false;
228 if (det == SubDetId::kFGD1){
229 IDs[0] = EventBoxTracker::kTracksWithTPCAndFGD1;
232 else if (det == SubDetId::kFGD2){
233 IDs[0] = EventBoxTracker::kTracksWithTPCAndFGD2;
236 else if (det == SubDetId::kFGD){
237 IDs[0] = EventBoxTracker::kTracksWithTPCAndFGD1;
238 IDs[1] = EventBoxTracker::kTracksWithTPCAndFGD2;
253 IDs[0] = EventBoxTracker::kTrueParticlesChargedInTPCInBunch;
Int_t _index
The index of this systematic (needed by SystematicsManager);.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
int GetECalDetCrossed(const AnaTrueParticleB *track, SubDetId::SubDetEnum det[])
ECal detectors crossed: split based on geom info PECal and TECal sub-detectors, this may not be very ...
Int_t SelectionEnabledIndex
The enabled index of this selection this ToyBox belongs to.
bool IsRelevantRecObject(const AnaEventC &event, const AnaRecObjectC &track) const
Is this track relevant for this systematic ?
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
void SetNParameters(int N)
Set the number of systematic parameters associated to this systematic.
Int_t GetRelevantRecObjectGroups(const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
Get the TrackGroup IDs array for this systematic.
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
Weight_h ComputeWeight(const ToyExperiment &, const AnaEventC &, const ToyBoxB &)
Apply the systematic.
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.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
virtual void FillSystBox(const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
Fills the SystBox.
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.
SubDetEnum
Enumeration of all detector systems and subdetectors.
Int_t PDG
The PDG code of this particle.
virtual void InitializeEvent(const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
Initialize the SystBox for this event.
Representation of a global track.
Int_t nRelevantTrueObjects
Array of Relevant True RecObjects for each systematic.
static bool IsTECALDetector(SubDetId::SubDetEnum det)
Check if a detector enumeration refers to a Tracker ECAL or not.
Representation of a TPC segment of a global track.
bool IsRelevantTrueObject(const AnaEventC &event, const AnaTrueObjectC &track) const
Is this track relevant for this systematic ?
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
AnaRecObjectC ** RelevantTrueObjectsReco
Int_t GetRelevantTrueObjectGroups(const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
Get the TrueTrackGroup IDs array for this systematic.
Float_t PositionEnd[4]
The end position of the true particle.
void InitializeEfficiencyCounter()
Initialize counters.
AnaParticleB * GetSegmentWithMostNodesInClosestTpc(const AnaTrackB &track)
Combined function to address NuMu selection needs as efficiently as possible - gets the TPC segment w...
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) ...
SystBoxB **** _systBoxes
----—— Relevant objects for this systematic ------------——
void FillSystBox(const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
Fills the SystBox.
Int_t GetNBins()
Get the number of bins.
SubDetId_h GetDetectorFV(Int_t ibranch=0) const
Get the detector in which the Fiducial Volume is defined.
Int_t GetEnabledIndex() const
Get the Selection index.