diff --git a/DPG/Tasks/qaEfficiency.cxx b/DPG/Tasks/qaEfficiency.cxx index 98e9d9d31b2..bd5b3382d9e 100644 --- a/DPG/Tasks/qaEfficiency.cxx +++ b/DPG/Tasks/qaEfficiency.cxx @@ -31,7 +31,9 @@ #include "TEfficiency.h" #include "TList.h" +using namespace o2; using namespace o2::framework; +using namespace o2::framework::expressions; struct QaEfficiency { // Particle information @@ -63,8 +65,8 @@ struct QaEfficiency { Configurable doTr{"do-tr", false, "Flag to run with the PDG code of tritons"}; Configurable doHe{"do-he", false, "Flag to run with the PDG code of helium 3"}; Configurable doAl{"do-al", false, "Flag to run with the PDG code of helium 4"}; - // Track only selection - Configurable applyTrackSelection{"applyTrackSelection", false, "Flag to use the standard track selection when selecting numerator and denominator"}; + // options to select only specific tracks + Configurable trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; // Event selection Configurable nMinNumberOfContributors{"nMinNumberOfContributors", 2, "Minimum required number of contributors to the primary vertex"}; Configurable vertexZMin{"vertex-z-min", -10.f, "Minimum position of the generated vertez in Z (cm)"}; @@ -1094,10 +1096,17 @@ struct QaEfficiency { isCollisionSelected(collision); } + Filter trackFilter = (trackSelection.node() == 0) || + ((trackSelection.node() == 1) && requireGlobalTrackInFilter()) || + ((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) || + ((trackSelection.node() == 3) && requireGlobalTrackWoDCAInFilter()) || + ((trackSelection.node() == 4) && requireQualityTracksInFilter()) || + ((trackSelection.node() == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); // MC process + using TrackTableMC = soa::Join; void processMC(const o2::aod::McParticles& mcParticles, const o2::soa::Join& collisions, - const o2::soa::Join& tracks, + soa::Filtered const& tracks, const o2::aod::McCollisions&) { @@ -1165,7 +1174,7 @@ struct QaEfficiency { } histos.fill(HIST("MC/trackSelection"), 10); - if (applyTrackSelection && !track.isGlobalTrack()) { // Check general cuts + if (trackSelection < 0) { // Check general cuts continue; } histos.fill(HIST("MC/trackSelection"), 11); @@ -1322,9 +1331,9 @@ struct QaEfficiency { } } PROCESS_SWITCH(QaEfficiency, processMC, "process MC", false); - + using TrackTableData = soa::Join; void processData(o2::soa::Join::iterator const& collision, - const o2::soa::Join& tracks) + soa::Filtered const& tracks) { if (!isCollisionSelected(collision)) { @@ -1347,7 +1356,7 @@ struct QaEfficiency { continue; } histos.fill(HIST("Data/trackSelection"), 4); - if (applyTrackSelection) { // Check general cuts + if (trackSelection > 0) { // Check general cuts if (!track.passedTrackType()) { continue; }