Skip to content

Commit eabfe0e

Browse files
committed
Change Phi binning range and add QA histogram to monitor centrality distribution
1 parent 59d44b3 commit eabfe0e

File tree

1 file changed

+58
-14
lines changed

1 file changed

+58
-14
lines changed

PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ struct lambdaspincorrderived {
191191
TH3D* hweight22;
192192
TH3D* hweight32;
193193
TH3D* hweight42;
194+
TH2D* hweightCentPair = nullptr;
194195

196+
Configurable<std::string> ConfWeightPathCentPair{"ConfWeightPathCentPair", "", "Centrality x pair-type weight path"};
195197
Configurable<std::string> ConfWeightPathLL{"ConfWeightPathLL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"};
196198
Configurable<std::string> ConfWeightPathALAL{"ConfWeightPathALAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"};
197199
Configurable<std::string> ConfWeightPathLAL{"ConfWeightPathLAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"};
@@ -278,6 +280,9 @@ struct lambdaspincorrderived {
278280
histos.add("ptCent", "ptCent", HistType::kTH2D, {{100, 0.0, 10.0}, {8, 0.0, 80.0}}, true);
279281
histos.add("etaCent", "etaCent", HistType::kTH2D, {{32, -0.8, 0.8}, {8, 0.0, 80.0}}, true);
280282

283+
histos.add("hCentPairTypeSE", "SE pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}});
284+
histos.add("hCentPairTypeME", "ME pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}});
285+
281286
// --- 3D SE/ME pair-space maps per category (LL, LAL, ALL, ALAL)
282287
histos.add("SE_LL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true);
283288
histos.add("SE_LAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true);
@@ -368,6 +373,9 @@ struct lambdaspincorrderived {
368373
hweight32 = ccdb->getForTimeStamp<TH3D>(ConfWeightPathALL2.value, cfgCcdbParam.nolaterthan.value);
369374
hweight42 = ccdb->getForTimeStamp<TH3D>(ConfWeightPathALAL2.value, cfgCcdbParam.nolaterthan.value);
370375
}
376+
if (!ConfWeightPathCentPair.value.empty()) {
377+
hweightCentPair = ccdb->getForTimeStamp<TH2D>(ConfWeightPathCentPair.value, cfgCcdbParam.nolaterthan.value);
378+
}
371379
}
372380

373381
template <typename T>
@@ -694,6 +702,18 @@ struct lambdaspincorrderived {
694702
}
695703
}
696704

705+
static inline int pairTypeCode(int tag1, int tag2)
706+
{
707+
if (tag1 == 0 && tag2 == 0) {
708+
return 0; // LL
709+
} else if (tag1 == 0 && tag2 == 1) {
710+
return 1; // LAL
711+
} else if (tag1 == 1 && tag2 == 0) {
712+
return 2; // ALL
713+
} else {
714+
return 3; // ALAL
715+
}
716+
}
697717
ROOT::Math::PtEtaPhiMVector lambda0, proton0;
698718
ROOT::Math::PtEtaPhiMVector lambda, proton;
699719
ROOT::Math::PtEtaPhiMVector lambda2, proton2;
@@ -737,6 +757,8 @@ struct lambdaspincorrderived {
737757
proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton);
738758
lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass());
739759
histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi));
760+
const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status());
761+
histos.fill(HIST("hCentPairTypeSE"), collision.cent(), ptype, 1.0);
740762
if (v0.v0Status() == 0 && v02.v0Status() == 0) {
741763
fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0);
742764
}
@@ -1030,7 +1052,8 @@ struct lambdaspincorrderived {
10301052
MixBinner(float ptMin_, float ptMax_, float ptStep_,
10311053
float etaAbsMax, float etaStep_,
10321054
float phiStep_)
1033-
: ptMin(ptMin_), ptMax(ptMax_), ptStep(ptStep_), etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), phiMin(0.f), phiMax(static_cast<float>(2.0 * TMath::Pi())), phiStep(phiStep_)
1055+
: ptMin(ptMin_), ptMax(ptMax_), ptStep(ptStep_), etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), phiMin(-static_cast<float>(TMath::Pi())), phiMax(+static_cast<float>(TMath::Pi())), phiStep(phiStep_)
1056+
// : ptMin(ptMin_), ptMax(ptMax_), ptStep(ptStep_), etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), phiMin(0.f), phiMax(static_cast<float>(2.0 * TMath::Pi())), phiStep(phiStep_)
10341057
{
10351058
ptStep = (ptStep > 0.f ? ptStep : 0.1f);
10361059
etaStep = (etaStep > 0.f ? etaStep : 0.1f);
@@ -1138,7 +1161,7 @@ struct lambdaspincorrderived {
11381161
// Bin kinematics (φ already constrained via your call-site)
11391162
const int ptB = mb.ptBin(t.lambdaPt());
11401163
const int etaB = mb.etaBin(t.lambdaEta());
1141-
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), 0.0F, harmonic));
1164+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), -TMath::Pi(), harmonic));
11421165
const int mB = mb.massBin(t.lambdaMass());
11431166
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0)
11441167
continue;
@@ -1187,7 +1210,7 @@ struct lambdaspincorrderived {
11871210
// Bin of t1 defines where to search (exact bin, but handle φ wrap at edges)
11881211
const int ptB = mb.ptBin(t1.lambdaPt());
11891212
const int etaB = mb.etaBin(t1.lambdaEta());
1190-
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), 0.0F, harmonic));
1213+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), -TMath::Pi(), harmonic));
11911214
const int mB = mb.massBin(t1.lambdaMass());
11921215
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0)
11931216
continue;
@@ -1410,6 +1433,8 @@ struct lambdaspincorrderived {
14101433
RecoDecay::constrainAngle(mcacc::lamPhi(v0) - mcacc::lamPhi(v02),
14111434
-TMath::Pi(), harmonicDphi));
14121435

