@@ -91,7 +91,7 @@ struct tpcPidQa {
9191 ConfigurableAxis nSigmaBins{" nSigmaBins" , {401 , -10 .025f , 10 .025f }, " Binning in NSigma" };
9292 ConfigurableAxis dEdxBins{" dEdxBins" , {5000 , 0 .f , 5000 .f }, " Binning in dE/dx" };
9393 Configurable<int > applyEvSel{" applyEvSel" , 2 , " Flag to apply event selection cut: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection" };
94- Configurable<bool > applyTrackCut{ " applyTrackCut " , false , " Flag to apply standard track cuts " };
94+ Configurable<int > trackSelection{ " trackSelection " , 1 , " Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks " };
9595 Configurable<bool > applyRapidityCut{" applyRapidityCut" , false , " Flag to apply rapidity cut" };
9696 Configurable<bool > splitSignalPerCharge{" splitSignalPerCharge" , true , " Split the signal per charge (reduces memory footprint if off)" };
9797 Configurable<bool > enableDeDxPlot{" enableDeDxPlot" , true , " Enables the dEdx plot (reduces memory footprint if off)" };
@@ -195,7 +195,6 @@ struct tpcPidQa {
195195
196196 void init (o2::framework::InitContext&)
197197 {
198- const AxisSpec multAxis{1000 , 0 .f , 1000 .f , " Track multiplicity" };
199198 const AxisSpec vtxZAxis{100 , -20 , 20 , " Vtx_{z} (cm)" };
200199 const AxisSpec etaAxis{etaBins, " #it{#eta}" };
201200 const AxisSpec phiAxis{phiBins, " #it{#phi}" };
@@ -213,8 +212,7 @@ struct tpcPidQa {
213212 auto h = histos.add <TH1 >(" event/evsel" , " " , kTH1F , {{10 , 0.5 , 10.5 , " Ev. Sel." }});
214213 h->GetXaxis ()->SetBinLabel (1 , " Events read" );
215214 h->GetXaxis ()->SetBinLabel (2 , " Passed ev. sel." );
216- h->GetXaxis ()->SetBinLabel (3 , " Passed mult." );
217- h->GetXaxis ()->SetBinLabel (4 , " Passed vtx Z" );
215+ h->GetXaxis ()->SetBinLabel (3 , " Passed vtx Z" );
218216
219217 h = histos.add <TH1 >(" event/trackselection" , " " , kTH1F , {{10 , 0.5 , 10.5 , " Selection passed" }});
220218 h->GetXaxis ()->SetBinLabel (1 , " Tracks read" );
@@ -227,7 +225,6 @@ struct tpcPidQa {
227225 for (int i = 0 ; i < 9 ; i++) {
228226 h->GetXaxis ()->SetBinLabel (i + 1 , PID::getName (i));
229227 }
230- histos.add (" event/trackmultiplicity" , " " , kTH1F , {multAxis});
231228 if (enableDeDxPlot) {
232229 if (splitSignalPerCharge) {
233230 histos.add (" event/tpcsignal" , " " , kTH3F , {pAxis, dedxAxis, chargeAxis});
@@ -270,24 +267,12 @@ struct tpcPidQa {
270267 histos.fill (HIST (" event/evsel" ), 2 );
271268 }
272269
273- // Computing Multiplicity first
274- int ntracks = 0 ;
275- if constexpr (fillHistograms) {
276- for (auto t : tracks) {
277- if (applyTrackCut && !t.isGlobalTrack ()) {
278- continue ;
279- }
280- ntracks += 1 ;
281- }
282- histos.fill (HIST (" event/evsel" ), 3 );
283- }
284270 if (abs (collision.posZ ()) > 10 .f ) {
285271 return false ;
286272 }
287273 if constexpr (fillHistograms) {
288- histos.fill (HIST (" event/evsel" ), 4 );
274+ histos.fill (HIST (" event/evsel" ), 3 );
289275 histos.fill (HIST (" event/vertexz" ), collision.posZ ());
290- histos.fill (HIST (" event/trackmultiplicity" ), ntracks);
291276 }
292277 return true ;
293278 }
@@ -336,10 +321,19 @@ struct tpcPidQa {
336321 return true ;
337322 }
338323
339- using CollisionCandidate = soa::Join<aod::Collisions, aod::EvSels>::iterator;
340- void process (CollisionCandidate const & collision,
341- soa::Join<aod::Tracks, aod::TracksExtra,
342- aod::TrackSelection> const & tracks)
324+ Filter eventFilter = (applyEvSel.node() == 0 ) ||
325+ ((applyEvSel.node() == 1 ) && (o2::aod::evsel::sel7 == true )) ||
326+ ((applyEvSel.node() == 2 ) && (o2::aod::evsel::sel8 == true ));
327+ Filter trackFilter = (trackSelection.node() == 0 ) ||
328+ ((trackSelection.node() == 1 ) && requireGlobalTrackInFilter()) ||
329+ ((trackSelection.node() == 2 ) && requireGlobalTrackWoPtEtaInFilter()) ||
330+ ((trackSelection.node() == 3 ) && requireGlobalTrackWoDCAInFilter()) ||
331+ ((trackSelection.node() == 4 ) && requireQualityTracksInFilter()) ||
332+ ((trackSelection.node() == 5 ) && requireInAcceptanceTracksInFilter());
333+ using CollisionCandidate = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator;
334+ using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection>;
335+ void process (soa::Filtered<CollisionCandidate> const & collision,
336+ soa::Filtered<TrackCandidates> const & tracks)
343337 {
344338 isEventSelected<true >(collision, tracks);
345339 for (auto t : tracks) {
@@ -413,13 +407,12 @@ struct tpcPidQa {
413407 }
414408
415409 // QA of nsigma only tables
416- #define makeProcessFunction (inputPid, particleId ) \
417- void process##particleId(CollisionCandidate const & collision, \
418- soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, \
419- inputPid> const & tracks) \
420- { \
421- processSingleParticle<PID ::particleId, false , false >(collision, tracks); \
422- } \
410+ #define makeProcessFunction (inputPid, particleId ) \
411+ void process##particleId(CollisionCandidate const & collision, \
412+ soa::Filtered<soa::Join<TrackCandidates, inputPid>> const & tracks) \
413+ { \
414+ processSingleParticle<PID ::particleId, false , false >(collision, tracks); \
415+ } \
423416 PROCESS_SWITCH (tpcPidQa, process##particleId, Form(" Process for the %s hypothesis for TPC NSigma QA" , #particleId), false );
424417
425418 makeProcessFunction (aod::pidTPCEl, Electron);
@@ -434,13 +427,12 @@ struct tpcPidQa {
434427#undef makeProcessFunction
435428
436429// QA of full tables
437- #define makeProcessFunction (inputPid, particleId ) \
438- void processFull##particleId(CollisionCandidate const & collision, \
439- soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, \
440- inputPid> const & tracks) \
441- { \
442- processSingleParticle<PID ::particleId, true , false >(collision, tracks); \
443- } \
430+ #define makeProcessFunction (inputPid, particleId ) \
431+ void processFull##particleId(CollisionCandidate const & collision, \
432+ soa::Filtered<soa::Join<TrackCandidates, inputPid>> const & tracks) \
433+ { \
434+ processSingleParticle<PID ::particleId, true , false >(collision, tracks); \
435+ } \
444436 PROCESS_SWITCH (tpcPidQa, processFull##particleId, Form(" Process for the %s hypothesis for full TPC PID QA" , #particleId), false );
445437
446438 makeProcessFunction (aod::pidTPCFullEl, Electron);
@@ -455,13 +447,13 @@ struct tpcPidQa {
455447#undef makeProcessFunction
456448
457449 // QA of full tables with TOF information
458- #define makeProcessFunction (inputPid, inputPidTOF, particleId ) \
459- void processFullWithTOF##particleId(CollisionCandidate const & collision, \
460- soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, inputPid, inputPidTOF> const & tracks) \
461- { \
462- processSingleParticle<PID ::particleId, true , true >(collision, tracks); \
463- } \
464- PROCESS_SWITCH (tpcPidQa, processFullWithTOF##particleId, Form(" Process for the %s hypothesis for full TPC PID QA" , #particleId), false );
450+ #define makeProcessFunction (inputPid, inputPidTOF, particleId ) \
451+ void processFullWithTOF##particleId(CollisionCandidate const & collision, \
452+ soa::Filtered<soa::Join<TrackCandidates, inputPid, inputPidTOF> > const & tracks) \
453+ { \
454+ processSingleParticle<PID ::particleId, true , true >(collision, tracks); \
455+ } \
456+ PROCESS_SWITCH (tpcPidQa, processFullWithTOF##particleId, Form(" Process for the %s hypothesis for full TPC PID QA with the TOF info added " , #particleId), false );
465457
466458 makeProcessFunction (aod::pidTPCFullEl, aod::pidTOFFullEl, Electron);
467459 makeProcessFunction (aod::pidTPCFullMu, aod::pidTOFFullMu, Muon);
0 commit comments