|
40 | 40 | #include <TPDGCode.h> |
41 | 41 |
|
42 | 42 | #include <algorithm> |
| 43 | +#include <cmath> |
43 | 44 | #include <vector> |
44 | 45 |
|
45 | 46 | using namespace o2; |
@@ -71,6 +72,7 @@ struct Initializereventqa { |
71 | 72 | ConfigurableAxis signalFT0MAxis{"signalFT0MAxis", {4000, 0, 40000}, "FT0M amplitude"}; |
72 | 73 | ConfigurableAxis signalFV0AAxis{"signalFV0AAxis", {4000, 0, 40000}, "FV0A amplitude"}; |
73 | 74 | 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})"}; |
74 | 76 |
|
75 | 77 | // Event selection criteria |
76 | 78 | Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; |
@@ -146,8 +148,8 @@ struct Initializereventqa { |
146 | 148 | registry.add("hFT0MsignalPVContr", "hFT0MsignalPVContr", {HistType::kTH3D, {signalFT0MAxis, multNTracksAxis, eventTypeAxis}}); |
147 | 149 | } |
148 | 150 |
|
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}); |
151 | 153 | } |
152 | 154 | float pvEta1 = 1.0f; |
153 | 155 | float globalEta05 = 0.5f; |
@@ -272,25 +274,32 @@ struct Initializereventqa { |
272 | 274 |
|
273 | 275 | if (std::abs(mcPart.pdgCode()) != pdgTruthMother || std::abs(mcPart.y()) >= cfgRapidityCut) |
274 | 276 | 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; |
282 | 279 | } |
283 | 280 |
|
| 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 | + |
284 | 285 | if (isDaughterCheck) { |
285 | 286 | bool pass1 = std::abs(daughterPDGs[0]) == pdgTruthDaughter1 || std::abs(daughterPDGs[1]) == pdgTruthDaughter1; |
286 | 287 | bool pass2 = std::abs(daughterPDGs[0]) == pdgTruthDaughter2 || std::abs(daughterPDGs[1]) == pdgTruthDaughter2; |
287 | 288 | if (!pass1 || !pass2) |
288 | 289 | continue; |
289 | 290 | } |
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 | + } |
294 | 303 |
|
295 | 304 | daughterPDGs.clear(); |
296 | 305 | } |
|
0 commit comments