1 #include "numuCCSelection.hxx" 2 #include "baseSelection.hxx" 3 #include "SystematicTuning.hxx" 4 #include "CutUtils.hxx" 5 #include "EventBoxUtils.hxx" 6 #include "VersioningUtils.hxx" 7 #include "SystematicUtils.hxx" 8 #include "trackerSelectionUtils.hxx" 37 systTuning::Initialize();
59 AddStep(StepBase::kCut,
"muon PID",
new MuonPIDCut());
61 SetBranchAlias(0,
"trunk");
66 SetPreSelectionAccumLevel(2);
69 _MuonPIDCutIndex = GetCutNumber(
"muon PID");
70 _MuonPIDStepIndex = GetStepNumber(
"muon PID");
71 _FindLeadingTracksStepIndex = GetStepNumber(
"find leading tracks");
72 _TotalMultiplicityCutIndex = GetCutNumber(
"> 0 tracks ");
80 SetDetectorFV(SubDetId::kFGD1);
84 bool numuCCSelection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
88 static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = SampleId::kFGD1NuMuCC;
90 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
102 EventBoxB* EventBox =
event.EventBoxes[EventBoxId::kEventBoxTracker];
129 return cutUtils::MuonPIDCut(*(box.
MainTrack), _prod5Cut);
179 box.
Vertex->nParticles = 0;
182 for(
int i = 0; i < 4; ++i){
201 for(
int i = 0; i < 4; ++i){
218 trackerSelUtils::FindLeadingTracks(event,box);
262 if (systId == SystId::kFgdPid){
265 else if(systId == SystId::kTpcClusterEff){
269 if (!tpcTrack)
return false;
288 if (systId == SystId::kTpcTrackEff){
291 else if (systId == SystId::kFgdTrackEff){
294 else if (systId == SystId::kFgdHybridTrackEff){
321 case SystId::kChargeIDEff:
323 case SystId::kTpcFgdMatchEff:
328 case SystId::kTpcClusterEff:
332 cutUtils::FiducialCut(trackb->
PositionStart, static_cast<SubDetId::SubDetEnum>(GetDetectorFV())) &&
366 if(systId == SystId::kTpcTrackEff){
378 else if (trueTrack->
PDG == 13)
383 else if(systId == SystId::kSIPion){
398 else if(systId == SystId::kSIProton){
434 case SystId::kChargeIDEff:
435 case SystId::kTpcClusterEff:
436 case SystId::kTpcTrackEff:
438 case SystId::kTpcFgdMatchEff:
440 case SystId::kPileUp:
441 case SystId::kFgdMass:
443 case SystId::kSandMu:
445 case SystId::kFluxWeightNu:
447 case SystId::kSIPion:
448 case SystId::kSIProton:
466 if (!event.EventBoxes[EventBoxId::kEventBoxTracker])
467 event.EventBoxes[EventBoxId::kEventBoxTracker] =
new EventBoxTracker();
469 boxUtils::FillTracksWithTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
470 boxUtils::FillTracksWithFGD(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
471 boxUtils::FillTrajsChargedInTPC(event);
472 boxUtils::FillTrajsChargedInFGDAndNoTPC(event, static_cast<SubDetId::SubDetEnum>(GetDetectorFV()));
495 if (!PreviousToyBox.
HMNtrack)
return false;
513 if (PreviousToyBox.
MaxAccumLevel > _TotalMultiplicityCutIndex){
515 trackerSelUtils::FindLeadingTracks(event, box);
525 redoFromStep = _FindLeadingTracksStepIndex;
537 bool pidCut = cutUtils::MuonPIDCut(*(PreviousToyBox.
HMNtrack), !versionUtils::prod6_systematics);
538 if (( pidCut && (PreviousToyBox.
AccumLevel[0] == _MuonPIDCutIndex)) ||
539 (!pidCut && (PreviousToyBox.
AccumLevel[0] > _MuonPIDCutIndex))){
541 redoFromStep = _MuonPIDStepIndex;
AnaTrackB * SHMtrack
For storing the second highest momentum 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...
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
Float_t PositionStart[4]
The reconstructed start position of the particle.
AnaTrueVertexB * TrueVertex
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Float_t Position[4]
The identified position of the global vertex.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Int_t NNodes
The number of nodes in the reconstructed object.
SubDetId_h DetectorFV
Indicate the FV we are interested in.
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)
bool Apply(AnaEventC &event, ToyBoxB &box) const
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.
AnaTrueVertexB * TrueVertex
For storing the true vertex, for analyses with no reconstructed primary vertex.
AnaTrackB * HMPtrack
For storing the highest momentum positive track.
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...
bool Apply(AnaEventC &event, ToyBoxB &box) const
Int_t nRecObjectsInGroup[NMAXRECOBJECTGROUPS]
----—— RecObjects and TrueRecObjects used in the selection and systematics ------------—— ...
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.
Representation of a true Monte Carlo trajectory/particle.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Leading tracks with good quality in FGD1.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrackB * VetoTrack
For storing the 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.
AnaTrackB * SHMPtrack
For storing the second highest momentum positive track.
Representation of a global track.
AnaTrackB * HMtrack
For storing the highest momentum track.
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) ...
Representation of a TPC segment of a global track.
AnaParticleB ** Particles
Representation of a global vertex.
bool APPLY_SYST_FINE_TUNING
General tuning, the concept of apply the systematic for only the "relevant" objects.
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...
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
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.
Float_t Position[4]
The initial position of the true particle.
Find the Vertex. For the moment it's just the Star position of the HM track.
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool Apply(AnaEventC &event, ToyBoxB &box) const
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.
bool InFiducialVolume(SubDetId::SubDetEnum det, const Float_t *pos, const Float_t *FVdefmin, const Float_t *FVdefmax)
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
bool TrackUsesOnlyDet(const AnaTrackB &track, SubDetId::SubDetEnum det)
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) ...
A cut on event quality. Requires good beam and ND280 data quality flags.
AnaTrackB * OOFVtrack
For storing the oofv fgd tracks.
bool Apply(AnaEventC &event, ToyBoxB &box) const
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)