1436+
const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02));
1437+
histos.fill(HIST("hCentPairTypeSE"), mcacc::cent(collision), ptype, 1.0);
14131438
// datatype=0 (same event)
14141439
fillHistograms(mcacc::v0Status(v0), mcacc::v0Status(v02),
14151440
lambda, lambda2, proton, proton2,
@@ -1573,7 +1598,7 @@ struct lambdaspincorrderived {
15731598

15741599
const int ptB = mb.ptBin(mcacc::lamPt(t));
15751600
const int etaB = mb.etaBin(mcacc::lamEta(t));
1576-
const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), 0.0F, harmonic));
1601+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), -TMath::Pi(), harmonic));
15771602
const int mB = mb.massBin(mcacc::lamMass(t));
15781603
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) {
15791604
continue;
@@ -1625,7 +1650,7 @@ struct lambdaspincorrderived {
16251650

16261651
const int ptB = mb.ptBin(mcacc::lamPt(t1));
16271652
const int etaB = mb.etaBin(mcacc::lamEta(t1));
1628-
const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t1), 0.0F, harmonic));
1653+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t1), -TMath::Pi(), harmonic));
16291654
const int mB = mb.massBin(mcacc::lamMass(t1));
16301655
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) {
16311656
continue;
@@ -1846,7 +1871,7 @@ struct lambdaspincorrderived {
18461871
etaB = mb.etaBin(lv.Rapidity()); // treat "eta axis" as rapidity axis
18471872
}
18481873

1849-
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), 0.0F, harmonic));
1874+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), -TMath::Pi(), harmonic));
18501875
const int mB = mb.massBin(t.lambdaMass());
18511876

18521877
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) {
@@ -1919,7 +1944,7 @@ struct lambdaspincorrderived {
19191944
etaB = mb.etaBin(lv1.Rapidity());
19201945
}
19211946

1922-
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), 0.0F, harmonic));
1947+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), -TMath::Pi(), harmonic));
19231948
const int mB = mb.massBin(t1.lambdaMass());
19241949

19251950
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) {
@@ -2011,12 +2036,22 @@ struct lambdaspincorrderived {
20112036
auto lambda2 = ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(),
20122037
t2.lambdaMass());
20132038

2039+
const int ptype = pairTypeCode(tX.v0Status(), t2.v0Status());
2040+
double centPairWeight = 1.0;
2041+
if (hweightCentPair) {
2042+
const int bin = hweightCentPair->FindBin(col1.cent(), ptype);
2043+
centPairWeight = hweightCentPair->GetBinContent(bin);
2044+
if (centPairWeight <= 0.0) {
2045+
centPairWeight = 1.0;
2046+
}
2047+
}
2048+
const float meWeight = wBase * centPairWeight;
20142049
const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi());
20152050
histos.fill(HIST("deltaPhiMix"), dPhi, wBase);
2016-
2051+
histos.fill(HIST("hCentPairTypeME"), col1.cent(), ptype, wBase);
20172052
fillHistograms(tX.v0Status(), t2.v0Status(),
20182053
lambda, lambda2, proton, proton2,
2019-
/*datatype=*/1, /*mixpairweight=*/wBase);
2054+
/*datatype=*/1, /*mixpairweight=*/meWeight);
20202055
}
20212056
}
20222057
}
@@ -2076,7 +2111,7 @@ struct lambdaspincorrderived {
20762111
etaB = mb.etaBin(lv.Rapidity());
20772112
}
20782113

2079-
const int phiB = mb.phiBin(phi0To2Pi(mcacc::lamPhi(t)));
2114+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), -TMath::Pi(), harmonic));
20802115
if (ptB < 0 || etaB < 0 || phiB < 0) {
20812116
continue;
20822117
}
@@ -2142,8 +2177,7 @@ struct lambdaspincorrderived {
21422177
mcacc::lamPhi(t1), mcacc::lamMass(t1));
21432178
etaB = mb.etaBin(lv1.Rapidity());
21442179
}
2145-
2146-
const int phiB = mb.phiBin(phi0To2Pi(mcacc::lamPhi(t1)));
2180+
const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t1), -TMath::Pi(), harmonic));
21472181
if (ptB < 0 || etaB < 0 || phiB < 0) {
21482182
continue;
21492183
}
@@ -2230,12 +2264,22 @@ struct lambdaspincorrderived {
22302264
auto l2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2),
22312265
mcacc::lamMass(t2));
22322266

2267+
const int ptype = pairTypeCode(mcacc::v0Status(tX), mcacc::v0Status(t2));
2268+
double centPairWeight = 1.0;
2269+
if (hweightCentPair) {
2270+
const int bin = hweightCentPair->FindBin(mcacc::cent(col1), ptype);
2271+
centPairWeight = hweightCentPair->GetBinContent(bin);
2272+
if (centPairWeight <= 0.0) {
2273+
centPairWeight = 1.0;
2274+
}
2275+
}
2276+
const float meWeight = wBase * centPairWeight;
22332277
const float dPhi = deltaPhiMinusPiToPi((float)lX.Phi(), (float)l2.Phi());
22342278
histos.fill(HIST("deltaPhiMix"), dPhi, wBase);
2235-
2279+
histos.fill(HIST("hCentPairTypeME"), mcacc::cent(col1), ptype, wBase);
22362280
fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2),
22372281
lX, l2, pX, p2,
2238-
/*datatype=*/1, /*mixpairweight=*/wBase);
2282+
/*datatype=*/1, /*mixpairweight=*/meWeight);
22392283
}
22402284
}
22412285
}

0 commit comments

Comments
 (0)