Skip to content

Commit a507655

Browse files
rolavickalibuild
andauthored
[PWGUD] Update of personal task (#8768)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 344730c commit a507655

File tree

2 files changed

+120
-79
lines changed

2 files changed

+120
-79
lines changed

PWGUD/Core/UPCTauCentralBarrelHelperRL.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
#include <string>
2020
#include <algorithm>
2121

22-
using namespace o2;
23-
using namespace o2::framework;
24-
using namespace o2::framework::expressions;
25-
2622
enum MyParticle {
2723
P_ELECTRON = 0,
2824
P_MUON = 1,
@@ -160,6 +156,12 @@ int enumMyParticle(int valuePDG)
160156
}
161157
}
162158

159+
float pt(float px, float py)
160+
// Just a simple function to return pt
161+
{
162+
return std::sqrt(px * px + py * py);
163+
}
164+
163165
float momentum(float px, float py, float pz)
164166
// Just a simple function to return momentum
165167
{
@@ -219,7 +221,7 @@ int countPhysicalPrimary(Ps particles)
219221
// Function to loop over particles associated to a mcCollision and return total of physical primary particles
220222
{
221223
int nTotal = 0;
222-
for (auto& particle : particles) {
224+
for (const auto& particle : particles) {
223225
if (!particle.isPhysicalPrimary())
224226
continue;
225227
nTotal++;
@@ -232,7 +234,7 @@ int countParticlesWithoutMother(Ps particles)
232234
// Function to loop over particles associated to a mcCollision and return total of particles without mothers (hopely alternative to isPhysicalPrimary)
233235
{
234236
int nTotal = 0;
235-
for (auto& particle : particles) {
237+
for (const auto& particle : particles) {
236238
if (particle.has_mothers())
237239
continue;
238240
nTotal++;

PWGUD/Tasks/upcTauCentralBarrelRL.cxx

Lines changed: 112 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
///
12-
/// \brief
11+
/// \file upcTauCentralBarrelRL.cxx
12+
/// \brief Personal task to analyze tau events from UPC collisions
1313
/// \author Roman Lavicka, roman.lavicka@cern.ch
1414
/// \since 12.07.2022
1515

@@ -40,8 +40,7 @@
4040

4141
// ROOT headers
4242
#include "TLorentzVector.h"
43-
#include "TEfficiency.h"
44-
#include "TF1.h"
43+
#include "TPDGCode.h"
4544

4645
using namespace o2;
4746
using namespace o2::framework;
@@ -132,7 +131,7 @@ struct UpcTauCentralBarrelRL {
132131
ConfigurableAxis axisMomWide{"axisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"};
133132
ConfigurableAxis axisMomSigned{"axisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"};
134133
ConfigurableAxis axisPt{"axisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"};
135-
ConfigurableAxis axisPhi{"axisPhi", {64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}, "Azimuthal angle (a.y.)"};
134+
ConfigurableAxis axisPhi{"axisPhi", {64, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}, "Azimuthal angle (a.y.)"};
136135
ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"};
137136
ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"};
138137
ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"};
@@ -644,7 +643,7 @@ struct UpcTauCentralBarrelRL {
644643
histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt});
645644
histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi});
646645
histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap});
647-
histos.add("EventSixTracks//hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt});
646+
histos.add("EventSixTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt});
648647
histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx});
649648

650649
histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass});
@@ -670,6 +669,22 @@ struct UpcTauCentralBarrelRL {
670669
histos.add("Events/Truth/hNmuons", ";Number of muons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles});
671670
histos.add("Events/Truth/hNpions", ";Number of pions in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles});
672671
histos.add("Events/Truth/hNphysPartVsNwoutMotherParts", ";Number of physical primary particles (-);Number of particles without mother(-)", HistType::kTH2D, {confAxis.axisNparticles, confAxis.axisNparticles});
672+
histos.add("Tracks/Truth/hTauP", ";Tau #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom});
673+
histos.add("Tracks/Truth/hTauPt", ";Tau #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt});
674+
histos.add("Tracks/Truth/hTauPhi", ";Tau #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi});
675+
histos.add("Tracks/Truth/hTauEta", ";Tau #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta});
676+
histos.add("Tracks/Truth/hElectronP", ";Electron #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom});
677+
histos.add("Tracks/Truth/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt});
678+
histos.add("Tracks/Truth/hElectronPhi", ";Electron #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi});
679+
histos.add("Tracks/Truth/hElectronEta", ";Electron #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta});
680+
histos.add("Tracks/Truth/hMuonP", ";Muon #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom});
681+
histos.add("Tracks/Truth/hMuonPt", ";Muon #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt});
682+
histos.add("Tracks/Truth/hMuonPhi", ";Muon #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi});
683+
histos.add("Tracks/Truth/hMuonEta", ";Muon #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta});
684+
histos.add("Tracks/Truth/hPionP", ";Pion #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom});
685+
histos.add("Tracks/Truth/hPionPt", ";Pion #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt});
686+
histos.add("Tracks/Truth/hPionPhi", ";Pion #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi});
687+
histos.add("Tracks/Truth/hPionEta", ";Pion #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta});
673688
}
674689

675690
} // end init
@@ -779,10 +794,10 @@ struct UpcTauCentralBarrelRL {
779794
if (eta(track.px(), track.py(), track.pz()) < -0.8 || eta(track.px(), track.py(), track.pz()) > 0.8)
780795
return false;
781796
// kPrimaryTracks
782-
if (abs(track.dcaZ()) > 2.0)
797+
if (std::abs(track.dcaZ()) > 2.0)
783798
return false;
784-
float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f);
785-
if (abs(track.dcaXY()) > maxDCA)
799+
float maxDCA = 0.0105f + 0.0350f / std::pow(track.pt(), 1.1f);
800+
if (std::abs(track.dcaXY()) > maxDCA)
786801
return false;
787802
// kQualityTrack
788803
// ITS
@@ -876,8 +891,8 @@ struct UpcTauCentralBarrelRL {
876891
daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
877892
daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
878893
mother = daug[0] + daug[1];
879-
pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
880-
pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
894+
pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
895+
pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
881896
motherOfPions = pion[0] + pion[1];
882897
if (cutTauEvent.cutOppositeCharge && (trkDaug1.sign() * trkDaug2.sign() > 0))
883898
return false;
@@ -998,11 +1013,11 @@ struct UpcTauCentralBarrelRL {
9981013
daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
9991014
daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
10001015
mother = daug[0] + daug[1];
1001-
pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1002-
pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
1016+
pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1017+
pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
10031018
motherOfPions = pion[0] + pion[1];
1004-
muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1005-
muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
1019+
muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kMuonPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1020+
muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
10061021
motherOfMuons = muon[0] + muon[1];
10071022
const auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi());
10081023
if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) {
@@ -1614,10 +1629,10 @@ struct UpcTauCentralBarrelRL {
16141629
const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]);
16151630
daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
16161631
daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
1617-
pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1618-
pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
1619-
muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1620-
muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
1632+
pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1633+
pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
1634+
muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kMuonPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
1635+
muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
16211636
if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) {
16221637
return;
16231638
}
@@ -2081,6 +2096,82 @@ struct UpcTauCentralBarrelRL {
20812096
histos.get<TH2>(HIST("Events/FIT/hTimeFV0AvsFT0A"))->Fill(reconstructedCollision.timeFV0A(), reconstructedCollision.timeFT0A());
20822097
}
20832098

2099+
void fillTruthHistograms(aod::UDMcParticles const& particles)
2100+
{
2101+
histos.get<TH1>(HIST("Events/Truth/hCountCollisions"))->Fill(1);
2102+
histos.get<TH1>(HIST("Events/Truth/hNparticles"))->Fill(particles.size());
2103+
histos.get<TH2>(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles));
2104+
2105+
int countElectrons = 0;
2106+
int countMuons = 0;
2107+
int countPions = 0;
2108+
2109+
for (const auto& particle : particles) {
2110+
histos.get<TH1>(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode());
2111+
// if (!particle.isPhysicalPrimary()) continue;
2112+
if (particle.has_mothers())
2113+
continue;
2114+
histos.get<TH1>(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode());
2115+
histos.get<TH1>(HIST("Tracks/Truth/hTauPt"))->Fill(pt(particle.px(), particle.py()));
2116+
histos.get<TH1>(HIST("Tracks/Truth/hTauP"))->Fill(momentum(particle.px(), particle.py(), particle.pz()));
2117+
histos.get<TH1>(HIST("Tracks/Truth/hTauPhi"))->Fill(phi(particle.px(), particle.py()));
2118+
histos.get<TH1>(HIST("Tracks/Truth/hTauEta"))->Fill(eta(particle.px(), particle.py(), particle.pz()));
2119+
const auto& daughters = particle.daughters_as<aod::UDMcParticles>();
2120+
histos.get<TH1>(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size());
2121+
for (const auto& daughter : daughters) {
2122+
histos.get<TH1>(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode());
2123+
if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON) {
2124+
countElectrons++;
2125+
histos.get<TH1>(HIST("Tracks/Truth/hElectronPt"))->Fill(pt(daughter.px(), daughter.py()));
2126+
histos.get<TH1>(HIST("Tracks/Truth/hElectronP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz()));
2127+
histos.get<TH1>(HIST("Tracks/Truth/hElectronPhi"))->Fill(phi(daughter.px(), daughter.py()));
2128+
histos.get<TH1>(HIST("Tracks/Truth/hElectronEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz()));
2129+
}
2130+
if (enumMyParticle(daughter.pdgCode()) == P_MUON) {
2131+
countMuons++;
2132+
histos.get<TH1>(HIST("Tracks/Truth/hMuonPt"))->Fill(pt(daughter.px(), daughter.py()));
2133+
histos.get<TH1>(HIST("Tracks/Truth/hMuonP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz()));
2134+
histos.get<TH1>(HIST("Tracks/Truth/hMuonPhi"))->Fill(phi(daughter.px(), daughter.py()));
2135+
histos.get<TH1>(HIST("Tracks/Truth/hMuonEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz()));
2136+
}
2137+
if (enumMyParticle(daughter.pdgCode()) == P_PION) {
2138+
countPions++;
2139+
histos.get<TH1>(HIST("Tracks/Truth/hPionPt"))->Fill(pt(daughter.px(), daughter.py()));
2140+
histos.get<TH1>(HIST("Tracks/Truth/hPionP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz()));
2141+
histos.get<TH1>(HIST("Tracks/Truth/hPionPhi"))->Fill(phi(daughter.px(), daughter.py()));
2142+
histos.get<TH1>(HIST("Tracks/Truth/hPionEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz()));
2143+
}
2144+
}
2145+
}
2146+
2147+
histos.get<TH1>(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons);
2148+
histos.get<TH1>(HIST("Events/Truth/hNmuons"))->Fill(countMuons);
2149+
histos.get<TH1>(HIST("Events/Truth/hNpions"))->Fill(countPions);
2150+
2151+
if (countElectrons == 2)
2152+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EE);
2153+
if (countElectrons == 1 && countMuons == 1)
2154+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EMU);
2155+
if (countElectrons == 1 && countPions == 1)
2156+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EPI);
2157+
if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1))
2158+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI);
2159+
if (countMuons == 2)
2160+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU);
2161+
if (countMuons == 1 && countPions == 1)
2162+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI);
2163+
if (countPions == 2)
2164+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI);
2165+
if (countPions == 4)
2166+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI);
2167+
if (countPions == 3 && countElectrons == 1)
2168+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI);
2169+
if (countPions == 3 && countMuons == 1)
2170+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI);
2171+
if (countPions == 6)
2172+
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI);
2173+
}
2174+
20842175
void processDataDG(FullUDCollision const& reconstructedCollision,
20852176
FullUDTracks const& reconstructedBarrelTracks)
20862177
{
@@ -2205,64 +2296,12 @@ struct UpcTauCentralBarrelRL {
22052296
}
22062297

22072298
if (doTruthHistos) {
2208-
histos.get<TH1>(HIST("Events/Truth/hCountCollisions"))->Fill(1);
2209-
histos.get<TH1>(HIST("Events/Truth/hNparticles"))->Fill(particles.size());
2210-
histos.get<TH2>(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles));
2211-
2212-
int countElectrons = 0;
2213-
int countMuons = 0;
2214-
int countPions = 0;
2215-
2216-
for (const auto& particle : particles) {
2217-
histos.get<TH1>(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode());
2218-
// if (!particle.isPhysicalPrimary()) continue;
2219-
if (particle.has_mothers())
2220-
continue;
2221-
histos.get<TH1>(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode());
2222-
const auto& daughters = particle.daughters_as<aod::UDMcParticles>();
2223-
histos.get<TH1>(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size());
2224-
for (const auto& daughter : daughters) {
2225-
histos.get<TH1>(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode());
2226-
if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON)
2227-
countElectrons++;
2228-
if (enumMyParticle(daughter.pdgCode()) == P_MUON)
2229-
countMuons++;
2230-
if (enumMyParticle(daughter.pdgCode()) == P_PION)
2231-
countPions++;
2232-
}
2233-
}
2234-
2235-
histos.get<TH1>(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons);
2236-
histos.get<TH1>(HIST("Events/Truth/hNmuons"))->Fill(countMuons);
2237-
histos.get<TH1>(HIST("Events/Truth/hNpions"))->Fill(countPions);
2238-
2239-
if (countElectrons == 2)
2240-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EE);
2241-
if (countElectrons == 1 && countMuons == 1)
2242-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EMU);
2243-
if (countElectrons == 1 && countPions == 1)
2244-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EPI);
2245-
if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1))
2246-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI);
2247-
if (countMuons == 2)
2248-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU);
2249-
if (countMuons == 1 && countPions == 1)
2250-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI);
2251-
if (countPions == 2)
2252-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI);
2253-
if (countPions == 4)
2254-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI);
2255-
if (countPions == 3 && countElectrons == 1)
2256-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI);
2257-
if (countPions == 3 && countMuons == 1)
2258-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI);
2259-
if (countPions == 6)
2260-
histos.get<TH1>(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI);
2299+
fillTruthHistograms(particles);
22612300
}
22622301

22632302
} // end processMCgenDG
22642303

2265-
void processTestMC(FullMCSGUDCollision const& reconstructedCollision,
2304+
void processTestMC(FullMCUDCollision const& reconstructedCollision,
22662305
FullMCUDTracks const& reconstructedBarrelTracks,
22672306
aod::UDMcCollisions const&,
22682307
aod::UDMcParticles const&)

0 commit comments

Comments
 (0)