diff --git a/Common/Core/TrackSelection.h b/Common/Core/TrackSelection.h index 1bdbb6c64cb..57180014869 100644 --- a/Common/Core/TrackSelection.h +++ b/Common/Core/TrackSelection.h @@ -46,6 +46,12 @@ class TrackSelection kNCuts }; + enum GlobalTrackRun3ITSMatching { + Run3ITSibAny, + Run3ITSallAny, + 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..9ca58235b44 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,43 @@ 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::Run3ITSibAny: + itsMatching = std::make_pair((int8_t)1, (std::set){0, 1, 2}); + break; + 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: + 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..1b5d92d2601 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: Run3ITSibAny, 2: Run3ITSallAny, 3: Run3ITSall7Layers)"}; Produces filterTable; @@ -45,7 +46,34 @@ 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::Run3ITSibAny); + } + break; + case 2: + // Run 3 kAny on all 7 layers of ITS + if (isRun3) { + globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny); + } + 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) {