Skip to content

Commit ea9fa53

Browse files
authored
[PWGLF] Update on initializerQA for a resonance-width check at the mcParticle level (#15739)
1 parent 68434b4 commit ea9fa53

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

PWGLF/Tasks/Resonances/initializereventqa.cxx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <TString.h>
5151

5252
#include <algorithm>
53+
#include <cmath>
5354
#include <cstdint>
5455
#include <vector>
5556

@@ -82,6 +83,7 @@ struct Initializereventqa {
8283
ConfigurableAxis signalFT0MAxis{"signalFT0MAxis", {4000, 0, 40000}, "FT0M amplitude"};
8384
ConfigurableAxis signalFV0AAxis{"signalFV0AAxis", {4000, 0, 40000}, "FV0A amplitude"};
8485
ConfigurableAxis nCandidates{"nCandidates", {30, -0.5, 29.5}, "N_{cand.}"};
86+
ConfigurableAxis massAxis{"massAxis", {400, 1.4f, 1.8f}, "#it{M} (GeV/#it{c}^{2})"};
8587

8688
// Event selection criteria
8789
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
@@ -157,8 +159,8 @@ struct Initializereventqa {
157159
registry.add("hFT0MsignalPVContr", "hFT0MsignalPVContr", {HistType::kTH3D, {signalFT0MAxis, multNTracksAxis, eventTypeAxis}});
158160
}
159161

160-
registry.add("h3ResonanceTruth", "pT distribution of True Resonance", kTHnSparseF, {eventTypeAxis, ptAxis, centFT0MAxis});
161-
registry.add("h3ResonanceTruthAnti", "pT distribution of True Resonance Anti", kTHnSparseF, {eventTypeAxis, ptAxis, centFT0MAxis});
162+
registry.add("h4ResonanceTruthMass", "pT-mass distribution of True Resonance", kTHnSparseF, {eventTypeAxis, ptAxis, massAxis, centFT0MAxis});
163+
registry.add("h4ResonanceTruthAntiMass", "pT-mass distribution of True Resonance Anti", kTHnSparseF, {eventTypeAxis, ptAxis, massAxis, centFT0MAxis});
162164
}
163165
float pvEta1 = 1.0f;
164166
float globalEta05 = 0.5f;
@@ -283,25 +285,32 @@ struct Initializereventqa {
283285

284286
if (std::abs(mcPart.pdgCode()) != pdgTruthMother || std::abs(mcPart.y()) >= cfgRapidityCut)
285287
continue;
286-
std::vector<int> daughterPDGs;
287-
if (mcPart.has_daughters()) {
288-
auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset());
289-
auto daughter02 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[1] - mcParticles.offset());
290-
daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()};
291-
} else {
292-
daughterPDGs = {-1, -1};
288+
if (!mcPart.has_daughters()) {
289+
continue;
293290
}
294291

292+
auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset());
293+
auto daughter02 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[1] - mcParticles.offset());
294+
std::vector<int> daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()};
295+
295296
if (isDaughterCheck) {
296297
bool pass1 = std::abs(daughterPDGs[0]) == pdgTruthDaughter1 || std::abs(daughterPDGs[1]) == pdgTruthDaughter1;
297298
bool pass2 = std::abs(daughterPDGs[0]) == pdgTruthDaughter2 || std::abs(daughterPDGs[1]) == pdgTruthDaughter2;
298299
if (!pass1 || !pass2)
299300
continue;
300301
}
301-
if (mcPart.pdgCode() > 0) // Consider INELt0 or INEL
302-
registry.fill(HIST("h3ResonanceTruth"), eventType, mcPart.pt(), multiplicity);
303-
else
304-
registry.fill(HIST("h3ResonanceTruthAnti"), eventType, mcPart.pt(), multiplicity);
302+
const float daughterPx = daughter01.px() + daughter02.px();
303+
const float daughterPy = daughter01.py() + daughter02.py();
304+
const float daughterPz = daughter01.pz() + daughter02.pz();
305+
const float daughterEnergy = daughter01.e() + daughter02.e();
306+
const float daughterP2 = daughterPx * daughterPx + daughterPy * daughterPy + daughterPz * daughterPz;
307+
const float mcMass = std::sqrt(std::max(0.f, daughterEnergy * daughterEnergy - daughterP2));
308+
309+
if (mcPart.pdgCode() > 0) { // Consider INELt0 or INEL
310+
registry.fill(HIST("h4ResonanceTruthMass"), eventType, mcPart.pt(), mcMass, multiplicity);
311+
} else {
312+
registry.fill(HIST("h4ResonanceTruthAntiMass"), eventType, mcPart.pt(), mcMass, multiplicity);
313+
}
305314

306315
daughterPDGs.clear();
307316
}

0 commit comments

Comments
 (0)