Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Common/Core/TrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class TrackSelection
kNCuts
};

enum GlobalTrackRun3ITSMatching {
Run3ITSibAny,
Run3ITSallAny,
Run3ITSall7Layers
};

static const std::string mCutNames[static_cast<int>(TrackCuts::kNCuts)];

// Temporary function to check if track passes selection criteria. To be replaced by framework filters.
Expand Down
38 changes: 38 additions & 0 deletions Common/Core/TrackSelectionDefaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -40,6 +41,43 @@ TrackSelection getGlobalTrackSelection()
return selectedTracks;
}

// Default track selection requiring a particular Run 3 ITS matching
TrackSelection getGlobalTrackSelectionITSMatch(int matching)
{
std::pair<int8_t, std::set<unsigned char>> itsMatching;
switch (matching) {
case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny:
itsMatching = std::make_pair((int8_t)1, (std::set<unsigned char>){0, 1, 2});
break;
case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny:
itsMatching = std::make_pair((int8_t)1, (std::set<unsigned char>){0, 1, 2, 3, 4, 5, 6});
break;
case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers:
itsMatching = std::make_pair((int8_t)7, (std::set<unsigned char>){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()
Expand Down
30 changes: 29 additions & 1 deletion Common/TableProducer/trackselection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> isRun3{"isRun3", false, "temp option to enable run3 mode"};
Configurable<int> itsMatching{"itsMatching", 0, "condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSibAny, 2: Run3ITSallAny, 3: Run3ITSall7Layers)"};

Produces<aod::TrackSelection> filterTable;

Expand All @@ -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) {
Expand Down