Skip to content

Commit aff1c87

Browse files
committed
validated mixed event + dca cuts (no cuts for alltracks)
1 parent 35f09a6 commit aff1c87

1 file changed

Lines changed: 104 additions & 13 deletions

File tree

PWGHF/HFC/Tasks/taskFlow.cxx

Lines changed: 104 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ enum MftTrackSelectionStep {
134134
Eta,
135135
Cluster,
136136
Pt,
137+
DCAxy,
138+
DCAz,
139+
IsLTF,
140+
IsCA,
137141
NMftTrackSelectionSteps
138142
};
139143

@@ -267,6 +271,8 @@ struct HfTaskFlow {
267271
struct : ConfigurableGroup {
268272
std::string prefix = "ConfigMft_group";
269273
Configurable<int> cutBestCollisionId{"cutBestCollisionId", 0, "cut on the best collision Id used in a filter"};
274+
Configurable<bool> cutOnDcaXY{"cutOnDcaXY", false, "if true, cut on DCA XY"};
275+
Configurable<bool> cutOnDcaZ{"cutOnDcaZ", false, "if true, cut on DCA Z"};
270276
Configurable<float> etaMftTrackMax{"etaMftTrackMax", -2.4f, "Maximum value for the eta of MFT tracks when used in cut function"};
271277
Configurable<float> etaMftTrackMin{"etaMftTrackMin", -3.36f, "Minimum value for the eta of MFT tracks when used in cut function"};
272278
Configurable<float> etaMftTrackMaxFilter{"etaMftTrackMaxFilter", -2.0f, "Maximum value for the eta of MFT tracks when used in filter"};
@@ -277,6 +283,8 @@ struct HfTaskFlow {
277283
Configurable<float> ptMftTrackMax{"ptMftTrackMax", 10.0f, "max value of MFT tracks pT when used in cut function"};
278284
Configurable<float> ptMftTrackMin{"ptMftTrackMin", 0.f, "min value of MFT tracks pT when used in cut function"};
279285
Configurable<bool> useMftPtCut{"useMftPtCut", false, "if true, use the Mft pt function cut"};
286+
Configurable<bool> useOnlyCATracks{"useOnlyCATracks", false, "if true, use strictly MFT tracks reconstructed with CA algo."};
287+
Configurable<bool> useOnlyLTFTracks{"useOnlyLTFTracks", false, "if true, use strictly MFT tracks reconstructed with LTF algo."};
280288
} configMft;
281289

282290
// configurables for MFT tracks
@@ -298,7 +306,7 @@ struct HfTaskFlow {
298306
o2::fv0::Geometry* fv0Det{};
299307
std::vector<float> cstFT0RelGain{};
300308
RCTFlagsChecker rctChecker;
301-
RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad};
309+
RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad};
302310

303311
// =========================
304312
// using declarations : DATA
@@ -346,7 +354,7 @@ struct HfTaskFlow {
346354

347355
// Filters below will be used for uncertainties
348356
Filter mftTrackCollisionIdFilter = (aod::fwdtrack::bestCollisionId >= 0);
349-
Filter mftTrackDcaXYFilter = (nabs(aod::fwdtrack::bestDCAXY) < configMft.mftMaxDCAxy);
357+
// Filter mftTrackDcaXYFilter = (nabs(aod::fwdtrack::bestDCAXY) < configMft.mftMaxDCAxy);
350358
// Filter mftTrackDcaZFilter = (nabs(aod::fwdtrack::bestDCAZ) < configMft.mftMaxDCAz);
351359

352360
// =========================
@@ -435,6 +443,10 @@ struct HfTaskFlow {
435443
labelsMftTracksSelection[MftTrackSelectionStep::Eta] = "MFT tracks after eta selection";
436444
labelsMftTracksSelection[MftTrackSelectionStep::Cluster] = "MFT tracks after clusters selection";
437445
labelsMftTracksSelection[MftTrackSelectionStep::Pt] = "MFT tracks after pT selection";
446+
labelsMftTracksSelection[MftTrackSelectionStep::DCAxy] = "MFT tracks after DCAxy selection";
447+
labelsMftTracksSelection[MftTrackSelectionStep::DCAz] = "MFT tracks after DCAz selection";
448+
labelsMftTracksSelection[MftTrackSelectionStep::IsLTF] = "Linear Track Finder MFT tracks";
449+
labelsMftTracksSelection[MftTrackSelectionStep::IsCA] = "Cellular Automaton MFT tracks";
438450
registry.get<TH1>(HIST("Data/Mft/hMftTracksSelection"))->SetMinimum(0);
439451

440452
for (int iBin = 0; iBin < MftTrackSelectionStep::NMftTrackSelectionSteps; iBin++) {
@@ -479,8 +491,8 @@ struct HfTaskFlow {
479491
// Event histograms
480492
// =========================
481493

482-
rctChecker.init(configCollision.setRCTFlagCheckerLabel, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad);
483-
correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad);
494+
rctChecker.init(configCollision.setRCTFlagCheckerLabel, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad, true);
495+
correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad, true);
484496

485497
registry.add("Data/hVtxZ", "v_{z} (cm)", {HistType::kTH1D, {configAxis.axisVertex}});
486498
registry.add("Data/hNTracks", "", {HistType::kTH1F, {configAxis.axisMultiplicity}});
@@ -1092,7 +1104,7 @@ struct HfTaskFlow {
10921104
// I tried to put it as a filter, but filters for normal TPC tracks also apply to MFT tracks I think
10931105
// and it seems that they are not compatible
10941106
template <typename TTrack>
1095-
bool isAcceptedMftTrack(TTrack const& mftTrack, bool fillHistograms)
1107+
bool isAcceptedMftTrack(TTrack const& mftTrack, float dcaXY, float dcaZ, bool fillHistograms)
10961108
{
10971109
// cut on the eta of MFT tracks
10981110
if (mftTrack.eta() > configMft.etaMftTrackMax || mftTrack.eta() < configMft.etaMftTrackMin) {
@@ -1121,6 +1133,41 @@ struct HfTaskFlow {
11211133
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::Pt);
11221134
}
11231135

1136+
if (configMft.cutOnDcaXY && std::abs(dcaXY) > configMft.mftMaxDCAxy) {
1137+
return false;
1138+
}
1139+
1140+
if (fillHistograms) {
1141+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::DCAxy);
1142+
}
1143+
if (configMft.cutOnDcaZ && std::abs(dcaZ) > configMft.mftMaxDCAz) {
1144+
return false;
1145+
}
1146+
1147+
if (fillHistograms) {
1148+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::DCAz);
1149+
}
1150+
1151+
// cut on the track algorithm of MFT tracks
1152+
if (mftTrack.isCA()) {
1153+
if (fillHistograms) {
1154+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::IsCA);
1155+
}
1156+
1157+
if (configMft.useOnlyLTFTracks) {
1158+
return false;
1159+
}
1160+
1161+
} else {
1162+
if (fillHistograms) {
1163+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::IsLTF);
1164+
}
1165+
1166+
if (configMft.useOnlyCATracks) {
1167+
return false;
1168+
}
1169+
}
1170+
11241171
return true;
11251172
}
11261173

