Skip to content
Merged
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
91 changes: 61 additions & 30 deletions PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@
AxisSpec etaAxis = {20, -4., -2.};
AxisSpec centAxis{100, 0, 100, "centrality"};
AxisSpec chiSqAxis = {100, 0., 1000.};
AxisSpec nclsAxis{10, 0.5, 10.5, "# clusters"};

enum TrkSel {
trkSelNCls,
trkSelChi2Ncl,
trkSelEta,
trkSelPhiCut,
trkSelPt,
trkSelCA,
nTrkSel
};

struct DndetaMFTPbPb {
SliceCache cache;
Expand Down Expand Up @@ -101,40 +112,42 @@
"minimum number of MFT clusters"};
Configurable<bool> useChi2Cut{"useChi2Cut", false, "use track chi2 cut"};
Configurable<float> maxChi2NCl{"maxChi2NCl", 1000.f, "maximum chi2 per MFT clusters"};
Configurable<bool> usePtCut{"usePtCut", false, "use track pT cut"};
Configurable<double> minPt{"minPt", 0., "minimum pT of the MFT tracks"};
Configurable<bool> requireCA{

Check failure on line 117 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"requireCA", false, "Use Cellular Automaton track-finding algorithm"};
Configurable<float> maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"};
} trackCuts;

struct : ConfigurableGroup {
Configurable<float> maxZvtx{"maxZvtx", 10.0f, "Cut on z-vtx"};
Configurable<float> maxZvtx{"maxZvtx", 10.0f, "maximum cut on z-vtx (cm)"};
Configurable<float> minZvtx{"minZvtx", -10.0f, "minimum cut on z-vtx (cm)"};
Configurable<bool> useZDiffCut{"useZDiffCut", false,
"use Zvtx reco-mc diff. cut"};
Configurable<float> maxZvtxDiff{

Check failure on line 127 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"maxZvtxDiff", 1.0f,
"max allowed Z vtx difference for reconstruced collisions (cm)"};
Configurable<bool> requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", true, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference"};
Configurable<bool> requireRejectSameBunchPileup{"requireRejectSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"};
Configurable<bool> requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", true, " requireNoCollInTimeRangeStrict"};
Configurable<bool> requireNoCollInRofStrict{"requireNoCollInRofStrict", true, "requireNoCollInRofStrict"};
Configurable<bool> requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", false, " requireNoCollInTimeRangeStrict"};
Configurable<bool> requireNoCollInRofStrict{"requireNoCollInRofStrict", false, "requireNoCollInRofStrict"};
Configurable<bool> requireNoCollInRofStandard{"requireNoCollInRofStandard", false, "requireNoCollInRofStandard"};
Configurable<bool> requireNoHighMultCollInPrevRof{"requireNoHighMultCollInPrevRof", true, "requireNoHighMultCollInPrevRof"};
Configurable<bool> requireNoHighMultCollInPrevRof{"requireNoHighMultCollInPrevRof", false, "requireNoHighMultCollInPrevRof"};
Configurable<bool> requireNoCollInTimeRangeStd{

Check failure on line 136 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"requireNoCollInTimeRangeStd", false,
"requireNoCollInTimeRangeStd", true,
"reject collisions corrupted by the cannibalism, with other collisions "
"within +/- 10 microseconds"};
Configurable<bool> requireNoCollInTimeRangeNarrow{

Check failure on line 140 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"requireNoCollInTimeRangeNarrow", false,
"reject collisions corrupted by the cannibalism, with other collisions "
"within +/- 10 microseconds"};
Configurable<uint> occupancyEstimator{

Check failure on line 144 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"occupancyEstimator", 1,
"Occupancy estimator: 1 = trackOccupancyInTimeRange, 2 = "
"ft0cOccupancyInTimeRange"};
Configurable<float> minOccupancy{

Check failure on line 148 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"minOccupancy", -1, "minimum occupancy from neighbouring collisions"};
Configurable<float> maxOccupancy{

Check failure on line 150 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"};
Configurable<float> minIR{"minIR", -1, "minimum IR (kHz) collisions"};
Configurable<float> maxIR{"maxIR", -1, "maximum IR (kHz) collisions"};
Expand Down Expand Up @@ -234,7 +247,7 @@
"be enabled!");
}

