Skip to content

Commit 739afe1

Browse files
Use FT0M centrality for pp and FT0C for other systems
1 parent ea0b3ab commit 739afe1

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

PWGLF/TableProducer/Strangeness/sigma0builder.cxx

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ struct sigma0builder {
503503
if (fillHists)
504504
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);
505505

506-
histos.fill(HIST("hEventCentrality"), collision.centFT0C());
506+
float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
507+
histos.fill(HIST("hEventCentrality"), centrality);
507508
return true;
508509
}
509510

@@ -751,6 +752,7 @@ struct sigma0builder {
751752
float pi0Mass = RecoDecay::m(arrpi0, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassPhoton});
752753
float pi0Pt = RecoDecay::pt(std::array{gamma1.px() + gamma2.px(), gamma1.py() + gamma2.py()});
753754
float pi0Y = RecoDecay::y(std::array{gamma1.px() + gamma2.px(), gamma1.py() + gamma2.py(), gamma1.pz() + gamma2.pz()}, o2::constants::physics::MassPi0);
755+
float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
754756

755757
// MC-specific variables
756758
bool fIsPi0 = false, fIsMC = false;
@@ -766,12 +768,12 @@ struct sigma0builder {
766768
gamma1MC.pdgCodeMother() == 111 && gamma2MC.pdgCodeMother() == 111 &&
767769
gamma1.motherMCPartId() == gamma2.motherMCPartId()) {
768770
fIsPi0 = true;
769-
histos.fill(HIST("Pi0QA/h3dMassPi0BeforeSel_MCAssoc"), collision.centFT0C(), pi0Pt, pi0Mass);
771+
histos.fill(HIST("Pi0QA/h3dMassPi0BeforeSel_MCAssoc"), centrality, pi0Pt, pi0Mass);
770772
}
771773
}
772774
}
773775

774-
histos.fill(HIST("Pi0QA/h3dMassPi0BeforeSel_Candidates"), collision.centFT0C(), pi0Pt, pi0Mass);
776+
histos.fill(HIST("Pi0QA/h3dMassPi0BeforeSel_Candidates"), centrality, pi0Pt, pi0Mass);
775777

776778
// Photon-specific selections
777779
auto posTrackGamma1 = gamma1.template posTrackExtra_as<dauTracks>();
@@ -780,7 +782,7 @@ struct sigma0builder {
780782
auto negTrackGamma2 = gamma2.template negTrackExtra_as<dauTracks>();
781783

782784
// Gamma1 Selection
783-
bool passedTPCGamma1 = (TMath::Abs(posTrackGamma1.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas) ||
785+
bool passedTPCGamma1 = (TMath::Abs(posTrackGamma1.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas) ||
784786
(TMath::Abs(negTrackGamma1.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas);
785787

786788
if (TMath::Abs(gamma1.mGamma()) > Pi0PhotonMaxMass ||
@@ -827,9 +829,9 @@ struct sigma0builder {
827829
}
828830

829831
// Fill histograms
830-
histos.fill(HIST("Pi0QA/h3dMassPi0AfterSel_Candidates"), collision.centFT0C(), pi0Pt, pi0Mass);
832+
histos.fill(HIST("Pi0QA/h3dMassPi0AfterSel_Candidates"), centrality, pi0Pt, pi0Mass);
831833
if (fIsMC && fIsPi0)
832-
histos.fill(HIST("Pi0QA/h3dMassPi0AfterSel_MCAssoc"), collision.centFT0C(), pi0Pt, pi0Mass);
834+
histos.fill(HIST("Pi0QA/h3dMassPi0AfterSel_MCAssoc"), centrality, pi0Pt, pi0Mass);
833835
}
834836

835837
// Process photon candidate
@@ -873,7 +875,8 @@ struct sigma0builder {
873875
return false;
874876
histos.fill(HIST("PhotonSel/hSelectionStatistics"), 6.);
875877
}
876-
histos.fill(HIST("PhotonSel/h3dPhotonMass"), collision.centFT0C(), gamma.pt(), gamma.mGamma());
878+
float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
879+
histos.fill(HIST("PhotonSel/h3dPhotonMass"), centrality, gamma.pt(), gamma.mGamma());
877880
return true;
878881
}
879882

@@ -917,8 +920,9 @@ struct sigma0builder {
917920
histos.fill(HIST("LambdaSel/hSelectionStatistics"), 6.);
918921
}
919922

920-
histos.fill(HIST("LambdaSel/h3dLambdaMass"), collision.centFT0C(), lambda.pt(), lambda.mLambda());
921-
histos.fill(HIST("LambdaSel/h3dALambdaMass"), collision.centFT0C(), lambda.pt(), lambda.mAntiLambda());
923+
float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
924+
histos.fill(HIST("LambdaSel/h3dLambdaMass"), centrality, lambda.pt(), lambda.mLambda());
925+
histos.fill(HIST("LambdaSel/h3dALambdaMass"), centrality, lambda.pt(), lambda.mAntiLambda());
922926

923927
return true;
924928
}
@@ -940,9 +944,10 @@ struct sigma0builder {
940944
float sigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0});
941945
float sigmaY = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0);
942946
float SigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()});
947+
float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C();
943948

