1 #include "gammaSelection.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" 9 #include "SystematicTuning.hxx" 11 #include "nueCCUtils.hxx" 12 #include "nueCutUtils.hxx" 32 AddStep(StepBase::kAction,
"Find vertex",
new FillVertex() );
37 AddStep(StepBase::kCut,
"Highest Momentum Track Momentum cut",
new HighestMomentumCut() );
38 AddStep(StepBase::kCut,
"Electron PID",
new PIDCut_gamma() );
39 AddStep(StepBase::kAction,
"Find secondary tracks",
new FindPairsAction() );
41 AddStep(StepBase::kCut,
"Invariant Mass Cut",
new MinvCut_gamma() );
43 SetBranchAlias(0,
"Gamma Selection");
45 _FindLeadingTracksStepIndex = GetStepNumber(
"Find leading tracks");
46 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
48 _ElecPIDCutIndex = GetCutNumber(
"Electron PID");
49 _ElecPIDStepIndex = GetStepNumber(
"Electron PID");
54 SetPreSelectionAccumLevel(3);
63 SetDetectorFV(SubDetId::kFGD1);
66 _nueCCSelection.SetDetectorFV(SubDetId::kFGD1);
80 for(
int i = 0; i < 4; ++i){
93 bool gammaSelection::FillEventSummary(
AnaEventC& eventC, Int_t allCutsPassed[]){
100 return (static_cast<AnaEventSummaryB*>(eventC.
Summary)->EventSample != SampleId::kUnassigned);
110 trackerSelUtils::FindLeadingTracks(eventC, boxB);
141 if(!box.
Vertex)
return false;
144 if(!track)
return false;
146 return nueCutUtils::TrackQuality(track, _num_tpc_nodes, _num_tpc_nodes);
165 return (nueCCUtils::GetInvMass(*nuebox.
MainTrack, *nuebox.
PairTrack) < _inv_mass_min);
179 bool accept = nueCutUtils::TPCElectronPull(track_pri, _elepullpri_min, _elepullpri_max,
180 _elepullpri_min, _elepullpri_max, 0.0);
192 _nueCCSelection.InitializeEvent(eventC);
204 if(!PreviousToyBox.
HMtrack)
return false;
207 if(PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
209 trackerSelUtils::FindLeadingTracks(event, box);
219 redoFromStep = _FindLeadingTracksStepIndex;
229 redoFromStep = _ElecPIDStepIndex;
289 if(systId == SystId::kTpcClusterEff){
293 if(!tpcTrack)
return false;
310 return _nueCCSelection.IsRelevantTrueObjectForSystematic(event, trueTrack, systId, branch);
327 if(systId == SystId::kChargeIDEff){
348 if(systId == SystId::kTpcTrackEff){
363 else if (abs(truePart->
PDG) == 11)
return true;
367 else if(systId == SystId::kSIPion){
389 else if(systId == SystId::kSIProton){
420 if (systId == SystId::kTpcECalMatchEff)
422 else if(systId == SystId::kECalPID)
424 else if(systId == SystId::kECalEMResol)
426 else if(systId == SystId::kECalEMScale)
428 else if(systId == SystId::kNuETPCPileUp)
430 else if(systId == SystId::kNuEP0DPileUp)
432 else if(systId == SystId::kNuEECalPileUp)
436 return _nueCCSelection.IsRelevantSystematic(event, box, systId, branch);
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 DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
bool IsRelevantRecObjectForSystematicInToy(const AnaEventC &event, const ToyBoxB &boxB, AnaRecObjectC *recObj, SystId_h systId, Int_t branch) const
Is this track relevant for a given systematic (after selection, called for each toy) ...
Int_t NNodes
The number of nodes in the reconstructed object.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
Int_t GParentPDG
The PDG code of this particle's grandparent, or 0 if there is no grandparent.
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
void DefineSteps()
Define all steps in the selection.
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
bool CheckRedoSelection(const AnaEventC &eventC, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
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
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
Float_t Charge
The reconstructed charge of the particle.
Int_t ID
The ID of the trueObj, which corresponds to the ID of the TTruthParticle that created it...
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
AnaVertexB * Vertex
For storing the reconstructed vertex.
int nTPCSegments
How many TPC tracks are associated with this track.
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
Representation of a true Monte Carlo trajectory/particle.
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
Int_t PDG
The PDG code of this particle.
bool IsRelevantRecObjectForSystematic(const AnaEventC &event, AnaRecObjectC *trackRecC, SystId_h systId, Int_t branch) const
Is this track relevant for a given systematic (prior to selection, call when initializing the event...
AnaTrackB * HMNtrack
For storing the highest momentum negative track.
Int_t ParentPDG
The PDG code of this particle's immediate parent, or 0 if there is no parent.
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
Representation of a global track.
bool Apply(AnaEventC &eventC, ToyBoxB &boxB) const
AnaTrackB * HMtrack
For storing the highest momentum track.
Representation of a TPC segment of a global track.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
bool IsRelevantTrueObjectForSystematicInToy(const AnaEventC &event, const ToyBoxB &boxB, AnaTrueObjectC *trueObj, SystId_h systId, Int_t branch) const
Is this true track relevant for a given systematic (after selection, called for each toy) ...
AnaTrackB * SHMNtrack
For storing the second highest momentum negative track.
AnaTrackB * PairTrack
The particle that isn't HMTrackSelected that forms the e+e- pair with the lowest invariant mass...
AnaParticleB * GetSegmentWithMostNodesInClosestTpc(const AnaTrackB &track)
Combined function to address NuMu selection needs as efficiently as possible - gets the TPC segment w...
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
A cut on event quality. Requires good beam and ND280 data quality flags.
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...
void Initialize()
Initialize this selection: defines the steps and the detectorFV.