Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PWGJE] hybrid track cuts for Run2 converted data #9680

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion Common/Core/TrackSelection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool TrackSelection::FulfillsITSHitRequirements(uint8_t itsClusterMap) const
return true;
}

const std::string TrackSelection::mCutNames[static_cast<int>(TrackSelection::TrackCuts::kNCuts)] = {"TrackType", "PtRange", "EtaRange", "TPCNCls", "TPCCrossedRows", "TPCCrossedRowsOverNCls", "TPCChi2NDF", "TPCRefit", "ITSNCls", "ITSChi2NDF", "ITSRefit", "ITSHits", "GoldenChi2", "DCAxy", "DCAz"};
const std::string TrackSelection::mCutNames[static_cast<int>(TrackSelection::TrackCuts::kNCuts)] = {"TrackType", "PtRange", "EtaRange", "TPCNCls", "TPCCrossedRows", "TPCCrossedRowsOverNCls", "TPCChi2NDF", "TPCRefit", "ITSNCls", "ITSChi2NDF", "ITSRefit", "ITSHits", "GoldenChi2", "DCAxy", "DCAz", "TPCFracSharedCls"};

void TrackSelection::SetTrackType(o2::aod::track::TrackTypeEnum trackType)
{
Expand Down Expand Up @@ -79,6 +79,11 @@ void TrackSelection::SetMinNCrossedRowsOverFindableClustersTPC(float minNCrossed
mMinNCrossedRowsOverFindableClustersTPC = minNCrossedRowsOverFindableClustersTPC;
LOG(info) << "Track selection, set min N crossed rows over findable clusters TPC: " << mMinNCrossedRowsOverFindableClustersTPC;
}
void TrackSelection::SetMaxTPCFractionSharedCls(float maxTPCFractionSharedCls)
{
mMaxTPCFractionSharedCls = maxTPCFractionSharedCls;
LOG(info) << "Track selection, set max fraction of shared clusters TPC: " << mMaxTPCFractionSharedCls;
}
void TrackSelection::SetMinNClustersITS(int minNClustersITS)
{
mMinNClustersITS = minNClustersITS;
Expand Down Expand Up @@ -175,6 +180,9 @@ void TrackSelection::print() const
case TrackCuts::kDCAz:
LOG(info) << mCutNames[i] << " < " << mMaxDcaZ;
break;
case TrackCuts::kTPCFracSharedCls:
LOG(info) << mCutNames[i] << " < " << mMaxTPCFractionSharedCls;
break;
default:
LOG(fatal) << "Cut unknown!";
}
Expand Down
10 changes: 10 additions & 0 deletions Common/Core/TrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class TrackSelection
kGoldenChi2,
kDCAxy,
kDCAz,
kTPCFracSharedCls,
kNCuts
};

Expand Down Expand Up @@ -114,6 +115,9 @@ class TrackSelection
if (!IsSelected(track, TrackCuts::kDCAz)) {
return false;
}
if (!IsSelected(track, TrackCuts::kTPCFracSharedCls)) {
return false;
}
return true;
}

Expand Down Expand Up @@ -144,6 +148,7 @@ class TrackSelection
setFlag(TrackCuts::kGoldenChi2);
setFlag(TrackCuts::kDCAxy);
setFlag(TrackCuts::kDCAz);
setFlag(TrackCuts::kTPCFracSharedCls);

return flag;
}
Expand Down Expand Up @@ -199,6 +204,8 @@ class TrackSelection

case TrackCuts::kDCAz:
return std::fabs(track.dcaZ()) <= mMaxDcaZ;
case TrackCuts::kTPCFracSharedCls:
return track.tpcFractionSharedCls() <= mMaxTPCFractionSharedCls;

default:
return false;
Expand All @@ -225,6 +232,7 @@ class TrackSelection
void SetRequireNoHitsInITSLayers(std::set<uint8_t> excludedLayers);
/// @brief Reset ITS requirements
void ResetITSRequirements() { mRequiredITSHits.clear(); }
void SetMaxTPCFractionSharedCls(float maxTPCFractionSharedCls);

