|
50 | 50 | #include <TString.h> |
51 | 51 |
|
52 | 52 | #include <algorithm> |
| 53 | +#include <cmath> |
53 | 54 | #include <cstdint> |
54 | 55 | #include <vector> |
55 | 56 |
|
@@ -82,6 +83,7 @@ struct Initializereventqa { |
82 | 83 | ConfigurableAxis signalFT0MAxis{"signalFT0MAxis", {4000, 0, 40000}, "FT0M amplitude"}; |
83 | 84 | ConfigurableAxis signalFV0AAxis{"signalFV0AAxis", {4000, 0, 40000}, "FV0A amplitude"}; |
84 | 85 | 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})"}; |
85 | 87 |
|
86 | 88 | // Event selection criteria |
87 | 89 | Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; |
@@ -157,8 +159,8 @@ struct Initializereventqa { |
157 | 159 | registry.add("hFT0MsignalPVContr", "hFT0MsignalPVContr", {HistType::kTH3D, {signalFT0MAxis, multNTracksAxis, eventTypeAxis}}); |
158 | 160 | } |
159 | 161 |
|
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}); |
162 | 164 | } |
163 | 165 | float pvEta1 = 1.0f; |
164 | 166 | float globalEta05 = 0.5f; |
@@ -283,25 +285,32 @@ struct Initializereventqa { |
283 | 285 |
|
284 | 286 | if (std::abs(mcPart.pdgCode()) != pdgTruthMother || std::abs(mcPart.y()) >= cfgRapidityCut) |
285 | 287 | 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; |
293 | 290 | } |
294 | 291 |
|
| 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 | + |
295 | 296 | if (isDaughterCheck) { |
296 | 297 | bool pass1 = std::abs(daughterPDGs[0]) == pdgTruthDaughter1 || std::abs(daughterPDGs[1]) == pdgTruthDaughter1; |
297 | 298 | bool pass2 = std::abs(daughterPDGs[0]) == pdgTruthDaughter2 || std::abs(daughterPDGs[1]) == pdgTruthDaughter2; |
298 | 299 | if (!pass1 || !pass2) |
299 | 300 | continue; |
300 | 301 | } |
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 | + } |
305 | 314 |
|
306 | 315 | daughterPDGs.clear(); |
307 | 316 | } |
|
0 commit comments