1 #include "gammaFGD2Selection.hxx" 2 #include "gammaSelection.hxx" 4 #include "baseSelection.hxx" 5 #include "CutUtils.hxx" 6 #include "EventBoxUtils.hxx" 7 #include "VersioningUtils.hxx" 8 #include "SystematicUtils.hxx" 9 #include "trackerSelectionUtils.hxx" 10 #include "SystematicTuning.hxx" 12 #include "nueCCUtils.hxx" 13 #include "nueCutUtils.hxx" 16 gammaFGD2Selection::gammaFGD2Selection(
bool forceBreak):
SelectionBase(forceBreak,
EventBoxId::kEventBoxTracker) {
33 AddStep(StepBase::kAction,
"Find vertex",
new FillVertex() );
38 AddStep(StepBase::kCut,
"Highest Momentum Track Momentum cut",
new HighestMomentumCut() );
39 AddStep(StepBase::kCut,
"Electron PID",
new PIDCut_gamma() );
40 AddStep(StepBase::kAction,
"Find secondary tracks",
new FindPairsAction() );
42 AddStep(StepBase::kCut,
"Invariant Mass Cut",
new MinvCut_gamma() );
46 SetBranchAlias(0,
"Gamma Selection");
48 _FindLeadingTracksStepIndex = GetStepNumber(
"Find leading tracks");
49 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
51 _ElecPIDCutIndex = GetCutNumber(
"Electron PID");
52 _ElecPIDStepIndex = GetStepNumber(
"Electron PID");
57 SetPreSelectionAccumLevel(3);
68 AnaTrackB* MainTrackFGD1 = nueCCUtils::FindLeadingTrackInDet(event, SubDetId::kFGD1);
76 std::cout <<
"nuebox.VetoTrack already used!" << std::endl;
78 nuebox.
VetoTrack = nueCCUtils::FindPairTrack(event, *MainTrackFGD1, _delta_pos_max, _pullel_min, _pullel_max);
103 SetDetectorFV(SubDetId::kFGD2);
106 _nueCCSelection.SetDetectorFV(SubDetId::kFGD2);
110 bool gammaFGD2Selection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
115 static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = SampleId::kFGD2Gamma;
117 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
125 _nueCCSelection.InitializeEvent(eventC);
141 if(systId == SystId::kTpcClusterEff){
145 if(!tpcTrack)
return false;
161 return _nueCCSelection.IsRelevantTrueObjectForSystematic(eventC, trueObj, systId, branch);
178 if(systId == SystId::kChargeIDEff){
198 if(systId == SystId::kTpcTrackEff){
221 else if(systId == SystId::kSIPion){
243 else if(systId == SystId::kSIProton){
277 if (systId == SystId::kFgdTrackEff)
279 else if(systId == SystId::kFgdHybridTrackEff)
281 else if(systId == SystId::kMichelEleEff)
283 else if(systId == SystId::kSIPion){
287 else if(systId == SystId::kSIProton){
291 else if(systId == SystId::kECalTrackEff)
293 else if(systId == SystId::kTpcECalMatchEff)
295 else if(systId == SystId::kECalEmHipPID)
297 else if(systId == SystId::kFGD2Shower)
299 else if(systId == SystId::kECalPID)
301 else if(systId == SystId::kNuETPCPileUp)
303 else if(systId == SystId::kNuEP0DPileUp)
305 else if(systId == SystId::kNuEECalPileUp)
307 else if(systId == SystId::kPileUp)
309 else if(systId == SystId::kOOFV)
325 if(!PreviousToyBox.
HMtrack)
return false;
328 if(PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
330 trackerSelUtils::FindLeadingTracks(event, box);
340 redoFromStep = _FindLeadingTracksStepIndex;
350 redoFromStep = _ElecPIDStepIndex;
AnaTrackB * SHMtrack
For storing the second highest momentum track.
bool Apply(AnaEventC &event, ToyBoxB &boxB) const
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) ...
bool CheckRedoSelection(const AnaEventC &eventC, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
Int_t NNodes
The number of nodes in the reconstructed object.
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)
AnaTrueObjectC * TrueObject
The link to the true oject that most likely generated this reconstructed object.
Float_t Momentum
The initial momentum of the true particle.
AnaTrackB * HMPtrack
For storing the highest momentum positive track.
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) ...
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.
int nTPCSegments
How many TPC tracks are associated with this track.
Representation of a true Monte Carlo trajectory/particle.
AnaTrackB * VetoTrack
The TPC veto track.
Int_t PDG
The PDG code of this particle.
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.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
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.
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.
Representation of a TPC segment of a global track.
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.
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.
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
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...
A cut on event quality. Requires good beam and ND280 data quality flags.
void Initialize()
Initialize this selection: defines the steps and the detectorFV.