/// @brief Print the track selection
void print() const;
Expand All @@ -250,6 +258,8 @@ class TrackSelection
float mMaxDcaZ{1e10f}; // max dca in z direction
std::function<float(float)> mMaxDcaXYPtDep{}; // max dca in xy plane as function of pT

float mMaxTPCFractionSharedCls{1e10f}; // max fraction of shared TPC clusters

bool mRequireITSRefit{false}; // require refit in ITS
bool mRequireTPCRefit{false}; // require refit in TPC
bool mRequireGoldenChi2{false}; // require golden chi2 cut (Run 2 only)
Expand Down
23 changes: 19 additions & 4 deletions Common/Core/TrackSelectionDefaults.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,27 @@
// Reduced default track selection for jet validation based on hybrid cuts for converted (based on ESD's from run 2) A02D's
TrackSelection getJEGlobalTrackSelectionRun2()
{
TrackSelection selectedTracks = getGlobalTrackSelection();
selectedTracks.SetPtRange(0.15f, 1e15f);
selectedTracks.SetRequireGoldenChi2(false);
selectedTracks.SetMaxDcaXYPtDep([](float /*pt*/) { return 1e+10; });
TrackSelection selectedTracks;

//These track selections are the same as the global track selections as of Jan 2025. Implemented seperately to prevent future
//global track selection changes from affecting the Run 2 hybrid track selections.
selectedTracks.SetTrackType(o2::aod::track::Run2Track); // Run 2 track asked by default
selectedTracks.SetRequireITSRefit(true);
selectedTracks.SetRequireTPCRefit(true);
selectedTracks.SetRequireGoldenChi2(true);
selectedTracks.SetMinNCrossedRowsTPC(70);
selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.8f);
selectedTracks.SetMaxChi2PerClusterTPC(4.f);
selectedTracks.SetMaxChi2PerClusterITS(36.f);

//These track selections are different to the global track selections as of Jan 2025.
selectedTracks.SetPtRange(0.15f, 1000.f);
selectedTracks.SetEtaRange(-0.9f, 0.9f);
selectedTracks.SetMaxDcaXYPtDep([](float /*pt*/) { return 1e+10; });
selectedTracks.SetMaxDcaXY(2.4f);
selectedTracks.SetMaxDcaZ(3.2f);
selectedTracks.SetRequireHitsInITSLayers(0, {0, 1}); // no minimum required number of hits in any SPD layer

Check failure on line 142 in Common/Core/TrackSelectionDefaults.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
selectedTracks.SetMaxTPCFractionSharedCls(0.4f); //This cut machinery was added since it's used in hybrid tracks Run 2

Check failure on line 144 in Common/Core/TrackSelectionDefaults.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
return selectedTracks;
}
14 changes: 13 additions & 1 deletion Common/Tools/trackSelectionRequest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ int trackSelectionRequest::getMinTPCCrossedRowsOverFindable() const
{
return minTPCcrossedrowsoverfindable;
}
void trackSelectionRequest::setMaxTPCFractionSharedCls(float maxTPCFractionSharedCls_)
{
maxTPCFractionSharedCls = maxTPCFractionSharedCls_;
}
int trackSelectionRequest::getMaxTPCFractionSharedCls() const
{
return maxTPCFractionSharedCls;
}
void trackSelectionRequest::setRequireITS(bool requireITS_)
{
requireITS = requireITS_;
Expand Down Expand Up @@ -159,6 +167,8 @@ void trackSelectionRequest::CombineWithLogicalOR(trackSelectionRequest const& lT
minTPCcrossedrows = lTraSelRe.getMinTPCCrossedRows();
if (lTraSelRe.getMinTPCCrossedRowsOverFindable() < minTPCcrossedrowsoverfindable)
minTPCcrossedrowsoverfindable = lTraSelRe.getMinTPCCrossedRowsOverFindable();
if (lTraSelRe.getMaxTPCFractionSharedCls() > maxTPCFractionSharedCls)
maxTPCFractionSharedCls = lTraSelRe.getMaxTPCFractionSharedCls();

if (lTraSelRe.getRequireITS() == false)
requireITS = false;
Expand Down Expand Up @@ -205,7 +215,9 @@ void trackSelectionRequest::PrintSelections() const
LOGF(info, "Minimum TPC clusters ...................: %i", minTPCclusters);
LOGF(info, "Minimum TPC crossed rows ...............: %i", minTPCcrossedrows);
LOGF(info, "Minimum TPC crossed rows over findable .: %.3f", minTPCcrossedrowsoverfindable);
LOGF(info, "Max Fraction of TPC Shared Clusters ....: %.3f", maxTPCFractionSharedCls);

LOGF(info, "Require ITS ............................: %i", requireITS);
LOGF(info, "Minimum ITS clusters ...................: %i", minITSclusters);
LOGF(info, "Max ITS chi2/clu ......................: %.3f", maxITSChi2percluster);
}
}
7 changes: 7 additions & 0 deletions Common/Tools/trackSelectionRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class trackSelectionRequest
int getMinTPCCrossedRows() const;
void setMinTPCCrossedRowsOverFindable(float minTPCCrossedRowsOverFindable_);
int getMinTPCCrossedRowsOverFindable() const;
void setMaxTPCFractionSharedCls(float maxTPCFractionSharedCls_);
int getMaxTPCFractionSharedCls() const;