auto hev = registry.add<TH1>("hEvtSel", "hEvtSel", HistType::kTH1F,
auto hev = registry.add<TH1>("Events/hEvtSel", "hEvtSel", HistType::kTH1F,
{{14, -0.5f, +13.5f}});
hev->GetXaxis()->SetBinLabel(1, "All collisions");
hev->GetXaxis()->SetBinLabel(2, "Ev. sel.");
Expand All @@ -250,6 +263,14 @@
hev->GetXaxis()->SetBinLabel(12, "Below min occup.");
hev->GetXaxis()->SetBinLabel(13, "Above max occup.");

registry.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {HistType::kTH1D, {{nTrkSel, 0, nTrkSel}}});
registry.get<TH1>(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNCls + 1, "Ncl cut");
registry.get<TH1>(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelChi2Ncl + 1, "#chi^{2}/Ncl cut");
registry.get<TH1>(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "#eta cut");
registry.get<TH1>(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPhiCut + 1, "#varphi cut");
registry.get<TH1>(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "#it{p}_{T} cut");
registry.get<TH1>(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelCA + 1, "Tracking algorithm (CA)");

auto hBcSel = registry.add<TH1>("hBcSel", "hBcSel", HistType::kTH1F,
{{3, -0.5f, +2.5f}});
hBcSel->GetXaxis()->SetBinLabel(1, "Good BCs");
Expand Down Expand Up @@ -290,7 +311,7 @@
qaregistry.add(
{"Tracks/NclustersEta",
"; nClusters; #eta; occupancy",
{HistType::kTHnSparseF, {{7, 4, 10}, etaAxis, occupancyAxis}}});
{HistType::kTHnSparseF, {nclsAxis, etaAxis, occupancyAxis}}});
qaregistry.add({"Tracks/NchSel",
"; N_{ch}; occupancy",
{HistType::kTH2F, {multAxis, occupancyAxis}}});
Expand All @@ -311,7 +332,7 @@
qaregistry.add(
{"Tracks/NclustersEtaBest",
"; nClusters; #eta; occupancy",
{HistType::kTHnSparseF, {{7, 4, 10}, etaAxis, occupancyAxis}}});
{HistType::kTHnSparseF, {nclsAxis, etaAxis, occupancyAxis}}});
qaregistry.add(
{"Tracks/DCAXYPt",
"; p_{T} (GeV/c) ; DCA_{XY} (cm); occupancy",
Expand Down Expand Up @@ -389,7 +410,7 @@
qaregistry.add({"Tracks/Centrality/NclustersEta",
"; nClusters; #eta; centrality; occupancy",
{HistType::kTHnSparseF,
{{7, 4, 10}, etaAxis, centralityAxis, occupancyAxis}}});
{nclsAxis, etaAxis, centralityAxis, occupancyAxis}}});

