1 #include "numuCCBwdSelection.hxx" 3 #include "baseSelection.hxx" 4 #include "EventBoxUtils.hxx" 5 #include "VersioningUtils.hxx" 6 #include "SystematicUtils.hxx" 27 AddStep(StepBase::kCut,
"More than one node in second detector",
new numuCCBwd::NoShower() );
28 AddStep(StepBase::kCut,
"Positive time of flight",
new numuCCBwd::ToF() );
32 SetBranchAlias(0,
"Bwd muon");
47 return !(
static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample == SampleId::kFGD1NuMuCCBwd && box.
DetectorFV == SubDetId::kFGD2 );
53 bool numuCCBwdSelection::FillEventSummary(
AnaEventC& event, Int_t allCutsPassed[]){
57 static_cast<AnaEventSummaryB*
>(
event.Summary)->EventSample = GetSampleEnum();
59 return (static_cast<AnaEventSummaryB*>(event.
Summary)->EventSample != SampleId::kUnassigned);
70 if (!event.EventBoxes[EventBoxId::kEventBoxTracker])
73 boxUtils::FillTracksWithTPC( event );
74 boxUtils::FillTrajsChargedInTPC( event );
81 return SubDetId::kFGD1;
83 return SubDetId::kFGD2;
85 return SubDetId::kInvalid;
105 if(!track){
return false; }
108 if( track->
ToF.Flag_P0D_FGD1 ){
109 return track->
ToF.P0D_FGD1 > _P0D_FGD1;
110 }
else if(track->
ToF.Flag_ECal_FGD1){
111 return track->
ToF.ECal_FGD1 > _ECal_FGD1;
114 if( track->
ToF.Flag_FGD1_FGD2 ){
115 return track->
ToF.FGD1_FGD2 > _FGD1_FGD2;
116 }
else if(track->
ToF.Flag_ECal_FGD2){
117 return track->
ToF.ECal_FGD2 > _ECal_FGD2;
138 if(!track){
return false; }
145 std::cout<<
"Flag but no segment in P0D"<<std::endl;
150 std::cout<<
"Flag but no segment in ECal"<<std::endl;
157 std::cout<<
"Flag but no segment in FGD1"<<std::endl;
162 std::cout<<
"Flag but no segment in ECal"<<std::endl;
182 if(!track){
return false; }
184 bool available =
false;
186 available = track->
ToF.Flag_P0D_FGD1 || track->
ToF.Flag_ECal_FGD1;
187 }
else if( box.
DetectorFV == SubDetId::kFGD2 ){
188 available = track->
ToF.Flag_FGD1_FGD2 || track->
ToF.Flag_ECal_FGD2;
207 if(!track){
return false; }
209 Float_t PIDLikelihood[4];
212 if ( PIDLikelihood[0] > _muon_pid ){
238 box.
Vertex->nParticles = 0;
259 if( tpc_track->
NNodes > 18 ){
return true;}
270 if( numuCCBwd::EndsInFGDFV(*a) == SubDetId::kFGD1 ){
272 }
else if( numuCCBwd::EndsInFGDFV(*a) == SubDetId::kFGD2 ){
277 if( numuCCBwd::EndsInFGDFV(*b) == SubDetId::kFGD1 ){
279 }
else if( numuCCBwd::EndsInFGDFV(*b) == SubDetId::kFGD2 ){
283 if(!aTPC)
return false;
284 if(!bTPC)
return true;
306 EventBoxB* EventBox =
event.EventBoxes[EventBoxId::kEventBoxTracker];
307 AnaRecObjectC** selTracksNS = EventBox->RecObjectsInGroup[EventBoxTracker::kTracksWithTPC];
311 std::vector<AnaTrackB*> selTracksV;
312 for (Int_t i=0;i<nTPC; ++i){
313 selTracksV.push_back( static_cast<AnaTrackB*>(selTracksNS[i]) );
315 std::sort(selTracksV.begin(), selTracksV.end(), HMFirst);
320 std::copy(selTracksV.begin(), selTracksV.end(), selTracks);
325 for (Int_t i=0;i<nTPC; ++i){
328 if( numuCCBwd::EndsInFGDFV(*track) != box.
DetectorFV )
continue;
331 if ( ( box.
DetectorFV == SubDetId::kFGD1 && !numuCCBwd::TrackQualityCut(*track, SubDetId::kTPC1 ) )
332 || ( box.
DetectorFV == SubDetId::kFGD2 && !numuCCBwd::TrackQualityCut(*track, SubDetId::kTPC2 ) ) ){
383 (void)PreviousToyBox;
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
int nP0DSegments
How many P0D tracks are associated with this track.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrueVertexB * TrueVertex
AnaP0DParticleB * P0DSegments[NMAXP0DS]
The P0D segments that contributed to this global track.
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineSteps()
Define all steps in the selection.
AnaECALParticleB * ECALSegments[NMAXECALS]
The ECAL segments that contributed to this global track.
int nECALSegments
How many ECAL tracks are associated with this track.
bool CheckRedoSelection(const AnaEventC &event, const ToyBoxB &PreviousToyBox, Int_t &redoFromStep)
Event failed FGD1 selection when running FGD2 selection in a FGD1 + FGD2 analysis.
Float_t Position[4]
The identified position of the global vertex.
Int_t NNodes
The number of nodes in the reconstructed object.
SubDetId_h DetectorFV
Indicate the FV we are interested in.
bool Apply(AnaEventC &event, ToyBoxB &box) const
CUTS.
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
AnaTPCParticleB * TPCSegments[NMAXTPCS]
The TPC segments that contributed to this global track.
AnaToF ToF
Times of flight between pairs of detectors.
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
AnaTrueVertexB * TrueVertex
For storing the true vertex, for analyses with no reconstructed primary vertex.
Track has more than one node in ecal or p0d.
AnaParticleB * GetSegmentInDet(const AnaTrackB &track, SubDetId::SubDetEnum det)
bool TrackUsesDet(const AnaTrackB &track, SubDetId::SubDetEnum det)
Float_t Charge
The reconstructed charge of the particle.
bool Apply(AnaEventC &event, ToyBoxB &box) const
Float_t GetPIDLikelihood(const AnaTrackB &track, Int_t hypo, bool prod5Cut=0)
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.
bool IsRelevantSystematic(const AnaEventC &event, const ToyBoxB &box, SystId_h systId, Int_t branch) const
Is this systematic relevant for this selection.
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...
SubDetEnum
Enumeration of all detector systems and subdetectors.
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
Representation of a global track.
Representation of a TPC segment of a global track.
AnaParticleB ** Particles
Representation of a global vertex.
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.
AnaEventSummaryC * Summary
A summary of the event with high level quantities.
bool Apply(AnaEventC &event, ToyBoxB &box) const
int nFGDSegments
How many FGD tracks are associated with this track.
Muon candidate has a positive time of flight.
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)
AnaFGDParticleB * FGDSegments[NMAXFGDS]
The FGD segments that contributed to this global track.
A cut on event quality. Requires good beam and ND280 data quality flags.
Float_t PositionEnd[4]
The reconstructed end position of the particle.