void setRequireITS(bool requireITS_);
bool getRequireITS() const;
Expand Down Expand Up @@ -97,6 +99,8 @@ class trackSelectionRequest
return false;
if (lTrack.tpcCrossedRowsOverFindableCls() < minTPCcrossedrowsoverfindable)
return false;
if (lTrack.tpcFractionSharedCls() > maxTPCFractionSharedCls)
return false;
if (lTrack.hasITS() == false && requireITS)
return false;
if (lTrack.itsNCls() < minITSclusters)
Expand All @@ -117,6 +121,8 @@ class trackSelectionRequest
return false;
if (lTrack.tpcCrossedRowsOverFindableCls() < minTPCcrossedrowsoverfindable)
return false;
if (lTrack.tpcFractionSharedCls() > maxTPCFractionSharedCls)
return false;
if (lTrack.hasITS() == false && requireITS)
return false;
if (lTrack.itsNCls() < minITSclusters)
Expand Down Expand Up @@ -146,6 +152,7 @@ class trackSelectionRequest
int minTPCclusters;
int minTPCcrossedrows;
float minTPCcrossedrowsoverfindable;
float maxTPCFractionSharedCls;
// ITS parameters (TracksExtra)
bool requireITS; // in Run 3, equiv to hasITS
int minITSclusters;
Expand Down
8 changes: 7 additions & 1 deletion PWGJE/Core/JetDerivedDataUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ enum JTrackSel {
globalTrack = 1,
qualityTrack = 2,
qualityTrackWDCA = 3,
hybridTrack = 4
hybridTrack = 4,
hybridTrackRun2 = 5
};

template <typename T>
Expand Down Expand Up @@ -536,6 +537,8 @@ int initialiseTrackSelection(std::string trackSelection)
return JTrackSel::qualityTrackWDCA;
} else if (trackSelection == "hybridTracks") {
return JTrackSel::hybridTrack;
} else if (trackSelection == "hybridTracksRun2") {
return JTrackSel::hybridTrackRun2;
}
return -1;
}
Expand All @@ -561,6 +564,9 @@ uint8_t setTrackSelectionBit(T const& track, float trackDCAZ, float maxDCAZ)
if (track.trackCutFlagFb5()) {
SETBIT(bit, JTrackSel::hybridTrack);
}
if (track.trackCutFlagFb5()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to check the same things as the if statement above?
So hybridTrack and hybridTrackRun2 are the same? If the original hybridTrack has just been updated (i.e trackCutFlagFb5 has been updated), then we can just keep on using hybridTrack as it was and not add hybridTrackRun2

SETBIT(bit, JTrackSel::hybridTrackRun2);
}
return bit;
}

Expand Down
Loading
Loading