From d9c68efc3354b7c6c0c47cd6b1d73a10b37c067f Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Mon, 12 Sep 2022 17:47:26 +0200 Subject: [PATCH 1/3] Add new default function with Run 3 ITS requirements. --- Common/Core/TrackSelection.h | 6 ++++ Common/Core/TrackSelectionDefaults.h | 39 +++++++++++++++++++++++++ Common/TableProducer/trackselection.cxx | 25 +++++++++++++++- 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/Common/Core/TrackSelection.h b/Common/Core/TrackSelection.h index 1bdbb6c64cb..f4b6521907a 100644 --- a/Common/Core/TrackSelection.h +++ b/Common/Core/TrackSelection.h @@ -46,6 +46,12 @@ class TrackSelection kNCuts }; + enum GlobalTrackRun3ITSMatching { + Run3ITSIBkAny, + Run3ITSallkAny, + Run3ITSall7Layers +}; + static const std::string mCutNames[static_cast(TrackCuts::kNCuts)]; // Temporary function to check if track passes selection criteria. To be replaced by framework filters. diff --git a/Common/Core/TrackSelectionDefaults.h b/Common/Core/TrackSelectionDefaults.h index 907963e24a4..eb58ccb1ab8 100644 --- a/Common/Core/TrackSelectionDefaults.h +++ b/Common/Core/TrackSelectionDefaults.h @@ -19,6 +19,7 @@ #define TrackSelectionDefaults_H #include "Framework/DataTypes.h" +#include "Common/Core/TrackSelection.h" // Default track selection requiring one hit in the SPD TrackSelection getGlobalTrackSelection() @@ -40,6 +41,44 @@ TrackSelection getGlobalTrackSelection() return selectedTracks; } +// Default track selection requiring a particular Run 3 ITS matching +TrackSelection getGlobalTrackSelectionITSMatch(int matching) +{ + std::pair> itsMatching; + switch (matching) + { + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny: + itsMatching = std::make_pair( (int8_t)1, (std::set){0, 1, 2} ); + break; + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny: + itsMatching = std::make_pair( (int8_t)1, (std::set){0, 1, 2, 3, 4, 5, 6} ); + break; + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers: + itsMatching = std::make_pair( (int8_t)7, (std::set){0, 1, 2, 3, 4, 5, 6} ); + break; + + default: + LOG(fatal) << "getGlobalTrackSelectionITSMatch with undefined ITS matching"; + break; + } + + TrackSelection selectedTracks; + selectedTracks.SetTrackType(o2::aod::track::Run2Track); + selectedTracks.SetPtRange(0.1f, 1e10f); + selectedTracks.SetEtaRange(-0.8f, 0.8f); + selectedTracks.SetRequireITSRefit(true); + selectedTracks.SetRequireTPCRefit(true); + selectedTracks.SetRequireGoldenChi2(true); + selectedTracks.SetMinNCrossedRowsTPC(70); + selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.8f); + selectedTracks.SetMaxChi2PerClusterTPC(4.f); + selectedTracks.SetRequireHitsInITSLayers(itsMatching.first, itsMatching.second); + selectedTracks.SetMaxChi2PerClusterITS(36.f); + selectedTracks.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); }); + selectedTracks.SetMaxDcaZ(2.f); + return selectedTracks; +} + // Default track selection requiring no hit in the SPD and one in the innermost // SDD -> complementary tracks to global selection TrackSelection getGlobalTrackSelectionSDD() diff --git a/Common/TableProducer/trackselection.cxx b/Common/TableProducer/trackselection.cxx index a1c9e63fa82..60882914641 100644 --- a/Common/TableProducer/trackselection.cxx +++ b/Common/TableProducer/trackselection.cxx @@ -37,6 +37,7 @@ using namespace o2::framework::expressions; struct TrackSelectionTask { // FIXME: this will be removed once we can get this via meta data Configurable isRun3{"isRun3", false, "temp option to enable run3 mode"}; + Configurable itsMatching{"itsMatching", 0, "condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSIBkAny, 2: Run3ITSallkAny, 3: Run3ITSall7Layers)"}; Produces filterTable; @@ -45,7 +46,29 @@ struct TrackSelectionTask { void init(InitContext&) { - globalTracks = getGlobalTrackSelection(); + switch (itsMatching) + { + case 0: + // Run 2 SPD kAny + globalTracks = getGlobalTrackSelection(); + break; + case 1: + // Run 3 kAny on 3 IB layers of ITS + if(isRun3) {globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny);} + break; + case 2: + // Run 3 kAny on all 7 layers of ITS + if(isRun3) {globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny);} + break; + case 3: + // Run 3 kAll on all 7 layers of ITS + if(isRun3) {globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers);} + break; + + default: + LOG(fatal) << "TrackSelectionTask with undefined cuts. Fix it!"; + break; + } globalTracksSDD = getGlobalTrackSelectionSDD(); if (isRun3) { From f1d349d858a9c98c24f82e5e172075f163e79d52 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Mon, 12 Sep 2022 18:03:15 +0200 Subject: [PATCH 2/3] Fix Clang format. --- Common/Core/TrackSelection.h | 8 ++-- Common/Core/TrackSelectionDefaults.h | 29 +++++++-------- Common/TableProducer/trackselection.cxx | 49 ++++++++++++++----------- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Common/Core/TrackSelection.h b/Common/Core/TrackSelection.h index f4b6521907a..c2d939b974c 100644 --- a/Common/Core/TrackSelection.h +++ b/Common/Core/TrackSelection.h @@ -47,10 +47,10 @@ class TrackSelection }; enum GlobalTrackRun3ITSMatching { - Run3ITSIBkAny, - Run3ITSallkAny, - Run3ITSall7Layers -}; + Run3ITSIBkAny, + Run3ITSallkAny, + Run3ITSall7Layers + }; static const std::string mCutNames[static_cast(TrackCuts::kNCuts)]; diff --git a/Common/Core/TrackSelectionDefaults.h b/Common/Core/TrackSelectionDefaults.h index eb58ccb1ab8..0c43b348b46 100644 --- a/Common/Core/TrackSelectionDefaults.h +++ b/Common/Core/TrackSelectionDefaults.h @@ -45,21 +45,20 @@ TrackSelection getGlobalTrackSelection() TrackSelection getGlobalTrackSelectionITSMatch(int matching) { std::pair> itsMatching; - switch (matching) - { - case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny: - itsMatching = std::make_pair( (int8_t)1, (std::set){0, 1, 2} ); - break; - case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny: - itsMatching = std::make_pair( (int8_t)1, (std::set){0, 1, 2, 3, 4, 5, 6} ); - break; - case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers: - itsMatching = std::make_pair( (int8_t)7, (std::set){0, 1, 2, 3, 4, 5, 6} ); - break; - - default: - LOG(fatal) << "getGlobalTrackSelectionITSMatch with undefined ITS matching"; - break; + switch (matching) { + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny: + itsMatching = std::make_pair((int8_t)1, (std::set){0, 1, 2}); + break; + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny: + itsMatching = std::make_pair((int8_t)1, (std::set){0, 1, 2, 3, 4, 5, 6}); + break; + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers: + itsMatching = std::make_pair((int8_t)7, (std::set){0, 1, 2, 3, 4, 5, 6}); + break; + + default: + LOG(fatal) << "getGlobalTrackSelectionITSMatch with undefined ITS matching"; + break; } TrackSelection selectedTracks; diff --git a/Common/TableProducer/trackselection.cxx b/Common/TableProducer/trackselection.cxx index 60882914641..58b68c5e777 100644 --- a/Common/TableProducer/trackselection.cxx +++ b/Common/TableProducer/trackselection.cxx @@ -46,28 +46,33 @@ struct TrackSelectionTask { void init(InitContext&) { - switch (itsMatching) - { - case 0: - // Run 2 SPD kAny - globalTracks = getGlobalTrackSelection(); - break; - case 1: - // Run 3 kAny on 3 IB layers of ITS - if(isRun3) {globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny);} - break; - case 2: - // Run 3 kAny on all 7 layers of ITS - if(isRun3) {globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny);} - break; - case 3: - // Run 3 kAll on all 7 layers of ITS - if(isRun3) {globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers);} - break; - - default: - LOG(fatal) << "TrackSelectionTask with undefined cuts. Fix it!"; - break; + switch (itsMatching) { + case 0: + // Run 2 SPD kAny + globalTracks = getGlobalTrackSelection(); + break; + case 1: + // Run 3 kAny on 3 IB layers of ITS + if (isRun3) { + globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny); + } + break; + case 2: + // Run 3 kAny on all 7 layers of ITS + if (isRun3) { + globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny); + } + break; + case 3: + // Run 3 kAll on all 7 layers of ITS + if (isRun3) { + globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers); + } + break; + + default: + LOG(fatal) << "TrackSelectionTask with undefined cuts. Fix it!"; + break; } globalTracksSDD = getGlobalTrackSelectionSDD(); From ea8a225b85f36cd4e04f8bbb8980181537f6e473 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 13 Sep 2022 08:57:19 +0200 Subject: [PATCH 3/3] Apply coding conventions for the enum. --- Common/Core/TrackSelection.h | 4 ++-- Common/Core/TrackSelectionDefaults.h | 4 ++-- Common/TableProducer/trackselection.cxx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Common/Core/TrackSelection.h b/Common/Core/TrackSelection.h index c2d939b974c..57180014869 100644 --- a/Common/Core/TrackSelection.h +++ b/Common/Core/TrackSelection.h @@ -47,8 +47,8 @@ class TrackSelection }; enum GlobalTrackRun3ITSMatching { - Run3ITSIBkAny, - Run3ITSallkAny, + Run3ITSibAny, + Run3ITSallAny, Run3ITSall7Layers }; diff --git a/Common/Core/TrackSelectionDefaults.h b/Common/Core/TrackSelectionDefaults.h index 0c43b348b46..9ca58235b44 100644 --- a/Common/Core/TrackSelectionDefaults.h +++ b/Common/Core/TrackSelectionDefaults.h @@ -46,10 +46,10 @@ TrackSelection getGlobalTrackSelectionITSMatch(int matching) { std::pair> itsMatching; switch (matching) { - case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny: + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny: itsMatching = std::make_pair((int8_t)1, (std::set){0, 1, 2}); break; - case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny: + case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny: itsMatching = std::make_pair((int8_t)1, (std::set){0, 1, 2, 3, 4, 5, 6}); break; case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers: diff --git a/Common/TableProducer/trackselection.cxx b/Common/TableProducer/trackselection.cxx index 58b68c5e777..1b5d92d2601 100644 --- a/Common/TableProducer/trackselection.cxx +++ b/Common/TableProducer/trackselection.cxx @@ -37,7 +37,7 @@ using namespace o2::framework::expressions; struct TrackSelectionTask { // FIXME: this will be removed once we can get this via meta data Configurable isRun3{"isRun3", false, "temp option to enable run3 mode"}; - Configurable itsMatching{"itsMatching", 0, "condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSIBkAny, 2: Run3ITSallkAny, 3: Run3ITSall7Layers)"}; + Configurable itsMatching{"itsMatching", 0, "condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSibAny, 2: Run3ITSallAny, 3: Run3ITSall7Layers)"}; Produces filterTable; @@ -54,13 +54,13 @@ struct TrackSelectionTask { case 1: // Run 3 kAny on 3 IB layers of ITS if (isRun3) { - globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSIBkAny); + globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny); } break; case 2: // Run 3 kAny on all 7 layers of ITS if (isRun3) { - globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallkAny); + globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny); } break; case 3: