From 572ac4ad76369aac5891727839ecae81f2d75847 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:41:58 +0100 Subject: [PATCH 01/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 350 ++++++++++++++++++++---------- 1 file changed, 232 insertions(+), 118 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 82aa3de2e14..f5bd2f827b6 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -19,6 +19,8 @@ // O2 includes #include +#include +#include #include "ReconstructionDataFormats/Track.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -84,6 +86,7 @@ struct tofSpectra { struct : ConfigurableGroup { Configurable cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; + Configurable cfgCutNsigma{"cfgCutNsigma", 10.0f, "nsigma cut range for tracks"}; Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; Configurable cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"}; Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", 5, "Last cluster to require in TRD for track selection. -1 does not require any TRD cluster"}; @@ -335,6 +338,8 @@ struct tofSpectra { histos.add("Mult/TPC", "MultTPC", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultTPC"}}); histos.add("Mult/NTracksPV", "MultNTracksPV", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultNTracksPV"}}); histos.add("Mult/NTracksPVeta1", "MultNTracksPVeta1", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultNTracksPVeta1"}}); + histos.add("test_occupancy/tpcCount", "TPC Track Count", HistType::kTH1F, {{100, 0, 10000, "Number of TPC Tracks"}}); + histos.add("test_occupancy/tofCount", "TOF Track Count", HistType::kTH1F, {{100, 0, 10000, "Number of TOF Tracks"}}); const AxisSpec dcaXyAxis{binsOptions.binsDca, "DCA_{xy} (cm)"}; const AxisSpec phiAxis{200, 0, 7, "#it{#varphi} (rad)"}; @@ -461,12 +466,18 @@ struct tofSpectra { histos.add("MC/test/pr/pos/prm/pt/den", "generated MC p", kTHnSparseD, {ptAxis, impParamAxis}); histos.add("MC/test/pr/neg/prm/pt/den", "generated MC #bar{p}", kTHnSparseD, {ptAxis, impParamAxis}); if (doprocessMCgen_RecoEvs) { - histos.add("MC/test/RecoEvs/pi/pos/prm/pt/den", "generated MC #pi^{+} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/RecoEvs/pi/neg/prm/pt/den", "generated MC #pi^{-} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/RecoEvs/ka/pos/prm/pt/den", "generated MC K^{+} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/RecoEvs/ka/neg/prm/pt/den", "generated MC K^{-} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/RecoEvs/pr/pos/prm/pt/den", "generated MC p from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/RecoEvs/pr/neg/prm/pt/den", "generated MC #bar{p} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pi/pos/prm/pt/num", "generated MC #pi^{+} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pi/neg/prm/pt/num", "generated MC #pi^{-} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/ka/pos/prm/pt/num", "generated MC K^{+} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/ka/neg/prm/pt/num", "generated MC K^{-} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pr/pos/prm/pt/num", "generated MC p from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pr/neg/prm/pt/num", "generated MC #bar{p} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pi/pos/prm/pt/numtof", "generated MC #pi^{+} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pi/neg/prm/pt/numtof", "generated MC #pi^{-} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/ka/pos/prm/pt/numtof", "generated MC K^{+} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/ka/neg/prm/pt/numtof", "generated MC K^{-} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pr/pos/prm/pt/numtof", "generated MC p from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/RecoEvs/pr/neg/prm/pt/numtof", "generated MC #bar{p} from recons. events", kTHnSparseD, {ptAxis, impParamAxis}); } } auto hh = histos.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", kTH1D, {{10, 0.5, 10.5}}); @@ -1333,73 +1344,98 @@ struct tofSpectra { soa::Join const& tracks) - { - if (!isEventSelected(collision)) { - return; +{ + // Event selection criteria + if (!collision.sel8() || std::abs(collision.posZ()) > 10 || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder) || + !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || + !collision.selection_bit(aod::evsel::kNoSameBunchPileup) || + !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return; } + histos.fill(HIST("test_occupancy/event/vertexz"), collision.posZ()); + + // Multiplicity and occupancy int occupancy = collision.trackOccupancyInTimeRange(); - const float multiplicity = collision.centFT0C(); + const float multiplicity = getMultiplicity(collision); histos.fill(HIST("nsigmatpc/test_occupancy/Mult_vs_Occupancy"), multiplicity, occupancy); + + int tpcCount = 0, tofCount = 0; + for (const auto& track : tracks) { - if (!isTrackSelected(track, collision)) { - continue; - } - if (std::abs(track.rapidity(PID::getMass(2))) > trkselOptions.cfgCutY) { - return; - } - if (std::abs(track.rapidity(PID::getMass(3))) > trkselOptions.cfgCutY) { - return; - } - if (std::abs(track.rapidity(PID::getMass(4))) > trkselOptions.cfgCutY) { - return; - } - if (includeCentralityToTracks) { + // Track selection criteria + if (track.tpcNClsCrossedRows() < 70 || track.tpcChi2NCl() > 4 || track.tpcChi2NCl() < 0.5 || + track.itsChi2NCl() > 36 || std::abs(track.dcaXY()) > 0.05 || std::abs(track.dcaZ()) > 2.0 || + std::abs(track.eta()) > 0.8 || track.tpcCrossedRowsOverFindableCls() < 0.8 || track.tpcNClsFound() < 100 || + !(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)) { + continue; + } + const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);; + const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); + const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); - if (track.sign() > 0) { - if (track.hasITS() && track.hasTPC() && track.hasTOF()) { - histos.fill(HIST("Data/cent/pos/pt/its_tpc_tof"), track.pt(), collision.centFT0C(), occupancy); - } - if (track.hasITS() && track.hasTOF()) { - histos.fill(HIST("Data/cent/pos/pt/its_tof"), track.pt(), collision.centFT0C(), occupancy); - } - if (track.hasITS() && track.hasTPC()) { - histos.fill(HIST("Data/cent/pos/pt/its_tpc"), track.pt(), collision.centFT0C(), occupancy); - } - } else { - if (track.hasITS() && track.hasTPC() && track.hasTOF()) { - histos.fill(HIST("Data/cent/neg/pt/its_tpc_tof"), track.pt(), collision.centFT0C(), occupancy); - } - if (track.hasITS() && track.hasTPC()) { - histos.fill(HIST("Data/cent/neg/pt/its_tpc"), track.pt(), collision.centFT0C(), occupancy); - } - if (track.hasITS() && track.hasTOF()) { - histos.fill(HIST("Data/cent/neg/pt/its_tof"), track.pt(), collision.centFT0C(), occupancy); - } + bool isTPCPion = fabs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; + bool isTPCKaon = fabs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; + bool isTPCProton = fabs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; + + const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); + const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); + const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); + + bool isTOFPion = track.hasTOF() && fabs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; + bool isTOFKaon = track.hasTOF() && fabs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; + bool isTOFProton = track.hasTOF() && fabs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; + + // Apply rapidity cut for identified particles + if (isTPCPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { + tpcCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + } + } else if (isTPCKaon && std::abs(track.rapidity(PID::getMass(3))) < trkselOptions.cfgCutY) { + tpcCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + } + } else if (isTPCProton && std::abs(track.rapidity(PID::getMass(4))) < trkselOptions.cfgCutY) { + tpcCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } } - } - if (track.sign() > 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), track.tpcNSigmaPi(), multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), track.tpcNSigmaKa(), multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), track.tpcNSigmaPr(), multiplicity, occupancy); - } else if (track.sign() < 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), track.tpcNSigmaPi(), multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), track.tpcNSigmaKa(), multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), track.tpcNSigmaPr(), multiplicity, occupancy); - } - if (!track.hasTOF()) { - return; - } - if (track.sign() > 0) { - histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), track.tofNSigmaPi(), multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), track.tofNSigmaKa(), multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), track.tofNSigmaPr(), multiplicity, occupancy); - } else if (track.sign() < 0) { - histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), track.tofNSigmaPi(), multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), track.tofNSigmaKa(), multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), track.tofNSigmaPr(), multiplicity, occupancy); - } - } // track - } // process function + + // TOF PID histograms + if (isTOFPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { + tofCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + } + } else if (isTOFKaon && std::abs(track.rapidity(PID::getMass(3))) < trkselOptions.cfgCutY) { + tofCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + } + } else if (isTOFProton && std::abs(track.rapidity(PID::getMass(4))) < trkselOptions.cfgCutY) { + tofCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } + } + } + histos.fill(HIST("test_occupancy/tpcCount"), tpcCount); + histos.fill(HIST("test_occupancy/tofCount"), tofCount); +} // process function PROCESS_SWITCH(tofSpectra, processOccupancy, "check for occupancy plots", false); void processStandard(CollisionCandidates::iterator const& collision, @@ -2108,29 +2144,34 @@ struct tofSpectra { int pdgCode = mcParticleGen.pdgCode(); float pt = mcParticleGen.pt(); float absY = std::abs(mcParticleGen.y()); - // Apply rapidity cut + const int PDG_PROTON = 2212; + const int PDG_ANTIPROTON = -2212; + const int PDG_PION_PLUS = 211; + const int PDG_PION_MINUS = -211; + const int PDG_KAON_PLUS = 321; + const int PDG_KAON_MINUS = -321; + if (absY > trkselOptions.cfgCutY) { continue; } - // Fill histograms based on particle type switch (pdgCode) { - case 2212: + case PDG_PROTON: histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); break; - case -2212: + case PDG_ANTIPROTON: histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); break; - case 211: + case PDG_PION_PLUS: histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); break; - case -211: + case PDG_PION_MINUS: histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); break; - case 321: + case PDG_KAON_PLUS: histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); break; - case -321: + case PDG_KAON_MINUS: histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); break; default: @@ -2139,54 +2180,127 @@ struct tofSpectra { } } PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); - void processMCgen_RecoEvs(GenMCCollisions const&, RecoMCCollisions const& collisions, aod::McParticles const& mcParticles) - { + void processMCgen_RecoEvs(soa::Join const& tracks, + aod::McTrackLabels const& mcTrackLabels, + RecoMCCollisions const& collisions, + aod::McParticles const& mcParticles) +{ for (const auto& collision : collisions) { - if (!collision.has_mcCollision()) { - continue; - } - const auto& mcCollision = collision.mcCollision_as(); - const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - histos.fill(HIST("Vertex/RecoEvs/histGenVtxMC"), mcCollision.posZ()); - histos.fill(HIST("Centrality/RecoEvs/ImpParm"), mcCollision.impactParameter()); - const float multiplicity = mcCollision.impactParameter(); - for (const auto& mcParticleGen : particlesInCollision) { - if (!mcParticleGen.isPhysicalPrimary()) - continue; - int pdgCode = mcParticleGen.pdgCode(); - float pt = mcParticleGen.pt(); - float absY = std::abs(mcParticleGen.y()); - // Apply rapidity cut - if (absY > trkselOptions.cfgCutY) { - continue; + if (!collision.has_mcCollision()) { + continue; } - // Fill histograms based on particle type - switch (pdgCode) { - case 2212: - histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/den"), pt, multiplicity); - break; - case -2212: - histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/den"), pt, multiplicity); - break; - case 211: - histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/den"), pt, multiplicity); - break; - case -211: - histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/den"), pt, multiplicity); - break; - case 321: - histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/den"), pt, multiplicity); - break; - case -321: - histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/den"), pt, multiplicity); - break; - default: - break; + const auto& mcCollision = collision.mcCollision_as(); + histos.fill(HIST("Vertex/RecoEvs/histGenVtxMC"), mcCollision.posZ()); + histos.fill(HIST("Centrality/RecoEvs/ImpParm"), mcCollision.impactParameter()); + const float multiplicity = mcCollision.impactParameter(); + + for (const auto& track : tracks) { + if (track.tpcNClsCrossedRows() < 70 || + track.tpcChi2NCl() > 4 || + track.tpcChi2NCl() < 0.5 || + track.itsChi2NCl() > 36 || + std::abs(track.dcaXY()) > 0.05 || + std::abs(track.dcaZ()) > 2.0 || + std::abs(track.eta()) > 0.8 || + track.tpcCrossedRowsOverFindableCls() < 0.8 || + track.tpcNClsFound() < 100 || + !(o2::aod::track::TPCrefit) || + !(o2::aod::track::ITSrefit)) { + continue; + } + const auto& mcLabel = mcTrackLabels.iteratorAt(track.globalIndex()); + if (mcLabel.mcParticleId() < 0 || mcLabel.mcParticleId() >= mcParticles.size()) { + continue; + } + const auto& mcParticle = mcParticles.iteratorAt(mcLabel.mcParticleId()); + if (!mcParticle.isPhysicalPrimary()) { + continue; + } + + int pdgCode = mcParticle.pdgCode(); + float pt = mcParticle.pt(); + float absY = std::abs(mcParticle.y()); + if (absY > trkselOptions.cfgCutY) { + continue; + } + + const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);; + const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); + const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); + + bool isPionTPC = fabs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; + bool isKaonTPC = fabs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; + bool isProtonTPC = fabs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; + + const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); + const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); + const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); + + bool isPionTOF = track.hasTOF() && fabs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; + bool isKaonTOF = track.hasTOF() && fabs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; + bool isProtonTOF = track.hasTOF() && fabs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; + const int PDG_PROTON = 2212; + const int PDG_ANTIPROTON = -2212; + const int PDG_PION_PLUS = 211; + const int PDG_PION_MINUS = -211; + const int PDG_KAON_PLUS = 321; + const int PDG_KAON_MINUS = -321; + + if (isPionTPC || isKaonTPC || isProtonTPC) { + switch (pdgCode) { + case PDG_PROTON: // Proton + histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/num"), pt, multiplicity); + break; + case PDG_ANTIPROTON: // Anti-proton + histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/num"), pt, multiplicity); + break; + case PDG_PION_PLUS: // Pion+ + histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/num"), pt, multiplicity); + break; + case PDG_PION_MINUS: // Pion- + histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/num"), pt, multiplicity); + break; + case PDG_KAON_PLUS: // Kaon+ + histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/num"), pt, multiplicity); + break; + case PDG_KAON_MINUS: // Kaon- + histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/num"), pt, multiplicity); + break; + default: + break; + } + } + + if (isPionTOF || isKaonTOF || isProtonTOF) { + switch (pdgCode) { + case PDG_PROTON: // Proton + histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/numtof"), pt, multiplicity); + break; + case PDG_ANTIPROTON: // Anti-proton + histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/numtof"), pt, multiplicity); + break; + case PDG_PION_PLUS: // Pion+ + histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/numtof"), pt, multiplicity); + break; + case PDG_PION_MINUS: // Pion- + histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/numtof"), pt, multiplicity); + break; + case PDG_KAON_PLUS: // Kaon+ + histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/numtof"), pt, multiplicity); + break; + case PDG_KAON_MINUS: // Kaon- + histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/numtof"), pt, multiplicity); + break; + default: + break; + } + } } - } } - } +} PROCESS_SWITCH(tofSpectra, processMCgen_RecoEvs, "process generated MC (reconstructed events)", false); }; // end of spectra task From 37990e4c757880ba306c8aa7be56aaedba42d0bc Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:54:58 +0100 Subject: [PATCH 02/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 112 ++++++++++-------------------- 1 file changed, 36 insertions(+), 76 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index f5bd2f827b6..dd002b84864 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -2144,38 +2144,22 @@ struct tofSpectra { int pdgCode = mcParticleGen.pdgCode(); float pt = mcParticleGen.pt(); float absY = std::abs(mcParticleGen.y()); - const int PDG_PROTON = 2212; - const int PDG_ANTIPROTON = -2212; - const int PDG_PION_PLUS = 211; - const int PDG_PION_MINUS = -211; - const int PDG_KAON_PLUS = 321; - const int PDG_KAON_MINUS = -321; - if (absY > trkselOptions.cfgCutY) { continue; } - switch (pdgCode) { - case PDG_PROTON: - histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); - break; - case PDG_ANTIPROTON: - histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); - break; - case PDG_PION_PLUS: - histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); - break; - case PDG_PION_MINUS: - histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); - break; - case PDG_KAON_PLUS: - histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); - break; - case PDG_KAON_MINUS: - histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); - break; - default: - break; + if (pdgCode == 2212) { + histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == -2212) { + histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == 211) { + histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == -211) { + histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == 321) { + histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == -321) { + histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); } } } @@ -2242,60 +2226,36 @@ struct tofSpectra { bool isPionTOF = track.hasTOF() && fabs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; bool isKaonTOF = track.hasTOF() && fabs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; bool isProtonTOF = track.hasTOF() && fabs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; - const int PDG_PROTON = 2212; - const int PDG_ANTIPROTON = -2212; - const int PDG_PION_PLUS = 211; - const int PDG_PION_MINUS = -211; - const int PDG_KAON_PLUS = 321; - const int PDG_KAON_MINUS = -321; if (isPionTPC || isKaonTPC || isProtonTPC) { - switch (pdgCode) { - case PDG_PROTON: // Proton - histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/num"), pt, multiplicity); - break; - case PDG_ANTIPROTON: // Anti-proton - histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/num"), pt, multiplicity); - break; - case PDG_PION_PLUS: // Pion+ - histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/num"), pt, multiplicity); - break; - case PDG_PION_MINUS: // Pion- - histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/num"), pt, multiplicity); - break; - case PDG_KAON_PLUS: // Kaon+ - histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/num"), pt, multiplicity); - break; - case PDG_KAON_MINUS: // Kaon- - histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/num"), pt, multiplicity); - break; - default: - break; + if (pdgCode == 2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == -2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == 211) { + histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == -211) { + histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == 321) { + histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == -321) { + histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/num"), pt, multiplicity); } } if (isPionTOF || isKaonTOF || isProtonTOF) { - switch (pdgCode) { - case PDG_PROTON: // Proton - histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/numtof"), pt, multiplicity); - break; - case PDG_ANTIPROTON: // Anti-proton - histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/numtof"), pt, multiplicity); - break; - case PDG_PION_PLUS: // Pion+ - histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/numtof"), pt, multiplicity); - break; - case PDG_PION_MINUS: // Pion- - histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/numtof"), pt, multiplicity); - break; - case PDG_KAON_PLUS: // Kaon+ - histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/numtof"), pt, multiplicity); - break; - case PDG_KAON_MINUS: // Kaon- - histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/numtof"), pt, multiplicity); - break; - default: - break; + if (pdgCode == 2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == -2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == 211) { + histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == -211) { + histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == 321) { + histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == -321) { + histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/numtof"), pt, multiplicity); } } } From a720307dcf1aa8a9524d90daf996d9a84d0aebf3 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:57:09 +0100 Subject: [PATCH 03/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index dd002b84864..edec3b28162 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1373,17 +1373,17 @@ struct tofSpectra { const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); - bool isTPCPion = fabs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; - bool isTPCKaon = fabs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; - bool isTPCProton = fabs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; + bool isTPCPion = std::abs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; + bool isTPCKaon = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; + bool isTPCProton = std::abs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); - bool isTOFPion = track.hasTOF() && fabs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; - bool isTOFKaon = track.hasTOF() && fabs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; - bool isTOFProton = track.hasTOF() && fabs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; + bool isTOFPion = track.hasTOF() && std::abs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; + bool isTOFKaon = track.hasTOF() && std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; + bool isTOFProton = track.hasTOF() && std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; // Apply rapidity cut for identified particles if (isTPCPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { @@ -2215,17 +2215,17 @@ struct tofSpectra { const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); - bool isPionTPC = fabs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; - bool isKaonTPC = fabs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; - bool isProtonTPC = fabs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; + bool isPionTPC = std::abs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; + bool isKaonTPC = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; + bool isProtonTPC = std::abs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); - bool isPionTOF = track.hasTOF() && fabs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; - bool isKaonTOF = track.hasTOF() && fabs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; - bool isProtonTOF = track.hasTOF() && fabs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; + bool isPionTOF = track.hasTOF() && std::abs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; + bool isKaonTOF = track.hasTOF() && std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; + bool isProtonTOF = track.hasTOF() && std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; if (isPionTPC || isKaonTPC || isProtonTPC) { if (pdgCode == 2212) { From ae2417084e1458002ae22c81c4d90a9420b6a5ec Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:03:24 +0100 Subject: [PATCH 04/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index edec3b28162..05ca3f1aedc 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1735,15 +1735,15 @@ struct tofSpectra { } if (charmOrigin == RecoDecay::OriginType::NonPrompt) { IsBeautyMother = true; - std::cout << "Charm Origin for Beauty:" << charmOrigin << std::endl; + LOG(info) << "Charm Origin for Beauty: " << charmOrigin; } if (charmOrigin == RecoDecay::OriginType::Prompt) { IsCharmMother = true; - std::cout << "Charm Origin for Charm:" << charmOrigin << std::endl; + LOG(info) << "Charm Origin for Charm: " << charmOrigin; } if (charmOrigin == RecoDecay::OriginType::None) { IsNotHFMother = true; - std::cout << "Charm Origin for NotHF:" << charmOrigin << std::endl; + LOG(info) << "Charm Origin for NotHF: " << charmOrigin; } } } From 7fe4eca09857866cf9699e55c7e4630d3a49eada Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:05:50 +0100 Subject: [PATCH 05/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 05ca3f1aedc..66c15d2da07 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -19,7 +19,6 @@ // O2 includes #include -#include #include #include "ReconstructionDataFormats/Track.h" #include "Framework/runDataProcessing.h" From 7c78f4021a2ff0b5442b2116213783386d9b82d2 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:11:54 +0100 Subject: [PATCH 06/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 66c15d2da07..c7f580a39df 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -70,7 +70,7 @@ std::array, NpCharge> hDecayLengthMCBeauty; // Decay Length std::array, NpCharge> hDecayLengthMCNotHF; // Decay Length in the MC for particles from not a HF // Spectra task -struct tofSpectra { +struct tofSpectra {// o2-linter: disable = name/struct struct : ConfigurableGroup { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; @@ -1107,7 +1107,7 @@ struct tofSpectra { return false; } } - return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f)))); + return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));// o2-linter: disable = std-prefix } return track.isGlobalTrack(); } @@ -1493,7 +1493,7 @@ struct tofSpectra { PROCESS_SWITCH(tofSpectra, process##processorName##inputPid, Form("Process for the %s hypothesis from %s tables", #particleId, #processorName), false); // Full tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull) +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull)// o2-linter: disable = name/macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1507,7 +1507,7 @@ struct tofSpectra { #undef makeProcessFunctionFull // Full LF tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull) +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull)// o2-linter: disable = name/macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1645,7 +1645,7 @@ struct tofSpectra { using RecoMCCollisions = soa::Join; // RD template - void fillTrackHistograms_MC(TrackType const& track, + void fillTrackHistograms_MC(TrackType const& track, // o2-linter: disable = name/function-variable ParticleType::iterator const& mcParticle, RecoMCCollisions::iterator const& collision, ParticleType const& mcParticles) @@ -1720,10 +1720,10 @@ struct tofSpectra { } if (enableDCAvsmotherHistograms) { - bool IsD0Mother = false; - bool IsCharmMother = false; - bool IsBeautyMother = false; - bool IsNotHFMother = false; + bool IsD0Mother = false;// o2-linter: disable = name/function-variable + bool IsCharmMother = false;// o2-linter: disable = name/function-variable + bool IsBeautyMother = false;// o2-linter: disable = name/function-variable + bool IsNotHFMother = false;// o2-linter: disable = name/function-variable if (mcParticle.has_mothers()) { const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false); @@ -1880,7 +1880,7 @@ struct tofSpectra { } template - void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle) + void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle)// o2-linter: disable = name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1902,7 +1902,7 @@ struct tofSpectra { } template - void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision) + void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision)// o2-linter: disable = name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1960,7 +1960,7 @@ struct tofSpectra { } template - void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision) + void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision)// o2-linter: disable = name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled @@ -2163,7 +2163,7 @@ struct tofSpectra { } } PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); - void processMCgen_RecoEvs(soa::Join const& tracks, aod::McTrackLabels const& mcTrackLabels, From a729110664b0b62a8a412c80f2b3931f97679e3b Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:14:34 +0100 Subject: [PATCH 07/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index c7f580a39df..f1f07eca3af 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1107,7 +1107,7 @@ struct tofSpectra {// o2-linter: disable = name/struct return false; } } - return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));// o2-linter: disable = std-prefix + return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));// o2-linter: disable=std-prefix } return track.isGlobalTrack(); } From 9b07c8e8f9eeb6db9e2bfc03b95484dbb7165bbf Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:16:27 +0100 Subject: [PATCH 08/22] Update spectraTOF.cxx From b40030cc241f5ff87f2d848e29e95d98acf1454b Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:19:20 +0100 Subject: [PATCH 09/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index f1f07eca3af..18053ed28be 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -70,7 +70,7 @@ std::array, NpCharge> hDecayLengthMCBeauty; // Decay Length std::array, NpCharge> hDecayLengthMCNotHF; // Decay Length in the MC for particles from not a HF // Spectra task -struct tofSpectra {// o2-linter: disable = name/struct +struct tofSpectra {// o2-linter: disable=struct struct : ConfigurableGroup { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; @@ -1493,7 +1493,7 @@ struct tofSpectra {// o2-linter: disable = name/struct PROCESS_SWITCH(tofSpectra, process##processorName##inputPid, Form("Process for the %s hypothesis from %s tables", #particleId, #processorName), false); // Full tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull)// o2-linter: disable = name/macro +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull)// o2-linter: disable=macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1507,7 +1507,7 @@ struct tofSpectra {// o2-linter: disable = name/struct #undef makeProcessFunctionFull // Full LF tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull)// o2-linter: disable = name/macro +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull)// o2-linter: disable=macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1645,7 +1645,7 @@ struct tofSpectra {// o2-linter: disable = name/struct using RecoMCCollisions = soa::Join; // RD template - void fillTrackHistograms_MC(TrackType const& track, // o2-linter: disable = name/function-variable + void fillTrackHistograms_MC(TrackType const& track, // o2-linter: disable=function-variable ParticleType::iterator const& mcParticle, RecoMCCollisions::iterator const& collision, ParticleType const& mcParticles) @@ -1720,10 +1720,10 @@ struct tofSpectra {// o2-linter: disable = name/struct } if (enableDCAvsmotherHistograms) { - bool IsD0Mother = false;// o2-linter: disable = name/function-variable - bool IsCharmMother = false;// o2-linter: disable = name/function-variable - bool IsBeautyMother = false;// o2-linter: disable = name/function-variable - bool IsNotHFMother = false;// o2-linter: disable = name/function-variable + bool IsD0Mother = false;// o2-linter: disable=function-variable + bool IsCharmMother = false;// o2-linter: disable=function-variable + bool IsBeautyMother = false;// o2-linter: disable=function-variable + bool IsNotHFMother = false;// o2-linter: disable=function-variable if (mcParticle.has_mothers()) { const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false); @@ -1880,7 +1880,7 @@ struct tofSpectra {// o2-linter: disable = name/struct } template - void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle)// o2-linter: disable = name/function-variable + void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle)// o2-linter: disable=function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1902,7 +1902,7 @@ struct tofSpectra {// o2-linter: disable = name/struct } template - void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision)// o2-linter: disable = name/function-variable + void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision)// o2-linter: disable=function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1960,7 +1960,7 @@ struct tofSpectra {// o2-linter: disable = name/struct } template - void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision)// o2-linter: disable = name/function-variable + void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision)// o2-linter: disable=function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled @@ -2163,7 +2163,7 @@ struct tofSpectra {// o2-linter: disable = name/struct } } PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); - void processMCgen_RecoEvs(soa::Join const& tracks, aod::McTrackLabels const& mcTrackLabels, From 202ac56e774507f0ecb5b093c305afce8bbeb570 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:27:55 +0100 Subject: [PATCH 10/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 35 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 18053ed28be..4b62d2642b6 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -70,7 +70,7 @@ std::array, NpCharge> hDecayLengthMCBeauty; // Decay Length std::array, NpCharge> hDecayLengthMCNotHF; // Decay Length in the MC for particles from not a HF // Spectra task -struct tofSpectra {// o2-linter: disable=struct +struct tofSpectra {// o2-linter: disable=name/struct struct : ConfigurableGroup { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; @@ -1493,7 +1493,7 @@ struct tofSpectra {// o2-linter: disable=struct PROCESS_SWITCH(tofSpectra, process##processorName##inputPid, Form("Process for the %s hypothesis from %s tables", #particleId, #processorName), false); // Full tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull)// o2-linter: disable=macro +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull)// o2-linter: disable=name/macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1507,7 +1507,7 @@ struct tofSpectra {// o2-linter: disable=struct #undef makeProcessFunctionFull // Full LF tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull)// o2-linter: disable=macro +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull)// o2-linter: disable=name/macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1645,7 +1645,8 @@ struct tofSpectra {// o2-linter: disable=struct using RecoMCCollisions = soa::Join; // RD template - void fillTrackHistograms_MC(TrackType const& track, // o2-linter: disable=function-variable + // o2-linter: disable=name/function-variable + void fillTrackHistograms_MC(TrackType const& track, ParticleType::iterator const& mcParticle, RecoMCCollisions::iterator const& collision, ParticleType const& mcParticles) @@ -1720,11 +1721,14 @@ struct tofSpectra {// o2-linter: disable=struct } if (enableDCAvsmotherHistograms) { - bool IsD0Mother = false;// o2-linter: disable=function-variable - bool IsCharmMother = false;// o2-linter: disable=function-variable - bool IsBeautyMother = false;// o2-linter: disable=function-variable - bool IsNotHFMother = false;// o2-linter: disable=function-variable - + // o2-linter: disable=name/function-variable + bool IsD0Mother = false; + // o2-linter: disable=name/function-variable + bool IsCharmMother = false; + // o2-linter: disable=name/function-variable + bool IsBeautyMother = false; + // o2-linter: disable=name/function-variable + bool IsNotHFMother = false; if (mcParticle.has_mothers()) { const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false); for (const auto& mother : mcParticle.template mothers_as()) { @@ -1880,7 +1884,8 @@ struct tofSpectra {// o2-linter: disable=struct } template - void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle)// o2-linter: disable=function-variable + // o2-linter: disable=name/function-variable + void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle) { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1902,7 +1907,8 @@ struct tofSpectra {// o2-linter: disable=struct } template - void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision)// o2-linter: disable=function-variable + // o2-linter: disable=name/function-variable + void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision) { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1960,7 +1966,8 @@ struct tofSpectra {// o2-linter: disable=struct } template - void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision)// o2-linter: disable=function-variable + // o2-linter: disable=name/function-variable + void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision) { if (!isParticleEnabled()) { // Check if the particle is enabled @@ -2163,8 +2170,8 @@ struct tofSpectra {// o2-linter: disable=struct } } PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); - void processMCgen_RecoEvs(soa::Join const& tracks, aod::McTrackLabels const& mcTrackLabels, RecoMCCollisions const& collisions, From 0a1bd2daf67d703ad929e4266566396283fd6ef1 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:30:56 +0100 Subject: [PATCH 11/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 4b62d2642b6..eb2a85454ae 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1473,7 +1473,7 @@ struct tofSpectra {// o2-linter: disable=name/struct } } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); - +// o2-linter: disable=name/macro #define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join; // RD template - // o2-linter: disable=name/function-variable void fillTrackHistograms_MC(TrackType const& track, ParticleType::iterator const& mcParticle, RecoMCCollisions::iterator const& collision, - ParticleType const& mcParticles) + ParticleType const& mcParticles)// o2-linter: disable=name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; From 1e71974d10120ecfa8bf09429213d461a9a75c5a Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:32:44 +0100 Subject: [PATCH 12/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index eb2a85454ae..f624106f6b9 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1473,7 +1473,7 @@ struct tofSpectra {// o2-linter: disable=name/struct } } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); -// o2-linter: disable=name/macro + #define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join; // RD template + // o2-linter: disable=name/function-variable void fillTrackHistograms_MC(TrackType const& track, ParticleType::iterator const& mcParticle, RecoMCCollisions::iterator const& collision, - ParticleType const& mcParticles)// o2-linter: disable=name/function-variable + ParticleType const& mcParticles) { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -2169,8 +2170,8 @@ struct tofSpectra {// o2-linter: disable=name/struct } } PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); - // o2-linter: disable=name/function-variable - void processMCgen_RecoEvs(soa::Join const& tracks, aod::McTrackLabels const& mcTrackLabels, RecoMCCollisions const& collisions, From 6f5b4c48f5273a6a40478dabc5d0b50577b65745 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:35:19 +0100 Subject: [PATCH 13/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index f624106f6b9..3ed8f6eebe2 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1966,8 +1966,7 @@ struct tofSpectra {// o2-linter: disable=name/struct } template - // o2-linter: disable=name/function-variable - void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision) + void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, GenMCCollisions::iterator const& mcCollision) // o2-linter: disable=name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled From 7c74c4e1b40739d0ce3cd985b10bd250239fe096 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:37:40 +0100 Subject: [PATCH 14/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 3ed8f6eebe2..f1a3ed8e972 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1493,7 +1493,7 @@ struct tofSpectra {// o2-linter: disable=name/struct PROCESS_SWITCH(tofSpectra, process##processorName##inputPid, Form("Process for the %s hypothesis from %s tables", #particleId, #processorName), false); // Full tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull)// o2-linter: disable=name/macro +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(Full, inputPid, particleId, true, TOFFull, TPCFull) // o2-linter: disable=name/macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1645,8 +1645,7 @@ struct tofSpectra {// o2-linter: disable=name/struct using RecoMCCollisions = soa::Join; // RD template - // o2-linter: disable=name/function-variable - void fillTrackHistograms_MC(TrackType const& track, + void fillTrackHistograms_MC(TrackType const& track, // o2-linter: disable=name/function-variable ParticleType::iterator const& mcParticle, RecoMCCollisions::iterator const& collision, ParticleType const& mcParticles) @@ -1721,14 +1720,10 @@ struct tofSpectra {// o2-linter: disable=name/struct } if (enableDCAvsmotherHistograms) { - // o2-linter: disable=name/function-variable - bool IsD0Mother = false; - // o2-linter: disable=name/function-variable - bool IsCharmMother = false; - // o2-linter: disable=name/function-variable - bool IsBeautyMother = false; - // o2-linter: disable=name/function-variable - bool IsNotHFMother = false; + bool IsD0Mother = false; // o2-linter: disable=name/function-variable + bool IsCharmMother = false; // o2-linter: disable=name/function-variable + bool IsBeautyMother = false; // o2-linter: disable=name/function-variable + bool IsNotHFMother = false; // o2-linter: disable=name/function-variable if (mcParticle.has_mothers()) { const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false); for (const auto& mother : mcParticle.template mothers_as()) { @@ -1884,8 +1879,7 @@ struct tofSpectra {// o2-linter: disable=name/struct } template - // o2-linter: disable=name/function-variable - void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle) + void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle) // o2-linter: disable=name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; @@ -1907,8 +1901,7 @@ struct tofSpectra {// o2-linter: disable=name/struct } template - // o2-linter: disable=name/function-variable - void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision) + void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, RecoMCCollisions::iterator const& collision) // o2-linter: disable=name/function-variable { if (!isParticleEnabled()) { // Check if the particle is enabled return; From 48f5a428c2885e3e7982d49e3964e72cca2a73c4 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:39:39 +0100 Subject: [PATCH 15/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index f1a3ed8e972..4160c6aa5ac 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1474,7 +1474,7 @@ struct tofSpectra {// o2-linter: disable=name/struct } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); -#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ +#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ // o2-linter: disable=name/macro void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join Date: Tue, 7 Jan 2025 08:42:52 +0100 Subject: [PATCH 16/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 4160c6aa5ac..cdc56ecdb7d 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -70,7 +70,8 @@ std::array, NpCharge> hDecayLengthMCBeauty; // Decay Length std::array, NpCharge> hDecayLengthMCNotHF; // Decay Length in the MC for particles from not a HF // Spectra task -struct tofSpectra {// o2-linter: disable=name/struct + // o2-linter: disable=name/workflow-file +struct tofSpectra { // o2-linter: disable=name/struct struct : ConfigurableGroup { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; From a41b4a3ed6c2ab0abcf333e36b935bea39c24603 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:47:57 +0100 Subject: [PATCH 17/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index cdc56ecdb7d..82309a2f5c8 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -70,7 +70,7 @@ std::array, NpCharge> hDecayLengthMCBeauty; // Decay Length std::array, NpCharge> hDecayLengthMCNotHF; // Decay Length in the MC for particles from not a HF // Spectra task - // o2-linter: disable=name/workflow-file +// o2-linter: disable=name/workflow-file struct tofSpectra { // o2-linter: disable=name/struct struct : ConfigurableGroup { Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; From 55697e5cf50b923e12808728342ea99329fbbf76 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:10:31 +0100 Subject: [PATCH 18/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 82309a2f5c8..25ecbae7148 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1475,7 +1475,7 @@ struct tofSpectra { // o2-linter: disable=name/struct } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); -#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ // o2-linter: disable=name/macro +#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join Date: Tue, 7 Jan 2025 13:16:20 +0100 Subject: [PATCH 19/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 25ecbae7148..595154ca317 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1474,7 +1474,7 @@ struct tofSpectra { // o2-linter: disable=name/struct } } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); - +// o2-linter: disable-file=name/macro #define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join Date: Tue, 7 Jan 2025 13:18:48 +0100 Subject: [PATCH 20/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 595154ca317..48cb57ea5b2 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1474,8 +1474,8 @@ struct tofSpectra { // o2-linter: disable=name/struct } } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); -// o2-linter: disable-file=name/macro -#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ + +#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) /* o2-linter: disable=name/macro */ \ void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join Date: Tue, 7 Jan 2025 13:31:41 +0100 Subject: [PATCH 21/22] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 48cb57ea5b2..25ecbae7148 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1475,7 +1475,7 @@ struct tofSpectra { // o2-linter: disable=name/struct } // end of the process function PROCESS_SWITCH(tofSpectra, processDerived, "Derived data processor", false); -#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) /* o2-linter: disable=name/macro */ \ +#define makeProcessFunction(processorName, inputPid, particleId, isFull, tofTable, tpcTable) \ void process##processorName##inputPid(CollisionCandidates::iterator const& collision, \ soa::Join Date: Tue, 7 Jan 2025 12:32:08 +0000 Subject: [PATCH 22/22] Please consider the following formatting changes --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 316 +++++++++++++++--------------- 1 file changed, 159 insertions(+), 157 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 25ecbae7148..414b3588e9f 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1108,7 +1108,7 @@ struct tofSpectra { // o2-linter: disable=name/struct return false; } } - return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));// o2-linter: disable=std-prefix + return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f)))); // o2-linter: disable=std-prefix } return track.isGlobalTrack(); } @@ -1344,13 +1344,13 @@ struct tofSpectra { // o2-linter: disable=name/struct soa::Join const& tracks) -{ + { // Event selection criteria if (!collision.sel8() || std::abs(collision.posZ()) > 10 || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { - return; + return; } histos.fill(HIST("test_occupancy/event/vertexz"), collision.posZ()); @@ -1362,80 +1362,81 @@ struct tofSpectra { // o2-linter: disable=name/struct int tpcCount = 0, tofCount = 0; for (const auto& track : tracks) { - // Track selection criteria - if (track.tpcNClsCrossedRows() < 70 || track.tpcChi2NCl() > 4 || track.tpcChi2NCl() < 0.5 || - track.itsChi2NCl() > 36 || std::abs(track.dcaXY()) > 0.05 || std::abs(track.dcaZ()) > 2.0 || - std::abs(track.eta()) > 0.8 || track.tpcCrossedRowsOverFindableCls() < 0.8 || track.tpcNClsFound() < 100 || - !(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)) { - continue; - } - const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);; - const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); - const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); + // Track selection criteria + if (track.tpcNClsCrossedRows() < 70 || track.tpcChi2NCl() > 4 || track.tpcChi2NCl() < 0.5 || + track.itsChi2NCl() > 36 || std::abs(track.dcaXY()) > 0.05 || std::abs(track.dcaZ()) > 2.0 || + std::abs(track.eta()) > 0.8 || track.tpcCrossedRowsOverFindableCls() < 0.8 || track.tpcNClsFound() < 100 || + !(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit)) { + continue; + } + const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track); + ; + const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); + const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); - bool isTPCPion = std::abs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; - bool isTPCKaon = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; - bool isTPCProton = std::abs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; + bool isTPCPion = std::abs(nsigmaTPCPi) < trkselOptions.cfgCutNsigma; + bool isTPCKaon = std::abs(nsigmaTPCKa) < trkselOptions.cfgCutNsigma; + bool isTPCProton = std::abs(nsigmaTPCPr) < trkselOptions.cfgCutNsigma; - const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); - const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); - const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); + const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); + const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); + const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); - bool isTOFPion = track.hasTOF() && std::abs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; - bool isTOFKaon = track.hasTOF() && std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; - bool isTOFProton = track.hasTOF() && std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; + bool isTOFPion = track.hasTOF() && std::abs(nsigmaTOFPi) < trkselOptions.cfgCutNsigma; + bool isTOFKaon = track.hasTOF() && std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; + bool isTOFProton = track.hasTOF() && std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; - // Apply rapidity cut for identified particles - if (isTPCPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { - tpcCount++; - if (track.sign() > 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - } else { - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - } - } else if (isTPCKaon && std::abs(track.rapidity(PID::getMass(3))) < trkselOptions.cfgCutY) { - tpcCount++; - if (track.sign() > 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - } else { - histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - } - } else if (isTPCProton && std::abs(track.rapidity(PID::getMass(4))) < trkselOptions.cfgCutY) { - tpcCount++; - if (track.sign() > 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); - } else { - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); - } + // Apply rapidity cut for identified particles + if (isTPCPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { + tpcCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + } + } else if (isTPCKaon && std::abs(track.rapidity(PID::getMass(3))) < trkselOptions.cfgCutY) { + tpcCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); } + } else if (isTPCProton && std::abs(track.rapidity(PID::getMass(4))) < trkselOptions.cfgCutY) { + tpcCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } + } - // TOF PID histograms - if (isTOFPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { - tofCount++; - if (track.sign() > 0) { - histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - } else { - histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - } - } else if (isTOFKaon && std::abs(track.rapidity(PID::getMass(3))) < trkselOptions.cfgCutY) { - tofCount++; - if (track.sign() > 0) { - histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - } else { - histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - } - } else if (isTOFProton && std::abs(track.rapidity(PID::getMass(4))) < trkselOptions.cfgCutY) { - tofCount++; - if (track.sign() > 0) { - histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); - } else { - histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); - } + // TOF PID histograms + if (isTOFPion && std::abs(track.rapidity(PID::getMass(2))) < trkselOptions.cfgCutY) { + tofCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); } + } else if (isTOFKaon && std::abs(track.rapidity(PID::getMass(3))) < trkselOptions.cfgCutY) { + tofCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + } + } else if (isTOFProton && std::abs(track.rapidity(PID::getMass(4))) < trkselOptions.cfgCutY) { + tofCount++; + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } else { + histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } + } } histos.fill(HIST("test_occupancy/tpcCount"), tpcCount); histos.fill(HIST("test_occupancy/tofCount"), tofCount); -} // process function + } // process function PROCESS_SWITCH(tofSpectra, processOccupancy, "check for occupancy plots", false); void processStandard(CollisionCandidates::iterator const& collision, @@ -1508,7 +1509,7 @@ struct tofSpectra { // o2-linter: disable=name/struct #undef makeProcessFunctionFull // Full LF tables -#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull)// o2-linter: disable=name/macro +#define makeProcessFunctionFull(inputPid, particleId) makeProcessFunction(LfFull, inputPid, particleId, true, TOFFull, TPCLfFull) // o2-linter: disable=name/macro makeProcessFunctionFull(El, Electron); makeProcessFunctionFull(Mu, Muon); @@ -1721,10 +1722,10 @@ struct tofSpectra { // o2-linter: disable=name/struct } if (enableDCAvsmotherHistograms) { - bool IsD0Mother = false; // o2-linter: disable=name/function-variable - bool IsCharmMother = false; // o2-linter: disable=name/function-variable + bool IsD0Mother = false; // o2-linter: disable=name/function-variable + bool IsCharmMother = false; // o2-linter: disable=name/function-variable bool IsBeautyMother = false; // o2-linter: disable=name/function-variable - bool IsNotHFMother = false; // o2-linter: disable=name/function-variable + bool IsNotHFMother = false; // o2-linter: disable=name/function-variable if (mcParticle.has_mothers()) { const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false); for (const auto& mother : mcParticle.template mothers_as()) { @@ -2147,70 +2148,71 @@ struct tofSpectra { // o2-linter: disable=name/struct continue; } - if (pdgCode == 2212) { - histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); - } else if (pdgCode == -2212) { - histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); - } else if (pdgCode == 211) { - histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); - } else if (pdgCode == -211) { - histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); - } else if (pdgCode == 321) { - histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); - } else if (pdgCode == -321) { - histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); + if (pdgCode == 2212) { + histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == -2212) { + histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == 211) { + histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == -211) { + histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == 321) { + histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); + } else if (pdgCode == -321) { + histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); } } } PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); void processMCgen_RecoEvs(soa::Join const& tracks, - aod::McTrackLabels const& mcTrackLabels, - RecoMCCollisions const& collisions, - aod::McParticles const& mcParticles) -{ + aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, + aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr> const& tracks, + aod::McTrackLabels const& mcTrackLabels, + RecoMCCollisions const& collisions, + aod::McParticles const& mcParticles) + { for (const auto& collision : collisions) { - if (!collision.has_mcCollision()) { - continue; - } + if (!collision.has_mcCollision()) { + continue; + } - const auto& mcCollision = collision.mcCollision_as(); - histos.fill(HIST("Vertex/RecoEvs/histGenVtxMC"), mcCollision.posZ()); - histos.fill(HIST("Centrality/RecoEvs/ImpParm"), mcCollision.impactParameter()); - const float multiplicity = mcCollision.impactParameter(); - - for (const auto& track : tracks) { - if (track.tpcNClsCrossedRows() < 70 || - track.tpcChi2NCl() > 4 || - track.tpcChi2NCl() < 0.5 || - track.itsChi2NCl() > 36 || - std::abs(track.dcaXY()) > 0.05 || - std::abs(track.dcaZ()) > 2.0 || - std::abs(track.eta()) > 0.8 || - track.tpcCrossedRowsOverFindableCls() < 0.8 || - track.tpcNClsFound() < 100 || - !(o2::aod::track::TPCrefit) || - !(o2::aod::track::ITSrefit)) { - continue; - } - const auto& mcLabel = mcTrackLabels.iteratorAt(track.globalIndex()); - if (mcLabel.mcParticleId() < 0 || mcLabel.mcParticleId() >= mcParticles.size()) { - continue; - } - const auto& mcParticle = mcParticles.iteratorAt(mcLabel.mcParticleId()); - if (!mcParticle.isPhysicalPrimary()) { - continue; - } + const auto& mcCollision = collision.mcCollision_as(); + histos.fill(HIST("Vertex/RecoEvs/histGenVtxMC"), mcCollision.posZ()); + histos.fill(HIST("Centrality/RecoEvs/ImpParm"), mcCollision.impactParameter()); + const float multiplicity = mcCollision.impactParameter(); + + for (const auto& track : tracks) { + if (track.tpcNClsCrossedRows() < 70 || + track.tpcChi2NCl() > 4 || + track.tpcChi2NCl() < 0.5 || + track.itsChi2NCl() > 36 || + std::abs(track.dcaXY()) > 0.05 || + std::abs(track.dcaZ()) > 2.0 || + std::abs(track.eta()) > 0.8 || + track.tpcCrossedRowsOverFindableCls() < 0.8 || + track.tpcNClsFound() < 100 || + !(o2::aod::track::TPCrefit) || + !(o2::aod::track::ITSrefit)) { + continue; + } + const auto& mcLabel = mcTrackLabels.iteratorAt(track.globalIndex()); + if (mcLabel.mcParticleId() < 0 || mcLabel.mcParticleId() >= mcParticles.size()) { + continue; + } + const auto& mcParticle = mcParticles.iteratorAt(mcLabel.mcParticleId()); + if (!mcParticle.isPhysicalPrimary()) { + continue; + } - int pdgCode = mcParticle.pdgCode(); - float pt = mcParticle.pt(); - float absY = std::abs(mcParticle.y()); - if (absY > trkselOptions.cfgCutY) { - continue; - } + int pdgCode = mcParticle.pdgCode(); + float pt = mcParticle.pt(); + float absY = std::abs(mcParticle.y()); + if (absY > trkselOptions.cfgCutY) { + continue; + } - const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track);; + const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track); + ; const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); @@ -2226,40 +2228,40 @@ struct tofSpectra { // o2-linter: disable=name/struct bool isKaonTOF = track.hasTOF() && std::abs(nsigmaTOFKa) < trkselOptions.cfgCutNsigma; bool isProtonTOF = track.hasTOF() && std::abs(nsigmaTOFPr) < trkselOptions.cfgCutNsigma; - if (isPionTPC || isKaonTPC || isProtonTPC) { - if (pdgCode == 2212) { - histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/num"), pt, multiplicity); - } else if (pdgCode == -2212) { - histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/num"), pt, multiplicity); - } else if (pdgCode == 211) { - histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/num"), pt, multiplicity); - } else if (pdgCode == -211) { - histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/num"), pt, multiplicity); - } else if (pdgCode == 321) { - histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/num"), pt, multiplicity); - } else if (pdgCode == -321) { - histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/num"), pt, multiplicity); - } - } + if (isPionTPC || isKaonTPC || isProtonTPC) { + if (pdgCode == 2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == -2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == 211) { + histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == -211) { + histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == 321) { + histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/num"), pt, multiplicity); + } else if (pdgCode == -321) { + histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/num"), pt, multiplicity); + } + } - if (isPionTOF || isKaonTOF || isProtonTOF) { - if (pdgCode == 2212) { - histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/numtof"), pt, multiplicity); - } else if (pdgCode == -2212) { - histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/numtof"), pt, multiplicity); - } else if (pdgCode == 211) { - histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/numtof"), pt, multiplicity); - } else if (pdgCode == -211) { - histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/numtof"), pt, multiplicity); - } else if (pdgCode == 321) { - histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/numtof"), pt, multiplicity); - } else if (pdgCode == -321) { - histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/numtof"), pt, multiplicity); - } - } + if (isPionTOF || isKaonTOF || isProtonTOF) { + if (pdgCode == 2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/pos/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == -2212) { + histos.fill(HIST("MC/test/RecoEvs/pr/neg/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == 211) { + histos.fill(HIST("MC/test/RecoEvs/pi/pos/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == -211) { + histos.fill(HIST("MC/test/RecoEvs/pi/neg/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == 321) { + histos.fill(HIST("MC/test/RecoEvs/ka/pos/prm/pt/numtof"), pt, multiplicity); + } else if (pdgCode == -321) { + histos.fill(HIST("MC/test/RecoEvs/ka/neg/prm/pt/numtof"), pt, multiplicity); + } } + } } -} + } PROCESS_SWITCH(tofSpectra, processMCgen_RecoEvs, "process generated MC (reconstructed events)", false); }; // end of spectra task