From 618e8fcaf56003d75e2237394e136a32a528dbf1 Mon Sep 17 00:00:00 2001 From: Biao Zhang Date: Wed, 20 Jul 2022 00:23:21 +0800 Subject: [PATCH 1/2] DPG: add the flag for the specific track selection --- DPG/Tasks/qaEfficiency.cxx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/DPG/Tasks/qaEfficiency.cxx b/DPG/Tasks/qaEfficiency.cxx index 98e9d9d31b2..6f2b0be6312 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,18 @@ 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 +1175,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 +1332,10 @@ 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 +1358,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; } From acb604976301a53c220b477a2528ad7a1716446c Mon Sep 17 00:00:00 2001 From: Biao Zhang Date: Wed, 20 Jul 2022 00:35:37 +0800 Subject: [PATCH 2/2] DPG: add the flag for the specific track selection --- DPG/Tasks/qaEfficiency.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/DPG/Tasks/qaEfficiency.cxx b/DPG/Tasks/qaEfficiency.cxx index 6f2b0be6312..bd5b3382d9e 100644 --- a/DPG/Tasks/qaEfficiency.cxx +++ b/DPG/Tasks/qaEfficiency.cxx @@ -1102,7 +1102,6 @@ struct QaEfficiency { ((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, @@ -1332,7 +1331,6 @@ struct QaEfficiency { } } PROCESS_SWITCH(QaEfficiency, processMC, "process MC", false); - using TrackTableData = soa::Join; void processData(o2::soa::Join::iterator const& collision, soa::Filtered const& tracks)