Skip to content

Commit e80c2c8

Browse files
sangwoo184sangwoo
andauthored
[PWGLF] Add a configuration flag and change configuration names (#11115)
Co-authored-by: sangwoo <sangwoo@sangwooui-MacBookPro.local>
1 parent 5b04060 commit e80c2c8

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// #include <iostream>
2323
#include <string>
2424

25-
#include "TLorentzVector.h"
25+
// #include "TLorentzVector.h"
2626
#include "TRandom3.h"
2727
#include "TF1.h"
2828
#include "TVector2.h"
@@ -103,9 +103,9 @@ struct F0980pbpbanalysis {
103103
Configurable<float> cfgRapMin{"cfgRapMin", -0.5, "Minimum rapidity for pair"};
104104
Configurable<float> cfgRapMax{"cfgRapMax", 0.5, "Maximum rapidity for pair"};
105105

106-
Configurable<bool> cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"};
107-
Configurable<bool> cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"};
108-
Configurable<bool> cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"};
106+
Configurable<bool> cfgIsPrimaryTrack{"cfgIsPrimaryTrack", true, "Primary track selection"};
107+
Configurable<bool> cfgIsGlobalWoDCATrack{"cfgIsGlobalWoDCATrack", true, "Global track selection without DCA"};
108+
Configurable<bool> cfgIsPVContributor{"cfgIsPVContributor", true, "PV contributor track selection"};
109109

110110
Configurable<double> cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF
111111
Configurable<double> cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC
@@ -125,13 +125,14 @@ struct F0980pbpbanalysis {
125125
Configurable<int> cfgRotBkgNum{"cfgRotBkgNum", 10, "the number of rotational backgrounds"};
126126

127127
// for phi test
128-
Configurable<bool> cfgTPCFinableClsSel{"cfgTPCFinableClsSel", true, "TPC Crossed Rows to Findable Clusters selection flag"};
128+
Configurable<bool> cfgRatioTPCRowsFinableClsSel{"cfgRatioTPCRowsFinableClsSel", true, "TPC Crossed Rows to Findable Clusters selection flag"};
129129
Configurable<bool> cfgITSClsSel{"cfgITSClsSel", false, "ITS cluster selection flag"};
130130
Configurable<int> cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"};
131131
Configurable<bool> cfgTOFBetaSel{"cfgTOFBetaSel", false, "TOF beta cut selection flag"};
132132
Configurable<float> cfgTOFBetaCut{"cfgTOFBetaCut", 0.0, "cut TOF beta"};
133133
Configurable<bool> cfgDeepAngleSel{"cfgDeepAngleSel", true, "Deep Angle cut"};
134134
Configurable<double> cfgDeepAngle{"cfgDeepAngle", 0.04, "Deep Angle cut value"};
135+
Configurable<bool> cfgTrackIndexSel{"cfgTrackIndexSel", false, "Index selection flag"};
135136

136137
ConfigurableAxis massAxis{"massAxis", {400, 0.2, 2.2}, "Invariant mass axis"};
137138
ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"};
@@ -263,19 +264,19 @@ struct F0980pbpbanalysis {
263264
if (std::fabs(track.dcaZ()) > cfgMaxDCAzToPVcut) {
264265
return 0;
265266
}
266-
if (cfgPVContributor && !track.isPVContributor()) {
267+
if (cfgIsPVContributor && !track.isPVContributor()) {
267268
return 0;
268269
}
269-
if (cfgPrimaryTrack && !track.isPrimaryTrack()) {
270+
if (cfgIsPrimaryTrack && !track.isPrimaryTrack()) {
270271
return 0;
271272
}
272-
if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) {
273+
if (cfgIsGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) {
273274
return 0;
274275
}
275276
if (track.tpcNClsFound() < cfgTPCcluster) {
276277
return 0;
277278
}
278-
if (cfgTPCFinableClsSel && track.tpcCrossedRowsOverFindableCls() < cfgRatioTPCRowsOverFindableCls) {
279+
if (cfgRatioTPCRowsFinableClsSel && track.tpcCrossedRowsOverFindableCls() < cfgRatioTPCRowsOverFindableCls) {
279280
return 0;
280281
}
281282
if (cfgITSClsSel && track.itsNCls() < cfgITScluster) {
@@ -389,7 +390,7 @@ struct F0980pbpbanalysis {
389390
histos.fill(HIST("QA/EPResAC"), centrality, std::cos(static_cast<float>(nmode) * (eventPlaneDet - eventPlaneRefB)));
390391
histos.fill(HIST("QA/EPResBC"), centrality, std::cos(static_cast<float>(nmode) * (eventPlaneRefA - eventPlaneRefB)));
391392

392-
TLorentzVector pion1, pion2, pion2Rot, reco, recoRot;
393+
ROOT::Math::PxPyPzMVector pion1, pion2, pion2Rot, reco, recoRot;
393394
for (const auto& trk1 : dTracks) {
394395
if (!trackSelected(trk1)) {
395396
continue;
@@ -419,16 +420,16 @@ struct F0980pbpbanalysis {
419420
histos.fill(HIST("QA/TPC_TOF_selected"), getTpcNSigma(trk2), getTofNSigma(trk2));
420421
}
421422

422-
if (cfgSelectPID == PIDList::PIDTest && trk2.globalIndex() == trk1.globalIndex()) {
423+
if (cfgTrackIndexSel && cfgSelectPID == PIDList::PIDTest && trk2.globalIndex() <= trk1.globalIndex()) {
423424
continue;
424425
}
425426

426427
if (cfgSelectPID == PIDList::PIDTest && !selectionPair(trk1, trk2)) {
427428
continue;
428429
}
429430

430-
pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPtl);
431-
pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPtl);
431+
pion1 = ROOT::Math::PxPyPzMVector(trk1.px(), trk1.py(), trk1.pz(), massPtl);
432+
pion2 = ROOT::Math::PxPyPzMVector(trk2.px(), trk2.py(), trk2.pz(), massPtl);
432433
reco = pion1 + pion2;
433434

434435
if (reco.Rapidity() > cfgRapMax || reco.Rapidity() < cfgRapMin) {
@@ -449,7 +450,7 @@ struct F0980pbpbanalysis {
449450
for (int nr = 0; nr < cfgRotBkgNum; nr++) {
450451
auto randomPhi = rn->Uniform(o2::constants::math::PI * 5.0 / 6.0, o2::constants::math::PI * 7.0 / 6.0);
451452
randomPhi += pion2.Phi();
452-
pion2Rot.SetXYZM(pion2.Pt() * std::cos(randomPhi), pion2.Pt() * std::sin(randomPhi), trk2.pz(), massPtl);
453+
pion2Rot = ROOT::Math::PxPyPzMVector(pion2.Pt() * std::cos(randomPhi), pion2.Pt() * std::sin(randomPhi), trk2.pz(), massPtl);
453454
recoRot = pion1 + pion2Rot;
454455
relPhiRot = TVector2::Phi_0_2pi((recoRot.Phi() - eventPlaneDet) * static_cast<float>(nmode));
455456
histos.fill(HIST("hInvMass_f0980_USRot_EPA"), recoRot.M(), recoRot.Pt(), centrality, relPhiRot);

0 commit comments

Comments
 (0)