Skip to content

Commit 94cb4a9

Browse files
authored
[PWGCF] fix TPD radius oprion for 2trck cuts (#11365)
1 parent 0aca030 commit 94cb4a9

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

PWGCF/Femto3D/Core/femto3dPairTask.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,12 @@ class FemtoPair
222222
}
223223
float GetPhiStarDiff(const float& radius = 1.2) const
224224
{
225-
if (_first != NULL && _second != NULL)
226-
return _first->phiStar(_magfield1, radius) - _second->phiStar(_magfield2, radius);
227-
else
225+
if (_first != NULL && _second != NULL) {
226+
float dphi = _first->phiStar(_magfield1, radius) - _second->phiStar(_magfield2, radius);
227+
return std::fabs(dphi) > o2::constants::math::PI ? (1.0 - 2.0 * o2::constants::math::PI / std::fabs(dphi)) * dphi : dphi;
228+
} else {
228229
return 1000;
230+
}
229231
}
230232
float GetAvgPhiStarDiff() const;
231233

@@ -327,8 +329,7 @@ float FemtoPair<TrackType>::GetAvgPhiStarDiff() const
327329
float res = 0.0;
328330

329331
for (const auto& radius : TPCradii) {
330-
const float dphi = GetPhiStarDiff(radius);
331-
res += std::fabs(dphi) > o2::constants::math::PI ? (1.0 - 2.0 * o2::constants::math::PI / std::fabs(dphi)) * dphi : dphi;
332+
res += GetPhiStarDiff(radius);
332333
}
333334

334335
return res / TPCradii.size();

PWGCF/Femto3D/Tasks/femto3dPairTask.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ struct FemtoCorrelations {
9090
Configurable<int> _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"};
9191
Configurable<std::vector<float>> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector<float>{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"};
9292

93+
Configurable<int> _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"};
94+
Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
9395
Configurable<float> _deta{"deta", 0.01, "minimum allowed defference in eta between two tracks in a pair"};
9496
Configurable<float> _dphi{"dphi", 0.01, "minimum allowed defference in phi_star between two tracks in a pair"};
95-
// Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
9697
Configurable<float> _avgSepTPC{"avgSepTPC", 10, "average sep. (cm) in TPC"};
9798

9899
Configurable<int> _vertexNbinsToMix{"vertexNbinsToMix", 10, "Number of vertexZ bins for the mixing"};
@@ -310,15 +311,15 @@ struct FemtoCorrelations {
310311
LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins (3D)");
311312

312313
if (_fillDetaDphi % 2 == 0)
313-
DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
314+
DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
314315

315-
if (_deta > 0 && _dphi > 0 && Pair->IsClosePair(_deta, _dphi))
316+
if (_deta > 0 && _dphi > 0 && (_dPhiMode.value == 0 ? Pair->IsClosePair(_deta, _dphi, _radiusTPC) : Pair->IsClosePair(_deta, _dphi)))
316317
continue;
317318
if (_avgSepTPC > 0 && Pair->IsClosePair(_avgSepTPC))
318319
continue;
319320

320321
if (_fillDetaDphi > 0)
321-
DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
322+
DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
322323

323324
kThistos[multBin][kTbin]->Fill(pair_kT);
324325
mThistos[multBin][kTbin]->Fill(Pair->GetMt()); // test
@@ -359,21 +360,21 @@ struct FemtoCorrelations {
359360

360361
if (_fillDetaDphi % 2 == 0) {
361362
if (!SE_or_ME)
362-
DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
363+
DoubleTrack_SE_histos_BC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
363364
else
364-
DoubleTrack_ME_histos_BC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
365+
DoubleTrack_ME_histos_BC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
365366
}
366367

367-
if (_deta > 0 && _dphi > 0 && Pair->IsClosePair(_deta, _dphi))
368+
if (_deta > 0 && _dphi > 0 && (_dPhiMode.value == 0 ? Pair->IsClosePair(_deta, _dphi, _radiusTPC) : Pair->IsClosePair(_deta, _dphi)))
368369
continue;
369370
if (_avgSepTPC > 0 && Pair->IsClosePair(_avgSepTPC))
370371
continue;
371372

372373
if (_fillDetaDphi > 0) {
373374
if (!SE_or_ME)
374-
DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
375+
DoubleTrack_SE_histos_AC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
375376
else
376-
DoubleTrack_ME_histos_AC[multBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
377+
DoubleTrack_ME_histos_AC[multBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
377378
}
378379

379380
if (!SE_or_ME) {

PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ struct FemtoCorrelationsMC {
8686
Configurable<int> _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"};
8787
Configurable<std::vector<float>> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector<float>{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"};
8888

89-
// Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
89+
Configurable<int> _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"};
90+
Configurable<float> _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
9091

9192
Configurable<int> _vertexNbinsToMix{"vertexNbinsToMix", 10, "Number of vertexZ bins for the mixing"};
9293
Configurable<std::vector<float>> _centBins{"multBins", std::vector<float>{0.0f, 100.0f}, "multiplicity percentile/centrality binning (min:0, max:100)"};
@@ -257,7 +258,7 @@ struct FemtoCorrelationsMC {
257258
LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins");
258259

259260
kThistos[centBin][kTbin]->Fill(pair_kT);
260-
DoubleTrack_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
261+
DoubleTrack_SE_histos[centBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
261262
AvgSep_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgSep());
262263
Pair->ResetPair();
263264
}
@@ -281,7 +282,7 @@ struct FemtoCorrelationsMC {
281282
LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins");
282283

283284
kThistos[centBin][kTbin]->Fill(pair_kT);
284-
DoubleTrack_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
285+
DoubleTrack_SE_histos[centBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
285286
AvgSep_SE_histos[centBin][kTbin]->Fill(Pair->GetAvgSep());
286287
Pair->ResetPair();
287288
}
@@ -304,7 +305,7 @@ struct FemtoCorrelationsMC {
304305
if (kTbin > Resolution_histos[centBin].size() || kTbin > DoubleTrack_ME_histos[centBin].size())
305306
LOGF(fatal, "kTbin value obtained for a pair exceeds the configured number of kT bins");
306307

307-
DoubleTrack_ME_histos[centBin][kTbin]->Fill(Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
308+
DoubleTrack_ME_histos[centBin][kTbin]->Fill(_dPhiMode.value == 0 ? Pair->GetPhiStarDiff(_radiusTPC) : Pair->GetAvgPhiStarDiff(), Pair->GetEtaDiff());
308309
AvgSep_ME_histos[centBin][kTbin]->Fill(Pair->GetAvgSep());
309310

310311
if (abs(ii->pdgCode()) != _particlePDG_1.value || abs(iii->pdgCode()) != _particlePDG_2.value)

0 commit comments

Comments
 (0)