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
3 changes: 3 additions & 0 deletions Analysis/Core/include/Analysis/TrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class TrackSelection : public TObject
(track.tpcChi2NCl() < mMaxChi2PerClusterTPC) &&
((mRequireITSRefit) ? (track.flags() & 0x4) : true) &&
((mRequireTPCRefit) ? (track.flags() & 0x40) : true) &&
((mRequireTOF) ? ((track.flags() & 0x2000) && (track.flags() & 0x80000000)) : true) &&
FulfillsITSHitRequirements(track.itsClusterMap()) &&
abs(track.dcaXY()) < mMaxDcaXY && abs(track.dcaZ()) < mMaxDcaZ) {
return true;
Expand All @@ -63,6 +64,7 @@ class TrackSelection : public TObject
{
mRequireTPCRefit = requireTPCRefit;
}
void SetRequireTOF(bool requireTOF = true) { mRequireTOF = requireTOF; }
void SetMinNClustersTPC(int minNClustersTPC)
{
mMinNClustersTPC = minNClustersTPC;
Expand Down Expand Up @@ -131,6 +133,7 @@ class TrackSelection : public TObject

bool mRequireITSRefit; // require refit in ITS
bool mRequireTPCRefit; // require refit in TPC
bool mRequireTOF; // require that track exits the TOF and that it has an associated time measurement (kTIME and kTOFOUT)

std::vector<std::pair<int8_t, std::set<uint8_t>>>
mRequiredITSHits; // vector of ITS requirements (minNRequiredHits in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ DECLARE_SOA_COLUMN(DcaZ, dcaZ, float);
// Columns to store track filter decisions
DECLARE_SOA_COLUMN(IsGlobalTrack, isGlobalTrack, uint8_t);
DECLARE_SOA_COLUMN(IsGlobalTrackSDD, isGlobalTrackSDD, uint8_t);
DECLARE_SOA_COLUMN(IsGlobalTrackwTOF, isGlobalTrackwTOF, uint8_t);

} // namespace track
DECLARE_SOA_TABLE(TracksExtended, "AOD", "TRACKEXTENDED", track::DcaXY,
track::DcaZ);

DECLARE_SOA_TABLE(TrackSelection, "AOD", "TRACKSELECTION", track::IsGlobalTrack,
track::IsGlobalTrackSDD);
track::IsGlobalTrackSDD,
track::IsGlobalTrackwTOF);
} // namespace o2::aod

#endif // O2_ANALYSIS_TRACKSELECTIONTABLES_H_
13 changes: 12 additions & 1 deletion Analysis/Tasks/trackselection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ TrackSelection getGlobalTrackSelectionSDD()
return selectedTracks;
}

// Default track selection requiring a cluster matched in TOF
TrackSelection getGlobalTrackSelectionwTOF()
{
TrackSelection selectedTracks = getGlobalTrackSelection();
selectedTracks.SetRequireTOF(kTRUE);
return selectedTracks;
}

//****************************************************************************************
/**
* Produce the derived track quantities needed for track selection.
Expand Down Expand Up @@ -111,18 +119,21 @@ struct TrackSelectionTask {

TrackSelection globalTracks;
TrackSelection globalTracksSDD;
TrackSelection globalTrackswTOF;

void init(InitContext&)
{
globalTracks = getGlobalTrackSelection();
globalTracksSDD = getGlobalTrackSelectionSDD();
globalTrackswTOF = getGlobalTrackSelectionwTOF();
}

void process(soa::Join<aod::FullTracks, aod::TracksExtended> const& tracks)
{
for (auto& track : tracks) {
filterTable((uint8_t)globalTracks.IsSelected(track),
(uint8_t)globalTracksSDD.IsSelected(track));
(uint8_t)globalTracksSDD.IsSelected(track),
(uint8_t)globalTrackswTOF.IsSelected(track));
}
}
};
Expand Down