1 #include "numuBkgInAntiNuModeCCSelection.hxx" 2 #include "baseSelection.hxx" 3 #include "numuCCSelection.hxx" 4 #include "CutUtils.hxx" 5 #include "SubDetId.hxx" 6 #include "VersioningUtils.hxx" 7 #include "trackerSelectionUtils.hxx" 8 #include "EventBoxId.hxx" 12 numuBkgInAntiNuModeCCSelection::numuBkgInAntiNuModeCCSelection(
bool forceBreak):
SelectionBase(forceBreak,
EventBoxId::kEventBoxTracker) {
38 SetBranchAlias(0,
"trunk");
41 SetPreSelectionAccumLevel(2);
44 _MuonPIDCutIndex = GetCutNumber(
"Muon PID");
45 _MuonPIDStepIndex = GetStepNumber(
"Muon PID");
46 _FindLeadingTracksStepIndex = GetStepNumber(
"find leading tracks");
47 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
55 SetDetectorFV(SubDetId::kFGD1);
58 _numuCCSelection.SetDetectorFV(SubDetId::kFGD1);
62 bool numuBkgInAntiNuModeCCSelection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
66 if(allCutsPassed[0])
static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = SampleId::kFGD1NuMuBkgInAntiNuModeCC;
68 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
81 for(
int i = 0; i < 4; ++i){
111 return cutUtils::NumuBkgMuonPIDCut(*(box.
HMNtrack));
118 return _numuCCSelection.IsRelevantRecObjectForSystematic(event,track,systId,branch);
125 return _numuCCSelection.IsRelevantTrueObjectForSystematic(event,trueTrack,systId,branch);
138 if (systId==SystId::kFgdTrackEff)
140 else if (systId==SystId::kFgdHybridTrackEff)
142 else if (systId==SystId::kMichelEleEff)
144 else if (systId==SystId::kSIPion)
146 else if (systId==SystId::kSIProton)
155 _numuCCSelection.InitializeEvent(event);
176 if (!PreviousToyBox.
HMNtrack)
return false;
178 if (PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
180 trackerSelUtils::FindLeadingTracks(event, box);
190 redoFromStep = _FindLeadingTracksStepIndex;
202 bool pidCut = cutUtils::NumuBkgMuonPIDCut(*(PreviousToyBox.
HMNtrack));
203 if (( pidCut && (PreviousToyBox.
AccumLevel[0] == _MuonPIDCutIndex)) ||
204 (!pidCut && (PreviousToyBox.
AccumLevel[0] > _MuonPIDCutIndex))){
206 redoFromStep = _MuonPIDStepIndex;
AnaTrackB * SHMtrack
For storing the second highest momentum track.
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t PositionStart[4]
The reconstructed start position of the particle.
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
AnaTrackB * HMPtrack
For storing the highest momentum positive track.
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool Apply(AnaEventC &event, ToyBoxB &box) const
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Leading tracks with good quality in FGD1.
bool IsRelevantTrueObjectForSystematic(const AnaEventC &event, AnaTrueObjectC *trueObj, SystId_h systId, Int_t branch) const
Is this true track relevant for a given systematic (prior to selection, call when initializing the ev...
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
AnaTrackB * HMtrack
For storing the highest momentum track.
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
AnaTrackB * SHMNtrack
For storing the second highest momentum negative track.
void DefineSteps()
Define all steps in the selection.
Int_t * AccumLevel
Accum level for each branch in this toy in the selection this ToyBox belongs to.
Find the Vertex. For the moment it's just the Star position of the HM track.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
bool IsRelevantRecObjectForSystematic(const AnaEventC &event, AnaRecObjectC *recObj, SystId_h systId, Int_t branch) const
Is this track relevant for a given systematic (prior to selection, call when initializing the event...
A cut on event quality. Requires good beam and ND280 data quality flags.
void Initialize()
Initialize this selection: defines the steps and the detectorFV.