Skip to content

Commit a7f713d

Browse files
committed
Update on the initializerQA for reso-width check
1 parent b7e2a55 commit a7f713d

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
@@ -40,6 +40,7 @@
4040
#include <TPDGCode.h>
4141

4242
#include <algorithm>
43+
#include <cmath>
4344
#include <vector>
4445

4546
using namespace o2;
@@ -71,6 +72,7 @@ struct Initializereventqa {
7172
ConfigurableAxis signalFT0MAxis{"signalFT0MAxis", {4000, 0, 40000}, "FT0M amplitude"};
7273
ConfigurableAxis signalFV0AAxis{"signalFV0AAxis", {4000, 0, 40000}, "FV0A amplitude"};
7374
ConfigurableAxis nCandidates{"nCandidates", {30, -0.5, 29.5}, "N_{cand.}"};
75+
ConfigurableAxis massAxis{"massAxis", {400, 1.4f, 1.8f}, "#it{M} (GeV/#it{c}^{2})"};
7476

7577
// Event selection criteria
7678
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
@@ -146,8 +148,8 @@ struct Initializereventqa {
146148
registry.add("hFT0MsignalPVContr", "hFT0MsignalPVContr", {HistType::kTH3D, {signalFT0MAxis, multNTracksAxis, eventTypeAxis}});
147149
}
148150

149-
registry.add("h3ResonanceTruth", "pT distribution of True Resonance", kTHnSparseF, {eventTypeAxis, ptAxis, centFT0MAxis});
150-
registry.add("h3ResonanceTruthAnti", "pT distribution of True Resonance Anti", kTHnSparseF, {eventTypeAxis, ptAxis, centFT0MAxis});
151+
registry.add("h4ResonanceTruthMass", "pT-mass distribution of True Resonance", kTHnSparseF, {eventTypeAxis, ptAxis, massAxis, centFT0MAxis});
152+
registry.add("h4ResonanceTruthAntiMass", "pT-mass distribution of True Resonance Anti", kTHnSparseF, {eventTypeAxis, ptAxis, massAxis, centFT0MAxis});
151153
}
152154
float pvEta1 = 1.0f;
153155
float globalEta05 = 0.5f;
@@ -272,25 +274,32 @@ struct Initializereventqa {
272274

273275
if (std::abs(mcPart.pdgCode()) != pdgTruthMother || std::abs(mcPart.y()) >= cfgRapidityCut)
274276
continue;
275-
std::vector<int> daughterPDGs;
276-
if (mcPart.has_daughters()) {
277-
auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset());
278-
auto daughter02 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[1] - mcParticles.offset());
279-
daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()};
280-
} else {
281-
daughterPDGs = {-1, -1};
277+
if (!mcPart.has_daughters()) {
278+
continue;
282279
}
283280

281+
auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset());
282+
auto daughter02 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[1] - mcParticles.offset());
283+
std::vector<int> daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()};
284+
284285
if (isDaughterCheck) {
285286
bool pass1 = std::abs(daughterPDGs[0]) == pdgTruthDaughter1 || std::abs(daughterPDGs[1]) == pdgTruthDaughter1;
286287
bool pass2 = std::abs(daughterPDGs[0]) == pdgTruthDaughter2 || std::abs(daughterPDGs[1]) == pdgTruthDaughter2;
287288
if (!pass1 || !pass2)
288289
continue;
289290
}
290-
if (mcPart.pdgCode() > 0) // Consider INELt0 or INEL
291-
registry.fill(HIST("h3ResonanceTruth"), eventType, mcPart.pt(), multiplicity);
292-
else
293-
registry.fill(HIST("h3ResonanceTruthAnti"), eventType, mcPart.pt(), multiplicity);
291+
const float daughterPx = daughter01.px() + daughter02.px();
292+
const float daughterPy = daughter01.py() + daughter02.py();
293+
const float daughterPz = daughter01.pz() + daughter02.pz();
294+
const float daughterEnergy = daughter01.e() + daughter02.e();
295+
const float daughterP2 = daughterPx * daughterPx + daughterPy * daughterPy + daughterPz * daughterPz;
296+
const float mcMass = std::sqrt(std::max(0.f, daughterEnergy * daughterEnergy - daughterP2));
297+
298+
if (mcPart.pdgCode() > 0) { // Consider INELt0 or INEL
299+
registry.fill(HIST("h4ResonanceTruthMass"), eventType, mcPart.pt(), mcMass, multiplicity);
300+
} else {
301+
registry.fill(HIST("h4ResonanceTruthAntiMass"), eventType, mcPart.pt(), mcMass, multiplicity);
302+
}
294303

295304
daughterPDGs.clear();
296305
}

0 commit comments

Comments
 (0)