From d3c63357141db71ba943c6750baf7b8829df2fa5 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sat, 19 Sep 2026 17:47:03 +0200 Subject: [PATCH] [PWGCF] DptDpt - Incorporating deuterons --- PWGCF/TableProducer/dptDptFilter.cxx | 12 ++- PWGCF/TableProducer/dptDptFilter.h | 32 +++---- PWGCF/Tasks/dptDptCorrelations.cxx | 35 ++++--- .../Tasks/dptDptEfficiencyAndQc.cxx | 93 +++++++++---------- .../Tasks/particleOriginAnalysis.cxx | 5 +- 5 files changed, 89 insertions(+), 88 deletions(-) diff --git a/PWGCF/TableProducer/dptDptFilter.cxx b/PWGCF/TableProducer/dptDptFilter.cxx index baff1b96e2d..592070588c7 100644 --- a/PWGCF/TableProducer/dptDptFilter.cxx +++ b/PWGCF/TableProducer/dptDptFilter.cxx @@ -72,8 +72,8 @@ namespace o2::analysis::dptdptfilter { using DptDptFullTracks = soa::Join; using DptDptFullTracksAmbiguous = soa::Join; -using DptDptTracksPID = soa::Join; -using DptDptTracksFullPID = soa::Join; +using DptDptTracksPID = soa::Join; +using DptDptTracksFullPID = soa::Join; using DptDptFullTracksPID = soa::Join; using DptDptFullTracksPIDAmbiguous = soa::Join; using DptDptFullTracksFullPID = soa::Join; @@ -1160,7 +1160,7 @@ struct DptDptFilterTracks { Configurable cfgTrackType{"cfgTrackType", 4, "Type of selected tracks: 0 = no selection;1 = Run2 global tracks FB96;3 = Run3 tracks;4 = Run3 tracks MM sel;5 = Run2 TPC only tracks;7 = Run 3 TPC only tracks;30-33 = any/two on 3 ITS,any/all in 7 ITS;40-43 same as 30-33 w tighter DCAxy;50-53 w tighter pT DCAz. Default 4"}; Configurable cfgOnlyInOneSide{"cfgOnlyInOneSide", false, "select tracks that don't cross the TPC central membrane. Default false"}; Configurable cfgTraceDCAOutliers{"cfgTraceDCAOutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; - Configurable cfgTraceOutOfSpeciesParticles{"cfgTraceOutOfSpeciesParticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; + Configurable cfgTraceOutOfSpeciesParticles{"cfgTraceOutOfSpeciesParticles", false, "Track the particles which are not e,mu,pi,K,p,d: false/true. Default false"}; Configurable cfgRecoIdMethod{"cfgRecoIdMethod", 0, "Method for identifying reconstructed tracks: 0 No PID, 1 PID, 2 mcparticle, 3 mcparticle only primaries, 4 mcparticle only sec, 5 mcparicle only sec from decays, 6 mcparticle only sec from material. Default 0"}; Configurable cfgTuneTrackSelection{"cfgTuneTrackSelection", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, tpcshcls-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,0.4,false,2.4,false,3.2,false}"}; Configurable cfgPionPIDSelection{"cfgPionPIDSelection", @@ -1178,6 +1178,9 @@ struct DptDptFilterTracks { Configurable cfgMuonPIDSelection{"cfgMuonPIDSelection", {}, "PID criteria for muons"}; + Configurable cfgDeuteronPIDSelection{"cfgDeuteronPIDSelection", + {}, + "PID criteria for deuterons"}; OutputObj fOutput{"DptDptFilterTracksInfo", OutputObjHandlingPolicy::AnalysisObject}; Service fPDG; @@ -1280,6 +1283,7 @@ struct DptDptFilterTracks { insertInPIDselector(cfgPionPIDSelection, 2); insertInPIDselector(cfgKaonPIDSelection, 3); insertInPIDselector(cfgProtonPIDSelection, 4); + insertInPIDselector(cfgDeuteronPIDSelection, 5); if ((fDataType == kData) || (fDataType == kDataNoEvtSel) || (fDataType == kMC)) { /* create the reconstructed data histograms */ @@ -1481,7 +1485,7 @@ struct DptDptFilterTracks { /* the debug info output file if required */ if (cfgOutDebugInfo) { debugstream.open("tracings.csv"); - debugstream << "p,piw,pt,hastof,dEdx,beta,tpcnEl,tpcnMu,tpcnPi,tpcnKa,tpcnPr,tofnEl,tofnMu,tofnPi,tofnKa,tofnPr,tpcnElSft,tpcnMuSft,tpcnPiSft,tpcnKaSft,tpcnPrSft,tofnElSft,tofnMuSft,tofnPiSft,tofnKaSft,tofnPrSft,idcode,pid,pid2,truepid,phprim,process\n"; + debugstream << "p,piw,pt,hastof,dEdx,beta,tpcnEl,tpcnMu,tpcnPi,tpcnKa,tpcnPr,tpcnDe,tofnEl,tofnMu,tofnPi,tofnKa,tofnPr,tofnDe,tpcnElSft,tpcnMuSft,tpcnPiSft,tpcnKaSft,tpcnPrSft,tpcnDeSft,tofnElSft,tofnMuSft,tofnPiSft,tofnKaSft,tofnPrSft,tofnDeSft,idcode,pid,pid2,truepid,phprim,process\n"; debugstream.close(); } } diff --git a/PWGCF/TableProducer/dptDptFilter.h b/PWGCF/TableProducer/dptDptFilter.h index ba712975084..af632d74ae6 100644 --- a/PWGCF/TableProducer/dptDptFilter.h +++ b/PWGCF/TableProducer/dptDptFilter.h @@ -1733,12 +1733,12 @@ inline bool acceptParticle(ParticleObject& particle, MCCollisionObject const&) ////////////////////////////////////////////////////////////////////////////////// struct PIDSpeciesSelection { - const std::vector pdgcodes = {kElectron, kMuonMinus, kPiPlus, kKPlus, kProton}; - const std::vector spnames = {"e", "mu", "pi", "ka", "p"}; - const std::vector sptitles = {"e", "#mu", "#pi", "K", "p"}; - const std::vector spfnames = {"E", "Mu", "Pi", "Ka", "Pr"}; - const std::vector spadjnames = {"Electron", "Muon", "Pion", "Kaon", "Proton"}; - const std::vector spmasses = {o2::constants::physics::MassElectron, o2::constants::physics::MassMuon, o2::constants::physics::MassPionCharged, o2::constants::physics::MassKaonCharged, o2::constants::physics::MassProton}; + const std::vector pdgcodes = {kElectron, kMuonMinus, kPiPlus, kKPlus, kProton, o2::constants::physics::kDeuteron}; + const std::vector spnames = {"e", "mu", "pi", "ka", "p", "d"}; + const std::vector sptitles = {"e", "#mu", "#pi", "K", "p", "d"}; + const std::vector spfnames = {"E", "Mu", "Pi", "Ka", "Pr", "De"}; + const std::vector spadjnames = {"Electron", "Muon", "Pion", "Kaon", "Proton", "Deuteron"}; + const std::vector spmasses = {o2::constants::physics::MassElectron, o2::constants::physics::MassMuon, o2::constants::physics::MassPionCharged, o2::constants::physics::MassKaonCharged, o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}; const std::vector chadjnames = {"P", "M"}; const char* hadname = "h"; const char* hadtitle = "h"; @@ -1787,10 +1787,10 @@ struct PIDSpeciesSelection { auto last = config[config.size() - 1]; uint8_t lastsp = species[config.size() - 1]; LOGF(info, "Inserted species %d with", lastsp); - LOGF(info, " minTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMinNSigmasTPC[0], last->mMinNSigmasTPC[1], last->mMinNSigmasTPC[2], last->mMinNSigmasTPC[3], last->mMinNSigmasTPC[4]); - LOGF(info, " maxTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMaxNSigmasTPC[0], last->mMaxNSigmasTPC[1], last->mMaxNSigmasTPC[2], last->mMaxNSigmasTPC[3], last->mMaxNSigmasTPC[4]); - LOGF(info, " minTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMinNSigmasTOF[0], last->mMinNSigmasTOF[1], last->mMinNSigmasTOF[2], last->mMinNSigmasTOF[3], last->mMinNSigmasTOF[4]); - LOGF(info, " maxTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMaxNSigmasTOF[0], last->mMaxNSigmasTOF[1], last->mMaxNSigmasTOF[2], last->mMaxNSigmasTOF[3], last->mMaxNSigmasTOF[4]); + LOGF(info, " minTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMinNSigmasTPC[0], last->mMinNSigmasTPC[1], last->mMinNSigmasTPC[2], last->mMinNSigmasTPC[3], last->mMinNSigmasTPC[4], last->mMinNSigmasTPC[5]); + LOGF(info, " maxTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMaxNSigmasTPC[0], last->mMaxNSigmasTPC[1], last->mMaxNSigmasTPC[2], last->mMaxNSigmasTPC[3], last->mMaxNSigmasTPC[4], last->mMaxNSigmasTPC[5]); + LOGF(info, " minTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMinNSigmasTOF[0], last->mMinNSigmasTOF[1], last->mMinNSigmasTOF[2], last->mMinNSigmasTOF[3], last->mMinNSigmasTOF[4], last->mMinNSigmasTOF[5]); + LOGF(info, " maxTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMaxNSigmasTOF[0], last->mMaxNSigmasTOF[1], last->mMaxNSigmasTOF[2], last->mMaxNSigmasTOF[3], last->mMaxNSigmasTOF[4], last->mMaxNSigmasTOF[5]); LOGF(info, " %.1f < pT < %.1f", last->mPtMin, last->mPtMax); } void addExcludedSpecies(uint8_t sp, const o2::analysis::TrackSelectionPIDCfg* incfg) @@ -1802,18 +1802,18 @@ struct PIDSpeciesSelection { uint8_t lastsp = speciesexclude[configexclude.size() - 1]; LOGF(info, "Inserted species %d for exclusion with", lastsp); - LOGF(info, " minTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMinNSigmasTPC[0], last->mMinNSigmasTPC[1], last->mMinNSigmasTPC[2], last->mMinNSigmasTPC[3], last->mMinNSigmasTPC[4]); - LOGF(info, " maxTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMaxNSigmasTPC[0], last->mMaxNSigmasTPC[1], last->mMaxNSigmasTPC[2], last->mMaxNSigmasTPC[3], last->mMaxNSigmasTPC[4]); - LOGF(info, " minTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMinNSigmasTOF[0], last->mMinNSigmasTOF[1], last->mMinNSigmasTOF[2], last->mMinNSigmasTOF[3], last->mMinNSigmasTOF[4]); - LOGF(info, " maxTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMaxNSigmasTOF[0], last->mMaxNSigmasTOF[1], last->mMaxNSigmasTOF[2], last->mMaxNSigmasTOF[3], last->mMaxNSigmasTOF[4]); + LOGF(info, " minTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMinNSigmasTPC[0], last->mMinNSigmasTPC[1], last->mMinNSigmasTPC[2], last->mMinNSigmasTPC[3], last->mMinNSigmasTPC[4], last->mMinNSigmasTPC[5]); + LOGF(info, " maxTPC nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMaxNSigmasTPC[0], last->mMaxNSigmasTPC[1], last->mMaxNSigmasTPC[2], last->mMaxNSigmasTPC[3], last->mMaxNSigmasTPC[4], last->mMaxNSigmasTPC[5]); + LOGF(info, " minTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMinNSigmasTOF[0], last->mMinNSigmasTOF[1], last->mMinNSigmasTOF[2], last->mMinNSigmasTOF[3], last->mMinNSigmasTOF[4], last->mMinNSigmasTOF[5]); + LOGF(info, " maxTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f, de: %.2f", last->mMaxNSigmasTOF[0], last->mMaxNSigmasTOF[1], last->mMaxNSigmasTOF[2], last->mMaxNSigmasTOF[3], last->mMaxNSigmasTOF[4], last->mMaxNSigmasTOF[5]); LOGF(info, " %.1f < pT < %.1f", last->mPtMin, last->mPtMax); } template int8_t whichSpecies(TrackObject const& track) { TString debuginfo; - std::vector tpcnsigmas = {track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; - std::vector tofnsigmas = {track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr()}; + std::vector tpcnsigmas = {track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), track.tpcNSigmaDe()}; + std::vector tofnsigmas = {track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), track.tofNSigmaDe()}; auto outmomentumdebug = [&]() { if constexpr (outdebug != 0) { diff --git a/PWGCF/Tasks/dptDptCorrelations.cxx b/PWGCF/Tasks/dptDptCorrelations.cxx index 4ec5b4125f9..7da4997b702 100644 --- a/PWGCF/Tasks/dptDptCorrelations.cxx +++ b/PWGCF/Tasks/dptDptCorrelations.cxx @@ -287,17 +287,17 @@ struct DptDptCorrelations { photon = p1+p2; photon.M()*/ - constexpr float kLARGETANTHETA = 1e10; - constexpr float kVERYSMALLETA = 1e-10; - float tantheta1 = kLARGETANTHETA; + constexpr float LARGETANTHETA = 1e10; + constexpr float VERYSMALLETA = 1e-10; + float tantheta1 = LARGETANTHETA; - if (track1.eta() < -kVERYSMALLETA || track1.eta() > kVERYSMALLETA) { + if (track1.eta() < -VERYSMALLETA || track1.eta() > VERYSMALLETA) { float expTmp = std::exp(-track1.eta()); tantheta1 = 2.0 * expTmp / (1.0 - expTmp * expTmp); } - float tantheta2 = kLARGETANTHETA; - if (track2.eta() < -kVERYSMALLETA || track2.eta() > kVERYSMALLETA) { + float tantheta2 = LARGETANTHETA; + if (track2.eta() < -VERYSMALLETA || track2.eta() > VERYSMALLETA) { float expTmp = std::exp(-track2.eta()); tantheta2 = 2.0 * expTmp / (1.0 - expTmp * expTmp); } @@ -918,8 +918,8 @@ struct DptDptCorrelations { std::string cfgCCDBSuffix{""}; /* pair conversion suppression defaults */ - static constexpr float kCfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; - Configurable> cfgPairCut{"cfgPairCut", {kCfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Conversion suppressions"}; + static constexpr float KCfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; + Configurable> cfgPairCut{"cfgPairCut", {KCfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Conversion suppressions"}; /* two tracks cut */ Configurable cfgTwoTrackCut{"cfgTwoTrackCut", -1, "Two-tracks cut: -1 = off; >0 otherwise distance value (suggested: 0.02"}; Configurable cfgTwoTrackCutMinRadius{"cfgTwoTrackCutMinRadius", 0.8f, "Two-tracks cut: radius in m from which two-tracks cut is applied"}; @@ -1020,8 +1020,7 @@ struct DptDptCorrelations { { /* self configure the desired species */ o2::analysis::dptdptfilter::PIDSpeciesSelection pidselector; - std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; - std::vector spids = {0, 1, 2, 3, 4}; + std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection", "cfgDeuteronPIDSelection"}; for (uint i = 0; i < cfgnames.size(); ++i) { auto includeIt = [&pidselector, &initContext](int spid, const auto& name) { bool mUseIt = false; @@ -1036,7 +1035,7 @@ struct DptDptCorrelations { } } }; - includeIt(spids[i], cfgnames[i]); + includeIt(i, cfgnames[i]); } uint nspecies = pidselector.getNSpecies(); if (nspecies == 0) { @@ -1224,8 +1223,8 @@ struct DptDptCorrelations { { using namespace correlationstask; - static constexpr std::string_view kStrDim[] = {"", "", "2D", "3D", "4D"}; - return kStrDim[nNoOfDimensions].data(); + static constexpr std::string_view KStrDim[] = {"", "", "2D", "3D", "4D"}; + return KStrDim[nNoOfDimensions].data(); } template @@ -1491,7 +1490,7 @@ struct DptDptCorrelations { SliceCache cache; using BinningZVtxMultRec = ColumnBinningPolicy; BinningZVtxMultRec bindingOnVtxAndMultRec{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - static constexpr int kNoOfLoggingCombinations = 10; + static constexpr int KNoOfLoggingCombinations = 10; void processRecLevelMixed(soa::Filtered const& collisions, aod::BCsWithTimestamps const&, soa::Filtered const& tracks) { @@ -1501,7 +1500,7 @@ struct DptDptCorrelations { LOGF(DPTDPTLOGCOLLISIONS, "Received %d collisions", collisions.size()); int logcomb = 0; for (auto const& [collision1, tracks1, collision2, tracks2] : pairreco) { - if (logcomb < kNoOfLoggingCombinations) { + if (logcomb < KNoOfLoggingCombinations) { LOGF(DPTDPTLOGCOLLISIONS, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), collision1.posZ(), collision1.centmult(), collision1.collisionaccepted() ? "accepted" : "not accepted", collision2.globalIndex(), collision2.posZ(), collision2.centmult(), collision2.collisionaccepted() ? "accepted" : "not accepted"); @@ -1536,7 +1535,7 @@ struct DptDptCorrelations { LOGF(DPTDPTLOGCOLLISIONS, "Received %d collisions", collisions.size()); int logcomb = 0; for (auto const& [collision1, tracks1, collision2, tracks2] : pairreco) { - if (logcomb < kNoOfLoggingCombinations) { + if (logcomb < KNoOfLoggingCombinations) { LOGF(DPTDPTLOGCOLLISIONS, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), @@ -1580,7 +1579,7 @@ struct DptDptCorrelations { LOGF(DPTDPTLOGCOLLISIONS, "Received %d generated collisions", collisions.size()); int logcomb = 0; for (auto const& [collision1, tracks1, collision2, tracks2] : pairgen) { - if (logcomb < kNoOfLoggingCombinations) { + if (logcomb < KNoOfLoggingCombinations) { LOGF(DPTDPTLOGCOLLISIONS, "Received generated collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), collision1.posZ(), collision1.centmult(), collision1.collisionaccepted() ? "accepted" : "not accepted", collision2.globalIndex(), collision2.posZ(), collision2.centmult(), collision2.collisionaccepted() ? "accepted" : "not accepted"); @@ -1611,7 +1610,7 @@ struct DptDptCorrelations { LOGF(DPTDPTLOGCOLLISIONS, "Received %d generated collisions", collisions.size()); int logcomb = 0; for (auto const& [collision1, tracks1, collision2, tracks2] : pairgen) { - if (logcomb < kNoOfLoggingCombinations) { + if (logcomb < KNoOfLoggingCombinations) { LOGF(DPTDPTLOGCOLLISIONS, "Received generated collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index ed0478eb294..e084e4dfd33 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -98,8 +98,8 @@ enum BeforeAfter { }; /* the structures for checking the TPC sector borders impact */ -constexpr int kNoOfTpcSectors = 18; -constexpr float kTpcPhiSectorWidth = (constants::math::TwoPI) / kNoOfTpcSectors; +constexpr int KNoOfTpcSectors = 18; +constexpr float KTpcPhiSectorWidth = (constants::math::TwoPI) / KNoOfTpcSectors; /* the configuration of the nsigma axis */ float minNSigma = -4.05f; @@ -404,8 +404,8 @@ struct QADataCollectingEngine { using namespace analysis::dptdptfilter; using namespace o2::aod::track; - constexpr float kFiftyPerCent = 50.0f; - constexpr float kHundredPerCent = 100.0f; + constexpr float KFiftyPerCent = 50.0f; + constexpr float KHundredPerCent = 100.0f; fhPtB[kindOfData]->Fill(track.pt()); fhPtVsEtaB[kindOfData]->Fill(track.eta(), track.pt()); @@ -425,9 +425,9 @@ struct QADataCollectingEngine { bool hastpc = track.hasTPC() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), TrackSelectionTPC); bool hastof = track.hasTOF(); - float phiInTpcSector = std::fmod(track.phi(), kTpcPhiSectorWidth); - float phiShiftedPercentInTpcSector = phiInTpcSector * 100 / kTpcPhiSectorWidth; - phiShiftedPercentInTpcSector = (phiShiftedPercentInTpcSector > kFiftyPerCent) ? (phiShiftedPercentInTpcSector - kHundredPerCent) : phiShiftedPercentInTpcSector; + float phiInTpcSector = std::fmod(track.phi(), KTpcPhiSectorWidth); + float phiShiftedPercentInTpcSector = phiInTpcSector * 100 / KTpcPhiSectorWidth; + phiShiftedPercentInTpcSector = (phiShiftedPercentInTpcSector > KFiftyPerCent) ? (phiShiftedPercentInTpcSector - KHundredPerCent) : phiShiftedPercentInTpcSector; if (track.sign() > 0) { fhPhiVsPtPosB->Fill(track.pt(), phiInTpcSector); fhPerColNchVsPhiVsPtPosB->Fill(track.pt(), phiInTpcSector); @@ -601,8 +601,8 @@ struct QAExtraDataCollectingEngine { // The QA output objects //=================================================== /* pairs histograms */ - constexpr static size_t kNoOfOverflowBins = 2; - constexpr static int kBinNotTracked = -1; + constexpr static size_t KNoOfOverflowBins = 2; + constexpr static int KBinNotTracked = -1; std::vector>>> fhPhiPhiA{2, {nsp, {nsp, nullptr}}}; std::vector>>> fhEtaEtaA{2, {nsp, {nsp, nullptr}}}; std::vector>>> fhN2VsDeltaEtaVsDeltaPhi{2, {nsp, {nsp, nullptr}}}; @@ -618,7 +618,7 @@ struct QAExtraDataCollectingEngine { /* the mapping between pT bins of interest and internal representation, and histogram title to keep track of them offline */ /* it is done once for both reco and gen */ - ptOfInterestBinMap = std::vector(static_cast(ptbins + kNoOfOverflowBins), kBinNotTracked); + ptOfInterestBinMap = std::vector(static_cast(ptbins + KNoOfOverflowBins), KBinNotTracked); LOGF(info, "Configuring the pT bins of interest on a map of length %d", ptOfInterestBinMap.size()); for (size_t ix = 0; ix < ptBinsOfInterest.size(); ++ix) { /* remember our internal axis starts in 0.5 value, i.e. its first central value is 1 */ @@ -634,10 +634,10 @@ struct QAExtraDataCollectingEngine { using namespace analysis::dptdptfilter; AxisSpec phiAxis = {phibins, 0.0f, constants::math::TwoPI, "#varphi"}; - AxisSpec phiSectorAxis = {72, 0.0f, kTpcPhiSectorWidth, "#varphi (mod(2#pi/18)) (rad)"}; + AxisSpec phiSectorAxis = {72, 0.0f, KTpcPhiSectorWidth, "#varphi (mod(2#pi/18)) (rad)"}; AxisSpec deltaPhiAxis = {phibins, 0.0f, constants::math::TwoPI, "#Delta#varphi (rad)"}; AxisSpec deltaEtaAxis = {2 * etabins - 1, etalow - etaup, etaup - etalow, "#Delta#eta"}; - AxisSpec deltaPhiInSectorAxis = {144, -kTpcPhiSectorWidth, kTpcPhiSectorWidth, "#Delta#varphi (rad)"}; + AxisSpec deltaPhiInSectorAxis = {144, -KTpcPhiSectorWidth, KTpcPhiSectorWidth, "#Delta#varphi (rad)"}; AxisSpec etaAxis = {etabins, etalow, etaup, "#eta"}; AxisSpec ptOfInterestAxis = {static_cast(ptBinsOfInterest.size()), 0.5f, static_cast(ptBinsOfInterest.size()) + 0.5f, "#it{p}_{T} (GeV/#it{c})"}; @@ -649,7 +649,7 @@ struct QAExtraDataCollectingEngine { std::string hPtRangesOfInterestTitle; bool firstRange = true; for (size_t ix = 0; ix < ptOfInterestBinMap.size(); ++ix) { - if (ptOfInterestBinMap[ix] != kBinNotTracked) { + if (ptOfInterestBinMap[ix] != KBinNotTracked) { TString ptRange = TString::Format("%s%.2f-%.2f", firstRange ? "" : ",", ptAxis.GetBinLowEdge(ix), ptAxis.GetBinUpEdge(ix)); hPtRangesOfInterestTitle += ptRange.Data(); LOGF(info, " Tracking pT bin %d as internal axis value %d", ix, ptOfInterestBinMap[ix]); @@ -689,8 +689,8 @@ struct QAExtraDataCollectingEngine { return ptOfInterestBinMap[ptAxis.FindFixBin(track.pt())]; }; int ptBin1 = binForPt(track1); - if (ptBin1 != kBinNotTracked) { - float inTpcSectorPhi1 = std::fmod(track1.phi(), kTpcPhiSectorWidth); + if (ptBin1 != KBinNotTracked) { + float inTpcSectorPhi1 = std::fmod(track1.phi(), KTpcPhiSectorWidth); for (auto const& track2 : tracks2) { /* checking the same track id condition */ if (track1 == track2) { @@ -698,7 +698,7 @@ struct QAExtraDataCollectingEngine { continue; } int ptBin2 = binForPt(track2); - if (ptBin2 != kBinNotTracked) { + if (ptBin2 != KBinNotTracked) { float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi()); float deltaEta = track1.eta() - track2.eta(); float preWeight = 1 - std::abs(deltaEta) / deltaEtaSpan; @@ -706,9 +706,9 @@ struct QAExtraDataCollectingEngine { fhPhiPhiA[kindOfData][track1.trackacceptedid()][track2.trackacceptedid()]->Fill(track1.phi(), track2.phi(), weight); fhEtaEtaA[kindOfData][track1.trackacceptedid()][track2.trackacceptedid()]->Fill(track1.eta(), track2.eta()); fhN2VsDeltaEtaVsDeltaPhi[kindOfData][track1.trackacceptedid()][track2.trackacceptedid()]->Fill(deltaEta, deltaPhi, weight); - if (static_cast(track1.phi() / kTpcPhiSectorWidth) == static_cast(track2.phi() / kTpcPhiSectorWidth)) { + if (static_cast(track1.phi() / KTpcPhiSectorWidth) == static_cast(track2.phi() / KTpcPhiSectorWidth)) { /* only if, for sure, both tracks are within the same sector */ - float inTpcSectorPhi2 = std::fmod(track2.phi(), kTpcPhiSectorWidth); + float inTpcSectorPhi2 = std::fmod(track2.phi(), KTpcPhiSectorWidth); float inTpcSectorDeltaPhi = inTpcSectorPhi1 - inTpcSectorPhi2; double values[] = {inTpcSectorPhi1, inTpcSectorPhi2, inTpcSectorDeltaPhi, static_cast(ptBin1), static_cast(ptBin2)}; fhInSectorDeltaPhiVsPhiPhiPerPtBinA[kindOfData][track1.trackacceptedid()][track2.trackacceptedid()]->Fill(values, weight); @@ -728,66 +728,66 @@ struct PidDataCollectingEngine { uint nmainsp = static_cast(efficiencyandqatask::mainspnames.size()); uint nallmainsp = static_cast(efficiencyandqatask::allmainspnames.size()); - constexpr static uint kNoOfSteps = 2; /* Before and after track selection */ + constexpr static uint KNoOfSteps = 2; /* Before and after track selection */ /* PID histograms */ /* before and after */ - std::vector> fhTPCdEdxSignalVsP{kNoOfSteps, nullptr}; - std::vector>> fhTPCdEdxSignalDiffVsP{kNoOfSteps, {nmainsp, nullptr}}; - std::vector>> fhTPCnSigmasVsP{kNoOfSteps, {nallmainsp, nullptr}}; - std::vector> fhTOFSignalVsP{kNoOfSteps, nullptr}; - std::vector>> fhTOFSignalDiffVsP{kNoOfSteps, {nmainsp, nullptr}}; - std::vector>> fhTOFnSigmasVsP{kNoOfSteps, {nallmainsp, nullptr}}; - std::vector> fhPvsTOFSqMass{kNoOfSteps, nullptr}; - std::vector>> fhTPCTOFSigmaVsP{kNoOfSteps, {nmainsp, nullptr}}; + std::vector> fhTPCdEdxSignalVsP{KNoOfSteps, nullptr}; + std::vector>> fhTPCdEdxSignalDiffVsP{KNoOfSteps, {nmainsp, nullptr}}; + std::vector>> fhTPCnSigmasVsP{KNoOfSteps, {nallmainsp, nullptr}}; + std::vector> fhTOFSignalVsP{KNoOfSteps, nullptr}; + std::vector>> fhTOFSignalDiffVsP{KNoOfSteps, {nmainsp, nullptr}}; + std::vector>> fhTOFnSigmasVsP{KNoOfSteps, {nallmainsp, nullptr}}; + std::vector> fhPvsTOFSqMass{KNoOfSteps, nullptr}; + std::vector>> fhTPCTOFSigmaVsP{KNoOfSteps, {nmainsp, nullptr}}; template void init(HistogramRegistry& registry, const char* dirname) { using namespace efficiencyandqatask; - const AxisSpec dEdxAxis{200, 0.0, 200.0, "dE/dx (au)"}; + AxisSpec dEdxAxis{200, 0.0, 200.0, "dE/dx (au)"}; AxisSpec pidPAxis{150, 0.1, 5.0, "#it{p} (GeV/#it{c})"}; pidPAxis.makeLogarithmic(); if constexpr (kindOfData == kReco) { /* PID histograms */ std::vector whenname{"Before", "After"}; - constexpr char kWhenPrefix[kNoOfSteps]{'B', 'A'}; + constexpr char KWhenPrefix[KNoOfSteps]{'B', 'A'}; std::vector whentitle{"before", ""}; - for (uint ix = 0; ix < kNoOfSteps; ++ix) { + for (uint ix = 0; ix < KNoOfSteps; ++ix) { fhTPCdEdxSignalVsP[ix] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tpcSignalVsP%c", kWhenPrefix[ix]), + HNAMESTRING("tpcSignalVsP%c", KWhenPrefix[ix]), HTITLESTRING("TPC dE/dx signal %s", whentitle[ix].c_str()), kTH2F, {pidPAxis, dEdxAxis}); fhTOFSignalVsP[ix] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tofSignalVsP%c", kWhenPrefix[ix]), + HNAMESTRING("tofSignalVsP%c", KWhenPrefix[ix]), HTITLESTRING("TOF signal %s", whentitle[ix].c_str()), kTH2F, {pidPAxis, {200, 0.0, 1.1, "#beta"}}); fhPvsTOFSqMass[ix] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tofPvsMassSq%c", kWhenPrefix[ix]), + HNAMESTRING("tofPvsMassSq%c", KWhenPrefix[ix]), HTITLESTRING("Momentum versus #it{m}^{2} %s", whentitle[ix].c_str()), kTH2F, {{140, 0.0, 1.4, "#it{m}^{2} ((GeV/c^{2})^{2})"}, pidPAxis}); for (uint isp = 0; isp < nmainsp; ++isp) { fhTPCdEdxSignalDiffVsP[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tpcSignalDiffVsP%c_%s", kWhenPrefix[ix], mainspnames[isp].c_str()), + HNAMESTRING("tpcSignalDiffVsP%c_%s", KWhenPrefix[ix], mainspnames[isp].c_str()), HTITLESTRING("TPC dE/dx to the %s line %s", mainsptitles[isp].c_str(), whentitle[ix].c_str()), kTH2F, {pidPAxis, {400, -200.0, 200.0, FORMATSTRING("dE/dx - _{%s}", mainsptitles[isp].c_str())}}); fhTOFSignalDiffVsP[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tofSignalDiffVsP%c_%s", kWhenPrefix[ix], mainspnames[isp].c_str()), + HNAMESTRING("tofSignalDiffVsP%c_%s", KWhenPrefix[ix], mainspnames[isp].c_str()), HTITLESTRING("#Delta^{TOF_{%s}} %s", mainsptitles[isp].c_str(), whentitle[ix].c_str()), kTH2F, {pidPAxis, {200, -1000.0, 1000.0, FORMATSTRING("t-t_{ev}-t_{exp_{%s}} (ps)", mainsptitles[isp].c_str())}}); fhTPCTOFSigmaVsP[ix][isp] = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("toftpcNSigmasVsP%c_%s", kWhenPrefix[ix], mainspnames[isp].c_str()), + HNAMESTRING("toftpcNSigmasVsP%c_%s", KWhenPrefix[ix], mainspnames[isp].c_str()), HTITLESTRING("n#sigma to the %s line %s", mainsptitles[isp].c_str(), whentitle[ix].c_str()), kTH3F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); } for (uint isp = 0; isp < nallmainsp; ++isp) { fhTPCnSigmasVsP[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tpcNSigmasVsP%c_%s", kWhenPrefix[ix], allmainspnames[isp].c_str()), + HNAMESTRING("tpcNSigmasVsP%c_%s", KWhenPrefix[ix], allmainspnames[isp].c_str()), HTITLESTRING("TPC n#sigma to the %s line %s", allmainsptitles[isp].c_str(), whentitle[ix].c_str()), kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TPC}^{%s}", allmainsptitles[isp].c_str())}}); fhTOFnSigmasVsP[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), - HNAMESTRING("tofNSigmasVsP%c_%s", kWhenPrefix[ix], allmainspnames[isp].c_str()), + HNAMESTRING("tofNSigmasVsP%c_%s", KWhenPrefix[ix], allmainspnames[isp].c_str()), HTITLESTRING("TOF n#sigma to the %s line %s", allmainsptitles[isp].c_str(), whentitle[ix].c_str()), kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TOF}^{%s}", allmainsptitles[isp].c_str())}}); } @@ -803,7 +803,7 @@ struct PidDataCollectingEngine { } else { ix = 2 * ix; } - for (uint when = 0; when < kNoOfSteps; ++when) { + for (uint when = 0; when < KNoOfSteps; ++when) { fhTPCnSigmasVsP[when][ix]->Fill(tpcmom, o2::aod::pidutils::tpcNSigma(track)); fhTOFnSigmasVsP[when][ix]->Fill(tofmom, o2::aod::pidutils::tofNSigma(track)); if (track.trackacceptedid() < 0) { @@ -821,7 +821,7 @@ struct PidDataCollectingEngine { } else { ix = 2 * ix; } - for (uint when = 0; when < kNoOfSteps; ++when) { + for (uint when = 0; when < KNoOfSteps; ++when) { fhTPCdEdxSignalDiffVsP[when][ix]->Fill(tpcmom, o2::aod::pidutils::tpcExpSignalDiff(track)); fhTOFSignalDiffVsP[when][ix]->Fill(tofmom, o2::aod::pidutils::tofExpSignalDiff(track)); fhTPCTOFSigmaVsP[when][ix]->Fill(tpcmom, o2::aod::pidutils::tpcNSigma(track), o2::aod::pidutils::tofNSigma(track)); @@ -835,7 +835,7 @@ struct PidDataCollectingEngine { template void fillPID(TrackObject const& track, float tpcmom, float tofmom) { - for (uint when = 0; when < kNoOfSteps; ++when) { + for (uint when = 0; when < KNoOfSteps; ++when) { if constexpr (framework::has_type_v) { fhTPCdEdxSignalVsP[when]->Fill(tpcmom, track.mcTunedTPCSignal()); } else { @@ -892,10 +892,10 @@ struct PidExtraDataCollectingEngine { { using namespace efficiencyandqatask; - const AxisSpec dEdxAxis{200, 0.0, 200.0, "dE/dx (au)"}; + AxisSpec dEdxAxis{200, 0.0, 200.0, "dE/dx (au)"}; AxisSpec pidPAxis{150, 0.1, 5.0, "#it{p} (GeV/#it{c})"}; pidPAxis.makeLogarithmic(); - constexpr int kEvenOddBase = 2; + constexpr int KEvenOddBase = 2; if constexpr (kindOfData == kReco) { /* PID histograms */ @@ -918,7 +918,7 @@ struct PidExtraDataCollectingEngine { kTProfile2D, {pidPAxis, {200, 0.0, 1.1, "#beta"}}); for (uint imainsp = 0; imainsp < nallmainsp; ++imainsp) { /* only the same charge makes any sense */ - if (isp % kEvenOddBase == imainsp % kEvenOddBase) { + if (isp % KEvenOddBase == imainsp % KEvenOddBase) { fhIdTPCnSigmasVsP[isp][imainsp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", "Selected"), HNAMESTRING("tpcNSigmasVsPSelected_%s_to%s", tnames[isp].c_str(), allmainspnames[imainsp].c_str()), HTITLESTRING("TPC n#sigma for selected %s to the %s line", tnames[isp].c_str(), allmainsptitles[imainsp].c_str()), @@ -1092,8 +1092,7 @@ struct DptDptEfficiencyAndQc { getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPhibins", phibins, false); /* configuring the involved species */ - std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; - std::vector spids = {0, 1, 2, 3, 4}; + std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection", "cfgDeuteronPIDSelection"}; for (uint i = 0; i < cfgnames.size(); ++i) { auto includeIt = [&initContext](int spid, const auto& name) { bool mUseIt = false; @@ -1108,7 +1107,7 @@ struct DptDptEfficiencyAndQc { } } }; - includeIt(spids[i], cfgnames[i]); + includeIt(i, cfgnames[i]); } uint nspecies = pidselector.getNSpecies(); if (nspecies == 0) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx index cc30bd1655b..7360e956468 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx @@ -175,8 +175,7 @@ struct ParticleOriginAnalysis { /* self configure the desired species */ o2::analysis::dptdptfilter::PIDSpeciesSelection pidselector; - std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; - std::vector spids = {0, 1, 2, 3, 4}; + std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection", "cfgDeuteronPIDSelection"}; for (uint i = 0; i < cfgnames.size(); ++i) { auto includeIt = [&pidselector, &initContext](int spid, const auto& name) { bool mUseIt = false; @@ -191,7 +190,7 @@ struct ParticleOriginAnalysis { } } }; - includeIt(spids[i], cfgnames[i]); + includeIt(i, cfgnames[i]); } uint nspecies = pidselector.getNSpecies(); if (nspecies == 0) {