1 #include "antiNumuCCSelection.hxx" 2 #include "baseSelection.hxx" 3 #include "SystematicTuning.hxx" 4 #include "CutUtils.hxx" 5 #include "EventBoxUtils.hxx" 6 #include "SubDetId.hxx" 8 #include "VersioningUtils.hxx" 9 #include "SystematicUtils.hxx" 10 #include "trackerSelectionUtils.hxx" 13 antiNumuCCSelection::antiNumuCCSelection(
bool forceBreak):
SelectionBase(forceBreak,
EventBoxId::kEventBoxTracker) {
20 systTuning::Initialize();
42 SetBranchAlias(0,
"trunk");
45 SetPreSelectionAccumLevel(2);
48 _MuonPIDCutIndex = GetCutNumber(
"Anti muon PID");
49 _MuonPIDStepIndex = GetStepNumber(
"Anti muon PID");
50 _FindLeadingTracksStepIndex = GetStepNumber(
"find leading tracks");
51 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
59 SetDetectorFV(SubDetId::kFGD1);
63 bool antiNumuCCSelection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
67 if(allCutsPassed[0])
static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = SampleId::kFGD1AntiNuMuCC;
69 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
82 for(
int i = 0; i < 4; ++i){
97 trackerSelUtils::FindLeadingTracks(event, box);
126 return cutUtils::AntiMuonPIDCut(*(box.
HMPtrack));
133 return _numuCCSelection.IsRelevantRecObjectForSystematic(event,track,systId,branch);
140 return _numuCCSelection.IsRelevantTrueObjectForSystematic(event,trueTrack,systId,branch);
147 return _numuCCSelection.IsRelevantRecObjectForSystematicInToy(event,box,track,systId,branch);
165 if(systId == SystId::kTpcTrackEff){
177 else if (trueTrack->
PDG == -13)
183 else if (systId == SystId::kSIProton){
190 && trueTrack->
Momentum > 1000.)
return true;
196 return _numuCCSelection.IsRelevantTrueObjectForSystematicInToy(event,boxB,trueObj,systId,branch);
206 if (systId == SystId::kFluxWeightNu)
210 if (systId == SystId::kFluxWeightAntiNu)
214 return _numuCCSelection.IsRelevantSystematic(event, box, systId, branch);
222 _numuCCSelection.InitializeEvent(event);
243 if (!PreviousToyBox.
HMPtrack)
return false;
245 if (PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
247 trackerSelUtils::FindLeadingTracks(event, box);
257 redoFromStep = _FindLeadingTracksStepIndex;
270 bool pidCut = cutUtils::AntiMuonPIDCut(*(PreviousToyBox.
HMPtrack));
271 if (( pidCut && (PreviousToyBox.
AccumLevel[0] == _MuonPIDCutIndex)) ||
272 (!pidCut && (PreviousToyBox.
AccumLevel[0] > _MuonPIDCutIndex))){
273 redoFromStep = _MuonPIDStepIndex;
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.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
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 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) ...
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
Float_t Momentum
The initial momentum of the true particle.
AnaTrackB * HMPtrack
For storing the highest momentum positive track.
Int_t ID
The ID of the trueObj, which corresponds to the ID of the TTruthParticle that created it...
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.
Representation of a true Monte Carlo trajectory/particle.
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
Int_t PDG
The PDG code of this particle.
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
AnaTrackB * HMtrack
For storing the highest momentum track.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
bool APPLY_SYST_FINE_TUNING
General tuning, the concept of apply the systematic for only the "relevant" objects.
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrackB * SHMNtrack
For storing the second highest momentum negative track.
Int_t * AccumLevel
Accum level for each branch in this toy in the selection this ToyBox belongs to.
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
Find the Vertex. For the moment it's just the Star position of the HM track.
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...
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) ...
void DefineSteps()
Define all steps in the selection.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
A cut on event quality. Requires good beam and ND280 data quality flags.
void Initialize()
Initialize this selection: defines the steps and the detectorFV.