Skip to content

Commit cdd552f

Browse files
committed
Feat: add pair-wise kstar histograms to triplet hist manager
1 parent 9256063 commit cdd552f

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

PWGCF/Femto/Core/tripletHistManager.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ enum TripletHist {
4444
// standard 1D
4545
kQ3,
4646
kMt, // averate mt of all pairs in the triplet
47+
// kstar betweeen single particles
48+
kKstar12,
49+
kKstar13,
50+
kKstar23,
4751
// standard 2D
4852
kPt1VsQ3,
4953
kPt2VsQ3,
@@ -106,13 +110,15 @@ struct ConfTripletBinning : o2::framework::ConfigurableGroup {
106110
std::string prefix = std::string("TripletBinning");
107111
o2::framework::Configurable<bool> plot1D{"plot1D", true, "Enable 1D histograms"};
108112
o2::framework::Configurable<bool> plot2D{"plot2D", true, "Enable 2D histograms"};
113+
o2::framework::Configurable<bool> plotKstar{"plotKstar", false, "Enable kstar histograms"};
109114
o2::framework::Configurable<bool> plotPt1VsPt2VsPt3{"plotPt1VsPt2VsPt3", false, "Enable 3D histogram (Pt1 vs Pt2 vs Pt3)"};
110115
o2::framework::Configurable<bool> plotQ3VsPt1VsPt2VsPt3{"plotQ3VsPt1VsPt2VsPt3", false, "Enable 4D histogram (Q3 vs Pt1 vs Pt2 vs Pt3)"};
111116
o2::framework::Configurable<bool> plotQ3VsMtVsMult{"plotQ3VsMtVsMult", false, "Enable 3D histogram (Q3 vs Mt vs Mult)"};
112117
o2::framework::Configurable<bool> plotQ3VsMtVsMultVsCent{"plotQ3VsMtVsMultVsCent", false, "Enable 4D histogram (Q3 vs Mt vs Mult Vs Cent)"};
113118
o2::framework::Configurable<bool> plotQ3VsMtVsPt1VsPt2VsPt3VsMult{"plotQ3VsMtVsPt1VsPt2VsPt3VsMult", false, "Enable 6D histogram (Q3 vs Mt Vs Pt1 vs Pt2 vs Pt3 vs Mult)"};
114119
o2::framework::Configurable<bool> plotQ3VsMtVsPt1VsPt2VsPt3VsMultVsCent{"plotQ3VsMtVsPt1VsPt2VsPt3VsMultVsCent", false, "Enable 7D histogram (Q3 vs Mt Vs Pt1 vs Pt2 vs Pt3 vs Mult vs Cent)"};
115120
o2::framework::ConfigurableAxis q3{"q3", {{600, 0, 6}}, "q3"};
121+
o2::framework::ConfigurableAxis kstar{"kstar", {{600, 0, 6}}, "kstar (between pairs of particles)"};
116122
o2::framework::ConfigurableAxis mt{"mt", {{500, 0.8, 5.8}}, "mt"};
117123
o2::framework::ConfigurableAxis multiplicity{"multiplicity", {{50, 0, 200}}, "multiplicity"};
118124
o2::framework::ConfigurableAxis centrality{"centrality", {{10, 0, 100}}, "centrality (mult. percentile)"};
@@ -142,6 +148,9 @@ constexpr std::array<histmanager::HistInfo<TripletHist>, kTripletHistogramLast>
142148
// 1D
143149
{kQ3, o2::framework::HistType::kTH1F, "hQ3", "Q_{3}; Q_{3} (GeV/#it{c}); Entries"},
144150
{kMt, o2::framework::HistType::kTH1F, "hMt", "transverse mass; m_{T} (GeV/#it{c}^{2}); Entries"},
151+
{kKstar12, o2::framework::HistType::kTH1F, "hKstar12", "k* between particle 1 and particle 2; k* (GeV/#it{c}); Entries"},
152+
{kKstar13, o2::framework::HistType::kTH1F, "hKstar13", "k* between particle 1 and particle 3; k* (GeV/#it{c}); Entries"},
153+
{kKstar23, o2::framework::HistType::kTH1F, "hKstar23", "k* between particle 2 and particle 3; k* (GeV/#it{c}); Entries"},
145154
// 2D
146155
{kPt1VsQ3, o2::framework::HistType::kTH2F, "hPt1VsQ3", "p_{T,1} vs Q_{3}; p_{T,1} (GeV/#it{c}); Q_{3} (GeV/#it{c})"},
147156
{kPt2VsQ3, o2::framework::HistType::kTH2F, "hPt2VsQ3", "p_{T,2} vs Q_{3}; p_{T,2} (GeV/#it{c}); Q_{3} (GeV/#it{c})"},
@@ -173,6 +182,9 @@ constexpr std::array<histmanager::HistInfo<TripletHist>, kTripletHistogramLast>
173182
#define TRIPLET_HIST_ANALYSIS_MAP(conf, confMixing) \
174183
{kQ3, {(conf).q3}}, \
175184
{kMt, {(conf).mt}}, \
185+
{kKstar12, {(conf).kstar}}, \
186+
{kKstar13, {(conf).kstar}}, \
187+
{kKstar23, {(conf).kstar}}, \
176188
{kPt1VsQ3, {(conf).pt1, (conf).q3}}, \
177189
{kPt2VsQ3, {(conf).pt2, (conf).q3}}, \
178190
{kPt3VsQ3, {(conf).pt3, (conf).q3}}, \
@@ -261,6 +273,7 @@ class TripletHistManager
261273
mMtMin = ConfTripletCuts.mtMin.value;
262274
mMtMax = ConfTripletCuts.mtMax.value;
263275

276+
mPlotKstar = ConfTripletBinning.plotKstar.value;
264277
mPlotPt1VsPt2VsPt3 = ConfTripletBinning.plotPt1VsPt2VsPt3.value;
265278
mPlotQ3VsPt1VsPt2VsPt3 = ConfTripletBinning.plotQ3VsPt1VsPt2VsPt3.value;
266279
mPlotQ3VsMtVsMult = ConfTripletBinning.plotQ3VsMtVsMult.value;
@@ -314,6 +327,10 @@ class TripletHistManager
314327
// set Q3
315328
mQ3 = getQ3(mParticle1, mParticle2, mParticle3);
316329

330+
mKstar12 = getKstar(mParticle1, mParticle2);
331+
mKstar13 = getKstar(mParticle1, mParticle3);
332+
mKstar23 = getKstar(mParticle2, mParticle3);
333+
317334
// if one of the particles has a mass getter, we cache the value for the filling later
318335
if constexpr (utils::HasMass<T1>) {
319336
mMass1 = particle1.mass();
@@ -495,6 +512,24 @@ class TripletHistManager
495512
return static_cast<float>(std::sqrt(-q));
496513
}
497514

515+
float getKstar(ROOT::Math::PtEtaPhiMVector const& part1, ROOT::Math::PtEtaPhiMVector const& part2)
516+
{
517+
// Use Cartesian 4-vectors: addition/M2() become pure arithmetic
518+
const ROOT::Math::PxPyPzEVector p1(part1);
519+
const ROOT::Math::PxPyPzEVector p2(part2);
520+
521+
// Mandelstam s = (p1 + p2)^2
522+
const double s = (p1 + p2).M2();
523+
const double m1sq = p1.M2();
524+
const double m2sq = p2.M2();
525+
526+
// Källen function λ(s, m1^2, m2^2) = (s - m1^2 - m2^2)² - 4*m1^2*m2^2
527+
const double kallen = (s - m1sq - m2sq) * (s - m1sq - m2sq) - 4.0 * m1sq * m2sq;
528+
529+
// k* = 0.5 * sqrt(λ/s)
530+
return static_cast<float>(0.5 * std::sqrt(std::max(0.0, kallen) / s));
531+
}
532+
498533
void initAnalysis(std::map<TripletHist, std::vector<o2::framework::AxisSpec>> const& Specs)
499534
{
500535
std::string analysisDir = std::string(prefix) + std::string(AnalysisDir);
@@ -512,6 +547,12 @@ class TripletHistManager
512547
// TODO: implement histograms differential im mass of the particles
513548
}
514549

550+
if (mPlotKstar) {
551+
mHistogramRegistry->add(analysisDir + getHistNameV2(kKstar12, HistTable), getHistDesc(kKstar12, HistTable), getHistType(kKstar12, HistTable), {Specs.at(kKstar12)});
552+
mHistogramRegistry->add(analysisDir + getHistNameV2(kKstar13, HistTable), getHistDesc(kKstar13, HistTable), getHistType(kKstar13, HistTable), {Specs.at(kKstar13)});
553+
mHistogramRegistry->add(analysisDir + getHistNameV2(kKstar23, HistTable), getHistDesc(kKstar23, HistTable), getHistType(kKstar23, HistTable), {Specs.at(kKstar23)});
554+
}
555+
515556
if (mPlotPt1VsPt2VsPt3) {
516557
mHistogramRegistry->add(analysisDir + getHistNameV2(kPt1VsPt2VsPt3, HistTable), getHistDesc(kPt1VsPt2VsPt3, HistTable), getHistType(kPt1VsPt2VsPt3, HistTable), {Specs.at(kPt1VsPt2VsPt3)});
517558
}
@@ -577,6 +618,12 @@ class TripletHistManager
577618
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kQ3VsCent, HistTable)), mQ3, mCent);
578619
}
579620

621+
if (mPlotKstar) {
622+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstar12, HistTable)), mKstar12);
623+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstar13, HistTable)), mKstar13);
624+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstar23, HistTable)), mKstar23);
625+
}
626+
580627
if (mPlotPt1VsPt2VsPt3) {
581628
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kPt1VsPt2VsPt3, HistTable)), mParticle1.Pt(), mParticle2.Pt(), mParticle3.Pt());
582629
}
@@ -658,6 +705,9 @@ class TripletHistManager
658705
float mMt = 0.f;
659706
float mMult = 0.f;
660707
float mCent = 0.f;
708+
float mKstar12 = 0.f;
709+
float mKstar13 = 0.f;
710+
float mKstar23 = 0.f;
661711

662712
// mc
663713
ROOT::Math::PtEtaPhiMVector mTrueParticle1;
@@ -680,6 +730,7 @@ class TripletHistManager
680730
bool mPlot1d = true;
681731
bool mPlot2d = true;
682732

733+
bool mPlotKstar = false;
683734
bool mPlotPt1VsPt2VsPt3 = false;
684735
bool mPlotQ3VsPt1VsPt2VsPt3 = false;
685736
bool mPlotQ3VsMtVsMult = false;

0 commit comments

Comments
 (0)