1 #include "antiNueCCSelection.hxx" 2 #include "nueCCFGD2Selection.hxx" 3 #include "antiNueCCFGD2Selection.hxx" 5 #include "baseSelection.hxx" 6 #include "CutUtils.hxx" 7 #include "EventBoxUtils.hxx" 8 #include "VersioningUtils.hxx" 9 #include "SystematicUtils.hxx" 10 #include "trackerSelectionUtils.hxx" 12 #include "nueCCUtils.hxx" 13 #include "nueCutUtils.hxx" 14 #include "SystematicTuning.hxx" 17 antiNueCCFGD2Selection::antiNueCCFGD2Selection(
bool forceBreak):
SelectionBase(forceBreak,
EventBoxId::kEventBoxTracker) {
24 _protonregion_low = (Float_t)ND::params().GetParameterD(
"psycheSelections.antiNueCCAnalysis.Analysis.ProtonMomentumRegion.Low");
27 systTuning::Initialize();
35 SetDetectorFV(SubDetId::kFGD2);
37 _nueCCSelection.SetDetectorFV(SubDetId::kFGD2);
50 AddStep(StepBase::kAction,
"Fill vertex info",
new FillVertex());
74 AddStep(StepBase::kAction,
"find best e+e- pair",
new FindPairsAction());
75 AddStep(StepBase::kCut,
"Pair Veto",
new PairCut());
81 AddStep(StepBase::kCut,
"Ecal Veto",
new ECalVetoCut());
94 SetBranchAlias(0,
"trunk");
99 SetPreSelectionAccumLevel(3);
101 _FindLeadingTracksStepIndex = GetStepNumber(
"find leading tracks");
102 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
104 _ElecPIDCutIndex = GetCutNumber(
"TPC Electron Pull");
105 _ElecPIDStepIndex = GetStepNumber(
"TPC Electron Pull");
109 bool antiNueCCFGD2Selection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
113 static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = SampleId::kFGD2AntiNuECC;
115 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
128 for(Int_t i = 0; i < 4; ++i)
140 return _nueCCSelection.IsRelevantRecObjectForSystematic(eventC, recObj, systId, branch);
147 return _nueCCSelection.IsRelevantTrueObjectForSystematic(eventC, trueObj, systId, branch);
160 if(systId == SystId::kECalEmHipPID){
162 if (track != box.
MainTrack)
return false;
164 if(!nueCCUtils::UseEcal(track))
return false;
166 if(track->
Momentum < _protonregion_low)
return false;
171 return _nueCCSelection.IsRelevantRecObjectForSystematicInToy(eventC, boxB, recObj, systId, branch);
178 if(systId == SystId::kSIProton){
188 && trueTrack->
Momentum > _protonregion_low)
return true;
191 return _nueCCSelection.IsRelevantTrueObjectForSystematicInToy(eventC, boxB, trueObj, systId, branch);
199 if(systId == SystId::kECalEmHipPID)
return true;
202 return _nueCCSelection.IsRelevantSystematic(eventC, boxB, systId, branch);
218 if(PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
220 trackerSelUtils::FindLeadingTracks(event, box);
230 redoFromStep = _FindLeadingTracksStepIndex;
246 redoFromStep = _ElecPIDStepIndex;
258 _nueCCSelection.InitializeEvent(eventC);
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 CheckRedoSelection(const AnaEventC &eventC, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaTrueObjectC *, SystId_h systId, Int_t branch=0) const
Is this true track relevant for a given systematic (after selection, called for each toy) ...
bool IsRelevantTrueObjectForSystematic(const AnaEventC &event, AnaTrueObjectC *trueTrack, SystId_h systId, Int_t branch) const
Is this true track relevant for a given systematic (prior to selection, call when initializing the ev...
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
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 IsRelevantRecObjectForSystematic(const AnaEventC &event, AnaRecObjectC *track, SystId_h systId, Int_t branch) const
Is this track relevant for a given systematic (prior to selection, call when initializing the event...
void DefineSteps()
Define all steps in the selection.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Representation of a true Monte Carlo trajectory/particle.
bool IsRelevantRecObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaRecObjectC *, SystId_h systId, Int_t branch=0) const
Is this track relevant for a given systematic (after selection, called for each toy) ...
Int_t PDG
The PDG code of this particle.
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
Representation of a global track.
AnaTrackB * HMtrack
For storing the highest momentum track.
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
AnaTrackB * SHMNtrack
For storing the second highest momentum negative track.
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
bool Apply(AnaEventC &event, ToyBoxB &box) const
A cut on event quality. Requires good beam and ND280 data quality flags.
void Initialize()
Initialize this selection: defines the steps and the detectorFV.