|
67 | 67 | #include <string> |
68 | 68 | #include <vector> |
69 | 69 |
|
70 | | -using namespace std; |
71 | 70 | using namespace o2; |
72 | | -using namespace o2::soa; |
73 | | -using namespace o2::aod; |
74 | 71 | using namespace o2::framework; |
75 | 72 | using namespace o2::framework::expressions; |
76 | 73 | using namespace o2::constants::math; |
77 | | -using std::array; |
78 | 74 |
|
79 | 75 | // Define convenient aliases for joined AOD tables |
80 | 76 | using SelCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>; |
@@ -197,7 +193,7 @@ struct StrangenessInJets { |
197 | 193 | enabled += checkEnabled(ParticleOfInterest::kKaons); |
198 | 194 | enabled += checkEnabled(ParticleOfInterest::kProtons); |
199 | 195 | if (enabled == 0) { |
200 | | - LOG(fatal) << "At least one particle species must be enabled for the analysis. Please check the configuration of the task." << endl; |
| 196 | + LOG(fatal) << "At least one particle species must be enabled for the analysis. Please check the configuration of the task."; |
201 | 197 | } |
202 | 198 |
|
203 | 199 | // Define binning and axis specifications for multiplicity, eta, pT, PID, and invariant mass histograms |
@@ -319,7 +315,7 @@ struct StrangenessInJets { |
319 | 315 | const AxisSpec axisInJetOutOfJet = AxisSpec{2, -2., 2., "In jet / Out of jet"}; |
320 | 316 | const AxisSpec axisCharge = AxisSpec{2, -2., 2., "Charge"}; |
321 | 317 | const AxisSpec axisParticleType = AxisSpec{3, -0.5, 2.5, "Particle Type"}; |
322 | | - registryData.add("LongLivedGenerated", "LongLivedGenerated", HistType::kTHnSparseF, {axisInJetOutOfJet, axisParticleType, axisCharge, ptAxisLongLived, multAxis}); |
| 318 | + registryMC.add("LongLivedGenerated", "LongLivedGenerated", HistType::kTHnSparseF, {axisInJetOutOfJet, axisParticleType, axisCharge, ptAxisLongLived, multAxis}); |
323 | 319 | } |
324 | 320 | } |
325 | 321 |
|
@@ -385,11 +381,31 @@ struct StrangenessInJets { |
385 | 381 | const AxisSpec axisCharge = AxisSpec{2, -2., 2., "Charge"}; |
386 | 382 | const AxisSpec axisParticleType = AxisSpec{3, -0.5, 2.5, "Particle Type"}; |
387 | 383 | const AxisSpec axisDetector = AxisSpec{2, -0.5, 1.5, "TPC / TOF"}; |
388 | | - registryData.add("LongLivedReconstructed", "LongLivedReconstructed", HistType::kTHnSparseF, {axisInJetOutOfJet, axisParticleType, axisCharge, ptAxisLongLived, multAxis, axisDetector}); |
| 384 | + registryMC.add("LongLivedReconstructed", "LongLivedReconstructed", HistType::kTHnSparseF, {axisInJetOutOfJet, axisParticleType, axisCharge, ptAxisLongLived, multAxis, axisDetector}); |
389 | 385 | } |
390 | 386 | } |
391 | 387 | } |
392 | 388 |
|
| 389 | + bool pdgToLongLivedIndex(const int pdg, float& particle, float& charge) |
| 390 | + { |
| 391 | + switch (std::abs(pdg)) { |
| 392 | + case PDG_t::kPiPlus: |
| 393 | + particle = 0; // pion |
| 394 | + charge = (pdg > 0) ? 1 : -1; |
| 395 | + return enabledSignals.value[ParticleOfInterest::kPions]; |
| 396 | + case PDG_t::kKPlus: |
| 397 | + particle = 1; // kaon |
| 398 | + charge = (pdg > 0) ? 1 : -1; |
| 399 | + return enabledSignals.value[ParticleOfInterest::kKaons]; |
| 400 | + case PDG_t::kProton: |
| 401 | + particle = 2; // proton |
| 402 | + charge = (pdg > 0) ? 1 : -1; |
| 403 | + return enabledSignals.value[ParticleOfInterest::kProtons]; |
| 404 | + default: |
| 405 | + return false; |
| 406 | + } |
| 407 | + } |
| 408 | + |
393 | 409 | // Delta phi calculation |
394 | 410 | double getDeltaPhi(double a1, double a2) |
395 | 411 | { |
@@ -1129,7 +1145,9 @@ struct StrangenessInJets { |
1129 | 1145 | } |
1130 | 1146 | } |
1131 | 1147 | } |
1132 | | - if (enabledSignals.value[ParticleOfInterest::kPions] || enabledSignals.value[ParticleOfInterest::kKaons] || enabledSignals.value[ParticleOfInterest::kProtons]) { |
| 1148 | + if (enabledSignals.value[ParticleOfInterest::kPions] || |
| 1149 | + enabledSignals.value[ParticleOfInterest::kKaons] || |
| 1150 | + enabledSignals.value[ParticleOfInterest::kProtons]) { |
1133 | 1151 | for (const auto& trk : tracks) { |
1134 | 1152 |
|
1135 | 1153 | if (!passedSingleTrackSelection(trk)) { |
@@ -1424,33 +1442,14 @@ struct StrangenessInJets { |
1424 | 1442 | } |
1425 | 1443 | break; |
1426 | 1444 | case kPiPlus: |
1427 | | - if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1428 | | - registryMC.fill(HIST("LongLivedGenerated"), -1.f, 0.f, 1.f, hadron.first.Pt(), genMultiplicity); |
1429 | | - } |
1430 | | - break; |
1431 | | - case kKPlus: |
1432 | | - if (enabledSignals.value[ParticleOfInterest::kKaons]) { |
1433 | | - registryMC.fill(HIST("LongLivedGenerated"), -1.f, 1.f, 1.f, hadron.first.Pt(), genMultiplicity); |
1434 | | - } |
1435 | | - break; |
1436 | | - case kProton: |
1437 | | - if (enabledSignals.value[ParticleOfInterest::kProtons]) { |
1438 | | - registryMC.fill(HIST("LongLivedGenerated"), -1.f, 2.f, 1.f, hadron.first.Pt(), genMultiplicity); |
1439 | | - } |
1440 | | - break; |
1441 | 1445 | case kPiMinus: |
1442 | | - if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1443 | | - registryMC.fill(HIST("LongLivedGenerated"), -1.f, 0.f, -1.f, hadron.first.Pt(), genMultiplicity); |
1444 | | - } |
1445 | | - break; |
| 1446 | + case kKPlus: |
1446 | 1447 | case kKMinus: |
1447 | | - if (enabledSignals.value[ParticleOfInterest::kKaons]) { |
1448 | | - registryMC.fill(HIST("LongLivedGenerated"), -1.f, 1.f, -1.f, hadron.first.Pt(), genMultiplicity); |
1449 | | - } |
1450 | | - break; |
| 1448 | + case kProton: |
1451 | 1449 | case kProtonBar: |
1452 | | - if (enabledSignals.value[ParticleOfInterest::kProtons]) { |
1453 | | - registryMC.fill(HIST("LongLivedGenerated"), -1.f, 2.f, -1.f, hadron.first.Pt(), genMultiplicity); |
| 1450 | + float particleId, chargeId; |
| 1451 | + if (pdgToLongLivedIndex(hadron.second, particleId, chargeId)) { |
| 1452 | + registryMC.fill(HIST("LongLivedGenerated"), -1.f, particleId, chargeId, hadron.first.Pt(), genMultiplicity); |
1454 | 1453 | } |
1455 | 1454 | break; |
1456 | 1455 | default: |
@@ -1497,33 +1496,14 @@ struct StrangenessInJets { |
1497 | 1496 | } |
1498 | 1497 | break; |
1499 | 1498 | case kPiPlus: |
1500 | | - if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1501 | | - registryMC.fill(HIST("LongLivedGenerated"), 1.f, 0.f, 1.f, hadron.first.Pt(), genMultiplicity); |
1502 | | - } |
1503 | | - break; |
1504 | | - case kKPlus: |
1505 | | - if (enabledSignals.value[ParticleOfInterest::kKaons]) { |
1506 | | - registryMC.fill(HIST("LongLivedGenerated"), 1.f, 1.f, 1.f, hadron.first.Pt(), genMultiplicity); |
1507 | | - } |
1508 | | - break; |
1509 | | - case kProton: |
1510 | | - if (enabledSignals.value[ParticleOfInterest::kProtons]) { |
1511 | | - registryMC.fill(HIST("LongLivedGenerated"), 1.f, 2.f, 1.f, hadron.first.Pt(), genMultiplicity); |
1512 | | - } |
1513 | | - break; |
1514 | 1499 | case kPiMinus: |
1515 | | - if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1516 | | - registryMC.fill(HIST("LongLivedGenerated"), 1.f, 0.f, -1.f, hadron.first.Pt(), genMultiplicity); |
1517 | | - } |
1518 | | - break; |
| 1500 | + case kKPlus: |
1519 | 1501 | case kKMinus: |
1520 | | - if (enabledSignals.value[ParticleOfInterest::kKaons]) { |
1521 | | - registryMC.fill(HIST("LongLivedGenerated"), 1.f, 1.f, -1.f, hadron.first.Pt(), genMultiplicity); |
1522 | | - } |
1523 | | - break; |
| 1502 | + case kProton: |
1524 | 1503 | case kProtonBar: |
1525 | | - if (enabledSignals.value[ParticleOfInterest::kProtons]) { |
1526 | | - registryMC.fill(HIST("LongLivedGenerated"), 1.f, 2.f, -1.f, hadron.first.Pt(), genMultiplicity); |
| 1504 | + float particleId, chargeId; |
| 1505 | + if (pdgToLongLivedIndex(hadron.second, particleId, chargeId)) { |
| 1506 | + registryMC.fill(HIST("LongLivedGenerated"), 1.f, particleId, chargeId, hadron.first.Pt(), genMultiplicity); |
1527 | 1507 | } |
1528 | 1508 | break; |
1529 | 1509 | default: |
@@ -1692,6 +1672,7 @@ struct StrangenessInJets { |
1692 | 1672 | if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1693 | 1673 | registryMC.fill(HIST("Pion_Plus_reconstructed_fullevent"), multiplicity, trk.pt()); |
1694 | 1674 | } |
| 1675 | + break; |
1695 | 1676 | case kPiMinus: |
1696 | 1677 | if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1697 | 1678 | registryMC.fill(HIST("Pion_Minus_reconstructed_fullevent"), multiplicity, trk.pt()); |
@@ -1984,46 +1965,14 @@ struct StrangenessInJets { |
1984 | 1965 | const double deltaPhiUe2 = getDeltaPhi(trackDir.Phi(), ue2[i].Phi()); |
1985 | 1966 | const double deltaRue2 = std::sqrt(deltaEtaUe2 * deltaEtaUe2 + deltaPhiUe2 * deltaPhiUe2); |
1986 | 1967 |
|
1987 | | - float indexParticle = -1; |
1988 | | - float indexCharge = 0; |
1989 | | - switch (mcParticle.pdgCode()) { |
1990 | | - case kPiPlus: |
1991 | | - if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1992 | | - indexParticle = 0; |
1993 | | - indexCharge = 1; |
1994 | | - } |
1995 | | - break; |
1996 | | - case kPiMinus: |
1997 | | - if (enabledSignals.value[ParticleOfInterest::kPions]) { |
1998 | | - indexParticle = 0; |
1999 | | - indexCharge = -1; |
2000 | | - } |
2001 | | - break; |
2002 | | - case kKPlus: |
2003 | | - if (enabledSignals.value[ParticleOfInterest::kKaons]) { |
2004 | | - indexParticle = 1; |
2005 | | - indexCharge = 1; |
2006 | | - } |
2007 | | - case kKMinus: |
2008 | | - if (enabledSignals.value[ParticleOfInterest::kKaons]) { |
2009 | | - indexParticle = 1; |
2010 | | - indexCharge = -1; |
2011 | | - } |
2012 | | - break; |
2013 | | - case kProton: |
2014 | | - if (enabledSignals.value[ParticleOfInterest::kProtons]) { |
2015 | | - indexParticle = 2; |
2016 | | - indexCharge = 1; |
2017 | | - } |
2018 | | - } |
2019 | | - if (indexParticle <= -0.5f) { |
2020 | | - continue; |
2021 | | - } |
2022 | | - if (deltaRjet < rJet) { |
2023 | | - registryMC.fill(HIST("LongLivedReconstructed"), -1.f, indexParticle, indexCharge, trk.pt(), multiplicity, (trk.hasTOF() ? 1 : 0)); |
2024 | | - } |
2025 | | - if (deltaRue1 < rJet || deltaRue2 < rJet) { |
2026 | | - registryMC.fill(HIST("LongLivedReconstructed"), 1.f, indexParticle, indexCharge, trk.pt(), multiplicity, (trk.hasTOF() ? 1 : 0)); |
| 1968 | + float particleId, chargeId; |
| 1969 | + if (pdgToLongLivedIndex(mcParticle.pdgCode(), particleId, chargeId)) { |
| 1970 | + if (deltaRjet < rJet) { |
| 1971 | + registryMC.fill(HIST("LongLivedReconstructed"), -1.f, indexParticle, indexCharge, trk.pt(), multiplicity, (trk.hasTOF() ? 1 : 0)); |
| 1972 | + } |
| 1973 | + if (deltaRue1 < rJet || deltaRue2 < rJet) { |
| 1974 | + registryMC.fill(HIST("LongLivedReconstructed"), 1.f, indexParticle, indexCharge, trk.pt(), multiplicity, (trk.hasTOF() ? 1 : 0)); |
| 1975 | + } |
2027 | 1976 | } |
2028 | 1977 | } |
2029 | 1978 | } |
|
0 commit comments