1 #include "antiNueCCSelection.hxx" 3 #include "baseSelection.hxx" 4 #include "CutUtils.hxx" 5 #include "EventBoxUtils.hxx" 6 #include "VersioningUtils.hxx" 7 #include "SystematicUtils.hxx" 8 #include "trackerSelectionUtils.hxx" 10 #include "nueCCUtils.hxx" 11 #include "nueCutUtils.hxx" 12 #include "SystematicTuning.hxx" 15 antiNueCCSelection::antiNueCCSelection(
bool forceBreak):
SelectionBase(forceBreak,
EventBoxId::kEventBoxTracker) {
21 _protonregion_low = (Float_t)ND::params().GetParameterD(
"psycheSelections.antiNueCCAnalysis.Analysis.ProtonMomentumRegion.Low");
24 systTuning::Initialize();
32 SetDetectorFV(SubDetId::kFGD1);
35 _nueCCSelection.SetDetectorFV(SubDetId::kFGD1);
46 AddStep(StepBase::kAction,
"Fill vertex info",
new FillVertex());
66 AddStep(StepBase::kCut,
"TPC Veto",
new TPCVetoCut());
70 AddStep(StepBase::kAction,
"find best e+e- pair",
new FindPairsAction());
71 AddStep(StepBase::kCut,
"Pair Veto",
new PairCut());
74 AddStep(StepBase::kCut,
"P0D Veto",
new P0DVetoCut());
77 AddStep(StepBase::kCut,
"Ecal Veto",
new ECalVetoCut());
90 SetBranchAlias(0,
"trunk");
96 SetPreSelectionAccumLevel(3);
98 _FindLeadingTracksStepIndex = GetStepNumber(
"find leading tracks");
99 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
101 _ElecPIDCutIndex = GetCutNumber(
"TPC Electron Pull");
102 _ElecPIDStepIndex = GetStepNumber(
"TPC Electron Pull");
106 bool antiNueCCSelection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
110 if(allCutsPassed[0])
static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = SampleId::kFGD1AntiNuECC;
112 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
125 for(
int i = 0; i < 4; ++i)
138 return _nueCCSelection.IsRelevantRecObjectForSystematic(event, recObj, systId, branch);
145 return _nueCCSelection.IsRelevantTrueObjectForSystematic(event, trueObj, systId, branch);
158 if(systId == SystId::kECalEmHipPID){
160 if (track != box.
MainTrack)
return false;
162 if(!nueCCUtils::UseEcal(track))
return false;
164 if(track->
Momentum < _protonregion_low)
return false;
168 else if(systId == SystId::kFGD2Shower){
170 if (track != box.
MainTrack)
return false;
173 if(track->
Momentum < _protonregion_low)
return false;
176 if(nueCCUtils::UseEcal(track)){
177 if(nueCutUtils::FGD2ShowerActivityEcal(track, _protonregion_low, box.FGD2ShowerNFGD1TPC2Tracks, box.
FGD2ShowerNFGD2TPC3Tracks))
186 return _nueCCSelection.IsRelevantRecObjectForSystematicInToy(event, boxB, recObj, systId, branch);
193 if(systId == SystId::kSIProton){
203 && trueTrack->
Momentum > _protonregion_low)
return true;
206 return _nueCCSelection.IsRelevantTrueObjectForSystematicInToy(event, boxB, trueObj, systId, branch);
214 if(systId == SystId::kECalEmHipPID)
return true;
215 if(systId == SystId::kFGD2Shower)
return true;
218 return _nueCCSelection.IsRelevantSystematic(event, boxB, systId, branch);
234 if(PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
236 trackerSelUtils::FindLeadingTracks(event, box);
246 redoFromStep = _FindLeadingTracksStepIndex;
262 redoFromStep = _ElecPIDStepIndex;
274 _nueCCSelection.InitializeEvent(eventC);
284 trackerSelUtils::FindLeadingTracks(event,boxB);
316 if(!track)
return false;
319 if(track != nuebox.
HMtrack)
return false;
338 if(!track)
return false;
340 return nueCutUtils::AntiNuSecondTPCPID(track, _protonregion_low, _protonregion_high, _pullelec_reject_min, _pullelec_reject_max);
353 if(!track)
return false;
355 return nueCutUtils::EcalEMEnergy(track, _Ethreshold, _Emin_ecal, _EoverP,
true);
369 if(!track)
return false;
372 if(nueCutUtils::FGD2ShowerActivityEcal(track, _protonregion_low, box.FGD2ShowerNFGD1TPC2Tracks, box.
FGD2ShowerNFGD2TPC3Tracks))
380 if(run < 8 || run == 13)
381 return nueCutUtils::EOverP(track, _protonregion_low, _eoverpfhc);
383 return nueCutUtils::EOverP(track, _protonregion_low, _eoverp);
396 if(!track)
return false;
399 if(nueCutUtils::FGD2ShowerActivityEcal(track, _protonregion_low, box.FGD2ShowerNFGD1TPC2Tracks, box.
FGD2ShowerNFGD2TPC3Tracks))
407 if(run < 8 || run == 13)
408 return (nueCutUtils::EcalEMHIPPID(track, _protonregion_low, _emhipfhc));
410 return (nueCutUtils::EcalEMHIPPID(track, _protonregion_low, _emhip));
423 if(!track)
return false;
425 return (nueCutUtils::FGD2Shower(track, _protonregion_low, _protonregion_high, box.FGD2ShowerNFGD1TPC2Tracks, box.
FGD2ShowerNFGD2TPC3Tracks));
438 if(!track)
return false;
445 return (nueCutUtils::AntiNuToF(*track, _fgdecaltof, _fgd1fgd2tof, _protonregion_low, run));
AnaTrackB * SHMtrack
For storing the second highest momentum track.
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 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 Apply(AnaEventC &event, ToyBoxB &boxB) const
bool CheckRedoSelection(const AnaEventC &eventC, const ToyBoxB &PreviousToyBoxB, Int_t &redoFromStep)
bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaTrueObjectC *, SystId_h systId, Int_t branch) const
Is this true track relevant for a given systematic (after selection, called for each toy) ...
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
Int_t FGD2ShowerNFGD2TPC3Tracks
FGD2 shower.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
Float_t Momentum
The initial momentum of the true particle.
AnaTrackB * HMPtrack
For storing the highest momentum positive track.
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
AnaEventInfoB EventInfo
Run, sunrun, event, time stamp, etc.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
Int_t SubRun
The subrun number.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Representation of a true Monte Carlo trajectory/particle.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
int GetRunPeriod(int run, int subrun=-1)
Returns the run period (sequentially: 0,1,2,3,4,5 ...)
Int_t PDG
The PDG code of this particle.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
Representation of a global track.
AnaTrackB * HMtrack
For storing the highest momentum track.
AnaTrackB * SecondMostEnergeticTPCTrack
The second most energetic TPC track.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
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...
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
void DefineSteps()
Define all steps in the selection.
AnaTrackB * SHMNtrack
For storing the second highest momentum negative track.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
void InitializeEvent(AnaEventC &eventC)
Fill the EventBox with the objects needed by this selection.
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
bool IsRelevantRecObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaRecObjectC *, SystId_h systId, Int_t branch) const
Is this track relevant for a given systematic (after selection, called for each toy) ...
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &boxB, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
A cut on event quality. Requires good beam and ND280 data quality flags.
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
void Initialize()
Initialize this selection: defines the steps and the detectorFV.
Int_t Run
The ND280 run number.