944949
// Before any selection
945-
histos.fill(HIST("SigmaSel/h3dMassSigma0BeforeSel"), collision.centFT0C(), SigmapT, sigmaMass);
950+
histos.fill(HIST("SigmaSel/h3dMassSigma0BeforeSel"), centrality, SigmapT, sigmaMass);
946951

947952
histos.fill(HIST("SigmaSel/hSelectionStatistics"), 1.);
948953
histos.fill(HIST("SigmaSel/hSigmaMass"), sigmaMass);
@@ -975,7 +980,7 @@ struct sigma0builder {
975980
histos.fill(HIST("GeneralQA/h2dV0XY"), gamma.x(), gamma.y());
976981
}
977982

978-
histos.fill(HIST("SigmaSel/h3dMassSigma0AfterSel"), collision.centFT0C(), SigmapT, sigmaMass);
983+
histos.fill(HIST("SigmaSel/h3dMassSigma0AfterSel"), centrality, SigmapT, sigmaMass);
979984

980985
return true;
981986
}
@@ -1141,7 +1146,7 @@ struct sigma0builder {
11411146
// Do analysis with collision-grouped V0s, retain full collision information
11421147
const uint64_t collIdx = coll.globalIndex();
11431148
auto V0s = fullV0s.sliceBy(perCollisionMCDerived, collIdx);
1144-
float centrality = coll.centFT0C();
1149+
float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C();
11451150

11461151
bool fhasMCColl = false;
11471152
if (coll.has_straMCCollision())
@@ -1186,10 +1191,10 @@ struct sigma0builder {
11861191
histos.fill(HIST("MC/h2dPtVsCentralityBeforeSel_MCAssocALambda"), centrality, v0.pt());
11871192
}
11881193

1189-
if (processPhotonCandidate(v0, coll)) // selecting photons
1194+
if (processPhotonCandidate(v0, coll)) // selecting photons
11901195
bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates
11911196

1192-
if (processLambdaCandidate(v0, coll)) // selecting lambdas
1197+
if (processLambdaCandidate(v0, coll)) // selecting lambdas
11931198
bestLambdasArray.push_back(v0.globalIndex()); // Save indices of best lambda candidates
11941199
}
11951200

@@ -1279,7 +1284,7 @@ struct sigma0builder {
12791284
if (fIsAntiSigma)
12801285
histos.fill(HIST("MC/h2dPtVsCentralityBeforeSel_MCAssocASigma0"), centrality, SigmaMCpT);
12811286
}
1282-
1287+
12831288
// Build sigma0 candidate, please
12841289
if (!buildSigma0(lambda, gamma, coll))
12851290
continue;
@@ -1300,7 +1305,7 @@ struct sigma0builder {
13001305
LambdaCandPDGCode, LambdaCandPDGCodeMother, fIsLambdaPrimary, LambdaMCpT, fIsLambdaCorrectlyAssign);
13011306

13021307
// Filling tables with accepted candidates
1303-
fillTables(lambda, gamma, coll);
1308+
fillTables(lambda, gamma, coll);
13041309

13051310
nSigmaCandidates++;
13061311
if (nSigmaCandidates % 10000 == 0)
@@ -1315,12 +1320,12 @@ struct sigma0builder {
13151320
for (const auto& coll : collisions) {
13161321

13171322
if (!IsEventAccepted(coll, true))
1318-
continue;
1323+
continue;
13191324

13201325
// Do analysis with collision-grouped V0s, retain full collision information
13211326
const uint64_t collIdx = coll.globalIndex();
13221327
auto V0s = fullV0s.sliceBy(perCollisionSTDDerived, collIdx);
1323-
float centrality = coll.centFT0C();
1328+
float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C();
13241329

13251330
//_______________________________________________
13261331
// Retrieving IR info
@@ -1340,10 +1345,10 @@ struct sigma0builder {
13401345
//_______________________________________________
13411346
// V0s loop
13421347
for (auto& v0 : V0s) {
1343-
if (processPhotonCandidate(v0, coll)) // selecting photons
1348+
if (processPhotonCandidate(v0, coll)) // selecting photons
13441349
bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates
13451350

1346-
if (processLambdaCandidate(v0, coll)) // selecting lambdas
1351+
if (processLambdaCandidate(v0, coll)) // selecting lambdas
13471352
bestLambdasArray.push_back(v0.globalIndex()); // Save indices of best lambda candidates
13481353
}
13491354

@@ -1362,17 +1367,17 @@ struct sigma0builder {
13621367
//_______________________________________________
13631368
// Sigma0 nested loop
13641369
for (size_t i = 0; i < bestGammasArray.size(); ++i) {
1365-
auto gamma = fullV0s.rawIteratorAt(bestGammasArray[i]);
1370+
auto gamma = fullV0s.rawIteratorAt(bestGammasArray[i]);
13661371

13671372
for (size_t j = 0; j < bestLambdasArray.size(); ++j) {
13681373
auto lambda = fullV0s.rawIteratorAt(bestLambdasArray[j]);
1369-
1374+
13701375
// Building sigma0 candidate
13711376
if (!buildSigma0(lambda, gamma, coll))
1372-
continue;
1377+
continue;
13731378

13741379
// Filling tables with accepted candidates
1375-
fillTables(lambda, gamma, coll);
1380+
fillTables(lambda, gamma, coll);
13761381

13771382
nSigmaCandidates++;
13781383
if (nSigmaCandidates % 10000 == 0)

0 commit comments

Comments
 (0)