if (doprocessDatawBestTracksCentFT0C ||
doprocessDatawBestTracksCentFT0CVariant1 ||
Expand All @@ -412,7 +433,7 @@
{"Tracks/Centrality/NclustersEtaBest",
"; nClusters; #eta; centrality; occupancy",
{HistType::kTHnSparseF,
{{7, 4, 10}, etaAxis, centralityAxis, occupancyAxis}}});
{nclsAxis, etaAxis, centralityAxis, occupancyAxis}}});
qaregistry.add({"Tracks/Centrality/TrackAmbDegree",
"; N_{coll}^{comp}; centrality; occupancy",
{HistType::kTHnSparseF,
Expand Down Expand Up @@ -744,20 +765,21 @@
template <typename T>
bool isTrackSelected(const T& track)
{
if (track.eta() < trackCuts.minEta || track.eta() > trackCuts.maxEta)
if (track.nClusters() < trackCuts.minNclusterMft) {
return false;
}
registry.fill(HIST("Tracks/hTrkSel"), trkSelNCls);
if (trackCuts.useChi2Cut) {
float nclMft = std::max(2.0f * track.nClusters() - 5.0f, 1.0f);
float mftChi2NCl = track.chi2() / nclMft;
if (mftChi2NCl > trackCuts.maxChi2NCl)
return false;
}
if (trackCuts.requireCA && !track.isCA())
return false;
if (track.nClusters() < trackCuts.minNclusterMft)
return false;
if (track.pt() < trackCuts.minPt)
registry.fill(HIST("Tracks/hTrkSel"), trkSelChi2Ncl);
if (track.eta() < trackCuts.minEta || track.eta() > trackCuts.maxEta) {
return false;
}
registry.fill(HIST("Tracks/hTrkSel"), trkSelEta);
if (trackCuts.usephiCut) {
float phi = track.phi();
o2::math_utils::bringTo02Pi(phi);
Expand All @@ -771,6 +793,15 @@
(phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut)))
return false;
}
registry.fill(HIST("Tracks/hTrkSel"), trkSelPhiCut);
if (trackCuts.usePtCut && track.pt() < trackCuts.minPt) {
return false;
}
registry.fill(HIST("Tracks/hTrkSel"), trkSelPt);
if (trackCuts.requireCA && !track.isCA()) {
return false;
}
registry.fill(HIST("Tracks/hTrkSel"), trkSelCA);
return true;
}

Expand Down Expand Up @@ -938,85 +969,85 @@
bool isGoodEvent(C const& collision)
{
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 0);
registry.fill(HIST("Events/hEvtSel"), 0);
}
if (!collision.sel8()) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 1);
registry.fill(HIST("Events/hEvtSel"), 1);
}
if (eventCuts.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 2);
registry.fill(HIST("Events/hEvtSel"), 2);
}
if (eventCuts.requireRejectSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 3);
registry.fill(HIST("Events/hEvtSel"), 3);
}
if (std::abs(collision.posZ()) >= eventCuts.maxZvtx) {
if (collision.posZ() <= eventCuts.minZvtx || collision.posZ() >= eventCuts.maxZvtx) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 4);
registry.fill(HIST("Events/hEvtSel"), 4);
}
if (eventCuts.requireNoCollInTimeRangeStd &&
!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 5);
registry.fill(HIST("Events/hEvtSel"), 5);
}
if (eventCuts.requireNoCollInTimeRangeNarrow &&
!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 6);
registry.fill(HIST("Events/hEvtSel"), 6);
}
if (eventCuts.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 7);
registry.fill(HIST("Events/hEvtSel"), 7);
}
if (eventCuts.requireNoCollInRofStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 8);
registry.fill(HIST("Events/hEvtSel"), 8);
}
if (eventCuts.requireNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 9);
registry.fill(HIST("Events/hEvtSel"), 9);
}
if (eventCuts.requireNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 10);
registry.fill(HIST("Events/hEvtSel"), 10);
}
if (eventCuts.minOccupancy >= 0 &&
getOccupancy(collision, eventCuts.occupancyEstimator) <
eventCuts.minOccupancy) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 11);
registry.fill(HIST("Events/hEvtSel"), 11);
}
if (eventCuts.maxOccupancy >= 0 &&
getOccupancy(collision, eventCuts.occupancyEstimator) >
eventCuts.maxOccupancy) {
return false;
}
if constexpr (fillHis) {
registry.fill(HIST("hEvtSel"), 12);
registry.fill(HIST("Events/hEvtSel"), 12);
}
return true;
}
Expand All @@ -1030,7 +1061,7 @@
if (p != nullptr) {
charge = p->Charge();
}
return std::abs(charge) >= 3.;

Check failure on line 1064 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
}

template <bool isCent, typename P>
Expand Down Expand Up @@ -1342,7 +1373,7 @@

float cgen = -1;
if constexpr (has_reco_cent<C>) {
float crec_min = 105.f;

Check failure on line 1376 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
for (const auto& collision : collisions) {
if (isGoodEvent<false>(collision)) {
float c = getRecoCent(collision);
Expand Down Expand Up @@ -1545,7 +1576,7 @@
bool gtZeroColl = false;
float cgen = -1;
if constexpr (has_reco_cent<C>) {
float crec_min = 105.f;

Check failure on line 1579 in PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
for (const auto& collision : collisions) {
if (isGoodEvent<false>(collision)) {
float c = getRecoCent(collision);
Expand Down
Loading