@@ -1236,11 +1283,11 @@ struct HfTaskFlow {
12361283
if (sameEvent && loopCounter == 1) { // To avoid double counting, we fill the plots only the first time
12371284
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::NoSelection);
12381285

1239-
if (!isAcceptedMftTrack(track2, true)) {
1286+
if (!isAcceptedMftTrack(track2, 0.f, 0.f, true)) {
12401287
continue;
12411288
}
12421289
} else { // After the first loop, we don't fill the plots anymore but still do the selection
1243-
if (!isAcceptedMftTrack(track2, false)) {
1290+
if (!isAcceptedMftTrack(track2, 0.f, 0.f, false)) {
12441291
continue;
12451292
}
12461293
}
@@ -1432,9 +1479,27 @@ struct HfTaskFlow {
14321479
}
14331480

14341481
auto reassociatedMftTrack = track2.template mfttrack_as<FilteredMftTracks>();
1482+
auto reassociatedMftTrackDcaXY = 0.f;
1483+
auto reassociatedMftTrackDcaZ = 0.f;
14351484

1436-
if (!isAcceptedMftTrack(reassociatedMftTrack, false)) {
1437-
continue;
1485+
if constexpr (std::is_same_v<soa::SmallGroups<aod::BestCollisionsFwd>, TTracksAssoc>) {
1486+
reassociatedMftTrackDcaXY = track2.bestDCAXY();
1487+
}
1488+
if constexpr (std::is_same_v<soa::SmallGroups<aod::BestCollisionsFwd3d>, TTracksAssoc>) {
1489+
reassociatedMftTrackDcaXY = track2.bestDCAXY();
1490+
reassociatedMftTrackDcaZ = track2.bestDCAZ();
1491+
}
1492+
1493+
if (sameEvent && loopCounter == 1) { // To avoid double counting, we fill the plots only the first time
1494+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::NoSelection);
1495+
1496+
if (!isAcceptedMftTrack(reassociatedMftTrack, reassociatedMftTrackDcaXY, reassociatedMftTrackDcaZ, true)) {
1497+
continue;
1498+
}
1499+
} else { // After the first loop, we don't fill the plots anymore but still do the selection
1500+
if (!isAcceptedMftTrack(reassociatedMftTrack, reassociatedMftTrackDcaXY, reassociatedMftTrackDcaZ, false)) {
1501+
continue;
1502+
}
14381503
}
14391504

14401505
// Fill QA plot for MFT tracks after physical selection (eta + clusters)
@@ -1543,8 +1608,16 @@ struct HfTaskFlow {
15431608
continue;
15441609
}
15451610
} else if constexpr (std::is_same_v<FilteredMftTracks, TTracksTrig>) {
1546-
if (!isAcceptedMftTrack(track1, true)) {
1547-
continue;
1611+
if (sameEvent && loopCounter == 1) { // To avoid double counting, we fill the plots only the first time
1612+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::NoSelection);
1613+
1614+
if (!isAcceptedMftTrack(track1, 0.f, 0.f, true)) {
1615+
continue;
1616+
}
1617+
} else { // After the first loop, we don't fill the plots anymore but still do the selection
1618+
if (!isAcceptedMftTrack(track1, 0.f, 0.f, false)) {
1619+
continue;
1620+
}
15481621
}
15491622
}
15501623

@@ -1739,9 +1812,27 @@ struct HfTaskFlow {
17391812
loopCounter++;
17401813

17411814
auto reassociatedMftTrack = track1.template mfttrack_as<FilteredMftTracks>();
1815+
auto reassociatedMftTrackDcaXY = 0.f;
1816+
auto reassociatedMftTrackDcaZ = 0.f;
17421817

1743-
if (!isAcceptedMftTrack(reassociatedMftTrack, true)) {
1744-
continue;
1818+
if constexpr (std::is_same_v<soa::SmallGroups<aod::BestCollisionsFwd>, TTracksAssoc>) {
1819+
reassociatedMftTrackDcaXY = track1.bestDCAXY();
1820+
}
1821+
if constexpr (std::is_same_v<soa::SmallGroups<aod::BestCollisionsFwd3d>, TTracksAssoc>) {
1822+
reassociatedMftTrackDcaXY = track1.bestDCAXY();
1823+
reassociatedMftTrackDcaZ = track1.bestDCAZ();
1824+
}
1825+
1826+
if (sameEvent && loopCounter == 1) { // To avoid double counting, we fill the plots only the first time
1827+
registry.fill(HIST("Data/Mft/hMftTracksSelection"), MftTrackSelectionStep::NoSelection);
1828+
1829+
if (!isAcceptedMftTrack(reassociatedMftTrack, reassociatedMftTrackDcaXY, reassociatedMftTrackDcaZ, true)) {
1830+
continue;
1831+
}
1832+
} else { // After the first loop, we don't fill the plots anymore but still do the selection
1833+
if (!isAcceptedMftTrack(reassociatedMftTrack, reassociatedMftTrackDcaXY, reassociatedMftTrackDcaZ, false)) {
1834+
continue;
1835+
}
17451836
}
17461837

17471838
if (isAmbiguousMftTrack(track1, false)) {

0 commit comments

Comments
 (0)