Skip to content

Commit 41e9d8b

Browse files
[PWGHF] refined soft pion selection in tcc tree creator (#9687)
1 parent 04fb3eb commit 41e9d8b

File tree

1 file changed

+23
-41
lines changed

1 file changed

+23
-41
lines changed

PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ DECLARE_SOA_COLUMN(MD1, mD1, float);
7777
DECLARE_SOA_COLUMN(MD2, mD2, float);
7878
DECLARE_SOA_COLUMN(DeltaMD1, deltaMD1, float);
7979
DECLARE_SOA_COLUMN(DeltaMD2, deltaMD2, float);
80+
DECLARE_SOA_COLUMN(MDD, mDD, float);
81+
DECLARE_SOA_COLUMN(MDPi1, mDPi1, float);
82+
DECLARE_SOA_COLUMN(MDPi2, mDPi2, float);
8083
DECLARE_SOA_COLUMN(MDDPi, mDDPi, float);
8184
DECLARE_SOA_COLUMN(DeltaMDDPi, deltaMDDPi, float);
8285
DECLARE_SOA_COLUMN(EtaD1, etaD1, float);
@@ -133,6 +136,9 @@ DECLARE_SOA_TABLE(HfCandTccLites, "AOD", "HFCANDTCCLITE",
133136
full::MD2,
134137
full::DeltaMD1,
135138
full::DeltaMD2,
139+
full::MDD,
140+
full::MDPi1,
141+
full::MDPi2,
136142
full::MDDPi,
137143
full::DeltaMDDPi,
138144
full::EtaD1,
@@ -178,17 +184,16 @@ struct HfTreeCreatorTccToD0D0Pi {
178184
Configurable<float> ptMinSoftPion{"ptMinSoftPion", 0.0, "Min pt for the soft pion"};
179185
Configurable<bool> usePionIsGlobalTrackWoDCA{"usePionIsGlobalTrackWoDCA", true, "check isGlobalTrackWoDCA status for pions"};
180186

181-
Configurable<float> softPiEtaMax{"softPiEtaMax", 0.9f, "Soft pion max value for pseudorapidity (abs vale)"};
182-
Configurable<float> softPiChi2Max{"softPiChi2Max", 36.f, "Soft pion max value for chi2 ITS"};
183-
Configurable<int> softPiItsHitMap{"softPiItsHitMap", 127, "Soft pion ITS hitmap"};
184-
Configurable<int> softPiItsHitsMin{"softPiItsHitsMin", 1, "Minimum number of ITS layers crossed by the soft pion among those in \"softPiItsHitMap\""};
187+
// Configurable<float> softPiEtaMax{"softPiEtaMax", 0.9f, "Soft pion max value for pseudorapidity (abs vale)"};
188+
// Configurable<float> softPiChi2Max{"softPiChi2Max", 36.f, "Soft pion max value for chi2 ITS"};
189+
// Configurable<int> softPiItsHitMap{"softPiItsHitMap", 127, "Soft pion ITS hitmap"};
190+
// Configurable<int> softPiItsHitsMin{"softPiItsHitsMin", 1, "Minimum number of ITS layers crossed by the soft pion among those in \"softPiItsHitMap\""};
185191
Configurable<float> softPiDcaXYMax{"softPiDcaXYMax", 0.065, "Soft pion max dcaXY (cm)"};
186192
Configurable<float> softPiDcaZMax{"softPiDcaZMax", 0.065, "Soft pion max dcaZ (cm)"};
187193
Configurable<float> deltaMassCanMax{"deltaMassCanMax", 2, "delta candidate max mass (DDPi-D0D0) ((GeV/c2)"};
188194
Configurable<float> massCanMax{"massCanMax", 4.0, "candidate max mass (DDPi) ((GeV/c2)"};
189195

190196
HfHelper hfHelper;
191-
TrackSelection softPiCuts;
192197

193198
using TracksPid = soa::Join<aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa>;
194199
using TracksWPid = soa::Join<aod::TracksWCovDcaExtra, TracksPid, aod::TrackSelection>;
@@ -212,37 +217,6 @@ struct HfTreeCreatorTccToD0D0Pi {
212217
if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) {
213218
LOGP(fatal, "Only one process function can be enabled at a time.");
214219
}
215-
// soft pion setting take from Sigmac analysis by mattia
216-
/// apply the global-track w/o dca cuts for soft pion BEFORE ALL OTHER CUSTOM CUTS
217-
if (usePionIsGlobalTrackWoDCA) {
218-
LOG(info) << ">>> usePionIsGlobalTrackWoDCA==true ==> global-track w/o dca cuts for soft pionapplied BEFORE ALL OTHER CUSTOM CUTS <<<";
219-
/// same configuration as in track selection (itsMatching==1)
220-
softPiCuts = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, 0);
221-
/// remove dca cuts (applied manually after the possible track-to-collision reassociation)
222-
softPiCuts.SetMaxDcaXY(99999);
223-
softPiCuts.SetMaxDcaZ(99999);
224-
}
225-
// kinematics
226-
softPiCuts.SetPtRange(ptMinSoftPion, 1000.); // pt
227-
softPiCuts.SetEtaRange(-softPiEtaMax, softPiEtaMax); // eta
228-
// ITS chi2
229-
softPiCuts.SetMaxChi2PerClusterITS(softPiChi2Max);
230-
// ITS hitmap
231-
std::set<uint8_t> setSoftPiItsHitMap; // = {};
232-
for (int idItsLayer = 0; idItsLayer < 7; idItsLayer++) {
233-
if (TESTBIT(softPiItsHitMap, idItsLayer)) {
234-
setSoftPiItsHitMap.insert(static_cast<uint8_t>(idItsLayer));
235-
}
236-
}
237-
LOG(info) << "### ITS hitmap for soft pion";
238-
LOG(info) << " >>> setSoftPiItsHitMap.size(): " << setSoftPiItsHitMap.size();
239-
LOG(info) << " >>> Custom ITS hitmap dfchecked: ";
240-
for (std::set<uint8_t>::iterator it = setSoftPiItsHitMap.begin(); it != setSoftPiItsHitMap.end(); it++) {
241-
LOG(info) << " Layer " << static_cast<int>(*it) << " ";
242-
}
243-
LOG(info) << "############";
244-
softPiCuts.SetRequireITSRefit();
245-
softPiCuts.SetRequireHitsInITSLayers(softPiItsHitsMin, setSoftPiItsHitMap);
246220
}
247221

248222
template <typename T>
@@ -267,7 +241,7 @@ struct HfTreeCreatorTccToD0D0Pi {
267241
return o2::hf_centrality::getCentralityColl<Coll>(collision);
268242
}
269243

270-
template <int reconstructionType, typename CollType, typename CandType, typename TrkType>
244+
template <typename CollType, typename CandType, typename TrkType>
271245
void runCandCreatorData(CollType const& collision,
272246
CandType const& candidates,
273247
aod::TrackAssoc const& trackIndices,
@@ -277,7 +251,11 @@ struct HfTreeCreatorTccToD0D0Pi {
277251
for (auto candidateD2 = candidateD1 + 1; candidateD2 != candidates.end(); ++candidateD2) {
278252
for (const auto& trackId : trackIndices) {
279253
auto trackPion = trackId.template track_as<TrkType>();
280-
if (!softPiCuts.IsSelected(trackPion)) {
254+
if (usePionIsGlobalTrackWoDCA && !trackPion.isGlobalTrackWoDCA()) {
255+
continue;
256+
}
257+
// minimum pT selection
258+
if (trackPion.pt() < ptMinSoftPion) {
281259
continue;
282260
}
283261
if (std::abs(trackPion.dcaXY()) > softPiDcaXYMax || std::abs(trackPion.dcaZ()) > softPiDcaZMax) {
@@ -367,6 +345,7 @@ struct HfTreeCreatorTccToD0D0Pi {
367345
auto arrayMomentaDDpi = std::array{pVecD1, pVecD2, pVecSoftPion};
368346
const auto massD0D0Pi = RecoDecay::m(std::move(arrayMomentaDDpi), std::array{MassD0, MassD0, MassPiPlus});
369347
const auto deltaMassD0D0Pi = massD0D0Pi - (massD01 + massD02);
348+
const auto massD0D0Pair = RecoDecay::m(std::array{pVecD1, pVecD2}, std::array{MassD0, MassD0});
370349

371350
if (deltaMassD0D0Pi > deltaMassCanMax || massD0D0Pi > massCanMax) {
372351
continue;
@@ -397,6 +376,9 @@ struct HfTreeCreatorTccToD0D0Pi {
397376
massD02,
398377
deltaMassD01,
399378
deltaMassD02,
379+
massD0D0Pair,
380+
massKpipi1,
381+
massKpipi2,
400382
massD0D0Pi,
401383
deltaMassD0D0Pi,
402384
candidateD1.eta(),
@@ -442,7 +424,7 @@ struct HfTreeCreatorTccToD0D0Pi {
442424
if (candwD0ThisColl.size() <= 1)
443425
continue; // only loop the collision that include at least 2 D candidates
444426
auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId);
445-
runCandCreatorData<aod::hf_cand::VertexerType::DCAFitter>(collision, candwD0ThisColl, trackIdsThisCollision, tracks, bcs);
427+
runCandCreatorData(collision, candwD0ThisColl, trackIdsThisCollision, tracks, bcs);
446428
}
447429
}
448430
PROCESS_SWITCH(HfTreeCreatorTccToD0D0Pi, processDataWithMl, "Process data with DCAFitterN with the ML method and without centrality", false);
@@ -461,7 +443,7 @@ struct HfTreeCreatorTccToD0D0Pi {
461443
if (candwD0ThisColl.size() <= 1)
462444
continue; // only loop the collision that include at least 2 D candidates
463445
auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId);
464-
runCandCreatorData<aod::hf_cand::VertexerType::DCAFitter>(collision, candwD0ThisColl, trackIdsThisCollision, tracks, bcs);
446+
runCandCreatorData(collision, candwD0ThisColl, trackIdsThisCollision, tracks, bcs);
465447
}
466448
}
467449
PROCESS_SWITCH(HfTreeCreatorTccToD0D0Pi, processDataWithMlWithFT0C, "Process data with DCAFitterN with the ML method and with FT0C centrality", true);
@@ -480,7 +462,7 @@ struct HfTreeCreatorTccToD0D0Pi {
480462
if (candwD0ThisColl.size() <= 1)
481463
continue; // only loop the collision that include at least 2 D candidates
482464
auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId);
483-
runCandCreatorData<aod::hf_cand::VertexerType::DCAFitter>(collision, candwD0ThisColl, trackIdsThisCollision, tracks, bcs);
465+
runCandCreatorData(collision, candwD0ThisColl, trackIdsThisCollision, tracks, bcs);
484466
}
485467
}
486468
PROCESS_SWITCH(HfTreeCreatorTccToD0D0Pi, processDataWithMlWithFT0M, "Process data with DCAFitterN with the ML method and with FT0M centrality", false);

0 commit comments

Comments
 (0)