From 59b6e1199a02a77dc60079fb2ba1e3439f044924 Mon Sep 17 00:00:00 2001 From: yakparo Date: Mon, 2 Dec 2024 07:55:16 +0100 Subject: [PATCH 01/91] [PWGLF] change in hStrangeCorrelation (#8745) Co-authored-by: Yakiv <5348341@upjs.sk> --- PWGLF/DataModel/LFHStrangeCorrelationTables.h | 45 +++-- .../Strangeness/hStrangeCorrelationFilter.cxx | 38 +++- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 185 ++++++++++++++---- 3 files changed, 211 insertions(+), 57 deletions(-) diff --git a/PWGLF/DataModel/LFHStrangeCorrelationTables.h b/PWGLF/DataModel/LFHStrangeCorrelationTables.h index 1b31239f406..7f7578b3632 100644 --- a/PWGLF/DataModel/LFHStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFHStrangeCorrelationTables.h @@ -50,26 +50,33 @@ DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! } // namespace assocPions DECLARE_SOA_TABLE(AssocPions, "AOD", "ASSOCPIONS", o2::soa::Index<>, assocPions::CollisionId, assocPions::TrackId); + +namespace assocHadrons +{ +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! +} // namespace assocHadrons +DECLARE_SOA_TABLE(AssocHadrons, "AOD", "ASSOCHADRONS", o2::soa::Index<>, assocHadrons::CollisionId, assocHadrons::TrackId); /// _________________________________________ /// Table for storing associated V0 indices namespace assocV0s { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //! +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //! // dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter DECLARE_SOA_COLUMN(CompatibleK0Short, compatibleK0Short, int); // compatible with K0Short dEdx, encoded syst checks DECLARE_SOA_COLUMN(CompatibleLambda, compatibleLambda, int); // compatible with Lambda dEdx, encoded syst checks DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, int); // compatible with AntiLambda dEdx, encoded syst checks -DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC -DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC -DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC -DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag -DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); // -DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); // +DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC +DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC +DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag +DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); // +DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); // DECLARE_SOA_COLUMN(NSigmaMassAntiLambda, nSigmaMassAntiLambda, float); // -DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) +DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) [](int cK0Short, int cLambda, int cAntiLambda, int value, int compatibilityLevel) -> bool { if (value == 0 && bitcheck(cK0Short, compatibilityLevel)) return true; @@ -119,8 +126,8 @@ DECLARE_SOA_TABLE(AssocV0s, "AOD", "ASSOCV0S", o2::soa::Index<>, /// Table for storing associated casc indices namespace assocCascades { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //! +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //! // dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter DECLARE_SOA_COLUMN(CompatibleXiMinus, compatibleXiMinus, int); // compatible with XiMinus @@ -128,14 +135,14 @@ DECLARE_SOA_COLUMN(CompatibleXiPlus, compatibleXiPlus, int); // compatib DECLARE_SOA_COLUMN(CompatibleOmegaMinus, compatibleOmegaMinus, int); // compatible with OmegaMinus DECLARE_SOA_COLUMN(CompatibleOmegaPlus, compatibleOmegaPlus, int); // compatible with OmegaPlus -DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc -DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc -DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc -DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc -DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC -DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); // -DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); // -DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) +DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc +DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc +DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc +DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC +DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); // +DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); // +DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) [](int cXiMinus, int cXiPlus, int cOmegaMinus, int cOmegaPlus, int value, int compatibilityLevel) -> bool { if (value == 0 && bitcheck(cXiMinus, compatibilityLevel)) return true; diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index 0dd6cf1d4ec..220670d1e4a 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -141,6 +141,7 @@ struct hstrangecorrelationfilter { Produces assocPion; Produces assocV0; Produces assocCascades; + Produces assocHadrons; TF1* fK0Mean = new TF1("fK0Mean", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); TF1* fK0Width = new TF1("fK0Width", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); @@ -314,7 +315,41 @@ struct hstrangecorrelationfilter { continue; } - assocPion( + assocHadrons( + track.collisionId(), + track.globalIndex()); + } + } + + void processAssocHadrons(soa::Join::iterator const& collision, soa::Filtered> const& tracks) + { + // Perform basic event selection + if (!collision.sel8()) { + return; + } + // No need to correlate stuff that's in far collisions + if (TMath::Abs(collision.posZ()) > 10.0) { + return; + } + + /// _________________________________________________ + /// Step 1: Populate table with trigger tracks + for (auto const& track : tracks) { + if (track.eta() > assocEtaMax || track.eta() < assocEtaMin) { + continue; + } + // if (track.sign()= 1 ) {continue;} + if (track.pt() > assocPtCutMax || track.pt() < assocPtCutMin) { + continue; + } + if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) { + continue; // crossed rows + } + if (!track.hasITS() && triggerRequireITS) { + continue; // skip, doesn't have ITS signal (skips lots of TPC-only!) + } + + assocHadrons( track.collisionId(), track.globalIndex()); } @@ -494,6 +529,7 @@ struct hstrangecorrelationfilter { PROCESS_SWITCH(hstrangecorrelationfilter, processV0s, "Produce associated V0 tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPions, "Produce associated Pion tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processCascades, "Produce associated cascade tables", true); + PROCESS_SWITCH(hstrangecorrelationfilter, processAssocHadrons, "Produce associated Hadron tables", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 4e16c31f995..e1fe312d225 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -56,6 +56,7 @@ struct correlateStrangeness { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + Configurable doCorrelationHadron{"doCorrelationHadron", false, "do Hadron correlation"}; Configurable doCorrelationK0Short{"doCorrelationK0Short", true, "do K0Short correlation"}; Configurable doCorrelationLambda{"doCorrelationLambda", false, "do Lambda correlation"}; Configurable doCorrelationAntiLambda{"doCorrelationAntiLambda", false, "do AntiLambda correlation"}; @@ -152,6 +153,8 @@ struct correlateStrangeness { TH2F* hEfficiencyOmegaMinus; TH2F* hEfficiencyOmegaPlus; + TH2F* hEfficiencyHadron; + using BinningType = ColumnBinningPolicy; BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. @@ -159,15 +162,16 @@ struct correlateStrangeness { Preslice collisionSliceTracks = aod::triggerTracks::collisionId; Preslice collisionSliceV0s = aod::assocV0s::collisionId; Preslice collisionSliceCascades = aod::assocCascades::collisionId; - Preslice collisionSlicePions = aod::assocPions::collisionId; + // Preslice collisionSlicePions = aod::assocHadrons::collisionId; + Preslice collisionSliceHadrons = aod::assocHadrons::collisionId; Preslice perCollision = aod::mcparticle::mcCollisionId; static constexpr std::string_view v0names[] = {"K0Short", "Lambda", "AntiLambda"}; static constexpr std::string_view cascadenames[] = {"XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus"}; - static constexpr std::string_view particlenames[] = {"K0Short", "Lambda", "AntiLambda", "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus", "Pion"}; + static constexpr std::string_view particlenames[] = {"K0Short", "Lambda", "AntiLambda", "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus", "Pion", "Hadron"}; static constexpr int pdgCodes[] = {310, 3122, -3122, 3312, -3312, 3334, -3334, 211}; - uint8_t doCorrelation; + uint16_t doCorrelation; int mRunNumber; std::vector> axisRanges; @@ -449,7 +453,7 @@ struct correlateStrangeness { } } - void fillCorrelationsPion(aod::TriggerTracks const& triggers, aod::AssocPions const& assocs, bool mixing, float pvz, float mult) + void fillCorrelationsHadron(aod::TriggerTracks const& triggers, aod::AssocHadrons const& assocs, bool mixing, float pvz, float mult, int indexAssoc) { for (auto& triggerTrack : triggers) { @@ -459,15 +463,20 @@ struct correlateStrangeness { if (!isValidTrigger(trigg)) continue; + static_for<7, 8>([&](auto i) { + constexpr int index = i.value; + if (bitcheck(doCorrelation, i)) { if (!mixing) - histos.fill(HIST("sameEvent/TriggerParticlesPion"), trigg.pt(), mult); + histos.fill(HIST("sameEvent/TriggerParticles") + HIST(particlenames[index]), trigg.pt(), mult); for (auto& assocTrack : assocs) { auto assoc = assocTrack.track_as(); + + //---] removing autocorrelations [--- if (doAutocorrelationRejection) { if (trigg.globalIndex() == assoc.globalIndex()) { - histos.fill(HIST("hNumberOfRejectedPairsPions"), 0.5); + histos.fill(HIST("hNumberOfRejectedPairs") + HIST(particlenames[index]), 0.5); continue; } } @@ -490,10 +499,11 @@ struct correlateStrangeness { continue; if (!mixing) - histos.fill(HIST("sameEvent/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + histos.fill(HIST("sameEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); else - histos.fill(HIST("mixedEvent/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + histos.fill(HIST("mixedEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); } + } }); } } @@ -509,6 +519,8 @@ struct correlateStrangeness { hEfficiencyOmegaMinus = 0x0; hEfficiencyOmegaPlus = 0x0; + hEfficiencyHadron = 0x0; + // set bitmap for convenience doCorrelation = 0; if (doCorrelationK0Short) @@ -527,6 +539,8 @@ struct correlateStrangeness { bitset(doCorrelation, 6); if (doCorrelationPion) bitset(doCorrelation, 7); + if (doCorrelationHadron) + bitset(doCorrelation, 8); // Store axis ranges to prevent spurious filling // axis status: @@ -688,10 +702,12 @@ struct correlateStrangeness { histos.add("hClosureTestEventCounter", "hClosureTestEventCounter", kTH1F, {{10, 0, 10}}); + histos.add("hNumberOfRejectedPairsHadron", "hNumberOfRejectedPairsHadron", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsV0", "hNumberOfRejectedPairsV0", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsCascades", "hNumberOfRejectedPairsCascades", kTH1F, {{1, 0, 1}}); - histos.add("hNumberOfRejectedPairsPions", "hNumberOfRejectedPairsPions", kTH1F, {{1, 0, 1}}); + histos.add("hNumberOfRejectedPairsPion", "hNumberOfRejectedPairsPion", kTH1F, {{1, 0, 1}}); + histos.add("sameEvent/TriggerParticlesHadron", "TriggersHadron", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesV0", "TriggersV0", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesCascade", "TriggersCascade", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesPion", "TriggersPion", kTH2F, {axisPtQA, axisMult}); @@ -712,23 +728,23 @@ struct correlateStrangeness { histos.add("hTriggerPtResolution", ";p_{T}^{reconstructed} (GeV/c); p_{T}^{generated} (GeV/c)", kTH2F, {axisPtQA, axisPtQA}); histos.add("hTriggerPrimaryEtaVsPt", "hTriggerPrimaryEtaVsPt", kTH3F, {axisPtQA, axisEta, axisMult}); histos.add("hTrackEtaVsPtVsPhi", "hTrackEtaVsPtVsPhi", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add("hTrackAttempt", "Attempt", kTH3F, {axisPtQA, axisEta, axisPhi}); bool hStrange = false; - for (int i = 0; i < 8; i++) { - if ((doprocessSameEventHV0s && i < 3) || (doprocessSameEventHCascades && i > 2 && i < 7) || (doprocessSameEventHPions && i == 7)) - histos.add(fmt::format("h{}EtaVsPtVsPhi", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); - if ((doprocessSameEventHV0s && i < 3) || (doprocessSameEventHCascades && i > 2 && i < 7)) - histos.add(fmt::format("h{}EtaVsPtVsPhiBg", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); + for (int i = 0; i < 9; i++) { if (bitcheck(doCorrelation, i)) { - histos.add(fmt::format("hITSClusters{}NegativeDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}PositiveDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}NegativeDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}PositiveDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("h{}EtaVsPtVsPhi", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); histos.add(fmt::format("h3d{}Spectrum", particlenames[i]).c_str(), fmt::format("h3d{}Spectrum", particlenames[i]).c_str(), kTH3F, {axisPtQA, axisMult, axisMassNSigma}); histos.add(fmt::format("h3d{}SpectrumY", particlenames[i]).c_str(), fmt::format("h3d{}SpectrumY", particlenames[i]).c_str(), kTH3F, {axisPtQA, axisMult, axisMassNSigma}); histos.add(fmt::format("sameEvent/Signal/{}", particlenames[i]).c_str(), "", kTHnF, {axisDeltaPhiNDim, axisDeltaEtaNDim, axisPtAssocNDim, axisPtTriggerNDim, axisVtxZNDim, axisMultNDim}); - if (i < 7) + if (i < 7) { hStrange = true; + histos.add(fmt::format("h{}EtaVsPtVsPhiBg", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add(fmt::format("hITSClusters{}NegativeDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}PositiveDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}NegativeDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}PositiveDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + } } } if (hStrange) { @@ -738,7 +754,7 @@ struct correlateStrangeness { LOGF(info, "Init THnFs done"); // mixed-event correlation functions - if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions) { + if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions || doprocessMixedEventHHadrons) { histos.addClone("sameEvent/", "mixedEvent/"); } @@ -823,6 +839,61 @@ struct correlateStrangeness { } } + void processSameEventHHadrons(soa::Join::iterator const& collision, + aod::AssocHadrons const& assocHadrons, aod::TriggerTracks const& triggerTracks, + TracksComplete const&, aod::BCsWithTimestamps const&) + { + // ________________________________________________ + // skip if desired trigger not found + if (triggerPresenceMap.size() > 0 && !bitcheck(triggerPresenceMap[collision.globalIndex()], triggerBinToSelect)) { + return; + } + + // ________________________________________________ + // Perform basic event selection + if (!collision.sel8()) { + return; + } + if (TMath::Abs(collision.posZ()) > zVertexCut) { + return; + } + if (collision.centFT0M() > axisRanges[5][1] || collision.centFT0M() < axisRanges[5][0]) { + return; + } + if (!collision.isInelGt0() && selectINELgtZERO) { + return; + } + // ________________________________________________ + if (!doprocessSameEventHCascades && !doprocessSameEventHV0s && !doprocessSameEventHPions) { + histos.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({collision.posZ(), collision.centFT0M()})); + histos.fill(HIST("EventQA/hMult"), collision.centFT0M()); + histos.fill(HIST("EventQA/hPvz"), collision.posZ()); + } + + // Do basic QA + for (auto const& hadron : assocHadrons) { + auto hadronTrack = hadron.track_as(); + histos.fill(HIST("hHadronEtaVsPtVsPhi"), hadronTrack.pt(), hadronTrack.eta(), hadronTrack.phi()); + } + if (!doprocessSameEventHCascades && !doprocessSameEventHV0s && !doprocessSameEventHPions) { + for (auto const& triggerTrack : triggerTracks) { + auto track = triggerTrack.track_as(); + if (!isValidTrigger(track)) + continue; + histos.fill(HIST("hTriggerAllSelectedEtaVsPt"), track.pt(), track.eta(), collision.centFT0M()); + histos.fill(HIST("hTriggerPtResolution"), track.pt(), triggerTrack.mcOriginalPt()); + if (doTriggPhysicalPrimary && !triggerTrack.mcPhysicalPrimary()) + continue; + histos.fill(HIST("hTriggerPrimaryEtaVsPt"), track.pt(), track.eta(), collision.centFT0M()); + histos.fill(HIST("hTrackEtaVsPtVsPhi"), track.pt(), track.eta(), track.phi()); + } + } + + // ________________________________________________ + // Do hadron - hadron correlations + fillCorrelationsHadron(triggerTracks, assocHadrons, false, collision.posZ(), collision.centFT0M(), 7); + } + void processSameEventHV0s(soa::Join::iterator const& collision, aod::AssocV0s const& associatedV0s, aod::TriggerTracks const& triggerTracks, V0DatasWithoutTrackX const&, aod::V0sLinked const&, TracksComplete const&, aod::BCsWithTimestamps const&) @@ -1023,7 +1094,7 @@ struct correlateStrangeness { fillCorrelationsCascade(triggerTracks, associatedCascades, false, collision.posX(), collision.posY(), collision.posZ(), collision.centFT0M()); } void processSameEventHPions(soa::Join::iterator const& collision, - aod::AssocPions const& associatedPions, aod::TriggerTracks const& triggerTracks, + aod::AssocHadrons const& associatedPions, aod::TriggerTracks const& triggerTracks, TracksComplete const&, aod::BCsWithTimestamps const&) { // ________________________________________________ @@ -1073,8 +1144,51 @@ struct correlateStrangeness { // ________________________________________________ // Do hadron - Pion correlations - fillCorrelationsPion(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M()); + fillCorrelationsHadron(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M(), 8); + } + + void processMixedEventHHadrons(soa::Join const& collisions, + aod::AssocHadrons const& assocHadrons, aod::TriggerTracks const& triggerTracks, + TracksComplete const&) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { + + // ________________________________________________ + // skip if desired trigger not found + if (triggerPresenceMap.size() > 0 && (!bitcheck(triggerPresenceMap[collision1.globalIndex()], triggerBinToSelect) || !bitcheck(triggerPresenceMap[collision2.globalIndex()], triggerBinToSelect))) { + return; + } + + // ________________________________________________ + // Perform basic event selection on both collisions + if (!collision1.sel8() || !collision2.sel8()) + continue; + if (TMath::Abs(collision1.posZ()) > zVertexCut || TMath::Abs(collision2.posZ()) > zVertexCut) + continue; + if (collision1.centFT0M() > axisRanges[5][1] || collision1.centFT0M() < axisRanges[5][0]) + continue; + if (collision2.centFT0M() > axisRanges[5][1] || collision2.centFT0M() < axisRanges[5][0]) + continue; + if ((!collision1.isInelGt0() || !collision2.isInelGt0()) && selectINELgtZERO) + continue; + + if (collision1.globalIndex() == collision2.globalIndex()) { + histos.fill(HIST("MixingQA/hMixingQA"), 0.0f); // same-collision pair counting + } + + histos.fill(HIST("MixingQA/hMEpvz1"), collision1.posZ()); + histos.fill(HIST("MixingQA/hMEpvz2"), collision2.posZ()); + histos.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), collision1.centFT0M()})); + // ________________________________________________ + // Do slicing + auto slicedTriggerTracks = triggerTracks.sliceBy(collisionSliceTracks, collision1.globalIndex()); + auto slicedAssocHadrons = assocHadrons.sliceBy(collisionSliceHadrons, collision2.globalIndex()); + // ________________________________________________ + // Do hadron - hadron correlations + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocHadrons, true, collision1.posZ(), collision1.centFT0M(), 7); + } } + void processMixedEventHV0s(soa::Join const& collisions, aod::AssocV0s const& associatedV0s, aod::TriggerTracks const& triggerTracks, V0DatasWithoutTrackX const&, aod::V0sLinked const&, TracksComplete const&, aod::BCsWithTimestamps const&) @@ -1165,7 +1279,7 @@ struct correlateStrangeness { } } void processMixedEventHPions(soa::Join const& collisions, - aod::AssocPions const& assocPions, aod::TriggerTracks const& triggerTracks, + aod::AssocHadrons const& assocPions, aod::TriggerTracks const& triggerTracks, TracksComplete const&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { @@ -1199,10 +1313,10 @@ struct correlateStrangeness { // ________________________________________________ // Do slicing auto slicedTriggerTracks = triggerTracks.sliceBy(collisionSliceTracks, collision1.globalIndex()); - auto slicedAssocPions = assocPions.sliceBy(collisionSlicePions, collision2.globalIndex()); + auto slicedAssocPions = assocPions.sliceBy(collisionSliceHadrons, collision2.globalIndex()); // ________________________________________________ // Do hadron - cascade correlations - fillCorrelationsPion(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M()); + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M(), 8); } } @@ -1451,16 +1565,9 @@ struct correlateStrangeness { continue; } if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { - Int_t charge = 0; - if (mcParticle.pdgCode() < 0) - charge = -1; - if (mcParticle.pdgCode() > 0) - charge = 1; if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { - if ((triggerParticleCharge > 0 && charge > 0) || (triggerParticleCharge < 0 && charge < 0) || triggerParticleCharge == 0) { - triggerIndices.emplace_back(iteratorNum); - histos.fill(HIST("ClosureTest/hTrigger"), gpt, geta, bestCollisionFT0Mpercentile); - } + triggerIndices.emplace_back(iteratorNum); + histos.fill(HIST("ClosureTest/hTrigger"), gpt, geta, bestCollisionFT0Mpercentile); } } if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { @@ -1545,15 +1652,19 @@ struct correlateStrangeness { } } - PROCESS_SWITCH(correlateStrangeness, processSelectEventWithTrigger, "Select events with trigger only", false); + PROCESS_SWITCH(correlateStrangeness, processSelectEventWithTrigger, "Select events with trigger only", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHV0s, "Process same events, h-V0s", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHCascades, "Process same events, h-Cascades", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHPions, "Process same events, h-Pion", true); + PROCESS_SWITCH(correlateStrangeness, processSameEventHHadrons, "Process same events, h-h", true); + PROCESS_SWITCH(correlateStrangeness, processMixedEventHV0s, "Process mixed events, h-V0s", true); PROCESS_SWITCH(correlateStrangeness, processMixedEventHCascades, "Process mixed events, h-Cascades", true); PROCESS_SWITCH(correlateStrangeness, processMixedEventHPions, "Process mixed events, h-Pion", true); - PROCESS_SWITCH(correlateStrangeness, processMCGenerated, "Process MC generated", true); - PROCESS_SWITCH(correlateStrangeness, processClosureTest, "Process Closure Test", true); + PROCESS_SWITCH(correlateStrangeness, processMixedEventHHadrons, "Process mixed events, h-h", true); + + PROCESS_SWITCH(correlateStrangeness, processMCGenerated, "Process MC generated", false); + PROCESS_SWITCH(correlateStrangeness, processClosureTest, "Process Closure Test", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 483f1877f7bcec0f6bbe4fb002400551c78622eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 2 Dec 2024 07:59:32 +0100 Subject: [PATCH 02/91] [Common] [TOF] fix parameters for negative tracks (#8753) --- Common/TableProducer/PID/pidTOFMerge.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/TableProducer/PID/pidTOFMerge.cxx b/Common/TableProducer/PID/pidTOFMerge.cxx index df682d4ffb8..e2c5489ab65 100644 --- a/Common/TableProducer/PID/pidTOFMerge.cxx +++ b/Common/TableProducer/PID/pidTOFMerge.cxx @@ -206,7 +206,7 @@ struct TOFCalibConfig { const std::string nameShiftPos = metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos; updateTimeShift(nameShiftPos, true); const std::string nameShiftNeg = metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg; - updateTimeShift(nameShiftNeg, true); + updateTimeShift(nameShiftNeg, false); // Calibration object is defined LOG(info) << "Parametrization at init time:"; @@ -690,7 +690,7 @@ struct tofEventTime { if constexpr (removeTOFEvTimeBias) { evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2); } - if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || abs(t0TOF[0]) < maxEvTimeTOF)) { + if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || std::abs(t0TOF[0]) < maxEvTimeTOF)) { flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; weight = 1.f / (t0TOF[1] * t0TOF[1]); @@ -754,7 +754,7 @@ struct tofEventTime { evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, et, erret, 2); } uint8_t flags = 0; - if (erret < errDiamond && (maxEvTimeTOF <= 0.f || abs(et) < maxEvTimeTOF)) { + if (erret < errDiamond && (maxEvTimeTOF <= 0.f || std::abs(et) < maxEvTimeTOF)) { flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; } else { et = 0.f; From 38998411bf68c531f70fb55fd5bddceb0dd2f024 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:17:27 +0100 Subject: [PATCH 03/91] Fix wrong type for receiving container (#8762) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index a4069a27764..f378cb2acd2 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -581,7 +581,7 @@ struct EventSelectionQaTask { metadata["runNumber"] = Form("%d", run); o2::itsmft::TimeDeadMap* itsDeadMap = ccdb->getSpecific("ITS/Calib/TimeDeadMap", (tsSOR + tsEOR) / 2, metadata); - std::vector itsDeadMapOrbits = itsDeadMap->getEvolvingMapKeys(); // roughly every second, ~350 TFs = 350x32 orbits + auto itsDeadMapOrbits = itsDeadMap->getEvolvingMapKeys(); // roughly every second, ~350 TFs = 350x32 orbits std::vector itsDeadMapOrbitsDouble(itsDeadMapOrbits.begin(), itsDeadMapOrbits.end()); const AxisSpec axisItsDeadMapOrbits{itsDeadMapOrbitsDouble}; From 82f622f7b2375d5462c06d415f85ea2218228c68 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:19:11 +0100 Subject: [PATCH 04/91] Drop unneeded semicolon (#8763) --- Common/TableProducer/multiplicityTable.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 7c36fe4363e..6d468282b55 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -9,10 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include ; -#include ; -#include ; -#include ; +#include +#include +#include +#include #include "Framework/ConfigParamSpec.h" #include "Framework/runDataProcessing.h" From 9c681c2e0f607b73136f0cd7d0e42ce99c3acc31 Mon Sep 17 00:00:00 2001 From: choich08365 <157435123+choich08365@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:00:09 +0900 Subject: [PATCH 05/91] [PWGJE] Add an extra table and vertexClustering function for GNN b-jet tagging (#8597) Co-authored-by: chchoi --- PWGJE/Core/JetTaggingUtilities.h | 173 +++++++++++++++++++++++ PWGJE/Tasks/bjetTreeCreator.cxx | 227 ++++++++++++++++++++++++++++++- 2 files changed, 399 insertions(+), 1 deletion(-) diff --git a/PWGJE/Core/JetTaggingUtilities.h b/PWGJE/Core/JetTaggingUtilities.h index 8f5c44362e1..c607a44c6da 100644 --- a/PWGJE/Core/JetTaggingUtilities.h +++ b/PWGJE/Core/JetTaggingUtilities.h @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include "TF1.h" #include "Framework/Logger.h" @@ -629,6 +631,177 @@ bool isTaggedJetSV(T const jet, U const& /*prongs*/, float const& prongChi2PCAMi return true; } +/** + * Clusters jet constituent tracks into groups of tracks originating from same mcParticle position (trkVtxIndex), and finds each track origin (trkOrigin). (for GNN b-jet tagging) + * @param trkLabels Track labels for GNN vertex and track origin predictions. trkVtxIndex: The index value of each vertex (cluster) which is determined by the function. trkOrigin: The category of the track origin (0: not physical primary, 1: charm, 2: beauty, 3: primary vertex, 4: other secondary vertex). + * @param vtxResParam Vertex resolution parameter which determines the cluster size. (cm) + * @param trackPtMin Minimum value of track pT. + * @return The number of vertices (clusters) in the jet. + */ +template +int vertexClustering(AnyCollision const& collision, AnalysisJet const& jet, AnyTracks const&, AnyParticles const& particles, AnyOriginalParticles const&, std::unordered_map>& trkLabels, bool searchUpToQuark, float vtxResParam = 0.01 /* 0.01cm = 100um */, float trackPtMin = 0.5) +{ + const auto& tracks = jet.template tracks_as(); + const int n_trks = tracks.size(); + + // trkVtxIndex + + std::vector tempTrkVtxIndex; + + int i = 0; + for (const auto& constituent : tracks) { + if (!constituent.has_mcParticle() || !constituent.template mcParticle_as().isPhysicalPrimary() || constituent.pt() < trackPtMin) + tempTrkVtxIndex.push_back(-1); + else + tempTrkVtxIndex.push_back(i++); + } + tempTrkVtxIndex.push_back(i); // temporary index for PV + if (n_trks < 1) { // the process should be done for n_trks == 1 as well + trkLabels["trkVtxIndex"] = tempTrkVtxIndex; + return n_trks; + } + + int n_pos = n_trks + 1; + std::vector dists(n_pos * (n_pos - 1) / 2); + auto trk_pair_idx = [n_pos](int ti, int tj) { + if (ti == tj || ti >= n_pos || tj >= n_pos || ti < 0 || tj < 0) { + LOGF(info, "Track pair index out of range"); + return -1; + } else { + return (ti < tj) ? (ti * n_pos - (ti * (ti + 1)) / 2 + tj - ti - 1) : (tj * n_pos - (tj * (tj + 1)) / 2 + ti - tj - 1); + } + }; // index n_trks is for PV + + for (int ti = 0; ti < n_pos - 1; ti++) + for (int tj = ti + 1; tj < n_pos; tj++) { + std::array posi, posj; + + if (tj < n_trks) { + if (tracks[tj].has_mcParticle()) { + const auto& pj = tracks[tj].template mcParticle_as().template mcParticle_as(); + posj = std::array{pj.vx(), pj.vy(), pj.vz()}; + } else { + dists[trk_pair_idx(ti, tj)] = std::numeric_limits::max(); + continue; + } + } else { + posj = std::array{collision.posX(), collision.posY(), collision.posZ()}; + } + + if (tracks[ti].has_mcParticle()) { + const auto& pi = tracks[ti].template mcParticle_as().template mcParticle_as(); + posi = std::array{pi.vx(), pi.vy(), pi.vz()}; + } else { + dists[trk_pair_idx(ti, tj)] = std::numeric_limits::max(); + continue; + } + + dists[trk_pair_idx(ti, tj)] = RecoDecay::distance(posi, posj); + } + + int clusteri = -1, clusterj = -1; + float min_min_dist = -1.f; // If there is an not-merge-able min_dist pair, check the 2nd-min_dist pair. + while (true) { + + float min_dist = -1.f; // Get min_dist pair + for (int ti = 0; ti < n_pos - 1; ti++) + for (int tj = ti + 1; tj < n_pos; tj++) + if (tempTrkVtxIndex[ti] != tempTrkVtxIndex[tj] && tempTrkVtxIndex[ti] >= 0 && tempTrkVtxIndex[tj] >= 0) { + float dist = dists[trk_pair_idx(ti, tj)]; + if ((dist < min_dist || min_dist < 0.f) && dist > min_min_dist) { + min_dist = dist; + clusteri = ti; + clusterj = tj; + } + } + if (clusteri < 0 || clusterj < 0) + break; + + bool mrg = true; // Merge-ability check + for (int ti = 0; ti < n_pos && mrg; ti++) + if (tempTrkVtxIndex[ti] == tempTrkVtxIndex[clusteri] && tempTrkVtxIndex[ti] >= 0) { + for (int tj = 0; tj < n_pos && mrg; tj++) + if (tj != ti && tempTrkVtxIndex[tj] == tempTrkVtxIndex[clusterj] && tempTrkVtxIndex[tj] >= 0) { + if (dists[trk_pair_idx(ti, tj)] > vtxResParam) { // If there is more distant pair compared to vtx_res between two clusters, they cannot be merged. + mrg = false; + min_min_dist = min_dist; + } + } + } + if (min_dist > vtxResParam || min_dist < 0.f) + break; + + if (mrg) { // Merge two clusters + int old_index = tempTrkVtxIndex[clusterj]; + for (int t = 0; t < n_pos; t++) + if (tempTrkVtxIndex[t] == old_index) + tempTrkVtxIndex[t] = tempTrkVtxIndex[clusteri]; + } + } + + int n_vertices = 0; + + // Sort the indices from PV (as 0) to the most distant SV (as 1~). + int idxPV = tempTrkVtxIndex[n_trks]; + for (int t = 0; t < n_trks; t++) + if (tempTrkVtxIndex[t] == idxPV) { + tempTrkVtxIndex[t] = -2; + n_vertices = 1; // There is a track originating from PV + } + + std::unordered_map avgDistances; + std::unordered_map count; + for (int t = 0; t < n_trks; t++) { + if (tempTrkVtxIndex[t] >= 0) { + avgDistances[tempTrkVtxIndex[t]] += dists[trk_pair_idx(t, n_trks)]; + count[tempTrkVtxIndex[t]]++; + } + } + + trkLabels["trkVtxIndex"] = std::vector(n_trks, -1); + if (count.size() != 0) { // If there is any SV cluster not only PV cluster + for (auto& [idx, avgDistance] : avgDistances) + avgDistance /= count[idx]; + + n_vertices += avgDistances.size(); + + std::vector> sortedIndices(avgDistances.begin(), avgDistances.end()); + std::sort(sortedIndices.begin(), sortedIndices.end(), [](const auto& a, const auto& b) { return a.second < b.second; }); + int rank = 1; + for (const auto& [idx, avgDistance] : sortedIndices) { + bool found = false; + for (int t = 0; t < n_trks; t++) + if (tempTrkVtxIndex[t] == idx) { + trkLabels["trkVtxIndex"][t] = rank; + found = true; + } + rank += found; + } + } + + for (int t = 0; t < n_trks; t++) + if (tempTrkVtxIndex[t] == -2) + trkLabels["trkVtxIndex"][t] = 0; + + // trkOrigin + + int trkIdx = 0; + for (auto& constituent : jet.template tracks_as()) { + if (!constituent.has_mcParticle() || !constituent.template mcParticle_as().isPhysicalPrimary() || constituent.pt() < trackPtMin) { + trkLabels["trkOrigin"].push_back(0); + } else { + const auto& particle = constituent.template mcParticle_as(); + int orig = RecoDecay::getParticleOrigin(particles, particle, searchUpToQuark); + trkLabels["trkOrigin"].push_back((orig > 0) ? orig : (trkLabels["trkVtxIndex"][trkIdx] == 0) ? 3 + : 4); + } + + trkIdx++; + } + + return n_vertices; +} + }; // namespace jettaggingutilities #endif // PWGJE_CORE_JETTAGGINGUTILITIES_H_ diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index 2d60344085a..5c291077d81 100644 --- a/PWGJE/Tasks/bjetTreeCreator.cxx +++ b/PWGJE/Tasks/bjetTreeCreator.cxx @@ -15,6 +15,11 @@ /// /// \author Hadi Hassan , University of Jyväskylä +#include +#include +#include +#include + #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoA.h" @@ -81,6 +86,15 @@ DECLARE_SOA_COLUMN(SignedIP3D, ip3d, float); //! The t DECLARE_SOA_COLUMN(SignedIP3DSign, ip3dsigma, float); //! The track signed 3D IP significance DECLARE_SOA_COLUMN(MomFraction, momfraction, float); //! The track momentum fraction of the jets DECLARE_SOA_COLUMN(DeltaRTrackVertex, rtrackvertex, float); //! DR between the track and the closest SV, to be decided whether to add to or not +DECLARE_SOA_COLUMN(TrackPhi, trackphi, float); //! The track phi +DECLARE_SOA_COLUMN(TrackCharge, trackcharge, float); //! The track sign (charge) +DECLARE_SOA_COLUMN(TrackITSChi2NCl, trackitschi2ncl, float); //! The track ITS Chi2NCl +DECLARE_SOA_COLUMN(TrackTPCChi2NCl, tracktpcchi2ncl, float); //! The track TPC Chi2NCl +DECLARE_SOA_COLUMN(TrackITSNCls, trackitsncls, float); //! The track ITS NCls +DECLARE_SOA_COLUMN(TrackTPCNCls, tracktpcncls, float); //! The track TPC NCls (Found) +DECLARE_SOA_COLUMN(TrackTPCNCrossedRows, tracktpcncrossedrows, float); //! The track TPC NCrossedRows +DECLARE_SOA_COLUMN(TrackOrigin, trk_origin, int); //! The track origin label for GNN track origin predictions +DECLARE_SOA_COLUMN(TrackVtxIndex, trk_vtx_index, int); //! The track vertex index for GNN vertex predictions // DECLARE_SOA_COLUMN(DCATrackJet, dcatrackjet, float); //! The distance between track and jet, unfortunately it cannot be calculated in O2 } // namespace trackInfo @@ -101,6 +115,20 @@ DECLARE_SOA_TABLE(bjetTracksParams, "AOD", "BJETTRACKSPARAM", using bjetTracksParam = bjetTracksParams::iterator; +DECLARE_SOA_TABLE(bjetTracksParamsExtra, "AOD", "BJETTRACKSEXTRA", + // o2::soa::Index<>, + trackInfo::TrackPhi, + trackInfo::TrackCharge, + trackInfo::TrackITSChi2NCl, + trackInfo::TrackTPCChi2NCl, + trackInfo::TrackITSNCls, + trackInfo::TrackTPCNCls, + trackInfo::TrackTPCNCrossedRows, + trackInfo::TrackOrigin, + trackInfo::TrackVtxIndex); + +using bjetTracksParamExtra = bjetTracksParamsExtra::iterator; + namespace SVInfo { DECLARE_SOA_INDEX_COLUMN(bjetParam, jetindex); //! The jet index @@ -154,6 +182,7 @@ struct BJetTreeCreator { Produces bjetParamsTable; Produces bjetTracksParamsTable; + Produces bjetTracksExtraTable; Produces bjetSVParamsTable; Produces bjetConstituentsTable; @@ -196,6 +225,8 @@ struct BJetTreeCreator { Configurable produceTree{"produceTree", true, "produce the jet TTree"}; + Configurable vtxRes{"vtxRes", 0.01, "Vertex position resolution (cluster size) for GNN vertex predictions (cm)"}; + int eventSelection = -1; std::vector jetRadiiValues; @@ -225,7 +256,7 @@ struct BJetTreeCreator { registry.add("h2_jetMass_jetpT", "Jet mass;#it{p}_{T,jet} (GeV/#it{c});#it{m}_{jet} (GeV/#it{c}^{2})", {HistType::kTH2F, {{200, 0., 200.}, {50, 0, 50.0}}}); registry.add("h2_SVMass_jetpT", "Secondary vertex mass;#it{p}_{T,jet} (GeV/#it{c});#it{m}_{SV} (GeV/#it{c}^{2})", {HistType::kTH2F, {{200, 0., 200.}, {50, 0, 10}}}); - if (doprocessMCJets) { + if (doprocessMCJets || doprocessMCJetsForGNN) { registry.add("h2_SIPs2D_jetpT_bjet", "2D IP significance b-jets;#it{p}_{T,jet} (GeV/#it{c});IPs", {HistType::kTH2F, {{200, 0., 200.}, {100, -50.0, 50.0}}}); registry.add("h2_SIPs3D_jetpT_bjet", "3D IP significance b-jets;#it{p}_{T,jet} (GeV/#it{c});IPs", {HistType::kTH2F, {{200, 0., 200.}, {100, -50.0, 50.0}}}); registry.add("h2_LxyS_jetpT_bjet", "Decay length in XY b-jets;#it{p}_{T,jet} (GeV/#it{c});S#it{L}_{xy}", {HistType::kTH2F, {{200, 0., 200.}, {100, 0., 100.0}}}); @@ -259,6 +290,46 @@ struct BJetTreeCreator { registry.add("h2_Response_DetjetpT_PartjetpT_cjet", "Response matrix c-jets;#it{p}_{T,jet}^{det} (GeV/#it{c});#it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH2F, {{200, 0., 200.}, {200, 0., 200.}}}); registry.add("h2_Response_DetjetpT_PartjetpT_lfjet", "Response matrix lf-jet;#it{p}_{T,jet}^{det} (GeV/#it{c});#it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH2F, {{200, 0., 200.}, {200, 0., 200.}}}); } + + if (doprocessMCJetsForGNN) { + //+jet + registry.add("h_jet_pt", "jet_pt;#it{p}_{T}^{ch jet} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 200.}}}); + registry.add("h_jet_eta", "jet_eta;#it{#eta}_{ch jet};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("h_jet_phi", "jet_phi;#it{#phi}_{ch jet};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_jet_flav", "jet_flav;jet flavor;Entries", {HistType::kTH1F, {{4, 0., 4.}}}); + registry.add("h_n_trks", "n_trks;#it{n}_{tracks};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); + registry.add("h_jet_mass", "jet_mass;#it{m}_{jet} (GeV/#it{c}^2);Entries", {HistType::kTH1F, {{100, 0., 50.}}}); + auto h_jet_flav = registry.get(HIST("h_jet_flav")); + h_jet_flav->GetXaxis()->SetBinLabel(1, "no mcparticle"); // 0 + h_jet_flav->GetXaxis()->SetBinLabel(2, "c-jet"); // 1 + h_jet_flav->GetXaxis()->SetBinLabel(3, "b-jet"); // 2 + h_jet_flav->GetXaxis()->SetBinLabel(4, "lf-jet"); // 3 + registry.add("h_n_vertices", "n_vertices;#it{n}_{vertex};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); + //+trk + registry.add("h_trk_pt", "trk_pt;#it{p}_{T} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 100.}}}); + registry.add("h_trk_eta", "trk_eta;#it{#eta};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("h_trk_phi", "trk_phi;#it{#phi};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_trk_charge", "trk_charge;#it{q};Entries", {HistType::kTH1F, {{3, -1.5, 1.5}}}); + registry.add("h_trk_dcaxy", "trk_dcaxy;#it{DCA}_{xy} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); + registry.add("h_trk_dcaxyz", "trk_dcaxyz;#it{DCA}_{xyz} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); + registry.add("h_trk_sigmadcaxy", "trk_sigmadcaxy;#it{#sigma}_{#it{DCA}_{xy}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); + registry.add("h_trk_sigmadcaxyz", "trk_sigmadcaxyz;#it{#sigma}_{#it{DCA}_{xyz}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); + registry.add("h_trk_itsncls", "trk_itsncls;ITS NCls;Entries", {HistType::kTH1F, {{10, 0., 10.}}}); + registry.add("h_trk_tpcncls", "trk_tpcncls;TPC NCls (Found);Entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_trk_tpcncrs", "trk_tpcncrs;TPC NCrossedRows;Entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_trk_itschi2ncl", "trk_itschi2ncl;ITS #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 20.}}}); + registry.add("h_trk_tpcchi2ncl", "trk_tpcchi2ncl;TPC #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("h_jtrack_counter", "jtrack counter", {HistType::kTH1F, {{1, 0., 1.}}}); + registry.add("h2_trk_jtrackpt_vs_origtrackpt", "JTracks::pt vs Tracks::pt", {HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}}); + registry.add("h_trk_vtx_index", "trk_vtx_index;Vertex index;Entries", {HistType::kTH1F, {{20, 0., 20.}}}); + registry.add("h_trk_origin", "trk_origin;Track origin;Entries", {HistType::kTH1F, {{5, 0., 5.}}}); + auto h_trk_origin = registry.get(HIST("h_trk_origin")); + h_trk_origin->GetXaxis()->SetBinLabel(1, "NotPhysPrim"); + h_trk_origin->GetXaxis()->SetBinLabel(2, "Charm"); + h_trk_origin->GetXaxis()->SetBinLabel(3, "Beauty"); + h_trk_origin->GetXaxis()->SetBinLabel(4, "Primary"); + h_trk_origin->GetXaxis()->SetBinLabel(5, "OtherSecondary"); + } } // FIXME filtering only works when you loop directly over the list, but if you loop over it as a constituent they will not be filtered @@ -272,6 +343,8 @@ struct BJetTreeCreator { using JetTracksMCDwID = soa::Filtered>; using DataJets = soa::Filtered>; + using OriginalTracks = soa::Join; + // Function to get the reduction factor based on jet pT double getReductionFactor(double jetPT) { @@ -347,6 +420,8 @@ struct BJetTreeCreator { } } + using TrackLabelMap = std::unordered_map>; + template void analyzeJetTrackInfo(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& trackIndices, int jetFlavor = 0, double eventweight = 1.0) { @@ -392,6 +467,77 @@ struct BJetTreeCreator { } } + template + void analyzeJetTrackInfoForGNN(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, AnyOriginalTracks const&, std::vector& trackIndices, int jetFlavor = 0, double eventweight = 1.0, TrackLabelMap* trkLabels = nullptr) + { + int trkIdx = -1; + for (auto& constituent : analysisJet.template tracks_as()) { + + trkIdx++; + + if (constituent.pt() < trackPtMin) { + continue; + } + + double deltaRJetTrack = jetutilities::deltaR(analysisJet, constituent); + double dotProduct = RecoDecay::dotProd(std::array{analysisJet.px(), analysisJet.py(), analysisJet.pz()}, std::array{constituent.px(), constituent.py(), constituent.pz()}); + int sign = jettaggingutilities::getGeoSign(analysisJet, constituent); + + registry.fill(HIST("h2_SIPs2D_jetpT"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + + if (doprocessMCJetsForGNN) { + if (jetFlavor == 2) { + registry.fill(HIST("h2_SIPs2D_jetpT_bjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT_bjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + } else if (jetFlavor == 1) { + registry.fill(HIST("h2_SIPs2D_jetpT_cjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT_cjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + } else { + registry.fill(HIST("h2_SIPs2D_jetpT_lfjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT_lfjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + } + + auto origConstit = constituent.template track_as(); + + //+ + int trkVtxIndex = 0; + int trkOrigin = 0; + if (trkLabels != nullptr) { + trkVtxIndex = (*trkLabels)["trkVtxIndex"][trkIdx]; + trkOrigin = (*trkLabels)["trkOrigin"][trkIdx]; + } + + //+trk + registry.fill(HIST("h_trk_pt"), constituent.pt(), eventweight); + registry.fill(HIST("h_trk_eta"), constituent.eta(), eventweight); + registry.fill(HIST("h_trk_phi"), origConstit.phi(), eventweight); + registry.fill(HIST("h_trk_charge"), constituent.sign(), eventweight); + registry.fill(HIST("h_trk_dcaxy"), std::abs(constituent.dcaXY()) * sign, eventweight); + registry.fill(HIST("h_trk_dcaxyz"), std::abs(constituent.dcaXYZ()) * sign, eventweight); + registry.fill(HIST("h_trk_sigmadcaxy"), constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h_trk_sigmadcaxyz"), constituent.sigmadcaXYZ(), eventweight); + registry.fill(HIST("h_trk_itsncls"), origConstit.itsNCls(), eventweight); + registry.fill(HIST("h_trk_tpcncls"), origConstit.tpcNClsFound(), eventweight); + registry.fill(HIST("h_trk_tpcncrs"), origConstit.tpcNClsCrossedRows(), eventweight); + registry.fill(HIST("h_trk_itschi2ncl"), origConstit.itsChi2NCl(), eventweight); + registry.fill(HIST("h_trk_tpcchi2ncl"), origConstit.tpcChi2NCl(), eventweight); + registry.fill(HIST("h2_trk_jtrackpt_vs_origtrackpt"), constituent.pt(), origConstit.pt(), eventweight); // jtrack & new extra table are well joined (linear correlation) + registry.fill(HIST("h_trk_vtx_index"), trkVtxIndex); + registry.fill(HIST("h_trk_origin"), trkOrigin); + + if (produceTree) { + bjetTracksExtraTable(/*bjetParamsTable.lastIndex() + 1, */ origConstit.phi(), constituent.sign(), origConstit.itsChi2NCl(), origConstit.tpcChi2NCl(), origConstit.itsNCls(), origConstit.tpcNClsFound(), origConstit.tpcNClsCrossedRows(), trkOrigin, trkVtxIndex); //+ + } + } + + if (produceTree) { + bjetTracksParamsTable(bjetParamsTable.lastIndex() + 1, constituent.pt(), constituent.eta(), dotProduct, dotProduct / analysisJet.p(), deltaRJetTrack, std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaXYZ()) * sign, constituent.sigmadcaXYZ(), constituent.p() / analysisJet.p(), 0.); + } + trackIndices.push_back(bjetTracksParamsTable.lastIndex()); + } + } + void processDummy(FilteredCollision::iterator const& /*collision*/) { } @@ -548,6 +694,85 @@ struct BJetTreeCreator { } PROCESS_SWITCH(BJetTreeCreator, processMCJets, "jet information in MC", false); + using MCDJetTableNoSV = soa::Filtered>; + using JetParticleswID = soa::Join; + + void processMCJetsForGNN(FilteredCollisionMCD::iterator const& collision, aod::JMcCollisions const&, MCDJetTableNoSV const& MCDjets, MCPJetTable const& MCPjets, JetTracksMCDwID const& allTracks, JetParticleswID const& MCParticles, OriginalTracks const& origTracks, aod::McParticles const& origParticles) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection) || (static_cast(std::rand()) / RAND_MAX < eventReductionFactor)) { + return; + } + + registry.fill(HIST("h_vertexZ"), collision.posZ()); + + auto const mcParticlesPerColl = MCParticles.sliceBy(McParticlesPerCollision, collision.mcCollisionId()); + auto const mcPJetsPerColl = MCPjets.sliceBy(McPJetsPerCollision, collision.mcCollisionId()); + + for (const auto& analysisJet : MCDjets) { + + bool jetIncluded = false; + for (auto jetR : jetRadiiValues) { + if (analysisJet.r() == static_cast(jetR * 100)) { + jetIncluded = true; + break; + } + } + + if (!jetIncluded) { + continue; + } + + std::vector tracksIndices; + std::vector SVsIndices; + + int16_t jetFlavor = 0; + + for (auto& mcpjet : analysisJet.template matchedJetGeo_as()) { + if (useQuarkDef) { + jetFlavor = jettaggingutilities::getJetFlavor(mcpjet, mcParticlesPerColl); + } else { + jetFlavor = jettaggingutilities::getJetFlavorHadron(mcpjet, mcParticlesPerColl); + } + } + + float eventWeight = analysisJet.eventWeight(); + + //+ + TrackLabelMap trkLabels{{"trkVtxIndex", {}}, {"trkOrigin", {}}}; + int nVertices = jettaggingutilities::vertexClustering(collision.template mcCollision_as(), analysisJet, allTracks, MCParticles, origParticles, trkLabels, true, vtxRes, trackPtMin); + analyzeJetTrackInfoForGNN(collision, analysisJet, allTracks, origTracks, tracksIndices, jetFlavor, eventWeight, &trkLabels); + + registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h2_nTracks_jetpT"), analysisJet.pt(), tracksIndices.size()); + + //+jet + registry.fill(HIST("h_jet_pt"), analysisJet.pt()); + registry.fill(HIST("h_jet_eta"), analysisJet.eta()); + registry.fill(HIST("h_jet_phi"), analysisJet.phi()); + registry.fill(HIST("h_jet_flav"), jetFlavor); + registry.fill(HIST("h_n_trks"), tracksIndices.size()); + registry.fill(HIST("h_jet_mass"), analysisJet.mass()); + registry.fill(HIST("h_n_vertices"), nVertices); + + if (jetFlavor == 2) { + registry.fill(HIST("h2_jetMass_jetpT_bjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h_jetpT_detector_bjet"), analysisJet.pt(), eventWeight); + } else if (jetFlavor == 1) { + registry.fill(HIST("h2_jetMass_jetpT_cjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h_jetpT_detector_cjet"), analysisJet.pt(), eventWeight); + } else { + registry.fill(HIST("h2_jetMass_jetpT_lfjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h_jetpT_detector_lfjet"), analysisJet.pt(), eventWeight); + } + + if (produceTree) { + bjetConstituentsTable(bjetParamsTable.lastIndex() + 1, tracksIndices, SVsIndices); + bjetParamsTable(analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), tracksIndices.size(), nVertices, analysisJet.mass(), jetFlavor, analysisJet.r()); + } + } + } + PROCESS_SWITCH(BJetTreeCreator, processMCJetsForGNN, "jet information in MC for GNN", false); + Filter mccollisionFilter = nabs(aod::jmccollision::posZ) < vertexZCut; using FilteredCollisionMCP = soa::Filtered; From 50936a71a9e361a5dfceafc56755ba755628f333 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Mon, 2 Dec 2024 17:11:41 +0100 Subject: [PATCH 06/91] [PWGHF] Add info about number of tracks decayed to muons for D* spin alignment (#8750) --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 80 ++++++++++++----------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 1594cc5e9cc..8dc690b0be6 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -288,6 +288,7 @@ struct TaskPolarisationCharmHadrons { const AxisSpec thnAxisNumPvContributors{configThnAxisNumPvContributors, "num PV contributors"}; const AxisSpec thnAxisPtB{configThnAxisPtB, "#it{p}_{T}(B mother) (GeV/#it{c})"}; const AxisSpec thnAxisDausAcc{2, -0.5f, 1.5f, "daughters in acceptance"}; + const AxisSpec thnAxisDauToMuons{4, -0.5f, 3.5f, "daughters decayed to muons"}; const AxisSpec thnAxisResoChannelLc{4, -0.5, 3.5, "0: direct 1,2,3: resonant"}; // 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± const AxisSpec thnAxisAbsEtaTrackMin{configThnAxisAbsEtaTrackMin, "min |#it{#eta_{track}}|"}; const AxisSpec thnAxisNumItsClsMin{configThnAxisNumItsClsMin, "min #it{N}_{cls ITS}"}; @@ -323,20 +324,20 @@ struct TaskPolarisationCharmHadrons { } } else { if (activateTHnSparseCosThStarHelicity) { - registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarProduction) { - registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarBeam) { - registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarRandom) { - registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } } } else if (doprocessLcToPKPiWithMl || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { @@ -410,20 +411,20 @@ struct TaskPolarisationCharmHadrons { } } else { if (activateTHnSparseCosThStarHelicity) { - registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarProduction) { - registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarBeam) { - registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarRandom) { - registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } } } else if (doprocessLcToPKPi || doprocessLcToPKPiMc) { @@ -536,7 +537,7 @@ struct TaskPolarisationCharmHadrons { /// \param numItsClsMin is the minimum number of ITS clusters of the daughter tracks /// \param numTpcClsMin is the minimum number of TPC clusters of the daughter tracks template - void fillRecoHistos(float invMassCharmHad, float ptCharmHad, int numPvContributors, float rapCharmHad, float invMassD0, float invMassKPiLc, float cosThetaStar, float phiEuler, std::array outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, int8_t resoChannelLc, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t charge) + void fillRecoHistos(float invMassCharmHad, float ptCharmHad, int numPvContributors, float rapCharmHad, float invMassD0, float invMassKPiLc, float cosThetaStar, float phiEuler, std::array outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, int8_t resoChannelLc, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t charge, int8_t nMuons) { if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity if constexpr (!doMc) { // data @@ -563,7 +564,7 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -572,7 +573,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -583,7 +584,7 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -592,7 +593,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -627,7 +628,7 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -636,7 +637,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -647,7 +648,7 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -656,7 +657,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -691,7 +692,7 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -700,7 +701,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -711,7 +712,7 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -720,7 +721,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -749,13 +750,13 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } @@ -763,13 +764,13 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } @@ -1222,29 +1223,34 @@ struct TaskPolarisationCharmHadrons { // random float cosThetaStarRandom = -10.f; + int8_t nMuons{0u}; + if constexpr (doMc) { + nMuons = candidate.nTracksDecayed(); + } + if (activateTHnSparseCosThStarHelicity) { // helicity cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); phiHelicity = std::atan2(beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()), normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2()))); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarHelicity, phiHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarHelicity, phiHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } if (activateTHnSparseCosThStarProduction) { // production cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(normalVec.Mag2()); phiProduction = std::atan2(normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())), helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2()))); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarProduction, phiProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarProduction, phiProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } if (activateTHnSparseCosThStarBeam) { // beam cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); phiBeam = std::atan2(helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())), beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2())); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarBeam, phiBeam, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarBeam, phiBeam, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } if (activateTHnSparseCosThStarRandom) { // random ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } /// Table for Lc->pKpi background studies From fccfc7fba21e0cb25db7148e6722e988f3f67a44 Mon Sep 17 00:00:00 2001 From: Andrea Giovanni Riffero Date: Mon, 2 Dec 2024 17:53:11 +0100 Subject: [PATCH 07/91] [PWGUD] Modify MC saved tables (#8761) Co-authored-by: ariffero Co-authored-by: ALICE Action Bot --- PWGUD/Tasks/fwdMuonsUPC.cxx | 323 ++++++++++++++++++++---------------- 1 file changed, 180 insertions(+), 143 deletions(-) diff --git a/PWGUD/Tasks/fwdMuonsUPC.cxx b/PWGUD/Tasks/fwdMuonsUPC.cxx index 418995de88c..de1fde95115 100644 --- a/PWGUD/Tasks/fwdMuonsUPC.cxx +++ b/PWGUD/Tasks/fwdMuonsUPC.cxx @@ -20,6 +20,7 @@ #include #include "Framework/runDataProcessing.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "CCDB/BasicCCDBManager.h" @@ -27,7 +28,6 @@ #include "DataFormatsParameters/GRPECSObject.h" #include "PWGUD/DataModel/UDTables.h" -#include "TDatabasePDG.h" #include "TLorentzVector.h" #include "TSystem.h" #include "TMath.h" @@ -38,7 +38,7 @@ namespace dimu { // dimuon DECLARE_SOA_COLUMN(M, m, float); -DECLARE_SOA_COLUMN(E, energy, float); +DECLARE_SOA_COLUMN(Energy, energy, float); DECLARE_SOA_COLUMN(Px, px, float); DECLARE_SOA_COLUMN(Py, py, float); DECLARE_SOA_COLUMN(Pz, pz, float); @@ -48,14 +48,14 @@ DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(PhiAv, phiAv, float); DECLARE_SOA_COLUMN(PhiCh, phiCh, float); // tracks positive (p) and negative (n) -DECLARE_SOA_COLUMN(Ep, energyp, float); +DECLARE_SOA_COLUMN(EnergyP, energyP, float); DECLARE_SOA_COLUMN(Pxp, pxp, float); DECLARE_SOA_COLUMN(Pyp, pyp, float); DECLARE_SOA_COLUMN(Pzp, pzp, float); DECLARE_SOA_COLUMN(Ptp, ptp, float); DECLARE_SOA_COLUMN(Etap, etap, float); DECLARE_SOA_COLUMN(Phip, phip, float); -DECLARE_SOA_COLUMN(En, energyn, float); +DECLARE_SOA_COLUMN(EnergyN, energyN, float); DECLARE_SOA_COLUMN(Pxn, pxn, float); DECLARE_SOA_COLUMN(Pyn, pyn, float); DECLARE_SOA_COLUMN(Pzn, pzn, float); @@ -73,17 +73,46 @@ DECLARE_SOA_COLUMN(Nclass, nclass, int); namespace o2::aod { DECLARE_SOA_TABLE(DiMu, "AOD", "DIMU", - dimu::M, dimu::E, dimu::Px, dimu::Py, dimu::Pz, dimu::Pt, dimu::Rap, dimu::Phi, + dimu::M, dimu::Energy, dimu::Px, dimu::Py, dimu::Pz, dimu::Pt, dimu::Rap, dimu::Phi, dimu::PhiAv, dimu::PhiCh, - dimu::Ep, dimu::Pxp, dimu::Pyp, dimu::Pzp, dimu::Ptp, dimu::Etap, dimu::Phip, - dimu::En, dimu::Pxn, dimu::Pyn, dimu::Pzn, dimu::Ptn, dimu::Etan, dimu::Phin, + dimu::EnergyP, dimu::Pxp, dimu::Pyp, dimu::Pzp, dimu::Ptp, dimu::Etap, dimu::Phip, + dimu::EnergyN, dimu::Pxn, dimu::Pyn, dimu::Pzn, dimu::Ptn, dimu::Etan, dimu::Phin, dimu::Tzna, dimu::Ezna, dimu::Tznc, dimu::Eznc, dimu::Nclass); } // namespace o2::aod +// for saving tree with info on gen MC +namespace gendimu +{ +// dimuon +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(PhiAv, phiAv, float); +DECLARE_SOA_COLUMN(PhiCh, phiCh, float); +// tracks positive (p) and negative (n) +DECLARE_SOA_COLUMN(Ptp, ptp, float); +DECLARE_SOA_COLUMN(Etap, etap, float); +DECLARE_SOA_COLUMN(Phip, phip, float); +DECLARE_SOA_COLUMN(Ptn, ptn, float); +DECLARE_SOA_COLUMN(Etan, etan, float); +DECLARE_SOA_COLUMN(Phin, phin, float); +} // namespace gendimu + +namespace o2::aod +{ +DECLARE_SOA_TABLE(GenDimu, "AOD", "GENDIMU", + gendimu::M, gendimu::Pt, gendimu::Rap, gendimu::Phi, + gendimu::PhiAv, gendimu::PhiCh, + gendimu::Ptp, gendimu::Etap, gendimu::Phip, + gendimu::Ptn, gendimu::Etan, gendimu::Phin); +} // namespace o2::aod + // for saving tree with info on reco MC namespace recodimu { // dimuon +DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Rap, rap, float); DECLARE_SOA_COLUMN(Phi, phi, float); @@ -97,22 +126,22 @@ DECLARE_SOA_COLUMN(Ptn, ptn, float); DECLARE_SOA_COLUMN(Etan, etan, float); DECLARE_SOA_COLUMN(Phin, phin, float); // gen info dimuon -DECLARE_SOA_COLUMN(GenPt, gen_pt, float); -DECLARE_SOA_COLUMN(GenRap, gen_rap, float); -DECLARE_SOA_COLUMN(GenPhi, gen_phi, float); +DECLARE_SOA_COLUMN(GenPt, genPt, float); +DECLARE_SOA_COLUMN(GenRap, genRap, float); +DECLARE_SOA_COLUMN(GenPhi, genPhi, float); // gen info trks -DECLARE_SOA_COLUMN(GenPtp, gen_ptp, float); -DECLARE_SOA_COLUMN(GenEtap, gen_etap, float); -DECLARE_SOA_COLUMN(GenPhip, gen_phip, float); -DECLARE_SOA_COLUMN(GenPtn, gen_ptn, float); -DECLARE_SOA_COLUMN(GenEtan, gen_etan, float); -DECLARE_SOA_COLUMN(GenPhin, gen_phin, float); +DECLARE_SOA_COLUMN(GenPtp, genPtp, float); +DECLARE_SOA_COLUMN(GenEtap, genEtap, float); +DECLARE_SOA_COLUMN(GenPhip, genPhip, float); +DECLARE_SOA_COLUMN(GenPtn, genPtn, float); +DECLARE_SOA_COLUMN(GenEtan, genEtan, float); +DECLARE_SOA_COLUMN(GenPhin, genPhin, float); } // namespace recodimu namespace o2::aod { -DECLARE_SOA_TABLE(recoDiMu, "AOD", "RECODIMU", - recodimu::Pt, recodimu::Rap, recodimu::Phi, +DECLARE_SOA_TABLE(RecoDimu, "AOD", "RECODIMU", + recodimu::M, recodimu::Pt, recodimu::Rap, recodimu::Phi, recodimu::PhiAv, recodimu::PhiCh, recodimu::Ptp, recodimu::Etap, recodimu::Phip, recodimu::Ptn, recodimu::Etan, recodimu::Phin, @@ -138,24 +167,26 @@ const float kPtMin = 0.; struct fwdMuonsUPC { // a pdg object - TDatabasePDG* pdg = nullptr; + Service pdg; using CandidatesFwd = soa::Join; using ForwardTracks = soa::Join; using CompleteFwdTracks = soa::Join; Produces dimuSel; - Produces dimuReco; + Produces dimuGen; + Produces dimuReco; // defining histograms using histogram registry: different histos for the different process functions HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry reg0n0n{"reg0n0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXn0n{"regXn0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXnXn{"regXnXn", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry McGenRegistry{"McGenRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry McRecoRegistry{"McRecoRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry mcGenRegistry{"mcGenRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry mcRecoRegistry{"mcRecoRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // CONFIGURABLES + static constexpr double Pi = o2::constants::math::PI; // pT of muon pairs Configurable nBinsPt{"nBinsPt", 250, "N bins in pT histo"}; Configurable lowPt{"lowPt", 0., "lower limit in pT histo"}; @@ -174,8 +205,8 @@ struct fwdMuonsUPC { Configurable highRapidity{"highRapidity", -2., "upper limit in rapidity histo"}; // phi of muon pairs Configurable nBinsPhi{"nBinsPhi", 600, "N bins in phi histo"}; - Configurable lowPhi{"lowPhi", -TMath::Pi(), "lower limit in phi histo"}; - Configurable highPhi{"highPhi", TMath::Pi(), "upper limit in phi histo"}; + Configurable lowPhi{"lowPhi", -Pi, "lower limit in phi histo"}; + Configurable highPhi{"highPhi", Pi, "upper limit in phi histo"}; // pT of single muons Configurable nBinsPtSingle{"nBinsPtSingle", 500, "N bins in pT histo single muon"}; Configurable lowPtSingle{"lowPtSingle", 0., "lower limit in pT histo single muon"}; @@ -186,8 +217,8 @@ struct fwdMuonsUPC { Configurable highEtaSingle{"highEtaSingle", -2., "upper limit in eta histo single muon"}; // phi of single muons Configurable nBinsPhiSingle{"nBinsPhiSingle", 600, "N bins in phi histo single muon"}; - Configurable lowPhiSingle{"lowPhiSingle", -TMath::Pi(), "lower limit in phi histo single muon"}; - Configurable highPhiSingle{"highPhiSingle", TMath::Pi(), "upper limit in phi histo single muon"}; + Configurable lowPhiSingle{"lowPhiSingle", -Pi, "lower limit in phi histo single muon"}; + Configurable highPhiSingle{"highPhiSingle", Pi, "upper limit in phi histo single muon"}; // ZDC Configurable nBinsZDCen{"nBinsZDCen", 200, "N bins in ZN energy"}; Configurable lowEnZN{"lowEnZN", -50., "lower limit in ZN energy histo"}; @@ -195,9 +226,6 @@ struct fwdMuonsUPC { void init(InitContext&) { - // PDG - pdg = TDatabasePDG::Instance(); - // binning of pT axis fr fit std::vector ptFitBinning = { 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, @@ -264,56 +292,52 @@ struct fwdMuonsUPC { regXnXn.add("hPtFit", "Transverse momentum of muon pairs - XnXn;;#counts", kTH1D, {axisPtFit}); // gen MC - McGenRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); - McGenRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); - McGenRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); - McGenRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); - McGenRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); - McGenRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); - McGenRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); - McGenRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); - McGenRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); - McGenRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); - McGenRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); - McGenRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); - McGenRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + mcGenRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + mcGenRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + mcGenRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); + mcGenRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); + mcGenRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); + mcGenRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); + mcGenRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); + mcGenRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); + mcGenRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); + mcGenRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); + mcGenRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + mcGenRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + mcGenRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); // reco MC - McRecoRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); - McRecoRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); - McRecoRegistry.add("hPtFit", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPtFit}); - McRecoRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); - McRecoRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); - McRecoRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); - McRecoRegistry.add("hCharge", "Charge;;;#counts", kTH1D, {{5, -2.5, 2.5}}); - McRecoRegistry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); - McRecoRegistry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); - McRecoRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); - McRecoRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); - McRecoRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); - McRecoRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); - McRecoRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); - McRecoRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); - McRecoRegistry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); - McRecoRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); - McRecoRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + mcRecoRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + mcRecoRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + mcRecoRegistry.add("hPtFit", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPtFit}); + mcRecoRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); + mcRecoRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); + mcRecoRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); + mcRecoRegistry.add("hCharge", "Charge;;;#counts", kTH1D, {{5, -2.5, 2.5}}); + mcRecoRegistry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); + mcRecoRegistry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); + mcRecoRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); + mcRecoRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); + mcRecoRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); + mcRecoRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); + mcRecoRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); + mcRecoRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + mcRecoRegistry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); + mcRecoRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + mcRecoRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); // corr gen-reco - McRecoRegistry.add("hPtcorr", "gen pT vs reco pT", kTH2D, {axisPt, axisPt}); - McRecoRegistry.add("hRapcorr", "gen rapidity vs reco rapidity", kTH2D, {axisRapidity, axisRapidity}); - McRecoRegistry.add("hPhicorr", "gen #phi vs reco #phi", kTH2D, {axisPhi, axisPhi}); + mcRecoRegistry.add("hPtcorr", "gen pT vs reco pT", kTH2D, {axisPt, axisPt}); + mcRecoRegistry.add("hRapcorr", "gen rapidity vs reco rapidity", kTH2D, {axisRapidity, axisRapidity}); + mcRecoRegistry.add("hPhicorr", "gen #phi vs reco #phi", kTH2D, {axisPhi, axisPhi}); } // FUNCTIONS // retrieve particle mass (GeV/c^2) from TDatabasePDG - float particleMass(TDatabasePDG* pdg, int pid) + float particleMass(int pid) { - auto mass = 0.; - TParticlePDG* pdgparticle = pdg->GetParticle(pid); - if (pdgparticle != nullptr) { - mass = pdgparticle->Mass(); - } + auto mass = pdg->Mass(pid); return mass; } @@ -382,10 +406,10 @@ struct fwdMuonsUPC { // function that fills a map with the collision id of each udcollision as key // and a ZDCinfo struct with the ZDC information - void collectCandZDCInfo(std::unordered_map& zdcPerCand, o2::aod::UDZdcsReduced& ZDCs) + void collectCandZDCInfo(std::unordered_map& zdcPerCand, o2::aod::UDZdcsReduced const& ZDCs) { - for (auto& zdc : ZDCs) { + for (const auto& zdc : ZDCs) { int32_t candId = zdc.udCollisionId(); if (candId < 0) { continue; @@ -415,7 +439,7 @@ struct fwdMuonsUPC { float rAbs = fwdTrack.rAtAbsorberEnd(); float pDca = fwdTrack.pDca(); TLorentzVector p; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p.SetXYZM(fwdTrack.px(), fwdTrack.py(), fwdTrack.pz(), mMu); float eta = p.Eta(); float pt = p.Pt(); @@ -464,7 +488,7 @@ struct fwdMuonsUPC { // used for real data void processCand(CandidatesFwd::iterator const& cand, ForwardTracks::iterator const& tr1, ForwardTracks::iterator const& tr2, - ZDCinfo& zdc) + ZDCinfo const& zdc) { // V0 selection const auto& ampsV0A = cand.amplitudesV0A(); @@ -499,7 +523,7 @@ struct fwdMuonsUPC { // form Lorentz vectors TLorentzVector p1, p2; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); TLorentzVector p = p1 + p2; @@ -527,47 +551,47 @@ struct fwdMuonsUPC { computePhiAnis(p1, p2, tr1.sign(), phiAverage, phiCharge); // zdc info - if (TMath::Abs(zdc.timeA) < 10) + if (std::abs(zdc.timeA) < 10) registry.fill(HIST("hTimeZNA"), zdc.timeA); - if (TMath::Abs(zdc.timeC) < 10) + if (std::abs(zdc.timeC) < 10) registry.fill(HIST("hTimeZNC"), zdc.timeC); registry.fill(HIST("hEnergyZN"), zdc.enA, zdc.enC); // divide the events in neutron classes - bool neutron_A = false; - bool neutron_C = false; + bool neutronA = false; + bool neutronC = false; int znClass = -1; - if (TMath::Abs(zdc.timeA) < 2) - neutron_A = true; - if (TMath::Abs(zdc.timeC) < 2) - neutron_C = true; + if (std::abs(zdc.timeA) < 2) + neutronA = true; + if (std::abs(zdc.timeC) < 2) + neutronC = true; if (std::isinf(zdc.timeC)) - neutron_C = false; + neutronC = false; if (std::isinf(zdc.timeA)) - neutron_A = false; + neutronA = false; // fill the histos in neutron classes and assign neutron class label // 0n0n - if (neutron_C == false && neutron_A == false) { + if (neutronC == false && neutronA == false) { znClass = 1; reg0n0n.fill(HIST("hMass"), p.M()); reg0n0n.fill(HIST("hPt"), p.Pt()); reg0n0n.fill(HIST("hPtFit"), p.Pt()); reg0n0n.fill(HIST("hEta"), p.Eta()); reg0n0n.fill(HIST("hRapidity"), p.Rapidity()); - } else if (neutron_A ^ neutron_C) { // Xn0n + 0nXn - if (neutron_A) + } else if (neutronA ^ neutronC) { // Xn0n + 0nXn + if (neutronA) znClass = 2; - else if (neutron_C) + else if (neutronC) znClass = 3; regXn0n.fill(HIST("hMass"), p.M()); regXn0n.fill(HIST("hPt"), p.Pt()); regXn0n.fill(HIST("hPtFit"), p.Pt()); regXn0n.fill(HIST("hEta"), p.Eta()); regXn0n.fill(HIST("hRapidity"), p.Rapidity()); - } else if (neutron_A && neutron_C) { // XnXn + } else if (neutronA && neutronC) { // XnXn znClass = 4; regXnXn.fill(HIST("hMass"), p.M()); regXnXn.fill(HIST("hPt"), p.Pt()); @@ -624,7 +648,7 @@ struct fwdMuonsUPC { // create Lorentz vectors TLorentzVector p1, p2; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p1.SetXYZM(McPart1.px(), McPart1.py(), McPart1.pz(), mMu); p2.SetXYZM(McPart2.px(), McPart2.py(), McPart2.pz(), mMu); TLorentzVector p = p1 + p2; @@ -649,22 +673,35 @@ struct fwdMuonsUPC { // compute phi for azimuth anisotropy float phiAverage = 0; float phiCharge = 0; - computePhiAnis(p1, p2, McPart1.pdgCode(), phiAverage, phiCharge); + computePhiAnis(p1, p2, -McPart1.pdgCode(), phiAverage, phiCharge); // fill the histos - McGenRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); - McGenRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); - McGenRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); - McGenRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); - McGenRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); - McGenRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); - McGenRegistry.fill(HIST("hMass"), p.M()); - McGenRegistry.fill(HIST("hPt"), p.Pt()); - McGenRegistry.fill(HIST("hEta"), p.Eta()); - McGenRegistry.fill(HIST("hRapidity"), p.Rapidity()); - McGenRegistry.fill(HIST("hPhi"), p.Phi()); - McGenRegistry.fill(HIST("hPhiAverage"), phiAverage); - McGenRegistry.fill(HIST("hPhiCharge"), phiCharge); + mcGenRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); + mcGenRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); + mcGenRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); + mcGenRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); + mcGenRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); + mcGenRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); + mcGenRegistry.fill(HIST("hMass"), p.M()); + mcGenRegistry.fill(HIST("hPt"), p.Pt()); + mcGenRegistry.fill(HIST("hEta"), p.Eta()); + mcGenRegistry.fill(HIST("hRapidity"), p.Rapidity()); + mcGenRegistry.fill(HIST("hPhi"), p.Phi()); + mcGenRegistry.fill(HIST("hPhiAverage"), phiAverage); + mcGenRegistry.fill(HIST("hPhiCharge"), phiCharge); + + // store the event to save it into a tree + if (McPart1.pdgCode() < 0) { + dimuGen(p.M(), p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + p2.Pt(), p2.PseudoRapidity(), p2.Phi()); + } else { + dimuGen(p.M(), p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + p1.Pt(), p1.PseudoRapidity(), p1.Phi()); + } } // function that processes MC reco candidates @@ -706,7 +743,7 @@ struct fwdMuonsUPC { // form Lorentz vectors TLorentzVector p1, p2; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); TLorentzVector p = p1 + p2; @@ -742,7 +779,7 @@ struct fwdMuonsUPC { // compute gen phi for azimuth anisotropy float phiGenAverage = 0; float phiGenCharge = 0; - computePhiAnis(p1, p2, McPart1.pdgCode(), phiGenAverage, phiGenCharge); + computePhiAnis(p1, p2, -McPart1.pdgCode(), phiGenAverage, phiGenCharge); // print info in case of problems if (tr1.sign() * McPart1.pdgCode() > 0 || tr2.sign() * McPart2.pdgCode() > 0) { @@ -754,48 +791,48 @@ struct fwdMuonsUPC { // fill the histos // reco info - McRecoRegistry.fill(HIST("hContrib"), cand.numContrib()); - McRecoRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); - McRecoRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); - McRecoRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); - McRecoRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); - McRecoRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); - McRecoRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); - McRecoRegistry.fill(HIST("hEvSign"), cand.netCharge()); - McRecoRegistry.fill(HIST("hMass"), p.M()); - McRecoRegistry.fill(HIST("hPt"), p.Pt()); - McRecoRegistry.fill(HIST("hPtFit"), p.Pt()); - McRecoRegistry.fill(HIST("hEta"), p.Eta()); - McRecoRegistry.fill(HIST("hRapidity"), p.Rapidity()); - McRecoRegistry.fill(HIST("hPhi"), p.Phi()); - McRecoRegistry.fill(HIST("hCharge"), tr1.sign()); - McRecoRegistry.fill(HIST("hCharge"), tr2.sign()); - McRecoRegistry.fill(HIST("hPhiAverage"), phiAverage); - McRecoRegistry.fill(HIST("hPhiCharge"), phiCharge); + mcRecoRegistry.fill(HIST("hContrib"), cand.numContrib()); + mcRecoRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); + mcRecoRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); + mcRecoRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); + mcRecoRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); + mcRecoRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); + mcRecoRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); + mcRecoRegistry.fill(HIST("hEvSign"), cand.netCharge()); + mcRecoRegistry.fill(HIST("hMass"), p.M()); + mcRecoRegistry.fill(HIST("hPt"), p.Pt()); + mcRecoRegistry.fill(HIST("hPtFit"), p.Pt()); + mcRecoRegistry.fill(HIST("hEta"), p.Eta()); + mcRecoRegistry.fill(HIST("hRapidity"), p.Rapidity()); + mcRecoRegistry.fill(HIST("hPhi"), p.Phi()); + mcRecoRegistry.fill(HIST("hCharge"), tr1.sign()); + mcRecoRegistry.fill(HIST("hCharge"), tr2.sign()); + mcRecoRegistry.fill(HIST("hPhiAverage"), phiAverage); + mcRecoRegistry.fill(HIST("hPhiCharge"), phiCharge); // gen info (of reco events) - McGenRegistry.fill(HIST("hPtTrkPos"), p1Mc.Pt()); - McGenRegistry.fill(HIST("hPtTrkNeg"), p2Mc.Pt()); - McGenRegistry.fill(HIST("hEtaTrkPos"), p1Mc.Eta()); - McGenRegistry.fill(HIST("hEtaTrkNeg"), p2Mc.Eta()); - McGenRegistry.fill(HIST("hPhiTrkPos"), p1Mc.Phi()); - McGenRegistry.fill(HIST("hPhiTrkNeg"), p2Mc.Phi()); - McGenRegistry.fill(HIST("hMass"), pMc.M()); - McGenRegistry.fill(HIST("hPt"), pMc.Pt()); - McGenRegistry.fill(HIST("hEta"), pMc.Eta()); - McGenRegistry.fill(HIST("hRapidity"), pMc.Rapidity()); - McGenRegistry.fill(HIST("hPhi"), pMc.Phi()); - McGenRegistry.fill(HIST("hPhiAverage"), phiGenAverage); - McGenRegistry.fill(HIST("hPhiCharge"), phiGenCharge); + mcGenRegistry.fill(HIST("hPtTrkPos"), p1Mc.Pt()); + mcGenRegistry.fill(HIST("hPtTrkNeg"), p2Mc.Pt()); + mcGenRegistry.fill(HIST("hEtaTrkPos"), p1Mc.Eta()); + mcGenRegistry.fill(HIST("hEtaTrkNeg"), p2Mc.Eta()); + mcGenRegistry.fill(HIST("hPhiTrkPos"), p1Mc.Phi()); + mcGenRegistry.fill(HIST("hPhiTrkNeg"), p2Mc.Phi()); + mcGenRegistry.fill(HIST("hMass"), pMc.M()); + mcGenRegistry.fill(HIST("hPt"), pMc.Pt()); + mcGenRegistry.fill(HIST("hEta"), pMc.Eta()); + mcGenRegistry.fill(HIST("hRapidity"), pMc.Rapidity()); + mcGenRegistry.fill(HIST("hPhi"), pMc.Phi()); + mcGenRegistry.fill(HIST("hPhiAverage"), phiGenAverage); + mcGenRegistry.fill(HIST("hPhiCharge"), phiGenCharge); // reco-gen correlations - McRecoRegistry.fill(HIST("hPtcorr"), p.Pt(), pMc.Pt()); - McRecoRegistry.fill(HIST("hRapcorr"), p.Eta(), pMc.Eta()); - McRecoRegistry.fill(HIST("hPhicorr"), p.Phi(), pMc.Phi()); + mcRecoRegistry.fill(HIST("hPtcorr"), p.Pt(), pMc.Pt()); + mcRecoRegistry.fill(HIST("hRapcorr"), p.Rapidity(), pMc.Rapidity()); + mcRecoRegistry.fill(HIST("hPhicorr"), p.Phi(), pMc.Phi()); // store the event to save it into a tree if (tr1.sign() > 0) { - dimuReco(p.Pt(), p.Rapidity(), p.Phi(), + dimuReco(p.M(), p.Pt(), p.Rapidity(), p.Phi(), phiAverage, phiCharge, p1.Pt(), p1.PseudoRapidity(), p1.Phi(), p2.Pt(), p2.PseudoRapidity(), p2.Phi(), @@ -804,7 +841,7 @@ struct fwdMuonsUPC { p1Mc.Pt(), p1Mc.PseudoRapidity(), p1Mc.Phi(), p2Mc.Pt(), p2Mc.PseudoRapidity(), p2Mc.Phi()); } else { - dimuReco(p.Pt(), p.Rapidity(), p.Phi(), + dimuReco(p.M(), p.Pt(), p.Rapidity(), p.Phi(), phiAverage, phiCharge, p2.Pt(), p2.PseudoRapidity(), p2.Phi(), p1.Pt(), p1.PseudoRapidity(), p1.Phi(), @@ -817,7 +854,7 @@ struct fwdMuonsUPC { // PROCESS FUNCTION void processData(CandidatesFwd const& eventCandidates, - o2::aod::UDZdcsReduced& ZDCs, + o2::aod::UDZdcsReduced const& ZDCs, ForwardTracks const& fwdTracks) { From 344730c49367572dd567207bdb17d6dd0bd8a824 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:23:44 +0100 Subject: [PATCH 08/91] [PWGJE,EMCAL-670] Add separate HG/LG cell time QC histos for time calib (#8769) Co-authored-by: Nicolas Strangmann --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 40 +++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index e14c347eb37..0a84a66b23b 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -183,6 +183,15 @@ struct EmcalCorrectionTask { LOG(debug) << "Completed init!"; + // Define the cell energy binning + std::vector cellEnergyBins; + for (int i = 0; i < 51; i++) + cellEnergyBins.emplace_back(0.1 * (i - 0) + 0.0); // from 0 to 5 GeV/c, every 0.1 GeV + for (int i = 51; i < 76; i++) + cellEnergyBins.emplace_back(0.2 * (i - 51) + 5.2); // from 5.2 to 10.0 GeV, every 0.2 GeV + for (int i = 76; i < 166; i++) + cellEnergyBins.emplace_back(1. * (i - 76) + 11.); // from 11.0 to 100. GeV, every 1 GeV + // Setup QA hists. // NOTE: This is not comprehensive. using o2HistType = o2::framework::HistType; @@ -195,7 +204,8 @@ struct EmcalCorrectionTask { mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis}); mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}}); mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, {200, 0., 20.}}); + mHistManager.add("hHGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) + mHistManager.add("hLGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) // NOTE: Reversed column and row because it's more natural for presentation. mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis}); @@ -276,7 +286,7 @@ struct EmcalCorrectionTask { } cellsBC.emplace_back(cell.cellNumber(), amplitude, - cell.time() + getCellTimeShift(cell.cellNumber(), amplitude), + cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType())), o2::emcal::intToChannelType(cell.cellType())); cellIndicesBC.emplace_back(cell.globalIndex()); } @@ -395,7 +405,7 @@ struct EmcalCorrectionTask { } cellsBC.emplace_back(cell.cellNumber(), amplitude, - cell.time() + getCellTimeShift(cell.cellNumber(), amplitude), + cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType())), o2::emcal::intToChannelType(cell.cellType())); cellIndicesBC.emplace_back(cell.globalIndex()); cellLabels.emplace_back(cell.mcParticleIds(), cell.amplitudeA()); @@ -497,7 +507,7 @@ struct EmcalCorrectionTask { for (auto& cell : cellsInBC) { cellsBC.emplace_back(cell.cellNumber(), cell.amplitude(), - cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude()), + cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude(), o2::emcal::intToChannelType(cell.cellType())), o2::emcal::intToChannelType(cell.cellType())); cellIndicesBC.emplace_back(cell.globalIndex()); } @@ -779,7 +789,10 @@ struct EmcalCorrectionTask { // For convenience, use the clusterizer stored geometry to get the eta-phi for (auto& cell : cellsBC) { mHistManager.fill(HIST("hCellE"), cell.getEnergy()); - mHistManager.fill(HIST("hCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); + if (cell.getLowGain()) + mHistManager.fill(HIST("hLGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); + else if (cell.getHighGain()) + mHistManager.fill(HIST("hHGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); mHistManager.fill(HIST("hCellTowerID"), cell.getTower()); auto res = mClusterizers.at(0)->getGeometry()->EtaPhiFromIndex(cell.getTower()); mHistManager.fill(HIST("hCellEtaPhi"), std::get<0>(res), TVector2::Phi_0_2pi(std::get<1>(res))); @@ -809,7 +822,7 @@ struct EmcalCorrectionTask { // Apply shift of the cell time in data and MC // In MC this has to be done to shift the cell time, which is not calibrated to 0 due to the flight time of the particles to the EMCal surface (~15ns) // In data this is done to correct for the time walk effect - float getCellTimeShift(const int16_t cellID, const float cellEnergy) + float getCellTimeShift(const int16_t cellID, const float cellEnergy, const o2::emcal::ChannelType_t cellType) { if (!applyCellTimeCorrection) { return 0.f; @@ -825,13 +838,18 @@ struct EmcalCorrectionTask { // Also smear the time to account for the broader time resolution in data than in MC timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods } else { // data - if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration timeshift = 0.; - else if (cellEnergy < 4.) // Low energy regime - timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods - else // High energy regime - timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else if (cellType == o2::emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies + if (cellEnergy < 4.) // Low energy regime + timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + else // Medium energy regime + timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else if (cellType == o2::emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies + timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), will be updated by LHC24aj input + } } + LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; return timeshift + timesmear; } From a5076558a682703270c6bd36d1ea80eec1e32b41 Mon Sep 17 00:00:00 2001 From: rolavick Date: Mon, 2 Dec 2024 18:54:40 +0100 Subject: [PATCH 09/91] [PWGUD] Update of personal task (#8768) Co-authored-by: ALICE Action Bot --- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 14 +- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 185 ++++++++++++++--------- 2 files changed, 120 insertions(+), 79 deletions(-) diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index d454cab0296..a6147089ecc 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -19,10 +19,6 @@ #include #include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - enum MyParticle { P_ELECTRON = 0, P_MUON = 1, @@ -160,6 +156,12 @@ int enumMyParticle(int valuePDG) } } +float pt(float px, float py) +// Just a simple function to return pt +{ + return std::sqrt(px * px + py * py); +} + float momentum(float px, float py, float pz) // Just a simple function to return momentum { @@ -219,7 +221,7 @@ int countPhysicalPrimary(Ps particles) // Function to loop over particles associated to a mcCollision and return total of physical primary particles { int nTotal = 0; - for (auto& particle : particles) { + for (const auto& particle : particles) { if (!particle.isPhysicalPrimary()) continue; nTotal++; @@ -232,7 +234,7 @@ int countParticlesWithoutMother(Ps particles) // Function to loop over particles associated to a mcCollision and return total of particles without mothers (hopely alternative to isPhysicalPrimary) { int nTotal = 0; - for (auto& particle : particles) { + for (const auto& particle : particles) { if (particle.has_mothers()) continue; nTotal++; diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 01e8f7a5d6a..5b80f5972ae 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -8,8 +8,8 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief +/// \file upcTauCentralBarrelRL.cxx +/// \brief Personal task to analyze tau events from UPC collisions /// \author Roman Lavicka, roman.lavicka@cern.ch /// \since 12.07.2022 @@ -40,8 +40,7 @@ // ROOT headers #include "TLorentzVector.h" -#include "TEfficiency.h" -#include "TF1.h" +#include "TPDGCode.h" using namespace o2; using namespace o2::framework; @@ -132,7 +131,7 @@ struct UpcTauCentralBarrelRL { ConfigurableAxis axisMomWide{"axisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"}; ConfigurableAxis axisMomSigned{"axisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"}; ConfigurableAxis axisPt{"axisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"}; - ConfigurableAxis axisPhi{"axisPhi", {64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}, "Azimuthal angle (a.y.)"}; + ConfigurableAxis axisPhi{"axisPhi", {64, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}, "Azimuthal angle (a.y.)"}; ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; @@ -644,7 +643,7 @@ struct UpcTauCentralBarrelRL { histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventSixTracks//hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventSixTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); @@ -670,6 +669,22 @@ struct UpcTauCentralBarrelRL { histos.add("Events/Truth/hNmuons", ";Number of muons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); histos.add("Events/Truth/hNpions", ";Number of pions in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); histos.add("Events/Truth/hNphysPartVsNwoutMotherParts", ";Number of physical primary particles (-);Number of particles without mother(-)", HistType::kTH2D, {confAxis.axisNparticles, confAxis.axisNparticles}); + histos.add("Tracks/Truth/hTauP", ";Tau #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hTauPt", ";Tau #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hTauPhi", ";Tau #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hTauEta", ";Tau #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/Truth/hElectronP", ";Electron #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hElectronPhi", ";Electron #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hElectronEta", ";Electron #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/Truth/hMuonP", ";Muon #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hMuonPt", ";Muon #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hMuonPhi", ";Muon #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hMuonEta", ";Muon #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/Truth/hPionP", ";Pion #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hPionPt", ";Pion #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hPionPhi", ";Pion #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hPionEta", ";Pion #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); } } // end init @@ -779,10 +794,10 @@ struct UpcTauCentralBarrelRL { if (eta(track.px(), track.py(), track.pz()) < -0.8 || eta(track.px(), track.py(), track.pz()) > 0.8) return false; // kPrimaryTracks - if (abs(track.dcaZ()) > 2.0) + if (std::abs(track.dcaZ()) > 2.0) return false; - float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f); - if (abs(track.dcaXY()) > maxDCA) + float maxDCA = 0.0105f + 0.0350f / std::pow(track.pt(), 1.1f); + if (std::abs(track.dcaXY()) > maxDCA) return false; // kQualityTrack // ITS @@ -876,8 +891,8 @@ struct UpcTauCentralBarrelRL { daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); mother = daug[0] + daug[1]; - pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfPions = pion[0] + pion[1]; if (cutTauEvent.cutOppositeCharge && (trkDaug1.sign() * trkDaug2.sign() > 0)) return false; @@ -998,11 +1013,11 @@ struct UpcTauCentralBarrelRL { daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); mother = daug[0] + daug[1]; - pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfPions = pion[0] + pion[1]; - muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kMuonPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfMuons = muon[0] + muon[1]; const auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()); if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { @@ -1614,10 +1629,10 @@ struct UpcTauCentralBarrelRL { const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kMuonPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { return; } @@ -2081,6 +2096,82 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Events/FIT/hTimeFV0AvsFT0A"))->Fill(reconstructedCollision.timeFV0A(), reconstructedCollision.timeFT0A()); } + void fillTruthHistograms(aod::UDMcParticles const& particles) + { + histos.get(HIST("Events/Truth/hCountCollisions"))->Fill(1); + histos.get(HIST("Events/Truth/hNparticles"))->Fill(particles.size()); + histos.get(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles)); + + int countElectrons = 0; + int countMuons = 0; + int countPions = 0; + + for (const auto& particle : particles) { + histos.get(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode()); + // if (!particle.isPhysicalPrimary()) continue; + if (particle.has_mothers()) + continue; + histos.get(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode()); + histos.get(HIST("Tracks/Truth/hTauPt"))->Fill(pt(particle.px(), particle.py())); + histos.get(HIST("Tracks/Truth/hTauP"))->Fill(momentum(particle.px(), particle.py(), particle.pz())); + histos.get(HIST("Tracks/Truth/hTauPhi"))->Fill(phi(particle.px(), particle.py())); + histos.get(HIST("Tracks/Truth/hTauEta"))->Fill(eta(particle.px(), particle.py(), particle.pz())); + const auto& daughters = particle.daughters_as(); + histos.get(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size()); + for (const auto& daughter : daughters) { + histos.get(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode()); + if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON) { + countElectrons++; + histos.get(HIST("Tracks/Truth/hElectronPt"))->Fill(pt(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hElectronP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz())); + histos.get(HIST("Tracks/Truth/hElectronPhi"))->Fill(phi(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hElectronEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz())); + } + if (enumMyParticle(daughter.pdgCode()) == P_MUON) { + countMuons++; + histos.get(HIST("Tracks/Truth/hMuonPt"))->Fill(pt(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hMuonP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz())); + histos.get(HIST("Tracks/Truth/hMuonPhi"))->Fill(phi(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hMuonEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz())); + } + if (enumMyParticle(daughter.pdgCode()) == P_PION) { + countPions++; + histos.get(HIST("Tracks/Truth/hPionPt"))->Fill(pt(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hPionP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz())); + histos.get(HIST("Tracks/Truth/hPionPhi"))->Fill(phi(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hPionEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz())); + } + } + } + + histos.get(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons); + histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); + histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); + + if (countElectrons == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); + if (countElectrons == 1 && countMuons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); + if (countElectrons == 1 && countPions == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); + if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); + if (countMuons == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); + if (countMuons == 1 && countPions == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); + if (countPions == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); + if (countPions == 4) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); + if (countPions == 3 && countElectrons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); + if (countPions == 3 && countMuons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); + if (countPions == 6) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); + } + void processDataDG(FullUDCollision const& reconstructedCollision, FullUDTracks const& reconstructedBarrelTracks) { @@ -2205,64 +2296,12 @@ struct UpcTauCentralBarrelRL { } if (doTruthHistos) { - histos.get(HIST("Events/Truth/hCountCollisions"))->Fill(1); - histos.get(HIST("Events/Truth/hNparticles"))->Fill(particles.size()); - histos.get(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles)); - - int countElectrons = 0; - int countMuons = 0; - int countPions = 0; - - for (const auto& particle : particles) { - histos.get(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode()); - // if (!particle.isPhysicalPrimary()) continue; - if (particle.has_mothers()) - continue; - histos.get(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode()); - const auto& daughters = particle.daughters_as(); - histos.get(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size()); - for (const auto& daughter : daughters) { - histos.get(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode()); - if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON) - countElectrons++; - if (enumMyParticle(daughter.pdgCode()) == P_MUON) - countMuons++; - if (enumMyParticle(daughter.pdgCode()) == P_PION) - countPions++; - } - } - - histos.get(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons); - histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); - histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); - - if (countElectrons == 2) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); - if (countElectrons == 1 && countMuons == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); - if (countElectrons == 1 && countPions == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); - if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); - if (countMuons == 2) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); - if (countMuons == 1 && countPions == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); - if (countPions == 2) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); - if (countPions == 4) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); - if (countPions == 3 && countElectrons == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); - if (countPions == 3 && countMuons == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); - if (countPions == 6) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); + fillTruthHistograms(particles); } } // end processMCgenDG - void processTestMC(FullMCSGUDCollision const& reconstructedCollision, + void processTestMC(FullMCUDCollision const& reconstructedCollision, FullMCUDTracks const& reconstructedBarrelTracks, aod::UDMcCollisions const&, aod::UDMcParticles const&) From d4b88adaec3d5eb6925a1db0f6984f0c2db54e0a Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Mon, 2 Dec 2024 19:50:08 +0100 Subject: [PATCH 10/91] [PWGCF] FemtoUniverse -- Add track-nucleus analysis. (#8767) --- PWGCF/FemtoUniverse/Tasks/CMakeLists.txt | 7 +- .../femtoUniversePairTaskTrackNucleus.cxx | 843 ++++++++++++++++++ ...iversePairTaskTrackTrackMultKtExtended.cxx | 112 +-- 3 files changed, 864 insertions(+), 98 deletions(-) create mode 100644 PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx diff --git a/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt b/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt index 7e82d3c4525..0a4682a7f7a 100644 --- a/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt @@ -29,6 +29,11 @@ o2physics_add_dpl_workflow(femtouniverse-pair-track-track-mult-kt-extended PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtouniverse-pair-track-nucleus + SOURCES femtoUniversePairTaskTrackNucleus.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtouniverse-pair-track-track-threedrelmom-mult-kt-extended SOURCES femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore @@ -92,4 +97,4 @@ o2physics_add_dpl_workflow(femtouniverse-efficiency-base o2physics_add_executable(femtouniverse-cutculator SOURCES femtoUniverseCutCulator.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx new file mode 100644 index 00000000000..4906ec103c0 --- /dev/null +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -0,0 +1,843 @@ +// Copyright 2019-2022 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file femtoUniversePairTaskTrackNucleus.cxx +/// \brief Tasks that reads the track tables used for the pairing and builds pairs of a track and a nucleus +/// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de +/// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de +/// \author Anton Riedel, TU München, anton.riedel@tum.de +/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch +/// \author Alicja Płachta, WUT Warsaw, alicja.plachta.stud@pw.edu.pl +/// \author Anna-Mariia Andrushko, WUT Warsaw, anna-mariia.andrushko@cern.ch + +#include +#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TDatabasePDG.h" +#include "ReconstructionDataFormats/PID.h" +#include "Common/DataModel/PIDResponse.h" + +#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h" + +using namespace o2; +using namespace o2::analysis::femtoUniverse; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +namespace +{ +static constexpr int nPart = 2; +static constexpr int nCuts = 5; +static const std::vector partNames{"Track", "Nucleus"}; +static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; +static const float cutsTable[nPart][nCuts]{{4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; +} // namespace + +struct femtoUniversePairTaskTrackNucleus { + + Service pdg; + + /// Selection part + + /// Table for both objects + struct : o2::framework::ConfigurableGroup { + Configurable IsKaonNsigma{"IsKaonNsigma", false, "Enable a strict cut selection for K+ and K-"}; + Configurable ConfNsigmaCombined{"ConfNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > ConfTOFpMin"}; + Configurable ConfNsigmaTPC{"ConfNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < ConfTOFpMin"}; + Configurable ConfTOFpMin{"ConfTOFpMin", 0.5f, "Min. momentum for which TOF is required for PID."}; + Configurable ConfEtaMax{"ConfEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; + + Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; + Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; + Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + } twoobjectsconfigs; + + /// Table for separate deuteron configurables + struct : o2::framework::ConfigurableGroup { + Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; + Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; + Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; + Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; + Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; + } deuteronconfigs; + + /// Table for linear cut for TPC Deuteron Sigma + struct : o2::framework::ConfigurableGroup { + Configurable ConfIsLine{"ConfIsLine", false, "Enable a separation line for clearer TPC Deuteron Sigma"}; + Configurable LinCutpLow{"LinCutpLow", 0.0f, "Lower limit of momentum for linear cut of TPC Deuteron Sigma"}; + Configurable LinCutpHigh{"LinCutpHigh", 1.4f, "Higher limit of momentum for linear cut of TPC Deuteron Sigma"}; + Configurable LinCutParA{"LinCutParA", -167.0f, "Parameter 'A' of a linear function 'y = A * x + B'"}; + Configurable LinCutParB{"B", 300.0f, "Parameter 'B' of a linear function 'y = A * x + B'"}; + } lincut; + + /// Table for polynomial 3 cut for TPC Deuteron Sigma + struct : o2::framework::ConfigurableGroup { + Configurable ConfIsPol{"ConfIsPol", false, "Enable a separation polynomial 3 curve for clearer TPC Deuteron Sigma"}; + Configurable PolCutParA{"PolCutParA", -52.2f, "Parameter 'A' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + Configurable PolCutParB{"PolCutParB", 357.7f, "Parameter 'B' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + Configurable PolCutParC{"PolCutParC", -834.7f, "Parameter 'C' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + Configurable PolCutParD{"PolCutParD", 705.8f, "Parameter 'D' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + } polcut; + + using FemtoFullParticles = soa::Join; + + // Filters for selection + Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twoobjectsconfigs.ConfEtaMax); // example filtering on configurable + using FilteredFemtoFullParticles = soa::Filtered; + // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this option + + SliceCache cache; + Preslice perCol = aod::femtouniverseparticle::fdCollisionId; + + /// Track + struct : o2::framework::ConfigurableGroup { + Configurable ConfPDGCodeTrack{"ConfPDGCodeTrack", 321, "Track -- PDG code"}; + // Configurable ConfCutTrack{"ConfCutTrack", 5542474, "Track -- Selection bit from cutCulator"}; + Configurable ConfPIDTrack{"ConfPIDTrack", 3, "Track -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> + Configurable ConfPtLowTrack{"ConfPtLowTrack", 0.14, "Lower pT limit for track"}; + Configurable ConfPtHighTrack{"ConfPtHighTrack", 1.5, "Higher pT limit for track"}; + Configurable ConfChargeTrack{"ConfChargeTrack", 1, "Track sign"}; // -1 means anti-particle + } trackfilter; + + /// Partition for track + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + + Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + + /// Histogramming for track + FemtoUniverseParticleHisto trackHistoTrack; + + /// Nucleus + struct : o2::framework::ConfigurableGroup { + Configurable ConfPDGCodeNucleus{"ConfPDGCodeNucleus", 1000010020, "Nucleus -- PDG code"}; + // Configurable ConfCutNucleus{"ConfCutNucleus", 5542474, "Nucleus -- Selection bit"}; + Configurable ConfPIDNucleus{"ConfPIDNucleus", 5, "Nucleus -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable ConfPtLowNucleus{"ConfPtLowNucleus", 0, "Lower pT limit for nucleus"}; + Configurable ConfPtHighNucleus{"ConfPtHighNucleus", 5, "Higher pT limit for nucleus"}; + Configurable ConfChargeNucleus{"ConfChargeNucleus", 1, "Nucleus sign"}; // -1 means anti-nucleus + } nucleusfilter; + + /// Partition for nucleus + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + + Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + + /// Histogramming for nucleus + FemtoUniverseParticleHisto trackHistoNucleus; + + /// Histogramming for Event + FemtoUniverseEventHisto eventHisto; + + /// The configurables need to be passed to an std::vector + int vPIDTrack, vPIDNucleus; + std::vector kNsigma; + + /// Event part + Configurable ConfV0MLow{"ConfV0MLow", 0.0, "Lower limit for V0M multiplicity"}; + Configurable ConfV0MHigh{"ConfV0MHigh", 25000.0, "Upper limit for V0M multiplicity"}; + Configurable ConfSphericityCutMin{"ConfSphericityCutMin", 0, "Min. sphericity"}; + Configurable ConfSphericityCutMax{"ConfSphericityCutMax", 3, "Max. sphericity"}; + + Filter collV0Mfilter = ((o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh)); + Filter colSpherfilter = ((o2::aod::femtouniversecollision::sphericity > ConfSphericityCutMin) && (o2::aod::femtouniversecollision::sphericity < ConfSphericityCutMax)); + // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twoobjectsconfigs.ConfEtaMax); // example filtering on configurable + + /// Particle part + ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + + /// Correlation part + ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 99999.f}, "Mixing bins -- multiplicity or centrality"}; // \todo to be obtained from the hash task + ConfigurableAxis ConfMultKstarBins{"ConfMultKstarBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 100.0f, 99999.f}, "Bins for kstar analysis in multiplicity or centrality bins (10 is maximum)"}; + ConfigurableAxis ConfKtKstarBins{"ConfKtKstarBins", {VARIABLE_WIDTH, 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 2.0f, 99999.f}, "Bins for kstar analysis in kT bins (10 is maximum)"}; + ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins -- z-vertex"}; + + ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis ConfmultBins3D{"ConfmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + + ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; + + ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; + Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; + Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; + Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + + Configurable IsPairIdentical{"IsPairIdentical", true, "'true' for identical particles, 'false' for non-identical particles"}; + Configurable cfgProcessPM{"cfgProcessPM", true, "Process differently charged particles (plus-minus)"}; + Configurable cfgProcessPP{"cfgProcessPP", true, "Process positively charged particles (plus-plus)"}; + Configurable cfgProcessMM{"cfgProcessMM", true, "Process negatively charged particles (minus-minus)"}; + Configurable cfgProcessMultBins{"cfgProcessMultBins", true, "Process kstar histograms (in multiplicity bins)"}; + Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if 'cfgProcessMultBins' is false, it will not be processed regardless of 'cfgProcessKtBins' state)"}; + Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and MultBins"}; + + FemtoUniverseFemtoContainer sameEventCont; + FemtoUniverseFemtoContainer mixedEventCont; + + FemtoUniverseFemtoContainer sameEventContPP; + FemtoUniverseFemtoContainer mixedEventContPP; + + FemtoUniverseFemtoContainer sameEventContMM; + FemtoUniverseFemtoContainer mixedEventContMM; + + FemtoUniversePairCleaner pairCleaner; + FemtoUniverseDetaDphiStar pairCloseRejection; + FemtoUniverseTrackSelection trackCuts; + + PairWithCentMultKt sameEventMultCont; + PairWithCentMultKt mixedEventMultCont; + + PairWithCentMultKt sameEventMultContPP; + PairWithCentMultKt mixedEventMultContPP; + + PairWithCentMultKt sameEventMultContMM; + PairWithCentMultKt mixedEventMultContMM; + + float mass1 = -1; + float mass2 = -1; + + /// Histogram output + HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryPM{"CorrelationsPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryPP{"CorrelationsPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryMM{"CorrelationsMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + + HistogramRegistry SameMultRegistryPM{"SameMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryPM{"MixedMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry SameMultRegistryPP{"SameMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryPP{"MixedMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry SameMultRegistryMM{"SameMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryMM{"MixedMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry sphericityRegistry{"SphericityHisto", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + /// TPC Pion/Kaon/Proton Sigma selection (general) + bool IsNSigma(float mom, float nsigmaTPC, float nsigmaTOF) + { + // |nsigma_TPC| < 3 for p < 0.5 GeV/c + // |nsigma_combined| < 3 for p > 0.5 + + // using configurables: + // ConfTOFpMin -- momentum value when we start using TOF; set to 1000 if TOF not needed + // ConfNsigmaTPC -> TPC Sigma for momentum < ConfTOFpMin + // ConfNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > ConfTOFpMin + + if (mom < twoobjectsconfigs.ConfTOFpMin) { + return TMath::Abs(nsigmaTPC) < twoobjectsconfigs.ConfNsigmaTPC; + } else { + return TMath::Hypot(nsigmaTOF, nsigmaTPC) < twoobjectsconfigs.ConfNsigmaCombined; + } + } + + /// TPC Kaon Sigma selection (stricter cuts for K+ and K-) -- based on Run2 results + bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + { + if (twoobjectsconfigs.IsKaonNsigma == true) { + if (mom < 0.4) { + return TMath::Abs(nsigmaTPCK) < 2; + } else if (mom > 0.4 && mom < 0.45) { + return TMath::Abs(nsigmaTPCK) < 1; + } else if (mom > 0.45 && mom < 0.8) { + return (TMath::Abs(nsigmaTPCK) < 3 && TMath::Abs(nsigmaTOFK) < 2); + } else if (mom > 0.8 && mom < 1.5) { + return (TMath::Abs(nsigmaTPCK) < 3 && TMath::Abs(nsigmaTOFK) < 1.5); + } else { + return false; + } + } else { + return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); + } + } + + /// TPC Deuteron Sigma selection + bool IsDeuteronNSigma(float mom, float nsigmaTPCDe, float nsigmaTOFDe) + { + if (mom > deuteronconfigs.ConfPLowDe && mom < deuteronconfigs.ConfPHighDe) { + if (mom < deuteronconfigs.ConfTOFpMinDe) { + return (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe); + } else { + return (TMath::Abs(nsigmaTOFDe) < deuteronconfigs.ConfNsigmaTOFDe && (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe)); + } + } else { + return false; + } + } + + /// Linear cut for clearer TPC Deuteron Sigma + bool IsDeuteronNSigmaLinearCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + { + if (lincut.ConfIsLine == true) { + if (mom > lincut.LinCutpLow && mom < lincut.LinCutpHigh) { + if (tpcSignal > lincut.LinCutParA * mom + lincut.LinCutParB) { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } else { + return false; + } + } else { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } + } else { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } + } + + /// Polynomial 3 cut for clearer TPC Deuteron Sigma + bool IsDeuteronNSigmaPolCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + { + if (polcut.ConfIsPol == true) { + if (tpcSignal > polcut.PolCutParA * TMath::Power(mom, 3) + polcut.PolCutParB * TMath::Power(mom, 2) + polcut.PolCutParC * mom + polcut.PolCutParD) { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } else { + return false; + } + } else { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } + } + + bool IsParticleNSigma(int8_t object_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + { + if (object_number == 1) { + switch (trackfilter.ConfPDGCodeTrack) { + case 2212: // Proton + case -2212: // Anti-proton + return IsNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + break; + case 211: // Pion+ + case -211: // Pion- + case 111: // Pion 0 + return IsNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + break; + case 321: // Kaon+ + case -321: // Kaon- + return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 130: // Kaon 0 LONG + case 310: // Kaon 0 SHORT + return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 1000010020: // Deuteron + case -1000010020: // Anti-deuteron + return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); + break; + default: + return false; + } + return false; + } else if (object_number == 2) { + switch (nucleusfilter.ConfPDGCodeNucleus) { + case 2212: // Proton + case -2212: // Anti-proton + return IsNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + break; + case 211: // Pion+ + case -211: // Pion- + case 111: // Pion 0 + return IsNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + break; + case 321: // Kaon+ + case -321: // Kaon- + return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 130: // Kaon 0 LONG + case 310: // Kaon 0 SHORT + return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 1000010020: // Deuteron + case -1000010020: // Anti-deuteron + return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); + break; + default: + return false; + } + return false; + } else { + LOGF(fatal, "Wrong number of objects chosen! It should be 1 or 2. It is -> %d", object_number); + } + return false; + } + + void init(InitContext&) + { + eventHisto.init(&qaRegistry); + sphericityRegistry.add("sphericity", ";Sphericity;Entries", kTH1F, {{150, 0.0, 3, "Sphericity"}}); + + trackHistoTrack.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, twoobjectsconfigs.ConfIsMC, trackfilter.ConfPDGCodeTrack, true); + + trackHistoNucleus.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, twoobjectsconfigs.ConfIsMC, nucleusfilter.ConfPDGCodeNucleus, true); + + MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + + mass1 = pdg->Mass(trackfilter.ConfPDGCodeTrack); + mass2 = pdg->Mass(nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessPM) { + sameEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + + sameEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultCont.init(&SameMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultCont.init(&MixedMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + if (cfgProcessPP) { + sameEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + sameEventContPP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContPP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContPP.init(&SameMultRegistryPP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContPP.init(&MixedMultRegistryPP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + if (cfgProcessMM) { + sameEventContMM.init(&resultRegistryMM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContMM.init(&resultRegistryMM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + sameEventContMM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContMM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContMM.init(&SameMultRegistryMM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContMM.init(&MixedMultRegistryMM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + pairCleaner.init(&qaRegistry); + if (ConfIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + } + + vPIDTrack = trackfilter.ConfPIDTrack.value; + vPIDNucleus = nucleusfilter.ConfPIDNucleus.value; + kNsigma = twoobjectsconfigs.ConfTrkPIDnSigmaMax.value; + } + + template + void fillCollision(CollisionType col) + { + MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multV0M()})); + eventHisto.fillQA(col); + } + + /// This function processes 'same event' and takes care of all the histogramming + /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... + /// \tparam PartitionType + /// \tparam PartType + /// \tparam isMC: enables Monte Carlo truth specific histograms + /// \param groupTrack partition for track passed by the process function + /// \param groupNucleus partition for nucleus passed by the process function + /// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) + /// \param magFieldTesla magnetic field of the collision + /// \param multCol multiplicity of the collision + /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) + /// \param fillQA enables filling of QA histograms + template + void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool fillQA) + { + /// Histogramming SameEvent + if ((pairType == 1 || pairType == 2) && fillQA) { + for (auto& part : groupTrack) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; + } + trackHistoTrack.fillQA(part); + } + } + + if ((pairType == 1 || pairType == 3) && fillQA) { + for (auto& part : groupNucleus) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; + } + trackHistoNucleus.fillQA(part); + } + } + + if (pairType == 1) { + /// Combinations for non-identical pairs + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { + + if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } + + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } + + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + continue; + } + } + + // Cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + sameEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultCont.fill(kstar, multCol, kT); + } + } else { + /// Combinations for identical pairs + for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupTrack, groupTrack))) { + + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } + + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } + + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + continue; + } + } + + // Cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + + switch (pairType) { + case 2: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); + + sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContPP.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContPP.fill(kstar, multCol, kT); + } + + break; + } + + case 3: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + + sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContMM.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContMM.fill(kstar, multCol, kT); + } + + break; + } + + default: + break; + } + } + } + } + + /// Process function to call doSameEvent with Data + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoUniverseParticleTable + void processSameEvent(soa::Filtered::iterator& col, + FilteredFemtoFullParticles& parts) + { + fillCollision(col); + sphericityRegistry.fill(HIST("sphericity"), col.sphericity()); + + auto thegroupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + bool fillQA = true; + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + fillQA = false; + } + + if (cfgProcessPP) + doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEvent, "Enable processing same event", true); + + /// Process function to call doSameEvent with Monte Carlo + /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth + /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo Truth table + void processSameEventMC(o2::aod::FDCollision& col, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + fillCollision(col); + + auto thegroupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + bool fillQA = true; + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + fillQA = false; + } + + if (cfgProcessPP) + doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEventMC, "Enable processing same event for Monte Carlo", false); + + /// This function processes 'mixed event' + /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... + /// \tparam PartitionType + /// \tparam PartType + /// \tparam isMC: enables Monte Carlo truth specific histograms + /// \param groupTrack partition for track passed by the process function + /// \param groupNucleus partition for nucleus passed by the process function + /// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) + /// \param magFieldTesla magnetic field of the collision + /// \param multCol multiplicity of the collision + /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) + template + void doMixedEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType) + { + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { + + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } + + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } + + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + continue; + } + } + + switch (pairType) { + case 1: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultCont.fill(kstar, multCol, kT); + + break; + } + + case 2: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); + + mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContPP.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContPP.fill(kstar, multCol, kT); + } + + break; + } + + case 3: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + + mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContMM.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContMM.fill(kstar, multCol, kT); + } + + break; + } + + default: + break; + } + } + } + + /// Process function to call doMixedEvent with Data + /// \param cols subscribe to the collisions table (Data) + /// \param parts subscribe to the femtoUniverseParticleTable + void processMixedEvent(soa::Filtered& cols, + FilteredFemtoFullParticles& parts) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + + const int multiplicityCol = collision1.multV0M(); + MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + + if (magFieldTesla1 != magFieldTesla2) { + continue; + } + + if (cfgProcessPM) { + auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); + } + + if (cfgProcessPP) { + auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + } + + if (cfgProcessMM) { + auto groupTrack = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processMixedEvent, "Enable processing mixed events", true); + + /// Process function to call doMixedEvent with Monte Carlo + /// \param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth + /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table + void processMixedEventMC(o2::aod::FDCollisions& cols, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + + const int multiplicityCol = collision1.multV0M(); + MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + + if (magFieldTesla1 != magFieldTesla2) { + continue; + } + /// \todo before mixing we should check whether both collisions contain a pair of particles! + // if (partsOne.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTwo.size() == 0 ) continue; + + if (cfgProcessPM) { + auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); + } + + if (cfgProcessPP) { + auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + } + + if (cfgProcessMM) { + auto groupTrack = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processMixedEventMC, "Enable processing mixed events MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + + return workflow; +} diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index f7f9baa6d87..41bbc51b54e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -77,33 +77,6 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; } twotracksconfigs; - /// Table for separate deuteron configurables - struct : o2::framework::ConfigurableGroup { - Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; - Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; - Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; - Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; - Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; - } deuteronconfigs; - - /// Table for linear cut for TPC Deuteron Sigma - struct : o2::framework::ConfigurableGroup { - Configurable ConfIsLine{"ConfIsLine", false, "Enable a separation line for clearer TPC Deuteron Sigma"}; - Configurable pLow{"pLow", 0.0f, "Lower limit of momentum for linear cut of TPC Deuteron Sigma"}; - Configurable pHigh{"pHigh", 1.4f, "Higher limit of momentum for linear cut of TPC Deuteron Sigma"}; - Configurable a{"a", -167.0f, "Parameter 'a' of a linear function 'y = a * x + b'"}; - Configurable b{"b", 300.0f, "Parameter 'b' of a linear function 'y = a * x + b'"}; - } lincut; - - /// Table for polynomial 3 cut for TPC Deuteron Sigma - struct : o2::framework::ConfigurableGroup { - Configurable ConfIsPol{"ConfIsPol", false, "Enable a separation polynomial 3 curve for clearer TPC Deuteron Sigma"}; - Configurable A{"A", -52.2f, "Parameter 'A' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - Configurable B{"B", 357.7f, "Parameter 'B' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - Configurable C{"C", -834.7f, "Parameter 'C' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - Configurable D{"D", 705.8f, "Parameter 'D' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - } polcut; - using FemtoFullParticles = soa::Join; // Filters for selecting particles (both p1 and p2) Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable @@ -118,15 +91,15 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 211, "Particle 1 -- PDG code"}; // Configurable ConfCutPartOne{"ConfCutPartOne", 5542474, "Particle 1 -- Selection bit from cutCulator"}; Configurable ConfPIDPartOne{"ConfPIDPartOne", 2, "Particle 1 -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> - Configurable ConfPtLowPart1{"ConfPtLowPart1", 0.14, "Lower limit for Pt for the first particle"}; + Configurable ConfpLowPart1{"ConfpLowPart1", 0.14, "Lower limit for Pt for the first particle"}; Configurable ConfPtHighPart1{"ConfPtHighPart1", 1.5, "Higher limit for Pt for the first particle"}; Configurable ConfChargePart1{"ConfChargePart1", 1, "Particle 1 sign"}; } trackonefilter; /// Partition for particle 1 - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfPtLowPart1; + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfpLowPart1; - Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfPtLowPart1; + Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfpLowPart1; /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartOne; @@ -136,15 +109,15 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 211, "Particle 2 -- PDG code"}; // Configurable ConfCutPartTwo{"ConfCutPartTwo", 5542474, "Particle 2 -- Selection bit"}; Configurable ConfPIDPartTwo{"ConfPIDPartTwo", 2, "Particle 2 -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> - Configurable ConfPtLowPart2{"ConfPtLowPart2", 0.14, "Lower limit for Pt for the second particle"}; + Configurable ConfpLowPart2{"ConfpLowPart2", 0.14, "Lower limit for Pt for the second particle"}; Configurable ConfPtHighPart2{"ConfPtHighPart2", 1.5, "Higher limit for Pt for the second particle"}; Configurable ConfChargePart2{"ConfChargePart2", -1, "Particle 2 sign"}; } tracktwofilter; /// Partition for particle 2 - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfPtLowPart2; + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfpLowPart2; - Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfPtLowPart2; + Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfpLowPart2; /// Histogramming for particle 2 FemtoUniverseParticleHisto trackHistoPartTwo; @@ -283,53 +256,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { } } - /// TPC Deuteron Sigma selection - bool IsDeuteronNSigma(float mom, float nsigmaTPCDe, float nsigmaTOFDe) - { - if (mom > deuteronconfigs.ConfPLowDe && mom < deuteronconfigs.ConfPHighDe) { - if (mom < deuteronconfigs.ConfTOFpMinDe) { - return TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe; - } else { - return (TMath::Abs(nsigmaTOFDe) < deuteronconfigs.ConfNsigmaTOFDe && (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe)); - } - } else { - return false; - } - } - - /// Linear cut for clearer TPC Deuteron Sigma - bool IsDeuteronNSigmaLinearCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) - { - if (lincut.ConfIsLine == true) { - if (mom > lincut.pLow && mom < lincut.pHigh) { - if (tpcSignal > lincut.a * mom + lincut.b) { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } else { - return false; - } - } else { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } - } else { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } - } - - /// Polynomial 3 cut for clearer TPC Deuteron Sigma - bool IsDeuteronNSigmaPolCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) - { - if (polcut.ConfIsPol == true) { - if (tpcSignal > polcut.A * TMath::Power(mom, 3) + polcut.B * TMath::Power(mom, 2) + polcut.C * mom + polcut.D) { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } else { - return false; - } - } else { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } - } - - bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { if (particle_number == 1) { switch (trackonefilter.ConfPDGCodePartOne) { @@ -350,10 +277,6 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { case 310: // Kaon 0 SHORT return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; - case 1000010020: // Deuteron+ - case -1000010020: // Deuteron- - return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); - break; default: return false; } @@ -377,11 +300,6 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { case 310: // Kaon 0 SHORT return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; - case 1000010020: // Deuteron+ - case -1000010020: // Deuteron- - return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); - break; - default: return false; } return false; @@ -479,7 +397,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// Histogramming same event if ((pairType == 1 || pairType == 2) && fillQA) { for (auto& part : groupPartsOne) { - if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { continue; } trackHistoPartOne.fillQA(part); @@ -488,7 +406,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { if ((pairType == 1 || pairType == 3) && fillQA) { for (auto& part : groupPartsTwo) { - if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { continue; } trackHistoPartTwo.fillQA(part); @@ -500,11 +418,11 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// Now build the combinations for non-identical particle pairs for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } @@ -530,11 +448,11 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// Now build the combinations for identical particles pairs for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsOne))) { - if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } @@ -663,11 +581,11 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } From 4e9711ed818f9c9ffe2ed1b18c50bf8528b51521 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 2 Dec 2024 19:56:37 +0100 Subject: [PATCH 11/91] [Common] centrality study update (#8773) Co-authored-by: ALICE Builder --- Common/Tasks/centralityStudy.cxx | 91 +++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 7 deletions(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 1ce0eb39680..bcb714d2a87 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -35,6 +35,11 @@ struct centralityStudy { // Configurables Configurable do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsCentrality2d{"doOccupancyStudyVsCentrality2d", true, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsRawValues2d{"doOccupancyStudyVsRawValues2d", true, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsCentrality3d{"doOccupancyStudyVsCentrality3d", false, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsRawValues3d{"doOccupancyStudyVsRawValues3d", false, "0 - no, 1 - yes"}; + Configurable doNGlobalTracksVsRawSignals{"doNGlobalTracksVsRawSignals", true, "0 - no, 1 - yes"}; Configurable applySel8{"applySel8", true, "0 - no, 1 - yes"}; Configurable applyVtxZ{"applyVtxZ", true, "0 - no, 1 - yes"}; @@ -88,6 +93,9 @@ struct centralityStudy { ConfigurableAxis axisMultPVContributors{"axisMultPVContributors", {200, 0, 6000}, "Number of PV Contributors"}; ConfigurableAxis axisMultGlobalTracks{"axisMultGlobalTracks", {500, 0, 5000}, "Number of global tracks"}; + ConfigurableAxis axisTrackOccupancy{"axisTrackOccupancy", {50, 0, 5000}, "Track occupancy"}; + ConfigurableAxis axisFT0COccupancy{"axisFT0COccupancy", {50, 0, 80000}, "FT0C occupancy"}; + // For one-dimensional plots, where binning is no issue ConfigurableAxis axisMultUltraFineFV0A{"axisMultUltraFineFV0A", {60000, 0, 60000}, "FV0A amplitude"}; ConfigurableAxis axisMultUltraFineFT0M{"axisMultUltraFineFT0M", {50000, 0, 200000}, "FT0M amplitude"}; @@ -144,21 +152,16 @@ struct centralityStudy { histos.add("hFT0C_BCs", "hFT0C_BCs", kTH1D, {axisMultUltraFineFT0C}); histos.add("hFT0M_BCs", "hFT0M_BCs", kTH1D, {axisMultUltraFineFT0M}); histos.add("hFV0A_BCs", "hFV0A_BCs", kTH1D, {axisMultUltraFineFV0A}); - histos.add("hFT0CvsPVz_BCs_All", "hFT0CvsPVz_BCs_All", kTProfile, {axisPVz}); histos.add("hFT0CvsPVz_BCs", "hFT0CvsPVz_BCs", kTProfile, {axisPVz}); - histos.add("hVertexZ_BCvsCO", "hVertexZ_BCvsCO", kTH2D, {axisPVz, axisPVz}); - histos.add("hZNAvsFT0C_BCs", "hZNAvsFT0C_BCs", kTH2D, {axisMultFT0C, axisZN}); histos.add("hZNCvsFT0C_BCs", "hZNCvsFT0C_BCs", kTH2D, {axisMultFT0C, axisZN}); } if (do2DPlots) { histos.add("hNContribsVsFT0C", "hNContribsVsFT0C", kTH2F, {axisMultFT0C, axisMultPVContributors}); - histos.add("hNGlobalTracksVsFT0C", "hNGlobalTracksVsFT0C", kTH2F, {axisMultFT0C, axisMultGlobalTracks}); histos.add("hNContribsVsFV0A", "hNContribsVsFV0A", kTH2F, {axisMultFV0A, axisMultPVContributors}); - histos.add("hNGlobalTracksVsFV0A", "hNGlobalTracksVsFV0A", kTH2F, {axisMultFV0A, axisMultGlobalTracks}); histos.add("hMatchedVsITSOnly", "hMatchedVsITSOnly", kTH2F, {axisMultITSOnly, axisMultITSTPC}); // 2d correlation of fit signals @@ -168,6 +171,30 @@ struct centralityStudy { histos.add("hFDDCVsFT0C", "hFDDCVsFT0C", kTH2F, {axisMultFT0C, axisMultFDDC}); } + if (doNGlobalTracksVsRawSignals) { + histos.add("hNGlobalTracksVsFT0A", "hNGlobalTracksVsFT0A", kTH2F, {axisMultFT0A, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFT0C", "hNGlobalTracksVsFT0C", kTH2F, {axisMultFT0C, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFV0A", "hNGlobalTracksVsFV0A", kTH2F, {axisMultFV0A, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFDDA", "hNGlobalTracksVsFDDA", kTH2F, {axisMultFDDA, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFDDC", "hNGlobalTracksVsFDDC", kTH2F, {axisMultFDDC, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsZNA", "hNGlobalTracksVsZNA", kTH2F, {axisZN, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsZNC", "hNGlobalTracksVsZNC", kTH2F, {axisZN, axisMultGlobalTracks}); + } + + if (doOccupancyStudyVsRawValues2d) { + histos.add("hNcontribsProfileVsTrackOccupancyVsFT0C", "hNcontribsProfileVsTrackOccupancyVsFT0C", kTProfile2D, {axisTrackOccupancy, axisMultFT0C}); + histos.add("hNGlobalTracksProfileVsTrackOccupancyVsFT0C", "hNGlobalTracksProfileVsTrackOccupancyVsFT0C", kTProfile2D, {axisTrackOccupancy, axisMultFT0C}); + histos.add("hNcontribsProfileVsFT0COccupancyVsFT0C", "hNcontribsProfileVsFT0COccupancyVsFT0C", kTProfile2D, {axisFT0COccupancy, axisMultFT0C}); + histos.add("hNGlobalTracksProfileVsFT0COccupancyVsFT0C", "hNGlobalTracksProfileVsFT0COccupancyVsFT0C", kTProfile2D, {axisFT0COccupancy, axisMultFT0C}); + } + + if (doOccupancyStudyVsRawValues3d) { + histos.add("hTrackOccupancyVsNContribsVsFT0C", "hTrackOccupancyVsNContribsVsFT0C", kTH3F, {axisTrackOccupancy, axisMultPVContributors, axisMultFT0C}); + histos.add("hTrackOccupancyVsNGlobalTracksVsFT0C", "hTrackOccupancyVsNGlobalTracksVsFT0C", kTH3F, {axisTrackOccupancy, axisMultGlobalTracks, axisMultFT0C}); + histos.add("hFT0COccupancyVsNContribsVsFT0C", "hFT0COccupancyVsNContribsVsFT0C", kTH3F, {axisFT0COccupancy, axisMultPVContributors, axisMultFT0C}); + histos.add("hFT0COccupancyVsNGlobalTracksVsFT0C", "hFT0COccupancyVsNGlobalTracksVsFT0C", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisMultFT0C}); + } + if (doprocessCollisionsWithCentrality) { // in case requested: do vs centrality debugging histos.add("hCentrality", "hCentrality", kTH1F, {axisCentrality}); @@ -177,6 +204,20 @@ struct centralityStudy { histos.add("hNGlobalTracksVsCentrality", "hNGlobalTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors}); histos.add("hPVChi2VsCentrality", "hPVChi2VsCentrality", kTH2F, {axisCentrality, axisPVChi2}); histos.add("hDeltaTimeVsCentrality", "hDeltaTimeVsCentrality", kTH2F, {axisCentrality, axisDeltaTime}); + + if (doOccupancyStudyVsCentrality2d) { + histos.add("hNcontribsProfileVsTrackOccupancyVsCentrality", "hNcontribsProfileVsTrackOccupancyVsCentrality", kTProfile2D, {axisTrackOccupancy, axisCentrality}); + histos.add("hNGlobalTracksProfileVsTrackOccupancyVsCentrality", "hNGlobalTracksProfileVsTrackOccupancyVsCentrality", kTProfile2D, {axisTrackOccupancy, axisCentrality}); + histos.add("hNcontribsProfileVsFT0COccupancyVsCentrality", "hNcontribsProfileVsFT0COccupancyVsCentrality", kTProfile2D, {axisFT0COccupancy, axisCentrality}); + histos.add("hNGlobalTracksProfileVsFT0COccupancyVsCentrality", "hNGlobalTracksProfileVsFT0COccupancyVsCentrality", kTProfile2D, {axisFT0COccupancy, axisCentrality}); + } + + if (doOccupancyStudyVsCentrality3d) { + histos.add("hTrackOccupancyVsNContribsVsCentrality", "hTrackOccupancyVsNContribsVsCentrality", kTH3F, {axisTrackOccupancy, axisMultPVContributors, axisCentrality}); + histos.add("hTrackOccupancyVsNGlobalTracksVsCentrality", "hTrackOccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisTrackOccupancy, axisMultGlobalTracks, axisCentrality}); + histos.add("hFT0COccupancyVsNContribsVsCentrality", "hFT0COccupancyVsNContribsVsCentrality", kTH3F, {axisFT0COccupancy, axisMultPVContributors, axisCentrality}); + histos.add("hFT0COccupancyVsNGlobalTracksVsCentrality", "hFT0COccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisCentrality}); + } } } @@ -291,9 +332,7 @@ struct centralityStudy { } if (do2DPlots) { histos.fill(HIST("hNContribsVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multPVTotalContributors()); - histos.fill(HIST("hNGlobalTracksVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multNTracksGlobal()); histos.fill(HIST("hNContribsVsFV0A"), collision.multFV0A() * scaleSignalFV0A, collision.multPVTotalContributors()); - histos.fill(HIST("hNGlobalTracksVsFV0A"), collision.multFV0A() * scaleSignalFV0A, collision.multNTracksGlobal()); histos.fill(HIST("hMatchedVsITSOnly"), collision.multNTracksITSOnly(), collision.multNTracksITSTPC()); // correlate also FIT detector signals @@ -303,6 +342,30 @@ struct centralityStudy { histos.fill(HIST("hFDDCVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multFDDC()); } + if (doOccupancyStudyVsCentrality2d) { + histos.fill(HIST("hNcontribsProfileVsTrackOccupancyVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsTrackOccupancyVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNcontribsProfileVsFT0COccupancyVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsFT0COccupancyVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multFT0C(), collision.multNTracksGlobal()); + } + + if (doOccupancyStudyVsRawValues3d) { + histos.fill(HIST("hTrackOccupancyVsNContribsVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.multFT0C()); + histos.fill(HIST("hTrackOccupancyVsNGlobalTracksVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.multFT0C()); + histos.fill(HIST("hFT0COccupancyVsNContribsVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.multFT0C()); + histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.multFT0C()); + } + + if (doNGlobalTracksVsRawSignals) { + histos.fill(HIST("hNGlobalTracksVsFT0A"), collision.multFT0A(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFT0C"), collision.multFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFV0A"), collision.multFV0A(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFDDA"), collision.multFDDA(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFDDC"), collision.multFDDC(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsZNA"), collision.multZNA(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsZNC"), collision.multZNC(), collision.multNTracksGlobal()); + } + // if the table has centrality information if constexpr (requires { collision.centFT0C(); }) { // process FT0C centrality plots @@ -312,6 +375,20 @@ struct centralityStudy { histos.fill(HIST("hNITSOnlyTracksVsCentrality"), collision.centFT0C(), collision.multNTracksITSOnly()); histos.fill(HIST("hNGlobalTracksVsCentrality"), collision.centFT0C(), collision.multNTracksGlobal()); histos.fill(HIST("hPVChi2VsCentrality"), collision.centFT0C(), collision.multPVChi2()); + + if (doOccupancyStudyVsCentrality2d) { + histos.fill(HIST("hNcontribsProfileVsTrackOccupancyVsCentrality"), collision.trackOccupancyInTimeRange(), collision.centFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsTrackOccupancyVsCentrality"), collision.trackOccupancyInTimeRange(), collision.centFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNcontribsProfileVsFT0COccupancyVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.centFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsFT0COccupancyVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.centFT0C(), collision.multNTracksGlobal()); + } + + if (doOccupancyStudyVsCentrality3d) { + histos.fill(HIST("hTrackOccupancyVsNContribsVsCentrality"), collision.trackOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.centFT0C()); + histos.fill(HIST("hTrackOccupancyVsNGlobalTracksVsCentrality"), collision.trackOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C()); + histos.fill(HIST("hFT0COccupancyVsNContribsVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.centFT0C()); + histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C()); + } } } From 7789989623d0be0bb243d0bad1d740e8e0f5c879 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Mon, 2 Dec 2024 21:59:22 +0100 Subject: [PATCH 12/91] [Common,PWGLF] feat(nucleiSpectra): Add matching study histograms (#8775) --- Common/DataModel/PIDResponseITS.h | 6 ++++ PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 31 ++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/Common/DataModel/PIDResponseITS.h b/Common/DataModel/PIDResponseITS.h index 5ee5b386810..3b5e13d94fd 100644 --- a/Common/DataModel/PIDResponseITS.h +++ b/Common/DataModel/PIDResponseITS.h @@ -81,6 +81,12 @@ struct ITSResponse { return (average * coslInv - exp) / resolution; }; + template + static float nSigmaITS(const T& track) + { + return nSigmaITS(track.itsClusterSizes(), track.p(), track.eta()); + } + static void setParameters(float p0, float p1, float p2, float p0_Z2, float p1_Z2, float p2_Z2, float p0_res, float p1_res, float p2_res) { if (mIsInitialized) { diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index b0ae705f374..34429b2c053 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -35,6 +35,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/Core/PID/PIDTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" @@ -203,6 +204,7 @@ std::shared_ptr hGloTOFtracks[2]; std::shared_ptr hDeltaP[2][5]; std::shared_ptr hFlowHists[2][5]; std::shared_ptr hDCAHists[2][5]; +std::shared_ptr hMatchingStudy[2]; o2::base::MatLayerCylSet* lut = nullptr; std::vector candidates; @@ -463,6 +465,12 @@ struct nucleiSpectra { } } + if (doprocessMatching) { + for (int iC{0}; iC < 2; ++iC) { + nuclei::hMatchingStudy[iC] = spectra.add(fmt::format("hMatchingStudy{}", nuclei::matter[iC]).data(), ";#it{p}_{T};#phi;#eta;n#sigma_{ITS};n#sigma{TPC};n#sigma_{TOF}", HistType::kTHnSparseF, {{20, 1., 9.}, {10, 0., o2::constants::math::TwoPI}, {10, -1., 1.}, {50, -5., 5.}, {50, -5., 5.}, {50, 0., 1.}}); + } + } + nuclei::lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get("GLO/Param/MatLUT")); // TrackTuner initialization if (cfgUseTrackTuner) { @@ -890,6 +898,29 @@ struct nucleiSpectra { } } PROCESS_SWITCH(nucleiSpectra, processMC, "MC analysis", false); + + void processMatching(soa::Join::iterator const& collision, TrackCandidates const& tracks, aod::BCsWithTimestamps const&) + { + if (!eventSelection(collision)) { + return; + } + o2::aod::ITSResponse itsResponse; + for (auto& track : tracks) { + if (std::abs(track.eta()) > cfgCutEta || + track.itsNCls() < 7 || + track.itsChi2NCl() > 36.f || + itsResponse.nSigmaITS(track) < -1.) { + continue; + } + double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() * 2. / o2::constants::physics::MassHelium3), cfgBetheBlochParams->get(4, 0u), cfgBetheBlochParams->get(4, 1u), cfgBetheBlochParams->get(4, 2u), cfgBetheBlochParams->get(4, 3u), cfgBetheBlochParams->get(4, 4u))}; + double expSigma{expBethe * cfgBetheBlochParams->get(4, 5u)}; + double nSigmaTPC{(track.tpcSignal() - expBethe) / expSigma}; + int iC = track.signed1Pt() > 0; + nuclei::hMatchingStudy[iC]->Fill(track.pt() * 2, track.phi(), track.eta(), itsResponse.nSigmaITS(track), nSigmaTPC, o2::pid::tof::Beta::GetBeta(track)); + } + } + + PROCESS_SWITCH(nucleiSpectra, processMatching, "Matching analysis", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 670245b26d588a5ad32bc5f5fecd20064794e927 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Mon, 2 Dec 2024 22:30:04 +0100 Subject: [PATCH 13/91] [PWGHF] Add missing subscription to MC collisions (#8777) --- PWGHF/D2H/Tasks/taskD0.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index b1c9eb92bd2..f76d9d7bfb8 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -360,7 +360,8 @@ struct HfTaskD0 { void processMc(CandType const& candidates, soa::Join const& mcParticles, aod::TracksWMc const&, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const&) { // MC rec. for (const auto& candidate : candidates) { @@ -587,36 +588,40 @@ struct HfTaskD0 { void processMcWithDCAFitterN(D0CandidatesMc const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMc, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMc, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithDCAFitterN, "Process MC with DCAFitterN", false); void processMcWithKFParticle(D0CandidatesMcKF const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMcKF, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMcKF, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithKFParticle, "Process MC with KFParticle", false); void processMcWithDCAFitterNMl(D0CandidatesMlMc const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMlMc, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMlMc, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithDCAFitterNMl, "Process MC with DCAFitterN and ML selection", false); void processMcWithKFParticleMl(D0CandidatesMlMcKF const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMlMcKF, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMlMcKF, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithKFParticleMl, "Process MC with KFParticle and ML selections", false); }; From adc5c555d3c7e88dad76a3519618696c28146472 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:00:49 +0100 Subject: [PATCH 14/91] [PWGHF] task to calculate directed flow of Dstar (#8778) --- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index f2b768ab36b..a4d9b9fcfe1 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -43,10 +43,12 @@ using namespace o2::hf_evsel; enum DecayChannel { DplusToPiKPi = 0, D0ToPiK, - D0ToKPi }; + D0ToKPi, + DstarToD0Pi }; struct HfTaskDirectedFlowCharmHadrons { Configurable centEstimator{"centEstimator", 2, "Centrality estimation (FT0A: 1, FT0C: 2, FT0M: 3, FV0A: 4)"}; + Configurable selectionFlagDstar{"selectionFlagDstar", false, "Selection Flag for Dstar"}; Configurable selectionFlag{"selectionFlag", 1, "Selection Flag for hadron (e.g. 1 for skimming, 3 for topo. and kine., 7 for PID)"}; Configurable centralityMin{"centralityMin", 0., "Minimum centrality accepted in SP computation"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP computation"}; @@ -69,11 +71,14 @@ struct HfTaskDirectedFlowCharmHadrons { using CandDplusData = soa::Filtered>; using CandD0DataWMl = soa::Filtered>; using CandD0Data = soa::Filtered>; + using CandDstarDataWMl = soa::Filtered>; + using CandDstarData = soa::Filtered>; using CollsWithQvecs = soa::Join; using TracksWithExtra = soa::Join; Filter filterSelectDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlag; Filter filterSelectD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; + Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; Partition selectedD0ToPiK = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag; Partition selectedD0ToKPi = aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; @@ -92,7 +97,7 @@ struct HfTaskDirectedFlowCharmHadrons { { /// check process functions - std::array processes = {doprocessDplusStd, doprocessDplusMl, doprocessD0Std, doprocessD0Ml}; + std::array processes = {doprocessDplusStd, doprocessDplusMl, doprocessD0Std, doprocessD0Ml, doprocessDstarStd, doprocessDstarMl}; const int nProcesses = std::accumulate(processes.begin(), processes.end(), 0); if (nProcesses > 1) { LOGP(fatal, "Only one process function should be enabled at a time, please check your configuration"); @@ -203,6 +208,7 @@ struct HfTaskDirectedFlowCharmHadrons { for (const auto& candidate : candidates) { double massCand = 0.; double rapCand = 0.; + double signDstarCand = 0.0; std::vector outputMl = {-999., -999.}; if constexpr (std::is_same_v || std::is_same_v) { massCand = hfHelper.invMassDplusToPiKPi(candidate); @@ -230,6 +236,19 @@ struct HfTaskDirectedFlowCharmHadrons { default: break; } + } else if constexpr (std::is_same_v || std::is_same_v) { + signDstarCand = candidate.signSoftPi(); + if (candidate.signSoftPi() > 0) { + massCand = std::abs(candidate.invMassDstar() - candidate.invMassD0()); + rapCand = candidate.y(candidate.invMassDstar()); + } else if (candidate.signSoftPi() < 0) { + massCand = std::abs(candidate.invMassAntiDstar() - candidate.invMassD0Bar()); + rapCand = candidate.y(candidate.invMassAntiDstar()); + } + if constexpr (std::is_same_v) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + outputMl[iclass] = candidate.mlProbDstarToD0Pi()[classMl->at(iclass)]; + } } auto trackprong0 = candidate.template prong0_as(); @@ -244,6 +263,9 @@ struct HfTaskDirectedFlowCharmHadrons { if (userap) etaCand = rapCand; + if (selectionFlagDstar) + sign = signDstarCand; + auto ux = cosNPhi; // real part of candidate q vector auto uy = sinNPhi; // imaginary part of candidate q vector auto uxQxp = ux * qxZDCA; @@ -322,6 +344,24 @@ struct HfTaskDirectedFlowCharmHadrons { } PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processDplusStd, "Process Dplus candidates with rectangular cuts", true); + // Dstar with ML + void processDstarMl(CollsWithQvecs::iterator const& collision, + CandDstarDataWMl const& candidatesDstar, + TracksWithExtra const& tracks) + { + runFlowAnalysis(collision, candidatesDstar, tracks); + } + PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processDstarMl, "Process Dstar candidates with ML", false); + + // Dstar with rectangular cuts + void processDstarStd(CollsWithQvecs::iterator const& collision, + CandDstarData const& candidatesDstar, + TracksWithExtra const& tracks) + { + runFlowAnalysis(collision, candidatesDstar, tracks); + } + PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processDstarStd, "Process Dstar candidates with rectangular cuts", true); + }; // End struct HfTaskDirectedFlowCharmHadrons WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 10d37fe08d8559d902f23e508e4eb31da661e3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:48:28 +0100 Subject: [PATCH 15/91] [PWGHF] Use the Hf event selection for both tracks and charm hadrons (#8706) --- PWGHF/HFC/TableProducer/CMakeLists.txt | 2 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 88 ++++++++++++++----- PWGHF/Utils/utilsEvSelHf.h | 2 +- 3 files changed, 67 insertions(+), 25 deletions(-) diff --git a/PWGHF/HFC/TableProducer/CMakeLists.txt b/PWGHF/HFC/TableProducer/CMakeLists.txt index 2b01aad32c6..e3fc1bd5938 100644 --- a/PWGHF/HFC/TableProducer/CMakeLists.txt +++ b/PWGHF/HFC/TableProducer/CMakeLists.txt @@ -61,5 +61,5 @@ o2physics_add_dpl_workflow(correlator-lc-hadrons o2physics_add_dpl_workflow(femto-dream-producer SOURCES femtoDreamProducer.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 5328703d76c..3ed86b564cf 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -12,6 +12,7 @@ /// \file femtoDreamProducer.cxx /// \brief Tasks that produces the track tables used for the pairing /// \author Ravindra Singh, GSI, ravindra.singh@cern.ch +/// \author Biao Zhang, Heidelberg University, biao.zhang@cern.ch #include #include @@ -39,11 +40,25 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" +#include "PWGHF/Core/CentralityEstimation.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::femtoDream; +using namespace o2::hf_evsel; +using namespace o2::hf_centrality; + +// event types +enum Event : uint8_t { + kAll = 0, + kRejEveSel, + kRejNoTracksAndCharm, + kTrackSelected, + kCharmSelected, + kPairSelected +}; struct HfFemtoDreamProducer { @@ -69,19 +84,6 @@ struct HfFemtoDreamProducer { // Configurable isForceGRP{"isForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; - /// Event selection - // Configurable evtZvtx{"evtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - // Configurable evtTriggerCheck{"evtTriggerCheck", true, "Evt sel: check for trigger"}; - // Configurable evtTriggerSel{"evtTriggerSel", kINT7, "Evt sel: trigger"}; - // Configurable evtOfflineCheck{"evtOfflineCheck", false, "Evt sel: check for offline selection"}; - // Configurable evtAddOfflineCheck{"evtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; - - Configurable evtAddOfflineCheck{"evtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; - Configurable evtOfflineCheck{"evtOfflineCheck", false, "Evt sel: check for offline selection"}; - Configurable evtTriggerCheck{"evtTriggerCheck", true, "Evt sel: check for trigger"}; - Configurable evtTriggerSel{"evtTriggerSel", kINT7, "Evt sel: trigger"}; - Configurable evtZvtx{"evtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable isDebug{"isDebug", true, "Enable Debug tables"}; Configurable isRun3{"isRun3", true, "Running on Run3 or pilot"}; @@ -121,7 +123,6 @@ struct HfFemtoDreamProducer { using GeneratedMc = soa::Filtered>; - FemtoDreamCollisionSelection colCuts; FemtoDreamTrackSelection trackCuts; Filter filterSelectCandidateLc = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); @@ -130,6 +131,7 @@ struct HfFemtoDreamProducer { HistogramRegistry TrackRegistry{"Tracks", {}, OutputObjHandlingPolicy::AnalysisObject}; HfHelper hfHelper; + o2::hf_evsel::HfEventSelection hfEvSel; float magField; int runNumber; @@ -148,8 +150,21 @@ struct HfFemtoDreamProducer { int CutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType); TrackRegistry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); - colCuts.setCuts(evtZvtx.value, evtTriggerCheck.value, evtTriggerSel.value, evtOfflineCheck.value, evtAddOfflineCheck.value, isRun3.value); - colCuts.init(&qaRegistry); + // event QA histograms + constexpr int kEventTypes = kPairSelected + 1; + std::string labels[kEventTypes]; + labels[Event::kAll] = "All events"; + labels[Event::kRejEveSel] = "rejected by event selection"; + labels[Event::kRejNoTracksAndCharm] = "rejected by no tracks and charm"; + labels[Event::kTrackSelected] = "with tracks "; + labels[Event::kCharmSelected] = "with charm hadrons "; + labels[Event::kPairSelected] = "with pairs"; + + static const AxisSpec axisEvents = {kEventTypes, 0.5, kEventTypes + 0.5, ""}; + qaRegistry.add("hEventQA", "Events;;entries", HistType::kTH1F, {axisEvents}); + for (int iBin = 0; iBin < kEventTypes; iBin++) { + qaRegistry.get(HIST("hEventQA"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } trackCuts.setSelection(trkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); trackCuts.setSelection(trkPtmin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); @@ -175,6 +190,8 @@ struct HfFemtoDreamProducer { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); + hfEvSel.addHistograms(qaRegistry); // collision monitoring + int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); } @@ -335,8 +352,7 @@ struct HfFemtoDreamProducer { { const auto vtxZ = col.posZ(); const auto sizeCand = candidates.size(); - - const auto spher = colCuts.computeSphericity(col, tracks); + const auto spher = 2.; // dummy value for the moment float mult = 0; int multNtr = 0; if (isRun3) { @@ -351,15 +367,20 @@ struct HfFemtoDreamProducer { multNtr = col.multTracklets(); } - colCuts.fillQA(col, mult); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(col, mult, ccdb, qaRegistry); + + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kAll); - // check whether the basic event selection criteria are fulfilled - // that included checking if there is at least on usable track or V0 - if (!colCuts.isSelectedCollision(col)) { + /// monitor the satisfied event selections + hfEvSel.fillHistograms(col, rejectionMask, mult); + if (rejectionMask != 0) { + /// at least one event selection not satisfied --> reject the candidate + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kRejEveSel); return; } - if (colCuts.isEmptyCollision(col, tracks, trackCuts)) { + if (isNoSelectedTracks(col, tracks, trackCuts) && sizeCand <= 0) { + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kRejNoTracksAndCharm); return; } @@ -437,18 +458,39 @@ struct HfFemtoDreamProducer { aod::femtodreamcollision::BitMaskType bitTrack = 0; if (isTrackFilled) { bitTrack |= 1 << 0; + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kTrackSelected); } aod::femtodreamcollision::BitMaskType bitCand = 0; if (sizeCand > 0) { bitCand |= 1 << 0; + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kCharmSelected); } + if (isTrackFilled && (sizeCand > 0)) + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kPairSelected); + rowMasks(static_cast(bitTrack), static_cast(bitCand), 0); } + // check if there is no selected track + /// \param C type of the collision + /// \param T type of the tracks + /// \param TC type of the femto track cuts + /// \return whether or not the tracks fulfills the all selections + template + bool isNoSelectedTracks(C const& /*col*/, T const& tracks, TC& trackCuts) + { + for (auto const& track : tracks) { + if (trackCuts.isSelectedMinimal(track)) { + return false; + } + } + return true; + } + template void fillCharmHadMcGen(ParticleType particles) { diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 616608116bb..9382108dee3 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -106,7 +106,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useNoCollInRofStandard{"useNoCollInRofStandard", false, "Reject collisions in ROF standard"}; o2::framework::Configurable softwareTrigger{"softwareTrigger", "", "Label of software trigger. Multiple triggers can be selected dividing them by a comma. Set None if you want bcs that are not selected by any trigger"}; o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; - o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/", "ccdb path for ZORRO objects"}; + o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/Chunked/", "ccdb path for ZORRO objects"}; o2::framework::ConfigurableAxis th2ConfigAxisCent{"th2ConfigAxisCent", {100, 0., 100.}, ""}; o2::framework::ConfigurableAxis th2ConfigAxisOccupancy{"th2ConfigAxisOccupancy", {14, 0, 140000}, ""}; From e7e8d4829b9e302e16f96a5f831a3c6bbf54fe2d Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 3 Dec 2024 00:05:06 +0100 Subject: [PATCH 16/91] [PWGEM/Dilepton] update prefilter task for geom cut in ULS (#8782) --- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index 406f1b1d54c..a787d9acd6c 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -88,13 +88,14 @@ struct prefilterDielectron { DielectronCut fDielectronCut; struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected - Configurable cfg_max_mass{"cfg_max_mass", 0.02, "max mass for prefilter ULS"}; // region to be rejected - Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; // region to be rejected - Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected - - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; // region to be rejected + Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected + Configurable cfg_max_mass{"cfg_max_mass", 0.0, "max mass for prefilter ULS"}; // region to be rejected + Configurable cfg_apply_dzrdphi_geom_uls{"cfg_apply_dzrdphi_geom_uls", false, "flag to apply generator dz-rdphi elliptic cut in ULS"}; // region to be rejected + Configurable cfg_apply_dzrdphi_geom_ls{"cfg_apply_dzrdphi_geom_ls", false, "flag to apply generator dz-rdphi elliptic cut in LS"}; // region to be rejected + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + + Configurable cfg_apply_phiv{"cfg_apply_phiv", false, "flag to apply phiv cut"}; // region to be rejected Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; // region to be rejected Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; // region to be rejected Configurable cfg_min_phiv{"cfg_min_phiv", -1.f, "min phiv"}; // region to be rejected @@ -379,7 +380,7 @@ struct prefilterDielectron { continue; } - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom) { + if (dielectroncuts.cfg_x_to_go > 0.f && (dielectroncuts.cfg_apply_dzrdphi_geom_uls || dielectroncuts.cfg_apply_dzrdphi_geom_ls)) { propagateElectron(posTracks_per_coll); propagateElectron(negTracks_per_coll); } @@ -420,10 +421,10 @@ struct prefilterDielectron { map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); } - // if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - // map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - // map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - // } + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + } } for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ @@ -450,7 +451,7 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); } @@ -480,7 +481,7 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); } From 89c41afef56d826a58128fa0753859ed7df93878 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Tue, 3 Dec 2024 00:46:45 +0100 Subject: [PATCH 17/91] [PWGCF] DptDpt - Efficiency and QC - Fixing linter errors (#8783) Co-authored-by: Victor --- .../Tasks/CMakeLists.txt | 4 +- ...ncyAndQc.cxx => dptdptEfficiencyAndQc.cxx} | 456 +++++++++--------- 2 files changed, 232 insertions(+), 228 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{efficiencyAndQc.cxx => dptdptEfficiencyAndQc.cxx} (66%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 3d939cff243..bf93c33d24c 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -33,8 +33,8 @@ o2physics_add_dpl_workflow(identifiedbf-filter-qa PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(twopartcorr-efficiency-qc - SOURCES efficiencyAndQc.cxx +o2physics_add_dpl_workflow(dptdpt-efficiency-and-qc + SOURCES dptdptEfficiencyAndQc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx similarity index 66% rename from PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx index 60830fe414d..6d8bff1d6a0 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx @@ -9,6 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file dptdptEfficiencyAndQc.cxx +/// \brief Provides efficiency extraction and QC for track cuts and PID +/// \author victor.gonzalez.sebastian@gmail.com + #include #include #include @@ -103,63 +107,63 @@ struct QADataCollectingEngine { /* when two indexes, first index reco and detector level, second index generator level */ /* when no indexes, reco and detector level */ std::vector> fhPtB{2, nullptr}; - std::vector> fhPt_vs_EtaB{2, nullptr}; - std::vector> fhPt_vs_ZvtxB{2, nullptr}; + std::vector> fhPtVsEtaB{2, nullptr}; + std::vector> fhPtVsZvtxB{2, nullptr}; std::vector>> fhPtA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_ZvtxA{2, {nsp, nullptr}}; - std::shared_ptr fhPt_vs_EtaItsAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaTpcAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaItsTpcAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaItsTofAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaTpcTofAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaItsTpcTofAcc{nullptr}; - std::vector> fhPt_vs_EtaItsA{nsp, nullptr}; - std::vector> fhPt_vs_EtaTpcA{nsp, nullptr}; - std::vector> fhPt_vs_EtaItsTpcA{nsp, nullptr}; - std::vector> fhPt_vs_EtaItsTofA{nsp, nullptr}; - std::vector> fhPt_vs_EtaTpcTofA{nsp, nullptr}; - std::vector> fhPt_vs_EtaItsTpcTofA{nsp, nullptr}; + std::vector>> fhPtVsEtaA{2, {nsp, nullptr}}; + std::vector>> fhPtVsZvtxA{2, {nsp, nullptr}}; + std::shared_ptr fhPtVsEtaItsAcc{nullptr}; + std::shared_ptr fhPtVsEtaTpcAcc{nullptr}; + std::shared_ptr fhPtVsEtaItsTpcAcc{nullptr}; + std::shared_ptr fhPtVsEtaItsTofAcc{nullptr}; + std::shared_ptr fhPtVsEtaTpcTofAcc{nullptr}; + std::shared_ptr fhPtVsEtaItsTpcTofAcc{nullptr}; + std::vector> fhPtVsEtaItsA{nsp, nullptr}; + std::vector> fhPtVsEtaTpcA{nsp, nullptr}; + std::vector> fhPtVsEtaItsTpcA{nsp, nullptr}; + std::vector> fhPtVsEtaItsTofA{nsp, nullptr}; + std::vector> fhPtVsEtaTpcTofA{nsp, nullptr}; + std::vector> fhPtVsEtaItsTpcTofA{nsp, nullptr}; /* primaries and secondaries */ /* overall, first index detector level second index generator level */ /* detailed, first index detector level, second index associated particle */ std::shared_ptr fhPtPurityPosPrimA{nullptr}; std::shared_ptr fhPtPurityNegPrimA{nullptr}; - std::vector> fhPt_vs_EtaPrimA{nsp, nullptr}; - std::vector>> fhPt_vs_EtaPrimItsA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaPrimItsTpcA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaPrimItsTpcTofA{2, {nsp, nullptr}}; + std::vector> fhPtVsEtaPrimA{nsp, nullptr}; + std::vector>> fhPtVsEtaPrimItsA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaPrimItsTpcA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaPrimItsTpcTofA{2, {nsp, nullptr}}; std::shared_ptr fhPtPurityPosSecA{nullptr}; std::shared_ptr fhPtPurityNegSecA{nullptr}; - std::vector> fhPt_vs_EtaSecA{nsp, nullptr}; - std::vector>> fhPt_vs_EtaSecItsA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaSecItsTpcA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaSecItsTpcTofA{2, {nsp, nullptr}}; + std::vector> fhPtVsEtaSecA{nsp, nullptr}; + std::vector>> fhPtVsEtaSecItsA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaSecItsTpcA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaSecItsTpcTofA{2, {nsp, nullptr}}; std::shared_ptr fhPtPurityPosMatA{nullptr}; std::shared_ptr fhPtPurityNegMatA{nullptr}; - std::vector> fhPt_vs_EtaMatA{nsp, nullptr}; - std::vector>> fhPt_vs_EtaMatItsA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaMatItsTpcA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaMatItsTpcTofA{2, {nsp, nullptr}}; + std::vector> fhPtVsEtaMatA{nsp, nullptr}; + std::vector>> fhPtVsEtaMatItsA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaMatItsTpcA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaMatItsTpcTofA{2, {nsp, nullptr}}; /* QC histograms */ - std::shared_ptr fhITS_NCls_vs_PtB{nullptr}; - std::shared_ptr fhITS_Chi2NCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_FindableNCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_FoundNCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_SharedNCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_FractionSharedCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_CrossedRows_vs_PtB{nullptr}; - std::shared_ptr fhTPC_CrossedRowsOverFindableCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_Chi2NCls_vs_PtB{nullptr}; - std::vector> fhITS_NCls_vs_PtA{nsp, nullptr}; - std::vector> fhITS_Chi2NCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_FindableNCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_FoundNCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_SharedNCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_FractionSharedCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_CrossedRows_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_CrossedRowsOverFindableCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_Chi2NCls_vs_PtA{nsp, nullptr}; + std::shared_ptr fhItsNClsVsPtB{nullptr}; + std::shared_ptr fhItsChi2NClsVsPtB{nullptr}; + std::shared_ptr fhTpcFindableNClsVsPtB{nullptr}; + std::shared_ptr fhTpcFoundNClsVsPtB{nullptr}; + std::shared_ptr fhTpcSharedNClsVsPtB{nullptr}; + std::shared_ptr fhTpcFractionSharedClsVsPtB{nullptr}; + std::shared_ptr fhTpcCrossedRowsVsPtB{nullptr}; + std::shared_ptr fhTpcCrossedRowsOverFindableClsVsPtB{nullptr}; + std::shared_ptr fhTpcChi2NClsVsPtB{nullptr}; + std::vector> fhItsNClsVsPtA{nsp, nullptr}; + std::vector> fhItsChi2NClsVsPtA{nsp, nullptr}; + std::vector> fhTpcFindableNClsVsPtA{nsp, nullptr}; + std::vector> fhTpcFoundNClsVsPtA{nsp, nullptr}; + std::vector> fhTpcSharedNClsVsPtA{nsp, nullptr}; + std::vector> fhTpcFractionSharedClsVsPtA{nsp, nullptr}; + std::vector> fhTpcCrossedRowsVsPtA{nsp, nullptr}; + std::vector> fhTpcCrossedRowsOverFindableClsVsPtA{nsp, nullptr}; + std::vector> fhTpcChi2NClsVsPtA{nsp, nullptr}; template void init(HistogramRegistry& registry, const char* dirname) @@ -184,50 +188,50 @@ struct QADataCollectingEngine { /* the reconstructed and generated levels histograms */ std::string recogen = (kindOfData == kReco) ? "Reco" : "Gen"; fhPtB[kindOfData] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "Pt", "#it{p}_{T}", kTH1F, {ptAxis}); - fhPt_vs_EtaB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsEta", "#it{p}_T vs #eta", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_ZvtxB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsZvtx", "#it{p}_T vs #it{z}_{vtx}", kTH2F, {zvtxAxis, ptAxis}); + fhPtVsEtaB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsEta", "#it{p}_T vs #eta", kTH2F, {etaAxis, ptAxis}); + fhPtVsZvtxB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsZvtx", "#it{p}_T vs #it{z}_{vtx}", kTH2F, {zvtxAxis, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { fhPtA[kindOfData][isp] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("Pt_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} %s", tnames[isp].c_str()), kTH1F, {ptAxis}); - fhPt_vs_EtaA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsEta_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #eta %s", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_ZvtxA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsZvtx_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #it{z}_{zvtx} %s", tnames[isp].c_str()), kTH2F, {zvtxAxis, ptAxis}); + fhPtVsEtaA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsEta_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #eta %s", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsZvtxA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsZvtx_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #it{z}_{zvtx} %s", tnames[isp].c_str()), kTH2F, {zvtxAxis, ptAxis}); } if constexpr (kindOfData == kReco) { /* only the reconstructed level histograms*/ - fhITS_NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis}); - fhITS_Chi2NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis}); - fhTPC_FindableNCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFindableNCls", "TPC findable clusters", kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FoundNCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFoundNCls", "TPC found clusters", kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_SharedNCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCSharedNCls", "TPC shared clusters", kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FractionSharedCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFractionSharedCls", "TPC fraction shared clusters", kTH2F, {ptAxis, tpcFractionAxis}); - fhTPC_CrossedRows_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCXrows", "TPC crossed rows", kTH2F, {ptAxis, tpcNRowsAxis}); - fhTPC_CrossedRowsOverFindableCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "XRowsOverFindableCls", "TPC xrows over findable clusters", kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); - fhTPC_Chi2NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCChi2NCls", "TPC #Chi^{2}", kTH2F, {ptAxis, tpcCh2Axis}); + fhItsNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis}); + fhItsChi2NClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis}); + fhTpcFindableNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFindableNCls", "TPC findable clusters", kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFoundNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFoundNCls", "TPC found clusters", kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcSharedNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCSharedNCls", "TPC shared clusters", kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFractionSharedClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFractionSharedCls", "TPC fraction shared clusters", kTH2F, {ptAxis, tpcFractionAxis}); + fhTpcCrossedRowsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCXrows", "TPC crossed rows", kTH2F, {ptAxis, tpcNRowsAxis}); + fhTpcCrossedRowsOverFindableClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "XRowsOverFindableCls", "TPC xrows over findable clusters", kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); + fhTpcChi2NClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCChi2NCls", "TPC #Chi^{2}", kTH2F, {ptAxis, tpcCh2Axis}); /* efficiency histograms */ fhPvsInnerP = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "pVsInnerP", "#it{p} versus TPC inner wall #it{p}", kTH2F, {pidPAxis, pidPAxis}); - fhPt_vs_EtaItsAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsAcc", "ITS tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcAcc", "TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcAcc", "ITS&TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTofAcc", "ITS&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcTofAcc", "TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcTofAcc", "ITS&TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsAcc", "ITS tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcAcc", "TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcAcc", "ITS&TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTofAcc", "ITS&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcTofAcc", "TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcTofAcc", "ITS&TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { - fhITS_NCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSNCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsNClsAxis}); - fhITS_Chi2NCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsCh2Axis}); - fhTPC_FindableNCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFindableNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FoundNCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFoundNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC found clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_SharedNCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCSharedNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FractionSharedCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFractionSharedCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC fraction shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcFractionAxis}); - fhTPC_CrossedRows_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCXrows_%s", tnames[isp].c_str()), HTITLESTRING("TPC crossed rows %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNRowsAxis}); - fhTPC_CrossedRowsOverFindableCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("XRowsOverFindableCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC xrows over findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); - fhTPC_Chi2NCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcCh2Axis}); + fhItsNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSNCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsNClsAxis}); + fhItsChi2NClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsCh2Axis}); + fhTpcFindableNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFindableNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFoundNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFoundNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC found clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcSharedNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCSharedNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFractionSharedClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFractionSharedCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC fraction shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcFractionAxis}); + fhTpcCrossedRowsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCXrows_%s", tnames[isp].c_str()), HTITLESTRING("TPC crossed rows %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNRowsAxis}); + fhTpcCrossedRowsOverFindableClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("XRowsOverFindableCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC xrows over findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); + fhTpcChi2NClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcCh2Axis}); /* efficiency histograms */ - fhPt_vs_EtaItsA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptIts_%s", tnames[isp].c_str()), HTITLESTRING("ITS %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpc_%s", tnames[isp].c_str()), HTITLESTRING("TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpc_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptIts%s", tnames[isp].c_str()), HTITLESTRING("ITS %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpc%s", tnames[isp].c_str()), HTITLESTRING("TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpc%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); } } else { AxisSpec recoSpecies{static_cast(nsp) + 1, -0.5, nsp - 0.5, "reco species"}; @@ -242,57 +246,57 @@ struct QADataCollectingEngine { fhPtPurityNegMatA = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s", dirname, "Purity"), "ptPurityNegMat", "Secondaries from material for reconstructed negative", kTH3F, {recoSpecies, trueSpecies, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { /* detector level and generator level histograms */ - fhPt_vs_EtaPrimA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), - HNAMESTRING("ptPrim%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), - HNAMESTRING("ptSec%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), - HNAMESTRING("ptMat%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaPrimA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), + HNAMESTRING("ptPrim%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), + HNAMESTRING("ptSec%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaMatA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), + HNAMESTRING("ptMat%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); const std::vector detectedorigin = {"DetReco", "DetAssoc"}; for (uint ix = 0; ix < detectedorigin.size(); ++ix) { - fhPt_vs_EtaPrimItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsPrim_%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), + fhPtVsEtaPrimItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsPrim_%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaPrimItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcPrim_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaPrimItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcTofPrim_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC&TOF %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsSec_%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcSec_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcTofSec_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC&TOF %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaMatItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsMat_%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaMatItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcMat_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC %s tracks (from material)", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaPrimItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcPrim_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC %s tracks (primaries)", tnames[isp].c_str()), + fhPtVsEtaMatItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcTofMat_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC&TOF %s tracks (from material)", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaPrimItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcTofPrim_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC&TOF %s tracks (primaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsSec_%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcSec_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcTofSec_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC&TOF %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsMat_%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcMat_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcTofMat_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC&TOF %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); } } } @@ -306,12 +310,12 @@ struct QADataCollectingEngine { using namespace o2::aod::track; fhPtB[kindOfData]->Fill(track.pt()); - fhPt_vs_EtaB[kindOfData]->Fill(track.eta(), track.pt()); - fhPt_vs_ZvtxB[kindOfData]->Fill(zvtx, track.pt()); + fhPtVsEtaB[kindOfData]->Fill(track.eta(), track.pt()); + fhPtVsZvtxB[kindOfData]->Fill(zvtx, track.pt()); if (!(track.trackacceptedid() < 0)) { fhPtA[kindOfData][track.trackacceptedid()]->Fill(track.pt()); - fhPt_vs_EtaA[kindOfData][track.trackacceptedid()]->Fill(track.eta(), track.pt()); - fhPt_vs_ZvtxA[kindOfData][track.trackacceptedid()]->Fill(zvtx, track.pt()); + fhPtVsEtaA[kindOfData][track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsZvtxA[kindOfData][track.trackacceptedid()]->Fill(zvtx, track.pt()); } if constexpr (kindOfData == kReco) { auto fillhisto = [&track](auto& h, bool cond) { @@ -323,42 +327,42 @@ struct QADataCollectingEngine { bool hastpc = track.hasTPC() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), TrackSelectionTPC); bool hastof = track.hasTOF(); - fhITS_NCls_vs_PtB->Fill(track.pt(), track.itsNCls()); - fhITS_Chi2NCls_vs_PtB->Fill(track.pt(), track.itsChi2NCl()); - fhTPC_FindableNCls_vs_PtB->Fill(track.pt(), track.tpcNClsFindable()); - fhTPC_FoundNCls_vs_PtB->Fill(track.pt(), track.tpcNClsFound()); - fhTPC_SharedNCls_vs_PtB->Fill(track.pt(), track.tpcNClsShared()); - fhTPC_FractionSharedCls_vs_PtB->Fill(track.pt(), track.tpcFractionSharedCls()); - fhTPC_CrossedRows_vs_PtB->Fill(track.pt(), track.tpcNClsCrossedRows()); - fhTPC_CrossedRowsOverFindableCls_vs_PtB->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); - fhTPC_Chi2NCls_vs_PtB->Fill(track.pt(), track.tpcChi2NCl()); + fhItsNClsVsPtB->Fill(track.pt(), track.itsNCls()); + fhItsChi2NClsVsPtB->Fill(track.pt(), track.itsChi2NCl()); + fhTpcFindableNClsVsPtB->Fill(track.pt(), track.tpcNClsFindable()); + fhTpcFoundNClsVsPtB->Fill(track.pt(), track.tpcNClsFound()); + fhTpcSharedNClsVsPtB->Fill(track.pt(), track.tpcNClsShared()); + fhTpcFractionSharedClsVsPtB->Fill(track.pt(), track.tpcFractionSharedCls()); + fhTpcCrossedRowsVsPtB->Fill(track.pt(), track.tpcNClsCrossedRows()); + fhTpcCrossedRowsOverFindableClsVsPtB->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); + fhTpcChi2NClsVsPtB->Fill(track.pt(), track.tpcChi2NCl()); if (inTheAcceptance(track)) { /* efficiency histograms */ - fillhisto(fhPt_vs_EtaItsAcc, hasits); - fillhisto(fhPt_vs_EtaTpcAcc, hastpc); - fillhisto(fhPt_vs_EtaItsTpcAcc, hasits && hastpc); - fillhisto(fhPt_vs_EtaItsTofAcc, hasits && hastof); - fillhisto(fhPt_vs_EtaTpcTofAcc, hastpc && hastof); - fillhisto(fhPt_vs_EtaItsTpcTofAcc, hasits && hastpc && hastof); + fillhisto(fhPtVsEtaItsAcc, hasits); + fillhisto(fhPtVsEtaTpcAcc, hastpc); + fillhisto(fhPtVsEtaItsTpcAcc, hasits && hastpc); + fillhisto(fhPtVsEtaItsTofAcc, hasits && hastof); + fillhisto(fhPtVsEtaTpcTofAcc, hastpc && hastof); + fillhisto(fhPtVsEtaItsTpcTofAcc, hasits && hastpc && hastof); } if (!(track.trackacceptedid() < 0)) { - fhITS_NCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.itsNCls()); - fhITS_Chi2NCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.itsChi2NCl()); - fhTPC_FindableNCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFindable()); - fhTPC_FoundNCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFound()); - fhTPC_SharedNCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsShared()); - fhTPC_FractionSharedCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcFractionSharedCls()); - fhTPC_CrossedRows_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsCrossedRows()); - fhTPC_CrossedRowsOverFindableCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); - fhTPC_Chi2NCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcChi2NCl()); + fhItsNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsNCls()); + fhItsChi2NClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsChi2NCl()); + fhTpcFindableNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFindable()); + fhTpcFoundNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFound()); + fhTpcSharedNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsShared()); + fhTpcFractionSharedClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcFractionSharedCls()); + fhTpcCrossedRowsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsCrossedRows()); + fhTpcCrossedRowsOverFindableClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); + fhTpcChi2NClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcChi2NCl()); /* efficiency histograms */ fhPvsInnerP->Fill(track.tpcInnerParam(), track.p()); - fillhisto(fhPt_vs_EtaItsA[track.trackacceptedid()], hasits); - fillhisto(fhPt_vs_EtaTpcA[track.trackacceptedid()], hastpc); - fillhisto(fhPt_vs_EtaItsTpcA[track.trackacceptedid()], hasits && hastpc); - fillhisto(fhPt_vs_EtaItsTofA[track.trackacceptedid()], hasits && hastof); - fillhisto(fhPt_vs_EtaTpcTofA[track.trackacceptedid()], hastpc && hastof); - fillhisto(fhPt_vs_EtaItsTpcTofA[track.trackacceptedid()], hasits && hastpc && hastof); + fillhisto(fhPtVsEtaItsA[track.trackacceptedid()], hasits); + fillhisto(fhPtVsEtaTpcA[track.trackacceptedid()], hastpc); + fillhisto(fhPtVsEtaItsTpcA[track.trackacceptedid()], hasits && hastpc); + fillhisto(fhPtVsEtaItsTofA[track.trackacceptedid()], hasits && hastof); + fillhisto(fhPtVsEtaTpcTofA[track.trackacceptedid()], hastpc && hastof); + fillhisto(fhPtVsEtaItsTpcTofA[track.trackacceptedid()], hasits && hastpc && hastof); /* the detector / generator combined level */ if constexpr (framework::has_type_v) { auto findgenid = [&](auto& part) { @@ -397,18 +401,18 @@ struct QADataCollectingEngine { h->Fill(eta, pt); } }; - std::vector t_pt = {track.pt(), mcparticle.pt()}; - std::vector t_eta = {track.eta(), mcparticle.eta()}; - for (uint ix = 0; ix < t_pt.size(); ++ix) { - fillhisto(fhPt_vs_EtaPrimItsA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits, isprimary); - fillhisto(fhPt_vs_EtaPrimItsTpcA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastpc, isprimary); - fillhisto(fhPt_vs_EtaPrimItsTpcTofA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastof, isprimary); - fillhisto(fhPt_vs_EtaSecItsA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits, issecdecay); - fillhisto(fhPt_vs_EtaSecItsTpcA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastpc, issecdecay); - fillhisto(fhPt_vs_EtaSecItsTpcTofA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastof, issecdecay); - fillhisto(fhPt_vs_EtaMatItsA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits, isfrommaterial); - fillhisto(fhPt_vs_EtaMatItsTpcA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastpc, isfrommaterial); - fillhisto(fhPt_vs_EtaMatItsTpcTofA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastof, isfrommaterial); + std::vector tPt = {track.pt(), mcparticle.pt()}; + std::vector tEta = {track.eta(), mcparticle.eta()}; + for (uint ix = 0; ix < tPt.size(); ++ix) { + fillhisto(fhPtVsEtaPrimItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isprimary); + fillhisto(fhPtVsEtaPrimItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isprimary); + fillhisto(fhPtVsEtaPrimItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isprimary); + fillhisto(fhPtVsEtaSecItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, issecdecay); + fillhisto(fhPtVsEtaSecItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, issecdecay); + fillhisto(fhPtVsEtaSecItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, issecdecay); + fillhisto(fhPtVsEtaMatItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isfrommaterial); + fillhisto(fhPtVsEtaMatItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isfrommaterial); + fillhisto(fhPtVsEtaMatItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isfrommaterial); } } } @@ -417,11 +421,11 @@ struct QADataCollectingEngine { if (!(track.trackacceptedid() < 0)) { /* pure generator level */ if (track.isPhysicalPrimary()) { - fhPt_vs_EtaPrimA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsEtaPrimA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); } else if (track.getProcess() == 4) { - fhPt_vs_EtaSecA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsEtaSecA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); } else { - fhPt_vs_EtaMatA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsEtaMatA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); } } } @@ -701,33 +705,33 @@ struct DptDptEfficiencyAndQc { PidExtraDataCollectingEngine** pidExtraDataCE; /* the histogram registries */ - HistogramRegistry registry_one{"registry_one", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_two{"registry_two", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_three{"registry_three", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_four{"registry_four", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_five{"registry_five", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_six{"registry_six", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_seven{"registry_seven", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_eight{"registry_eight", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_nine{"registry_nine", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_ten{"registry_ten", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidone{"pidregistry_one", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidtwo{"pidregistry_two", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidthree{"pidregistry_three", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidfour{"pidregistry_four", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidfive{"pidregistry_five", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidsix{"pidregistry_six", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidseven{"pidregistry_seven", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pideight{"pidregistry_eight", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidnine{"pidregistry_nine", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidten{"pidregistry_ten", {}, OutputObjHandlingPolicy::AnalysisObject}; - std::vector registrybank{®istry_one, ®istry_two, ®istry_three, ®istry_four, ®istry_five, - ®istry_six, ®istry_seven, ®istry_eight, ®istry_nine, ®istry_ten}; - std::vector pidregistrybank{®istry_pidone, ®istry_pidtwo, ®istry_pidthree, ®istry_pidfour, ®istry_pidfive, - ®istry_pidsix, ®istry_pidseven, ®istry_pideight, ®istry_pidnine, ®istry_pidten}; - - Configurable inCentralityClasses{"usecentrality", false, "Perform the task using centrality/multiplicity classes. Default value: false"}; - Configurable useTPCInnerWallMomentum{"useinnerwallmomm", false, "Use the TPC inner wall momentum. Default: false"}; + HistogramRegistry registryOne{"registryOne", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryTwo{"registryTwo", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryThree{"registryThree", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryFour{"registryFour", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryFive{"registryFive", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registrySix{"registrySix", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registrySeven{"registrySeven", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryEight{"registryEight", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryNine{"registryNine", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryTen{"registryTen", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidOne{"pidregistryOne", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidTwo{"pidregistryTwo", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidThree{"pidregistryThree", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidFour{"pidregistryFour", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidFive{"pidregistryFive", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidSix{"pidregistrySix", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidSeven{"pidregistrySeven", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidEight{"pidregistryEight", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidNine{"pidregistryNine", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidTen{"pidregistryTen", {}, OutputObjHandlingPolicy::AnalysisObject}; + std::vector registrybank{®istryOne, ®istryTwo, ®istryThree, ®istryFour, ®istryFive, + ®istrySix, ®istrySeven, ®istryEight, ®istryNine, ®istryTen}; + std::vector pidregistrybank{®istryPidOne, ®istryPidTwo, ®istryPidThree, ®istryPidFour, ®istryPidFive, + ®istryPidSix, ®istryPidSeven, ®istryPidEight, ®istryPidNine, ®istryPidTen}; + + Configurable useCentrality{"useCentrality", false, "Perform the task using centrality/multiplicity classes. Default value: false"}; + Configurable useTPCInnerWallMomentum{"useTPCInnerWallMomentum", false, "Use the TPC inner wall momentum. Default: false"}; void init(o2::framework::InitContext& initContext) { @@ -796,7 +800,7 @@ struct DptDptEfficiencyAndQc { /* create the data collecting engine instances according to the configured centrality/multiplicity ranges */ std::string centspec; - if (inCentralityClasses.value && getTaskOptionValue(initContext, "dpt-dpt-filter", "centralities", centspec, false)) { + if (useCentrality.value && getTaskOptionValue(initContext, "dpt-dpt-filter", "centralities", centspec, false)) { LOGF(info, "Got the centralities specification: %s", centspec.c_str()); auto tokens = TString(centspec.c_str()).Tokenize(","); ncmranges = tokens->GetEntries(); @@ -828,7 +832,7 @@ struct DptDptEfficiencyAndQc { if (doPidAnalysis) { pidDataCE = new PidDataCollectingEngine*[ncmranges]; } - if (doPidAnalysis) { + if (doPidExtraAnalysis) { pidExtraDataCE = new PidExtraDataCollectingEngine*[ncmranges]; } std::string recogen; @@ -881,7 +885,7 @@ struct DptDptEfficiencyAndQc { template int getDCEindex(FilteredCollision collision) { - if (!inCentralityClasses.value) { + if (!useCentrality.value) { return 0; } else { int ixDCE = -1; @@ -908,7 +912,7 @@ struct DptDptEfficiencyAndQc { int ixDCE = getDCEindex(collision); if (!(ixDCE < 0)) { - for (auto& track : tracks) { + for (auto const& track : tracks) { float mom = track.p(); if (useTPCInnerWallMomentum.value) { if constexpr (!framework::has_type_v) { @@ -934,13 +938,13 @@ struct DptDptEfficiencyAndQc { LOGF(debug, "Received %d collisions", collisions.size()); } - using tpcPID = soa::Join; - using tofPID = soa::Join; + using TpcPID = soa::Join; + using TofPID = soa::Join; Filter onlyacceptedcollisions = (aod::dptdptfilter::collisionaccepted == uint8_t(true)); void processReconstructedNotStored(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join const& tracks) { using namespace efficiencyandqatask; @@ -949,7 +953,7 @@ struct DptDptEfficiencyAndQc { PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStored, "Process reconstructed efficiency and QA for not stored derived data", false); void processDetectorLevelNotStored(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join const& tracks, soa::Join const&) { using namespace efficiencyandqatask; @@ -959,7 +963,7 @@ struct DptDptEfficiencyAndQc { PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStored, "Process MC detector level efficiency and QA for not stored derived data", false); void processGeneratorLevelNotStored(soa::Filtered>::iterator const& collision, - soa::Join& particles) + soa::Join const& particles) { using namespace efficiencyandqatask; @@ -968,52 +972,52 @@ struct DptDptEfficiencyAndQc { PROCESS_SWITCH(DptDptEfficiencyAndQc, processGeneratorLevelNotStored, "Process MC generator level efficiency and QA for not stored derived data", true); void processReconstructedNotStoredPID(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join const& tracks) { using namespace efficiencyandqatask; processTracks>, kPID, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPID, "Process reconstructed efficiency and QA for not stored derived data", false); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPID, "Process reconstructed PID QA for not stored derived data", false); void processReconstructedNotStoredPIDExtra(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join const& tracks) { using namespace efficiencyandqatask; processTracks>, kPIDEXTRA, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPIDExtra, "Process reconstructed efficiency and QA for not stored derived data", false); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPIDExtra, "Process reconstructed PID extra QA for not stored derived data", false); void processDetectorLevelNotStoredPID(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join const& tracks, soa::Join const&) { using namespace efficiencyandqatask; processTracks>, kPID, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPID, "Process MC detector level efficiency and QA for not stored derived data", true); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPID, "Process MC detector level PID QA for not stored derived data", true); void processDetectorLevelNotStoredPIDExtra(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join const& tracks, soa::Join const&) { using namespace efficiencyandqatask; processTracks>, kPIDEXTRA, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPIDExtra, "Process MC detector level efficiency and QA for not stored derived data", true); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPIDExtra, "Process MC detector level PID extra QA for not stored derived data", true); }; using BCsWithTimestamps = soa::Join; -struct checkTimestamp { +struct CheckTimestamp { - o2::ccdb::CcdbApi ccdb_api; + o2::ccdb::CcdbApi ccdbApi; int mRunNumber; - ULong64_t runsor = 0; - ULong64_t runeor = 0; + uint64_t runsor = 0; + uint64_t runeor = 0; std::shared_ptr hTimeStampDiffNegative = nullptr; std::shared_ptr hTimeStampDiffPositive = nullptr; @@ -1028,7 +1032,7 @@ struct checkTimestamp { hTimeStampDiffNegative = registry.add("DiffNegative", "Time before SOR (s)", kTH2F, {{100, 0.5, 100.5, "Run number"}, diffAxis}); hTimeStampDiffPositive = registry.add("DiffPositive", "Time after EOR (s)", kTH2F, {{100, 0.5, 100.5, "Run number"}, diffAxis}); - ccdb_api.init(ccdburl); + ccdbApi.init(ccdburl); } void process(aod::Collisions const& collisions, BCsWithTimestamps const&) @@ -1041,7 +1045,7 @@ struct checkTimestamp { mRunNumber = bc.runNumber(); // read SOR and EOR timestamps from RCT CCDB via utility function - auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdb_api, mRunNumber, false); + auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber, false); runeor = soreor.second; runsor = soreor.first; } @@ -1066,6 +1070,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; return workflow; } From d100dbb243f894762e0d8d807886a88fb416d23d Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Tue, 3 Dec 2024 06:52:47 +0100 Subject: [PATCH 18/91] [PWGLF] Update NucleiHistTask (#8765) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/NucleiHistTask.cxx | 190 ++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx index bacf180ca48..c7136664631 100644 --- a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include "ReconstructionDataFormats/Track.h" #include "Framework/runDataProcessing.h" @@ -506,6 +507,27 @@ struct NucleiHistTask { Configurable> Tpc_mSigma_shift_He3{"Tpc_mSigma_shift_He3", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)helium-3 nSigma values in TPC"}; Configurable> Tpc_mSigma_shift_Al{"Tpc_mSigma_shift_Al", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)helium-4 nSigma values in TPC"}; + TF1* Pion_Tpc_nSigma_shift = 0; + TF1* Proton_Tpc_nSigma_shift = 0; + TF1* Deuteron_Tpc_nSigma_shift = 0; + TF1* Triton_Tpc_nSigma_shift = 0; + TF1* He3_Tpc_nSigma_shift = 0; + TF1* He4_Tpc_nSigma_shift = 0; + + Configurable enable_pT_shift_pion_tpc_nSigma{"enable_pT_shift_pion_tpc_nSigma", false, "Enable Pi plus TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_proton_tpc_nSigma{"enable_pT_shift_proton_tpc_nSigma", false, "Enable Proton TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_deuteron_tpc_nSigma{"enable_pT_shift_deuteron_tpc_nSigma", false, "Enable Deuteron TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_triton_tpc_nSigma{"enable_pT_shift_triton_tpc_nSigma", false, "Enable Triton TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_He3_tpc_nSigma{"enable_pT_shift_He3_tpc_nSigma", false, "Enable Helium-3 TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_He4_tpc_nSigma{"enable_pT_shift_He4_tpc_nSigma", false, "Enable Helium-4 TPC nSigma recentering by TF1"}; + + Configurable> parShiftPtPion{"parShiftPtPion", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Pi plus pT shift."}; + Configurable> parShiftPtProton{"parShiftPtProton", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Proton pT shift."}; + Configurable> parShiftPtDeuteron{"parShiftPtDeuteron", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Deuteron pT shift."}; + Configurable> parShiftPtTriton{"parShiftPtTriton", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Triton pT shift."}; + Configurable> parShiftPtHe3{"parShiftPtHe3", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Helium-3 pT shift."}; + Configurable> parShiftPtHe4{"parShiftPtHe4", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Alpha pT shift."}; + // *************************************************************************** int getBinIndex(const std::vector& ptBinning, float momentum) @@ -531,6 +553,37 @@ struct NucleiHistTask { spectra_reg.fill(HIST("histRecVtxZData"), event.posZ()); } + if (enable_pT_shift_pion_tpc_nSigma) { + Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtPion; + Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_proton_tpc_nSigma) { + Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtProton; + Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtDeuteron; + Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_triton_tpc_nSigma) { + Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtTriton; + Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He3_tpc_nSigma) { + He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe3; + He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He4_tpc_nSigma) { + He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe4; + He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + for (auto track : tracks) { histTrackcuts_data->AddBinContent(1); @@ -690,6 +743,31 @@ struct NucleiHistTask { if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (enable_pT_shift_pion_tpc_nSigma) { + float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(momentum); + nSigmaPion -= nSigmaPion_shift; + } + if (enable_pT_shift_proton_tpc_nSigma) { + float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(momentum); + nSigmaProton -= nSigmaProton_shift; + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(momentum); + nSigmaDeut -= nSigmaDeuteron_shift; + } + if (enable_pT_shift_triton_tpc_nSigma) { + float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(momentum); + nSigmaTriton -= nSigmaTriton_shift; + } + if (enable_pT_shift_He3_tpc_nSigma) { + float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe3 -= nSigmaHe3_shift; + } + if (enable_pT_shift_He4_tpc_nSigma) { + float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe4 -= nSigmaHe4_shift; + } + if (track.sign() > 0) { pion_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaPion); proton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaProton); @@ -1233,6 +1311,37 @@ struct NucleiHistTask { if (!event_selection_sel8) spectra_reg.fill(HIST("histCentrality"), event.centFT0C()); + if (enable_pT_shift_pion_tpc_nSigma) { + Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtPion; + Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_proton_tpc_nSigma) { + Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtProton; + Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtDeuteron; + Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_triton_tpc_nSigma) { + Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtTriton; + Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He3_tpc_nSigma) { + He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe3; + He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He4_tpc_nSigma) { + He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe4; + He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + for (auto track : tracks) { if ((event_selection_sel8 && !event.sel8()) || (enable_Centrality_cut_global && (event.centFT0C() < minCentrality) && (event.centFT0C() > maxCentrality))) @@ -1334,6 +1443,31 @@ struct NucleiHistTask { if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (enable_pT_shift_pion_tpc_nSigma) { + float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(momentum); + nSigmaPion -= nSigmaPion_shift; + } + if (enable_pT_shift_proton_tpc_nSigma) { + float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(momentum); + nSigmaProton -= nSigmaProton_shift; + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(momentum); + nSigmaDeut -= nSigmaDeuteron_shift; + } + if (enable_pT_shift_triton_tpc_nSigma) { + float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(momentum); + nSigmaTriton -= nSigmaTriton_shift; + } + if (enable_pT_shift_He3_tpc_nSigma) { + float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe3 -= nSigmaHe3_shift; + } + if (enable_pT_shift_He4_tpc_nSigma) { + float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe4 -= nSigmaHe4_shift; + } + if (track.sign() > 0) { pion_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaPion, event.centFT0C()); @@ -1577,6 +1711,37 @@ struct NucleiHistTask { MC_recon_reg.fill(HIST("histRecVtxMC"), collisions.posZ()); MC_recon_reg.fill(HIST("histCentrality"), collisions.centFT0C()); + if (enable_pT_shift_pion_tpc_nSigma) { + Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtPion; + Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_proton_tpc_nSigma) { + Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtProton; + Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtDeuteron; + Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_triton_tpc_nSigma) { + Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtTriton; + Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He3_tpc_nSigma) { + He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe3; + He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He4_tpc_nSigma) { + He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe4; + He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + for (auto& track : tracks) { histTrackcuts_MC->AddBinContent(1); const auto particle = track.mcParticle(); @@ -1839,6 +2004,31 @@ struct NucleiHistTask { if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (enable_pT_shift_pion_tpc_nSigma) { + float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(momentum); + nSigmaPion -= nSigmaPion_shift; + } + if (enable_pT_shift_proton_tpc_nSigma) { + float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(momentum); + nSigmaProton -= nSigmaProton_shift; + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(momentum); + nSigmaDeuteron -= nSigmaDeuteron_shift; + } + if (enable_pT_shift_triton_tpc_nSigma) { + float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(momentum); + nSigmaTriton -= nSigmaTriton_shift; + } + if (enable_pT_shift_He3_tpc_nSigma) { + float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe3 -= nSigmaHe3_shift; + } + if (enable_pT_shift_He4_tpc_nSigma) { + float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe4 -= nSigmaHe4_shift; + } + if (track.sign() > 0) { MC_recon_reg.fill(HIST("histTpcNsigmaDataPi"), momentum, nSigmaPion); MC_recon_reg.fill(HIST("histTpcNsigmaDataPr"), momentum, nSigmaProton); From 098fc5d29ff965922cdb391785a3a298c00c2d00 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 3 Dec 2024 06:58:18 +0100 Subject: [PATCH 19/91] [PWGLF] PWGLF/Tasks/Nuspex/spectraTOF.cxx (#8774) Co-authored-by: ALICE Action Bot --- 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 37c87eeaec0..ce950f9c0b9 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1375,20 +1375,27 @@ struct tofSpectra { 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); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); - - histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); - + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } else if (track.sign() < 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } + if (!track.hasTOF()) { + return; + } + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } else if (track.sign() < 0) { + histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } } // track } // process function PROCESS_SWITCH(tofSpectra, processOccupancy, "check for occupancy plots", false); From 6f13dcee7aee84404653fe990cfe8e73dd1824d8 Mon Sep 17 00:00:00 2001 From: Astronica-Software Date: Tue, 3 Dec 2024 06:02:29 +0000 Subject: [PATCH 20/91] [PWGLF] v0ptinvmassplots task included memory/vector/string as requested by Megalinter. (#8305) Co-authored-by: nxk335-local --- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index 6ca3f353e07..0b1bb3c88ac 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief V0 task for production of invariant mass plots for Optimised Topological Cuts Analysis +/// \brief V0 task for production of invariant mass plots for Pt Spectrum Analysis /// \author Nikolaos Karatzenis (nikolaos.karatzenis@cern.ch) /// \author Roman Lietava (roman.lietava@cern.ch) @@ -28,6 +28,9 @@ This analysis includes two processes, one for Real Data and one for MC Data swit #include "Common/DataModel/EventSelection.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/PIDResponse.h" +#include +#include +#include // namespace to be used for pt plots and bins namespace pthistos From 6151676b9f8c3f56b2046aa5a0e548f431fa05cc Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Tue, 3 Dec 2024 07:35:50 +0100 Subject: [PATCH 21/91] =?UTF-8?q?Create=20derived=20data=20from=20derived?= =?UTF-8?q?=20data=20to=20have=20only=20signal=20events=20for=20=E2=80=A6?= =?UTF-8?q?=20(#8785)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laura Serksnyte --- PWGCF/DataModel/FemtoDerived.h | 146 ++++++------ PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h | 2 +- PWGCF/FemtoDream/TableProducer/CMakeLists.txt | 6 + ...toDreamProducerTaskForSpecificAnalysis.cxx | 211 ++++++++++++++++++ .../femtoDreamTripletTaskTrackTrackV0.cxx | 14 ++ 5 files changed, 305 insertions(+), 74 deletions(-) create mode 100644 PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx diff --git a/PWGCF/DataModel/FemtoDerived.h b/PWGCF/DataModel/FemtoDerived.h index ab9708cbaae..3e6ca985c1f 100644 --- a/PWGCF/DataModel/FemtoDerived.h +++ b/PWGCF/DataModel/FemtoDerived.h @@ -52,13 +52,13 @@ DECLARE_SOA_COLUMN(BitMaskTrackThree, bitmaskTrackThree, BitMaskType); //! Bit f DECLARE_SOA_COLUMN(Downsample, downsample, bool); //! Flag for downsampling } // namespace femtodreamcollision -DECLARE_SOA_TABLE(FDCollisions, "AOD", "FDCOLLISION", - o2::soa::Index<>, - o2::aod::collision::PosZ, - femtodreamcollision::MultV0M, - femtodreamcollision::MultNtr, - femtodreamcollision::Sphericity, - femtodreamcollision::MagField); +DECLARE_SOA_TABLE_STAGED(FDCollisions, "FDCOLLISION", + o2::soa::Index<>, + o2::aod::collision::PosZ, + femtodreamcollision::MultV0M, + femtodreamcollision::MultNtr, + femtodreamcollision::Sphericity, + femtodreamcollision::MagField); using FDCollision = FDCollisions::iterator; DECLARE_SOA_TABLE(FDColMasks, "AOD", "FDCOLMASK", @@ -74,16 +74,16 @@ namespace femtodreamMCcollision DECLARE_SOA_COLUMN(MultMCgenPartEta08, multMCgenPartEta08, int); //! Multiplicity of the event as given by the generator in |eta|<0.8 } -DECLARE_SOA_TABLE(FDMCCollisions, "AOD", "FDMCCOLLISION", - o2::soa::Index<>, - femtodreamMCcollision::MultMCgenPartEta08); +DECLARE_SOA_TABLE_STAGED(FDMCCollisions, "FDMCCOLLISION", + o2::soa::Index<>, + femtodreamMCcollision::MultMCgenPartEta08); using FDMCCollision = FDMCCollisions::iterator; namespace mcfdcolllabel { DECLARE_SOA_INDEX_COLUMN(FDMCCollision, fdMCCollision); //! MC collision for femtodreamcollision } -DECLARE_SOA_TABLE(FDMCCollLabels, "AOD", "FDMCCollLabel", mcfdcolllabel::FDMCCollisionId); +DECLARE_SOA_TABLE_STAGED(FDMCCollLabels, "FDMCCollLabel", mcfdcolllabel::FDMCCollisionId); /// FemtoDreamTrack namespace femtodreamparticle @@ -313,59 +313,59 @@ DECLARE_SOA_TABLE(FDParticlesIndex, "AOD", "FDPARTICLEINDEX", //! Table track in o2::soa::Index<>, fdhf::TrackId); -DECLARE_SOA_TABLE(FDParticles, "AOD", "FDPARTICLE", - o2::soa::Index<>, - femtodreamparticle::FDCollisionId, - femtodreamparticle::Pt, - femtodreamparticle::Eta, - femtodreamparticle::Phi, - femtodreamparticle::PartType, - femtodreamparticle::Cut, - femtodreamparticle::PIDCut, - femtodreamparticle::TempFitVar, - femtodreamparticle::ChildrenIds, - femtodreamparticle::MLambda, - femtodreamparticle::MAntiLambda, - femtodreamparticle::Theta, - femtodreamparticle::Px, - femtodreamparticle::Py, - femtodreamparticle::Pz, - femtodreamparticle::P); +DECLARE_SOA_TABLE_STAGED(FDParticles, "FDPARTICLE", + o2::soa::Index<>, + femtodreamparticle::FDCollisionId, + femtodreamparticle::Pt, + femtodreamparticle::Eta, + femtodreamparticle::Phi, + femtodreamparticle::PartType, + femtodreamparticle::Cut, + femtodreamparticle::PIDCut, + femtodreamparticle::TempFitVar, + femtodreamparticle::ChildrenIds, + femtodreamparticle::MLambda, + femtodreamparticle::MAntiLambda, + femtodreamparticle::Theta, + femtodreamparticle::Px, + femtodreamparticle::Py, + femtodreamparticle::Pz, + femtodreamparticle::P); using FDParticle = FDParticles::iterator; -DECLARE_SOA_TABLE(FDExtParticles, "AOD", "FDEXTPARTICLE", - femtodreamparticle::Sign, - femtodreamparticle::TPCNClsFound, - track::TPCNClsFindable, - femtodreamparticle::TPCNClsCrossedRows, - track::TPCNClsShared, - track::TPCInnerParam, - femtodreamparticle::ITSNCls, - femtodreamparticle::ITSNClsInnerBarrel, - track::DcaXY, - track::DcaZ, - track::TPCSignal, - femtodreamparticle::TPCNSigmaEl, - femtodreamparticle::TPCNSigmaPi, - femtodreamparticle::TPCNSigmaKa, - femtodreamparticle::TPCNSigmaPr, - femtodreamparticle::TPCNSigmaDe, - femtodreamparticle::TPCNSigmaTr, - femtodreamparticle::TPCNSigmaHe, - femtodreamparticle::TOFNSigmaEl, - femtodreamparticle::TOFNSigmaPi, - femtodreamparticle::TOFNSigmaKa, - femtodreamparticle::TOFNSigmaPr, - femtodreamparticle::TOFNSigmaDe, - femtodreamparticle::TOFNSigmaTr, - femtodreamparticle::TOFNSigmaHe, - femtodreamparticle::DaughDCA, - femtodreamparticle::TransRadius, - femtodreamparticle::DecayVtxX, - femtodreamparticle::DecayVtxY, - femtodreamparticle::DecayVtxZ, - femtodreamparticle::MKaon, - femtodreamparticle::TPCCrossedRowsOverFindableCls) +DECLARE_SOA_TABLE_STAGED(FDExtParticles, "FDEXTPARTICLE", + femtodreamparticle::Sign, + femtodreamparticle::TPCNClsFound, + track::TPCNClsFindable, + femtodreamparticle::TPCNClsCrossedRows, + track::TPCNClsShared, + track::TPCInnerParam, + femtodreamparticle::ITSNCls, + femtodreamparticle::ITSNClsInnerBarrel, + track::DcaXY, + track::DcaZ, + track::TPCSignal, + femtodreamparticle::TPCNSigmaEl, + femtodreamparticle::TPCNSigmaPi, + femtodreamparticle::TPCNSigmaKa, + femtodreamparticle::TPCNSigmaPr, + femtodreamparticle::TPCNSigmaDe, + femtodreamparticle::TPCNSigmaTr, + femtodreamparticle::TPCNSigmaHe, + femtodreamparticle::TOFNSigmaEl, + femtodreamparticle::TOFNSigmaPi, + femtodreamparticle::TOFNSigmaKa, + femtodreamparticle::TOFNSigmaPr, + femtodreamparticle::TOFNSigmaDe, + femtodreamparticle::TOFNSigmaTr, + femtodreamparticle::TOFNSigmaHe, + femtodreamparticle::DaughDCA, + femtodreamparticle::TransRadius, + femtodreamparticle::DecayVtxX, + femtodreamparticle::DecayVtxY, + femtodreamparticle::DecayVtxZ, + femtodreamparticle::MKaon, + femtodreamparticle::TPCCrossedRowsOverFindableCls) using FDFullParticle = FDExtParticles::iterator; /// FemtoDreamTrackMC @@ -411,25 +411,25 @@ DECLARE_SOA_COLUMN(PDGMCTruth, pdgMCTruth, int); //! Particle DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! Checks mother PDG, where mother is the primary particle for that decay chain } // namespace femtodreamMCparticle -DECLARE_SOA_TABLE(FDMCParticles, "AOD", "FDMCPARTICLE", - o2::soa::Index<>, - femtodreamMCparticle::PartOriginMCTruth, - femtodreamMCparticle::PDGMCTruth, - femtodreamparticle::Pt, - femtodreamparticle::Eta, - femtodreamparticle::Phi); +DECLARE_SOA_TABLE_STAGED(FDMCParticles, "FDMCPARTICLE", + o2::soa::Index<>, + femtodreamMCparticle::PartOriginMCTruth, + femtodreamMCparticle::PDGMCTruth, + femtodreamparticle::Pt, + femtodreamparticle::Eta, + femtodreamparticle::Phi); using FDMCParticle = FDMCParticles::iterator; -DECLARE_SOA_TABLE(FDExtMCParticles, "AOD", "FDEXTMCPARTICLE", - femtodreamMCparticle::MotherPDG); +DECLARE_SOA_TABLE_STAGED(FDExtMCParticles, "FDEXTMCPARTICLE", + femtodreamMCparticle::MotherPDG); using FDExtMCParticle = FDExtMCParticles::iterator; namespace mcfdlabel { DECLARE_SOA_INDEX_COLUMN(FDMCParticle, fdMCParticle); //! MC particle for femtodreamparticle } // namespace mcfdlabel -DECLARE_SOA_TABLE(FDMCLabels, "AOD", "FDMCLabel", //! Table joinable to FemtoDreamParticle containing the MC labels - mcfdlabel::FDMCParticleId); +DECLARE_SOA_TABLE_STAGED(FDMCLabels, "FDMCLabel", //! Table joinable to FemtoDreamParticle containing the MC labels + mcfdlabel::FDMCParticleId); namespace mcfdextlabel { DECLARE_SOA_INDEX_COLUMN(FDExtMCParticle, fdExtMCParticle); //! MC particle for femtodreamparticle diff --git a/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h b/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h index 7ae8ba40cc6..3cc1834de3f 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h +++ b/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h @@ -70,7 +70,7 @@ class FemtoDreamPairCleaner } const auto& posChild = particles.iteratorAt(part2.index() - 2); const auto& negChild = particles.iteratorAt(part2.index() - 1); - if (part1.globalIndex() != posChild.childrenIds()[0] && part1.globalIndex() != negChild.childrenIds()[1]) { + if (part1.index() != posChild.childrenIds()[0] && part1.index() != negChild.childrenIds()[1]) { return true; } return false; diff --git a/PWGCF/FemtoDream/TableProducer/CMakeLists.txt b/PWGCF/FemtoDream/TableProducer/CMakeLists.txt index 569a6de54cc..4f48c6bf10a 100644 --- a/PWGCF/FemtoDream/TableProducer/CMakeLists.txt +++ b/PWGCF/FemtoDream/TableProducer/CMakeLists.txt @@ -18,3 +18,9 @@ o2physics_add_dpl_workflow(femtodream-producer-reduced SOURCES femtoDreamProducerReducedTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(femtodream-producer-for-specific-analysis + SOURCES femtoDreamProducerTaskForSpecificAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx new file mode 100644 index 00000000000..b6ea6cd5f90 --- /dev/null +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx @@ -0,0 +1,211 @@ +// Copyright 2019-2022 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file femtoDreamProducerTaskForSpecificAnalysis.cxx +/// \brief Tasks that reads the track tables and creates track triplets; only three identical particles can be used +/// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de + +#include +#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TDatabasePDG.h" + +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h" +#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" + +using namespace o2; +using namespace o2::analysis::femtoDream; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct femtoDreamProducerTaskForSpecificAnalysis { + + SliceCache cache; + + Produces outputCollision; + Produces outputParts; + + Preslice perCol = aod::femtodreamparticle::fdCollisionId; + float mMassOne = -999, mMassTwo = -999, mMassThree = -999; + int collisions = 0; + + Configurable ConfNumberOfTracks{"ConfNumberOfTracks", 3, "Number of tracks"}; + Configurable ConfNumberOfV0{"ConfNumberOfV0", 0, "Number of V0"}; + + /// Track selection + Configurable ConfPIDthrMom{"ConfPIDthrMom", 1.f, "Momentum threshold from which TPC and TOF are required for PID"}; + Configurable ConfTPCPIDBit{"ConfTPCPIDBit", 16, "PID TPC bit from cutCulator "}; + Configurable ConfTPCTOFPIDBit{"ConfTPCTOFPIDBit", 8, "PID TPCTOF bit from cutCulator"}; + + /// Partition for selected particles + Partition SelectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && + ifnode(aod::femtodreamparticle::pt * (nexp(aod::femtodreamparticle::eta) + nexp(-1.f * aod::femtodreamparticle::eta)) / 2.f <= ConfPIDthrMom, ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCPIDBit), ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCTOFPIDBit)); + + /// V0 selection + Configurable Conf_minInvMass_V0{"Conf_minInvMass_V0", 1.08, "Minimum invariant mass of V0 (particle)"}; + Configurable Conf_maxInvMass_V0{"Conf_maxInvMass_V0", 1.15, "Maximum invariant mass of V0 (particle)"}; + Configurable Conf_minInvMassAnti_V0{"Conf_minInvMassAnti_V0", 1.08, "Minimum invariant mass of V0 (antiparticle)"}; + Configurable Conf_maxInvMassAnti_V0{"Conf_maxInvMassAnti_V0", 1.15, "Maximum invariant mass of V0 (antiparticle)"}; + + // Partition for selected particles + Partition SelectedV0s = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)); + + HistogramRegistry EventRegistry{"EventRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + + template + int getRowDaughters(int daughID, T const& vecID) + { + int rowInPrimaryTrackTableDaugh = -1; + for (size_t i = 0; i < vecID.size(); i++) { + if (vecID.at(i) == daughID) { + rowInPrimaryTrackTableDaugh = i; + break; + } + } + return rowInPrimaryTrackTableDaugh; + } + + void init(InitContext&) + { + EventRegistry.add("hStatistiscs", ";bin;Entries", kTH1F, {{3, 0, 3}}); + // get bit for the collision mask + } + /// This function stores accepted collisions in derived data + /// @tparam PartitionType + /// @tparam PartType + /// @tparam isMC: enables Monte Carlo truth specific histograms + /// @param groupSelectedTracks partition for the first particle passed by the process function + /// @param groupSelectedV0s partition for the second particle passed by the process function + /// @param parts femtoDreamParticles table + template + void createSpecifiedDerivedData(o2::aod::FDCollision& col, PartitionType groupSelectedTracks, PartitionType groupSelectedV0s, PartType parts) + { + /// check tracks + int tracksCount = 0; + int antitracksCount = 0; + for (auto& part : groupSelectedTracks) { + if (part.cut() & 1) { + antitracksCount++; + } else { + tracksCount++; + } + } + + /// check V0s + int V0Count = 0; + int antiV0Count = 0; + for (auto& V0 : groupSelectedV0s) { + if ((V0.mLambda() > Conf_minInvMass_V0) && (V0.mLambda() < Conf_maxInvMass_V0)) { + V0Count++; + } else if ((V0.mAntiLambda() > Conf_minInvMassAnti_V0) && (V0.mAntiLambda() < Conf_maxInvMassAnti_V0)) { + antiV0Count++; + } + } + + std::vector tmpIDtrack; + + if ((V0Count >= ConfNumberOfV0 && tracksCount >= ConfNumberOfTracks) || (antiV0Count >= ConfNumberOfV0 && antitracksCount >= ConfNumberOfTracks)) { + EventRegistry.fill(HIST("hStatistiscs"), 1); + outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField()); + for (auto& femtoParticle : parts) { + if (aod::femtodreamparticle::ParticleType::kTrack == femtoParticle.partType()) { + std::vector childIDs = {0, 0}; + outputParts(outputCollision.lastIndex(), + femtoParticle.pt(), + femtoParticle.eta(), + femtoParticle.phi(), + femtoParticle.partType(), + femtoParticle.cut(), + femtoParticle.pidcut(), + femtoParticle.tempFitVar(), + childIDs, + femtoParticle.mLambda(), + femtoParticle.mAntiLambda()); + tmpIDtrack.push_back(femtoParticle.index()); + } + if (aod::femtodreamparticle::ParticleType::kV0Child == femtoParticle.partType()) { + std::vector childIDs = {0, 0}; + const auto& children = femtoParticle.childrenIds(); + int childId = (children[0] != 0) ? children[0] : children[1]; + if (childId != -1) { + int rowInPrimaryTrackTable = getRowDaughters(childId, tmpIDtrack); + childIDs = (children[0] != 0) ? std::vector{rowInPrimaryTrackTable, 0} : std::vector{0, rowInPrimaryTrackTable}; + } else { + childIDs = (children[0] != 0) ? std::vector{-1, 0} : std::vector{0, -1}; + } + outputParts(outputCollision.lastIndex(), + femtoParticle.pt(), + femtoParticle.eta(), + femtoParticle.phi(), + femtoParticle.partType(), + femtoParticle.cut(), + femtoParticle.pidcut(), + femtoParticle.tempFitVar(), + childIDs, + femtoParticle.mLambda(), + femtoParticle.mAntiLambda()); + } + if (aod::femtodreamparticle::ParticleType::kV0 == femtoParticle.partType()) { + // If the order in primary producer is changed of storing first pos, neg daughters and then V0 - this must be updated + const int rowOfLastTrack = outputParts.lastIndex(); + std::vector childIDs = {rowOfLastTrack - 1, rowOfLastTrack}; + outputParts(outputCollision.lastIndex(), + femtoParticle.pt(), + femtoParticle.eta(), + femtoParticle.phi(), + femtoParticle.partType(), + femtoParticle.cut(), + femtoParticle.pidcut(), + femtoParticle.tempFitVar(), + childIDs, + femtoParticle.mLambda(), + femtoParticle.mAntiLambda()); + } + } + } else { + EventRegistry.fill(HIST("hStatistiscs"), 2); + } + } + + /// process function to create derived data with only collisions containing n tracks + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoDreamParticleTable + void processCollisionsWithNTracksAndNV0(o2::aod::FDCollision& col, + o2::aod::FDParticles& parts) + { + EventRegistry.fill(HIST("hStatistiscs"), 0); + auto thegroupSelectedParts = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupSelectedV0s = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + + createSpecifiedDerivedData(col, thegroupSelectedParts, thegroupSelectedV0s, parts); + } + PROCESS_SWITCH(femtoDreamProducerTaskForSpecificAnalysis, processCollisionsWithNTracksAndNV0, "Enable producing data with ppp collisions for data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + return workflow; +} diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx index aecca490b80..05892a71bf1 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx @@ -203,6 +203,9 @@ struct femtoDreamTripletTaskTrackTrackV0 { std::vector tmpVecMult = ConfMultBins; framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"}; ThreeBodyQARegistry.add("TripletTaskQA/hSEMultVSGoodTracks", ";Mult;GoodT", kTH2F, {multAxis, {100, 0, 100}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleaner", ";posDaughtID; negDaughID", kTH2F, {{100, -10000, 10000}, {100, -10000, 10000}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerPos", ";primaryTrack; posDaughtID", kTH2F, {{100, -200, 200}, {100, -200, 200}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerNeg", ";primaryTrack; negDaughtID", kTH2F, {{100, -200, 200}, {100, -200, 200}}); sameEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); mixedEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); @@ -312,6 +315,13 @@ struct femtoDreamTripletTaskTrackTrackV0 { for (auto& V0 : groupSelectedV0s) { const auto& posChild = parts.iteratorAt(V0.index() - 2); const auto& negChild = parts.iteratorAt(V0.index() - 1); + + const auto& childrenPos = posChild.childrenIds(); + const auto& childrenNeg = negChild.childrenIds(); + auto posID = childrenPos[0]; + auto negID = childrenNeg[1]; + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleaner"), posID, negID); + if (!((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 && (posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 && (negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 && @@ -320,6 +330,10 @@ struct femtoDreamTripletTaskTrackTrackV0 { } for (auto& [T1, T2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupSelectedTracks, groupSelectedTracks))) { + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPos"), T1.index(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNeg"), T1.index(), negID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPos"), T2.index(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNeg"), T2.index(), negID); auto Q3 = FemtoDreamMath::getQ3(T1, mMassOne, T2, mMassTwo, V0, mMassThree); // Close pair rejection if (ConfIsCPR.value) { From da06af673218fb34e2fa073da999a5bb34cbf084 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Tue, 3 Dec 2024 07:40:45 +0100 Subject: [PATCH 22/91] [PWGLF] added shift callibration (#8720) Co-authored-by: Prottay Das --- PWGLF/TableProducer/Common/spvector.cxx | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/PWGLF/TableProducer/Common/spvector.cxx b/PWGLF/TableProducer/Common/spvector.cxx index 5309156b345..a5a3a03d9d1 100644 --- a/PWGLF/TableProducer/Common/spvector.cxx +++ b/PWGLF/TableProducer/Common/spvector.cxx @@ -126,6 +126,8 @@ struct spvector { Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; Configurable QA{"QA", false, "QA histograms"}; + Configurable useShift{"useShift", false, "shift histograms"}; + Configurable nshift{"nshift", 10, "no. of iterations in shifting"}; Configurable ispolarization{"ispolarization", false, "Flag to check polarization"}; Configurable finecorrection{"finecorrection", false, "Flag to check fine correction"}; Configurable rejbadevent{"rejbadevent", true, "Flag to check bad events"}; @@ -150,6 +152,8 @@ struct spvector { Configurable ConfRecenterevySp{"ConfRecenterevySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere"}; Configurable ConfRecenterevzSp{"ConfRecenterevzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere"}; Configurable ConfRecenteresqSp{"ConfRecenteresqSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recenteresq"}; + Configurable ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; + Configurable ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; // Event selection cuts - Alex TF1* fMultPVCutLow = nullptr; @@ -197,6 +201,8 @@ struct spvector { AxisSpec vxfineAxis = {VxfineNbins, lfinebinVx, hfinebinVx, "vxfine"}; AxisSpec vyfineAxis = {VyfineNbins, lfinebinVy, hfinebinVy, "vyfine"}; AxisSpec centfineAxis = {CentfineNbins, lfinebinCent, hfinebinCent, "V0M (%) fine"}; + AxisSpec shiftAxis = {10, 0, 10, "shift"}; + AxisSpec basisAxis = {2, 0, 2, "basis"}; histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}}); histos.add("hpQxZDCAC", "hpQxZDCAC", kTProfile, {centfineAxis}); @@ -246,6 +252,8 @@ struct spvector { histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); // histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile3D, {{2,0.0,2.0}, vzfineAxis, centfineAxis}); + histos.add("ShiftZDCC", "ShiftZDCC", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); + histos.add("ShiftZDCA", "ShiftZDCA", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); if (QA) { histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); @@ -283,6 +291,8 @@ struct spvector { TH2F* hrecenterevySp; TH2F* hrecenterevzSp; THnF* hrecenteresqSp; + TProfile3D* shiftprofileA; + TProfile3D* shiftprofileC; // Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; // Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin); @@ -422,6 +432,11 @@ struct spvector { qxZDCC = qxZDCC / sumC; qyZDCC = qyZDCC / sumC; } + } else { + qxZDCA = qxZDCA; + qxZDCC = qxZDCC; + qyZDCA = qyZDCA; + qyZDCC = qyZDCC; } if (sumA <= 1e-4 || sumC <= 1e-4) { qxZDCA = 0.0; @@ -654,6 +669,32 @@ struct spvector { psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC); psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA); + if (useShift && (currentRunNumber != lastRunNumber)) { + shiftprofileC = ccdb->getForTimeStamp(ConfShiftC.value, bc.timestamp()); + shiftprofileA = ccdb->getForTimeStamp(ConfShiftA.value, bc.timestamp()); + } + if (useShift) { + auto deltapsiZDCC = 0.0; + auto deltapsiZDCA = 0.0; + for (int ishift = 1; ishift <= nshift; ishift++) { + auto coeffshiftxZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5)); + auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5)); + deltapsiZDCC = deltapsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC))); + deltapsiZDCA = deltapsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA))); + } + psiZDCC = psiZDCC + deltapsiZDCC; + psiZDCA = psiZDCA + deltapsiZDCA; + } + + for (int ishift = 1; ishift <= nshift; ishift++) { + histos.fill(HIST("ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA)); + histos.fill(HIST("ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA)); + } + histos.fill(HIST("hpQxZDCAC"), centrality, (qxZDCA * qxZDCC)); histos.fill(HIST("hpQyZDCAC"), centrality, (qyZDCA * qyZDCC)); histos.fill(HIST("hpQxZDCAQyZDCC"), centrality, (qxZDCA * qyZDCC)); From c09a9ee619a91bb886844268bbcf705c51c37a14 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 3 Dec 2024 08:10:12 +0100 Subject: [PATCH 23/91] [PWGEM/Dilepton] quick fix to phiv prefilter (#8784) --- PWGEM/Dilepton/Core/Dilepton.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index b7f237748ec..d3de41a05f7 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -1185,6 +1185,7 @@ struct Dilepton { Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); From f14605b7b96480eb84e408c914b5630079a1f6a5 Mon Sep 17 00:00:00 2001 From: creetz16 <79141119+creetz16@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:31:00 +0100 Subject: [PATCH 24/91] [PWGLF] Fix KF cascade daughter DCA calculation in cascadebuilder (#8669) --- PWGLF/TableProducer/Strangeness/cascadebuilder.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx index a9a41f83f8c..6a7c74dc273 100644 --- a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx @@ -1412,12 +1412,8 @@ struct cascadeBuilder { KFXi.TransportToDecayVertex(); KFOmega.TransportToDecayVertex(); - // get DCA of updated daughters at vertex - KFParticle kfpBachPionUpd = kfpBachPion; - KFParticle kfpV0Upd = kfpV0; - kfpBachPionUpd.SetProductionVertex(KFXi); - kfpV0Upd.SetProductionVertex(KFXi); - cascadecandidate.dcacascdau = kfpBachPionUpd.GetDistanceFromParticle(kfpV0Upd); + // get DCA of daughters at vertex + cascadecandidate.dcacascdau = kfpBachPion.GetDistanceFromParticle(kfpV0); if (cascadecandidate.dcacascdau > dcacascdau) return false; From 9d81b96c97e2a816091cd8948493838a33e0124d Mon Sep 17 00:00:00 2001 From: nzardosh Date: Tue, 3 Dec 2024 10:25:02 +0100 Subject: [PATCH 25/91] [PWGHF,PWGJE] Declare common derived tables with macros (#8780) --- PWGHF/DataModel/DerivedTables.h | 517 ++++++------------ .../derivedDataCreatorBplusToD0Pi.cxx | 17 +- .../derivedDataCreatorD0ToKPi.cxx | 7 +- PWGJE/Core/JetHFUtilities.h | 2 +- 4 files changed, 193 insertions(+), 350 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 441d412ea2f..0066f9fe456 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -32,18 +32,13 @@ namespace o2::aod { // basic species: // D0 -> K- + pi+ (done) -// Lc -> pi+ K- p (existing 3P table to be renamed Lc) +// Lc -> pi+ K- p // D+ -> K- + pi+ + pi+ (3P table with adapted PID columns) // Ds+ -> K- + K+ + pi+ (3P table with adapted PID columns) // composite species // B0 -> D- + pi+ // B+ -> D0 + pi+ (in progress) // D*+ -> D0 + pi+ -constexpr uint MarkerBase = 2; -constexpr uint MarkerD0 = 3; -constexpr uint Marker3P = 4; -constexpr uint MarkerBplus = 5; -constexpr uint MarkerB0 = 6; // ================ // Collision tables @@ -62,172 +57,66 @@ DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! FDDM centrali DECLARE_SOA_COLUMN(MultZeqNTracksPV, multZeqNTracksPV, float); //! z-equalised barrel multiplicity } // namespace hf_coll_base -// base - -DECLARE_SOA_TABLE_STAGED(HfCollBases, "HFCOLLBASE", //! Table with basic collision info - o2::soa::Index<>, - collision::PosX, - collision::PosY, - collision::PosZ, - collision::NumContrib, - hf_coll_base::CentFT0A, - hf_coll_base::CentFT0C, - hf_coll_base::CentFT0M, - hf_coll_base::CentFV0A, - hf_coll_base::MultZeqNTracksPV, - // hf_coll_base::IsEventReject, - // bc::RunNumber, - o2::soa::Marker); - -using HfCollBase = HfCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfCollIds, "HFCOLLID", //! Table with original global indices of collisions - hf_cand::CollisionId, - o2::soa::Marker); - -// D0 (to be replaced by base version) - -DECLARE_SOA_TABLE_STAGED(HfD0CollBases, "HFD0COLLBASE", //! Table with basic collision info - o2::soa::Index<>, - collision::PosX, - collision::PosY, - collision::PosZ, - collision::NumContrib, - hf_coll_base::CentFT0A, - hf_coll_base::CentFT0C, - hf_coll_base::CentFT0M, - hf_coll_base::CentFV0A, - hf_coll_base::MultZeqNTracksPV, - // hf_coll_base::IsEventReject, - // bc::RunNumber, - o2::soa::Marker); - -using HfD0CollBase = HfD0CollBases::iterator; -using StoredHfD0CollBase = StoredHfD0CollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfD0CollIds, "HFD0COLLID", //! Table with original global indices of collisions - hf_cand::CollisionId, - o2::soa::Marker); - -// 3-prong decays (to be replaced by base version) - -DECLARE_SOA_TABLE_STAGED(Hf3PCollBases, "HF3PCOLLBASE", //! Table with basic collision info - o2::soa::Index<>, - collision::PosX, - collision::PosY, - collision::PosZ, - collision::NumContrib, - hf_coll_base::CentFT0A, - hf_coll_base::CentFT0C, - hf_coll_base::CentFT0M, - hf_coll_base::CentFV0A, - hf_coll_base::MultZeqNTracksPV, - // hf_coll_base::IsEventReject, - // bc::RunNumber, - o2::soa::Marker); - -using Hf3PCollBase = Hf3PCollBases::iterator; -using StoredHf3PCollBase = StoredHf3PCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(Hf3PCollIds, "HF3PCOLLID", //! Table with original global indices of collisions - hf_cand::CollisionId, - o2::soa::Marker); - -// =================== -// MC collision tables -// =================== - -// MC collision columns namespace hf_mc_coll { -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of the MC collision -DECLARE_SOA_ARRAY_INDEX_COLUMN(HfCollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for D0 candidates -namespace der_d0 -{ -DECLARE_SOA_ARRAY_INDEX_COLUMN(HfD0CollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for D0 candidates -} -namespace der_3p -{ -DECLARE_SOA_ARRAY_INDEX_COLUMN(Hf3PCollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for 3-prong candidates -} +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of the MC collision } // namespace hf_mc_coll -// base - -DECLARE_SOA_TABLE_STAGED(HfMcCollBases, "HFMCCOLLBASE", //! Table with basic MC collision info - o2::soa::Index<>, - mccollision::PosX, - mccollision::PosY, - mccollision::PosZ, - o2::soa::Marker); - -using HfMcCollBase = HfMcCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfMcCollIds, "HFMCCOLLID", //! Table with original global indices of MC collisions - hf_mc_coll::McCollisionId, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfMcRCollIds, "HFMCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table - hf_mc_coll::HfCollBaseIds); - -// D0 - -DECLARE_SOA_TABLE_STAGED(HfD0McCollBases, "HFD0MCCOLLBASE", //! Table with basic MC collision info - o2::soa::Index<>, - mccollision::PosX, - mccollision::PosY, - mccollision::PosZ, - o2::soa::Marker); - -using HfD0McCollBase = HfD0McCollBases::iterator; -using StoredHfD0McCollBase = StoredHfD0McCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfD0McCollIds, "HFD0MCCOLLID", //! Table with original global indices of MC collisions - hf_mc_coll::McCollisionId, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfD0McRCollIds, "HFD0MCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table - hf_mc_coll::der_d0::HfD0CollBaseIds); - -// 3-prong decays - -DECLARE_SOA_TABLE_STAGED(Hf3PMcCollBases, "HF3PMCCOLLBASE", //! Table with basic MC collision info - o2::soa::Index<>, - mccollision::PosX, - mccollision::PosY, - mccollision::PosZ, - cent::CentFT0M, - o2::soa::Marker); - -using Hf3PMcCollBase = Hf3PMcCollBases::iterator; -using StoredHf3PMcCollBase = StoredHf3PMcCollBases::iterator; +// Defines the collision table +#define DECLARE_COLL_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##CollBases, "HF" _hf_description_ "COLLBASE", \ + o2::soa::Index<>, \ + collision::PosX, \ + collision::PosY, \ + collision::PosZ, \ + collision::NumContrib, \ + hf_coll_base::CentFT0A, \ + hf_coll_base::CentFT0C, \ + hf_coll_base::CentFT0M, \ + hf_coll_base::CentFV0A, \ + hf_coll_base::MultZeqNTracksPV, \ + o2::soa::Marker); \ + \ + using Hf##_hf_type_##CollBase = Hf##_hf_type_##CollBases::iterator; \ + using StoredHf##_hf_type_##CollBase = StoredHf##_hf_type_##CollBases::iterator; \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##CollIds, "HF" _hf_description_ "COLLID", \ + hf_cand::CollisionId, \ + o2::soa::Marker); + +// Defines the mc collision table +#define DECLARE_MCCOLL_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_mc_coll \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_ARRAY_INDEX_COLUMN(Hf##_hf_type_##CollBase, hfCollBases); \ + } \ + } \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollBases, "HF" _hf_description_ "MCCOLLBASE", \ + o2::soa::Index<>, \ + mccollision::PosX, \ + mccollision::PosY, \ + mccollision::PosZ, \ + cent::CentFT0M, \ + o2::soa::Marker); \ + \ + using Hf##_hf_type_##McCollBase = Hf##_hf_type_##McCollBases::iterator; \ + using StoredHf##_hf_type_##McCollBase = StoredHf##_hf_type_##McCollBases::iterator; \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollIds, "HF" _hf_description_ "MCCOLLID", \ + hf_mc_coll::McCollisionId, \ + o2::soa::Marker); \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McRCollIds, "HF" _hf_description_ "MCRCOLLID", \ + hf_mc_coll::der_##_hf_namespace_::Hf##_hf_type_##CollBaseIds); + +#define DECLARE_COLL_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_COLL_TABLE(_hf_type_, _hf_description_) \ + DECLARE_MCCOLL_TABLE(_hf_type_, _hf_description_, _hf_namespace_) -DECLARE_SOA_TABLE_STAGED(Hf3PMcCollIds, "HF3PMCCOLLID", //! Table with original global indices of MC collisions - hf_mc_coll::McCollisionId, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(Hf3PMcRCollIds, "HF3PMCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table - hf_mc_coll::der_3p::Hf3PCollBaseIds); - -// ================ -// Candidate tables -// ================ - -// Basic candidate properties namespace hf_cand_base { -namespace der_d0 -{ -DECLARE_SOA_INDEX_COLUMN(HfD0CollBase, hfCollBase); //! collision index pointing to the derived collision table for D0 candidates -} -namespace der_bplus -{ -DECLARE_SOA_INDEX_COLUMN(HfCollBase, hfCollBase); //! collision index pointing to the derived collision table for B+ candidates -} -namespace der_3p -{ -DECLARE_SOA_INDEX_COLUMN(Hf3PCollBase, hfCollBase); //! collision index pointing to the derived collision table for 3-prong candidates -} DECLARE_SOA_COLUMN(Eta, eta, float); //! pseudorapidity DECLARE_SOA_COLUMN(M, m, float); //! invariant mass DECLARE_SOA_COLUMN(Phi, phi, float); //! azimuth @@ -243,6 +132,127 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! momentum [](float pt, float eta) -> float { return RecoDecayPtEtaPhi::p(pt, eta); }); } // namespace hf_cand_base +// Candidate MC columns +namespace hf_cand_mc +{ +DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for reconstruction level matching +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! particle origin, reconstruction level +DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order +DECLARE_SOA_COLUMN(FlagMcDecayChanRec, flagMcDecayChanRec, int8_t); //! resonant decay channel flag, reconstruction level +DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class +DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class +DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt class +DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt class +DECLARE_SOA_COLUMN(MlScores, mlScores, std::vector); //! vector of ML scores +} // namespace hf_cand_mc + +namespace hf_mc_particle +{ +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle +DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle +DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); //! flag for generator level matching +DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! particle origin, generator level +DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant decay channel flag, generator level +} // namespace hf_mc_particle + +#define DECLARE_CAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_cand_base \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_INDEX_COLUMN(Hf##_hf_type_##CollBase, hfCollBase); \ + } \ + } \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Bases, "HF" _hf_description_ "BASE", \ + o2::soa::Index<>, \ + hf_cand_base::der_##_hf_namespace_::Hf##_hf_type_##CollBaseId, \ + hf_cand_base::Pt, \ + hf_cand_base::Eta, \ + hf_cand_base::Phi, \ + hf_cand_base::M, \ + hf_cand_base::Y, \ + hf_cand_base::Px, \ + hf_cand_base::Py, \ + hf_cand_base::Pz, \ + hf_cand_base::P, \ + o2::soa::Marker); + +#define DECLARE_CAND_2P_ID_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Ids, "HF" _hf_description_ "ID", \ + hf_cand::CollisionId, \ + hf_track_index::Prong0Id, \ + hf_track_index::Prong1Id, \ + o2::soa::Marker); + +#define DECLARE_CAND_3P_ID_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Ids, "HF" _hf_description_ "ID", \ + hf_cand::CollisionId, \ + hf_track_index::Prong0Id, \ + hf_track_index::Prong1Id, \ + hf_track_index::Prong2Id, \ + o2::soa::Marker); + +#define DECLARE_MCCAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_mc_particle \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_INDEX_COLUMN(Hf##_hf_type_##McCollBase, hfMcCollBase); \ + } \ + } \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PBases, "HF" _hf_description_ "PBASE", \ + o2::soa::Index<>, \ + hf_mc_particle::der_##_hf_namespace_::Hf##_hf_type_##McCollBaseId, \ + hf_cand_base::Pt, \ + hf_cand_base::Eta, \ + hf_cand_base::Phi, \ + hf_cand_base::Y, \ + hf_mc_particle::FlagMcMatchGen, \ + hf_mc_particle::OriginMcGen, \ + hf_cand_base::Px, \ + hf_cand_base::Py, \ + hf_cand_base::Pz, \ + hf_cand_base::P, \ + o2::soa::Marker); + +#define DECLARE_MCCAND_ID_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PIds, "HF" _hf_description_ "PID", \ + hf_mc_particle::McCollisionId, \ + hf_mc_particle::McParticleId, \ + o2::soa::Marker); + +#define DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_MCCAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_MCCAND_ID_TABLE(_hf_type_, _hf_description_) + +#define DECLARE_CAND_2P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_2P_ID_TABLE(_hf_type_, _hf_description_) + +#define DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_3P_ID_TABLE(_hf_type_, _hf_description_) + +#define DECLARE_2P_TABLES(_hf_type_, _hf_description_, _hf_namespace_, _marker_number_) \ + constexpr uint Marker##_hf_type_ = _marker_number_; \ + DECLARE_COLL_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_2P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) + +#define DECLARE_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_, _marker_number_) \ + constexpr uint Marker##_hf_type_ = _marker_number_; \ + DECLARE_COLL_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) + +DECLARE_2P_TABLES(D0, "D0", d0, 2); +DECLARE_3P_TABLES(3P, "3P", 3p, 3); +DECLARE_3P_TABLES(Bplus, "BP", bplus, 4); + +// ================ +// Candidate tables +// ================ + // Candidate properties used for selection namespace hf_cand_par { @@ -387,20 +397,6 @@ namespace hf_cand_sel DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! bitmap of the selected candidate type } -// Candidate MC columns -namespace hf_cand_mc -{ -DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for reconstruction level matching -DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! particle origin, reconstruction level -DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order -DECLARE_SOA_COLUMN(FlagMcDecayChanRec, flagMcDecayChanRec, int8_t); //! resonant decay channel flag, reconstruction level -DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class -DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class -DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt class -DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt class -DECLARE_SOA_COLUMN(MlScores, mlScores, std::vector); //! vector of ML scores -} // namespace hf_cand_mc - // Candidate MC columns of the charm daughter namespace hf_cand_mc_charm { @@ -415,22 +411,6 @@ DECLARE_SOA_COLUMN(MlScoreNonPromptCharm, mlScoreNonPromptCharm, float); // DECLARE_SOA_COLUMN(MlScoresCharm, mlScoresCharm, std::vector); //! vector of ML scores } // namespace hf_cand_mc_charm -// D0 - -DECLARE_SOA_TABLE_STAGED(HfD0Bases, "HFD0BASE", //! Table with basic candidate properties used in the analyses - o2::soa::Index<>, - hf_cand_base::der_d0::HfD0CollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::M, - hf_cand_base::Y, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY @@ -495,33 +475,11 @@ DECLARE_SOA_TABLE_STAGED(HfD0Mls, "HFD0ML", //! Table with candidate selection M hf_cand_mc::MlScores, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfD0Ids, "HFD0ID", //! Table with original global indices for candidates - hf_cand::CollisionId, - hf_track_index::Prong0Id, - hf_track_index::Prong1Id, - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(HfD0Mcs, "HFD0MC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, o2::soa::Marker); -// B+ - -DECLARE_SOA_TABLE_STAGED(HfBplusBases, "HFBPBASE", //! Table with basic candidate properties used in the analyses - o2::soa::Index<>, - hf_cand_base::der_bplus::HfCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::M, - hf_cand_base::Y, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY @@ -585,42 +543,19 @@ DECLARE_SOA_TABLE_STAGED(HfBplusParEs, "HFBPPARE", //! Table with additional can hf_cand_par::Ct, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores - hf_cand_mc::MlScoreSig, +DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores + hf_cand_mc::MlScoreSig, // why is this the signal ML score instead of the full one? o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfBplusMlD0s, "HFBPMLD0", //! Table with D0 candidate selection ML scores hf_cand_mc_charm::MlScoresCharm, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfBplusIds, "HFBPID", //! Table with original global indices for candidates - hf_cand::CollisionId, - hf_track_index::Prong0Id, // D0 prong 0 - hf_track_index::Prong1Id, // D0 prong 1 - hf_track_index::Prong2Id, // bachelor pion - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(HfBplusMcs, "HFBPMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, o2::soa::Marker); -// 3-prong decays - -DECLARE_SOA_TABLE_STAGED(Hf3PBases, "HF3PBASE", //! Table with basic candidate properties used in the analyses - o2::soa::Index<>, - hf_cand_base::der_3p::Hf3PCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::M, - hf_cand_base::Y, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY @@ -693,110 +628,12 @@ DECLARE_SOA_TABLE_STAGED(Hf3PMls, "HF3PML", //! Table with candidate selection M hf_cand_mc::MlScores, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PIds, "HF3PID", //! Table with original global indices for candidates - hf_cand::CollisionId, - hf_track_index::Prong0Id, - hf_track_index::Prong1Id, - hf_track_index::Prong2Id, - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, hf_cand_mc::IsCandidateSwapped, o2::soa::Marker); -// ================== -// MC particle tables -// ================== - -// MC particle columns -namespace hf_mc_particle -{ -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle -namespace der_d0 -{ -DECLARE_SOA_INDEX_COLUMN(HfD0McCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for D0 candidates -} -namespace der_bplus -{ -DECLARE_SOA_INDEX_COLUMN(HfMcCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for B+ candidates -} -namespace der_3p -{ -DECLARE_SOA_INDEX_COLUMN(Hf3PMcCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for 3-prong candidates -} -DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); //! flag for generator level matching -DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! particle origin, generator level -DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant decay channel flag, generator level -} // namespace hf_mc_particle - -// D0 - -DECLARE_SOA_TABLE_STAGED(HfD0PBases, "HFD0PBASE", //! Table with MC particle info - o2::soa::Index<>, - hf_mc_particle::der_d0::HfD0McCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::Y, - hf_mc_particle::FlagMcMatchGen, - hf_mc_particle::OriginMcGen, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfD0PIds, "HFD0PID", //! Table with original global indices for MC particles - hf_mc_particle::McCollisionId, - hf_mc_particle::McParticleId, - o2::soa::Marker); - -// B+ - -DECLARE_SOA_TABLE_STAGED(HfBplusPBases, "HFBPPBASE", //! Table with MC particle info - o2::soa::Index<>, - hf_mc_particle::der_bplus::HfMcCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::Y, - hf_mc_particle::FlagMcMatchGen, - hf_mc_particle::OriginMcGen, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfBplusPIds, "HFBPPID", //! Table with original global indices for MC particles - hf_mc_particle::McCollisionId, - hf_mc_particle::McParticleId, - o2::soa::Marker); - -// 3-prong decays - -DECLARE_SOA_TABLE_STAGED(Hf3PPBases, "HF3PPBASE", //! Table with MC particle info - o2::soa::Index<>, - hf_mc_particle::der_3p::Hf3PMcCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::Y, - hf_mc_particle::FlagMcMatchGen, - hf_mc_particle::OriginMcGen, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(Hf3PPIds, "HF3PPID", //! Table with original global indices for MC particles - hf_mc_particle::McCollisionId, - hf_mc_particle::McParticleId, - o2::soa::Marker); } // namespace o2::aod #endif // PWGHF_DATAMODEL_DERIVEDTABLES_H_ diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 6c0ada5de5b..3ee02a28bb8 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -27,6 +27,8 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" +#include "PWGLF/DataModel/mcCentrality.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -52,12 +54,12 @@ struct HfDerivedDataCreatorBplusToD0Pi { Produces rowCandidateId; Produces rowCandidateMc; // Collisions - Produces rowCollBase; - Produces rowCollId; + Produces rowCollBase; + Produces rowCollId; // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; + Produces rowMcCollBase; + Produces rowMcCollId; + Produces rowMcRCollId; // MC particles Produces rowParticleBase; Produces rowParticleId; @@ -95,7 +97,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { using SelectedCandidatesMl = soa::Filtered>; using SelectedCandidatesMcMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; - using TypeMcCollisions = aod::McCollisions; + using TypeMcCollisions = soa::Join; using THfCandDaughters = aod::HfCand2ProngWPid; using THfCandDaughtersMl = soa::Join; @@ -165,7 +167,8 @@ struct HfDerivedDataCreatorBplusToD0Pi { rowMcCollBase( mcCollision.posX(), mcCollision.posY(), - mcCollision.posZ()); + mcCollision.posZ(), + mcCollision.centFT0M()); } if (fillMcCollId) { rowMcCollId( diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index de26dc1dff3..212916981d7 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -27,6 +27,8 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" +#include "PWGLF/DataModel/mcCentrality.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -97,7 +99,7 @@ struct HfDerivedDataCreatorD0ToKPi { using SelectedCandidatesMcMl = soa::Filtered>; using SelectedCandidatesMcKfMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; - using TypeMcCollisions = aod::McCollisions; + using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; Filter filterMcGenMatching = nabs(aod::hf_cand_2prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); @@ -178,7 +180,8 @@ struct HfDerivedDataCreatorD0ToKPi { rowMcCollBase( mcCollision.posX(), mcCollision.posY(), - mcCollision.posZ()); + mcCollision.posZ(), + mcCollision.centFT0M()); } if (fillMcCollId) { rowMcCollId( diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index d76c8d19121..f636eda3d7f 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -542,7 +542,7 @@ void fillHFCollisionTable(T const& collision, U const& /*candidates*/, V& HFColl template void fillD0McCollisionTable(T const& mcCollision, U& D0McCollisionTable, int32_t& D0McCollisionTableIndex) { - D0McCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + D0McCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); D0McCollisionTableIndex = D0McCollisionTable.lastIndex(); } From 32134f441c4924d4286080e305ddfab3b91e9c04 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Tue, 3 Dec 2024 10:28:38 +0100 Subject: [PATCH 26/91] [PWGHF] Fix typo in configurable name (#8788) --- PWGHF/Utils/utilsEvSelHf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 9382108dee3..f6f713b9914 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -93,7 +93,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useItsRofBorderCut{"useItsRofBorderCut", true, "Apply ITS ROF border cut"}; o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES - o2::framework::Configurable useOccupancyCut{"useOccupancyCut ", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; + o2::framework::Configurable useOccupancyCut{"useOccupancyCut", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; o2::framework::Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; o2::framework::Configurable occupancyMin{"occupancyMin", 0, "Minimum occupancy"}; o2::framework::Configurable occupancyMax{"occupancyMax", 1000000, "Maximum occupancy"}; From af6998833dd811a11791752603030724cb770e67 Mon Sep 17 00:00:00 2001 From: Daniel Samitz <69901155+DanielSamitz@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:13:41 +0100 Subject: [PATCH 27/91] [PWGEM] [PGWEM] fix FT0 occupancy cut in treeCreatorElectronML (#8790) --- PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx index 41e9e58209c..7643f79a984 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -185,7 +185,7 @@ struct TreeCreatorElectronML { // collision Configurable maxVtxZ{"maxVtxZ", 10.0, "max VtxZ [cm]"}; Configurable maxTrackOccupancy{"maxTrackOccupancy", 999999, "max. track occupancy"}; - Configurable maxFT0Occupancy{"maxFT0Occupancy", 999999, "max. FT0 occupancy"}; + Configurable maxFT0Occupancy{"maxFT0Occupancy", 999999., "max. FT0 occupancy"}; // track Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; From 3adade1a94bd526eb8c6c3822f4897e43acd5502 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Tue, 3 Dec 2024 14:36:16 +0100 Subject: [PATCH 28/91] [PWGHF,PWGJE] Adding B+ to the jet framework and renaming 3P->Lc in Derived HF tables (#8792) --- PWGHF/DataModel/DerivedTables.h | 22 +- .../derivedDataCreatorLcToPKPi.cxx | 28 +- PWGJE/Core/JetCandidateUtilities.h | 14 +- PWGJE/Core/JetDQUtilities.h | 12 +- PWGJE/Core/JetHFUtilities.h | 240 +++++++++--------- PWGJE/DataModel/Jet.h | 22 +- PWGJE/DataModel/JetReducedDataDQ.h | 14 +- PWGJE/DataModel/JetReducedDataHF.h | 63 +++++ PWGJE/DataModel/JetSubstructure.h | 4 +- PWGJE/DataModel/JetSubtraction.h | 16 +- PWGJE/JetFinders/CMakeLists.txt | 15 ++ .../JetFinders/jetFinderBplusDataCharged.cxx | 29 +++ PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx | 29 +++ PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx | 29 +++ PWGJE/JetFinders/jetFinderHF.cxx | 16 -- PWGJE/TableProducer/CMakeLists.txt | 5 + PWGJE/TableProducer/Matching/CMakeLists.txt | 15 ++ .../TableProducer/Matching/jetMatchingMC.cxx | 8 - .../Matching/jetMatchingMCBplusCharged.cxx | 31 +++ .../Matching/jetMatchingMCSub.cxx | 6 - .../Matching/jetMatchingMCSubBplusCharged.cxx | 29 +++ .../TableProducer/Matching/jetMatchingSub.cxx | 7 - .../Matching/jetMatchingSubBplusCharged.cxx | 30 +++ PWGJE/TableProducer/derivedDataProducer.cxx | 44 +++- .../derivedDataProducerDummy.cxx | 34 ++- .../derivedDataProducerDummyBplus.cxx | 69 +++++ .../derivedDataProducerDummyD0.cxx | 32 ++- .../derivedDataProducerDummyDielectron.cxx | 32 ++- .../derivedDataProducerDummyLc.cxx | 12 + PWGJE/TableProducer/derivedDataWriter.cxx | 216 +++++++++++++--- .../eventwiseConstituentSubtractor.cxx | 4 +- PWGJE/TableProducer/rhoEstimator.cxx | 4 +- PWGJE/Tasks/CMakeLists.txt | 12 + PWGJE/Tasks/jetFinderBplusQA.cxx | 27 ++ PWGJE/Tasks/jetSubstructureBplus.cxx | 27 ++ PWGJE/Tasks/jetSubstructureBplusOutput.cxx | 26 ++ PWGJE/Tasks/jetSubstructureD0Output.cxx | 2 +- .../Tasks/jetSubstructureDielectronOutput.cxx | 2 +- PWGJE/Tasks/jetSubstructureHF.cxx | 1 - PWGJE/Tasks/jetSubstructureHFOutput.cxx | 15 +- PWGJE/Tasks/jetSubstructureLcOutput.cxx | 2 +- 41 files changed, 933 insertions(+), 312 deletions(-) create mode 100644 PWGJE/JetFinders/jetFinderBplusDataCharged.cxx create mode 100644 PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx create mode 100644 PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx create mode 100644 PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx create mode 100644 PWGJE/Tasks/jetFinderBplusQA.cxx create mode 100644 PWGJE/Tasks/jetSubstructureBplus.cxx create mode 100644 PWGJE/Tasks/jetSubstructureBplusOutput.cxx diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 0066f9fe456..55bf8e57cc4 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -246,7 +246,7 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) DECLARE_2P_TABLES(D0, "D0", d0, 2); -DECLARE_3P_TABLES(3P, "3P", 3p, 3); +DECLARE_3P_TABLES(Lc, "LC", lc, 3); DECLARE_3P_TABLES(Bplus, "BP", bplus, 4); // ================ @@ -560,7 +560,7 @@ DECLARE_SOA_TABLE_STAGED(HfBplusMcs, "HFBPMC", //! Table with MC candidate info // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY // normalised: DecayLengthNormalised, DecayLengthXYNormalised, ImpactParameterNormalised0 -DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate properties used for selection +DECLARE_SOA_TABLE_STAGED(HfLcPars, "HFLCPAR", //! Table with candidate properties used for selection hf_cand::Chi2PCA, hf_cand::NProngsContributorsPV, hf_cand_par::Cpa, @@ -593,9 +593,9 @@ DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate propertie hf_cand_par::NSigTofPr2, hf_cand_par::NSigTpcTofPi2, hf_cand_par::NSigTpcTofPr2, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candidate properties used for selection +DECLARE_SOA_TABLE_STAGED(HfLcParEs, "HFLCPARE", //! Table with additional candidate properties used for selection hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, @@ -618,21 +618,21 @@ DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candid hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, hf_cand_par::Ct, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PSels, "HF3PSEL", //! Table with candidate selection flags +DECLARE_SOA_TABLE_STAGED(HfLcSels, "HFLCSEL", //! Table with candidate selection flags hf_cand_sel::CandidateSelFlag, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PMls, "HF3PML", //! Table with candidate selection ML scores +DECLARE_SOA_TABLE_STAGED(HfLcMls, "HFLCML", //! Table with candidate selection ML scores hf_cand_mc::MlScores, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info +DECLARE_SOA_TABLE_STAGED(HfLcMcs, "HFLCMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, hf_cand_mc::IsCandidateSwapped, - o2::soa::Marker); + o2::soa::Marker); } // namespace o2::aod diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index e16c498cd11..6353241bc38 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -43,23 +43,23 @@ using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorLcToPKPi { // Candidates - Produces rowCandidateBase; - Produces rowCandidatePar; - Produces rowCandidateParE; - Produces rowCandidateSel; - Produces rowCandidateMl; - Produces rowCandidateId; - Produces rowCandidateMc; + Produces rowCandidateBase; + Produces rowCandidatePar; + Produces rowCandidateParE; + Produces rowCandidateSel; + Produces rowCandidateMl; + Produces rowCandidateId; + Produces rowCandidateMc; // Collisions - Produces rowCollBase; - Produces rowCollId; + Produces rowCollBase; + Produces rowCollId; // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; + Produces rowMcCollBase; + Produces rowMcCollId; + Produces rowMcRCollId; // MC particles - Produces rowParticleBase; - Produces rowParticleId; + Produces rowParticleBase; + Produces rowParticleId; // Switches for filling tables Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; diff --git a/PWGJE/Core/JetCandidateUtilities.h b/PWGJE/Core/JetCandidateUtilities.h index 37e5e53d96b..6c5c0328ef5 100644 --- a/PWGJE/Core/JetCandidateUtilities.h +++ b/PWGJE/Core/JetCandidateUtilities.h @@ -373,30 +373,30 @@ float getCandidateInvariantMass(T const& candidate) } template -void fillCandidateCollisionTable(T const& collision, U const& candidates, V& CandiateCollisionTable, int32_t& CandidateCollisionTableIndex) +void fillCandidateCollisionTable(T const& collision, U const& /*candidates*/, V& CandiateCollisionTable, int32_t& CandidateCollisionTableIndex) { if constexpr (jethfutilities::isHFTable()) { - jethfutilities::fillHFCollisionTable(collision, candidates, CandiateCollisionTable, CandidateCollisionTableIndex); + jethfutilities::fillHFCollisionTable(collision, CandiateCollisionTable, CandidateCollisionTableIndex); } else if constexpr (jetdqutilities::isDielectronTable()) { jetdqutilities::fillDielectronCollisionTable(collision, CandiateCollisionTable, CandidateCollisionTableIndex); // if more dilepton tables are added we would need a fillDQCollisionTable } } template -void fillCandidateMcCollisionTable(T const& mcCollision, U const& candidates, V& CandiateMcCollisionTable, int32_t& CandidateMcCollisionTableIndex) +void fillCandidateMcCollisionTable(T const& mcCollision, U const& /*candidates*/, V& CandiateMcCollisionTable, int32_t& CandidateMcCollisionTableIndex) { if constexpr (jethfutilities::isHFMcTable()) { - jethfutilities::fillHFMcCollisionTable(mcCollision, candidates, CandiateMcCollisionTable, CandidateMcCollisionTableIndex); + jethfutilities::fillHFMcCollisionTable(mcCollision, CandiateMcCollisionTable, CandidateMcCollisionTableIndex); } else if constexpr (jetdqutilities::isDielectronMcTable()) { jetdqutilities::fillDielectronMcCollisionTable(mcCollision, CandiateMcCollisionTable, CandidateMcCollisionTableIndex); } } -template -void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& BaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMlTable, P& HFMCDTable, int32_t& candidateTableIndex) +template +void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& BaseTable, V& HFParTable, M& HFParETable, N& HFParDaughterTable, O& HFSelectionFlagTable, P& HFMlTable, Q& HFMlDaughterTable, S& HFMCDTable, int32_t& candidateTableIndex) { if constexpr (jethfutilities::isHFCandidate()) { - jethfutilities::fillHFCandidateTable(candidate, collisionIndex, BaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, candidateTableIndex); + jethfutilities::fillHFCandidateTable(candidate, collisionIndex, BaseTable, HFParTable, HFParETable, HFParDaughterTable, HFSelectionFlagTable, HFMlTable, HFMlDaughterTable, HFMCDTable, candidateTableIndex); } else if constexpr (jetdqutilities::isDielectronCandidate()) { jetdqutilities::fillDielectronCandidateTable(candidate, collisionIndex, BaseTable, candidateTableIndex); } diff --git a/PWGJE/Core/JetDQUtilities.h b/PWGJE/Core/JetDQUtilities.h index e68a23494f6..91b4c3cdd30 100644 --- a/PWGJE/Core/JetDQUtilities.h +++ b/PWGJE/Core/JetDQUtilities.h @@ -188,11 +188,7 @@ auto slicedPerDielectronCollision(T const& table, U const& /*candidates*/, V con template int getDielectronCandidateCollisionId(T const& candidate) { - if constexpr (isDielectronCandidate()) { - return candidate.reducedeventId(); - } else { - return -1; - } + return candidate.reducedeventId(); } /** @@ -275,11 +271,7 @@ float getDielectronTablePDGMass() template float getDielectronCandidateInvariantMass(T const& candidate) { - if constexpr (isDielectronCandidate()) { - return candidate.mass(); - } else { - return -1.0; - } + return candidate.mass(); } template diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index f636eda3d7f..00d88d728a0 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -296,7 +296,7 @@ bool isHFDaughterTrack(T& track, U& candidate, V const& /*tracks*/) return false; } } else if constexpr (isBplusCandidate()) { - if (candidate.template prong0_as().template prong0_as().globalIndex() == track.globalIndex() || candidate.template prong0_as().template prong1_as().globalIndex() == track.globalIndex() || candidate.template prong1_as().globalIndex() == track.globalIndex()) { + if (candidate.prong0Id() == track.globalIndex() || candidate.prong1Id() == track.globalIndex() || candidate.prong2Id() == track.globalIndex()) { return true; } else { return false; @@ -382,15 +382,7 @@ auto slicedPerHFCollision(T const& table, U const& /*candidates*/, V const& coll template int getHFCandidateCollisionId(T const& candidate) { - if constexpr (isD0Candidate()) { - return candidate.hfCollBaseId(); - } else if constexpr (isLcCandidate()) { - return candidate.hfCollBaseId(); - } else if constexpr (isBplusCandidate()) { - return candidate.hfCollBaseId(); - } else { - return -1; - } + return candidate.hfCollBaseId(); } /** @@ -401,15 +393,7 @@ int getHFCandidateCollisionId(T const& candidate) template int getHFMcCandidateCollisionId(T const& candidate) { - if constexpr (isD0McCandidate()) { - return candidate.hfMcCollBaseId(); - } else if constexpr (isLcMcCandidate()) { - return candidate.hfMcCollBaseId(); - } else if constexpr (isBplusMcCandidate()) { - return candidate.hfMcCollBaseId(); - } else { - return -1; - } + return candidate.hfMcCollBaseId(); } /** @@ -422,11 +406,9 @@ int getHFCandidatePDG(T const& /*candidate*/) { if constexpr (isD0Candidate() || isD0McCandidate()) { return static_cast(o2::constants::physics::Pdg::kD0); - } - if constexpr (isLcCandidate() || isLcMcCandidate()) { + } else if constexpr (isLcCandidate() || isLcMcCandidate()) { return static_cast(o2::constants::physics::Pdg::kLambdaCPlus); - } - if constexpr (isBplusCandidate() || isBplusMcCandidate()) { + } else if constexpr (isBplusCandidate() || isBplusMcCandidate()) { return static_cast(o2::constants::physics::Pdg::kBPlus); } else { return 0; @@ -441,11 +423,9 @@ int getHFTablePDG() { if constexpr (isD0Table() || isD0McTable()) { return static_cast(o2::constants::physics::Pdg::kD0); - } - if constexpr (isLcTable() || isLcMcTable()) { + } else if constexpr (isLcTable() || isLcMcTable()) { return static_cast(o2::constants::physics::Pdg::kLambdaCPlus); - } - if constexpr (isBplusTable() || isBplusMcTable()) { + } else if constexpr (isBplusTable() || isBplusMcTable()) { return static_cast(o2::constants::physics::Pdg::kBPlus); } else { return 0; @@ -462,11 +442,9 @@ float getHFCandidatePDGMass(T const& /*candidate*/) { if constexpr (isD0Candidate() || isD0McCandidate()) { return static_cast(o2::constants::physics::MassD0); - } - if constexpr (isLcCandidate() || isLcMcCandidate()) { + } else if constexpr (isLcCandidate() || isLcMcCandidate()) { return static_cast(o2::constants::physics::MassLambdaCPlus); - } - if constexpr (isBplusCandidate() || isBplusMcCandidate()) { + } else if constexpr (isBplusCandidate() || isBplusMcCandidate()) { return static_cast(o2::constants::physics::MassBPlus); } else { return -1.0; @@ -482,11 +460,9 @@ float getHFTablePDGMass() { if constexpr (isD0Table() || isD0McTable()) { return static_cast(o2::constants::physics::MassD0); - } - if constexpr (isLcTable() || isLcMcTable()) { + } else if constexpr (isLcTable() || isLcMcTable()) { return static_cast(o2::constants::physics::MassLambdaCPlus); - } - if constexpr (isBplusTable() || isBplusMcTable()) { + } else if constexpr (isBplusTable() || isBplusMcTable()) { return static_cast(o2::constants::physics::MassBPlus); } else { return -1.0; @@ -501,74 +477,26 @@ float getHFTablePDGMass() template float getHFCandidateInvariantMass(T const& candidate) { - if constexpr (isD0Candidate()) { - return candidate.m(); - } - if constexpr (isLcCandidate()) { - return candidate.m(); - } - if constexpr (isBplusCandidate()) { - return candidate.m(); - } else { - return -1.0; - } + return candidate.m(); } template -void fillD0CollisionTable(T const& collision, U& D0CollisionTable, int32_t& D0CollisionTableIndex) +void fillHFCollisionTable(T const& collision, U& HFCollisionTable, int32_t& HFCollisionTableIndex) { - D0CollisionTable(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFV0A(), collision.multZeqNTracksPV()); - D0CollisionTableIndex = D0CollisionTable.lastIndex(); + HFCollisionTable(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFV0A(), collision.multZeqNTracksPV()); + HFCollisionTableIndex = HFCollisionTable.lastIndex(); } template -void fillLcCollisionTable(T const& collision, U& LcCollisionTable, int32_t& LcCollisionTableIndex) +void fillHFMcCollisionTable(T const& mcCollision, U& HFMcCollisionTable, int32_t& HFMcCollisionTableIndex) { - LcCollisionTable(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFV0A(), collision.multZeqNTracksPV()); - LcCollisionTableIndex = LcCollisionTable.lastIndex(); + HFMcCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); + HFMcCollisionTableIndex = HFMcCollisionTable.lastIndex(); } -template -void fillHFCollisionTable(T const& collision, U const& /*candidates*/, V& HFCollisionTable, int32_t& HFCollisionTableIndex) +template +void fillD0CandidateTable(T const& candidate, U& D0ParTable, V& D0ParETable, M& D0SelectionFlagTable, N& D0MlTable, O& D0MCDTable) { - if constexpr (isD0Table()) { - fillD0CollisionTable(collision, HFCollisionTable, HFCollisionTableIndex); - } - if constexpr (isLcTable()) { - fillLcCollisionTable(collision, HFCollisionTable, HFCollisionTableIndex); - } -} - -template -void fillD0McCollisionTable(T const& mcCollision, U& D0McCollisionTable, int32_t& D0McCollisionTableIndex) -{ - D0McCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); - D0McCollisionTableIndex = D0McCollisionTable.lastIndex(); -} - -template -void fillLcMcCollisionTable(T const& mcCollision, U& LcMcCollisionTable, int32_t& LcMcCollisionTableIndex) -{ - LcMcCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); - LcMcCollisionTableIndex = LcMcCollisionTable.lastIndex(); -} - -template -void fillHFMcCollisionTable(T const& mcCollision, U const& /*candidates*/, V& HFMcCollisionTable, int32_t& HFMcCollisionTableIndex) -{ - if constexpr (isD0McTable()) { - fillD0McCollisionTable(mcCollision, HFMcCollisionTable, HFMcCollisionTableIndex); - } - if constexpr (isLcMcTable()) { - fillLcMcCollisionTable(mcCollision, HFMcCollisionTable, HFMcCollisionTableIndex); - } -} - -template -void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseTable, V& D0ParTable, M& D0ParETable, N& D0SelectionFlagTable, O& D0MlTable, P& D0MCDTable, int32_t& D0CandidateTableIndex) -{ - D0BaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); - D0ParTable( candidate.chi2PCA(), candidate.cpa(), @@ -620,22 +548,20 @@ void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseT candidate.ct()); D0SelectionFlagTable(candidate.candidateSelFlag()); - if constexpr (isMc) { - D0MCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); - } std::vector mlScoresVector; auto mlScoresSpan = candidate.mlScores(); std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); D0MlTable(mlScoresVector); - D0CandidateTableIndex = D0BaseTable.lastIndex(); + if constexpr (isMc) { + D0MCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); + } } -template -void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseTable, V& LcParTable, M& LcParETable, N& LcSelectionFlagTable, O& LcMlTable, P& LcMCDTable, int32_t& LcCandidateTableIndex) +template +void fillLcCandidateTable(T const& candidate, U& LcParTable, V& LcParETable, M& LcSelectionFlagTable, N& LcMlTable, O& LcMCDTable) { - LcBaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); LcParTable( candidate.chi2PCA(), @@ -696,51 +622,115 @@ void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseT candidate.ct()); LcSelectionFlagTable(candidate.candidateSelFlag()); - if constexpr (isMc) { - LcMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.isCandidateSwapped()); - } std::vector mlScoresVector; auto mlScoresSpan = candidate.mlScores(); std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); LcMlTable(mlScoresVector); - LcCandidateTableIndex = LcBaseTable.lastIndex(); + if constexpr (isMc) { + LcMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.isCandidateSwapped()); + } } +// need to update this template -void fillHFCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMlTable, P& HFMCDTable, int32_t& HFCandidateTableIndex) +void fillBplusCandidateTable(T const& candidate, U& BplusParTable, V& BplusParETable, M& BplusParD0Table, N& BplusMlTable, O& BplusMlD0Table, P& BplusMCDTable) { - if constexpr (isD0Candidate()) { - fillD0CandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, HFCandidateTableIndex); - } - if constexpr (isLcCandidate()) { - fillLcCandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, HFCandidateTableIndex); + + BplusParTable( + candidate.chi2PCA(), + candidate.cpa(), + candidate.cpaXY(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.ptProng0(), + candidate.ptProng1(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised0(), + candidate.impactParameterNormalised1(), + candidate.nSigTpcPiExpPi(), + candidate.nSigTofPiExpPi(), + candidate.nSigTpcTofPiExpPi(), + candidate.nSigTpcKaExpPi(), + candidate.nSigTofKaExpPi(), + candidate.nSigTpcTofKaExpPi(), + candidate.maxNormalisedDeltaIP(), + candidate.impactParameterProduct()); + + BplusParETable( + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.rSecondaryVertex(), + candidate.pProng1(), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.errorImpactParameter1(), + candidate.cosThetaStar(), + candidate.ct()); + + BplusParD0Table( + candidate.cpaCharm(), + candidate.decayLengthCharm(), + candidate.impactParameter0Charm(), + candidate.impactParameter1Charm(), + candidate.impactParameterProductCharm(), + candidate.nSigTpcPiExpPiCharm(), + candidate.nSigTofPiExpPiCharm(), + candidate.nSigTpcTofPiExpPiCharm(), + candidate.nSigTpcKaExpPiCharm(), + candidate.nSigTofKaExpPiCharm(), + candidate.nSigTpcTofKaExpPiCharm(), + candidate.nSigTpcPiExpKaCharm(), + candidate.nSigTofPiExpKaCharm(), + candidate.nSigTpcTofPiExpKaCharm(), + candidate.nSigTpcKaExpKaCharm(), + candidate.nSigTofKaExpKaCharm(), + candidate.nSigTpcTofKaExpKaCharm()); + + // BplusSelectionFlagTable(candidate.candidateSelFlag()); + + BplusMlTable(candidate.mlScoreSig()); + + std::vector mlScoresCharmVector; + auto mlScoresCharmSpan = candidate.mlScoresCharm(); + std::copy(mlScoresCharmSpan.begin(), mlScoresCharmSpan.end(), std::back_inserter(mlScoresCharmVector)); + BplusMlD0Table(mlScoresCharmVector); + + if constexpr (isMc) { + BplusMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); } } -template -void fillD0CandidateMcTable(T const& candidate, int32_t mcCollisionIndex, U& D0PBaseTable, int32_t& D0CandidateTableIndex) -{ - D0PBaseTable(mcCollisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.y(), candidate.flagMcMatchGen(), candidate.originMcGen()); - D0CandidateTableIndex = D0PBaseTable.lastIndex(); -} -template -void fillLcCandidateMcTable(T const& candidate, int32_t mcCollisionIndex, U& LcPBaseTable, int32_t& LcCandidateTableIndex) +template +void fillHFCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseTable, V& HFParTable, M& HFParETable, N& HFParDaughterTable, O& HFSelectionFlagTable, P& HFMlTable, Q& HFMlDaughterTable, S& HFMCDTable, int32_t& HFCandidateTableIndex) { - LcPBaseTable(mcCollisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.y(), candidate.flagMcMatchGen(), candidate.originMcGen()); - LcCandidateTableIndex = LcPBaseTable.lastIndex(); + HFBaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); + HFCandidateTableIndex = HFBaseTable.lastIndex(); + + if constexpr (isD0Candidate()) { + fillD0CandidateTable(candidate, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable); + } + if constexpr (isLcCandidate()) { + fillLcCandidateTable(candidate, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable); + } + if constexpr (isBplusCandidate()) { + fillBplusCandidateTable(candidate, HFParTable, HFParETable, HFParDaughterTable, HFMlTable, HFMlDaughterTable, HFMCDTable); + } } template void fillHFCandidateMcTable(T const& candidate, int32_t mcCollisionIndex, U& BaseMcTable, int32_t& candidateTableIndex) { - if constexpr (isD0McCandidate()) { - fillD0CandidateMcTable(candidate, mcCollisionIndex, BaseMcTable, candidateTableIndex); - } - if constexpr (isLcMcCandidate()) { - fillLcCandidateMcTable(candidate, mcCollisionIndex, BaseMcTable, candidateTableIndex); - } + BaseMcTable(mcCollisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.y(), candidate.flagMcMatchGen(), candidate.originMcGen()); + candidateTableIndex = BaseMcTable.lastIndex(); } }; // namespace jethfutilities diff --git a/PWGJE/DataModel/Jet.h b/PWGJE/DataModel/Jet.h index 0ba6ff484d4..423240fe799 100644 --- a/PWGJE/DataModel/Jet.h +++ b/PWGJE/DataModel/Jet.h @@ -179,8 +179,8 @@ DECLARE_JET_TABLES_LEVELS(Charged, JTrackSub, HfD0Bases, HfD0PBases, "C"); DECLARE_JET_TABLES_LEVELS(Full, JTrackSub, HfD0Bases, HfD0PBases, "F"); DECLARE_JET_TABLES_LEVELS(Neutral, JTrackSub, HfD0Bases, HfD0PBases, "N"); DECLARE_JET_TABLES_LEVELS(D0Charged, JTrackD0Sub, HfD0Bases, HfD0PBases, "D0"); -DECLARE_JET_TABLES_LEVELS(LcCharged, JTrackLcSub, Hf3PBases, Hf3PPBases, "Lc"); -DECLARE_JET_TABLES_LEVELS(BplusCharged, JTrackBplusSub, HfCandBplus, HfD0PBases, "BPl"); +DECLARE_JET_TABLES_LEVELS(LcCharged, JTrackLcSub, HfLcBases, HfLcPBases, "Lc"); +DECLARE_JET_TABLES_LEVELS(BplusCharged, JTrackBplusSub, HfBplusBases, HfBplusPBases, "BP"); DECLARE_JET_TABLES_LEVELS(V0Charged, JTrackSub, V0Cores, JV0Mcs, "V0"); DECLARE_JET_TABLES_LEVELS(DielectronCharged, JTrackSub, Dielectrons, JDielectronMcs, "DIEL"); @@ -219,19 +219,21 @@ using JetParticlesSubD0 = JMcParticleD0Subs; using McCollisionsD0 = o2::soa::Join; using CandidatesD0MCP = o2::soa::Join; -using CollisionsLc = o2::soa::Join; -using CandidatesLcData = o2::soa::Join; -using CandidatesLcMCD = o2::soa::Join; +using CollisionsLc = o2::soa::Join; +using CandidatesLcData = o2::soa::Join; +using CandidatesLcMCD = o2::soa::Join; using JetTracksSubLc = JTrackLcSubs; using JetParticlesSubLc = JMcParticleLcSubs; -using McCollisionsLc = o2::soa::Join; -using CandidatesLcMCP = o2::soa::Join; +using McCollisionsLc = o2::soa::Join; +using CandidatesLcMCP = o2::soa::Join; -using CandidatesBplusData = o2::soa::Join; -using CandidatesBplusMCD = o2::soa::Join; +using CollisionsBplus = o2::soa::Join; +using CandidatesBplusData = o2::soa::Join; +using CandidatesBplusMCD = o2::soa::Join; using JetTracksSubBplus = JTrackBplusSubs; using JetParticlesSubBplus = JMcParticleBplusSubs; -using CandidatesBplusMCP = o2::soa::Join; +using McCollisionsBplus = o2::soa::Join; +using CandidatesBplusMCP = o2::soa::Join; using CandidatesV0Data = o2::soa::Join; using CandidatesV0MCD = o2::soa::Join; diff --git a/PWGJE/DataModel/JetReducedDataDQ.h b/PWGJE/DataModel/JetReducedDataDQ.h index 8641b3d612e..a5779ebd3b4 100644 --- a/PWGJE/DataModel/JetReducedDataDQ.h +++ b/PWGJE/DataModel/JetReducedDataDQ.h @@ -115,35 +115,37 @@ DECLARE_SOA_COLUMN(DummyDQ, dummyDQ, bool); } // namespace jdummydq DECLARE_SOA_TABLE(JDielectron1Dummys, "AOD", "JDIEL1DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<1>); DECLARE_SOA_TABLE(JDielectron2Dummys, "AOD", "JDIEL2DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<2>); DECLARE_SOA_TABLE(JDielectron3Dummys, "AOD", "JDIEL3DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<3>); DECLARE_SOA_TABLE(JDielectron4Dummys, "AOD", "JDIEL4DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<4>); DECLARE_SOA_TABLE(JDielectron5Dummys, "AOD", "JDIEL5DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<5>); DECLARE_SOA_TABLE(JDielectron6Dummys, "AOD", "JDIEL6DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<6>); +DECLARE_SOA_TABLE(JDielectron7Dummys, "AOD", "JDIEL7DUMMY", + jdummydq::DummyDQ, + o2::soa::Marker<7>); + +DECLARE_SOA_TABLE(JDielectron8Dummys, "AOD", "JDIEL8DUMMY", + jdummydq::DummyDQ, + o2::soa::Marker<8>); + } // namespace o2::aod #endif // PWGJE_DATAMODEL_JETREDUCEDDATADQ_H_ diff --git a/PWGJE/DataModel/JetReducedDataHF.h b/PWGJE/DataModel/JetReducedDataHF.h index 1c196c173d9..c00a89e029e 100644 --- a/PWGJE/DataModel/JetReducedDataHF.h +++ b/PWGJE/DataModel/JetReducedDataHF.h @@ -50,6 +50,19 @@ DECLARE_SOA_TABLE_STAGED(JD0PIds, "JD0PID", jd0indices::JMcCollisionId, jd0indices::JMcParticleId); +namespace jdummyd0 +{ +DECLARE_SOA_COLUMN(DummyD0, dummyD0, bool); +} // namespace jdummyd0 + +DECLARE_SOA_TABLE(JDumD0ParDaus, "AOD", "JDUMD0PARDAU", + jdummyd0::DummyD0, + o2::soa::Marker<1>); + +DECLARE_SOA_TABLE(JDumD0MlDaus, "AOD", "JDumD0MLDAU", + jdummyd0::DummyD0, + o2::soa::Marker<2>); + namespace jlcindices { DECLARE_SOA_INDEX_COLUMN(JCollision, collision); @@ -76,6 +89,56 @@ DECLARE_SOA_TABLE_STAGED(JLcPIds, "JLCPID", jlcindices::JMcCollisionId, jlcindices::JMcParticleId); +namespace jdummylc +{ + +DECLARE_SOA_COLUMN(DummyLc, dummyLc, bool); + +} // namespace jdummylc +DECLARE_SOA_TABLE(JDumLcParDaus, "AOD", "JDUMLCPARDAU", + jdummylc::DummyLc, + o2::soa::Marker<1>); + +DECLARE_SOA_TABLE(JDumLcMlDaus, "AOD", "JDUMLCMLDAU", + jdummylc::DummyLc, + o2::soa::Marker<2>); + +namespace jbplusindices +{ +DECLARE_SOA_INDEX_COLUMN(JCollision, collision); +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, JTracks, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, JTracks, "_1"); +DECLARE_SOA_INDEX_COLUMN_FULL(Prong2, prong2, int, JTracks, "_2"); +DECLARE_SOA_INDEX_COLUMN(JMcCollision, mcCollision); +DECLARE_SOA_INDEX_COLUMN(JMcParticle, mcParticle); +} // namespace jbplusindices + +DECLARE_SOA_TABLE_STAGED(JBplusCollisionIds, "JBPCOLLID", + jbplusindices::JCollisionId); + +DECLARE_SOA_TABLE_STAGED(JBplusMcCollisionIds, "JBPMCCOLLID", + jbplusindices::JMcCollisionId); + +DECLARE_SOA_TABLE_STAGED(JBplusIds, "JBPID", + jbplusindices::JCollisionId, + jbplusindices::Prong0Id, + jbplusindices::Prong1Id, + jbplusindices::Prong2Id); + +DECLARE_SOA_TABLE_STAGED(JBplusPIds, "JBPPID", + jbplusindices::JMcCollisionId, + jbplusindices::JMcParticleId); + +namespace jdummybplus +{ + +DECLARE_SOA_COLUMN(DummyBplus, dummyBplus, bool); + +} // namespace jdummybplus +DECLARE_SOA_TABLE(JDumBplusSels, "AOD", "JDUMBPUSSEL", + jdummybplus::DummyBplus, + o2::soa::Marker<1>); + } // namespace o2::aod #endif // PWGJE_DATAMODEL_JETREDUCEDDATAHF_H_ diff --git a/PWGJE/DataModel/JetSubstructure.h b/PWGJE/DataModel/JetSubstructure.h index 2e5d03f46d0..9b606b8dcfd 100644 --- a/PWGJE/DataModel/JetSubstructure.h +++ b/PWGJE/DataModel/JetSubstructure.h @@ -122,8 +122,8 @@ DECLARE_SOA_COLUMN(JetNConstituents, jetNConstituents, int); //! JETSUBSTRUCTURE_TABLES_DEF(C, "C", CJetCOs, "CJETCO", CEWSJetCOs, "CEWSJETCO", CMCDJetCOs, "CMCDJETCO", CMCPJetCOs, "CMCPJETCO"); JETSUBSTRUCTURE_TABLES_DEF(D0C, "D0C", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0PBases, "HFD0PBASE"); -JETSUBSTRUCTURE_TABLES_DEF(LcC, "LCC", Hf3PBases, "HF3PBASE", Hf3PBases, "HF3PBASE", Hf3PBases, "HF3PBASE", Hf3PPBases, "HF3PPBASE"); -JETSUBSTRUCTURE_TABLES_DEF(BplusC, "BPLUSC", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0PBases, "HFD0PBASE"); +JETSUBSTRUCTURE_TABLES_DEF(LcC, "LCC", HfLcBases, "HFLcBASE", HfLcBases, "HFLcBASE", HfLcBases, "HFLcBASE", HfLcPBases, "HFLcPBASE"); +JETSUBSTRUCTURE_TABLES_DEF(BplusC, "BPC", HfBplusBases, "HFBPBASE", HfBplusBases, "HFBPBASE", HfBplusBases, "HFBPBASE", HfBplusPBases, "HFBPPBASE"); JETSUBSTRUCTURE_TABLES_DEF(DielectronC, "DIELC", Dielectrons, "RTDIELECTRON", Dielectrons, "RTDIELECTRON", Dielectrons, "RTDIELECTRON", JDielectronMcs, "JDIELMC"); } // namespace o2::aod diff --git a/PWGJE/DataModel/JetSubtraction.h b/PWGJE/DataModel/JetSubtraction.h index 1992283865c..3f78c05ec58 100644 --- a/PWGJE/DataModel/JetSubtraction.h +++ b/PWGJE/DataModel/JetSubtraction.h @@ -54,22 +54,22 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfD0PBases, "_0"); namespace bkglc { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Hf3PBases, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfLcBases, "_0"); } // namespace bkglc namespace bkglcmc { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Hf3PPBases, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfLcPBases, "_0"); } // namespace bkglcmc namespace bkgbplus { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfCandBplus, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfBplusBases, "_0"); } // namespace bkgbplus namespace bkgbplusmc { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfCandBplusMcGen, "_0"); // change this!! +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfBplusPBases, "_0"); } // namespace bkgbplusmc namespace bkgdielectron @@ -117,13 +117,13 @@ DECLARE_SOA_TABLE(BkgLcMcRhos, "AOD", "BkgLcMcRho", bkgrho::RhoM, o2::soa::Marker<5>); -DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgBPlRho", +DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, o2::soa::Marker<6>); -DECLARE_SOA_TABLE(BkgBplusMcRhos, "AOD", "BkgBPlMcRho", +DECLARE_SOA_TABLE(BkgBplusMcRhos, "AOD", "BkgBPMcRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, @@ -246,7 +246,7 @@ DECLARE_SOA_TABLE(JMcParticleLcSubs, "AOD", "JMcPartLcSubs", using JMcParticleLcSub = JMcParticleLcSubs::iterator; -DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPlSubs", +DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPSubs", o2::soa::Index<>, bkgbplus::CandidateId, jtrack::Pt, @@ -261,7 +261,7 @@ DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPlSubs", using JTrackBplusSub = JTrackBplusSubs::iterator; -DECLARE_SOA_TABLE(JMcParticleBplusSubs, "AOD", "JMcPartBPlSubs", +DECLARE_SOA_TABLE(JMcParticleBplusSubs, "AOD", "JMcPartBPSubs", o2::soa::Index<>, bkgbplusmc::CandidateId, jmcparticle::Pt, diff --git a/PWGJE/JetFinders/CMakeLists.txt b/PWGJE/JetFinders/CMakeLists.txt index 9be82d6180b..ba4dbb132fc 100644 --- a/PWGJE/JetFinders/CMakeLists.txt +++ b/PWGJE/JetFinders/CMakeLists.txt @@ -89,6 +89,21 @@ o2physics_add_dpl_workflow(jet-finder-lc-mcp-charged PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-finder-bplus-data-charged + SOURCES jetFinderBplusDataCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-finder-bplus-mcd-charged + SOURCES jetFinderBplusMCDCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-finder-bplus-mcp-charged + SOURCES jetFinderBplusMCPCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-finder-v0-data-charged SOURCES jetFinderV0DataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport diff --git a/PWGJE/JetFinders/jetFinderBplusDataCharged.cxx b/PWGJE/JetFinders/jetFinderBplusDataCharged.cxx new file mode 100644 index 00000000000..402527211fb --- /dev/null +++ b/PWGJE/JetFinders/jetFinderBplusDataCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ data charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/JetFinders/jetFinderHF.cxx" + +using JetFinderBplusDataCharged = JetFinderHFTask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{{{"processChargedJetsData", true}}}, + TaskName{"jet-finder-bplus-data-charged"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx b/PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx new file mode 100644 index 00000000000..4eed52e30b3 --- /dev/null +++ b/PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ mcd charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/JetFinders/jetFinderHF.cxx" + +using JetFinderBplusMCDetectorLevelCharged = JetFinderHFTask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{{{"processChargedJetsMCD", true}}}, + TaskName{"jet-finder-bplus-mcd-charged"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx b/PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx new file mode 100644 index 00000000000..83a1e7c9d60 --- /dev/null +++ b/PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ mcp charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/JetFinders/jetFinderHF.cxx" + +using JetFinderBplusMCParticleLevelCharged = JetFinderHFTask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{{{"processChargedJetsMCP", true}}}, + TaskName{"jet-finder-bplus-mcp-charged"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/JetFinders/jetFinderHF.cxx b/PWGJE/JetFinders/jetFinderHF.cxx index 3117ac42f29..53b6114cbe7 100644 --- a/PWGJE/JetFinders/jetFinderHF.cxx +++ b/PWGJE/JetFinders/jetFinderHF.cxx @@ -26,22 +26,6 @@ using namespace o2::analysis; using namespace o2::framework; using namespace o2::framework::expressions; -/* -void customize(std::vector& workflowOptions) -{ - std::vector hfjetworkflows{{"d0-data-charged", VariantType::Int, 1, {"D0 jets charged data"}}, - {"d0-mcd-charged", VariantType::Int, 0, {"D0 jets charged MCD"}}, - {"d0-mcp-charged", VariantType::Int, 0, {"D0 jets charged MCD"}}, - {"bplus-data-charged", VariantType::Int, 0, {"B+ jets charged MCD"}}, - {"bplus-mcd-charged", VariantType::Int, 0, {"B+ jets charged MCD"}}, - {"bplus-mcp-charged", VariantType::Int, 0, {"B+ jets charged MCD"}}, - {"lc-data-charged", VariantType::Int, 0, {"Lc jets charged MCD"}}, - {"lc-mcd-charged", VariantType::Int, 0, {"Lc jets charged MCD"}}, - {"lc-mcp-charged", VariantType::Int, 0, {"Lc jets charged MCD"}}}; - std::swap(workflowOptions, hfjetworkflows); -} -*/ - // NB: runDataProcessing.h must be included after customize! #include "Framework/runDataProcessing.h" diff --git a/PWGJE/TableProducer/CMakeLists.txt b/PWGJE/TableProducer/CMakeLists.txt index 8efe1878755..4e8141566f3 100644 --- a/PWGJE/TableProducer/CMakeLists.txt +++ b/PWGJE/TableProducer/CMakeLists.txt @@ -38,6 +38,11 @@ o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-lc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-bplus + SOURCES derivedDataProducerDummyBplus.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-dielectron SOURCES derivedDataProducerDummyDielectron.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/TableProducer/Matching/CMakeLists.txt b/PWGJE/TableProducer/Matching/CMakeLists.txt index 5cb655eae3a..a3848f352e7 100644 --- a/PWGJE/TableProducer/Matching/CMakeLists.txt +++ b/PWGJE/TableProducer/Matching/CMakeLists.txt @@ -38,6 +38,11 @@ o2physics_add_dpl_workflow(jet-matching-mc-lc-ch PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-matching-mc-bplus-ch + SOURCES jetMatchingMCBplusCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-matching-mc-dielectron-ch SOURCES jetMatchingMCDielectronCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport @@ -63,6 +68,11 @@ o2physics_add_dpl_workflow(jet-matching-mc-sub-lc-ch PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-matching-mc-sub-bplus-ch + SOURCES jetMatchingMCSubBplusCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-matching-mc-sub-dielectron-ch SOURCES jetMatchingMCSubDielectronCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport @@ -83,6 +93,11 @@ o2physics_add_dpl_workflow(jet-matching-sub-lc-ch PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-matching-sub-bplus-ch + SOURCES jetMatchingSubBplusCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-matching-sub-dielectron-ch SOURCES jetMatchingSubDielectronCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport diff --git a/PWGJE/TableProducer/Matching/jetMatchingMC.cxx b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx index 39688616eba..ef56702af09 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMC.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx @@ -102,11 +102,3 @@ struct JetMatchingMc { } PROCESS_SWITCH(JetMatchingMc, processJets, "Perform jet matching", true); }; - -/*using BplusChargedJetMatching = JetMatchingMc, - soa::Join, - aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCParticleLevelJets, - aod::BplusChargedMCParticleLevelJetsMatchedToBplusChargedMCDetectorLevelJets, - aod::CandidatesBplusMCD, - aod::CandidatesBplusMCP, - aod::JDummys>>;*/ diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx new file mode 100644 index 00000000000..8a5705f273f --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using BplusChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCParticleLevelJets, + aod::BplusChargedMCParticleLevelJetsMatchedToBplusChargedMCDetectorLevelJets, + aod::CandidatesBplusMCD, + aod::CandidatesBplusMCP, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-bplus-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx index 26dc0a63b53..9db070ec7b6 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx @@ -90,9 +90,3 @@ struct JetMatchingMcSub { } PROCESS_SWITCH(JetMatchingMcSub, processJets, "Perform jet matching", true); }; - -/*using BplusChargedJetMatching = JetMatchingMcSub, - soa::Join, - aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCDetectorLevelEventWiseSubtractedJets, - aod::BplusChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToBplusChargedMCDetectorLevelJets, - aod::CandidatesBplusMCD>;*/ diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx new file mode 100644 index 00000000000..86db7221aa6 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc subtracted B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx" + +using D0ChargedJetMatchingMCSub = JetMatchingMcSub, + soa::Join, + aod::D0ChargedMCDetectorLevelJetsMatchedToD0ChargedMCDetectorLevelEventWiseSubtractedJets, + aod::D0ChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToD0ChargedMCDetectorLevelJets, + aod::CandidatesD0MCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-d0-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingSub.cxx b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx index 7c31ba437d7..36e809b5129 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingSub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx @@ -88,10 +88,3 @@ struct JetMatchingSub { } PROCESS_SWITCH(JetMatchingSub, processJets, "Perform jet matching", true); }; - -/*using BplusChargedJetMatching = JetMatchingSub, - soa::Join, - aod::BplusChargedJetsMatchedToBplusChargedEventWiseSubtractedJets, - aod::BplusChargedEventWiseSubtractedJetsMatchedToBplusChargedJets, - aod::JTrackBplusSubs, - aod::CandidatesBplusData>;*/ diff --git a/PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx new file mode 100644 index 00000000000..a24b7c6de6f --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching subtracted B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingSub.cxx" + +using BplusChargedJetMatchingSub = JetMatchingSub, + soa::Join, + aod::BplusChargedJetsMatchedToBplusChargedEventWiseSubtractedJets, + aod::BplusChargedEventWiseSubtractedJetsMatchedToBplusChargedJets, + aod::JTrackBplusSubs, + aod::CandidatesBplusData>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-bplus-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/derivedDataProducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx index e0fcdc959ea..0167ceeed5b 100644 --- a/PWGJE/TableProducer/derivedDataProducer.cxx +++ b/PWGJE/TableProducer/derivedDataProducer.cxx @@ -89,6 +89,10 @@ struct JetDerivedDataProducerTask { Produces jLcMcCollisionIdsTable; Produces jLcIdsTable; Produces jLcParticleIdsTable; + Produces jBplusCollisionIdsTable; + Produces jBplusMcCollisionIdsTable; + Produces jBplusIdsTable; + Produces jBplusParticleIdsTable; Produces jV0IdsTable; Produces jV0McCollisionsTable; Produces jV0McCollisionIdsTable; @@ -429,19 +433,19 @@ struct JetDerivedDataProducerTask { } PROCESS_SWITCH(JetDerivedDataProducerTask, processD0MC, "produces derived index for D0 particles", false); - void processLcCollisions(aod::Hf3PCollIds::iterator const& LcCollision) + void processLcCollisions(aod::HfLcCollIds::iterator const& LcCollision) { jLcCollisionIdsTable(LcCollision.collisionId()); } PROCESS_SWITCH(JetDerivedDataProducerTask, processLcCollisions, "produces derived index for Lc collisions", false); - void processLcMcCollisions(aod::Hf3PMcCollIds::iterator const& LcMcCollision) + void processLcMcCollisions(aod::HfLcMcCollIds::iterator const& LcMcCollision) { jLcMcCollisionIdsTable(LcMcCollision.mcCollisionId()); } PROCESS_SWITCH(JetDerivedDataProducerTask, processLcMcCollisions, "produces derived index for Lc MC collisions", false); - void processLc(aod::Hf3PIds::iterator const& Lc, aod::Tracks const&) + void processLc(aod::HfLcIds::iterator const& Lc, aod::Tracks const&) { auto JProng0ID = trackCollisionMapping.find({Lc.prong0Id(), Lc.prong0_as().collisionId()}); auto JProng1ID = trackCollisionMapping.find({Lc.prong1Id(), Lc.prong1_as().collisionId()}); @@ -455,12 +459,44 @@ struct JetDerivedDataProducerTask { } PROCESS_SWITCH(JetDerivedDataProducerTask, processLc, "produces derived index for Lc candidates", false); - void processLcMC(aod::Hf3PPIds::iterator const& Lc) + void processLcMC(aod::HfLcPIds::iterator const& Lc) { jLcParticleIdsTable(Lc.mcCollisionId(), Lc.mcParticleId()); } PROCESS_SWITCH(JetDerivedDataProducerTask, processLcMC, "produces derived index for Lc particles", false); + void processBplusCollisions(aod::HfBplusCollIds::iterator const& BplusCollision) + { + jBplusCollisionIdsTable(BplusCollision.collisionId()); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplusCollisions, "produces derived index for Bplus collisions", false); + + void processBplusMcCollisions(aod::HfBplusMcCollIds::iterator const& BplusMcCollision) + { + jBplusMcCollisionIdsTable(BplusMcCollision.mcCollisionId()); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplusMcCollisions, "produces derived index for Bplus MC collisions", false); + + void processBplus(aod::HfBplusIds::iterator const& Bplus, aod::Tracks const&) + { + auto JProng0ID = trackCollisionMapping.find({Bplus.prong0Id(), Bplus.prong0_as().collisionId()}); + auto JProng1ID = trackCollisionMapping.find({Bplus.prong1Id(), Bplus.prong1_as().collisionId()}); + auto JProng2ID = trackCollisionMapping.find({Bplus.prong2Id(), Bplus.prong2_as().collisionId()}); + if (withCollisionAssociator) { + JProng0ID = trackCollisionMapping.find({Bplus.prong0Id(), Bplus.collisionId()}); + JProng1ID = trackCollisionMapping.find({Bplus.prong1Id(), Bplus.collisionId()}); + JProng2ID = trackCollisionMapping.find({Bplus.prong2Id(), Bplus.collisionId()}); + } + jBplusIdsTable(Bplus.collisionId(), JProng0ID->second, JProng1ID->second, JProng2ID->second); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplus, "produces derived index for Bplus candidates", false); + + void processBplusMC(aod::HfBplusPIds::iterator const& Bplus) + { + jBplusParticleIdsTable(Bplus.mcCollisionId(), Bplus.mcParticleId()); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplusMC, "produces derived index for Bplus particles", false); + void processV0(aod::V0Indices::iterator const& V0, aod::Tracks const&) { auto JPosTrackID = trackCollisionMapping.find({V0.posTrackId(), V0.posTrack_as().collisionId()}); diff --git a/PWGJE/TableProducer/derivedDataProducerDummy.cxx b/PWGJE/TableProducer/derivedDataProducerDummy.cxx index efbd1fa4cf5..da60109d94f 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummy.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummy.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// temporary task to produce HF tables needed when making inclusive derived data - should become obsolete when tables are able to be prouduced based on a configurable +// temporary task to produce HF and DQ tables needed when making inclusive derived data - should become obsolete when tables are able to be prouduced based on a configurable // /// \author Nima Zardoshti @@ -38,16 +38,28 @@ struct JetDerivedDataProducerDummyTask { Produces d0McCollisionsTable; Produces d0ParticlesTable; - Produces lcCollisionsTable; - Produces lcCollisionsMatchingTable; - Produces lcsTable; - Produces lcParsTable; - Produces lcParExtrasTable; - Produces lcSelsTable; - Produces lcMlsTable; - Produces lcMcsTable; - Produces lcMcCollisionsTable; - Produces lcParticlesTable; + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; Produces dielectronCollisionsTable; Produces dielectronTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx b/PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx new file mode 100644 index 00000000000..8f3e238710a --- /dev/null +++ b/PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx @@ -0,0 +1,69 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// temporary task to produce HF and DQ tables needed when making B+ jet derived data - should become obsolete when tables are able to be prouduced based on a configurable +// +/// \author Nima Zardoshti + +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" +#include "Framework/runDataProcessing.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct JetDerivedDataProducerDummyTask { + + Produces d0CollisionsTable; + Produces d0CollisionsMatchingTable; + Produces d0sTable; + Produces d0ParsTable; + Produces d0ParExtrasTable; + Produces d0SelsTable; + Produces d0MlsTable; + Produces d0McsTable; + Produces d0McCollisionsTable; + Produces d0ParticlesTable; + + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces dielectronCollisionsTable; + Produces dielectronTable; + + void init(InitContext const&) + { + } + + void processDummy(aod::JDummys const&) + { + } + PROCESS_SWITCH(JetDerivedDataProducerDummyTask, processDummy, "leaves all tables empty", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"jet-deriveddata-producer-dummy"})}; +} diff --git a/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx index 8b02d7cdeab..c28b0e44dfe 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx @@ -27,16 +27,28 @@ using namespace o2::framework::expressions; struct JetDerivedDataProducerDummyD0Task { - Produces lcCollisionsTable; - Produces lcCollisionsMatchingTable; - Produces lcsTable; - Produces lcParsTable; - Produces lcParExtrasTable; - Produces lcSelsTable; - Produces lcMlsTable; - Produces lcMcsTable; - Produces lcMcCollisionsTable; - Produces lcParticlesTable; + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; Produces dielectronCollisionsTable; Produces dielectronTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx index 784fa3e4826..9df74703902 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx @@ -38,16 +38,28 @@ struct JetDerivedDataProducerDummyDielectronTask { Produces d0McCollisionsTable; Produces d0ParticlesTable; - Produces lcCollisionsTable; - Produces lcCollisionsMatchingTable; - Produces lcsTable; - Produces lcParsTable; - Produces lcParExtrasTable; - Produces lcSelsTable; - Produces lcMlsTable; - Produces lcMcsTable; - Produces lcMcCollisionsTable; - Produces lcParticlesTable; + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; void init(InitContext const&) { diff --git a/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx index 05e1384deac..5550e97a9ae 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx @@ -38,6 +38,18 @@ struct JetDerivedDataProducerDummyLcTask { Produces d0McCollisionsTable; Produces d0ParticlesTable; + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; + Produces dielectronCollisionsTable; Produces dielectronTable; diff --git a/PWGJE/TableProducer/derivedDataWriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx index eb5858184da..d82f8d58b45 100644 --- a/PWGJE/TableProducer/derivedDataWriter.cxx +++ b/PWGJE/TableProducer/derivedDataWriter.cxx @@ -51,6 +51,9 @@ struct JetDerivedDataWriter { Configurable thresholdChargedLcJetPtMin{"thresholdChargedLcJetPtMin", 0.0, "Minimum charged Lc jet pt to accept event"}; Configurable thresholdChargedEventWiseSubtractedLcJetPtMin{"thresholdChargedEventWiseSubtractedLcJetPtMin", 0.0, "Minimum charged event-wise subtracted Lc jet pt to accept event"}; Configurable thresholdChargedLcMCPJetPtMin{"thresholdChargedLcMCPJetPtMin", 0.0, "Minimum charged Lc mcp jet pt to accept event"}; + Configurable thresholdChargedBplusJetPtMin{"thresholdChargedBplusJetPtMin", 0.0, "Minimum charged Bplus jet pt to accept event"}; + Configurable thresholdChargedEventWiseSubtractedBplusJetPtMin{"thresholdChargedEventWiseSubtractedBplusJetPtMin", 0.0, "Minimum charged event-wise subtracted Bplus jet pt to accept event"}; + Configurable thresholdChargedBplusMCPJetPtMin{"thresholdChargedBplusMCPJetPtMin", 0.0, "Minimum charged Bplus mcp jet pt to accept event"}; Configurable thresholdChargedDielectronJetPtMin{"thresholdChargedDielectronJetPtMin", 0.0, "Minimum charged Dielectron jet pt to accept event"}; Configurable thresholdChargedEventWiseSubtractedDielectronJetPtMin{"thresholdChargedEventWiseSubtractedDielectronJetPtMin", 0.0, "Minimum charged event-wise subtracted Dielectron jet pt to accept event"}; Configurable thresholdChargedDielectronMCPJetPtMin{"thresholdChargedDielectronMCPJetPtMin", 0.0, "Minimum charged Dielectron mcp jet pt to accept event"}; @@ -67,9 +70,10 @@ struct JetDerivedDataWriter { Configurable trackEtaSelectionMax{"trackEtaSelectionMax", 0.9, "only save tracks that have an eta smaller than this eta"}; Configurable saveBCsTable{"saveBCsTable", true, "save the bunch crossing table to the output"}; Configurable saveClustersTable{"saveClustersTable", false, "save the clusters table to the output"}; - Configurable saveD0Table{"saveD0Table", false, "save the D0 table to the output"}; - Configurable saveLcTable{"saveLcTable", false, "save the Lc table to the output"}; - Configurable saveDielectronTable{"saveDielectronTable", false, "save the Dielectron table to the output"}; + Configurable saveD0Table{"saveD0Table", false, "save the D0 tables to the output"}; + Configurable saveLcTable{"saveLcTable", false, "save the Lc tables to the output"}; + Configurable saveBplusTable{"saveBplusTable", false, "save the Bplus tables to the output"}; + Configurable saveDielectronTable{"saveDielectronTable", false, "save the Dielectron tables to the output"}; Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; } config; @@ -102,8 +106,10 @@ struct JetDerivedDataWriter { Produces storedD0sTable; Produces storedD0ParsTable; Produces storedD0ParExtrasTable; + Produces storedD0ParDaughtersDummyTable; Produces storedD0SelsTable; Produces storedD0MlsTable; + Produces storedD0MlDughtersDummyTable; Produces storedD0McsTable; Produces storedD0IdsTable; Produces storedD0McCollisionsTable; @@ -112,21 +118,40 @@ struct JetDerivedDataWriter { Produces storedD0ParticlesTable; Produces storedD0ParticleIdsTable; - Produces storedLcCollisionsTable; + Produces storedLcCollisionsTable; Produces storedLcCollisionIdsTable; - Produces storedLcsTable; - Produces storedLcParsTable; - Produces storedLcParExtrasTable; - Produces storedLcSelsTable; - Produces storedLcMlsTable; - Produces storedLcMcsTable; + Produces storedLcsTable; + Produces storedLcParsTable; + Produces storedLcParExtrasTable; + Produces storedLcParDaughtersDummyTable; + Produces storedLcSelsTable; + Produces storedLcMlsTable; + Produces storedLcMlDughtersDummyTable; + Produces storedLcMcsTable; Produces storedLcIdsTable; - Produces storedLcMcCollisionsTable; + Produces storedLcMcCollisionsTable; Produces storedLcMcCollisionIdsTable; - Produces storedLcMcCollisionsMatchingTable; - Produces storedLcParticlesTable; + Produces storedLcMcCollisionsMatchingTable; + Produces storedLcParticlesTable; Produces storedLcParticleIdsTable; + Produces storedBplusCollisionsTable; + Produces storedBplusCollisionIdsTable; + Produces storedBplussTable; + Produces storedBplusParsTable; + Produces storedBplusParExtrasTable; + Produces storedBplusParD0sTable; + Produces storedBplusSelsDummyTable; + Produces storedBplusMlsTable; + Produces storedBplusMlD0sTable; + Produces storedBplusMcsTable; + Produces storedBplusIdsTable; + Produces storedBplusMcCollisionsTable; + Produces storedBplusMcCollisionIdsTable; + Produces storedBplusMcCollisionsMatchingTable; + Produces storedBplusParticlesTable; + Produces storedBplusParticleIdsTable; + Produces storedDielectronCollisionsTable; Produces storedDielectronCollisionIdsTable; Produces storedDielectronsTable; @@ -143,13 +168,16 @@ struct JetDerivedDataWriter { Preslice> TracksPerCollision = aod::jtrack::collisionId; Preslice> ClustersPerCollision = aod::jcluster::collisionId; Preslice> D0McCollisionsPerMcCollision = aod::jd0indices::mcCollisionId; - Preslice> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + Preslice> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + Preslice> BplusMcCollisionsPerMcCollision = aod::jbplusindices::mcCollisionId; Preslice DielectronMcCollisionsPerMcCollision = aod::jdielectronindices::mcCollisionId; Preslice D0CollisionsPerCollision = aod::jd0indices::collisionId; Preslice LcCollisionsPerCollision = aod::jlcindices::collisionId; + Preslice BplusCollisionsPerCollision = aod::jbplusindices::collisionId; Preslice DielectronCollisionsPerCollision = aod::jdielectronindices::collisionId; Preslice D0sPerCollision = aod::jd0indices::collisionId; Preslice LcsPerCollision = aod::jlcindices::collisionId; + Preslice BplussPerCollision = aod::jbplusindices::collisionId; Preslice DielectronsPerCollision = aod::jdielectronindices::collisionId; PresliceUnsorted EMCTrackPerTrack = aod::jemctrack::trackId; @@ -277,6 +305,12 @@ struct JetDerivedDataWriter { selectionObjectPtMin = config.thresholdChargedEventWiseSubtractedLcJetPtMin; } else if constexpr (std::is_same_v, aod::LcChargedMCParticleLevelJets>) { selectionObjectPtMin = config.thresholdChargedLcMCPJetPtMin; + } else if constexpr (std::is_same_v, aod::BplusChargedJets> || std::is_same_v, aod::BplusChargedMCDetectorLevelJets>) { + selectionObjectPtMin = config.thresholdChargedBplusJetPtMin; + } else if constexpr (std::is_same_v, aod::BplusChargedEventWiseSubtractedJets> || std::is_same_v, aod::BplusChargedMCDetectorLevelEventWiseSubtractedJets>) { + selectionObjectPtMin = config.thresholdChargedEventWiseSubtractedBplusJetPtMin; + } else if constexpr (std::is_same_v, aod::BplusChargedMCParticleLevelJets>) { + selectionObjectPtMin = config.thresholdChargedBplusMCPJetPtMin; } else if constexpr (std::is_same_v, aod::DielectronChargedJets> || std::is_same_v, aod::DielectronChargedMCDetectorLevelJets>) { selectionObjectPtMin = config.thresholdChargedDielectronJetPtMin; } else if constexpr (std::is_same_v, aod::DielectronChargedEventWiseSubtractedJets> || std::is_same_v, aod::DielectronChargedMCDetectorLevelEventWiseSubtractedJets>) { @@ -346,6 +380,11 @@ struct JetDerivedDataWriter { PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingLcChargedMCDJets, "process Lc charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingLcChargedMCDetectorLevelEventWiseSubtractedJets, "process Lc event-wise subtracted charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingLcChargedMCPJets, "process Lc charged mcp jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedJets, "process Bplus charged jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedEventWiseSubtractedJets, "process Bplus event-wise subtracted charged jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedMCDJets, "process Bplus charged mcd jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedMCDetectorLevelEventWiseSubtractedJets, "process Bplus event-wise subtracted charged mcd jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedMCPJets, "process Bplus charged mcp jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingDielectronChargedJets, "process Dielectron charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingDielectronChargedEventWiseSubtractedJets, "process Dielectron event-wise subtracted charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingDielectronChargedMCDJets, "process Dielectron charged mcd jets", false); @@ -363,7 +402,7 @@ struct JetDerivedDataWriter { } PROCESS_SWITCH(JetDerivedDataWriter, processStoreDummyTable, "write out dummy output table", true); - void processStoreData(soa::Join::iterator const& collision, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0Data const& D0s, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcData const& Lcs, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronData const& Dielectrons) + void processStoreData(soa::Join::iterator const& collision, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0Data const& D0s, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcData const& Lcs, aod::CollisionsBplus const& BplusCollisions, aod::CandidatesBplusData const& Bpluss, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronData const& Dielectrons) { std::map bcMapping; std::map trackMapping; @@ -429,12 +468,12 @@ struct JetDerivedDataWriter { if (config.saveD0Table) { int32_t collisionD0Index = -1; for (const auto& D0Collision : D0Collisions) { // should only ever be one - jethfutilities::fillD0CollisionTable(D0Collision, products.storedD0CollisionsTable, collisionD0Index); + jethfutilities::fillHFCollisionTable(D0Collision, products.storedD0CollisionsTable, collisionD0Index); products.storedD0CollisionIdsTable(products.storedJCollisionsTable.lastIndex()); } for (const auto& D0 : D0s) { int32_t D0Index = -1; - jethfutilities::fillD0CandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0McsTable, D0Index); + jethfutilities::fillHFCandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0ParDaughtersDummyTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0MlDughtersDummyTable, products.storedD0McsTable, D0Index); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -453,12 +492,12 @@ struct JetDerivedDataWriter { if (config.saveLcTable) { int32_t collisionLcIndex = -1; for (const auto& LcCollision : LcCollisions) { // should only ever be one - jethfutilities::fillLcCollisionTable(LcCollision, products.storedLcCollisionsTable, collisionLcIndex); + jethfutilities::fillHFCollisionTable(LcCollision, products.storedLcCollisionsTable, collisionLcIndex); products.storedLcCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); } for (const auto& Lc : Lcs) { int32_t LcIndex = -1; - jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMcsTable, LcIndex); + jethfutilities::fillHFCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcParDaughtersDummyTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMlDughtersDummyTable, products.storedLcMcsTable, LcIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -478,6 +517,34 @@ struct JetDerivedDataWriter { products.storedLcIdsTable(products.storedJCollisionsTable.lastIndex(), prong0Id, prong1Id, prong2Id); } } + if (config.saveBplusTable) { + int32_t collisionBplusIndex = -1; + for (const auto& BplusCollision : BplusCollisions) { // should only ever be one + jethfutilities::fillHFCollisionTable(BplusCollision, products.storedBplusCollisionsTable, collisionBplusIndex); + products.storedBplusCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); + } + for (const auto& Bplus : Bpluss) { + int32_t BplusIndex = -1; + jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsDummyTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); + + int32_t prong0Id = -1; + int32_t prong1Id = -1; + int32_t prong2Id = -1; + auto JtrackIndex = trackMapping.find(Bplus.prong0Id()); + if (JtrackIndex != trackMapping.end()) { + prong0Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong1Id()); + if (JtrackIndex != trackMapping.end()) { + prong1Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong2Id()); + if (JtrackIndex != trackMapping.end()) { + prong2Id = JtrackIndex->second; + } + products.storedBplusIdsTable(products.storedJCollisionsTable.lastIndex(), prong0Id, prong1Id, prong2Id); + } + } if (config.saveDielectronTable) { int32_t collisionDielectronIndex = -1; for (const auto& DielectronCollision : DielectronCollisions) { // should only ever be one @@ -507,13 +574,14 @@ struct JetDerivedDataWriter { // to run after all jet selections PROCESS_SWITCH(JetDerivedDataWriter, processStoreData, "write out data output tables", false); - void processStoreMC(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, soa::Join const& particles, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0MCD const& D0s, soa::Join const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcMCD const& Lcs, soa::Join const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronMCD const& Dielectrons, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) + void processStoreMC(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, soa::Join const& particles, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0MCD const& D0s, soa::Join const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcMCD const& Lcs, soa::Join const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::CollisionsBplus const& BplusCollisions, aod::CandidatesBplusMCD const& Bpluss, soa::Join const& BplusMcCollisions, aod::CandidatesBplusMCP const& BplusParticles, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronMCD const& Dielectrons, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) { std::map bcMapping; std::map paticleMapping; std::map mcCollisionMapping; std::map D0CollisionMapping; std::map LcCollisionMapping; + std::map BplusCollisionMapping; int particleTableIndex = 0; for (auto mcCollision : mcCollisions) { bool collisionSelected = false; @@ -571,12 +639,12 @@ struct JetDerivedDataWriter { const auto d0McCollisionsPerMcCollision = D0McCollisions.sliceBy(D0McCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionD0Index = -1; for (const auto& d0McCollisionPerMcCollision : d0McCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillD0McCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); + jethfutilities::fillHFMcCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); products.storedD0McCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& D0Particle : D0Particles) { int32_t D0ParticleIndex = -1; - jethfutilities::fillD0CandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); + jethfutilities::fillHFCandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); int32_t D0ParticleId = -1; auto JParticleIndex = paticleMapping.find(D0Particle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -590,12 +658,12 @@ struct JetDerivedDataWriter { const auto lcMcCollisionsPerMcCollision = LcMcCollisions.sliceBy(LcMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionLcIndex = -1; for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillLcMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); products.storedLcMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& LcParticle : LcParticles) { int32_t LcParticleIndex = -1; - jethfutilities::fillLcCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); + jethfutilities::fillHFCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); int32_t LcParticleId = -1; auto JParticleIndex = paticleMapping.find(LcParticle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -604,6 +672,24 @@ struct JetDerivedDataWriter { products.storedLcParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), LcParticleId); } } + if (config.saveBplusTable) { + const auto lcMcCollisionsPerMcCollision = BplusMcCollisions.sliceBy(BplusMcCollisionsPerMcCollision, mcCollision.globalIndex()); + int32_t mcCollisionBplusIndex = -1; + for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedBplusMcCollisionsTable, mcCollisionBplusIndex); + products.storedBplusMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); + } + for (const auto& BplusParticle : BplusParticles) { + int32_t BplusParticleIndex = -1; + jethfutilities::fillHFCandidateMcTable(BplusParticle, mcCollisionBplusIndex, products.storedBplusParticlesTable, BplusParticleIndex); + int32_t BplusParticleId = -1; + auto JParticleIndex = paticleMapping.find(BplusParticle.mcParticleId()); + if (JParticleIndex != paticleMapping.end()) { + BplusParticleId = JParticleIndex->second; + } + products.storedBplusParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), BplusParticleId); + } + } if (config.saveDielectronTable) { const auto dielectronMcCollisionsPerMcCollision = DielectronMcCollisions.sliceBy(DielectronMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionDielectronIndex = -1; @@ -752,14 +838,14 @@ struct JetDerivedDataWriter { const auto d0CollisionsPerCollision = D0Collisions.sliceBy(D0CollisionsPerCollision, collision.globalIndex()); int32_t collisionD0Index = -1; for (const auto& d0CollisionPerCollision : d0CollisionsPerCollision) { // should only ever be one - jethfutilities::fillD0CollisionTable(d0CollisionPerCollision, products.storedD0CollisionsTable, collisionD0Index); + jethfutilities::fillHFCollisionTable(d0CollisionPerCollision, products.storedD0CollisionsTable, collisionD0Index); products.storedD0CollisionIdsTable(products.storedJCollisionsTable.lastIndex()); D0CollisionMapping.insert(std::make_pair(d0CollisionPerCollision.globalIndex(), products.storedD0CollisionsTable.lastIndex())); } const auto d0sPerCollision = D0s.sliceBy(D0sPerCollision, collision.globalIndex()); for (const auto& D0 : d0sPerCollision) { int32_t D0Index = -1; - jethfutilities::fillD0CandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0McsTable, D0Index); + jethfutilities::fillHFCandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0ParDaughtersDummyTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0MlDughtersDummyTable, products.storedD0McsTable, D0Index); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -779,14 +865,14 @@ struct JetDerivedDataWriter { const auto lcCollisionsPerCollision = LcCollisions.sliceBy(LcCollisionsPerCollision, collision.globalIndex()); int32_t collisionLcIndex = -1; for (const auto& lcCollisionPerCollision : lcCollisionsPerCollision) { // should only ever be one - jethfutilities::fillLcCollisionTable(lcCollisionPerCollision, products.storedLcCollisionsTable, collisionLcIndex); + jethfutilities::fillHFCollisionTable(lcCollisionPerCollision, products.storedLcCollisionsTable, collisionLcIndex); products.storedLcCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); LcCollisionMapping.insert(std::make_pair(lcCollisionPerCollision.globalIndex(), products.storedLcCollisionsTable.lastIndex())); } const auto lcsPerCollision = Lcs.sliceBy(LcsPerCollision, collision.globalIndex()); for (const auto& Lc : lcsPerCollision) { int32_t LcIndex = -1; - jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMcsTable, LcIndex); + jethfutilities::fillHFCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcParDaughtersDummyTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMlDughtersDummyTable, products.storedLcMcsTable, LcIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -807,6 +893,38 @@ struct JetDerivedDataWriter { } } + if (config.saveBplusTable) { + const auto lcCollisionsPerCollision = BplusCollisions.sliceBy(BplusCollisionsPerCollision, collision.globalIndex()); + int32_t collisionBplusIndex = -1; + for (const auto& lcCollisionPerCollision : lcCollisionsPerCollision) { // should only ever be one + jethfutilities::fillHFCollisionTable(lcCollisionPerCollision, products.storedBplusCollisionsTable, collisionBplusIndex); + products.storedBplusCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); + BplusCollisionMapping.insert(std::make_pair(lcCollisionPerCollision.globalIndex(), products.storedBplusCollisionsTable.lastIndex())); + } + const auto lcsPerCollision = Bpluss.sliceBy(BplussPerCollision, collision.globalIndex()); + for (const auto& Bplus : lcsPerCollision) { + int32_t BplusIndex = -1; + jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsDummyTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); + + int32_t prong0Id = -1; + int32_t prong1Id = -1; + int32_t prong2Id = -1; + auto JtrackIndex = trackMapping.find(Bplus.prong0Id()); + if (JtrackIndex != trackMapping.end()) { + prong0Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong1Id()); + if (JtrackIndex != trackMapping.end()) { + prong1Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong2Id()); + if (JtrackIndex != trackMapping.end()) { + prong2Id = JtrackIndex->second; + } + products.storedBplusIdsTable(products.storedJCollisionsTable.lastIndex(), prong0Id, prong1Id, prong2Id); + } + } + if (config.saveDielectronTable) { const auto dielectronCollisionsPerCollision = DielectronCollisions.sliceBy(DielectronCollisionsPerCollision, collision.globalIndex()); int32_t collisionDielectronIndex = -1; @@ -862,6 +980,20 @@ struct JetDerivedDataWriter { products.storedLcMcCollisionsMatchingTable(lcCollisionIDs); } } + + if (config.saveBplusTable) { + const auto lcMcCollisionsPerMcCollision = BplusMcCollisions.sliceBy(BplusMcCollisionsPerMcCollision, mcCollision.globalIndex()); + for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should just be one + std::vector lcCollisionIDs; + for (auto const& lcCollisionPerMcCollision : lcMcCollisionPerMcCollision.template hfCollBases_as()) { + auto lcCollisionIndex = BplusCollisionMapping.find(lcCollisionPerMcCollision.globalIndex()); + if (lcCollisionIndex != BplusCollisionMapping.end()) { + lcCollisionIDs.push_back(lcCollisionIndex->second); + } + } + products.storedBplusMcCollisionsMatchingTable(lcCollisionIDs); + } + } } } } @@ -869,7 +1001,7 @@ struct JetDerivedDataWriter { // to run after all jet selections PROCESS_SWITCH(JetDerivedDataWriter, processStoreMC, "write out data output tables for mc", false); - void processStoreMCP(soa::Join const& mcCollisions, soa::Join const& particles, aod::McCollisionsD0 const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::McCollisionsLc const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) + void processStoreMCP(soa::Join const& mcCollisions, soa::Join const& particles, aod::McCollisionsD0 const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::McCollisionsLc const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::McCollisionsBplus const& BplusMcCollisions, aod::CandidatesBplusMCP const& BplusParticles, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) { int particleTableIndex = 0; @@ -918,12 +1050,12 @@ struct JetDerivedDataWriter { const auto d0McCollisionsPerMcCollision = D0McCollisions.sliceBy(D0McCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionD0Index = -1; for (const auto& d0McCollisionPerMcCollision : d0McCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillD0McCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); + jethfutilities::fillHFMcCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); products.storedD0McCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& D0Particle : D0Particles) { int32_t D0ParticleIndex = -1; - jethfutilities::fillD0CandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); + jethfutilities::fillHFCandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); int32_t D0ParticleId = -1; auto JParticleIndex = paticleMapping.find(D0Particle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -936,12 +1068,12 @@ struct JetDerivedDataWriter { const auto lcMcCollisionsPerMcCollision = LcMcCollisions.sliceBy(LcMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionLcIndex = -1; for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillLcMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); products.storedLcMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& LcParticle : LcParticles) { int32_t LcParticleIndex = -1; - jethfutilities::fillLcCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); + jethfutilities::fillHFCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); int32_t LcParticleId = -1; auto JParticleIndex = paticleMapping.find(LcParticle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -950,6 +1082,24 @@ struct JetDerivedDataWriter { products.storedLcParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), LcParticleId); } } + if (config.saveBplusTable) { + const auto lcMcCollisionsPerMcCollision = BplusMcCollisions.sliceBy(BplusMcCollisionsPerMcCollision, mcCollision.globalIndex()); + int32_t mcCollisionBplusIndex = -1; + for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedBplusMcCollisionsTable, mcCollisionBplusIndex); + products.storedBplusMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); + } + for (const auto& BplusParticle : BplusParticles) { + int32_t BplusParticleIndex = -1; + jethfutilities::fillHFCandidateMcTable(BplusParticle, mcCollisionBplusIndex, products.storedBplusParticlesTable, BplusParticleIndex); + int32_t BplusParticleId = -1; + auto JParticleIndex = paticleMapping.find(BplusParticle.mcParticleId()); + if (JParticleIndex != paticleMapping.end()) { + BplusParticleId = JParticleIndex->second; + } + products.storedBplusParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), BplusParticleId); + } + } if (config.saveDielectronTable) { const auto dielectronMcCollisionsPerMcCollision = DielectronMcCollisions.sliceBy(DielectronMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionDielectronIndex = -1; diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index 18b1249ed95..f1dae6bb061 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -163,7 +163,7 @@ struct eventWiseConstituentSubtractorTask { analyseHFMc(tracks, candidates, particleSubtractedLcTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processLcMcCollisions, "Fill table of subtracted tracks for collisions with Lc MCP candidates", false); - /* + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedBplusTable); @@ -175,7 +175,7 @@ struct eventWiseConstituentSubtractorTask { analyseHFMc(tracks, candidates, particleSubtractedBplusTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusMcCollisions, "Fill table of subtracted tracks for collisions with Bplus MCP candidates", false); - */ + void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedDielectronTable); diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index 83429af3f5b..ff0072f7052 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -152,7 +152,7 @@ struct RhoEstimatorTask { } } PROCESS_SWITCH(RhoEstimatorTask, processLcMcCollisions, "Fill rho tables for collisions with Lc MCP candidates", false); - /* + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesBplusData const& candidates) { inputParticles.clear(); @@ -178,7 +178,7 @@ struct RhoEstimatorTask { } } PROCESS_SWITCH(RhoEstimatorTask, processBplusMcCollisions, "Fill rho tables for collisions with Bplus MCP candidates", false); - */ + void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesDielectronData const& candidates) { inputParticles.clear(); diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 50f9600c2ed..4582452a7ab 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -60,6 +60,10 @@ if(FastJet_FOUND) SOURCES jetSubstructureLc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-substructure-bplus + SOURCES jetSubstructureBplus.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-substructure-dielectron SOURCES jetSubstructureDielectron.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore @@ -72,6 +76,10 @@ if(FastJet_FOUND) SOURCES jetSubstructureLcOutput.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-substructure-bplus-output + SOURCES jetSubstructureBplusOutput.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-substructure-dielectron-output SOURCES jetSubstructureDielectronOutput.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore @@ -104,6 +112,10 @@ if(FastJet_FOUND) SOURCES jetFinderLcQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-finder-bplus-qa + SOURCES jetFinderBplusQA.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-dielectron-qa SOURCES jetFinderDielectronQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/jetFinderBplusQA.cxx b/PWGJE/Tasks/jetFinderBplusQA.cxx new file mode 100644 index 00000000000..4b7c42b4580 --- /dev/null +++ b/PWGJE/Tasks/jetFinderBplusQA.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ charged QA task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetFinderHFQA.cxx" + +using JetFinderBplusQATask = JetFinderHFQATask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-finder-charged-bplus-qa"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureBplus.cxx b/PWGJE/Tasks/jetSubstructureBplus.cxx new file mode 100644 index 00000000000..61228fe5b19 --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureBplus.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHF.cxx" + +using JetSubstructureBplus = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesBplusData, aod::CandidatesBplusMCP, aod::BplusCJetSSs, aod::BplusCMCDJetSSs, aod::BplusCMCPJetSSs, aod::BplusCEWSJetSSs, aod::JTrackBplusSubs>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-substructure-bplus"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureBplusOutput.cxx b/PWGJE/Tasks/jetSubstructureBplusOutput.cxx new file mode 100644 index 00000000000..89c0b94560f --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureBplusOutput.cxx @@ -0,0 +1,26 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure output B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" + +using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusParD0s, aod::JDumBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMlD0s, aod::StoredHfBplusMcs, aod::StoredHfBplusMcCollBases, aod::StoredHfBplusMcRCollIds, aod::StoredHfBplusPBases>; // all the 3P tables have been made into Bplus but they might be made common + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-bplus-output"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureD0Output.cxx b/PWGJE/Tasks/jetSubstructureD0Output.cxx index d53894fba01..7eb6b474eaf 100644 --- a/PWGJE/Tasks/jetSubstructureD0Output.cxx +++ b/PWGJE/Tasks/jetSubstructureD0Output.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JTrackD0Subs, soa::Join, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::StoredHfD0Mcs, aod::StoredHfD0McCollBases, aod::StoredHfD0McRCollIds, aod::StoredHfD0PBases>; +using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JTrackD0Subs, soa::Join, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::JDumD0ParDaus, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::JDumD0MlDaus, aod::StoredHfD0Mcs, aod::StoredHfD0McCollBases, aod::StoredHfD0McRCollIds, aod::StoredHfD0PBases>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx b/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx index 2e1e7eb12df..76cdd6e7643 100644 --- a/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputDielectron = JetSubstructureHFOutputTask, soa::Join, aod::DielectronCJetCOs, aod::DielectronCJetOs, aod::DielectronCJetSSOs, aod::DielectronCJetMOs, soa::Join, aod::DielectronCMCDJetCOs, aod::DielectronCMCDJetOs, aod::DielectronCMCDJetSSOs, aod::DielectronCMCDJetMOs, soa::Join, aod::DielectronCMCPJetCOs, aod::DielectronCMCPJetOs, aod::DielectronCMCPJetSSOs, aod::DielectronCMCPJetMOs, soa::Join, aod::DielectronCEWSJetCOs, aod::DielectronCEWSJetOs, aod::DielectronCEWSJetSSOs, aod::DielectronCEWSJetMOs, aod::StoredReducedEvents, aod::StoredDielectrons, aod::JDielectron1Dummys, aod::JDielectron2Dummys, aod::JDielectron3Dummys, aod::JDielectron4Dummys, aod::JDielectron5Dummys, aod::StoredJDielectronMcCollisions, aod::JDielectron6Dummys, aod::StoredJDielectronMcs>; +using JetSubstructureOutputDielectron = JetSubstructureHFOutputTask, soa::Join, aod::DielectronCJetCOs, aod::DielectronCJetOs, aod::DielectronCJetSSOs, aod::DielectronCJetMOs, soa::Join, aod::DielectronCMCDJetCOs, aod::DielectronCMCDJetOs, aod::DielectronCMCDJetSSOs, aod::DielectronCMCDJetMOs, soa::Join, aod::DielectronCMCPJetCOs, aod::DielectronCMCPJetOs, aod::DielectronCMCPJetSSOs, aod::DielectronCMCPJetMOs, soa::Join, aod::DielectronCEWSJetCOs, aod::DielectronCEWSJetOs, aod::DielectronCEWSJetSSOs, aod::DielectronCEWSJetMOs, aod::StoredReducedEvents, aod::StoredDielectrons, aod::JDielectron1Dummys, aod::JDielectron2Dummys, aod::JDielectron3Dummys, aod::JDielectron4Dummys, aod::JDielectron5Dummys, aod::JDielectron6Dummys, aod::JDielectron7Dummys, aod::StoredJDielectronMcCollisions, aod::JDielectron8Dummys, aod::StoredJDielectronMcs>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/Tasks/jetSubstructureHF.cxx b/PWGJE/Tasks/jetSubstructureHF.cxx index 16bcd3acd13..2ad5ddb4bac 100644 --- a/PWGJE/Tasks/jetSubstructureHF.cxx +++ b/PWGJE/Tasks/jetSubstructureHF.cxx @@ -291,4 +291,3 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processChargedJetsMCP, "HF jet substructure on MC particle level", false); }; -// using JetSubstructureBplus = JetSubstructureHFTask,soa::Join,soa::Join,soa::Join, aod::CandidatesBplusData, aod::CandidatesBplusMCP, aod::BplusCJetSSs,aod::BplusCMCDJetSSs,aod::BplusCMCPJetSSs, aod::BplusCEWSJetSSs, aod::JTrackBplusSubs>; diff --git a/PWGJE/Tasks/jetSubstructureHFOutput.cxx b/PWGJE/Tasks/jetSubstructureHFOutput.cxx index f0ca793c4a9..d651f2d8e5b 100644 --- a/PWGJE/Tasks/jetSubstructureHFOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureHFOutput.cxx @@ -42,7 +42,7 @@ using namespace o2::framework::expressions; // NB: runDataProcessing.h must be included after customize! #include "Framework/runDataProcessing.h" -template +template struct JetSubstructureHFOutputTask { Produces collisionOutputTableData; @@ -65,8 +65,10 @@ struct JetSubstructureHFOutputTask { Produces candidateTable; Produces candidateParsTable; Produces candidateParExtrasTable; + Produces candidateParsDaughterTable; Produces candidateSelsTable; Produces candidateMlsTable; + Produces candidateMlsDaughterTable; Produces candidateMcsTable; Produces hfMcCollisionsTable; Produces hfMcCollisionsMatchingTable; @@ -102,9 +104,11 @@ struct JetSubstructureHFOutputTask { PresliceUnsorted> CollisionsPerMcCollision = aod::jmccollisionlb::mcCollisionId; PresliceOptional D0CollisionsPerCollision = aod::jd0indices::collisionId; PresliceOptional LcCollisionsPerCollision = aod::jlcindices::collisionId; + PresliceOptional BplusCollisionsPerCollision = aod::jbplusindices::collisionId; PresliceOptional DielectronCollisionsPerCollision = aod::jdielectronindices::collisionId; PresliceOptional> D0McCollisionsPerMcCollision = aod::jd0indices::mcCollisionId; - PresliceOptional> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + PresliceOptional> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + PresliceOptional> BplusMcCollisionsPerMcCollision = aod::jbplusindices::mcCollisionId; PresliceOptional DielectronMcCollisionsPerMcCollision = aod::jdielectronindices::mcCollisionId; void init(InitContext const&) @@ -207,7 +211,7 @@ struct JetSubstructureHFOutputTask { if (hfCollisionIndex != candidateCollisionMapping.end()) { candidateCollisionIndex = hfCollisionIndex->second; } - jetcandidateutilities::fillCandidateTable(candidate, candidateCollisionIndex, candidateTable, candidateParsTable, candidateParExtrasTable, candidateSelsTable, candidateMlsTable, candidateMcsTable, candidateIndex); + jetcandidateutilities::fillCandidateTable(candidate, candidateCollisionIndex, candidateTable, candidateParsTable, candidateParExtrasTable, candidateParsDaughterTable, candidateSelsTable, candidateMlsTable, candidateMlsDaughterTable, candidateMcsTable, candidateIndex); } candidateMap.insert(std::make_pair(candidate.globalIndex(), candidateIndex)); } @@ -322,7 +326,7 @@ struct JetSubstructureHFOutputTask { if constexpr (!isMCPOnly) { for (const auto& collision : collisions) { if (collisionFlag[collision.globalIndex()]) { - const auto hfCollisionsPerCollision = jetcandidateutilities::slicedPerCandidateCollision(hfCollisions, candidates, collision, D0CollisionsPerCollision, LcCollisionsPerCollision, D0CollisionsPerCollision, DielectronCollisionsPerCollision); // add Bplus later + const auto hfCollisionsPerCollision = jetcandidateutilities::slicedPerCandidateCollision(hfCollisions, candidates, collision, D0CollisionsPerCollision, LcCollisionsPerCollision, BplusCollisionsPerCollision, DielectronCollisionsPerCollision); // add Bplus later int32_t candidateCollisionIndex = -1; for (const auto& hfCollisionPerCollision : hfCollisionsPerCollision) { // should only ever be one auto hfCollisionTableIndex = candidateCollisionMapping.find(hfCollisionPerCollision.globalIndex()); @@ -338,7 +342,7 @@ struct JetSubstructureHFOutputTask { if constexpr (isMC) { for (const auto& mcCollision : mcCollisions) { if (mcCollisionFlag[mcCollision.globalIndex()]) { - const auto hfMcCollisionsPerMcCollision = jetcandidateutilities::slicedPerCandidateCollision(hfMcCollisions, candidatesMCP, mcCollision, D0McCollisionsPerMcCollision, LcMcCollisionsPerMcCollision, D0McCollisionsPerMcCollision, DielectronMcCollisionsPerMcCollision); // add Bplus later + const auto hfMcCollisionsPerMcCollision = jetcandidateutilities::slicedPerCandidateCollision(hfMcCollisions, candidatesMCP, mcCollision, D0McCollisionsPerMcCollision, LcMcCollisionsPerMcCollision, BplusMcCollisionsPerMcCollision, DielectronMcCollisionsPerMcCollision); // add Bplus later int32_t candidateMcCollisionIndex = -1; for (const auto& hfMcCollisionPerMcCollision : hfMcCollisionsPerMcCollision) { // should only ever be one auto hfMcCollisionTableIndex = candidateMcCollisionMapping.find(hfMcCollisionPerMcCollision.globalIndex()); @@ -499,4 +503,3 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processOutputMatchingMC, "jet matching output MC", false); }; -// using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMcs, aod::StoredHfBplusPBases>; diff --git a/PWGJE/Tasks/jetSubstructureLcOutput.cxx b/PWGJE/Tasks/jetSubstructureLcOutput.cxx index 34361a1148e..dad7b2a52b5 100644 --- a/PWGJE/Tasks/jetSubstructureLcOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureLcOutput.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputLc = JetSubstructureHFOutputTask, aod::CandidatesLcData, aod::CandidatesLcMCD, aod::CandidatesLcMCP, aod::JTrackLcSubs, soa::Join, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHf3PCollBase, aod::StoredHf3PBases, aod::StoredHf3PPars, aod::StoredHf3PParEs, aod::StoredHf3PSels, aod::StoredHf3PMls, aod::StoredHf3PMcs, aod::StoredHf3PMcCollBases, aod::StoredHf3PMcRCollIds, aod::StoredHf3PPBases>; +using JetSubstructureOutputLc = JetSubstructureHFOutputTask, aod::CandidatesLcData, aod::CandidatesLcMCD, aod::CandidatesLcMCP, aod::JTrackLcSubs, soa::Join, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHfLcCollBase, aod::StoredHfLcBases, aod::StoredHfLcPars, aod::StoredHfLcParEs, aod::JDumLcParDaus, aod::StoredHfLcSels, aod::StoredHfLcMls, aod::JDumLcMlDaus, aod::StoredHfLcMcs, aod::StoredHfLcMcCollBases, aod::StoredHfLcMcRCollIds, aod::StoredHfLcPBases>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 29c727454e22de8d3e7c87f17d0b6860a51a5467 Mon Sep 17 00:00:00 2001 From: sarjeetagami <162087855+sarjeetagami@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:18:54 +0530 Subject: [PATCH 29/91] [PWGLF] occupancy checks for MC (#8787) Co-authored-by: sarjeeta gami --- .../Tasks/Resonances/phianalysisrun3_PbPb.cxx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx index d3b249a65be..d9e3eb99f44 100644 --- a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx @@ -79,7 +79,6 @@ struct phianalysisrun3_PbPb { Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, "Number of mixed events per event"}; Configurable fillOccupancy{"fillOccupancy", true, "fill Occupancy"}; Configurable cfgOccupancyCut{"cfgOccupancyCut", 2500, "Occupancy cut"}; - Configurable cfgCutTOFBeta{"cfgCutTOFBeta", 0.0, "cut TOF beta"}; Configurable isNoTOF{"isNoTOF", false, "isNoTOF"}; Configurable additionalEvSel2{"additionalEvSel2", true, "Additional evsel2"}; Configurable additionalEvSel3{"additionalEvSel3", true, "Additional evsel3"}; @@ -179,7 +178,7 @@ struct phianalysisrun3_PbPb { if (!candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) { return true; } - if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaKa()) < nsigmaCutTOF) { + if (candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaKa()) < nsigmaCutTOF) { return true; } return false; @@ -228,17 +227,17 @@ struct phianalysisrun3_PbPb { Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using EventCandidates = soa::Filtered>; - using TrackCandidates = soa::Filtered>; + using TrackCandidates = soa::Filtered>; // using EventCandidatesMC = soa::Join; using EventCandidatesMC = soa::Join; using TrackCandidatesMC = soa::Filtered>; using CollisionMCTrueTable = aod::McCollisions; using TrackMCTrueTable = aod::McParticles; using CollisionMCRecTableCentFT0C = soa::SmallGroups>; - using TrackMCRecTable = soa::Join; + using TrackMCRecTable = soa::Join; using FilTrackMCRecTable = soa::Filtered; ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for bin"}; @@ -582,6 +581,11 @@ struct phianalysisrun3_PbPb { if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cfgCutVertex) { continue; } + int occupancy = collision.trackOccupancyInTimeRange(); + if (fillOccupancy && occupancy > cfgOccupancyCut) // occupancy info is available for this collision (*) + { + continue; + } multiplicity = collision.centFT0C(); histos.fill(HIST("Centgen"), multiplicity); SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); @@ -631,6 +635,11 @@ struct phianalysisrun3_PbPb { if (std::abs(collision.mcCollision().posZ()) > cfgCutVertex || !collision.sel8()) { return; } + int occupancy = collision.trackOccupancyInTimeRange(); + if (fillOccupancy && occupancy > cfgOccupancyCut) // occupancy info is available for this collision (*) + { + return; + } auto multiplicity = collision.centFT0C(); histos.fill(HIST("Centrec"), multiplicity); histos.fill(HIST("hMC"), 5.5); From 3100ca123ce13bf55733d51b01943ed361d4dd40 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Tue, 3 Dec 2024 17:06:09 +0100 Subject: [PATCH 30/91] [PWGCF] DptDpt - Efficiency and QC fixing linter errors on file name (#8796) Co-authored-by: Victor --- PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt | 4 ++-- .../{dptdptEfficiencyAndQc.cxx => dptDptEfficiencyAndQc.cxx} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{dptdptEfficiencyAndQc.cxx => dptDptEfficiencyAndQc.cxx} (99%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index bf93c33d24c..bb41ca1ccab 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -33,8 +33,8 @@ o2physics_add_dpl_workflow(identifiedbf-filter-qa PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(dptdpt-efficiency-and-qc - SOURCES dptdptEfficiencyAndQc.cxx +o2physics_add_dpl_workflow(dpt-dpt-efficiency-and-qc + SOURCES dptDptEfficiencyAndQc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx similarity index 99% rename from PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index 6d8bff1d6a0..890a2c78fdc 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file dptdptEfficiencyAndQc.cxx +/// \file dptDptEfficiencyAndQc.cxx /// \brief Provides efficiency extraction and QC for track cuts and PID /// \author victor.gonzalez.sebastian@gmail.com From 5afd082a25edc07d4b389d9eaef3ce495bfee22f Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Wed, 4 Dec 2024 07:34:09 +0100 Subject: [PATCH 31/91] [Common] TrackQA: Add converter for _000 to _001 (#8404) --- .../TableProducer/Converters/CMakeLists.txt | 5 ++ .../Converters/trackQAConverter.cxx | 60 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 Common/TableProducer/Converters/trackQAConverter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index 48aba0a771a..0bf0ff823d4 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -83,3 +83,8 @@ o2physics_add_dpl_workflow(multmcextras-converter SOURCES multMCExtrasConverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(trackqa-converter + SOURCES trackQAConverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/Converters/trackQAConverter.cxx b/Common/TableProducer/Converters/trackQAConverter.cxx new file mode 100644 index 00000000000..bdfecbca8d0 --- /dev/null +++ b/Common/TableProducer/Converters/trackQAConverter.cxx @@ -0,0 +1,60 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct trackQAConverter { + Produces tracksQA_001; + + void process(aod::TracksQA_000 const& tracksQA_000) + { + for (const auto& trackQA : tracksQA_000) { + tracksQA_001( + trackQA.trackId(), + trackQA.tpcTime0(), + trackQA.tpcdcaR(), + trackQA.tpcdcaZ(), + trackQA.tpcClusterByteMask(), + trackQA.tpcdEdxMax0R(), + trackQA.tpcdEdxMax1R(), + trackQA.tpcdEdxMax2R(), + trackQA.tpcdEdxMax3R(), + trackQA.tpcdEdxTot0R(), + trackQA.tpcdEdxTot1R(), + trackQA.tpcdEdxTot2R(), + trackQA.tpcdEdxTot3R(), + // dummy values, not available in _000 + std::numeric_limits::min(), // deltaRefContParamY + std::numeric_limits::min(), // deltaRefContParamZ + std::numeric_limits::min(), // deltaRefContParamSnp + std::numeric_limits::min(), // deltaRefContParamTgl + std::numeric_limits::min(), // deltaRefContParamQ2Pt + std::numeric_limits::min(), // deltaRefGloParamY + std::numeric_limits::min(), // deltaRefGloParamZ + std::numeric_limits::min(), // deltaRefGloParamSnp + std::numeric_limits::min(), // deltaRefGloParamTgl + std::numeric_limits::min()); // deltaRefGloParamQ2Pt + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From e266c900f9d75592bda2d57c899588e004f31d84 Mon Sep 17 00:00:00 2001 From: kkimura0623 Date: Wed, 4 Dec 2024 17:23:43 +0900 Subject: [PATCH 32/91] [PWGDQ] Add calculation of muon pair production rate asymmetry (#8759) Co-authored-by: kkimura0623 --- PWGDQ/Core/HistogramsLibrary.cxx | 26 ++++++++++++++++++++++++++ PWGDQ/Core/VarManager.cxx | 2 ++ PWGDQ/Core/VarManager.h | 11 +++++++++++ 3 files changed, 39 insertions(+) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index af804d121b9..5e9180c6a8a 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1030,6 +1030,18 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_phiCS", "", 4, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); hm->AddHistogram(histClass, "Mass_y_cosThetaCS_phiCS", "", 4, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp")) { + int varspTCS[3] = {VarManager::kMass, VarManager::kPt, VarManager::kPhiVP}; + int varsrapCS[3] = {VarManager::kMass, VarManager::kRap, VarManager::kPhiVP}; + int binspT[3] = {100, 20, 24}; + int binsy[3] = {100, 10, 24}; + double xminpT[3] = {1., 0., 0.}; + double xmaxpT[3] = {5., 20., +3.14}; + double xminy[3] = {1., 2.5, 0.}; + double xmaxy[3] = {5., 4.0, +3.14}; + hm->AddHistogram(histClass, "Mass_Pt_phiVP", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + hm->AddHistogram(histClass, "Mass_y_phiVP", "", 3, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap")) { int vars[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kRap}; int binspT[4] = {150, 200, 10, 6}; @@ -1065,6 +1077,20 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h double xmaxpT[5] = {1.2, 3., 100, 1., 3.14}; hm->AddHistogram(histClass, "Mass_Pt_Cent_cosThetaCS_lowmass", "", 5, varsCSpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {150, 30, 10, 24}; + double xminpT[4] = {2., 0., 0, 0.}; + double xmaxpT[4] = {5., 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } + if (subGroupStr.Contains("dimuon-polarization-lowmass-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {200, 30, 10, 24}; + double xminpT[4] = {0.2, 0., 0, 0.}; + double xmaxpT[4] = {1.2, 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP_lowmass", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap-polarization-he-pbpb")) { int varsHEpbpb[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kCosThetaHE, VarManager::kRap}; int binspT[5] = {150, 30, 10, 10, 6}; diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index bd9055b6cdc..537afde077b 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -863,6 +863,8 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kCosThetaCS] = ""; fgVariableNames[kPhiCS] = "#varphi_{CS}"; fgVariableUnits[kPhiCS] = "rad."; + fgVariableNames[kPhiVP] = "#varphi_{VP} - #Psi_{2}"; + fgVariableUnits[kPhiVP] = "rad."; fgVariableNames[kDeltaPhiPair2] = "#Delta#phi"; fgVariableUnits[kDeltaPhiPair2] = "rad."; fgVariableNames[kDeltaEtaPair2] = "#Delta#eta"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 6b0af177765..9e10ea58049 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -611,6 +611,7 @@ class VarManager : public TObject kCosThetaCS, kPhiHE, kPhiCS, + kPhiVP, kDeltaPhiPair2, kDeltaEtaPair2, kPsiPair, @@ -4335,6 +4336,16 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) values[kCORR2REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; values[kCORR4REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; } + + ROOT::Math::PtEtaPhiMVector v1_vp(v1.Pt(), v1.Eta(), v1.Phi() - Psi2B, v1.M()); + ROOT::Math::PtEtaPhiMVector v2_vp(v2.Pt(), v2.Eta(), v2.Phi() - Psi2B, v2.M()); + ROOT::Math::PtEtaPhiMVector v12_vp = v1_vp + v2_vp; + auto p12_vp = ROOT::Math::XYZVectorF(v12_vp.Px(), v12_vp.Py(), v12_vp.Pz()); + auto p12_vp_projXZ = ROOT::Math::XYZVectorF(p12_vp.X(), 0, p12_vp.Z()); + auto vDimu = (t1.sign() > 0 ? ROOT::Math::XYZVectorF(v1_vp.Px(), v1_vp.Py(), v1_vp.Pz()).Cross(ROOT::Math::XYZVectorF(v2_vp.Px(), v2_vp.Py(), v2_vp.Pz())) + : ROOT::Math::XYZVectorF(v2_vp.Px(), v2_vp.Py(), v2_vp.Pz()).Cross(ROOT::Math::XYZVectorF(v1_vp.Px(), v1_vp.Py(), v1_vp.Pz()))); + auto vRef = p12_vp.Cross(p12_vp_projXZ); + values[kPhiVP] = std::acos(vDimu.Dot(vRef) / (vRef.R() * vDimu.R())); } template From a05a3b40803e9a0ceb2b7add2b3f02275961015c Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:53:57 +0530 Subject: [PATCH 33/91] [PWGCF] Update lambdaR2Correlation.cxx (#8779) --- .../Tasks/lambdaR2Correlation.cxx | 1171 ++++++++--------- 1 file changed, 519 insertions(+), 652 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 55222b26eb4..fa0d783fe52 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file lambdaCorrelationAnalysis.cxx +/// \file lambdaR2Correlation.cxx /// \brief R2 correlation of Lambda baryons. /// \author Yash Patley @@ -33,6 +33,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; +using namespace o2::constants::math; namespace o2::aod { @@ -50,11 +51,11 @@ using LambdaCollision = LambdaCollisions::iterator; namespace lambdamcgencollision { } -DECLARE_SOA_TABLE(LambdaMCGenCollisions, "AOD", "LMCGENCOLS", o2::soa::Index<>, +DECLARE_SOA_TABLE(LambdaMcGenCollisions, "AOD", "LMCGENCOLS", o2::soa::Index<>, o2::aod::mccollision::PosX, o2::aod::mccollision::PosY, o2::aod::mccollision::PosZ); -using LambdaMCGenCollision = LambdaMCGenCollisions::iterator; +using LambdaMcGenCollision = LambdaMcGenCollisions::iterator; namespace lambdatrack { @@ -67,11 +68,12 @@ DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(Rap, rap, float); DECLARE_SOA_COLUMN(Mass, mass, float); -DECLARE_SOA_COLUMN(PosTrackId, postrackid, int64_t); -DECLARE_SOA_COLUMN(NegTrackId, negtrackid, int64_t); -DECLARE_SOA_COLUMN(V0Type, v0type, int8_t); -DECLARE_SOA_COLUMN(Cospa, cospa, float); -DECLARE_SOA_COLUMN(DcaDau, dcadau, float); +DECLARE_SOA_COLUMN(PosTrackId, posTrackId, int64_t); +DECLARE_SOA_COLUMN(NegTrackId, negTrackId, int64_t); +DECLARE_SOA_COLUMN(V0Type, v0Type, int8_t); +DECLARE_SOA_COLUMN(CosPA, cosPA, float); +DECLARE_SOA_COLUMN(DcaDau, dcaDau, float); +DECLARE_SOA_COLUMN(CorrFact, corrFact, float); } // namespace lambdatrack DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::LambdaCollisionId, @@ -86,16 +88,17 @@ DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, - lambdatrack::Cospa, - lambdatrack::DcaDau); + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::CorrFact); using LambdaTrack = LambdaTracks::iterator; namespace lambdamcgentrack { -DECLARE_SOA_INDEX_COLUMN(LambdaMCGenCollision, lambdaMcGenCollision); +DECLARE_SOA_INDEX_COLUMN(LambdaMcGenCollision, lambdaMcGenCollision); } -DECLARE_SOA_TABLE(LambdaMCGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, - lambdamcgentrack::LambdaMCGenCollisionId, +DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, + lambdamcgentrack::LambdaMcGenCollisionId, o2::aod::mcparticle::Px, o2::aod::mcparticle::Py, o2::aod::mcparticle::Pz, @@ -107,9 +110,10 @@ DECLARE_SOA_TABLE(LambdaMCGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, - lambdatrack::Cospa, - lambdatrack::DcaDau); -using LambdaMCGenTrack = LambdaMCGenTracks::iterator; + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::CorrFact); +using LambdaMcGenTrack = LambdaMcGenTracks::iterator; } // namespace o2::aod @@ -129,69 +133,91 @@ enum RecGenType { kGen }; -struct lambdaCorrTableProducer { +enum DMCType { + kData = 0, + kMC +}; + +struct LambdaCorrTableProducer { Produces lambdaCollisionTable; Produces lambdaTrackTable; - Produces lambdaMCGenCollisionTable; - Produces lambdaMCGenTrackTable; + Produces lambdaMCGenCollisionTable; + Produces lambdaMCGenTrackTable; // Collisions - Configurable cfg_min_z_vtx{"cfg_min_z_vtx", -10.0, "z vertex cut"}; - Configurable cfg_max_z_vtx{"cfg_max_z_vtx", 10.0, "z vertex cut"}; - Configurable cfg_sel8_sel{"cfg_sel8_sel", true, "Sel8 (T0A + T0C) Selection"}; - Configurable cfg_trigger_tvx_sel{"cfg_trigger_tvx_sel", false, "Trigger Time and Vertex Selection"}; - Configurable cfg_tf_border{"cfg_tf_border", false, "Timeframe Border Selection"}; - Configurable cfg_noitsro_border{"cfg_noitsro_border", false, "No ITSRO Border Cut"}; - Configurable cfg_itstpc_vtx{"cfg_itstpc_vtx", false, "ITS+TPC Vertex Selection"}; - Configurable cfg_pileup_reject{"cfg_pileup_reject", false, "Pileup rejection"}; - Configurable cfg_zvtx_time_diff{"cfg_zvtx_time_diff", false, "z-vtx time diff selection"}; + Configurable cMinZVtx{"cMinZVtx", -10.0, "z vertex cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 10.0, "z vertex cut"}; + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection"}; + Configurable cTriggerTvxSel{"cTriggerTvxSel", false, "Trigger Time and Vertex Selection"}; + Configurable cTFBorder{"cTFBorder", false, "Timeframe Border Selection"}; + Configurable cNoItsROBorder{"cNoItsROBorder", false, "No ITSRO Border Cut"}; + Configurable cItsTpcVtx{"cItsTpcVtx", false, "ITS+TPC Vertex Selection"}; + Configurable cPileupReject{"cPileupReject", false, "Pileup rejection"}; + Configurable cZVtxTimeDiff{"cZVtxTimeDiff", false, "z-vtx time diff selection"}; // Tracks - Configurable cfg_pt_min{"cfg_pt_min", 0.2, "p_{T} minimum"}; - Configurable cfg_pt_max{"cfg_pt_max", 4.0, "p_{T} minimum"}; - Configurable cfg_eta_cut{"cfg_eta_cut", 0.8, "Pseudorapidity cut"}; - Configurable cfg_min_crossed_rows{"cfg_min_crossed_rows", 70, "min crossed rows"}; - Configurable cfg_tpc_nsigma{"cfg_tpc_nsigma", 2.0, "TPC NSigma Selection Cut"}; - Configurable cfg_track_dcaXY_min{"cfg_track_dcaXY_min", 0.05, "Minimum DcaXY of Daughter Tracks"}; + Configurable cTrackMinPt{"cTrackMinPt", 0.2, "p_{T} minimum"}; + Configurable cTrackMaxPt{"cTrackMaxPt", 4.0, "p_{T} minimum"}; + Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; + Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "min crossed rows"}; + Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 2.0, "TPC NSigma Selection Cut"}; + Configurable cTrackMinDcaXY{"cTrackMinDcaXY", 0.05, "Minimum DcaXY of Daughter Tracks"}; // V0s - Configurable cfg_min_dca_V0_daughters{"cfg_min_dca_V0_daughters", 1.0, "min DCA between V0 daughters"}; - Configurable cfg_min_dca_pos_to_PV{"cfg_min_dca_pos_to_PV", 0.1, "Minimum V0 Positive Track DCAr cut to PV"}; - Configurable cfg_min_dca_neg_to_PV{"cfg_min_dca_neg_to_PV", 0.1, "Minimum V0 Negative Track DCAr cut to PV"}; - Configurable cfg_min_dca_V0_to_PV{"cfg_min_dca_V0_to_PV", 0.6, "Minimum DCA V0 to PV"}; - Configurable cfg_min_V0_radius{"cfg_min_V0_radius", 0.0, "Minimum V0 radius from PV"}; - Configurable cfg_max_V0_radius{"cfg_max_V0_radius", 50.0, "Maximum V0 radius from PV"}; - Configurable cfg_min_ctau{"cfg_min_ctau", 0.0, "Minimum ctau"}; - Configurable cfg_max_ctau{"cfg_max_ctau", 50.0, "Maximum ctau"}; - Configurable cfg_min_V0_cosPA{"cfg_min_V0_cosPA", 0.998, "Minimum V0 CosPA to PV"}; - Configurable cfg_lambda_mass_window{"cfg_lambda_mass_window", 0.007, "Mass Window to select Lambda"}; - Configurable cfg_kshort_rej{"cfg_kshort_rej", 0.005, "Reject K0Short Candidates"}; - Configurable cfg_kshort_rej_flag{"cfg_kshort_rej_flag", false, "K0short Mass Rej Flag"}; - Configurable cfg_armpod_flag{"cfg_armpod_flag", true, "Armentros-Podolanski Cut Flag"}; - Configurable cfg_armpod_val{"cfg_armpod_val", 0.5, "Armentros-Podolanski Slope Parameter"}; + Configurable cMinV0DcaDaughters{"cMinV0DcaDaughters", 1.0, "min DCA between V0 daughters"}; + Configurable cMinDcaPosToPV{"cMinDcaPosToPV", 0.1, "Minimum V0 Positive Track DCAr cut to PV"}; + Configurable cMinDcaNegToPV{"cMinDcaNegToPV", 0.1, "Minimum V0 Negative Track DCAr cut to PV"}; + Configurable cMinDcaV0ToPV{"cMinDcaV0ToPV", 0.6, "Minimum DCA V0 to PV"}; + Configurable cMinV0TransRadius{"cMinV0TransRadius", 0.0, "Minimum V0 radius from PV"}; + Configurable cMaxV0TransRadius{"cMaxV0TransRadius", 50.0, "Maximum V0 radius from PV"}; + Configurable cMinV0CTau{"cMinV0CTau", 0.0, "Minimum ctau"}; + Configurable cMaxV0CTau{"cMaxV0CTau", 50.0, "Maximum ctau"}; + Configurable cMinV0CosPA{"cMinV0CosPA", 0.998, "Minimum V0 CosPA to PV"}; + Configurable cLambdaMassWindow{"cLambdaMassWindow", 0.007, "Mass Window to select Lambda"}; + Configurable cKshortRejMassWindow{"cKshortRejMassWindow", 0.005, "Reject K0Short Candidates"}; + Configurable cKshortRejFlag{"cKshortRejFlag", false, "K0short Mass Rej Flag"}; + Configurable cArmPodCutValue{"cArmPodCutValue", 0.5, "Armentros-Podolanski Slope Parameter"}; + Configurable cArmPodCutFlag{"cArmPodCutFlag", true, "Armentros-Podolanski Cut Flag"}; // V0s kinmatic acceptance - Configurable cfg_v0_pt_min{"cfg_v0_pt_min", 0.3, "Minimum V0 pT"}; - Configurable cfg_v0_pt_max{"cfg_v0_pt_max", 3.0, "Minimum V0 pT"}; - Configurable cfg_v0_rap_max{"cfg_v0_rap_max", 0.8, "|rap| cut"}; - - // bool eta/rapidity - Configurable cfg_do_eta_analysis{"cfg_do_eta_analysis", false, "Eta Analysis"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 3.2, "Minimum V0 pT"}; + Configurable cMaxV0Rap{"cMaxV0Rap", 0.6, "|rap| cut"}; // V0s MC - Configurable cfg_has_mc_flag{"cfg_has_mc_flag", true, "Has Mc Tag"}; - Configurable cfg_rec_primary_lambda{"cfg_rec_primary_lambda", false, "Primary Lambda"}; - Configurable cfg_rec_secondary_lambda{"cfg_rec_secondary_lambda", false, "Secondary Lambda"}; - Configurable cfg_rec_pid_flag{"cfg_rec_pid_flag", false, "PID Flag"}; - Configurable cfg_gen_primary_lambda{"cfg_gen_primary_lambda", true, "Primary Lambda"}; + Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; + Configurable cRecPrimaryLambda{"cRecPrimaryLambda", true, "Primary Lambda"}; + Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Lambda"}; + + // Efficiency Correction + Configurable cCorrectionFlag{"cCorrectionFlag", true, "Efficiency Correction Flag"}; + Configurable cCorrFactHistType{"cCorrFactHistType", 0, "Histogram Type {TH1F, TH2F, TH3F}"}; + + // CCDB + Configurable cUrlCCDB{"cUrlCCDB", "http://ccdb-test.cern.ch:8080", "url of ccdb"}; + Configurable cPathCCDB{"cPathCCDB", "Users/y/ypatley/lambda_corr_fact", "Path for ccdb-object"}; + + // Initialize CCDB Service + Service ccdb; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // initialize corr_factor objects + std::vector> vCorrFactStrings = {{"h1f_LaP_cf", "h1f_LaM_cf"}, + {"h2f_LaP_cf", "h2f_LaM_cf"}, + {"h3f_LaP_cf", "h3f_LaM_cf"}}; + void init(InitContext const&) { - const AxisSpec axisCol(10, 0, 10, ""); + // Set CCDB url + ccdb->setURL(cUrlCCDB.value); + ccdb->setCaching(true); + + // initialize axis specifications + const AxisSpec axisCol(20, 0, 20, ""); const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); @@ -201,7 +227,7 @@ struct lambdaCorrTableProducer { const AxisSpec axisV0Pt(32, 0.3, 3.5, "p_{T} (GeV/#it{c})"); const AxisSpec axisV0Rap(24, -1.2, 1.2, "y"); const AxisSpec axisV0Eta(24, -1.2, 1.2, "#eta"); - const AxisSpec axisV0Phi(36, 0., 2. * TMath::Pi(), "#phi (rad)"); + const AxisSpec axisV0Phi(36, 0., TwoPI, "#phi (rad)"); const AxisSpec axisRadius(400, 0, 200, "r(cm)"); const AxisSpec axisCosPA(100, 0.99, 1.0, "cos(#theta_{PA})"); @@ -221,125 +247,94 @@ struct lambdaCorrTableProducer { // Create Histograms. // Event histograms - histos.add("Event/h1d_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("Event/h1d_collisions_info", "# of Collisions", kTH1F, {axisCol}); + histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCol}); // QA - histos.add("QA_Checks/h1d_tracks_info", "# of tracks", kTH1F, {axisCol}); - histos.add("QA_Checks/h1d_lambda_mass", "M_{#Lambda}", kTH1F, {axisV0Mass}); - histos.add("QA_Checks/h1d_antilambda_mass", "M_{#Lambda}", kTH1F, {axisV0Mass}); - histos.add("QA_Checks/h2d_lambda_pt_vs_mass", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); - histos.add("QA_Checks/h2d_antilambda_pt_vs_mass", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); - histos.add("QA_Checks/h2d_before_topo_cuts_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - histos.add("QA_Checks/h2d_after_topo_cuts_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - histos.add("QA_Checks/h2d_before_masswincut_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - histos.add("QA_Checks/h2d_after_masswincut_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisCol}); + histos.add("Tracks/h2f_armpod_before_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h2f_armpod_after_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h1f_lambda_pt_vs_invm", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); + histos.add("Tracks/h1f_antilambda_pt_vs_invm", "p_{T} vs M_{#bar{#Lambda}}", kTH2F, {axisV0Mass, axisV0Pt}); // QA Lambda - histos.add("QA_Sel_Lambda/h1d_V0_inv_mass", "V_{0} mass", kTH1F, {axisV0Mass}); - histos.add("QA_Sel_Lambda/h1d_V0_pt", "V_{0} p_{T}", kTH1F, {axisV0Pt}); - histos.add("QA_Sel_Lambda/h1d_V0_eta", "#eta-distribution", kTH1F, {axisV0Eta}); - histos.add("QA_Sel_Lambda/h1d_V0_rap", "y-distribution", kTH1F, {axisV0Rap}); - histos.add("QA_Sel_Lambda/h1d_V0_phi", "#phi-distribution", kTH1F, {axisV0Phi}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_eta", "p_{T} vs #eta", kTH2F, {axisV0Eta, axisV0Pt}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_rap", "p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_phi", "p_{T} vs #phi", kTH2F, {axisV0Phi, axisV0Pt}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_mass", "p_{T} vs M_{p#pi}", kTH2F, {axisV0Mass, axisV0Pt}); - - histos.add("QA_Sel_Lambda/h1d_dca_V0_daughters", "DCA between V0 daughters", kTH1F, {axisDcaDau}); - histos.add("QA_Sel_Lambda/h1d_dca_pos_to_PV", "DCA positive prong to PV", kTH1F, {axisDcaProngPV}); - histos.add("QA_Sel_Lambda/h1d_dca_neg_to_PV", "DCA negative prong to PV", kTH1F, {axisDcaProngPV}); - histos.add("QA_Sel_Lambda/h1d_dca_V0_to_PV", "DCA V0 to PV", kTH1F, {axisDcaV0PV}); - histos.add("QA_Sel_Lambda/h1d_V0_cospa", "cos(#theta_{PA})", kTH1F, {axisCosPA}); - histos.add("QA_Sel_Lambda/h1d_V0_radius", "V_{0} Decay Radius in XY plane", kTH1F, {axisRadius}); - histos.add("QA_Sel_Lambda/h1d_V0_ctau", "V_{0} c#tau", kTH1F, {axisCTau}); - histos.add("QA_Sel_Lambda/h1d_V0_gctau", "V_{0} #gammac#tau", kTH1F, {axisGCTau}); - histos.add("QA_Sel_Lambda/h2d_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - - histos.add("QA_Sel_Lambda/h1d_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisTrackPt}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisTrackPt}); - histos.add("QA_Sel_Lambda/h1d_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("QA_Sel_Lambda/h1d_pos_prong_phi", "Pos-Prong #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_phi", "Neg-Prong #phi-distribution", kTH1F, {axisV0Phi}); - - histos.add("QA_Sel_Lambda/h2d_pos_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); - histos.add("QA_Sel_Lambda/h2d_pos_prong_dEdx_vs_p", "TPC Signal Pos-Prong", kTH2F, {axisMomPID, axisdEdx}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_dEdx_vs_p", "TPC Signal Neg-Prong", kTH2F, {axisMomPID, axisdEdx}); - histos.add("QA_Sel_Lambda/h2d_pos_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); - histos.add("QA_Sel_Lambda/h2d_pos_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("QA/Lambda/h1f_dca_V0_daughters", "DCA between V0 daughters", kTH1F, {axisDcaDau}); + histos.add("QA/Lambda/h1f_dca_pos_to_PV", "DCA positive prong to PV", kTH1F, {axisDcaProngPV}); + histos.add("QA/Lambda/h1f_dca_neg_to_PV", "DCA negative prong to PV", kTH1F, {axisDcaProngPV}); + histos.add("QA/Lambda/h1f_dca_V0_to_PV", "DCA V0 to PV", kTH1F, {axisDcaV0PV}); + histos.add("QA/Lambda/h1f_V0_cospa", "cos(#theta_{PA})", kTH1F, {axisCosPA}); + histos.add("QA/Lambda/h1f_V0_radius", "V_{0} Decay Radius in XY plane", kTH1F, {axisRadius}); + histos.add("QA/Lambda/h1f_V0_ctau", "V_{0} c#tau", kTH1F, {axisCTau}); + histos.add("QA/Lambda/h1f_V0_gctau", "V_{0} #gammac#tau", kTH1F, {axisGCTau}); + + histos.add("QA/Lambda/h1f_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisTrackPt}); + histos.add("QA/Lambda/h1f_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisTrackPt}); + histos.add("QA/Lambda/h1f_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Eta}); + histos.add("QA/Lambda/h1f_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Eta}); + histos.add("QA/Lambda/h1f_pos_prong_phi", "Pos-Prong #phi-distribution", kTH1F, {axisV0Phi}); + histos.add("QA/Lambda/h1f_neg_prong_phi", "Neg-Prong #phi-distribution", kTH1F, {axisV0Phi}); + + histos.add("QA/Lambda/h2f_pos_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); + histos.add("QA/Lambda/h2f_neg_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); + histos.add("QA/Lambda/h2f_pos_prong_dEdx_vs_p", "TPC Signal Pos-Prong", kTH2F, {axisMomPID, axisdEdx}); + histos.add("QA/Lambda/h2f_neg_prong_dEdx_vs_p", "TPC Signal Neg-Prong", kTH2F, {axisMomPID, axisdEdx}); + histos.add("QA/Lambda/h2f_pos_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_neg_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_pos_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_neg_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); // QA Anti-Lambda - histos.addClone("QA_Sel_Lambda/", "QA_Sel_AntiLambda/"); + histos.addClone("QA/Lambda/", "QA/AntiLambda/"); // MC Generated Histograms if (doprocessMCGen) { // McReco Histos - histos.add("QA_Checks/h2d_tracks_pid_before_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("QA_Checks/h2d_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("QA_Checks/h2d_lambda_from_sigma", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("QA_Checks/h2d_lambda_from_cascade", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_tracks_pid_before_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_from_sigma", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_from_cascade", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos - histos.add("McGen/h1d_collisions_info", "# of collisions", kTH1F, {axisCol}); - histos.add("McGen/h1d_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("McGen/h1d_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); - histos.add("McGen/h1d_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); - histos.add("McGen/h1d_mass_lambda", "M_{#Lambda}", kTH1F, {axisV0Mass}); - histos.add("McGen/h1d_pt_lambda", "#Lambda p_{T}", kTH1F, {axisV0Pt}); - histos.add("McGen/h1d_eta_lambda", "#Lambda #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("McGen/h1d_y_lambda", "#Lambda y-distribution", kTH1F, {axisV0Rap}); - histos.add("McGen/h1d_phi_lambda", "#Lambda #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("McGen/h2d_pteta_lambda", "#Lambda p_{T} vs #eta", kTH2F, {axisV0Eta, axisV0Pt}); - histos.add("McGen/h2d_ptrap_lambda", "#Lambda p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); - histos.add("McGen/h2d_ptphi_lambda", "#Lambda p_{T} vs #phi", kTH2F, {axisV0Phi, axisV0Pt}); - histos.add("McGen/h1d_mass_antilambda", "M_{#bar{#Lambda}}", kTH1F, {axisV0Mass}); - histos.add("McGen/h1d_pt_antilambda", "#bar{#Lambda} p_{T}", kTH1F, {axisV0Pt}); - histos.add("McGen/h1d_eta_antilambda", "#bar{#Lambda} #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("McGen/h1d_y_antilambda", "#bar{#Lambda} y-distribution", kTH1F, {axisV0Rap}); - histos.add("McGen/h1d_phi_antilambda", "#bar{#Lambda} #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("McGen/h2d_pteta_antilambda", "#bar{#Lambda} p_{T} vs #eta", kTH2F, {axisV0Eta, axisV0Pt}); - histos.add("McGen/h2d_ptrap_antilambda", "#bar{#Lambda} p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); - histos.add("McGen/h2d_ptphi_antilambda", "#bar{#Lambda} p_{T} vs #phi", kTH2F, {axisV0Phi, axisV0Pt}); + histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCol}); + histos.add("McGen/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + histos.add("McGen/h1f_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + histos.add("McGen/h1f_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); } } template - bool selCol(C const& col) + bool selCollision(C const& col) { - - if (col.posZ() < cfg_min_z_vtx || col.posZ() >= cfg_max_z_vtx) { + if (col.posZ() < cMinZVtx || col.posZ() >= cMaxZVtx) { return false; } - if (!col.sel8() && cfg_sel8_sel) { + if (!col.sel8() && cSel8Trig) { return false; } - if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && cfg_trigger_tvx_sel) { + if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && cTriggerTvxSel) { return false; } - if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && cfg_tf_border) { + if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && cTFBorder) { return false; } - if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && cfg_noitsro_border) { + if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && cNoItsROBorder) { return false; } - if (!col.selection_bit(aod::evsel::kIsVertexITSTPC) && cfg_itstpc_vtx) { + if (!col.selection_bit(aod::evsel::kIsVertexITSTPC) && cItsTpcVtx) { return false; } - if (!col.selection_bit(aod::evsel::kNoSameBunchPileup) && cfg_pileup_reject) { + if (!col.selection_bit(aod::evsel::kNoSameBunchPileup) && cPileupReject) { return false; } - if (!col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && cfg_zvtx_time_diff) { + if (!col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && cZVtxTimeDiff) { return false; } @@ -347,22 +342,21 @@ struct lambdaCorrTableProducer { } template - bool dauTrackSelection(T const& track) + bool selDaughterTracks(T const& track) { - - if (track.pt() < cfg_pt_min || track.pt() > cfg_pt_max) { + if (track.pt() < cTrackMinPt || track.pt() > cTrackMaxPt) { return false; } - if (fabs(track.eta()) >= cfg_eta_cut) { + if (std::abs(track.eta()) >= cTrackEtaCut) { return false; } - if (track.tpcNClsCrossedRows() < cfg_min_crossed_rows) { + if (track.tpcNClsCrossedRows() < cMinTpcCrossedRows) { return false; } - if (fabs(track.dcaXY()) < cfg_track_dcaXY_min) { + if (std::abs(track.dcaXY()) < cTrackMinDcaXY) { return false; } @@ -370,43 +364,69 @@ struct lambdaCorrTableProducer { } template - bool topologicalCutsV0(C const& col, V const& v0, T const&) + bool selLambdaWithTopoKinCuts(C const& col, V const& v0, T const&) { - auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); - if (!dauTrackSelection(postrack) || !dauTrackSelection(negtrack)) { + if (!selDaughterTracks(postrack) || !selDaughterTracks(negtrack)) { return false; } - if (v0.dcaV0daughters() > cfg_min_dca_V0_daughters) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 2.5); + + if (v0.dcaV0daughters() > cMinV0DcaDaughters) { return false; } - if (fabs(v0.dcapostopv()) < cfg_min_dca_pos_to_PV) { + if (std::abs(v0.dcapostopv()) < cMinDcaPosToPV) { return false; } - if (fabs(v0.dcanegtopv()) < cfg_min_dca_neg_to_PV) { + if (std::abs(v0.dcanegtopv()) < cMinDcaNegToPV) { return false; } - if (v0.dcav0topv() > cfg_min_dca_V0_to_PV) { + if (v0.dcav0topv() > cMinDcaV0ToPV) { return false; } - if ((v0.v0radius() > cfg_max_V0_radius) || (v0.v0radius() < cfg_min_V0_radius)) { + if ((v0.v0radius() > cMaxV0TransRadius) || (v0.v0radius() < cMinV0TransRadius)) { return false; } // ctau float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; - if (ctau < cfg_min_ctau || ctau > cfg_max_ctau) { + if (ctau < cMinV0CTau || ctau > cMaxV0CTau) { + return false; + } + + // cosine of pointing angle + if (v0.v0cosPA() < cMinV0CosPA) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), 3.5); + + // pT cut + if (v0.pt() <= cMinV0Pt || v0.pt() >= cMaxV0Pt) { + return false; + } + + // rapidity cut + if (std::abs(v0.yLambda()) >= cMaxV0Rap) { return false; } - if (v0.v0cosPA() < cfg_min_V0_cosPA) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 4.5); + + // Armentros-Podolanski Selection + if (cArmPodCutFlag && (std::abs(v0.alpha()) < v0.qtarm() / cArmPodCutValue)) { + return false; + } + + // Kshort mass rejection hypothesis + if (cKshortRejFlag && (std::abs(v0.mK0Short() - MassK0Short) <= cKshortRejMassWindow)) { return false; } @@ -414,9 +434,9 @@ struct lambdaCorrTableProducer { } template - bool selPIDTrack(T const& postrack, T const& negtrack) + bool selLambdaDauWithTpcPid(T const& postrack, T const& negtrack) { - bool return_flag = false; + bool returnFlag = false; float tpcNSigmaPr = 0., tpcNSigmaPi = 0.; switch (part) { @@ -433,62 +453,130 @@ struct lambdaCorrTableProducer { break; } - if (fabs(tpcNSigmaPr) < cfg_tpc_nsigma && fabs(tpcNSigmaPi) < cfg_tpc_nsigma) { - return_flag = true; + if (std::abs(tpcNSigmaPr) < cTpcNsigmaCut && std::abs(tpcNSigmaPi) < cTpcNsigmaCut) { + returnFlag = true; } - return return_flag; + return returnFlag; } - template - bool checkKinCuts(T const& v0track) + template + bool selLambdaMassWindow(V const& v0, T const&, ParticleType& v0type) { + // initialize daughter tracks + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); - // pT cut - if (v0track.pt() <= cfg_v0_pt_min || v0track.pt() >= cfg_v0_pt_max) { - return false; + // initialize selection flags + bool lambdaFlag = false, antiLambdaFlag = false; + + // get v0 track as lambda + if ((std::abs(v0.mLambda() - MassLambda0) < cLambdaMassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + lambdaFlag = true; + v0type = kLambda; } - // apply rapidity/pseudorapidity acceptance - float rap = 0.; - if (cfg_do_eta_analysis) { - rap = v0track.eta(); - } else { - rap = v0track.yLambda(); + // get v0 track as anti-lambda + if ((std::abs(v0.mAntiLambda() - MassLambda0) < cLambdaMassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + antiLambdaFlag = true; + v0type = kAntiLambda; } - if (fabs(rap) >= cfg_v0_rap_max) { + if (!lambdaFlag && !antiLambdaFlag) { // neither Lambda nor Anti-Lambda + histos.fill(HIST("Tracks/h1f_tracks_info"), 18.5); + return false; + } else if (lambdaFlag && antiLambdaFlag) { // check if the track is identified as lambda and anti-lambda both (DISCARD THIS TRACK) + histos.fill(HIST("Tracks/h1f_tracks_info"), 19.5); return false; } return true; } - template - void getPDGsIDs(T const& mcparts, std::vector& PDGs, std::vector& IDs) + template + bool selTrueMcRecLambda(V const& v0, T const&) { + auto mcpart = v0.template mcParticle_as(); - for (auto mcpart : mcparts) { - if (mcpart.globalIndex() != 0) { - IDs.push_back(mcpart.globalIndex()); - PDGs.push_back(mcpart.pdgCode()); - } + // check for lambda/anti-lambda + if (std::abs(mcpart.pdgCode()) != kLambda0) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 10.5); + return false; } - while (IDs.size() > 2) { - IDs.pop_back(); + // check for primary/secondary lambda + if (cRecPrimaryLambda && !mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 11.5); + return false; + } else if (!cRecPrimaryLambda && mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 12.5); + return false; } - while (PDGs.size() > 2) { - PDGs.pop_back(); + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + // check if the daughters have corresponding mcparticle + if (!postrack.has_mcParticle() || !negtrack.has_mcParticle()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 13.5); + return false; } + + auto mcpostrack = postrack.template mcParticle_as(); + auto mcnegtrack = negtrack.template mcParticle_as(); + + if (std::abs(mcpostrack.pdgCode()) != kProton || std::abs(mcnegtrack.pdgCode()) != kPiPlus) { // incorrect decay channel -> return false + histos.fill(HIST("Tracks/h1f_tracks_info"), 14.5); + return false; + } + + return true; } - template - void fillQALambda(C const& col, V const& v0, T const&) + template + float getCorrectionFactors(C const& col, V const& v0) { + // Check for efficiency correction flag and Rec/Gen Data + if (!cCorrectionFlag) { + return 1.; + } + + // Get from CCDB + auto ccdbObj = ccdb->getForTimeStamp(cPathCCDB.value, -1); - static constexpr std::string_view sub_dir[] = {"QA_Sel_Lambda/", "QA_Sel_AntiLambda/"}; + // Check CCDB Object + if (!ccdbObj) { + LOGF(warning, "CCDB OBJECT NOT FOUND"); + return 1.; + } + + // get ccdb object + TObject* obj = reinterpret_cast(ccdbObj->FindObject(Form("%s", vCorrFactStrings[cCorrFactHistType][part].c_str()))); + + if (obj->InheritsFrom("TH1F")) { + TH1F* hist = reinterpret_cast(obj->Clone()); + int ptBin = hist->GetXaxis()->FindBin(v0.pt()); + return hist->GetBinContent(ptBin); + } else if (obj->InheritsFrom("TH2F")) { + TH2F* hist = reinterpret_cast(obj->Clone()); + int ptBin = hist->GetXaxis()->FindBin(v0.pt()); + int rapBin = hist->GetYaxis()->FindBin(v0.yLambda()); + return hist->GetBinContent(ptBin, rapBin); + } else if (obj->InheritsFrom("TH3F")) { + TH3F* hist = reinterpret_cast(obj->Clone()); + int ptBin = hist->GetXaxis()->FindBin(v0.pt()); + int rapBin = hist->GetYaxis()->FindBin(v0.yLambda()); + int vzBin = hist->GetZaxis()->FindBin(col.posZ()); + return hist->GetBinContent(ptBin, rapBin, vzBin); + } else { + return 1.; + } + } + + template + void fillLambdaQAHistos(C const& col, V const& v0, T const&) + { + static constexpr std::string_view SubDir[] = {"QA/Lambda/", "QA/AntiLambda/"}; // daugthers auto postrack = v0.template posTrack_as(); @@ -507,168 +595,117 @@ struct lambdaCorrTableProducer { float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; float gctau = ctau * gamma; - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_inv_mass"), mass); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_pt"), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_eta"), v0.eta()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_rap"), v0.yLambda()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_phi"), v0.phi()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_eta"), v0.eta(), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_rap"), v0.yLambda(), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_phi"), v0.phi(), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_mass"), mass, v0.pt()); - - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_V0_daughters"), v0.dcaV0daughters()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_pos_to_PV"), v0.dcapostopv()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_neg_to_PV"), v0.dcanegtopv()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_V0_to_PV"), v0.dcav0topv()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_cospa"), v0.v0cosPA()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_radius"), v0.v0radius()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_ctau"), ctau); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_gctau"), gctau); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_qt_vs_alpha"), v0.alpha(), v0.qtarm()); - - histos.fill(HIST(sub_dir[part]) + HIST("h1d_pos_prong_pt"), postrack.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_pos_prong_eta"), postrack.eta()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_pos_prong_phi"), postrack.phi()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_neg_prong_pt"), negtrack.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_neg_prong_eta"), negtrack.eta()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_neg_prong_phi"), negtrack.phi()); - - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_dcaXY_vs_pt"), postrack.pt(), postrack.dcaXY()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_dcaXY_vs_pt"), negtrack.pt(), negtrack.dcaXY()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_dEdx_vs_p"), postrack.tpcInnerParam(), postrack.tpcSignal()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_dEdx_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcSignal()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_tpc_nsigma_pr_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPr()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_tpc_nsigma_pr_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPr()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_tpc_nsigma_pi_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPi()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_tpc_nsigma_pi_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_qt_vs_alpha"), v0.alpha(), v0.qtarm()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_V0_daughters"), v0.dcaV0daughters()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_pos_to_PV"), v0.dcapostopv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_neg_to_PV"), v0.dcanegtopv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_V0_to_PV"), v0.dcav0topv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_cospa"), v0.v0cosPA()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_radius"), v0.v0radius()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_ctau"), ctau); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_gctau"), gctau); + + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_pt"), postrack.pt()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_eta"), postrack.eta()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_phi"), postrack.phi()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_pt"), negtrack.pt()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_eta"), negtrack.eta()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_phi"), negtrack.phi()); + + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_dcaXY_vs_pt"), postrack.pt(), postrack.dcaXY()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_dcaXY_vs_pt"), negtrack.pt(), negtrack.dcaXY()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_dEdx_vs_p"), postrack.tpcInnerParam(), postrack.tpcSignal()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_dEdx_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcSignal()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_tpc_nsigma_pr_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPr()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pr_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPr()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_tpc_nsigma_pi_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPi()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pi_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); } - template - void selV0Particle(C const& collision, V const& v0track, T const& tracks) + template + void fillLambdaTables(C const& collision, V const& v0tracks, T const& tracks) { - - // apply kinematic cuts - if (!checkKinCuts(v0track)) { - return; - } - - // initialize daughter tracks - auto postrack = v0track.template posTrack_as(); - auto negtrack = v0track.template negTrack_as(); - - // initialize mass and v0lambda/v0antilambda - float mass = 0.; - ParticleType v0part; - - // apply daughter particle id - // check for Lambda / Anti-Lambda - if (selPIDTrack(postrack, negtrack)) { - mass = v0track.mLambda(); - v0part = kLambda; - } else if (selPIDTrack(postrack, negtrack)) { - mass = v0track.mAntiLambda(); - v0part = kAntiLambda; - } else { - return; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 3.5); - histos.fill(HIST("QA_Checks/h2d_before_masswincut_pt_vs_alpha"), v0track.alpha(), v0track.qtarm()); - - // apply Armentros-Podolanski Selection - if (cfg_armpod_flag && (fabs(v0track.alpha()) < v0track.qtarm() / cfg_armpod_val)) { - return; - } - - // apply kshort rejection hypothesis - if (cfg_kshort_rej_flag && (fabs(v0track.mK0Short() - MassK0Short) <= cfg_kshort_rej)) { - return; + if constexpr (dmc == kMC) { + histos.fill(HIST("Events/h1f_collisions_info"), 0.5); + if (!collision.has_mcCollision()) { + return; + } } - // fill mass histograms before applying mass window cut to get % purity - if (v0part == kLambda) { - histos.fill(HIST("QA_Checks/h1d_lambda_mass"), mass); - histos.fill(HIST("QA_Checks/h2d_lambda_pt_vs_mass"), mass, v0track.pt()); - } else if (v0part == kAntiLambda) { - histos.fill(HIST("QA_Checks/h1d_antilambda_mass"), mass); - histos.fill(HIST("QA_Checks/h2d_antilambda_pt_vs_mass"), mass, v0track.pt()); - } + histos.fill(HIST("Events/h1f_collisions_info"), 1.5); - // apply mass window cut (Selection of Lambda/AntiLambda) - if (fabs(mass - MassLambda0) >= cfg_lambda_mass_window) { + // select collision + if (!selCollision(collision)) { return; } - histos.fill(HIST("QA_Checks/h2d_after_masswincut_pt_vs_alpha"), v0track.alpha(), v0track.qtarm()); - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 4.5); + histos.fill(HIST("Events/h1f_collisions_info"), 2.5); + histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); - // MC Reco Analysis - if constexpr (reco) { - auto v0mcpart = v0track.mcParticle(); - - // Get information of all the reconstructed V0s - histos.fill(HIST("QA_Checks/h2d_tracks_pid_before_sel"), v0mcpart.pdgCode(), v0mcpart.pt()); - - // Get Daughters and Mothers - bool decay_channel_flag = false; - std::vector daughterPDGs{}, daughterIDs{}, motherPDGs{}, motherIDs{}; - auto mcpart_daughters = v0mcpart.template daughters_as(); - auto mcpart_mothers = v0mcpart.template mothers_as(); + lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); - if (cfg_rec_pid_flag) { + // initialize v0track objects + ParticleType v0type = kLambda; + float mass = 0., corr_fact = 1.; - if (v0part == kLambda && v0mcpart.pdgCode() != kLambda0) { - return; - } else if (v0part == kAntiLambda && v0mcpart.pdgCode() != kLambda0Bar) { - return; + for (auto const& v0 : v0tracks) { + // check for corresponding MCGen Particle + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 0.5); + if (!v0.has_mcParticle()) { + continue; } + } - getPDGsIDs(mcpart_daughters, daughterPDGs, daughterIDs); - getPDGsIDs(mcpart_mothers, motherPDGs, motherIDs); + histos.fill(HIST("Tracks/h1f_tracks_info"), 1.5); + histos.fill(HIST("Tracks/h2f_armpod_before_sel"), v0.alpha(), v0.qtarm()); - // Decay to Proton-Pion - if (abs(daughterPDGs[0]) == kProton && abs(daughterPDGs[1]) == kPiPlus) { - decay_channel_flag = true; - } + // topological and kinematic selection + // armeteros-podolanski selection | kshort mass rejection hypothesis + if (!selLambdaWithTopoKinCuts(collision, v0, tracks)) { + continue; + } - // check for correct decay channel - if (!decay_channel_flag) { - return; - } + histos.fill(HIST("Tracks/h1f_tracks_info"), 5.5); - // check whether the selected lambda is a Physical Primary / Secondary - if (cfg_rec_primary_lambda && !v0mcpart.isPhysicalPrimary()) { - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 7.5); - return; - } else if (cfg_rec_secondary_lambda && v0mcpart.isPhysicalPrimary()) { - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 8.5); - return; - } + // select v0 as lambda / anti-lambda + if (!selLambdaMassWindow(v0, tracks, v0type)) { + continue; + } - // check the secondary lambdas coming from Sigma, Cascades and Omegas - if (abs(motherPDGs[0]) == kSigma0 || abs(motherPDGs[1]) == kSigma0Bar) { - histos.fill(HIST("QA_Checks/h2d_lambda_from_sigma"), v0mcpart.pdgCode(), v0mcpart.pt()); - } + histos.fill(HIST("Tracks/h1f_tracks_info"), 6.5); + histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); - if (abs(motherPDGs[0]) == kXiMinus || abs(motherPDGs[1]) == kXiMinus) { - histos.fill(HIST("QA_Checks/h2d_lambda_from_cascade"), v0mcpart.pdgCode(), v0mcpart.pt()); + // we have v0 as lambda + // do MC analysis + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h2f_tracks_pid_before_sel"), v0.mcParticle().pdgCode(), v0.pt()); + if (cSelectTrueLambda && !selTrueMcRecLambda(v0, tracks)) { + continue; } + histos.fill(HIST("Tracks/h1f_tracks_info"), 7.5); + histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); } - // Fill the counter for selected primary/secondary Lambda/AntiLambda - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 5.5); - histos.fill(HIST("QA_Checks/h2d_tracks_pid_after_sel"), v0mcpart.pdgCode(), v0mcpart.pt()); - } + // get correction factors and mass + corr_fact = (v0type == kLambda) ? getCorrectionFactors(collision, v0) : getCorrectionFactors(collision, v0); + mass = (v0type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); - if (v0part == kLambda) { - fillQALambda(collision, v0track, tracks); - } else { - fillQALambda(collision, v0track, tracks); - } + // fill lambda qa + if (v0type == kLambda) { + histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + } else { + histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + } - // Fill Lambda/AntiLambda Table - lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0track.px(), v0track.py(), v0track.pz(), v0track.pt(), v0track.eta(), v0track.phi(), v0track.yLambda(), mass, postrack.index(), negtrack.index(), (int8_t)v0part, v0track.v0cosPA(), v0track.dcaV0daughters()); + // Fill Lambda/AntiLambda Table + lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), + v0.pt(), v0.eta(), v0.phi(), v0.yLambda(), mass, + v0.template posTrack_as().index(), v0.template negTrack_as().index(), + (int8_t)v0type, v0.v0cosPA(), v0.dcaV0daughters(), corr_fact); + } } using Collisions = soa::Join; @@ -676,219 +713,89 @@ struct lambdaCorrTableProducer { void processData(Collisions::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) { - - histos.fill(HIST("Event/h1d_collisions_info"), 1.5); - - // select collision - if (!selCol(collision)) { - return; - } - - histos.fill(HIST("Event/h1d_collisions_info"), 2.5); - histos.fill(HIST("Event/h1d_collision_posZ"), collision.posZ()); - - lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); - - for (auto const& v0 : V0s) { - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 1.5); - histos.fill(HIST("QA_Checks/h2d_before_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - // apply topological cuts on v0 candidates - if (!topologicalCutsV0(collision, v0, tracks)) { - continue; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 2.5); - histos.fill(HIST("QA_Checks/h2d_after_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - selV0Particle(collision, v0, tracks); - } + fillLambdaTables(collision, V0s, tracks); } - PROCESS_SWITCH(lambdaCorrTableProducer, processData, "Process for DATA", true); - - Preslice> perCol = aod::track::collisionId; - Preslice perMCCol = aod::mcparticle::mcCollisionId; + PROCESS_SWITCH(LambdaCorrTableProducer, processData, "Process for DATA", true); - SliceCache cache1; - - // Service pdgDB; - - using CollisionsWithMcLabels = soa::Join; - // using McCollisions = soa::Join; - using McCollisions = aod::McCollisions; using McV0Tracks = soa::Join; using TracksMC = soa::Join; - void processMCReco(CollisionsWithMcLabels const& collisions, McCollisions const&, McV0Tracks const& V0s, aod::McParticles const& /*mcParticles*/, TracksMC const& tracks) + void processMCReco(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, aod::McParticles const&, TracksMC const& tracks) { - - for (auto const& collision : collisions) { - - histos.fill(HIST("Event/h1d_collisions_info"), 1.5); - - // select collision - if (!selCol(collision)) { - continue; - } - - histos.fill(HIST("Event/h1d_collisions_info"), 2.5); - - // check for corresponding MCGen Collision - if (cfg_has_mc_flag && !collision.has_mcCollision()) { - continue; - } - - histos.fill(HIST("Event/h1d_collisions_info"), 3.5); - histos.fill(HIST("Event/h1d_collision_posZ"), collision.posZ()); - - lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); - - // auto const& mcCollision = collision.mcCollision_as(); - - // v0-track loop - auto v0sThisCollision = V0s.sliceBy(perCol, collision.globalIndex()); - for (auto const& v0 : v0sThisCollision) { - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 0.5); - - // check for corresponding MCGen Particle - if (cfg_has_mc_flag && !v0.has_mcParticle()) { - continue; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 1.5); - histos.fill(HIST("QA_Checks/h2d_before_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - // apply topological cuts on v0 candidates - if (!topologicalCutsV0(collision, v0, tracks)) { - continue; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 2.5); - histos.fill(HIST("QA_Checks/h2d_after_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - selV0Particle(collision, v0, tracks); - } - } + fillLambdaTables(collision, V0s, tracks); } - PROCESS_SWITCH(lambdaCorrTableProducer, processMCReco, "Process for MC Reconstructed", false); + PROCESS_SWITCH(LambdaCorrTableProducer, processMCReco, "Process for MC Reconstructed", false); - void processMCGen(McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) + void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) { - - histos.fill(HIST("McGen/h1d_collisions_info"), 1.5); + histos.fill(HIST("McGen/h1f_collisions_info"), 1.5); // apply collision cuts - if (mcCollision.posZ() < cfg_min_z_vtx || mcCollision.posZ() > cfg_max_z_vtx) { + if (mcCollision.posZ() < cMinZVtx || mcCollision.posZ() > cMaxZVtx) { return; } - histos.fill(HIST("McGen/h1d_collisions_info"), 2.5); - histos.fill(HIST("McGen/h1d_collision_posZ"), mcCollision.posZ()); + histos.fill(HIST("McGen/h1f_collisions_info"), 2.5); + histos.fill(HIST("McGen/h1f_collision_posZ"), mcCollision.posZ()); lambdaMCGenCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); - float mass = 0.; + + // initialize track objects + ParticleType v0type = kLambda; for (auto const& mcpart : mcParticles) { // check for Lambda first - if (abs(mcpart.pdgCode()) != kLambda0) { + if (mcpart.pdgCode() == kLambda0) { + v0type = kLambda; + } else if (mcpart.pdgCode() == kLambda0Bar) { + v0type = kAntiLambda; + } else { continue; } // check for Primary Lambdas/AntiLambdas - if (cfg_gen_primary_lambda && !mcpart.isPhysicalPrimary()) { + if (cGenPrimaryLambda && !mcpart.isPhysicalPrimary()) { continue; } // apply kinematic acceptance - if (mcpart.pt() <= cfg_v0_pt_min || mcpart.pt() >= cfg_v0_pt_max) { - continue; - } - - float rap = 0.; - if (cfg_do_eta_analysis) { - rap = mcpart.eta(); - } else { - rap = mcpart.y(); - } - - if (fabs(rap) >= cfg_v0_rap_max) { + if (mcpart.pt() <= cMinV0Pt || mcpart.pt() >= cMaxV0Pt || std::abs(mcpart.y()) >= cMaxV0Rap) { continue; } - // Get Daughters and Mothers - bool decay_channel_flag = false; - std::vector daughterPDGs{}, daughterIDs{}, motherPDGs{}, motherIDs{}; - auto mcpart_daughters = mcpart.template daughters_as(); - auto mcpart_mothers = mcpart.template mothers_as(); - getPDGsIDs(mcpart_daughters, daughterPDGs, daughterIDs); - getPDGsIDs(mcpart_mothers, motherPDGs, motherIDs); - - // Decay to Proton-Pion - if (abs(daughterPDGs[0]) == kProton && abs(daughterPDGs[1]) == kPiPlus) { - decay_channel_flag = true; + // check for correct decay channel + auto dautracks = mcpart.template daughters_as(); + std::vector daughterPDGs, daughterIDs; + for (auto const& dautrack : dautracks) { + daughterPDGs.push_back(dautrack.pdgCode()); + daughterIDs.push_back(dautrack.globalIndex()); } - - if (!decay_channel_flag) { + if (std::abs(daughterPDGs[0]) != kProton || std::abs(daughterPDGs[1]) != kPiPlus) { continue; } - mass = RecoDecay::m(mcpart.p(), mcpart.e()); - - // Fill histograms - if (mcpart.pdgCode() == kLambda0) { - histos.fill(HIST("McGen/h1d_lambda_daughter_PDG"), daughterPDGs[0]); - histos.fill(HIST("McGen/h1d_lambda_daughter_PDG"), daughterPDGs[1]); - histos.fill(HIST("McGen/h1d_mass_lambda"), mass); - histos.fill(HIST("McGen/h1d_pt_lambda"), mcpart.pt()); - histos.fill(HIST("McGen/h1d_eta_lambda"), mcpart.eta()); - histos.fill(HIST("McGen/h1d_y_lambda"), mcpart.y()); - histos.fill(HIST("McGen/h1d_phi_lambda"), mcpart.phi()); - histos.fill(HIST("McGen/h2d_pteta_lambda"), mcpart.eta(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptrap_lambda"), mcpart.y(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptphi_lambda"), mcpart.phi(), mcpart.pt()); - lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), mass, daughterIDs[0], daughterIDs[1], (int8_t)kLambda, -999., -999.); - } else if (mcpart.pdgCode() == kLambda0Bar) { - histos.fill(HIST("McGen/h1d_antilambda_daughter_PDG"), daughterPDGs[0]); - histos.fill(HIST("McGen/h1d_antilambda_daughter_PDG"), daughterPDGs[1]); - histos.fill(HIST("McGen/h1d_mass_antilambda"), mass); - histos.fill(HIST("McGen/h1d_pt_antilambda"), mcpart.pt()); - histos.fill(HIST("McGen/h1d_eta_antilambda"), mcpart.eta()); - histos.fill(HIST("McGen/h1d_y_antilambda"), mcpart.y()); - histos.fill(HIST("McGen/h1d_phi_antilambda"), mcpart.phi()); - histos.fill(HIST("McGen/h2d_pteta_antilambda"), mcpart.eta(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptrap_antilambda"), mcpart.y(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptphi_antilambda"), mcpart.phi(), mcpart.pt()); - lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), mass, daughterIDs[1], daughterIDs[0], (int8_t)kAntiLambda, -999., -999.); - } + lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), + mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), + daughterIDs[0], daughterIDs[1], (int8_t)v0type, -999., -999., 1.); } } - PROCESS_SWITCH(lambdaCorrTableProducer, processMCGen, "Process for MC Generated", false); + PROCESS_SWITCH(LambdaCorrTableProducer, processMCGen, "Process for MC Generated", false); }; -struct lambdaCorrelationAnalysis { +struct LambdaR2Correlation { // Global Configurables - Configurable cfg_nRapBins{"cfg_nRapBins", 12, "N Rapidity Bins"}; - Configurable cfg_Rap_Min{"cfg_Rap_Min", -0.6, "Minimum Rapidity"}; - Configurable cfg_Rap_Max{"cfg_Rap_Max", 0.6, "Maximum Rapidity"}; - Configurable cfg_nPhiBins{"cfg_nPhiBins", 64, "N Phi Bins"}; - Configurable cfg_Phi_Min{"cfg_Phi_Min", 0, "Minimum Phi"}; - Configurable cfg_Phi_Max{"cfg_Phi_Max", 2 * TMath::Pi(), "Maximum Phi"}; + Configurable cNRapBins{"cNRapBins", 12, "N Rapidity Bins"}; + Configurable cMinRap{"cMinRap", -0.6, "Minimum Rapidity"}; + Configurable cMaxRap{"cMaxRap", 0.6, "Maximum Rapidity"}; + Configurable cNPhiBins{"cNPhiBins", 64, "N Phi Bins"}; // remove lambda with shared daughters - Configurable cfg_remove_lambda{"cfg_remove_lambda", true, "Flag to remove lambda"}; - - // Efficiency Correction - Configurable cfg_eff_corr_flag{"cfg_eff_corr_flag", true, "Efficiency Correction Flag"}; - - // CCDB - Configurable cfg_ccdb_url{"cfg_ccdb_url", "http://ccdb-test.cern.ch:8080", "url of ccdb"}; - Configurable cfg_ccdb_path{"cfg_ccdb_path", "Users/y/ypatley/lambda_corr_fact", "Path for ccdb-object"}; + Configurable cRemoveLambdaSharingDau{"cRemoveLambdaSharingDau", true, "Flag to remove lambda"}; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -899,33 +806,23 @@ struct lambdaCorrelationAnalysis { float kmaxrap = 0.; float nphibins = 0.; float kminphi = 0.; - float kmaxphi = 0.; + float kmaxphi = TwoPI; float rapbinwidth = 0.; float phibinwidth = 0.; float q = 0., e = 0., qinv = 0.; - // Initialize CCDB Service - Service ccdb; - void init(InitContext const&) { - - // Set CCDB url - ccdb->setURL(cfg_ccdb_url.value); - ccdb->setCaching(true); - // Set Density Histogram Attributes - nrapbins = static_cast(cfg_nRapBins); - kminrap = static_cast(cfg_Rap_Min); - kmaxrap = static_cast(cfg_Rap_Max); - nphibins = static_cast(cfg_nPhiBins); - kminphi = static_cast(cfg_Phi_Min); - kmaxphi = static_cast(cfg_Phi_Max); + nrapbins = static_cast(cNRapBins); + kminrap = static_cast(cMinRap); + kmaxrap = static_cast(cMaxRap); + nphibins = static_cast(cNPhiBins); rapbinwidth = (kmaxrap - kminrap) / nrapbins; phibinwidth = (kmaxphi - kminphi) / nphibins; - int knrapphibins = static_cast(cfg_nRapBins) * static_cast(cfg_nPhiBins); + int knrapphibins = static_cast(cNRapBins) * static_cast(cNPhiBins); float kminrapphi = 0.; float kmaxrapphi = knrapphibins; @@ -934,39 +831,43 @@ struct lambdaCorrelationAnalysis { const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisMass(100, 1.06, 1.16, "Inv Mass (GeV/#it{c}^{2})"); - const AxisSpec axisPt(64, 0.3, 3.5, "p_{T} (GeV/#it{c})"); + const AxisSpec axisPt(64, 0.2, 3.5, "p_{T} (GeV/#it{c})"); const AxisSpec axisEta(24, -1.2, 1.2, "#eta"); const AxisSpec axisCPA(100, 0.99, 1.0, "cos(#theta_{PA})"); const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); - const AxisSpec axisRap(cfg_nRapBins, cfg_Rap_Min, cfg_Rap_Max, "y"); - const AxisSpec axisPhi(cfg_nPhiBins, cfg_Phi_Min, cfg_Phi_Max, "#phi (rad)"); + const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); + const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#phi (rad)"); const AxisSpec axisRapPhi(knrapphibins, kminrapphi, kmaxrapphi, "y #phi"); const AxisSpec axisQinv(100, 0, 10, "q_{inv} (GeV/#it{c})"); - const AxisSpec axisEfPt(16, 0.3, 3.5, "p_{T}"); + const AxisSpec axisEfPt(19, 0.2, 4.0, "p_{T}"); const AxisSpec axisEfEta(24, -1.2, 1.2, "#eta"); const AxisSpec axisEfRap(24, -1.2, 1.2, "y"); const AxisSpec axisEfPosZ(10, -10., 10., "V_{Z}"); // Create Histograms. // Event - histos.add("Event/Reco/h1d_collision_posz", "V_{Z} Distribution", kTH1F, {axisPosZ}); - histos.add("Event/Reco/h1d_ft0m_mult_percentile", "FT0M (%)", kTH1F, {axisCent}); - histos.add("Event/Reco/h1d_lambda_multiplicity", "#Lambda - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_antilambda_multiplicity", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_lambda_sdau", "#Lambda - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_antilambda_sdau", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_lambda_totmult", "#Lambda - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_antilambda_totmult", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1f_collision_posz", "V_{Z} Distribution", kTH1F, {axisPosZ}); + histos.add("Event/Reco/h1f_ft0m_mult_percentile", "FT0M (%)", kTH1F, {axisCent}); + histos.add("Event/Reco/h1i_lambda_multiplicity", "#Lambda - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_antilambda_multiplicity", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_lambda_sdau", "#Lambda - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_antilambda_sdau", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_lambda_totmult", "#Lambda - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_antilambda_totmult", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); // InvMass, DcaDau and CosPA - histos.add("Reco/QA_Lambda/h1d_V0_mass", "M_{p#pi}", kTH1F, {axisMass}); - histos.add("Reco/QA_Lambda/h1d_V0_cpa", "cos(#theta_{PA})", kTH1F, {axisCPA}); - histos.add("Reco/QA_Lambda/h1d_V0_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); + histos.add("Reco/QA_Lambda/h1f_invmass", "M_{p#pi}", kTH1F, {axisMass}); + histos.add("Reco/QA_Lambda/h1f_cospa", "cos(#theta_{PA})", kTH1F, {axisCPA}); + histos.add("Reco/QA_Lambda/h1f_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); histos.addClone("Reco/QA_Lambda/", "Reco/QA_AntiLambda/"); // Efficiency Histograms + histos.add("Reco/Efficiency/h2f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisEfPt, axisEfEta}); + histos.add("Reco/Efficiency/h2f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisEfPt, axisEfEta}); + histos.add("Reco/Efficiency/h2f_n1_ptrap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisEfPt, axisEfRap}); + histos.add("Reco/Efficiency/h2f_n1_ptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisEfPt, axisEfRap}); histos.add("Reco/Efficiency/h3f_n1_ptetaposz_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisEfPt, axisEfEta, axisEfPosZ}); histos.add("Reco/Efficiency/h3f_n1_ptetaposz_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisEfPt, axisEfEta, axisEfPosZ}); histos.add("Reco/Efficiency/h3f_n1_ptrapposz_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisEfPt, axisEfRap, axisEfPosZ}); @@ -982,16 +883,26 @@ struct lambdaCorrelationAnalysis { histos.add("Reco/h1d_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH1D, {axisEta}); histos.add("Reco/h1d_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH1D, {axisPhi}); histos.add("Reco/h1d_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH1D, {axisPhi}); + + // rho1 for R2 deta dphi histograms + histos.add("Reco/h2d_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisRap, axisPhi}); + histos.add("Reco/h2d_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisRap, axisPhi}); + + // rho1 for R2 qinv histograms + histos.add("Reco/h2d_n1_ptrap_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisPt, axisRap}); + histos.add("Reco/h2d_n1_ptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisPt, axisRap}); + + // rho2 for R2 deta dphi histograms + histos.add("Reco/h2d_n2_rapphi_LaP_LaM", "#rho_{2}^{#Lambda - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + histos.add("Reco/h2d_n2_rapphi_LaP_LaP", "#rho_{2}^{#Lambda - #Lambda}", kTH2D, {axisRapPhi, axisRapPhi}); + histos.add("Reco/h2d_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda} - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + + // rho2 for R2 qinv histograms histos.add("Reco/h1d_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda-#bar{#Lambda}}", kTH1D, {axisQinv}); histos.add("Reco/h1d_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda-#Lambda}", kTH1D, {axisQinv}); histos.add("Reco/h1d_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}-#bar{#Lambda}}", kTH1D, {axisQinv}); - // 2D Histograms - histos.add("Reco/h2d_n1_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisRap, axisPhi}); - histos.add("Reco/h2d_n1_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisRap, axisPhi}); - histos.add("Reco/h2d_n2_LaP_LaM", "#rho_{2}^{#Lambda - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); - histos.add("Reco/h2d_n2_LaP_LaP", "#rho_{2}^{#Lambda - #Lambda}", kTH2D, {axisRapPhi, axisRapPhi}); - histos.add("Reco/h2d_n2_LaM_LaM", "#rho_{2}^{#bar{#Lambda} - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + // rho2 for qa checks histos.add("Reco/h2d_n2_pt1pt2_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2D, {axisPt, axisPt}); histos.add("Reco/h2d_n2_pt1pt2_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2D, {axisPt, axisPt}); histos.add("Reco/h2d_n2_pt1pt2_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2D, {axisPt, axisPt}); @@ -1025,75 +936,37 @@ struct lambdaCorrelationAnalysis { bool removeLambdaSharingDau(T const& v, V const& vs) { // check whether to remove lambda or not - if (!cfg_remove_lambda) { + if (!cRemoveLambdaSharingDau) { return true; } - static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; - static constexpr std::string_view sub_dir[] = {"QA_Lambda/", "QA_AntiLambda/"}; + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirHist[] = {"QA_Lambda/", "QA_AntiLambda/"}; - bool ret_flag = true; + bool retFlag = true; for (auto const& x : vs) { - if ((v.index() != x.index()) && (v.postrackid() == x.postrackid() || v.negtrackid() == x.negtrackid())) { + if ((v.index() != x.index()) && (v.posTrackId() == x.posTrackId() || v.negTrackId() == x.negTrackId())) { if (fillHist) { - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir[part]) + HIST("h1d_V0_mass"), x.mass()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir[part]) + HIST("h1d_V0_cpa"), x.cospa()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir[part]) + HIST("h1d_V0_dcadau"), x.dcadau()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirHist[part]) + HIST("h1f_invmass"), x.mass()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirHist[part]) + HIST("h1f_cospa"), x.cosPA()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirHist[part]) + HIST("h1f_dcadau"), x.dcaDau()); } if (std::abs(v.mass() - MassLambda0) > std::abs(x.mass() - MassLambda0)) { - ret_flag = false; + retFlag = false; break; } } } - return ret_flag; + return retFlag; } - template - void get_corr_factor(float& corfact, C const& col, T const& track) + template + void fillPairHistos(U& p1, U& p2) { - - // Check for efficiency correction flag and Rec/Gen Data - if (!cfg_eff_corr_flag || rec_gen == kGen) { - return; - } - - // Get from CCDB - auto ccdb_obj = ccdb->getForTimeStamp(cfg_ccdb_path.value, -1); - - // Check CCDB Object - if (!ccdb_obj) { - LOGF(warning, "CCDB OBJECT NOT FOUND"); - return; - } - - std::string str; - - if (track.v0type() == kLambda) { - str = "h3f_lambda_corr_fact"; - } else { - str = "h3f_antilambda_corr_fact"; - } - - TH3F* hist = reinterpret_cast(ccdb_obj->FindObject(Form("%s", str.c_str()))); - - int pt_bin = hist->GetXaxis()->FindBin(track.pt()); - int eta_bin = hist->GetYaxis()->FindBin(track.eta()); - int vz_bin = hist->GetZaxis()->FindBin(col.posZ()); - - corfact = hist->GetBinContent(pt_bin + 0.00001, eta_bin + 0.00001, vz_bin + 0.01); - - return; - } - - template - void fillPairHistos(C const& col, U& p1, U& p2) - { - - static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; - static constexpr std::string_view sub_dir_hist[] = {"LaP_LaM", "LaP_LaP", "LaM_LaM"}; + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirHist[] = {"LaP_LaM", "LaP_LaP", "LaM_LaM"}; int rapbin1 = static_cast((p1.rap() - kminrap) / rapbinwidth); int rapbin2 = static_cast((p2.rap() - kminrap) / rapbinwidth); @@ -1101,43 +974,38 @@ struct lambdaCorrelationAnalysis { int phibin1 = static_cast(p1.phi() / phibinwidth); int phibin2 = static_cast(p2.phi() / phibinwidth); - float corfac1 = 1., corfac2 = 1.; + float corfac1 = p1.corrFact(), corfac2 = p2.corrFact(); - get_corr_factor(corfac1, col, p1); - get_corr_factor(corfac2, col, p2); - - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1pt2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.pt(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_eta1eta2_") + HIST(sub_dir_hist[part_pair]), p1.eta(), p2.eta(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_phi1phi2_") + HIST(sub_dir_hist[part_pair]), p1.phi(), p2.phi(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_rap1rap2_") + HIST(sub_dir_hist[part_pair]), p1.rap(), p2.rap(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1eta2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.eta(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1phi2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.phi(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1rap2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.rap(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1pt2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.pt(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_eta1eta2_") + HIST(SubDirHist[part_pair]), p1.eta(), p2.eta(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_phi1phi2_") + HIST(SubDirHist[part_pair]), p1.phi(), p2.phi(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_rap1rap2_") + HIST(SubDirHist[part_pair]), p1.rap(), p2.rap(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1eta2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.eta(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1phi2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.phi(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1rap2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.rap(), corfac1 * corfac2); if (rapbin1 >= 0 && rapbin2 >= 0 && phibin1 >= 0 && phibin2 >= 0 && rapbin1 < nrapbins && rapbin2 < nrapbins && phibin1 < nphibins && phibin2 < nphibins) { int rapphix = rapbin1 * nphibins + phibin1; int rapphiy = rapbin2 * nphibins + phibin2; - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_") + HIST(sub_dir_hist[part_pair]), rapphix + 0.5, rapphiy + 0.5, corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_rapphi_") + HIST(SubDirHist[part_pair]), rapphix + 0.5, rapphiy + 0.5, corfac1 * corfac2); } // qinv histos q = RecoDecay::p((p1.px() - p2.px()), (p1.py() - p2.py()), (p1.pz() - p2.pz())); e = RecoDecay::e(p1.px(), p1.py(), p1.pz(), MassLambda0) - RecoDecay::e(p2.px(), p2.py(), p2.pz(), MassLambda0); qinv = std::sqrt(-RecoDecay::m2(q, e)); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n2_qinv_") + HIST(sub_dir_hist[part_pair]), qinv, corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n2_qinv_") + HIST(SubDirHist[part_pair]), qinv, corfac1 * corfac2); } template void analyzeSingles(C const& col, T const& tracks) { - - static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; - static constexpr std::string_view sub_dir_hist[] = {"LaP", "LaM"}; + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirHist[] = {"LaP", "LaM"}; int ntrk1 = 0, ntrk2 = 0, ntrk3 = 0; - float corfac = 1.; for (auto const& track : tracks) { ++ntrk1; @@ -1147,51 +1015,51 @@ struct lambdaCorrelationAnalysis { } ++ntrk3; - // Get Correction Factor - get_corr_factor(corfac, col, track); - // QA Plots - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_pt_") + HIST(sub_dir_hist[part]), track.pt(), corfac); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_eta_") + HIST(sub_dir_hist[part]), track.eta(), corfac); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_phi_") + HIST(sub_dir_hist[part]), track.phi(), corfac); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_rap_") + HIST(sub_dir_hist[part]), track.rap(), corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_pt_") + HIST(SubDirHist[part]), track.pt(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_eta_") + HIST(SubDirHist[part]), track.eta(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_phi_") + HIST(SubDirHist[part]), track.phi(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_rap_") + HIST(SubDirHist[part]), track.rap(), track.corrFact()); // Efficiency Calculation Plots - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("Efficiency/h3f_n1_ptetaposz_") + HIST(sub_dir_hist[part]), track.pt(), track.eta(), col.posZ()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("Efficiency/h3f_n1_ptrapposz_") + HIST(sub_dir_hist[part]), track.pt(), track.rap(), col.posZ()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h2f_n1_pteta_") + HIST(SubDirHist[part]), track.pt(), track.eta()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h2f_n1_ptrap_") + HIST(SubDirHist[part]), track.pt(), track.rap()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h3f_n1_ptetaposz_") + HIST(SubDirHist[part]), track.pt(), track.eta(), col.posZ()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h3f_n1_ptrapposz_") + HIST(SubDirHist[part]), track.pt(), track.rap(), col.posZ()); // Rho1 for R2 Calculation - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n1_") + HIST(sub_dir_hist[part]), track.rap(), track.phi(), corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n1_ptrap_") + HIST(SubDirHist[part]), track.pt(), track.rap(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n1_rapphi_") + HIST(SubDirHist[part]), track.rap(), track.phi(), track.corrFact()); } // fill multiplicity histograms if (ntrk1 != 0) { if (part == kLambda) { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_lambda_totmult"), ntrk1); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_lambda_totmult"), ntrk1); } else { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_antilambda_totmult"), ntrk1); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_antilambda_totmult"), ntrk1); } } if (ntrk2 != 0) { if (part == kLambda) { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_lambda_sdau"), ntrk2); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_lambda_sdau"), ntrk2); } else { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_antilambda_sdau"), ntrk2); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_antilambda_sdau"), ntrk2); } } if (ntrk3 != 0) { if (part == kLambda) { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_lambda_multiplicity"), ntrk3); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_lambda_multiplicity"), ntrk3); } else { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_antilambda_multiplicity"), ntrk3); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_antilambda_multiplicity"), ntrk3); } } } - template - void analyzePairs(C const& col, T const& trks_1, T const& trks_2) + template + void analyzePairs(T const& trks_1, T const& trks_2) { for (auto const& trk_1 : trks_1) { if (!removeLambdaSharingDau(trk_1, trks_1)) { @@ -1202,68 +1070,67 @@ struct lambdaCorrelationAnalysis { if (samelambda && ((trk_1.index() == trk_2.index()))) { continue; } - // check if Lambda shares a daughter and select the one closest to PDG Mass if (!removeLambdaSharingDau(trk_2, trks_2)) { continue; } - fillPairHistos(col, trk_1, trk_2); + fillPairHistos(trk_1, trk_2); } } } - using Lambda_Collisions = aod::LambdaCollisions; - using Lambda_Tracks = aod::LambdaTracks; + using LambdaCollisions = aod::LambdaCollisions; + using LambdaTracks = aod::LambdaTracks; SliceCache cache; - Partition part_lambda_tracks = (aod::lambdatrack::v0type == (int8_t)kLambda); - Partition part_anti_lambda_tracks = (aod::lambdatrack::v0type == (int8_t)kAntiLambda); + Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda); + Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda); - void processDataReco(Lambda_Collisions::iterator const& collision, Lambda_Tracks const&) + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) { - histos.fill(HIST("Event/Reco/h1d_collision_posz"), collision.posZ()); - histos.fill(HIST("Event/Reco/h1d_ft0m_mult_percentile"), collision.cent()); + histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); + histos.fill(HIST("Event/Reco/h1f_ft0m_mult_percentile"), collision.cent()); - auto lambda_tracks = part_lambda_tracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - auto anti_lambda_tracks = part_anti_lambda_tracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - analyzeSingles(collision, lambda_tracks); - analyzeSingles(collision, anti_lambda_tracks); - analyzePairs(collision, lambda_tracks, anti_lambda_tracks); - analyzePairs(collision, lambda_tracks, lambda_tracks); - analyzePairs(collision, anti_lambda_tracks, anti_lambda_tracks); + analyzeSingles(collision, lambdaTracks); + analyzeSingles(collision, antiLambdaTracks); + analyzePairs(lambdaTracks, antiLambdaTracks); + analyzePairs(lambdaTracks, lambdaTracks); + analyzePairs(antiLambdaTracks, antiLambdaTracks); } - PROCESS_SWITCH(lambdaCorrelationAnalysis, processDataReco, "Process for Data and MCReco", true); + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); - using LambdaMCGenCollisions = aod::LambdaMCGenCollisions; - using LambdaMCGenTracks = aod::LambdaMCGenTracks; + using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; + using LambdaMcGenTracks = aod::LambdaMcGenTracks; SliceCache cachemc; - Partition part_lambda_mcgen_tracks = aod::lambdatrack::v0type == (int8_t)kLambda; - Partition part_antilambda_mcgen_tracks = aod::lambdatrack::v0type == (int8_t)kAntiLambda; + Partition partLambdaMcGenTracks = aod::lambdatrack::v0Type == (int8_t)kLambda; + Partition partAntiLambdaMcGenTracks = aod::lambdatrack::v0Type == (int8_t)kAntiLambda; - void processMCGen(LambdaMCGenCollisions::iterator const& mcgencol, LambdaMCGenTracks const&) + void processMCGen(LambdaMcGenCollisions::iterator const& mcgencol, LambdaMcGenTracks const&) { - histos.fill(HIST("Event/McGen/h1d_collision_posz"), mcgencol.posZ()); + histos.fill(HIST("Event/McGen/h1f_collision_posz"), mcgencol.posZ()); - auto lambda_mcgen_tracks = part_lambda_mcgen_tracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); - auto antilambda_mcgen_tracks = part_antilambda_mcgen_tracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto lambdaMcGenTracks = partLambdaMcGenTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto antiLambdaMcGenTracks = partAntiLambdaMcGenTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); - analyzeSingles(mcgencol, lambda_mcgen_tracks); - analyzeSingles(mcgencol, antilambda_mcgen_tracks); - analyzePairs(mcgencol, lambda_mcgen_tracks, antilambda_mcgen_tracks); - analyzePairs(mcgencol, lambda_mcgen_tracks, lambda_mcgen_tracks); - analyzePairs(mcgencol, antilambda_mcgen_tracks, antilambda_mcgen_tracks); + analyzeSingles(mcgencol, lambdaMcGenTracks); + analyzeSingles(mcgencol, antiLambdaMcGenTracks); + analyzePairs(lambdaMcGenTracks, antiLambdaMcGenTracks); + analyzePairs(lambdaMcGenTracks, lambdaMcGenTracks); + analyzePairs(antiLambdaMcGenTracks, antiLambdaMcGenTracks); } - PROCESS_SWITCH(lambdaCorrelationAnalysis, processMCGen, "Process for MC Generated", false); + PROCESS_SWITCH(LambdaR2Correlation, processMCGen, "Process for MC Generated", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } From 6cd090745a940140d1eb028747c6600381f13997 Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:24:12 +0100 Subject: [PATCH 34/91] [PWGCF] added SPM and corrected phi range (#8797) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/CMakeLists.txt | 4 +- .../{ZDCQvectors.cxx => zdcQVectors.cxx} | 493 +++++++++--------- PWGCF/Flow/Tasks/flowSP.cxx | 142 +++-- 3 files changed, 350 insertions(+), 289 deletions(-) rename PWGCF/Flow/TableProducer/{ZDCQvectors.cxx => zdcQVectors.cxx} (57%) diff --git a/PWGCF/Flow/TableProducer/CMakeLists.txt b/PWGCF/Flow/TableProducer/CMakeLists.txt index 667fcde6866..8774e589414 100644 --- a/PWGCF/Flow/TableProducer/CMakeLists.txt +++ b/PWGCF/Flow/TableProducer/CMakeLists.txt @@ -10,7 +10,7 @@ # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(flow-zdc-qvectors - SOURCES ZDCQvectors.cxx +o2physics_add_dpl_workflow(zdc-q-vectors + SOURCES zdcQVectors.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx similarity index 57% rename from PWGCF/Flow/TableProducer/ZDCQvectors.cxx rename to PWGCF/Flow/TableProducer/zdcQVectors.cxx index f8cfb02a8a4..de946251704 100644 --- a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -9,7 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done +/// \file zdcQVectors.cxx +/// \author Noor Koster +/// \since 11/2024 +/// \brief In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done #include #include @@ -62,7 +65,7 @@ using namespace o2::aod::track; using namespace o2::aod::evsel; // define my..... -using myCollisions = soa::Join; +using UsedCollisions = soa::Join; using BCsRun3 = soa::Join; namespace o2::analysis::qvectortask @@ -71,45 +74,34 @@ namespace o2::analysis::qvectortask int counter = 0; // step0 -> Energy calib -std::shared_ptr ZN_Energy[10] = {{nullptr}}; -std::shared_ptr hQx_vs_Qy[6] = {{nullptr}}; +std::shared_ptr energyZN[10] = {{nullptr}}; +std::shared_ptr hQxvsQy[6] = {{nullptr}}; // and -std::shared_ptr COORD_correlations[6][4] = {{nullptr}}; -std::vector hZN_mean(10, nullptr); // Get from calibration file - -// step1: 4D large bins -std::vector mean_10perCent_v(4, nullptr); // hQXA, hQYA, hQXC, hQYC - -// step2: Small bins 1D -std::vector mean_cent_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vx_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vy_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vz_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::shared_ptr hCOORDcorrelations[6][4] = {{nullptr}}; // Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb // Energy calibration: -std::vector names_Ecal(10, ""); +std::vector namesEcal(10, ""); std::vector> names(5, std::vector()); //(1x 4d 4x 1d) std::vector vnames = {"hvertex_vx", "hvertex_vy"}; // https://alice-notes.web.cern.ch/system/files/notes/analysis/620/017-May-31-analysis_note-ALICE_analysis_note_v2.pdf -std::vector ZDC_px = {-1.75, 1.75, -1.75, 1.75}; -std::vector ZDC_py = {-1.75, -1.75, 1.75, 1.75}; +std::vector pxZDC = {-1.75, 1.75, -1.75, 1.75}; +std::vector pyZDC = {-1.75, -1.75, 1.75, 1.75}; double alphaZDC = 0.395; // step 0 tm 5 A&C std::vector>> q(6, std::vector>(7, std::vector(4, 0.0))); // 5 iterations with 5 steps, each with 4 values // for energy calibration -std::vector EZN(8); // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) +std::vector eZN(8); // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) std::vector meanEZN(10); // mean energies from calibration histos (common A, t1-4 A,common C, t1-4C) std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4)) // Define variables needed to do the recentring steps. double centrality = 0; int runnumber = 0; -int lastRunnumber = 0; std::vector v(3, 0); // vx, vy, vz bool isSelected = false; @@ -117,16 +109,16 @@ bool isSelected = false; using namespace o2::analysis::qvectortask; -struct ZDCqvectors { +struct ZdcQVectors { - Produces SPtableZDC; + Produces spTableZDC; ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality axis in 1% bins"}; ConfigurableAxis axisCent10{"axisCent10", {9, 0, 90}, "Centrality axis in 10% bins"}; ConfigurableAxis axisQ{"axisQ", {100, -2, 2}, "Q vector (xy) in ZDC"}; - ConfigurableAxis axisVx_big{"axisVx_big", {3, -0.01, 0.01}, "for Pos X of collision"}; - ConfigurableAxis axisVy_big{"axisVy_big", {3, -0.01, 0.01}, "for Pos Y of collision"}; - ConfigurableAxis axisVz_big{"axisVz_big", {3, -10, 10}, "for Pos Z of collision"}; + ConfigurableAxis axisVxBig{"axisVxBig", {3, -0.01, 0.01}, "for Pos X of collision"}; + ConfigurableAxis axisVyBig{"axisVyBig", {3, -0.01, 0.01}, "for Pos Y of collision"}; + ConfigurableAxis axisVzBig{"axisVzBig", {3, -10, 10}, "for Pos Z of collision"}; ConfigurableAxis axisVx{"axisVx", {10, -0.01, 0.01}, "for Pos X of collision"}; ConfigurableAxis axisVy{"axisVy", {10, -0.01, 0.01}, "for Pos Y of collision"}; ConfigurableAxis axisVz{"axisVz", {10, -10, 1}, "for vz of collision"}; @@ -139,14 +131,14 @@ struct ZDCqvectors { O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5, "Chi2 per TPC clusters") O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") - O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "", "ccdb path for energy calibration histos") - O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "", "ccdb path for mean v histos") + O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/Energy", "ccdb path for energy calibration histos") + O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/vmean", "ccdb path for mean v histos") - Configurable> cfgRec1{"cfgRec1", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 1"}; - Configurable> cfgRec2{"cfgRec2", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 2"}; - Configurable> cfgRec3{"cfgRec3", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 3"}; - Configurable> cfgRec4{"cfgRec4", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 4"}; - Configurable> cfgRec5{"cfgRec5", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 5"}; + Configurable> cfgRec1{"cfgRec1", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step5"}, "ccdb paths for recentering calibration histos iteration 1"}; + Configurable> cfgRec2{"cfgRec2", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step5"}, "ccdb paths for recentering calibration histos iteration 2"}; + Configurable> cfgRec3{"cfgRec3", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step5"}, "ccdb paths for recentering calibration histos iteration 3"}; + Configurable> cfgRec4{"cfgRec4", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step5"}, "ccdb paths for recentering calibration histos iteration 4"}; + Configurable> cfgRec5{"cfgRec5", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step5"}, "ccdb paths for recentering calibration histos iteration 5"}; // Define output HistogramRegistry registry{"Registry"}; @@ -171,35 +163,34 @@ struct ZDCqvectors { ccdb->setCreatedNotAfter(now); std::vector sides = {"A", "C"}; - std::vector coords = {"x", "y", "z"}; - std::vector COORDS = {"X", "Y"}; + std::vector capCOORDS = {"X", "Y"}; // Tower mean energies vs. centrality used for tower gain equalisation for (int tower = 0; tower < 10; tower++) { - names_Ecal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < 5) ? 0 : 1], tower % 5); - ZN_Energy[tower] = registry.add(Form("Energy/%s", names_Ecal[tower].Data()), Form("%s", names_Ecal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); + namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < 5) ? 0 : 1], tower % 5); + energyZN[tower] = registry.add(Form("Energy/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); } // Qx_vs_Qy for each step for ZNA and ZNC for (int step = 0; step < 6; step++) { registry.add(Form("step%i/QA/hSPplaneA", step), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10}); registry.add(Form("step%i/QA/hSPplaneC", step), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10}); - for (const char* side : sides) { - hQx_vs_Qy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); + for (const auto& side : sides) { + hQxvsQy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); } int i = 0; - for (const char* COORD1 : COORDS) { - for (const char* COORD2 : COORDS) { + for (const auto& COORD1 : capCOORDS) { + for (const auto& COORD2 : capCOORDS) { // Now we get: & vs. Centrality - COORD_correlations[step][i] = registry.add(Form("step%i/QA/hQ%sA_Q%sC_vs_cent", step, COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent10}); + hCOORDcorrelations[step][i] = registry.add(Form("step%i/QA/hQ%sA_Q%sC_vs_cent", step, COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent10}); i++; } } // Add histograms for each step in the calibration process. - // Sides is {A,C} and coords is {X,Y} - for (const char* side : sides) { - for (const char* coord : COORDS) { + // Sides is {A,C} and capcoords is {X,Y} + for (const auto& side : sides) { + for (const auto& coord : capCOORDS) { registry.add(Form("step%i/QA/hQ%s%s_vs_cent", step, coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent10}}); registry.add(Form("step%i/QA/hQ%s%s_vs_vx", step, coord, side), Form("hQ%s%s_vs_vx", coord, side), {HistType::kTProfile, {axisVx}}); registry.add(Form("step%i/QA/hQ%s%s_vs_vy", step, coord, side), Form("hQ%s%s_vs_vy", coord, side), {HistType::kTProfile, {axisVy}}); @@ -207,7 +198,7 @@ struct ZDCqvectors { if (step == 1 || step == 5) { TString name = TString::Format("hQ%s%s_mean_Cent_V_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisCent10, axisVx_big, axisVy_big, axisVz_big, axisQ}}); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisCent10, axisVxBig, axisVyBig, axisVzBig, axisQ}}); if (step == 1) names[step - 1].push_back(name); } @@ -231,7 +222,7 @@ struct ZDCqvectors { registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vz_run", coord, side), kTProfile, {axisVz}); names[step - 1].push_back(name); } - } // end of COORDS + } // end of capCOORDS } // end of sides } // end of sum over steps @@ -333,45 +324,44 @@ struct ZDCqvectors { registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]); registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]); - static constexpr std::string_view subdir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"}; - static_for<0, 4>([&](auto ind) { - constexpr int index = ind.value; - int index_rt = index + 1; + static constexpr std::string_view SubDir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"}; + static_for<0, 4>([&](auto Ind) { + constexpr int Index = Ind.value; + int indexRt = Index + 1; - registry.fill(HIST(subdir[index]) + HIST("hZNA_Qx_vs_Qy"), q[iteration][index_rt][0], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("hZNC_Qx_vs_Qy"), q[iteration][index_rt][2], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("hZNA_Qx_vs_Qy"), q[iteration][indexRt][0], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("hZNC_Qx_vs_Qy"), q[iteration][indexRt][2], q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_QXC_vs_cent"), centrality, q[iteration][index_rt][0] * q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_QYC_vs_cent"), centrality, q[iteration][index_rt][1] * q[iteration][index_rt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_QXC_vs_cent"), centrality, q[iteration][index_rt][1] * q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_QYC_vs_cent"), centrality, q[iteration][index_rt][0] * q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_QXC_vs_cent"), centrality, q[iteration][indexRt][0] * q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_QYC_vs_cent"), centrality, q[iteration][indexRt][1] * q[iteration][indexRt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_QXC_vs_cent"), centrality, q[iteration][indexRt][1] * q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_QYC_vs_cent"), centrality, q[iteration][indexRt][0] * q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_cent"), centrality, q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_cent"), centrality, q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_cent"), centrality, q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_cent"), centrality, q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_cent"), centrality, q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_cent"), centrality, q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_cent"), centrality, q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_cent"), centrality, q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vx"), v[0], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vx"), v[0], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vx"), v[0], q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vx"), v[0], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_vx"), v[0], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_vx"), v[0], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vx"), v[0], q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vx"), v[0], q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vy"), v[1], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vy"), v[1], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vy"), v[1], q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vy"), v[1], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_vy"), v[1], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_vy"), v[1], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vy"), v[1], q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vy"), v[1], q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vz"), v[2], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vz"), v[2], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_vz"), v[2], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_vz"), v[2], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][indexRt][3]); // add psi!! - double Psi_A = 1.0 * TMath::ATan2(q[iteration][index_rt][2], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hSPplaneA"), Psi_A, centrality, 1); - double Psi_C = 1.0 * TMath::ATan2(q[iteration][index_rt][3], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hSPplaneC"), Psi_C, centrality, 1); - + double psiA = 1.0 * std::atan2(q[iteration][indexRt][2], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneA"), psiA, centrality, 1); + double psiC = 1.0 * std::atan2(q[iteration][indexRt][3], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneC"), psiC, centrality, 1); }); } @@ -456,10 +446,9 @@ struct ZDCqvectors { // needed for energy calibration! TProfile2D* h = reinterpret_cast(hist); TString name = h->GetName(); - int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); + int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", runnumber)); int bin = h->GetYaxis()->FindBin(centrality); calibConstant = h->GetBinContent(binrunnumber, bin); - } else if (hist->InheritsFrom("TProfile")) { TProfile* h = reinterpret_cast(hist); TString name = h->GetName(); @@ -504,7 +493,7 @@ struct ZDCqvectors { fillCommonRegistry(iteration); } - void process(myCollisions::iterator const& collision, + void process(UsedCollisions::iterator const& collision, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/) { @@ -517,8 +506,7 @@ struct ZDCqvectors { auto cent = collision.centFT0C(); if (cent < 0 || cent > 90) { - SPtableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); return; } @@ -527,215 +515,208 @@ struct ZDCqvectors { const auto& foundBC = collision.foundBC_as(); if (!foundBC.has_zdc()) { - SPtableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); return; } - v[0] = collision.posX(); - v[1] = collision.posY(); - v[2] = collision.posZ(); - centrality = cent; - runnumber = foundBC.runNumber(); + v[0] = collision.posX(); + v[1] = collision.posY(); + v[2] = collision.posZ(); + centrality = cent; + runnumber = foundBC.runNumber(); - const auto& zdcCol = foundBC.zdc(); + const auto& zdcCol = foundBC.zdc(); - // Get the raw energies EZN[8] (not the common A,C) - for (int tower = 0; tower < 8; tower++) { - EZN[tower] = (tower < 4) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % 4]; - } + // Get the raw energies eZN[8] (not the common A,C) + for (int tower = 0; tower < 8; tower++) { + eZN[tower] = (tower < 4) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % 4]; + } - // load the calibration histos for iteration 0 step 0 (Energy Calibration) - if (runnumber != lastRunnumber) - loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal, names_Ecal); - if (!cal.calibfilesLoaded[0][0]) { - if (counter < 1) { - LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); - } - } - // load the calibrations for the mean v - if (runnumber != lastRunnumber) - loadCalibrations(0, 1, foundBC.timestamp(), cfgMeanv, vnames); - if (!cal.calibfilesLoaded[0][1]) { - if (counter < 1) - LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); - registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); - registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + // load the calibration histos for iteration 0 step 0 (Energy Calibration) + loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal.value, namesEcal); + + if (!cal.calibfilesLoaded[0][0]) { + if (counter < 1) { + LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); } + } + // load the calibrations for the mean v + loadCalibrations(0, 1, foundBC.timestamp(), cfgMeanv.value, vnames); + if (!cal.calibfilesLoaded[0][1]) { if (counter < 1) - LOGF(info, "=====================> .....Start Energy Calibration..... <====================="); + LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); + registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); + registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + } - bool isZNAhit = true; - bool isZNChit = true; + if (counter < 1) + LOGF(info, "=====================> .....Start Energy Calibration..... <====================="); - for (int i = 0; i < 8; ++i) { - if (i < 4 && EZN[i] <= 0) - isZNAhit = false; - if (i > 3 && EZN[i] <= 0) - isZNChit = false; - } + bool isZNAhit = true; + bool isZNChit = true; - if (zdcCol.energyCommonZNA() <= 0) + for (int i = 0; i < 8; ++i) { + if (i < 4 && eZN[i] <= 0) isZNAhit = false; - if (zdcCol.energyCommonZNC() <= 0) + if (i > 3 && eZN[i] <= 0) isZNChit = false; + } - // Fill to get mean energy per tower in 1% centrality bins - for (int tower = 0; tower < 5; tower++) { - if (tower == 0) { - if (isZNAhit) - ZN_Energy[tower]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); - if (isZNChit) - ZN_Energy[tower + 5]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); - LOGF(debug, "Common A tower filled with: %i, %.2f, %.2f", runnumber, cent, zdcCol.energyCommonZNA()); - } else { - if (isZNAhit) - ZN_Energy[tower]->Fill(Form("%d", runnumber), cent, EZN[tower - 1], 1); - if (isZNChit) - ZN_Energy[tower + 5]->Fill(Form("%d", runnumber), cent, EZN[tower - 1 + 4], 1); - LOGF(debug, "Tower ZNC[%i] filled with: %i, %.2f, %.2f", tower, runnumber, cent, EZN[tower - 1 + 4]); - } + if (zdcCol.energyCommonZNA() <= 0) + isZNAhit = false; + if (zdcCol.energyCommonZNC() <= 0) + isZNChit = false; + + // Fill to get mean energy per tower in 1% centrality bins + for (int tower = 0; tower < 5; tower++) { + if (tower == 0) { + if (isZNAhit) + energyZN[tower]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); + if (isZNChit) + energyZN[tower + 5]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); + LOGF(debug, "Common A tower filled with: %i, %.2f, %.2f", runnumber, cent, zdcCol.energyCommonZNA()); + } else { + if (isZNAhit) + energyZN[tower]->Fill(Form("%d", runnumber), cent, eZN[tower - 1], 1); + if (isZNChit) + energyZN[tower + 5]->Fill(Form("%d", runnumber), cent, eZN[tower - 1 + 4], 1); + LOGF(debug, "Tower ZNC[%i] filled with: %i, %.2f, %.2f", tower, runnumber, cent, eZN[tower - 1 + 4]); } + } - // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation - if (!isZNAhit || !isZNChit) { - counter++; - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; - return; - } + // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation + if (!isZNAhit || !isZNChit) { + counter++; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + return; + } - if (!cal.calibfilesLoaded[0][0]) { - counter++; - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; - return; - } + if (!cal.calibfilesLoaded[0][0]) { + counter++; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + return; + } - if (counter < 1) - LOGF(info, "files for step 0 (energy Calibraton) are open!"); + if (counter < 1) + LOGF(info, "files for step 0 (energy Calibraton) are open!"); - if (counter < 1) { - LOGF(info, "=====================> .....Start Calculating Q-Vectors..... <====================="); - } + if (counter < 1) { + LOGF(info, "=====================> .....Start Calculating Q-Vectors..... <====================="); + } - // Now start gain equalisation! - // Fill the list with calibration constants. - for (int tower = 0; tower < 10; tower++) { - meanEZN[tower] = getCorrection(0, 0, names_Ecal[tower].Data()); - } + // Now start gain equalisation! + // Fill the list with calibration constants. + for (int tower = 0; tower < 10; tower++) { + meanEZN[tower] = getCorrection(0, 0, namesEcal[tower].Data()); + } - // Use the calibration constants but now only loop over towers 1-4 - int calibtower = 0; - std::vector towers_nocom = {1, 2, 3, 4, 6, 7, 8, 9}; + // Use the calibration constants but now only loop over towers 1-4 + int calibtower = 0; + std::vector towersNocom = {1, 2, 3, 4, 6, 7, 8, 9}; - for (int tower : towers_nocom) { - if (meanEZN[tower] > 0) { - double ecommon = (tower > 4) ? meanEZN[5] : meanEZN[0]; - e[calibtower] = EZN[calibtower] * (0.25 * ecommon) / meanEZN[tower]; - } - calibtower++; - } + for (const auto& tower : towersNocom) { + if (meanEZN[tower] > 0) { + double ecommon = (tower > 4) ? meanEZN[5] : meanEZN[0]; + e[calibtower] = eZN[calibtower] * (0.25 * ecommon) / meanEZN[tower]; + } + calibtower++; + } - for (int i = 0; i < 4; i++) { - float bincenter = i + .5; - registry.fill(HIST("QA/ZNA_Energy"), bincenter, EZN[i]); - registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); - registry.fill(HIST("QA/ZNC_Energy"), bincenter, EZN[i + 4]); - registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); - } + for (int i = 0; i < 4; i++) { + float bincenter = i + .5; + registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]); + registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter, eZN[i + 4]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); + } - // Now calculate Q-vector - for (int tower = 0; tower < 8; tower++) { - int side = (tower > 3) ? 1 : 0; - int sector = tower % 4; - double energy = std::pow(e[tower], alphaZDC); - sumZN[side] += energy; - xEnZN[side] += (side == 0) ? ZDC_px[sector] * energy : -1.0 * ZDC_px[sector] * energy; - yEnZN[side] += ZDC_py[sector] * energy; - } + // Now calculate Q-vector + for (int tower = 0; tower < 8; tower++) { + int side = (tower > 3) ? 1 : 0; + int sector = tower % 4; + double energy = std::pow(e[tower], alphaZDC); + sumZN[side] += energy; + xEnZN[side] += (side == 0) ? pxZDC[sector] * energy : -1.0 * pxZDC[sector] * energy; + yEnZN[side] += pyZDC[sector] * energy; + } - // "QXA", "QYA", "QXC", "QYC" - for (int i = 0; i < 2; ++i) { - if (sumZN[i] > 0) { - q[0][0][i * 2] = xEnZN[i] / sumZN[i]; // for QXA[0] and QXC[2] - q[0][0][i * 2 + 1] = yEnZN[i] / sumZN[i]; // for QYA[1] and QYC[3] - } - } + // "QXA", "QYA", "QXC", "QYC" + for (int i = 0; i < 2; ++i) { + if (sumZN[i] > 0) { + q[0][0][i * 2] = xEnZN[i] / sumZN[i]; // for QXA[0] and QXC[2] + q[0][0][i * 2 + 1] = yEnZN[i] / sumZN[i]; // for QYA[1] and QYC[3] + } + } - if (cal.calibfilesLoaded[0][1]) { - if (counter < 1) - LOGF(info, "=====================> Setting v to vmean!"); - v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); - v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); - } + if (cal.calibfilesLoaded[0][1]) { + if (counter < 1) + LOGF(info, "=====================> Setting v to vmean!"); + v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); + v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); + } - if (runnumber != lastRunnumber) { - for (int iteration = 1; iteration < 6; iteration++) { - std::vector ccdb_dirs; - if (iteration == 1) - ccdb_dirs = cfgRec1.value; - if (iteration == 2) - ccdb_dirs = cfgRec2.value; - if (iteration == 3) - ccdb_dirs = cfgRec3.value; - if (iteration == 4) - ccdb_dirs = cfgRec4.value; - if (iteration == 5) - ccdb_dirs = cfgRec5.value; - - for (int step = 0; step < 5; step++) { - loadCalibrations(iteration, step, foundBC.timestamp(), (ccdb_dirs)[step], names[step]); - } - } - } + for (int iteration = 1; iteration < 6; iteration++) { + std::vector ccdbDirs; + if (iteration == 1) + ccdbDirs = cfgRec1.value; + if (iteration == 2) + ccdbDirs = cfgRec2.value; + if (iteration == 3) + ccdbDirs = cfgRec3.value; + if (iteration == 4) + ccdbDirs = cfgRec4.value; + if (iteration == 5) + ccdbDirs = cfgRec5.value; + + for (int step = 0; step < 5; step++) { + loadCalibrations(iteration, step, foundBC.timestamp(), (ccdbDirs)[step], names[step]); + } + } - if (cal.atIteration == 0) { - if (counter < 1) - LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); - fillAllRegistries(0, 0); - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); - lastRunnumber = runnumber; - counter++; - return; - } else { - for (int iteration = 1; iteration <= cal.atIteration; iteration++) { - for (int step = 0; step < cal.atStep + 1; step++) { - if (cal.calibfilesLoaded[iteration][step]) { - for (int i = 0; i < 4; i++) { - if (step == 0) { - if (iteration == 1) { - q[iteration][step + 1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); - } else { - q[iteration][step + 1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); - } - } else { - q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); - } + if (cal.atIteration == 0) { + if (counter < 1) + LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); + fillAllRegistries(0, 0); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); + counter++; + return; + } else { + for (int iteration = 1; iteration <= cal.atIteration; iteration++) { + for (int step = 0; step < cal.atStep + 1; step++) { + if (cal.calibfilesLoaded[iteration][step]) { + for (int i = 0; i < 4; i++) { + if (step == 0) { + if (iteration == 1) { + q[iteration][step + 1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); + } else { + q[iteration][step + 1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); } } else { - if (counter < 1) - LOGF(warning, "Something went wrong in calibration loop! File not loaded but bool set to tue"); - } // end of (cal.calibLoaded) - } // end of step - } // end of iteration - - if (counter < 1) - LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); - fillAllRegistries(cal.atIteration, cal.atStep + 1); - registry.fill(HIST("QA/centrality_after"), centrality); - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); - lastRunnumber = runnumber; - counter++; - return; - } - LOGF(warning, "We return without saving table... -> THis is a problem"); + q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); + } + } + } else { + if (counter < 1) + LOGF(warning, "Something went wrong in calibration loop! File not loaded but bool set to tue"); + } // end of (cal.calibLoaded) + } // end of step + } // end of iteration + + if (counter < 1) + LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); + fillAllRegistries(cal.atIteration, cal.atStep + 1); + registry.fill(HIST("QA/centrality_after"), centrality); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); + counter++; + return; + } + LOGF(warning, "We return without saving table... -> THis is a problem"); } // end of process }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 62c237bb0f0..975698931bf 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -9,7 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// author: Noor Koster noor.koster@cern.ch +/// \file flowSP.cxx +/// \author Noor Koster +/// \since 01/12/2024 +/// \brief task to evaluate flow with respect to spectator plane. #include #include @@ -30,6 +33,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Qvectors.h" +#include "Common/Core/RecoDecay.h" #include "PWGCF/DataModel/SPTableZDC.h" #include "TF1.h" @@ -41,7 +45,7 @@ using namespace o2::framework::expressions; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; -struct flowAnalysisSP { +struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgDCAxy, float, 0.2, "Cut on DCA in the transverse direction (cm)"); O2_DEFINE_CONFIGURABLE(cfgDCAz, float, 2, "Cut on DCA in the longitudinal direction (cm)"); @@ -53,6 +57,8 @@ struct flowAnalysisSP { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, true, "Bool to enable Additional Track Cut"); + O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 60, "Maximum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 10, "Minimum cenrality for selected events"); O2_DEFINE_CONFIGURABLE(cfgDoubleTrackFunction, bool, true, "Include track cut at low pt"); O2_DEFINE_CONFIGURABLE(cfgTrackCutSize, float, 0.06, "Spread of track cut"); @@ -67,8 +73,8 @@ struct flowAnalysisSP { Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; - using myCollisions = soa::Filtered>; - using myTracks = soa::Filtered>; + using UsedCollisions = soa::Filtered>; + using UsedTracks = soa::Filtered>; // Connect to ccdb Service ccdb; @@ -118,6 +124,22 @@ struct flowAnalysisSP { registry.add("v1C_eta", "", kTProfile, {{10, -.8, .8}}); registry.add("v1AC_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v1_eta_odd_dev", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_dev", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v1_eta_odd_dev_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_dev_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_pos", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v1_eta_odd_dev_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_dev_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v2_cent", "", kTProfile, {{80, 0, 80}}); registry.add("v2A_cent", "", kTProfile, {{80, 0, 80}}); registry.add("v2C_cent", "", kTProfile, {{80, 0, 80}}); @@ -133,7 +155,8 @@ struct flowAnalysisSP { registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(9, "after Mult cuts"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(10, "isSelected"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(10, "after Cent cuts"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(11, "isSelected"); if (cfgUseAdditionalEventCut) { fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.5*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", 0, 100); @@ -217,7 +240,7 @@ struct flowAnalysisSP { float vtxz = -999; if (collision.numContrib() > 1) { vtxz = collision.posZ(); - float zRes = TMath::Sqrt(collision.covZZ()); + float zRes = std::sqrt(collision.covZZ()); if (zRes > 0.25 && collision.numContrib() < 20) vtxz = -999; } @@ -239,6 +262,11 @@ struct flowAnalysisSP { registry.fill(HIST("hEventCount"), 8.5); + if (centrality > cfgCentMax || centrality < cfgCentMin) + return 0; + + registry.fill(HIST("hEventCount"), 9.5); + return 1; } @@ -247,14 +275,14 @@ struct flowAnalysisSP { { double phimodn = track.phi(); if (field < 0) // for negative polarity field - phimodn = TMath::TwoPi() - phimodn; + phimodn = o2::constants::math::TwoPI - phimodn; if (track.sign() < 0) // for negative charge - phimodn = TMath::TwoPi() - phimodn; + phimodn = o2::constants::math::TwoPI - phimodn; if (phimodn < 0) LOGF(warning, "phi < 0: %g", phimodn); - phimodn += TMath::Pi() / 18.0; // to center gap in the middle - phimodn = fmod(phimodn, TMath::Pi() / 9.0); + phimodn += o2::constants::math::PI / 18.0; // to center gap in the middle + phimodn = fmod(phimodn, o2::constants::math::PI / 9.0); registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) return false; // reject track @@ -262,7 +290,7 @@ struct flowAnalysisSP { return true; } - void process(myCollisions::iterator const& collision, aod::BCsWithTimestamps const&, myTracks const& tracks) + void process(UsedCollisions::iterator const& collision, aod::BCsWithTimestamps const&, UsedTracks const& tracks) { // Hier sum over collisions and get ZDC data. registry.fill(HIST("hEventCount"), .5); @@ -280,7 +308,7 @@ struct flowAnalysisSP { return; if (collision.isSelected()) { - registry.fill(HIST("hEventCount"), 9.5); + registry.fill(HIST("hEventCount"), 10.5); registry.fill(HIST("hCent"), centrality); @@ -289,38 +317,90 @@ struct flowAnalysisSP { double qxC = collision.qxC(); double qyC = collision.qyC(); - double Psi_A = 1.0 * TMath::ATan2(qyA, qxA); - registry.fill(HIST("hSPplaneA"), Psi_A, 1); + double psiA = 1.0 * std::atan2(qyA, qxA); + registry.fill(HIST("hSPplaneA"), psiA, 1); + + double psiC = 1.0 * std::atan2(qyC, qxC); + registry.fill(HIST("hSPplaneC"), psiC, 1); + + registry.fill(HIST("hSPplaneA-C"), psiA - psiC, 1); - double Psi_C = 1.0 * TMath::ATan2(qyC, qxC); - registry.fill(HIST("hSPplaneC"), Psi_C, 1); + registry.fill(HIST("hCosdPhi"), centrality, std::cos(psiA - psiC)); + if (std::cos(psiA - psiC) < 0) + registry.fill(HIST("hSPlaneRes"), centrality, std::sqrt(-1. * std::cos(psiA - psiC))); - registry.fill(HIST("hSPplaneA-C"), Psi_A - Psi_C, 1); + registry.fill(HIST("hSindPhi"), centrality, std::sin(psiA - psiC)); - registry.fill(HIST("hCosdPhi"), centrality, TMath::Cos(Psi_A - Psi_C)); - if (TMath::Cos(Psi_A - Psi_C) < 0) - registry.fill(HIST("hSPlaneRes"), centrality, TMath::Sqrt(-1. * TMath::Cos(Psi_A - Psi_C))); - registry.fill(HIST("hSindPhi"), centrality, TMath::Sin(Psi_A - Psi_C)); + auto qxAqxC = qxA * qxC; + auto qyAqyC = qyA * qyC; - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!trackSelected(track, field)) continue; - double v1A = TMath::Cos(track.phi() - Psi_A); - double v1C = TMath::Cos(track.phi() - Psi_C); + bool pos; + if (track.sign() == 0.0) + continue; + if (track.sign() > 0) { + pos = true; + } else { + pos = false; + } + + // constrain angle to 0 -> [0,0+2pi] + auto phi = RecoDecay::constrainAngle(track.phi(), 0); - double v1AC = TMath::Cos(track.phi() - (Psi_A - Psi_C)); + auto ux = std::cos(phi); + auto uy = std::sin(phi); - registry.fill(HIST("v1_eta"), track.eta(), (1. / TMath::Sqrt(2)) * (v1A - v1C)); + auto uxQxA = ux * qxA; + auto uyQyA = uy * qyA; + auto uxyQxyA = uxQxA + uyQyA; + auto uxQxC = ux * qxC; + auto uyQyC = uy * qyC; + auto uxyQxyC = uxQxC + uyQyC; + + auto oddv1 = ux * (qxA - qxC) + uy * (qyA - qyC); + auto evenv1 = ux * (qxA + qxC) + uy * (qyA + qyC); + + auto oddv1Dev = ux * (qxA - qxC) / std::sqrt(std::abs(qxAqxC)) + uy * (qyA - qyC) / std::sqrt(std::abs(qyAqyC)); + auto evenv1Dev = ux * (qxA + qxC) / std::sqrt(std::abs(qxAqxC)) + uy * (qyA + qyC) / std::sqrt(std::abs(qyAqyC)); + + double v1A = std::cos(phi - psiA); + double v1C = std::cos(phi - psiC); + + double v1AC = std::cos(phi - (psiA - psiC)); + + registry.fill(HIST("v1_eta"), track.eta(), (1. / std::sqrt(2)) * (v1A - v1C)); registry.fill(HIST("v1A_eta"), track.eta(), (v1A)); registry.fill(HIST("v1C_eta"), track.eta(), (v1C)); registry.fill(HIST("v1AC_eta"), track.eta(), (v1AC)); - double v2A = TMath::Cos(2 * (track.phi() - Psi_A)); - double v2C = TMath::Cos(2 * (track.phi() - Psi_C)); - double v2AC = TMath::Cos(2 * (track.phi() - (Psi_A - Psi_C))); + registry.fill(HIST("v1_eta_odd"), track.eta(), oddv1); + registry.fill(HIST("v1_eta_even"), track.eta(), evenv1); + + registry.fill(HIST("v1_eta_odd_dev"), track.eta(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev"), track.eta(), evenv1Dev); + + if (pos) { + registry.fill(HIST("v1_eta_odd_pos"), track.eta(), oddv1); + registry.fill(HIST("v1_eta_even_pos"), track.eta(), evenv1); + + registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), evenv1Dev); + } else { + registry.fill(HIST("v1_eta_odd_neg"), track.eta(), oddv1); + registry.fill(HIST("v1_eta_even_neg"), track.eta(), evenv1); + + registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), evenv1Dev); + } + + double v2A = std::cos(2 * (phi - psiA)); + double v2C = std::cos(2 * (phi - psiC)); + double v2AC = std::cos(2 * (phi - (psiA - psiC))); - registry.fill(HIST("v2_cent"), centrality, (1. / TMath::Sqrt(2)) * (v2A - v2C)); + registry.fill(HIST("v2_cent"), centrality, (1. / std::sqrt(2)) * (v2A - v2C)); registry.fill(HIST("v2A_cent"), centrality, (v2A)); registry.fill(HIST("v2C_cent"), centrality, (v2C)); registry.fill(HIST("v2AC_cent"), centrality, (v2AC)); @@ -338,6 +418,6 @@ struct flowAnalysisSP { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; } From e4ab16cd7d43731f74488075938d361eb4beb7dd Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:24:28 +0100 Subject: [PATCH 35/91] [PWGEM,PWGEM-36] EMCal rotation background add SM edges (#8800) Co-authored-by: ALICE Action Bot --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 103 +++++-- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 294 +++++++++++++------- 2 files changed, 272 insertions(+), 125 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index e5437da59cf..8856fdaf6dd 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -11,8 +11,10 @@ // // ======================== // -// This code loops over photons and makes pairs for neutral mesons analyses. -// Please write to: daiki.sekihata@cern.ch +/// \file Pi0EtaToGammaGamma.h +/// \brief This code loops over photons and makes pairs for neutral mesons analyses. +/// +/// \author D. Sekihata, daiki.sekihata@cern.ch #ifndef PWGEM_PHOTONMESON_CORE_PI0ETATOGAMMAGAMMA_H_ #define PWGEM_PHOTONMESON_CORE_PI0ETATOGAMMAGAMMA_H_ @@ -189,6 +191,7 @@ struct Pi0EtaToGammaGamma { Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; } emccuts; PHOSPhotonCut fPHOSCut; @@ -268,7 +271,7 @@ struct Pi0EtaToGammaGamma { if (d_bz_input > -990) { d_bz = d_bz_input; o2::parameters::GRPMagField grpmag; - if (fabs(d_bz) > 1e-5) { + if (std::fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); } mRunNumber = collision.runNumber(); @@ -424,8 +427,8 @@ struct Pi0EtaToGammaGamma { fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); + fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); @@ -436,6 +439,42 @@ struct Pi0EtaToGammaGamma { fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); } + /// \brief returns if cluster is too close to edge of EMCal (using rotation background method only for EMCal!) + bool IsTooCloseToEdge(const int cellID, const int DistanceToBorder = 1) + { + if (DistanceToBorder <= 0) { + return false; + } + if (cellID < 0) { + return true; + } + + int iBadCell = -1; + + // check distance to border in case the cell is okay + auto [iSupMod, iMod, iPhi, iEta] = emcalGeom->GetCellIndex(cellID); + auto [irow, icol] = emcalGeom->GetCellPhiEtaIndexInSModule(iSupMod, iMod, iPhi, iEta); + + // Check rows/phi + int iRowLast = 24; + if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_HALF) { + iRowLast /= 2; // 2/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_THIRD) { + iRowLast /= 3; // 1/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::DCAL_EXT) { + iRowLast /= 3; // 1/3 sm case + } + + if (irow < DistanceToBorder || (iRowLast - irow) <= DistanceToBorder) { + iBadCell = 1; + } + + if (iBadCell > 0) { + return true; + } + return false; + } + /// \brief Calculate background (using rotation background method only for EMCal!) template void RotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, float eventWeight) @@ -455,11 +494,17 @@ struct Pi0EtaToGammaGamma { try { iCellID_photon1 = emcalGeom->GetAbsCellIdFromEtaPhi(photon1.Eta(), photon1.Phi()); + if (IsTooCloseToEdge(iCellID_photon1, emccuts.cfgDistanceToEdge.value)) { + iCellID_photon1 = -1; + } } catch (o2::emcal::InvalidPositionException& e) { iCellID_photon1 = -1; } try { iCellID_photon2 = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + if (IsTooCloseToEdge(iCellID_photon2, emccuts.cfgDistanceToEdge.value)) { + iCellID_photon2 = -1; + } } catch (o2::emcal::InvalidPositionException& e) { iCellID_photon2 = -1; } @@ -467,7 +512,7 @@ struct Pi0EtaToGammaGamma { return; } - for (auto& photon : photons_coll) { + for (const auto& photon : photons_coll) { if (photon.globalIndex() == ig1 || photon.globalIndex() == ig2) { // only combine rotated photons with other photons continue; @@ -483,10 +528,10 @@ struct Pi0EtaToGammaGamma { float openingAngle1 = std::acos(photon1.Vect().Dot(photon3.Vect()) / (photon1.P() * photon3.P())); float openingAngle2 = std::acos(photon2.Vect().Dot(photon3.Vect()) / (photon2.P() * photon3.P())); - if (openingAngle1 > emccuts.minOpenAngle && abs(mother1.Rapidity()) < maxY && iCellID_photon1 > 0) { + if (openingAngle1 > emccuts.minOpenAngle && std::abs(mother1.Rapidity()) < maxY && iCellID_photon1 > 0) { fRegistry.fill(HIST("Pair/rotation/hs"), mother1.M(), mother1.Pt(), eventWeight); } - if (openingAngle2 > emccuts.minOpenAngle && abs(mother2.Rapidity()) < maxY && iCellID_photon2 > 0) { + if (openingAngle2 > emccuts.minOpenAngle && std::abs(mother2.Rapidity()) < maxY && iCellID_photon2 > 0) { fRegistry.fill(HIST("Pair/rotation/hs"), mother2.M(), mother2.Pt(), eventWeight); } } @@ -515,14 +560,14 @@ struct Pi0EtaToGammaGamma { TPreslice1 const& perCollision1, TPreslice2 const& perCollision2, TCut1 const& cut1, TCut2 const& cut2) { - for (auto& collision : collisions) { + for (const auto& collision : collisions) { initCCDB(collision); int ndiphoton = 0; if ((pairtype == PairType::kPHOSPHOS || pairtype == PairType::kPCMPHOS) && !collision.alias_bit(triggerAliases::kTVXinPHOS)) { continue; } - if (eventcuts.onlyKeepWeightedEvents && fabs(collision.weight() - 1.) < 1E-10) { + if (eventcuts.onlyKeepWeightedEvents && std::fabs(collision.weight() - 1.) < 1E-10) { continue; } @@ -578,7 +623,7 @@ struct Pi0EtaToGammaGamma { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); - for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -586,7 +631,7 @@ struct Pi0EtaToGammaGamma { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } @@ -614,7 +659,7 @@ struct Pi0EtaToGammaGamma { auto positrons_per_collision = positrons->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); auto electrons_per_collision = electrons->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); - for (auto& g1 : photons1_per_collision) { + for (const auto& g1 : photons1_per_collision) { if (!cut1.template IsSelected(g1)) { continue; } @@ -622,7 +667,7 @@ struct Pi0EtaToGammaGamma { auto ele1 = g1.template negTrack_as(); ROOT::Math::PtEtaPhiMVector v_gamma(g1.pt(), g1.eta(), g1.phi(), 0.); - for (auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { + for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; @@ -643,7 +688,7 @@ struct Pi0EtaToGammaGamma { ROOT::Math::PtEtaPhiMVector v_ele(ele2.pt(), ele2.eta(), ele2.phi(), o2::constants::physics::MassElectron); ROOT::Math::PtEtaPhiMVector v_ee = v_pos + v_ele; ROOT::Math::PtEtaPhiMVector veeg = v_gamma + v_pos + v_ele; - if (abs(veeg.Rapidity()) > maxY) { + if (std::abs(veeg.Rapidity()) > maxY) { continue; } @@ -666,14 +711,14 @@ struct Pi0EtaToGammaGamma { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); - for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } @@ -707,7 +752,7 @@ struct Pi0EtaToGammaGamma { auto collisionIds2_in_mixing_pool = emh2->GetCollisionIdsFromEventPool(key_bin); if constexpr (pairtype == PairType::kPCMPCM || pairtype == PairType::kPHOSPHOS || pairtype == PairType::kEMCEMC) { // same kinds pairing - for (auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { + for (const auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; int64_t mix_collisionId = mix_dfId_collisionId.second; @@ -718,12 +763,12 @@ struct Pi0EtaToGammaGamma { auto photons1_from_event_pool = emh1->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d), ngamma = %d | event pool (%d, %d), ngamma = %d", ndf, collision.globalIndex(), selected_photons1_in_this_event.size(), mix_dfId, mix_collisionId, photons1_from_event_pool.size()); - for (auto& g1 : selected_photons1_in_this_event) { - for (auto& g2 : photons1_from_event_pool) { + for (const auto& g1 : selected_photons1_in_this_event) { + for (const auto& g2 : photons1_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } @@ -733,7 +778,7 @@ struct Pi0EtaToGammaGamma { } // end of loop over mixed event pool } else { // [photon1 from event1, photon2 from event2] and [photon1 from event2, photon2 from event1] - for (auto& mix_dfId_collisionId : collisionIds2_in_mixing_pool) { + for (const auto& mix_dfId_collisionId : collisionIds2_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; int64_t mix_collisionId = mix_dfId_collisionId.second; @@ -744,22 +789,22 @@ struct Pi0EtaToGammaGamma { auto photons2_from_event_pool = emh2->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d), ngamma = %d | event pool (%d, %d), nll = %d", ndf, collision.globalIndex(), selected_photons1_in_this_event.size(), mix_dfId, mix_collisionId, photons2_from_event_pool.size()); - for (auto& g1 : selected_photons1_in_this_event) { - for (auto& g2 : photons2_from_event_pool) { + for (const auto& g1 : selected_photons1_in_this_event) { + for (const auto& g2 : photons2_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1] v2.SetM(g2.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), collision.weight()); } } } // end of loop over mixed event pool - for (auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { + for (const auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; int64_t mix_collisionId = mix_dfId_collisionId.second; @@ -770,15 +815,15 @@ struct Pi0EtaToGammaGamma { auto photons1_from_event_pool = emh1->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d), nll = %d | event pool (%d, %d), ngamma = %d", ndf, collision.globalIndex(), selected_photons2_in_this_event.size(), mix_dfId, mix_collisionId, photons1_from_event_pool.size()); - for (auto& g1 : selected_photons2_in_this_event) { - for (auto& g2 : photons1_from_event_pool) { + for (const auto& g1 : selected_photons2_in_this_event) { + for (const auto& g2 : photons1_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1] v1.SetM(g1.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), collision.weight()); diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index 83d5af15a8e..e99f1dba904 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -39,6 +39,7 @@ #include "Common/Core/EventPlaneHelper.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Qvectors.h" +#include "CommonConstants/MathConstants.h" #include "DetectorsBase/GeometryManager.h" #include "DataFormatsEMCAL/Constants.h" @@ -77,7 +78,7 @@ enum CentralityEstimator { None = 0, NCentralityEstimators }; -struct EMfTaskPi0Flow { +struct TaskPi0FlowEMC { // configurable for flow Configurable harmonic{"harmonic", 2, "harmonic number"}; Configurable qvecDetector{"qvecDetector", 0, "Detector for Q vector estimation (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5)"}; @@ -90,6 +91,7 @@ struct EMfTaskPi0Flow { Configurable cfgDoRotation{"cfgDoRotation", true, "Flag to enable rotation background method"}; Configurable cfgDownsampling{"cfgDownsampling", 1, "Calculate rotation background only for every collision"}; Configurable cfgRotAngle{"cfgRotAngle", M_PI / 2., "Angle used for the rotation method"}; + Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; // configurable axis ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {200, 0.0, 0.4}, ""}; @@ -101,7 +103,7 @@ struct EMfTaskPi0Flow { EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { - std::string prefix = "eventcut_group"; + std::string prefix = "eventcuts"; Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; @@ -119,64 +121,72 @@ struct EMfTaskPi0Flow { Configurable cfgMinCent{"cfgMinCent", 0, "min. centrality (%)"}; Configurable cfgMaxCent{"cfgMaxCent", 90, "max. centrality (%)"}; Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; - Configurable enableQA{"enableQA", false, "flag to turn QA plots on/off"}; + Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } eventcuts; EMCPhotonCut fEMCCut; struct : ConfigurableGroup { - std::string prefix = "emccut_group"; - Configurable EMC_minTime{"EMC_minTime", -25., "Minimum cluster time for EMCal time cut"}; - Configurable EMC_maxTime{"EMC_maxTime", +30., "Maximum cluster time for EMCal time cut"}; - Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; - Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; - Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; - Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; - Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; - Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; - Configurable EMC_UseTM{"EMC_UseTM", false, "flag to use EMCal track matching cut or not"}; - Configurable enableQA{"enableQA", false, "flag to turn QA plots on/off"}; + std::string prefix = "emccuts"; + Configurable cfgEMCminTime{"cfgEMCminTime", -25., "Minimum cluster time for EMCal time cut"}; + Configurable cfgEMCmaxTime{"cfgEMCmaxTime", +30., "Maximum cluster time for EMCal time cut"}; + Configurable cfgEMCminM02{"cfgEMCminM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + Configurable cfgEMCmaxM02{"cfgEMCmaxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + Configurable cfgEMCminE{"cfgEMCminE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + Configurable cfgEMCminNCell{"cfgEMCminNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + Configurable> cfgEMCTMEta{"cfgEMCTMEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> cfgEMCTMPhi{"cfgEMCTMPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable cfgEMCEoverp{"cfgEMCEoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + Configurable cfgEMCUseExoticCut{"cfgEMCUseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + Configurable cfgEMCUseTM{"cfgEMCUseTM", false, "flag to use EMCal track matching cut or not"}; + Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } emccuts; struct : ConfigurableGroup { - std::string prefix = "meson"; + std::string prefix = "mesonConfig"; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle. Default value one EMCal cell"}; Configurable enableTanThetadPhi{"enableTanThetadPhi", false, "flag to turn cut opening angle in delta theta delta phi on/off"}; Configurable minTanThetadPhi{"minTanThetadPhi", 4., "apply min opening angle in delta theta delta phi to cut on late conversion"}; Configurable maxEnergyAsymmetry{"maxEnergyAsymmetry", 1., "apply max energy asymmetry for meson candidate"}; - Configurable enableQA{"enableQA", false, "flag to turn QA plots on/off"}; + Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; ConfigurableAxis thConfigAxisTanThetaPhi{"thConfigAxisTanThetaPhi", {180, -90.f, 90.f}, ""}; } mesonConfig; struct : ConfigurableGroup { - std::string prefix = "event-mixing"; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {8, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, 0, 100, 500, 1000, 2000}, "Mixing bins - occupancy"}; - Configurable ConfMixingDepth{"ConfMixingDepth", 2, "Mixing depth"}; + std::string prefix = "mixingConfig"; + ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis cfgCentBins{"cfgCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "Mixing bins - centrality"}; + ConfigurableAxis cfgEPBins{"cfgEPBins", {8, o2::constants::math::PIHalf, o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; + ConfigurableAxis cfgOccupancyBins{"cfgOccupancyBins", {VARIABLE_WIDTH, 0, 100, 500, 1000, 2000}, "Mixing bins - occupancy"}; + Configurable cfgMixingDepth{"cfgMixingDepth", 2, "Mixing depth"}; } mixingConfig; + struct : ConfigurableGroup { + std::string prefix = "correctionConfig"; + Configurable cfgSpresoPath{"cfgSpresoPath", "Users/m/mhemmer/EM/Flow/Resolution", "Path to SP resolution file"}; + Configurable cfgApplySPresolution{"cfgApplySPresolution", 0, "Apply resolution correction"}; + } correctionConfig; + SliceCache cache; EventPlaneHelper epHelper; o2::framework::Service ccdb; - Filter clusterFilter = aod::skimmedcluster::time >= emccuts.EMC_minTime && aod::skimmedcluster::time <= emccuts.EMC_maxTime && aod::skimmedcluster::m02 >= emccuts.EMC_minM02 && aod::skimmedcluster::m02 <= emccuts.EMC_maxM02 && skimmedcluster::e >= emccuts.EMC_minE; + Filter clusterFilter = aod::skimmedcluster::time >= emccuts.cfgEMCminTime && aod::skimmedcluster::time <= emccuts.cfgEMCmaxTime && aod::skimmedcluster::m02 >= emccuts.cfgEMCminM02 && aod::skimmedcluster::m02 <= emccuts.cfgEMCmaxM02 && skimmedcluster::e >= emccuts.cfgEMCminE; Filter collisionFilter = aod::evsel::sel8 && nabs(aod::collision::posZ) <= eventcuts.cfgZvtxMax && aod::evsel::trackOccupancyInTimeRange <= eventcuts.cfgTrackOccupancyMax && aod::evsel::trackOccupancyInTimeRange >= eventcuts.cfgTrackOccupancyMin && aod::evsel::ft0cOccupancyInTimeRange <= eventcuts.cfgFT0COccupancyMax && aod::evsel::ft0cOccupancyInTimeRange >= eventcuts.cfgFT0COccupancyMin; using FilteredEMCalPhotons = soa::Filtered>; using EMCalPhotons = soa::Join; using FilteredCollsWithQvecs = soa::Filtered>; using CollsWithQvecs = soa::Join; - Preslice perCollision_emc = aod::emccluster::emeventId; - Preslice perCollision_emc_filtered = aod::emccluster::emeventId; + Preslice perCollisionEMC = aod::emccluster::emeventId; + Preslice perCollisionEMCFiltered = aod::emccluster::emeventId; HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; o2::emcal::Geometry* emcalGeom; + TH1D* h1SPResolution = nullptr; + float epsilon = 1.e-8; - void DefineEMEventCut() + void defineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); fEMEventCut.SetRequireSel8(eventcuts.cfgRequireSel8); @@ -191,26 +201,26 @@ struct EMfTaskPi0Flow { fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); } - void DefineEMCCut() + void defineEMCCut() { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); + const float a = emccuts.cfgEMCTMEta->at(0); + const float b = emccuts.cfgEMCTMEta->at(1); + const float c = emccuts.cfgEMCTMEta->at(2); - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); + const float d = emccuts.cfgEMCTMPhi->at(0); + const float e = emccuts.cfgEMCTMPhi->at(1); + const float f = emccuts.cfgEMCTMPhi->at(2); LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + pow(pT + e, f); }); - fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); - - fEMCCut.SetMinE(emccuts.EMC_minE); - fEMCCut.SetMinNCell(emccuts.EMC_minNCell); - fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); - fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); + fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); + fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetMinEoverP(emccuts.cfgEMCEoverp); + + fEMCCut.SetMinE(emccuts.cfgEMCminE); + fEMCCut.SetMinNCell(emccuts.cfgEMCminNCell); + fEMCCut.SetM02Range(emccuts.cfgEMCminM02, emccuts.cfgEMCmaxM02); + fEMCCut.SetTimeRange(emccuts.cfgEMCminTime, emccuts.cfgEMCmaxTime); + fEMCCut.SetUseExoticCut(emccuts.cfgEMCUseExoticCut); } void init(InitContext&) @@ -219,9 +229,9 @@ struct EMfTaskPi0Flow { LOG(info) << "Harmonic was set to " << harmonic << " but can only be 2 or 3!"; } - DefineEMEventCut(); - DefineEMCCut(); - fEMCCut.SetUseTM(emccuts.EMC_UseTM); // disables TM + defineEMEventCut(); + defineEMCCut(); + fEMCCut.SetUseTM(emccuts.cfgEMCUseTM); // disables TM o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); // Load EMCal geometry @@ -242,7 +252,9 @@ struct EMfTaskPi0Flow { const AxisSpec thAxisEta{160, -0.8, 0.8, "#eta"}; const AxisSpec thAxisPhi{72, 0, 2 * 3.14159, "phi"}; const AxisSpec thAxisNCell{17664, 0.5, +17664.5, "#it{N}_{cell}"}; - const AxisSpec thAxisPsi{360 / harmonic.value, -(1. / static_cast(harmonic.value)) * M_PI, (1. / static_cast(harmonic.value)) * M_PI, Form("#Psi_{%d}", harmonic.value)}; + const AxisSpec thAxisPsi{360 / harmonic.value, -(1. / static_cast(harmonic.value)) * std::numbers::pi_v, (1. / static_cast(harmonic.value)) * std::numbers::pi_v, Form("#Psi_{%d}", harmonic.value)}; + const AxisSpec thAxisCN{8, 0.5, 8.5, "#it{c}_{n}"}; + const AxisSpec thAxisSN{8, 0.5, 8.5, "#it{s}_{n}"}; registry.add("hSparsePi0Flow", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisScalarProd}); registry.add("hSparseBkgFlow", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisScalarProd}); @@ -283,8 +295,20 @@ struct EMfTaskPi0Flow { registry.add("epReso/hEpResoFT0mTPCneg", "hEpResoFT0mTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpResoFT0mTPCtot", "hEpResoFT0mTPCtot; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpResoTPCposTPCneg", "hEpResoTPCposTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); + registry.add("epReso/hEpCosCoefficientsFT0c", "hEpCosCoefficientsFT0c; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFT0c", "hEpSinCoefficientsFT0c; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsFT0a", "hEpCosCoefficientsFT0a; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFT0a", "hEpSinCoefficientsFT0a; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsFT0m", "hEpCosCoefficientsFT0m; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFT0m", "hEpSinCoefficientsFT0m; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsTPCpos", "hEpCosCoefficientsTPCpos; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsTPCpos", "hEpSinCoefficientsTPCpos; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsTPCneg", "hEpCosCoefficientsTPCneg; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsTPCneg", "hEpSinCoefficientsTPCneg; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsTPCTots", "hEpCosCoefficientsTPCTots; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsTPCTots", "hEpSinCoefficientsTPCTots; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); } - if (eventcuts.enableQA) { + if (eventcuts.cfgEnableQA) { auto hCollisionEMCCheck = registry.add("hCollisionEMCCheck", "collision counter;;Counts", kTH1D, {{7, 0.5, 7.5}}, false); hCollisionEMCCheck->GetXaxis()->SetBinLabel(1, "all"); hCollisionEMCCheck->GetXaxis()->SetBinLabel(2, "EMC MB Readout"); @@ -299,12 +323,12 @@ struct EMfTaskPi0Flow { registry.add("LED/hNCell", "hNCell", HistType::kTH1D, {thAxisNCell}); } - if (emccuts.enableQA) { + if (emccuts.cfgEnableQA) { registry.add("hEClusterBefore", "Histo for cluster energy before cuts", HistType::kTH1D, {thAxisClusterEnergy}); registry.add("hEClusterAfter", "Histo for cluster energy after cuts", HistType::kTH1D, {thAxisClusterEnergy}); } - if (mesonConfig.enableQA) { + if (mesonConfig.cfgEnableQA) { registry.add("hInvMassPt", "Histo for inv pair mass vs pt", HistType::kTH2D, {thnAxisInvMass, thnAxisPt}); registry.add("hTanThetaPhi", "Histo for identification of conversion cluster", HistType::kTH2D, {thnAxisInvMass, thAxisTanThetaPhi}); registry.add("hAlphaPt", "Histo of meson asymmetry vs pT", HistType::kTH2D, {thAxisAlpha, thnAxisPt}); @@ -313,11 +337,20 @@ struct EMfTaskPi0Flow { ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); LOG(info) << "thnConfigAxisInvMass.value[1] = " << thnConfigAxisInvMass.value[1] << " thnConfigAxisInvMass.value.back() = " << thnConfigAxisInvMass.value.back(); LOG(info) << "thnConfigAxisPt.value[1] = " << thnConfigAxisPt.value[1] << " thnConfigAxisPt.value.back() = " << thnConfigAxisPt.value.back(); }; // end init + template + void initCCDB(TCollision const& collision) + { + if (correctionConfig.cfgApplySPresolution.value) { + h1SPResolution = ccdb->getForTimeStamp(correctionConfig.cfgSpresoPath.value, collision.timestamp()); + } + } + /// Change radians to degree /// \param angle in radians /// \return angle in degree @@ -470,7 +503,7 @@ struct EMfTaskPi0Flow { bool isQvecGood(std::vector const& QVecs) { bool isgood = true; - for (auto& QVec : QVecs) { + for (const auto& QVec : QVecs) { if (std::fabs(QVec) > 20.f) { isgood = false; break; @@ -479,9 +512,44 @@ struct EMfTaskPi0Flow { return isgood; } + bool isTooCloseToEdge(const int cellID, const int DistanceToBorder = 1) + { + if (DistanceToBorder <= 0) { + return false; + } + if (cellID < 0) { + return true; + } + + int iBadCell = -1; + + // check distance to border in case the cell is okay + auto [iSupMod, iMod, iPhi, iEta] = emcalGeom->GetCellIndex(cellID); + auto [irow, icol] = emcalGeom->GetCellPhiEtaIndexInSModule(iSupMod, iMod, iPhi, iEta); + + // Check rows/phi + int iRowLast = 24; + if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_HALF) { + iRowLast /= 2; // 2/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_THIRD) { + iRowLast /= 3; // 1/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::DCAL_EXT) { + iRowLast /= 3; // 1/3 sm case + } + + if (irow < DistanceToBorder || (iRowLast - irow) <= DistanceToBorder) { + iBadCell = 1; + } + + if (iBadCell > 0) { + return true; + } + return false; + } + /// \brief Calculate background using rotation background method template - void RotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, CollsWithQvecs::iterator const& collision) + void rotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, CollsWithQvecs::iterator const& collision) { // if less than 3 clusters are present skip event since we need at least 3 clusters if (photons_coll.size() < 3) { @@ -490,8 +558,8 @@ struct EMfTaskPi0Flow { auto [xQVec, yQVec] = getQvec(collision, qvecDetector); float cent = getCentrality(collision); - int iCellID_photon1 = 0; - int iCellID_photon2 = 0; + int iCellIDPhoton1 = 0; + int iCellIDPhoton = 0; ROOT::Math::AxisAngle rotationAxis(meson.Vect(), cfgRotAngle.value); ROOT::Math::Rotation3D rotationMatrix(rotationAxis); @@ -499,20 +567,26 @@ struct EMfTaskPi0Flow { photon2 = rotationMatrix * photon2; try { - iCellID_photon1 = emcalGeom->GetAbsCellIdFromEtaPhi(photon1.Eta(), photon1.Phi()); + iCellIDPhoton1 = emcalGeom->GetAbsCellIdFromEtaPhi(photon1.Eta(), photon1.Phi()); + if (isTooCloseToEdge(iCellIDPhoton1, cfgDistanceToEdge.value)) { + iCellIDPhoton1 = -1; + } } catch (o2::emcal::InvalidPositionException& e) { - iCellID_photon1 = -1; + iCellIDPhoton1 = -1; } try { - iCellID_photon2 = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + iCellIDPhoton = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + if (isTooCloseToEdge(iCellIDPhoton, cfgDistanceToEdge.value)) { + iCellIDPhoton = -1; + } } catch (o2::emcal::InvalidPositionException& e) { - iCellID_photon2 = -1; + iCellIDPhoton = -1; } - if (iCellID_photon1 == -1 && iCellID_photon2 == -1) { + if (iCellIDPhoton1 == -1 && iCellIDPhoton == -1) { return; } - for (auto& photon : photons_coll) { + for (const auto& photon : photons_coll) { if (photon.globalIndex() == ig1 || photon.globalIndex() == ig2) { // only combine rotated photons with other photons continue; @@ -521,17 +595,22 @@ struct EMfTaskPi0Flow { continue; } ROOT::Math::PtEtaPhiMVector photon3(photon.pt(), photon.eta(), photon.phi(), 0.); - if (iCellID_photon1 > 0) { + if (iCellIDPhoton1 > 0) { ROOT::Math::PtEtaPhiMVector mother1 = photon1 + photon3; float openingAngle1 = std::acos(photon1.Vect().Dot(photon3.Vect()) / (photon1.P() * photon3.P())); float cosNPhi1 = std::cos(harmonic * mother1.Phi()); float sinNPhi1 = std::sin(harmonic * mother1.Phi()); float scalprodCand1 = cosNPhi1 * xQVec + sinNPhi1 * yQVec; + + if (correctionConfig.cfgApplySPresolution.value) { + scalprodCand1 = scalprodCand1 / h1SPResolution->GetBinContent(h1SPResolution->FindBin(cent + epsilon)); + } + if (openingAngle1 > mesonConfig.minOpenAngle && thnConfigAxisInvMass.value[1] <= mother1.M() && thnConfigAxisInvMass.value.back() >= mother1.M() && thnConfigAxisPt.value[1] <= mother1.Pt() && thnConfigAxisPt.value.back() >= mother1.Pt()) { if (mesonConfig.enableTanThetadPhi) { float dTheta = photon1.Theta() - photon3.Theta(); float dPhi = photon1.Phi() - photon3.Phi(); - if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hSparseBkgFlow"), mother1.M(), mother1.Pt(), cent, scalprodCand1); } } else { @@ -539,18 +618,22 @@ struct EMfTaskPi0Flow { } } } - if (iCellID_photon2 > 0) { + if (iCellIDPhoton > 0) { ROOT::Math::PtEtaPhiMVector mother2 = photon2 + photon3; float openingAngle2 = std::acos(photon2.Vect().Dot(photon3.Vect()) / (photon2.P() * photon3.P())); float cosNPhi2 = std::cos(harmonic * mother2.Phi()); float sinNPhi2 = std::sin(harmonic * mother2.Phi()); float scalprodCand2 = cosNPhi2 * xQVec + sinNPhi2 * yQVec; + if (correctionConfig.cfgApplySPresolution.value) { + scalprodCand2 = scalprodCand2 / h1SPResolution->GetBinContent(h1SPResolution->FindBin(cent + epsilon)); + } + if (openingAngle2 > mesonConfig.minOpenAngle && thnConfigAxisInvMass.value[1] <= mother2.M() && thnConfigAxisInvMass.value.back() >= mother2.M() && thnConfigAxisPt.value[1] <= mother2.Pt() && thnConfigAxisPt.value.back() >= mother2.Pt()) { if (mesonConfig.enableTanThetadPhi) { float dTheta = photon2.Theta() - photon3.Theta(); float dPhi = photon2.Phi() - photon3.Phi(); - if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hSparseBkgFlow"), mother2.M(), mother2.Pt(), cent, scalprodCand2); } } else { @@ -578,6 +661,10 @@ struct EMfTaskPi0Flow { float sinNPhi = std::sin(harmonic * phiCand); float scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; + if (correctionConfig.cfgApplySPresolution.value) { + scalprodCand = scalprodCand / h1SPResolution->GetBinContent(h1SPResolution->FindBin(cent + epsilon)); + } + fillThn(massCand, ptCand, cent, scalprodCand); return; } @@ -585,27 +672,27 @@ struct EMfTaskPi0Flow { // Pi0 from EMCal void processEMCal(CollsWithQvecs const& collisions, EMCalPhotons const& clusters) { - int NColl = 1; - for (auto& collision : collisions) { - auto photons_per_collision = clusters.sliceBy(perCollision_emc, collision.globalIndex()); + int nColl = 1; + for (const auto& collision : collisions) { + auto photonsPerCollision = clusters.sliceBy(perCollisionEMC, collision.globalIndex()); - if (eventcuts.enableQA) { + if (eventcuts.cfgEnableQA) { // TODO: check EMCal NCells in collisions without EMC Readout registry.fill(HIST("hCollisionEMCCheck"), 1.); // all if (collision.alias_bit(kTVXinEMC) == true) { registry.fill(HIST("hCollisionEMCCheck"), 2.); // has EMC read out - if (photons_per_collision.size() > 0) { + if (photonsPerCollision.size() > 0) { registry.fill(HIST("hCollisionEMCCheck"), 3.); // has EMC cluster registry.fill(HIST("hCollisionEMCCheck"), 4.); // has EMC read out and clusters } else { registry.fill(HIST("hCollisionEMCCheck"), 5.); // has EMC read out but no clusters } } else { - if (photons_per_collision.size() > 0) { + if (photonsPerCollision.size() > 0) { registry.fill(HIST("hCollisionEMCCheck"), 3.); // has EMC cluster registry.fill(HIST("hCollisionEMCCheck"), 6.); // has no EMC read out and clusters registry.fill(HIST("LED/hMult"), collision.multFT0C()); - for (auto& photon : photons_per_collision) { + for (const auto& photon : photonsPerCollision) { registry.fill(HIST("LED/hClusterEtaPhi"), photon.phi(), photon.eta()); registry.fill(HIST("LED/clusterTimeVsE"), photon.time(), photon.e()); registry.fill(HIST("LED/hNCell"), photon.nCells()); @@ -619,7 +706,6 @@ struct EMfTaskPi0Flow { if (!(fEMEventCut.IsSelected(collision))) { // general event selection continue; - continue; } if (!(eventcuts.cfgTrackOccupancyMin <= collision.trackOccupancyInTimeRange() && collision.trackOccupancyInTimeRange() < eventcuts.cfgTrackOccupancyMax)) { // occupancy selection @@ -634,12 +720,13 @@ struct EMfTaskPi0Flow { // selection based on QVector continue; } + initCCDB(collision); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted - if (emccuts.enableQA) { - for (auto& photon : photons_per_collision) { + if (emccuts.cfgEnableQA) { + for (const auto& photon : photonsPerCollision) { registry.fill(HIST("hEClusterBefore"), photon.e()); // before cuts if (!(fEMCCut.IsSelected(photon))) { continue; @@ -647,7 +734,7 @@ struct EMfTaskPi0Flow { registry.fill(HIST("hEClusterAfter"), photon.e()); // accepted after cuts } } - for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons_per_collision, photons_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photonsPerCollision, photonsPerCollision))) { if (!(fEMCCut.IsSelected(g1)) || !(fEMCCut.IsSelected(g2))) { continue; } @@ -663,8 +750,8 @@ struct EMfTaskPi0Flow { continue; } if (cfgDoRotation) { - if (NColl % cfgDownsampling.value == 0) { - RotationBackground(vMeson, v1, v2, photons_per_collision, g1.globalIndex(), g2.globalIndex(), collision); + if (nColl % cfgDownsampling.value == 0) { + rotationBackground(vMeson, v1, v2, photonsPerCollision, g1.globalIndex(), g2.globalIndex(), collision); } } if (thnConfigAxisInvMass.value[1] > vMeson.M() || thnConfigAxisInvMass.value.back() < vMeson.M()) { @@ -675,12 +762,12 @@ struct EMfTaskPi0Flow { registry.fill(HIST("hClusterCuts"), 4); continue; } - if (mesonConfig.enableQA) { + if (mesonConfig.cfgEnableQA) { registry.fill(HIST("hInvMassPt"), vMeson.M(), vMeson.Pt()); - registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(atan(dTheta / dPhi))); + registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(std::atan(dTheta / dPhi))); registry.fill(HIST("hAlphaPt"), (v1.E() - v2.E()) / (v1.E() + v2.E()), vMeson.Pt()); } - if (mesonConfig.enableTanThetadPhi && mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.enableTanThetadPhi && mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hClusterCuts"), 5); continue; } @@ -688,15 +775,15 @@ struct EMfTaskPi0Flow { runFlowAnalysis(collision, vMeson); } if (cfgDoRotation) { - if (NColl % cfgDownsampling.value == 0) { - NColl = 1; // reset counter + if (nColl % cfgDownsampling.value == 0) { + nColl = 1; // reset counter } else { - NColl++; + nColl++; } } } } - PROCESS_SWITCH(EMfTaskPi0Flow, processEMCal, "Process EMCal Pi0 candidates", true); + PROCESS_SWITCH(TaskPi0FlowEMC, processEMCal, "Process EMCal Pi0 candidates", true); // Pi0 from EMCal void processEMCalMixed(FilteredCollsWithQvecs const& collisions, FilteredEMCalPhotons const& clusters) @@ -708,12 +795,12 @@ struct EMfTaskPi0Flow { }; using BinningType = FlexibleBinningPolicy, aod::collision::PosZ, aod::cent::CentFT0C, emevent::EP2FT0M>; - BinningType binningWithLambda{{getClustersSize}, {mixingConfig.ConfVtxBins, mixingConfig.ConfCentBins, mixingConfig.ConfEPBins}, true}; + BinningType binningWithLambda{{getClustersSize}, {mixingConfig.cfgVtxBins, mixingConfig.cfgCentBins, mixingConfig.cfgEPBins}, true}; auto clustersTuple = std::make_tuple(clusters); - SameKindPair pair{binningWithLambda, mixingConfig.ConfMixingDepth, -1, collisions, clustersTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored + SameKindPair pair{binningWithLambda, mixingConfig.cfgMixingDepth, -1, collisions, clustersTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored - for (auto& [c1, clusters1, c2, clusters2] : pair) { + for (const auto& [c1, clusters1, c2, clusters2] : pair) { if (!(fEMEventCut.IsSelected(c1)) || !(fEMEventCut.IsSelected(c2))) { // general event selection continue; @@ -730,7 +817,8 @@ struct EMfTaskPi0Flow { // selection based on QVector continue; } - for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(clusters1, clusters2))) { + initCCDB(c1); + for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(clusters1, clusters2))) { if (!(fEMCCut.IsSelected(g1)) || !(fEMCCut.IsSelected(g2))) { continue; } @@ -755,12 +843,12 @@ struct EMfTaskPi0Flow { registry.fill(HIST("hClusterCuts"), 4); continue; } - if (mesonConfig.enableQA) { + if (mesonConfig.cfgEnableQA) { registry.fill(HIST("hInvMassPt"), vMeson.M(), vMeson.Pt()); - registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(atan(dTheta / dPhi))); + registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(std::atan(dTheta / dPhi))); registry.fill(HIST("hAlphaPt"), (v1.E() - v2.E()) / (v1.E() + v2.E()), vMeson.Pt()); } - if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hClusterCuts"), 5); continue; } @@ -769,7 +857,7 @@ struct EMfTaskPi0Flow { } } } - PROCESS_SWITCH(EMfTaskPi0Flow, processEMCalMixed, "Process EMCal Pi0 mixed event candidates", false); + PROCESS_SWITCH(TaskPi0FlowEMC, processEMCalMixed, "Process EMCal Pi0 mixed event candidates", false); // Resolution void processResolution(CollsWithQvecs::iterator const& collision) @@ -873,13 +961,27 @@ struct EMfTaskPi0Flow { registry.fill(HIST("epReso/hEpResoFT0mTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0m, epBNegs))); registry.fill(HIST("epReso/hEpResoFT0mTPCtot"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0m, epBTots))); registry.fill(HIST("epReso/hEpResoTPCposTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epBPoss, epBNegs))); + for (int n = 1; n <= 8; n++) { + registry.fill(HIST("epReso/hEpCosCoefficientsFT0c"), centrality, n, std::cos(n * epFT0c)); + registry.fill(HIST("epReso/hEpSinCoefficientsFT0c"), centrality, n, std::sin(n * epFT0c)); + registry.fill(HIST("epReso/hEpCosCoefficientsFT0a"), centrality, n, std::cos(n * epFT0a)); + registry.fill(HIST("epReso/hEpSinCoefficientsFT0a"), centrality, n, std::sin(n * epFT0a)); + registry.fill(HIST("epReso/hEpCosCoefficientsFT0m"), centrality, n, std::cos(n * epFT0m)); + registry.fill(HIST("epReso/hEpSinCoefficientsFT0m"), centrality, n, std::sin(n * epFT0m)); + registry.fill(HIST("epReso/hEpCosCoefficientsTPCpos"), centrality, n, std::cos(n * epBPoss)); + registry.fill(HIST("epReso/hEpSinCoefficientsTPCpos"), centrality, n, std::sin(n * epBPoss)); + registry.fill(HIST("epReso/hEpCosCoefficientsTPCneg"), centrality, n, std::cos(n * epBNegs)); + registry.fill(HIST("epReso/hEpSinCoefficientsTPCneg"), centrality, n, std::sin(n * epBNegs)); + registry.fill(HIST("epReso/hEpCosCoefficientsTPCTots"), centrality, n, std::cos(n * epBTots)); + registry.fill(HIST("epReso/hEpSinCoefficientsTPCTots"), centrality, n, std::sin(n * epBTots)); + } } } - PROCESS_SWITCH(EMfTaskPi0Flow, processResolution, "Process resolution", false); + PROCESS_SWITCH(TaskPi0FlowEMC, processResolution, "Process resolution", false); -}; // End struct EMfTaskPi0Flow +}; // End struct TaskPi0FlowEMC WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 97c1af274450a53778ce8070aee4228ccc4cf4b2 Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 4 Dec 2024 09:24:46 +0100 Subject: [PATCH 36/91] [PWGUD] suppress SGProducers printouts to terminal (#8791) --- PWGUD/TableProducer/SGCandProducer.cxx | 52 +++++++++++++++++--------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index aabaa4357ae..967e7a838d0 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -34,6 +34,7 @@ struct SGCandProducer { // get an SGCutparHolder SGCutParHolder sameCuts = SGCutParHolder(); // SGCutparHolder Configurable SGCuts{"SGCuts", {}, "SG event cuts"}; + Configurable verboseInfo{"verboseInfo", false, "Print general info to terminal; default it false."}; Configurable saveAllTracks{"saveAllTracks", true, "save only PV contributors or all tracks associated to a collision"}; Configurable savenonPVCITSOnlyTracks{"savenonPVCITSOnlyTracks", false, "save non PV contributors with ITS only information"}; Configurable rejectAtTFBoundary{"rejectAtTFBoundary", true, "reject collisions at a TF boundary"}; @@ -172,7 +173,8 @@ struct SGCandProducer { void process(CC const& collision, BCs const& bcs, TCs& tracks, FWs& fwdtracks, aod::Zdcs& /*zdcs*/, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) { - LOGF(debug, " collision %d", collision.globalIndex()); + if (verboseInfo) + LOGF(debug, " collision %d", collision.globalIndex()); registry.get(HIST("reco/Stat"))->Fill(0., 1.); // reject collisions at TF boundaries if (rejectAtTFBoundary && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { @@ -215,11 +217,13 @@ struct SGCandProducer { if (isSGEvent.bc && issgevent < 2) { newbc = *(isSGEvent.bc); } else { - LOGF(info, "No Newbc %i", bc.globalBC()); + if (verboseInfo) + LOGF(info, "No Newbc %i", bc.globalBC()); } registry.get(HIST("reco/Stat"))->Fill(issgevent + 8, 1.); if (issgevent <= 2) { - // LOGF(info, "Current BC: %i, %i, %i", bc.globalBC(), newbc.globalBC(), issgevent); + if (verboseInfo) + LOGF(info, "Current BC: %i, %i, %i", bc.globalBC(), newbc.globalBC(), issgevent); if (sameCuts.minRgtrwTOF()) { if (udhelpers::rPVtrwTOF(tracks, collision.numContrib()) < sameCuts.minRgtrwTOF()) return; @@ -281,6 +285,7 @@ struct SGCandProducer { struct McSGCandProducer { // MC tables + Configurable verboseInfoMC{"verboseInfoMC", false, "Print general info to terminal; default it false."}; Produces outputMcCollisions; Produces outputMcParticles; Produces outputMcCollsLabels; @@ -374,7 +379,8 @@ struct McSGCandProducer { auto oldmids = mcpart.mothersIds(); for (auto oldmid : oldmids) { auto m = McParts.rawIteratorAt(oldmid); - LOGF(debug, " m %d", m.globalIndex()); + if (verboseInfoMC) + LOGF(debug, " m %d", m.globalIndex()); if (mcPartIsSaved.find(oldmid) != mcPartIsSaved.end()) { newval = mcPartIsSaved[oldmid]; } else { @@ -392,7 +398,8 @@ struct McSGCandProducer { } newdids[ii] = newval; } - LOGF(debug, " ms %i ds %i", oldmids.size(), olddids.size()); + if (verboseInfoMC) + LOGF(debug, " ms %i ds %i", oldmids.size(), olddids.size()); // update UDMcParticles outputMcParticles(McCollisionId, @@ -474,11 +481,14 @@ struct McSGCandProducer { UDCCs const& sgcands, UDTCs const& udtracks, CCs const& /*collisions*/, BCs const& /*bcs*/, TCs const& /*tracks*/) { - LOGF(info, "Number of McCollisions %d", mccols.size()); - LOGF(info, "Number of SG candidates %d", sgcands.size()); - LOGF(info, "Number of UD tracks %d", udtracks.size()); + if (verboseInfoMC) { + LOGF(info, "Number of McCollisions %d", mccols.size()); + LOGF(info, "Number of SG candidates %d", sgcands.size()); + LOGF(info, "Number of UD tracks %d", udtracks.size()); + } if (sgcands.size() <= 0) { - LOGF(info, "No DG candidates to save!"); + if (verboseInfoMC) + LOGF(info, "No DG candidates to save!"); return; } @@ -519,14 +529,16 @@ struct McSGCandProducer { // colId = -1; mcsgId = -1; } - LOGF(info, "\nStart of loop mcsgId %d mccolId %d", mcsgId, mccolId); + if (verboseInfoMC) + LOGF(info, "\nStart of loop mcsgId %d mccolId %d", mcsgId, mccolId); // two cases to consider // 1. mcdgId <= mccolId: the event to process is a dgcand. In this case the Mc tables as well as the McLabel tables are updated // 2. mccolId < mcdgId: the event to process is an MC event of interest without reconstructed dgcand. In this case only the Mc tables are updated if ((!sgcandAtEnd && !mccolAtEnd && (mcsgId <= mccolId)) || mccolAtEnd) { // this is case 1. - // LOGF(info, "Doing case 1 with mcsgId %d", mcsgId); + if (verboseInfoMC) + LOGF(info, "Doing case 1 with mcsgId %d", mcsgId); // update UDMcCollisions and UDMcColsLabels (for each UDCollision -> UDMcCollisions) // update UDMcParticles and UDMcTrackLabels (for each UDTrack -> UDMcParticles) @@ -537,7 +549,8 @@ struct McSGCandProducer { // McParticles are saved if (mcsgId >= 0) { if (mcColIsSaved.find(mcsgId) == mcColIsSaved.end()) { - LOGF(info, " Saving McCollision %d", mcsgId); + if (verboseInfoMC) + LOGF(info, " Saving McCollision %d", mcsgId); // update UDMcCollisions auto sgcandMcCol = sgcand.collision_as().mcCollision(); updateUDMcCollisions(sgcandMcCol, globBC); @@ -557,7 +570,8 @@ struct McSGCandProducer { } else { // If the sgcand has no associated McCollision then only the McParticles which are associated // with the tracks of the sgcand are saved - // LOGF(info, " Saving McCollision %d", -1); + if (verboseInfoMC) + LOGF(info, " Saving McCollision %d", -1); // update UDMcColsLabels (for each UDCollision -> UDMcCollisions) outputMcCollsLabels(-1); @@ -587,11 +601,13 @@ struct McSGCandProducer { } } else { // this is case 2. - LOGF(info, "Doing case 2"); + if (verboseInfoMC) + LOGF(info, "Doing case 2"); // update UDMcCollisions and UDMcParticles if (mcColIsSaved.find(mccolId) == mcColIsSaved.end()) { - LOGF(info, " Saving McCollision %d", mccolId); + if (verboseInfoMC) + LOGF(info, " Saving McCollision %d", mccolId); // update UDMcCollisions updateUDMcCollisions(mccol, globBC); mcColIsSaved[mccolId] = outputMcCollisions.lastIndex(); @@ -611,14 +627,16 @@ struct McSGCandProducer { } goon = !sgcandAtEnd || !mccolAtEnd; - // LOGF(info, "End of loop mcsgId %d mccolId %d", mcsgId, mccolId); + if (verboseInfoMC) + LOGF(info, "End of loop mcsgId %d mccolId %d", mcsgId, mccolId); } } PROCESS_SWITCH(McSGCandProducer, processMC, "Produce MC tables", false); void processDummy(aod::Collisions const& /*collisions*/) { // do nothing - LOGF(info, "Running dummy process function!"); + if (verboseInfoMC) + LOGF(info, "Running dummy process function!"); } PROCESS_SWITCH(McSGCandProducer, processDummy, "Dummy function", true); }; From af86e5c88db5e4e3dafec061a5b543bb01522eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jura=C4=8Dka?= <137087737+jjuracka@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:25:03 +0100 Subject: [PATCH 37/91] [PWGUD] updates to upcRhoAnalysis.cxx (#8806) --- PWGUD/Tasks/upcRhoAnalysis.cxx | 247 +++++++++++++++++++++------------ 1 file changed, 156 insertions(+), 91 deletions(-) diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index d4a45ed7442..8684bf99550 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -61,10 +61,10 @@ DECLARE_SOA_COLUMN(TimeFV0A, timeFV0A, float); DECLARE_SOA_COLUMN(TimeFDDA, timeFDDA, float); DECLARE_SOA_COLUMN(TimeFDDC, timeFDDC, float); // ZDC info -DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); -DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); -DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); -DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); +// DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); +// DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); +// DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); +// DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); DECLARE_SOA_COLUMN(NeutronClass, neutronClass, int); // Rhos DECLARE_SOA_COLUMN(TotalCharge, totalCharge, int); @@ -89,9 +89,14 @@ DECLARE_SOA_COLUMN(TrackElPID, trackElPID, std::vector); DECLARE_SOA_COLUMN(TrackDcaXY, trackDcaXY, std::vector); DECLARE_SOA_COLUMN(TrackDcaZ, trackDcaZ, std::vector); DECLARE_SOA_COLUMN(TrackTpcSignal, trackTpcSignal, std::vector); -DECLARE_SOA_COLUMN(TofClass, tofClass, int); } // namespace tree -DECLARE_SOA_TABLE(Tree, "AOD", "TREE", tree::RunNumber, tree::GlobalBC, tree::NumContrib, tree::PosX, tree::PosY, tree::PosZ, tree::TotalFT0AmplitudeA, tree::TotalFT0AmplitudeC, tree::TotalFV0AmplitudeA, tree::TotalFDDAmplitudeA, tree::TotalFDDAmplitudeC, tree::TimeFT0A, tree::TimeFT0C, tree::TimeFV0A, tree::TimeFDDA, tree::TimeFDDC, tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, tree::NeutronClass, tree::TotalCharge, tree::RhoPt, tree::RhoEta, tree::RhoPhi, tree::RhoM, tree::RhoPhiRandom, tree::RhoPhiCharge, tree::TrackSign, tree::TrackPt, tree::TrackEta, tree::TrackPhi, tree::TrackM, tree::TrackPiPID, tree::TrackElPID, tree::TrackDcaXY, tree::TrackDcaZ, tree::TrackTpcSignal, tree::TofClass); +DECLARE_SOA_TABLE(Tree, "AOD", "TREE", + tree::RunNumber, tree::GlobalBC, tree::NumContrib, + tree::PosX, tree::PosY, tree::PosZ, tree::TotalFT0AmplitudeA, tree::TotalFT0AmplitudeC, tree::TotalFV0AmplitudeA, tree::TotalFDDAmplitudeA, tree::TotalFDDAmplitudeC, + tree::TimeFT0A, tree::TimeFT0C, tree::TimeFV0A, tree::TimeFDDA, tree::TimeFDDC, + /* tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, */ tree::NeutronClass, + tree::TotalCharge, tree::RhoPt, tree::RhoEta, tree::RhoPhi, tree::RhoM, tree::RhoPhiRandom, tree::RhoPhiCharge, + tree::TrackSign, tree::TrackPt, tree::TrackEta, tree::TrackPhi, tree::TrackM, tree::TrackPiPID, tree::TrackElPID, tree::TrackDcaXY, tree::TrackDcaZ, tree::TrackTpcSignal); } // namespace o2::aod struct upcRhoAnalysis { @@ -99,6 +104,7 @@ struct upcRhoAnalysis { double PcEtaCut = 0.9; // physics coordination recommendation Configurable requireTof{"requireTof", false, "require TOF signal"}; + Configurable do4pi{"do4pi", true, "do 4pi analysis"}; Configurable collisionsPosZMaxCut{"collisionsPosZMaxCut", 10.0, "max Z position cut on collisions"}; Configurable ZNcommonEnergyCut{"ZNcommonEnergyCut", 0.0, "ZN common energy cut"}; @@ -125,12 +131,13 @@ struct upcRhoAnalysis { ConfigurableAxis ptAxis{"ptAxis", {1000, 0.0, 10.0}, "p_{T} (GeV/#it{c})"}; ConfigurableAxis ptCutAxis{"ptCutAxis", {100, 0.0, 0.1}, "p_{T} (GeV/#it{c})"}; ConfigurableAxis pt2Axis{"pt2Axis", {100, 0.0, 0.01}, "p_{T}^{2} (GeV^{2}/#it{c}^{2})"}; - ConfigurableAxis etaAxis{"etaAxis", {180, -0.9, 0.9}, "#eta"}; + ConfigurableAxis etaAxis{"etaAxis", {800, -4.0, 4.0}, "#eta"}; + ConfigurableAxis etaCutAxis{"etaCutAxis", {180, -0.9, 0.9}, "#eta"}; ConfigurableAxis yAxis{"yAxis", {180, -0.9, 0.9}, "y"}; ConfigurableAxis phiAxis{"phiAxis", {180, 0.0, o2::constants::math::TwoPI}, "#phi"}; ConfigurableAxis phiAsymmAxis{"phiAsymmAxis", {182, -o2::constants::math::PI, o2::constants::math::PI}, "#phi"}; ConfigurableAxis momentumFromPhiAxis{"momentumFromPhiAxis", {400, -0.1, 0.1}, "p (GeV/#it{c})"}; - ConfigurableAxis ptQuantileAxis{"ptQuantileAxis", {0, 0.0181689, 0.0263408, 0.0330488, 0.0390369, 0.045058, 0.0512604, 0.0582598, 0.066986, 0.0788085, 0.1}, "p_{T} (GeV/#it{c})"}; + // ConfigurableAxis ptQuantileAxis{"ptQuantileAxis", {0, 0.0181689, 0.0263408, 0.0330488, 0.0390369, 0.045058, 0.0512604, 0.0582598, 0.066986, 0.0788085, 0.1}, "p_{T} (GeV/#it{c})"}; HistogramRegistry QC{"QC", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry Pions{"Pions", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -183,9 +190,9 @@ struct upcRhoAnalysis { QC.add("QC/tracks/raw/hTpcChi2NCl", ";TPC #chi^{2}/N_{cls};counts", kTH1D, {{1000, 0.0, 100.0}}); QC.add("QC/tracks/raw/hTpcNCls", ";TPC N_{cls} found;counts", kTH1D, {{200, 0.0, 200.0}}); QC.add("QC/tracks/raw/hTpcNClsCrossedRows", ";TPC crossed rows;counts", kTH1D, {{200, 0.0, 200.0}}); - QC.add("QC/tracks/raw/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {{1000, 0.0, 10.0}}); - QC.add("QC/tracks/raw/hEta", ";y;counts", kTH1D, {{180, -0.9, 0.9}}); - QC.add("QC/tracks/raw/hPhi", ";#phi;counts", kTH1D, {{180, 0.0, o2::constants::math::TwoPI}}); // tracks passing selections + QC.add("QC/tracks/raw/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + QC.add("QC/tracks/raw/hEta", ";y;counts", kTH1D, {etaAxis}); + QC.add("QC/tracks/raw/hPhi", ";#phi;counts", kTH1D, {phiAxis}); // tracks passing selections QC.add("QC/tracks/cut/hTpcNSigmaPi2D", ";TPC n#sigma(#pi_{leading});TPC n#sigma(#pi_{subleading});counts", kTH2D, {{400, -10.0, 30.0}, {400, -10.0, 30.0}}); QC.add("QC/tracks/cut/hTpcNSigmaEl2D", ";TPC n#sigma(e_{leading});TPC n#sigma(e_{subleading});counts", kTH2D, {{400, -10.0, 30.0}, {400, -10.0, 30.0}}); QC.add("QC/tracks/cut/hTpcSignalVsP", ";p (GeV/#it{c});TPC signal;counts", kTH2D, {ptAxis, {500, 0.0, 500.0}}); @@ -206,17 +213,17 @@ struct upcRhoAnalysis { // PIONS // no selection Pions.add("pions/no-selection/unlike-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/no-selection/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/no-selection/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/no-selection/unlike-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); Pions.add("pions/no-selection/like-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/no-selection/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/no-selection/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/no-selection/like-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); // selected Pions.add("pions/selected/unlike-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/selected/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/selected/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/selected/unlike-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); Pions.add("pions/selected/like-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/selected/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/selected/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/selected/like-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); // RAW RHOS @@ -224,14 +231,17 @@ struct upcRhoAnalysis { System.add("system/raw/unlike-sign/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); System.add("system/raw/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); System.add("system/raw/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/raw/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/raw/like-sign/positive/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); System.add("system/raw/like-sign/positive/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); System.add("system/raw/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); System.add("system/raw/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/raw/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/raw/like-sign/negative/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); System.add("system/raw/like-sign/negative/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); System.add("system/raw/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); System.add("system/raw/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/raw/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAxis}); // SELECTED RHOS // no selection @@ -240,45 +250,39 @@ struct upcRhoAnalysis { System.add("system/cut/no-selection/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/no-selection/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/no-selection/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/no-selection/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiChargeVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPyVsPxRandom", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); System.add("system/cut/no-selection/unlike-sign/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); - System.add("system/cut/no-selection/unlike-sign/hTofClassVsM", ";m (GeV/#it{c}^{2});TOF class;counts", kTH2D, {mCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/unlike-sign/hTofClassVsPt", ";p_{T} (GeV/#it{c});TOF class;counts", kTH2D, {ptCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/unlike-sign/hTofClassVsY", ";y;TOF class;counts", kTH2D, {yAxis, {4, -0.5, 3.5}}); System.add("system/cut/no-selection/like-sign/positive/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mCutAxis}); System.add("system/cut/no-selection/like-sign/positive/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptCutAxis}); System.add("system/cut/no-selection/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/no-selection/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/no-selection/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/no-selection/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiChargeVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPyVsPxRandom", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); System.add("system/cut/no-selection/like-sign/positive/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); - System.add("system/cut/no-selection/like-sign/positive/hTofClassVsM", ";m (GeV/#it{c}^{2});TOF class;counts", kTH2D, {mCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/positive/hTofClassVsPt", ";p_{T} (GeV/#it{c});TOF class;counts", kTH2D, {ptCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/positive/hTofClassVsY", ";y;TOF class;counts", kTH2D, {yAxis, {4, -0.5, 3.5}}); System.add("system/cut/no-selection/like-sign/negative/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mCutAxis}); System.add("system/cut/no-selection/like-sign/negative/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptCutAxis}); System.add("system/cut/no-selection/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/no-selection/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/no-selection/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/no-selection/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiChargeVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPyVsPxRandom", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); System.add("system/cut/no-selection/like-sign/negative/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); - System.add("system/cut/no-selection/like-sign/negative/hTofClassVsM", ";m (GeV/#it{c}^{2});TOF class;counts", kTH2D, {mCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/negative/hTofClassVsPt", ";p_{T} (GeV/#it{c});TOF class;counts", kTH2D, {ptCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/negative/hTofClassVsY", ";y;TOF class;counts", kTH2D, {yAxis, {4, -0.5, 3.5}}); // 0n0n System.add("system/cut/0n0n/unlike-sign/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mCutAxis}); @@ -286,6 +290,7 @@ struct upcRhoAnalysis { System.add("system/cut/0n0n/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0n0n/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0n0n/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0n0n/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/0n0n/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -298,6 +303,7 @@ struct upcRhoAnalysis { System.add("system/cut/0n0n/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0n0n/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0n0n/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0n0n/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -310,6 +316,7 @@ struct upcRhoAnalysis { System.add("system/cut/0n0n/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0n0n/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0n0n/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0n0n/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -323,6 +330,7 @@ struct upcRhoAnalysis { System.add("system/cut/Xn0n/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/Xn0n/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/Xn0n/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/Xn0n/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -335,6 +343,7 @@ struct upcRhoAnalysis { System.add("system/cut/Xn0n/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/Xn0n/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/Xn0n/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/Xn0n/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -347,6 +356,7 @@ struct upcRhoAnalysis { System.add("system/cut/Xn0n/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/Xn0n/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/Xn0n/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/Xn0n/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -360,6 +370,7 @@ struct upcRhoAnalysis { System.add("system/cut/0nXn/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0nXn/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0nXn/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0nXn/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -372,6 +383,7 @@ struct upcRhoAnalysis { System.add("system/cut/0nXn/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0nXn/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0nXn/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0nXn/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -384,6 +396,7 @@ struct upcRhoAnalysis { System.add("system/cut/0nXn/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0nXn/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0nXn/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0nXn/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -397,6 +410,7 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/XnXn/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/XnXn/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/XnXn/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -409,6 +423,7 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/XnXn/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/XnXn/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/XnXn/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -421,6 +436,7 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/XnXn/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/XnXn/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/XnXn/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -429,32 +445,46 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/like-sign/negative/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); // MC - MC.add("MC/QC/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); - MC.add("MC/QC/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); - MC.add("MC/QC/hPdgCode", ";pdg code;counts", kTH1D, {{2001, -1000.5, 1000.5}}); - MC.add("MC/QC/hProducedByGenerator", ";produced by generator;counts", kTH1D, {{2, -0.5, 1.5}}); - MC.add("MC/QC/hNPions", ";number of pions;counts", kTH1D, {{11, -0.5, 10.5}}); - - MC.add("MC/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - MC.add("MC/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); - MC.add("MC/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + MC.add("MC/collisions/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); + MC.add("MC/collisions/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); + MC.add("MC/collisions/hNPions", ";number of pions;counts", kTH1D, {{11, -0.5, 10.5}}); + + MC.add("MC/tracks/all/hPdgCode", ";pdg code;counts", kTH1D, {{2001, -1000.5, 1000.5}}); + MC.add("MC/tracks/all/hProducedByGenerator", ";produced by generator;counts", kTH1D, {{2, -0.5, 1.5}}); + MC.add("MC/tracks/all/hIsPhysicalPrimary", ";is physical primary;counts", kTH1D, {{2, -0.5, 1.5}}); + MC.add("MC/tracks/all/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + MC.add("MC/tracks/all/hEta", ";#eta;counts", kTH1D, {etaAxis}); + MC.add("MC/tracks/all/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + MC.add("MC/tracks/pions/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); + MC.add("MC/tracks/pions/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + MC.add("MC/tracks/pions/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); MC.add("MC/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); MC.add("MC/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); MC.add("MC/system/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); MC.add("MC/system/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); MC.add("MC/system/hY", ";y;counts", kTH1D, {yAxis}); + MC.add("MC/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); MC.add("MC/system/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); MC.add("MC/system/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); // 4 pi QA - FourPiQA.add("FourPiQA/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - FourPiQA.add("FourPiQA/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); - FourPiQA.add("FourPiQA/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); - FourPiQA.add("FourPiQA/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); - FourPiQA.add("FourPiQA/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - FourPiQA.add("FourPiQA/system/hY", ";y;counts", kTH1D, {yAxis}); - FourPiQA.add("FourPiQA/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + if (do4pi) { + FourPiQA.add("FourPiQA/reco/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/reco/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); + FourPiQA.add("FourPiQA/reco/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/reco/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); + FourPiQA.add("FourPiQA/reco/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/reco/system/hY", ";y;counts", kTH1D, {yAxis}); + FourPiQA.add("FourPiQA/reco/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/MC/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/MC/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); + FourPiQA.add("FourPiQA/MC/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/MC/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); + FourPiQA.add("FourPiQA/MC/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/MC/system/hY", ";y;counts", kTH1D, {yAxis}); + FourPiQA.add("FourPiQA/MC/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + } } template @@ -533,6 +563,15 @@ struct upcRhoAnalysis { return charge; } + template + int tracksTotalChargeMC(const T& cutTracks) // total charge of selected tracks + { + int charge = 0; + for (const auto& track : cutTracks) + charge += track.pdgCode(); + return charge; + } + bool systemPassCuts(const TLorentzVector& system) // system cuts { if (system.M() < systemMassMinCut || system.M() > systemMassMaxCut) @@ -667,19 +706,26 @@ struct upcRhoAnalysis { LOG(error); return; } + // reonstruct system and calculate total charge, save commonly used values into variables + TLorentzVector system = reconstructSystem(cutTracks4Vecs); + int totalCharge = tracksTotalCharge(cutTracks); + double mass = system.M(); + double pT = system.Pt(); + double pTsquare = pT * pT; + double rapidity = system.Rapidity(); + double systemPhi = system.Phi() + o2::constants::math::PI; - if (cutTracks.size() == 4) { + if (do4pi && cutTracks.size() == 4 && totalCharge == 0) { // fill out some 4pi QC histograms for (int i = 0; i < static_cast(cutTracks.size()); i++) { - FourPiQA.fill(HIST("FourPiQA/tracks/hPt"), cutTracks[i].pt()); - FourPiQA.fill(HIST("FourPiQA/tracks/hEta"), eta(cutTracks[i].px(), cutTracks[i].py(), cutTracks[i].pz())); - FourPiQA.fill(HIST("FourPiQA/tracks/hPhi"), phi(cutTracks[i].px(), cutTracks[i].py())); + FourPiQA.fill(HIST("FourPiQA/reco/tracks/hPt"), cutTracks[i].pt()); + FourPiQA.fill(HIST("FourPiQA/reco/tracks/hEta"), eta(cutTracks[i].px(), cutTracks[i].py(), cutTracks[i].pz())); + FourPiQA.fill(HIST("FourPiQA/reco/tracks/hPhi"), phi(cutTracks[i].px(), cutTracks[i].py())); } - TLorentzVector system = reconstructSystem(cutTracks4Vecs); - FourPiQA.fill(HIST("FourPiQA/system/hM"), system.M()); - FourPiQA.fill(HIST("FourPiQA/system/hPt"), system.Pt()); - FourPiQA.fill(HIST("FourPiQA/system/hY"), system.Rapidity()); - FourPiQA.fill(HIST("FourPiQA/system/hPhi"), system.Phi()); + FourPiQA.fill(HIST("FourPiQA/reco/system/hM"), mass); + FourPiQA.fill(HIST("FourPiQA/reco/system/hPt"), pT); + FourPiQA.fill(HIST("FourPiQA/reco/system/hY"), rapidity); + FourPiQA.fill(HIST("FourPiQA/reco/system/hPhi"), systemPhi); } // further consider only two pion systems @@ -696,13 +742,6 @@ struct upcRhoAnalysis { for (int i = 0; i < static_cast(cutTracks.size()); i++) QC.fill(HIST("QC/tracks/hSelectionCounter"), 15); - // reonstruct system and calculate total charge, save commonly used values into variables - TLorentzVector system = reconstructSystem(cutTracks4Vecs); - int totalCharge = tracksTotalCharge(cutTracks); - double mass = system.M(); - double pT = system.Pt(); - double pTsquare = pT * pT; - double rapidity = system.Rapidity(); double phiRandom = getPhiRandom(cutTracks4Vecs); double phiCharge = getPhiCharge(cutTracks, cutTracks4Vecs); @@ -717,15 +756,6 @@ struct upcRhoAnalysis { double subleadingPhi = phi(subleadingMomentumTrack.px(), subleadingMomentumTrack.py()); // fill TOF hit checker QC.fill(HIST("QC/tracks/hTofHitCheck"), leadingMomentumTrack.hasTOF(), subleadingMomentumTrack.hasTOF()); - int tofClass = -1; - if (!leadingMomentumTrack.hasTOF() && !subleadingMomentumTrack.hasTOF()) - tofClass = 0; - else if (leadingMomentumTrack.hasTOF() && !subleadingMomentumTrack.hasTOF()) - tofClass = 1; - else if (!leadingMomentumTrack.hasTOF() && subleadingMomentumTrack.hasTOF()) - tofClass = 2; - else if (leadingMomentumTrack.hasTOF() && subleadingMomentumTrack.hasTOF()) - tofClass = 3; // fill tree std::vector trackSigns = {leadingMomentumTrack.sign(), subleadingMomentumTrack.sign()}; @@ -738,9 +768,13 @@ struct upcRhoAnalysis { std::vector trackDcaXYs = {leadingMomentumTrack.dcaXY(), subleadingMomentumTrack.dcaXY()}; std::vector trackDcaZs = {leadingMomentumTrack.dcaZ(), subleadingMomentumTrack.dcaZ()}; std::vector trackTpcSignals = {leadingMomentumTrack.tpcSignal(), subleadingMomentumTrack.tpcSignal()}; - Tree(collision.runNumber(), collision.globalBC(), collision.numContrib(), collision.posX(), collision.posY(), collision.posZ(), collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(), collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), neutronClass, + Tree(collision.runNumber(), collision.globalBC(), collision.numContrib(), + collision.posX(), collision.posY(), collision.posZ(), + collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), + collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(), + /* collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), */ neutronClass, totalCharge, pT, system.Eta(), system.Phi(), mass, phiRandom, phiCharge, - trackSigns, trackPts, trackEtas, trackPhis, trackMs, trackPiPIDs, trackElPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals, tofClass); + trackSigns, trackPts, trackEtas, trackPhis, trackMs, trackPiPIDs, trackElPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals); // fill raw histograms according to the total charge switch (totalCharge) { case 0: @@ -751,6 +785,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/raw/unlike-sign/hPt"), pT); System.fill(HIST("system/raw/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/raw/unlike-sign/hY"), rapidity); + System.fill(HIST("system/raw/unlike-sign/hPhi"), systemPhi); break; case 2: @@ -761,6 +796,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/raw/like-sign/positive/hPt"), pT); System.fill(HIST("system/raw/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/raw/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/raw/like-sign/positive/hPhi"), systemPhi); break; case -2: @@ -771,6 +807,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/raw/like-sign/negative/hPt"), pT); System.fill(HIST("system/raw/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/raw/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/raw/like-sign/negative/hPhi"), systemPhi); break; default: @@ -808,21 +845,20 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/no-selection/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/no-selection/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/no-selection/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/no-selection/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiRandomVsM"), mass, phiRandom); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiChargeVsM"), mass, phiCharge); System.fill(HIST("system/cut/no-selection/unlike-sign/hPyVsPxRandom"), pT * std::cos(phiRandom), pT * std::sin(phiRandom)); System.fill(HIST("system/cut/no-selection/unlike-sign/hPyVsPxCharge"), pT * std::cos(phiCharge), pT * std::sin(phiCharge)); - System.fill(HIST("system/cut/no-selection/unlike-sign/hTofClassVsM"), mass, tofClass); - System.fill(HIST("system/cut/no-selection/unlike-sign/hTofClassVsPt"), pT, tofClass); - System.fill(HIST("system/cut/no-selection/unlike-sign/hTofClassVsY"), rapidity, tofClass); if (OnOn) { System.fill(HIST("system/cut/0n0n/unlike-sign/hM"), mass); System.fill(HIST("system/cut/0n0n/unlike-sign/hPt"), pT); System.fill(HIST("system/cut/0n0n/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/0n0n/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0n0n/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/0n0n/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/0n0n/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0n0n/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0n0n/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -835,6 +871,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/Xn0n/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/Xn0n/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -847,6 +884,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/0nXn/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/0nXn/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0nXn/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/0nXn/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/0nXn/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0nXn/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0nXn/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -859,6 +897,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/XnXn/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/XnXn/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/XnXn/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/XnXn/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/XnXn/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/XnXn/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/XnXn/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -877,21 +916,20 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/no-selection/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/no-selection/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiChargeVsM"), mass, phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPyVsPxRandom"), pT * std::cos(phiRandom), pT * std::sin(phiRandom)); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPyVsPxCharge"), pT * std::cos(phiCharge), pT * std::sin(phiCharge)); - System.fill(HIST("system/cut/no-selection/like-sign/positive/hTofClassVsM"), mass, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/positive/hTofClassVsPt"), pT, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/positive/hTofClassVsY"), rapidity, tofClass); if (OnOn) { System.fill(HIST("system/cut/0n0n/like-sign/positive/hM"), mass); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPt"), pT); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0n0n/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -904,6 +942,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -916,6 +955,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/0nXn/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0nXn/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -928,6 +968,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/XnXn/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/XnXn/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -946,21 +987,20 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/no-selection/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/no-selection/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiChargeVsM"), mass, phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPyVsPxRandom"), pT * std::cos(phiRandom), pT * std::sin(phiRandom)); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPyVsPxCharge"), pT * std::cos(phiCharge), pT * std::sin(phiCharge)); - System.fill(HIST("system/cut/no-selection/like-sign/negative/hTofClassVsM"), mass, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/negative/hTofClassVsPt"), pT, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/negative/hTofClassVsY"), rapidity, tofClass); if (OnOn) { System.fill(HIST("system/cut/0n0n/like-sign/negative/hM"), mass); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPt"), pT); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0n0n/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -973,6 +1013,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -985,6 +1026,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/0nXn/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0nXn/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -997,6 +1039,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/XnXn/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/XnXn/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -1014,48 +1057,70 @@ struct upcRhoAnalysis { template void processMC(C const& mcCollision, T const& mcParticles) { - MC.fill(HIST("MC/QC/hPosXY"), mcCollision.posX(), mcCollision.posY()); - MC.fill(HIST("MC/QC/hPosZ"), mcCollision.posZ()); + MC.fill(HIST("MC/collisions/hPosXY"), mcCollision.posX(), mcCollision.posY()); + MC.fill(HIST("MC/collisions/hPosZ"), mcCollision.posZ()); std::vector cutMcParticles; std::vector mcParticles4Vecs; for (auto const& mcParticle : mcParticles) { - MC.fill(HIST("MC/QC/hPdgCode"), mcParticle.pdgCode()); - MC.fill(HIST("MC/QC/hProducedByGenerator"), mcParticle.producedByGenerator()); - MC.fill(HIST("MC/tracks/hPt"), std::sqrt(mcParticle.px() * mcParticle.px() + mcParticle.py() * mcParticle.py())); - MC.fill(HIST("MC/tracks/hEta"), eta(mcParticle.px(), mcParticle.py(), mcParticle.pz())); - MC.fill(HIST("MC/tracks/hPhi"), phi(mcParticle.px(), mcParticle.py())); - if (!mcParticle.producedByGenerator() || std::abs(mcParticle.pdgCode()) != 211) + MC.fill(HIST("MC/tracks/all/hPdgCode"), mcParticle.pdgCode()); + MC.fill(HIST("MC/tracks/all/hProducedByGenerator"), mcParticle.producedByGenerator()); + MC.fill(HIST("MC/tracks/all/hIsPhysicalPrimary"), mcParticle.isPhysicalPrimary()); + MC.fill(HIST("MC/tracks/all/hPt"), pt(mcParticle.px(), mcParticle.py())); + MC.fill(HIST("MC/tracks/all/hEta"), eta(mcParticle.px(), mcParticle.py(), mcParticle.pz())); + MC.fill(HIST("MC/tracks/all/hPhi"), phi(mcParticle.px(), mcParticle.py())); + if (!mcParticle.isPhysicalPrimary() || std::abs(mcParticle.pdgCode()) != 211) continue; cutMcParticles.push_back(mcParticle); TLorentzVector pion4Vec; pion4Vec.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); mcParticles4Vecs.push_back(pion4Vec); } - MC.fill(HIST("MC/QC/hNPions"), cutMcParticles.size()); + MC.fill(HIST("MC/collisions/hNPions"), cutMcParticles.size()); - if (mcParticles4Vecs.size() != 2 || cutMcParticles.size() != 2) + if (mcParticles4Vecs.size() != cutMcParticles.size()) return; - if (cutMcParticles[0].pdgCode() * cutMcParticles[1].pdgCode() > 0) // unlike-sign + if (tracksTotalChargeMC(cutMcParticles) != 0) // shouldn't happen in theory return; - TLorentzVector system = mcParticles4Vecs[0] + mcParticles4Vecs[1]; + TLorentzVector system = reconstructSystem(mcParticles4Vecs); double mass = system.M(); double pT = system.Pt(); double pTsquare = pT * pT; double rapidity = system.Rapidity(); - double phiRandom = getPhiRandom(mcParticles4Vecs); - double phiCharge = getPhiChargeMC(cutMcParticles, mcParticles4Vecs); + double systemPhi = system.Phi() + o2::constants::math::PI; + + if (do4pi && cutMcParticles.size() == 4) { + for (int i = 0; i < static_cast(cutMcParticles.size()); i++) { + FourPiQA.fill(HIST("FourPiQA/MC/tracks/hPt"), pt(cutMcParticles[i].px(), cutMcParticles[i].py())); + FourPiQA.fill(HIST("FourPiQA/MC/tracks/hEta"), eta(cutMcParticles[i].px(), cutMcParticles[i].py(), cutMcParticles[i].pz())); + FourPiQA.fill(HIST("FourPiQA/MC/tracks/hPhi"), phi(cutMcParticles[i].px(), cutMcParticles[i].py())); + } + FourPiQA.fill(HIST("FourPiQA/MC/system/hM"), mass); + FourPiQA.fill(HIST("FourPiQA/MC/system/hPt"), pT); + FourPiQA.fill(HIST("FourPiQA/MC/system/hY"), rapidity); + FourPiQA.fill(HIST("FourPiQA/MC/system/hPhi"), systemPhi); + } - if (std::abs(rapidity) > systemYCut) + if (cutMcParticles.size() != 2) return; + auto leadingMomentumPion = momentum(cutMcParticles[0].px(), cutMcParticles[0].py(), cutMcParticles[0].pz()) > momentum(cutMcParticles[1].px(), cutMcParticles[1].py(), cutMcParticles[1].pz()) ? cutMcParticles[0] : cutMcParticles[1]; + auto subleadingMomentumPion = (leadingMomentumPion == cutMcParticles[0]) ? cutMcParticles[1] : cutMcParticles[0]; + MC.fill(HIST("MC/tracks/pions/hPt"), pt(leadingMomentumPion.px(), leadingMomentumPion.py()), pt(subleadingMomentumPion.px(), subleadingMomentumPion.py())); + MC.fill(HIST("MC/tracks/pions/hEta"), eta(leadingMomentumPion.px(), leadingMomentumPion.py(), leadingMomentumPion.pz()), eta(subleadingMomentumPion.px(), subleadingMomentumPion.py(), subleadingMomentumPion.pz())); + MC.fill(HIST("MC/tracks/pions/hPhi"), phi(leadingMomentumPion.px(), leadingMomentumPion.py()), phi(subleadingMomentumPion.px(), subleadingMomentumPion.py())); + + double phiRandom = getPhiRandom(mcParticles4Vecs); + double phiCharge = getPhiChargeMC(cutMcParticles, mcParticles4Vecs); + MC.fill(HIST("MC/system/hM"), mass); MC.fill(HIST("MC/system/hPt"), pT); MC.fill(HIST("MC/system/hPtVsM"), mass, pT); MC.fill(HIST("MC/system/hPt2"), pTsquare); MC.fill(HIST("MC/system/hY"), rapidity); + MC.fill(HIST("MC/system/hPhi"), systemPhi); MC.fill(HIST("MC/system/hPhiRandom"), phiRandom); MC.fill(HIST("MC/system/hPhiCharge"), phiCharge); } From fdf97f7158f4531c0905f3810031216012107c8d Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 4 Dec 2024 09:25:16 +0100 Subject: [PATCH 38/91] [PWGLF] ebyeMult: get trigger efficiency + improve gen particle cuts (#8805) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 257 +++++++++++++++++++++----------- 1 file changed, 170 insertions(+), 87 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 66231c71549..42a316319de 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -9,8 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include +/// \file ebyeMult.cxx +/// \brief task to carry out multiplicity measurements for lf ebye analyses +/// \author Mario Ciacco + +#include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -28,7 +33,6 @@ #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" -#include "TDatabasePDG.h" #include "TFormula.h" using namespace o2; @@ -64,7 +68,7 @@ struct CandidateEvent { int nTklRec = -1; }; -struct tagRun2V0MCalibration { +struct TagRun2V0MCalibration { bool mCalibrationStored = false; TH1* mhVtxAmpCorrV0A = nullptr; TH1* mhVtxAmpCorrV0C = nullptr; @@ -85,30 +89,30 @@ enum PartTypes { kOther = 8 }; -struct ebyeMult { +struct EbyeMult { std::vector candidateTracks; Service ccdb; CandidateEvent candidateEvent; int mRunNumber; - float d_bz; + float dBz; uint8_t nTrackletsColl; ConfigurableAxis centAxis{"centAxis", {106, 0, 106}, "binning for the centrality"}; - ConfigurableAxis zVtxAxis{"zVtxBins", {100, -20.f, 20.f}, "Binning for the vertex z in cm"}; - ConfigurableAxis multAxis{"multAxis", {100, 0, 10000}, "Binning for the multiplicity axis"}; - ConfigurableAxis multFt0Axis{"multFt0Axis", {100, 0, 100000}, "Binning for the ft0 multiplicity axis"}; - Configurable genName{"genname", "", "Genearator name: HIJING, PYTHIA8, ... Default: \"\""}; + ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Binning for the vertex z in cm"}; + ConfigurableAxis multAxis{"multAxis", {100, 0.f, 100.f}, "Binning for the multiplicity axis"}; + ConfigurableAxis multFt0Axis{"multFt0Axis", {100, 0.f, 100.f}, "Binning for the ft0 multiplicity axis"}; + Configurable genName{"genName", "", "Genearator name: HIJING, PYTHIA8, ... Default: \"\""}; Configurable zVtxMax{"zVtxMax", 10.0f, "maximum z position of the primary vertex"}; Configurable etaMax{"etaMax", 0.8f, "maximum eta"}; - Configurable ptMin{"ptMin", 0.4f, "minimum pT (GeV/c)"}; - Configurable ptMax{"ptMax", 4.f, "maximum pT (GeV/c)"}; + Configurable ptMin{"ptMin", 0.05f, "minimum pT (GeV/c)"}; + Configurable ptMax{"ptMax", 10.f, "maximum pT (GeV/c)"}; Configurable trackNcrossedRows{"trackNcrossedRows", 70, "Minimum number of crossed TPC rows"}; - Configurable trackNclusItsCut{"trackNclusITScut", 2, "Minimum number of ITS clusters"}; - Configurable trackNclusTpcCut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"}; + Configurable trackNclusITScut{"trackNclusITScut", 2, "Minimum number of ITS clusters"}; + Configurable trackNclusTPCcut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"}; Configurable trackChi2Cut{"trackChi2Cut", 4.f, "Maximum chi2/ncls in TPC"}; Configurable> cfgDcaSels{"cfgDcaSels", {dcaSels, 1, 3, particleName, dcaSelsNames}, "DCA selections"}; @@ -153,8 +157,8 @@ struct ebyeMult { if (!(track.itsClusterMap() & 0x01) && !(track.itsClusterMap() & 0x02)) { return false; } - if (track.itsNCls() < trackNclusItsCut || - track.tpcNClsFound() < trackNclusTpcCut || + if (track.itsNCls() < trackNclusITScut || + track.tpcNClsFound() < trackNclusTPCcut || track.tpcNClsCrossedRows() < trackNcrossedRows || track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable() || track.tpcChi2NCl() > trackChi2Cut || @@ -224,46 +228,46 @@ struct ebyeMult { o2::base::Propagator::initFieldFromGRP(grpmag); } // Fetch magnetic field from ccdb for current collision - d_bz = o2::base::Propagator::Instance()->getNominalBz(); - LOG(info) << "Retrieved GRP for timestamp " << timestamp << " with magnetic field of " << d_bz << " kG"; + dBz = o2::base::Propagator::Instance()->getNominalBz(); + LOG(info) << "Retrieved GRP for timestamp " << timestamp << " with magnetic field of " << dBz << " kG"; mRunNumber = bc.runNumber(); } - // float getV0M(int64_t const id, float const zvtx, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs) - // { - // auto fv0a = fv0as.rawIteratorAt(id); - // auto fv0c = fv0cs.rawIteratorAt(id); - // float multFV0A = 0; - // float multFV0C = 0; - // for (float amplitude : fv0a.amplitude()) { - // multFV0A += amplitude; - // } - - // for (float amplitude : fv0c.amplitude()) { - // multFV0C += amplitude; - // } - - // float v0m = -1; - // auto scaleMC = [](float x, float pars[6]) { - // return pow(((pars[0] + pars[1] * pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); - // }; - - // if (Run2V0MInfo.mMCScale != nullptr) { - // float multFV0M = multFV0A + multFV0C; - // v0m = scaleMC(multFV0M, Run2V0MInfo.mMCScalePars); - // LOGF(debug, "Unscaled v0m: %f, scaled v0m: %f", multFV0M, v0m); - // } else { - // v0m = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(zvtx)) + - // multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(zvtx)); - // } - // return v0m; - // } + float getV0M(int64_t const id, float const zvtx, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs) + { + auto fv0a = fv0as.rawIteratorAt(id); + auto fv0c = fv0cs.rawIteratorAt(id); + float multFV0A = 0; + float multFV0C = 0; + for (float const& amplitude : fv0a.amplitude()) { + multFV0A += amplitude; + } + + for (float const& amplitude : fv0c.amplitude()) { + multFV0C += amplitude; + } + + float v0m = -1; + auto scaleMC = [](float x, float pars[6]) { + return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); + }; + + if (Run2V0MInfo.mMCScale != nullptr) { + float multFV0M = multFV0A + multFV0C; + v0m = scaleMC(multFV0M, Run2V0MInfo.mMCScalePars); + LOGF(debug, "Unscaled v0m: %f, scaled v0m: %f", multFV0M, v0m); + } else { + v0m = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(zvtx)) + + multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(zvtx)); + } + return v0m; + } void init(o2::framework::InitContext&) { mRunNumber = 0; - d_bz = 0; + dBz = 0; ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -275,33 +279,52 @@ struct ebyeMult { histos.add("QA/V0MvsCL0", ";Centrality CL0 (%);Centrality V0M (%)", HistType::kTH2F, {centAxis, centAxis}); histos.add("QA/trackletsVsV0M", ";Centrality CL0 (%);Centrality V0M (%)", HistType::kTH2F, {centAxis, multAxis}); histos.add("QA/nTrklCorrelation", ";Tracklets |#eta| > 0.7; Tracklets |#eta| < 0.6", HistType::kTH2D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("QA/nV0MCorrelation", ";V0M Multiplicity (%); Tracklets |#eta| < 0.6", HistType::kTH2D, {multAxis, {201, -0.5, 200.5}}); histos.add("QA/TrklEta", ";Tracklets #eta; Entries", HistType::kTH1D, {{100, -3., 3.}}); // rec tracks histos.add("RecTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("RecTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); // rec tracks and tracklets distribution histos.add("TracksDistr", ";Tracklets |#eta| > 0.7;#it{N}_{trk}", HistType::kTH2D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}}); histos.add("TrackletsDistr", ";Tracklets |#eta| > 0.7;#it{N}_{tkl}", HistType::kTH2D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("TracksDistrV0M", ";V0M Multiplicity (%);#it{N}_{trk}", HistType::kTH2D, {multAxis, {201, -0.5, 200.5}}); + histos.add("TrackletsDistrV0M", ";V0M Multiplicity (%);#it{N}_{tkl}", HistType::kTH2D, {multAxis, {201, -0.5, 200.5}}); + if (doprocessMcRun2) { // rec & gen particles (per species) histos.add("RecPart", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {10, 0, 10}}); histos.add("GenPart", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {10, 0, 10}}); + histos.add("RecPartV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {multAxis, {100, -5., 5.}, {10, 0, 10}}); + histos.add("GenPartV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {multAxis, {100, -5., 5.}, {10, 0, 10}}); + // dca_xy templates histos.add("PrimTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); histos.add("SecWDTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); histos.add("SecTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("PrimTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("SecWDTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("SecTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); + // response - histos.add("GenRecTracks", ";Tracklets |#eta| > 0.7#it;#it{N}_{trk};#it{N}_{gen}", HistType::kTH3D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("GenRecTracks", ";Tracklets |#eta| > 0.7;#it{N}_{trk};#it{N}_{gen}", HistType::kTH3D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); histos.add("GenRecTracklets", ";Tracklets |#eta| > 0.7;#it{N}_{tkl};#it{N}_{gen}", HistType::kTH3D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); + + histos.add("GenRecTracksV0M", ";V0M Multiplicity (%);#it{N}_{trk};#it{N}_{gen}", HistType::kTH3D, {multAxis, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("GenRecTrackletsV0M", ";V0M Multiplicity (%);#it{N}_{tkl};#it{N}_{gen}", HistType::kTH3D, {multAxis, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); } + + // histograms for the evaluation of trigger efficiency + histos.add("GenINELgtZERO", ";#it{N}_{gen}", HistType::kTH1D, {multAxis}); + histos.add("RecINELgtZERO", ";#it{N}_{gen}", HistType::kTH1D, {multAxis}); } template - void fillRecoEvent(C const& collision, T const& tracksAll /* , float const& centrality */) + void fillRecoEvent(C const& collision, T const& tracksAll, float const& centrality) { auto tracks = tracksAll.sliceBy(perCollisionTracksFull, collision.globalIndex()); candidateTracks.clear(); @@ -336,6 +359,8 @@ struct ebyeMult { CandidateTrack candTrack; candTrack.pt = track.sign() > 0. ? trackPt : -trackPt; + if (trackPt < ptMin || trackPt > ptMax) + continue; candTrack.eta = trackEta; candTrack.dcapv = dca; candTrack.dcaxypv = dcaInfo[0]; @@ -343,79 +368,87 @@ struct ebyeMult { candTrack.globalIndex = track.globalIndex(); candidateTracks.push_back(candTrack); - if (std::abs(dcaInfo[0]) < cfgDcaSels->get("dcaxy")) { // dcaxy + if (std::abs(dcaInfo[0]) < cfgDcaSels->get("dcaxy")) { // dcaxy TODO: add pt dependent dcaxy cut ++nTracks; } } histos.fill(HIST("QA/nTrklCorrelation"), nTracklets[0], nTracklets[1]); + histos.fill(HIST("QA/nV0MCorrelation"), nTracklets[0], centrality); nTrackletsColl = nTracklets[1]; candidateEvent.nTklRec = nTracklets[0]; histos.fill(HIST("TracksDistr"), nTracklets[1], nTracks); histos.fill(HIST("TrackletsDistr"), nTracklets[1], nTracklets[0]); + histos.fill(HIST("TracksDistrV0M"), centrality, nTracks); + histos.fill(HIST("TrackletsDistrV0M"), centrality, nTracklets[0]); } template - void fillMcEvent(C const& collision, T const& tracks /* , float const& centrality */, aod::McParticles const&, aod::McTrackLabels const& mcLabels) + void fillMcEvent(C const& collision, T const& tracks, float const& centrality, aod::McParticles const&, aod::McTrackLabels const& mcLabels) { - fillRecoEvent(collision, tracks /* , centrality */); + fillRecoEvent(collision, tracks, centrality); int nTracks{0}; - for (auto& candidateTrack : candidateTracks) { - candidateTrack.isreco = true; + for (int iT{0}; iT < static_cast(candidateTracks.size()); ++iT) { + candidateTracks[iT].isreco = true; - auto mcLab = mcLabels.rawIteratorAt(candidateTrack.globalIndex); + auto mcLab = mcLabels.rawIteratorAt(candidateTracks[iT].globalIndex); if (mcLab.has_mcParticle()) { auto mcTrack = mcLab.template mcParticle_as(); if (((mcTrack.flags() & 0x8) && (doprocessMcRun2)) || (mcTrack.flags() & 0x2)) continue; if (!mcTrack.isPhysicalPrimary()) { if (mcTrack.has_mothers()) { // sec WD - histos.fill(HIST("SecWDTracks"), nTrackletsColl, candidateTrack.pt, candidateTrack.dcaxypv); + histos.fill(HIST("SecWDTracks"), nTrackletsColl, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); + histos.fill(HIST("SecWDTracksV0M"), centrality, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); } else { // from material - histos.fill(HIST("SecTracks"), nTrackletsColl, candidateTrack.pt, candidateTrack.dcaxypv); + histos.fill(HIST("SecTracks"), nTrackletsColl, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); + histos.fill(HIST("SecTracksV0M"), centrality, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); } } - if ((mcTrack.flags() & 0x1)) - continue; + if (std::abs(candidateTracks[iT].dcaxypv) > cfgDcaSels->get("dcaxy")) { // TODO: add pt dependent cut + ++nTracks; + } + if (mcTrack.isPhysicalPrimary()) { // primary - histos.fill(HIST("PrimTracks"), nTrackletsColl, candidateTrack.pt, candidateTrack.dcaxypv); + histos.fill(HIST("PrimTracks"), nTrackletsColl, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); + histos.fill(HIST("PrimTracksV0M"), centrality, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); } - if (std::abs(candidateTrack.dcaxypv) > cfgDcaSels->get("dcaxy")) + if (std::abs(candidateTracks[iT].dcaxypv) > cfgDcaSels->get("dcaxy")) continue; int partType = getPartType(mcTrack.pdgCode()); if (mcTrack.isPhysicalPrimary()) { // primary - histos.fill(HIST("RecPart"), nTrackletsColl, candidateTrack.pt, partType); - if (partType < PartTypes::kOther) { - ++nTracks; - } + histos.fill(HIST("RecPart"), nTrackletsColl, candidateTracks[iT].pt, partType); + histos.fill(HIST("RecPartV0M"), centrality, candidateTracks[iT].pt, partType); } auto genPt = std::hypot(mcTrack.px(), mcTrack.py()); - candidateTrack.pdgcode = mcTrack.pdgCode(); - candidateTrack.genpt = genPt; - candidateTrack.geneta = mcTrack.eta(); - candidateTrack.mcIndex = mcTrack.globalIndex(); + candidateTracks[iT].pdgcode = mcTrack.pdgCode(); + candidateTracks[iT].genpt = genPt; + candidateTracks[iT].geneta = mcTrack.eta(); + candidateTracks[iT].mcIndex = mcTrack.globalIndex(); } } candidateEvent.nTrkRec = nTracks; } - void fillMcGen(aod::McParticles const& mcParticles, aod::McTrackLabels const& /*mcLab*/, uint64_t const& collisionId) + void fillMcGen(aod::McParticles const& mcParticles, aod::McTrackLabels const& /*mcLab*/, uint64_t const& collisionId, float const& centrality) { int nParticles = 0; - auto mcParticles_thisCollision = mcParticles.sliceBy(perCollisionMcParts, collisionId); - for (auto& mcPart : mcParticles_thisCollision) { + auto mcParticlesThisCollision = mcParticles.sliceBy(perCollisionMcParts, collisionId); + for (auto const& mcPart : mcParticlesThisCollision) { auto genEta = mcPart.eta(); if (std::abs(genEta) > etaMax) { continue; } - if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2) || (mcPart.flags() & 0x1)) + if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2)) continue; if (!mcPart.isPhysicalPrimary() /* && !mcPart.has_mothers() */) continue; auto genPt = std::hypot(mcPart.px(), mcPart.py()); + if (genPt < ptMin || genPt > ptMax) + continue; CandidateTrack candTrack; candTrack.genpt = genPt; candTrack.geneta = mcPart.eta(); @@ -426,6 +459,7 @@ struct ebyeMult { ++nParticles; } histos.fill(HIST("GenPart"), nTrackletsColl, mcPart.pdgCode() > 0 ? genPt : -genPt, partType); + histos.fill(HIST("GenPartV0M"), centrality, mcPart.pdgCode() > 0 ? genPt : -genPt, partType); auto it = find_if(candidateTracks.begin(), candidateTracks.end(), [&](CandidateTrack trk) { return trk.mcIndex == mcPart.globalIndex(); }); if (it != candidateTracks.end()) { @@ -434,11 +468,45 @@ struct ebyeMult { candidateTracks.emplace_back(candTrack); } } + histos.fill(HIST("RecINELgtZERO"), nParticles); histos.fill(HIST("GenRecTracks"), nTrackletsColl, candidateEvent.nTrkRec, nParticles); histos.fill(HIST("GenRecTracklets"), nTrackletsColl, candidateEvent.nTklRec, nParticles); + histos.fill(HIST("GenRecTracksV0M"), centrality, candidateEvent.nTrkRec, nParticles); + histos.fill(HIST("GenRecTrackletsV0M"), centrality, candidateEvent.nTklRec, nParticles); } - void processRun2(soa::Join const& collisions, TracksFull const& tracks /* , aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs */, BCsWithRun2Info const&) + template + int genMultINELgtZERO(C const& collision, P const& particles) + { + if (std::abs(collision.posZ()) > zVtxMax) + return -1; + + int nParticles = 0; + int partInAcc = 0; + auto particlesThisCollision = particles.sliceBy(perCollisionMcParts, collision.globalIndex()); + for (auto const& particle : particlesThisCollision) { + if (((particle.flags() & 0x8) && (doprocessMcRun2)) || (particle.flags() & 0x2)) + continue; + if (!particle.isPhysicalPrimary() /* && !particle.has_mothers() */) + continue; + auto pt = std::hypot(particle.px(), particle.py()); + if (pt < ptMin || pt > ptMax) + continue; + + int partType = getPartType(particle.pdgCode()); + if (partType < PartTypes::kOther) { + ++nParticles; + if (std::abs(particle.eta()) < 1.f) { + ++partInAcc; + } + } + } + if (partInAcc > 0) + return nParticles; + return -1; + } + + void processRun2(soa::Join const& collisions, TracksFull const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, BCsWithRun2Info const&) { for (const auto& collision : collisions) { @@ -454,24 +522,28 @@ struct ebyeMult { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) continue; - // float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - // float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kINELgtZERO))) + continue; + + float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); + float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); histos.fill(HIST("QA/zVtx"), collision.posZ()); - fillRecoEvent(collision, tracks /* , cV0M */); + fillRecoEvent(collision, tracks, cV0M); - for (auto t : candidateTracks) { + for (auto const& t : candidateTracks) { histos.fill(HIST("RecTracks"), nTrackletsColl, t.pt, t.dcaxypv); + histos.fill(HIST("RecTracksV0M"), cV0M, t.pt, t.dcaxypv); } } } - PROCESS_SWITCH(ebyeMult, processRun2, "process (Run 2)", false); + PROCESS_SWITCH(EbyeMult, processRun2, "process (Run 2)", false); - void processMcRun2(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFull const& tracks /* , aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs */, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) + void processMcRun2(soa::Join const& collisions, aod::McCollisions const& mcCollisions, TracksFull const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) { - for (const auto& collision : collisions) { + for (const auto& collision : collisions) { // TODO: fill numerator for trigger efficiency auto bc = collision.bc_as(); initCCDB(bc); @@ -481,20 +553,31 @@ struct ebyeMult { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) continue; - // float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - // float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kINELgtZERO))) + continue; + + float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); + float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); histos.fill(HIST("QA/zVtx"), collision.posZ()); - fillMcEvent(collision, tracks /* , cV0M */, mcParticles, mcLab); - fillMcGen(mcParticles, mcLab, collision.mcCollisionId()); + fillMcEvent(collision, tracks, cV0M, mcParticles, mcLab); + fillMcGen(mcParticles, mcLab, collision.mcCollisionId(), cV0M); + } + + // search generated INEL > 0 (one charged particle in |eta| < 1) + for (const auto& mcCollision : mcCollisions) { + int mult = genMultINELgtZERO(mcCollision, mcParticles) > 0; + if (mult > 0) { + histos.fill(HIST("GenINELgtZERO"), mult); + } } } - PROCESS_SWITCH(ebyeMult, processMcRun2, "process mc (Run 2)", false); + PROCESS_SWITCH(EbyeMult, processMcRun2, "process mc (Run 2)", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From 1c9a314c9f071a69be4f07b54e9fd9c115ec4edc Mon Sep 17 00:00:00 2001 From: mhartung71 <50153519+mhartung71@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:25:41 +0100 Subject: [PATCH 39/91] [PWGLF] Fix unbound indices in KF hypernuclei code (#8803) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFHypernucleiKfTables.h | 50 +++++++++---------- PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx | 10 ++-- .../TableProducer/Nuspex/hypKfTreeCreator.cxx | 20 ++++---- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/PWGLF/DataModel/LFHypernucleiKfTables.h b/PWGLF/DataModel/LFHypernucleiKfTables.h index ed50e56b17f..328ab07f6b3 100644 --- a/PWGLF/DataModel/LFHypernucleiKfTables.h +++ b/PWGLF/DataModel/LFHypernucleiKfTables.h @@ -24,17 +24,17 @@ namespace hykfmcColl { DECLARE_SOA_COLUMN(PassedEvSel, passedEvSel, bool); //! } -DECLARE_SOA_TABLE(HypKfMcCollisions, "AOD", "HYPKFMCCOLL", +DECLARE_SOA_TABLE(HypKfMcColls, "AOD", "HYPKFMCCOLL", o2::soa::Index<>, hykfmcColl::PassedEvSel, mccollision::PosX, mccollision::PosY, mccollision::PosZ); -using HypKfMcCollision = HypKfMcCollisions::iterator; +using HypKfMcColl = HypKfMcColls::iterator; namespace hykfmc { -DECLARE_SOA_INDEX_COLUMN(HypKfMcCollision, hypKfMcCollision); +DECLARE_SOA_INDEX_COLUMN(HypKfMcColl, hypKfMcColl); DECLARE_SOA_COLUMN(Species, species, int8_t); //! DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! DECLARE_SOA_COLUMN(Svx, svx, float); //! @@ -46,9 +46,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0; }); } // namespace hykfmc -DECLARE_SOA_TABLE(HypKfMcParticles, "AOD", "HYPKFMCPART", +DECLARE_SOA_TABLE(HypKfMcParts, "AOD", "HYPKFMCPART", o2::soa::Index<>, - hykfmc::HypKfMcCollisionId, + hykfmc::HypKfMcCollId, hykfmc::Species, mcparticle::PdgCode, hykfmc::IsPhysicalPrimary, @@ -63,23 +63,23 @@ DECLARE_SOA_TABLE(HypKfMcParticles, "AOD", "HYPKFMCPART", hykfmc::Y, hykfmc::Mass, hykfmc::IsMatter); -using HypKfMcParticle = HypKfMcParticles::iterator; +using HypKfMcPart = HypKfMcParts::iterator; -DECLARE_SOA_TABLE(HypKfCollisions, "AOD", "HYPKFCOLL", +DECLARE_SOA_TABLE(HypKfColls, "AOD", "HYPKFCOLL", o2::soa::Index<>, hykfmcColl::PassedEvSel, - hykfmc::HypKfMcCollisionId, + hykfmc::HypKfMcCollId, collision::PosX, collision::PosY, collision::PosZ, cent::CentFT0A, cent::CentFT0C, cent::CentFT0M); -using HypKfCollision = HypKfCollisions::iterator; +using HypKfColl = HypKfColls::iterator; namespace hykftrk { -DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision); +DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl); DECLARE_SOA_COLUMN(Rigidity, rigidity, float); //! DECLARE_SOA_COLUMN(TPCnCluster, tpcNcluster, float); //! DECLARE_SOA_COLUMN(TPCnSigma, tpcNsigma, float); //! @@ -149,12 +149,12 @@ DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK", hykftrk::ITSmeanClsSize); using HypKfTrack = HypKfTracks::iterator; -DECLARE_SOA_TABLE(HypKfSubDaughters, "AOD", "HYPKFSUBD", +DECLARE_SOA_TABLE(HypKfSubDs, "AOD", "HYPKFSUBD", o2::soa::Index<>, hykftrk::SubMass); -using HypKfSubDaughter = HypKfSubDaughters::iterator; +using HypKfSubD = HypKfSubDs::iterator; -DECLARE_SOA_TABLE(HypKfDaughterAddons, "AOD", "HYPKFDADD", +DECLARE_SOA_TABLE(HypKfDaughtAdds, "AOD", "HYPKFDAUGHTADD", o2::soa::Index<>, track::X, track::Y, @@ -162,16 +162,16 @@ DECLARE_SOA_TABLE(HypKfDaughterAddons, "AOD", "HYPKFDADD", mcparticle::Px, mcparticle::Py, mcparticle::Pz); -using HypKfDaughterAddon = HypKfDaughterAddons::iterator; +using HypKfDaughtAdd = HypKfDaughtAdds::iterator; namespace hykfhyp { -DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision); -DECLARE_SOA_INDEX_COLUMN(HypKfMcParticle, hypKfMcParticle); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughterAddon, addons); +DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl); +DECLARE_SOA_INDEX_COLUMN(HypKfMcPart, hypKfMcPart); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughtAdd, addons); DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, daughterTracks); -DECLARE_SOA_SELF_INDEX_COLUMN(HypDaughter, hypDaughter); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubDaughter, subDaughters); +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(HypDaughter, hypDaughter, int, "HypKfHypNucs"); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubD, subDaughters); DECLARE_SOA_COLUMN(Primary, primary, bool); //! DECLARE_SOA_COLUMN(Mass, mass, float); //! DECLARE_SOA_COLUMN(Px, px, float); //! @@ -188,19 +188,19 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) { return R DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) { return RecoDecay::phi(std::array{px, py}); }); DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) { return RecoDecay::p(px, py, pz); }); // DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float px, float py, float pz, float mass) { return RecoDecay::y(std::array{px, py, pz}, mass); }); -DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcParticleId) { return hypKfMcParticleId > 0; }); +DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcPartId) { return hypKfMcPartId > 0; }); DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int8_t species) { return species > 0; }); DECLARE_SOA_DYNAMIC_COLUMN(Cascade, cascade, [](int hypDaughter) { return hypDaughter > 0; }); } // namespace hykfhyp DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC", o2::soa::Index<>, - hykfhyp::HypKfMcParticleId, - hykfhyp::HypKfCollisionId, + hykfhyp::HypKfMcPartId, + hykfhyp::HypKfCollId, hykfhyp::HypKfTrackIds, - hykfhyp::HypKfDaughterAddonIds, + hykfhyp::HypKfDaughtAddIds, hykfhyp::HypDaughterId, - hykfhyp::HypKfSubDaughterIds, + hykfhyp::HypKfSubDIds, hykfmc::Species, hykfhyp::Primary, hykfhyp::Mass, @@ -221,7 +221,7 @@ DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC", hykfhyp::Eta, hykfhyp::Phi, hykfhyp::P, - hykfhyp::McTrue, + hykfhyp::McTrue, hykfhyp::IsMatter, hykfhyp::Cascade); using HypKfHypNuc = HypKfHypNucs::iterator; diff --git a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx index a1c4e21a9a7..353459c835b 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx @@ -405,12 +405,12 @@ std::vector> hInvMass; //---------------------------------------------------------------------------------------------------------------- struct hypKfRecoTask { - Produces outputMcCollisionTable; - Produces outputMcParticleTable; - Produces outputCollisionTable; + Produces outputMcCollisionTable; + Produces outputMcParticleTable; + Produces outputCollisionTable; Produces outputTrackTable; - Produces outputDaughterAddonTable; - Produces outputSubDaughterTable; + Produces outputDaughterAddonTable; + Produces outputSubDaughterTable; Produces outputHypNucTable; Preslice perCollision = aod::track_association::collisionId; diff --git a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx index 5666a06efc2..bba41fdfeac 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx @@ -329,7 +329,7 @@ struct hypKfTreeCreator { Produces outputTableMcTwoThree; Produces outputTableThreeTwo; Produces outputTableMcThreeTwo; - PresliceUnsorted perMcParticle = aod::hykfhyp::hypKfMcParticleId; + PresliceUnsorted perMcParticle = aod::hykfhyp::hypKfMcPartId; Configurable cfgSpecies{"cfgSpecies", 0, "Select species"}; Configurable cfgNprimDaughters{"cfgNprimDaughters", 0, "Number of primary daughters"}; @@ -354,7 +354,7 @@ struct hypKfTreeCreator { } //___________________________________________________________________________________________________________________________________________________________ - void processData(aod::HypKfHypNucs const& hypNucs, aod::HypKfCollisions const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughterAddons const& hypKfDAdd, aod::HypKfSubDaughters const& hypKfDSub) + void processData(aod::HypKfHypNucs const& hypNucs, aod::HypKfColls const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughtAdds const& hypKfDAdd, aod::HypKfSubDs const& hypKfDSub) { for (auto& hypNuc : hypNucs) { if (std::abs(hypNuc.species()) != cfgSpecies) @@ -514,12 +514,12 @@ struct hypKfTreeCreator { } //___________________________________________________________________________________________________________________________________________________________ - void fillCandidate(hyperNucleus& cand, hyperNucleus& hypDaughter, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfCollisions const&, aod::HypKfTracks const&, aod::HypKfDaughterAddons const&, aod::HypKfSubDaughters const&) + void fillCandidate(hyperNucleus& cand, hyperNucleus& hypDaughter, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfColls const&, aod::HypKfTracks const&, aod::HypKfDaughtAdds const&, aod::HypKfSubDs const&) { cand.daughterTracks.clear(); cand.subDaughterMassVec.clear(); - auto coll = hypNuc.hypKfCollision(); - auto addOns = hypNuc.addons_as(); + auto coll = hypNuc.hypKfColl(); + auto addOns = hypNuc.addons_as(); auto posVec = posVector(addOns); cand.Species = std::abs(hypNuc.species()); cand.IsMatter = hypNuc.isMatter(); @@ -584,20 +584,20 @@ struct hypKfTreeCreator { return; trackCount = 0; - auto subDaughters = hypNuc.subDaughters_as(); + auto subDaughters = hypNuc.subDaughters_as(); for (auto& subDaughter : subDaughters) { cand.daughterTracks.at(trackCount++).SubMass = subDaughter.subMass(); } } //___________________________________________________________________________________________________________________________________________________________ - void processMC(aod::HypKfMcParticles const& mcHypNucs, aod::HypKfHypNucs const& hypNucs, aod::HypKfMcCollisions const&, aod::HypKfCollisions const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughterAddons const& hypKfDAdd, aod::HypKfSubDaughters const& hypKfDSub) + void processMC(aod::HypKfMcParts const& mcHypNucs, aod::HypKfHypNucs const& hypNucs, aod::HypKfMcColls const&, aod::HypKfColls const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughtAdds const& hypKfDAdd, aod::HypKfSubDs const& hypKfDSub) { isMC = true; for (auto& mcHypNuc : mcHypNucs) { if (std::abs(mcHypNuc.species()) != cfgSpecies) continue; - auto mcColl = mcHypNuc.hypKfMcCollision(); + auto mcColl = mcHypNuc.hypKfMcColl(); const auto mcParticleIdx = mcHypNuc.globalIndex(); auto hypNucsByMc = hypNucs.sliceBy(perMcParticle, mcParticleIdx); hyperNucleus candidate, hypDaughter, dummy; @@ -620,8 +620,8 @@ struct hypKfTreeCreator { candidate.SvyGen = mcHypNuc.svy(); candidate.SvzGen = mcHypNuc.svz(); for (auto& hypNuc : hypNucsByMc) { - auto coll = hypNuc.hypKfCollision(); - if (coll.hypKfMcCollisionId() == mcHypNuc.hypKfMcCollisionId()) { + auto coll = hypNuc.hypKfColl(); + if (coll.hypKfMcCollId() == mcHypNuc.hypKfMcCollId()) { candidate.CollisionMcTrue = true; } candidate.IsReconstructed++; From 8d74e06e719e908f9fed1254ebc0c2b770d87aaa Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Wed, 4 Dec 2024 09:48:27 +0100 Subject: [PATCH 40/91] [PWGCF] DptDpt Efficiency an QC, configurable nsigma axes (#8808) Co-authored-by: Victor --- .../Tasks/dptDptEfficiencyAndQc.cxx | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index 890a2c78fdc..b902057451a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -74,6 +74,12 @@ enum BeforeAfter { kAfter ///< filling after track selection }; +/* the configuration of the nsigma axis */ +float minNSigma = -4.05f; +float maxNSigma = 4.05f; +float widthNSigmaBin = 0.1f; +int noOfNSigmaBins = static_cast((maxNSigma - minNSigma) / widthNSigmaBin); + /* the PID selector object to help with the configuration and the id of the selected particles */ o2::analysis::dptdptfilter::PIDSpeciesSelection pidselector; @@ -487,17 +493,17 @@ struct PidDataCollectingEngine { fhTPCTOFSigmaVsP[ix][isp] = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), HNAMESTRING("toftpcNSigmasVsP%c_%s", whenprefix[ix], mainspnames[isp].c_str()), HTITLESTRING("n#sigma to the %s line %s", mainsptitles[isp].c_str(), whentitle[ix].c_str()), - kTH3F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].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", whenprefix[ix], allmainspnames[isp].c_str()), HTITLESTRING("TPC n#sigma to the %s line %s", allmainsptitles[isp].c_str(), whentitle[ix].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TPC}^{%s}", allmainsptitles[isp].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", whenprefix[ix], allmainspnames[isp].c_str()), HTITLESTRING("TOF n#sigma to the %s line %s", allmainsptitles[isp].c_str(), whentitle[ix].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", allmainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TOF}^{%s}", allmainsptitles[isp].c_str())}}); } } } @@ -625,11 +631,11 @@ struct PidExtraDataCollectingEngine { 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()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}}); fhIdTOFnSigmasVsP[isp][imainsp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", "Selected"), HNAMESTRING("tofNSigmasVsPSelected_%s_to%s", tnames[isp].c_str(), allmainspnames[imainsp].c_str()), HTITLESTRING("TOF n#sigma for selected %s to the %s line", tnames[isp].c_str(), allmainsptitles[imainsp].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); } } } @@ -732,6 +738,9 @@ struct DptDptEfficiencyAndQc { Configurable useCentrality{"useCentrality", false, "Perform the task using centrality/multiplicity classes. Default value: false"}; Configurable useTPCInnerWallMomentum{"useTPCInnerWallMomentum", false, "Use the TPC inner wall momentum. Default: false"}; + Configurable cfgMinNSigma{"cfgMinNSigma", -4.05f, "nsigma axes lowest value. Default: -4.05"}; + Configurable cfgMaxNSigma{"cfgMaxNSigma", 4.05f, "nsigma axes highest value. Default: 4.05"}; + Configurable cfgWidthNSigmaBin{"cfgWidthNSigmaBin", 0.1, "nsigma axes bin width. Deafault: 0.1"}; void init(o2::framework::InitContext& initContext) { @@ -822,6 +831,12 @@ struct DptDptEfficiencyAndQc { fCentMultMin[0] = 0.0f; fCentMultMax[0] = 100.0f; } + /* configure nsigma axes */ + minNSigma = cfgMinNSigma.value; + maxNSigma = cfgMaxNSigma.value; + widthNSigmaBin = cfgWidthNSigmaBin.value; + noOfNSigmaBins = static_cast((maxNSigma - minNSigma) / widthNSigmaBin); + bool doBasicAnalysis = doprocessDetectorLevelNotStored || doprocessReconstructedNotStored; bool doPidAnalysis = doprocessDetectorLevelNotStoredPID || doprocessReconstructedNotStoredPID; bool doPidExtraAnalysis = doprocessDetectorLevelNotStoredPIDExtra || doprocessReconstructedNotStoredPIDExtra; From 43834f10718abcacc424afede4322413897ff61c Mon Sep 17 00:00:00 2001 From: m-rasa <99010072+m-rasa@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:07:41 +0100 Subject: [PATCH 41/91] [PWGLF] Adding cut for selecting antitriton for tree saving (#8678) --- PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index 34429b2c053..c0c4de3c8c1 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -707,8 +707,10 @@ struct nucleiSpectra { collision.multTPC()}); } if (fillTree) { - if (track.pt() < cfgCutPtMinTree || track.pt() > cfgCutPtMaxTree) - continue; + if (flag & BIT(2)) { + if (track.pt() < cfgCutPtMinTree || track.pt() > cfgCutPtMaxTree || track.sign() > 0) + continue; + } } nuclei::candidates.emplace_back(NucleusCandidate{ static_cast(track.globalIndex()), static_cast(track.collisionId()), (1 - 2 * iC) * mTrackParCov.getPt(), mTrackParCov.getEta(), mTrackParCov.getPhi(), From f52c0a6e525a54dac94827e482d1b560f76b2ac9 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:26:18 +0100 Subject: [PATCH 42/91] [Infrastructure] Don't try to lint when no files are found (#8772) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- .github/workflows/o2-linter.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml index 3f124b56750..8e150e970fd 100644 --- a/.github/workflows/o2-linter.yml +++ b/.github/workflows/o2-linter.yml @@ -24,6 +24,10 @@ jobs: run: | # Diff against the common ancestor of the source branch and the main branch. readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...) + if [ ${#files[@]} -eq 0 ]; then + echo "::notice::No files to lint." + exit 0 + fi [ ${{ github.event_name }} == 'pull_request' ] && options="-g" # shellcheck disable=SC2086 # Ignore unquoted options. python3 Scripts/o2_linter.py $options "${files[@]}" From ce05c6fc8bbb386065406241d3383d2307521a52 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:28:28 +0100 Subject: [PATCH 43/91] =?UTF-8?q?[PWGDQ]=20Adding=20Tprofiles=20with=20Cum?= =?UTF-8?q?ulants=20weights=20+=20fixing=20Pi=20constant=20=E2=80=A6=20(#8?= =?UTF-8?q?813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGDQ/Core/HistogramsLibrary.cxx | 88 ++++++++++++-------------------- PWGDQ/Core/HistogramsLibrary.h | 1 + 2 files changed, 34 insertions(+), 55 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 5e9180c6a8a..92fbdd9fb3e 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,6 +13,7 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" #include "VarManager.h" +#include "CommonConstants/MathConstants.h" void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) { @@ -249,6 +250,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); @@ -354,8 +358,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (!groupStr.CompareTo("track")) { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("ambiguity") && !subGroupStr.Contains("muon")) { @@ -367,10 +371,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("cent")) { hm->AddHistogram(histClass, "Pt_CentFT0C", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt, 20, 0.0, 100.0, VarManager::kCentFT0C); hm->AddHistogram(histClass, "Eta_CentFT0C", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C); - hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); + hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); } if (subGroupStr.Contains("kine")) { - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "Eta_Pt", "", false, 20, -1.0, 1.0, VarManager::kEta, 100, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta_VtxZ", "", false, 100, -1.0, 1.0, VarManager::kEta, 300, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "Px", "p_{x} distribution", false, 200, 0.0, 20.0, VarManager::kPx); @@ -429,8 +433,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_vsTimeFromSOR", "Number of cluster in TPC vs time from SOR", true, 10000, 0.0, 1000., VarManager::kTimeFromSOR, 160, -0.5, 159.5, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "TPCncls_TPCnclsCR", "Number of TPC cluster vs Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "IsTPCrefit", "", false, 2, -0.5, 1.5, VarManager::kIsTPCrefit); @@ -743,14 +747,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCHBitMap_vs_pt", "MCH vs pt", false, 1025, 0.0, 1025.0, VarManager::kMCHBitMap, 400, 0, 100, VarManager::kPt); hm->AddHistogram(histClass, "MuonTime", "", false, 100, -1.0, 1.0, VarManager::kMuonTime); hm->AddHistogram(histClass, "MuonTimeRes", "", false, 100, -1.0, 1.0, VarManager::kMuonTimeRes); - hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); @@ -773,7 +777,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta); - hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kPhi, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); + hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 50, 0.0, o2::constants::math::TwoPI, VarManager::kMCPhi); hm->AddHistogram(histClass, "TrackPDGcode", "PDG code of track", false, 10001, -5000, 5000, VarManager::kMCPdgCode); } if (subGroupStr.Contains("mcmother")) { @@ -794,7 +798,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1); hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Eta_Pt_Photon", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPairPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPairPhi); hm->AddHistogram(histClass, "Mass_Dilepton", "", false, 4500, 0.0, 4.5, VarManager::kPairMassDau); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Photon", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); @@ -816,7 +820,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 5.0, VarManager::kMass); hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); @@ -861,12 +865,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("polarization")) { hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "PhiHE", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "PhiCS", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "PhiHE", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "PhiCS", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); @@ -1030,18 +1034,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_phiCS", "", 4, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); hm->AddHistogram(histClass, "Mass_y_cosThetaCS_phiCS", "", 4, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); } - if (subGroupStr.Contains("dimuon-polarization-vp")) { - int varspTCS[3] = {VarManager::kMass, VarManager::kPt, VarManager::kPhiVP}; - int varsrapCS[3] = {VarManager::kMass, VarManager::kRap, VarManager::kPhiVP}; - int binspT[3] = {100, 20, 24}; - int binsy[3] = {100, 10, 24}; - double xminpT[3] = {1., 0., 0.}; - double xmaxpT[3] = {5., 20., +3.14}; - double xminy[3] = {1., 2.5, 0.}; - double xmaxy[3] = {5., 4.0, +3.14}; - hm->AddHistogram(histClass, "Mass_Pt_phiVP", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); - hm->AddHistogram(histClass, "Mass_y_phiVP", "", 3, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); - } if (subGroupStr.Contains("dimuon-rap")) { int vars[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kRap}; int binspT[4] = {150, 200, 10, 6}; @@ -1077,20 +1069,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h double xmaxpT[5] = {1.2, 3., 100, 1., 3.14}; hm->AddHistogram(histClass, "Mass_Pt_Cent_cosThetaCS_lowmass", "", 5, varsCSpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); } - if (subGroupStr.Contains("dimuon-polarization-vp-pbpb")) { - int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; - int binspT[4] = {150, 30, 10, 24}; - double xminpT[4] = {2., 0., 0, 0.}; - double xmaxpT[4] = {5., 3., 100, 3.14}; - hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); - } - if (subGroupStr.Contains("dimuon-polarization-lowmass-vp-pbpb")) { - int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; - int binspT[4] = {200, 30, 10, 24}; - double xminpT[4] = {0.2, 0., 0, 0.}; - double xmaxpT[4] = {1.2, 3., 100, 3.14}; - hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP_lowmass", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); - } if (subGroupStr.Contains("dimuon-rap-polarization-he-pbpb")) { int varsHEpbpb[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kCosThetaHE, VarManager::kRap}; int binspT[5] = {150, 30, 10, 10, 6}; @@ -1222,19 +1200,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "DeltaPhiPair", "", false, 130, -6.5, 6.5, VarManager::kDeltaPhiPair); } if (subGroupStr.Contains("correlation-emu")) { - hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2); hm->AddHistogram(histClass, "DeltaEtaPair2", "", false, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); - hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); } if (subGroupStr.Contains("dielectrons")) { if (subGroupStr.Contains("prefilter")) { hm->AddHistogram(histClass, "MassLow_OpeningAngle", "", false, 150, 0., 0.15, VarManager::kMass, 80, 0., 0.8, VarManager::kOpeningAngle); } if (subGroupStr.Contains("phiv")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv); } if (subGroupStr.Contains("double-phi-v")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv, "", "", "", -1, -1, true); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv, "", "", "", -1, -1, true); } if (subGroupStr.Contains("largemass-phi-v")) { // binning for mee at large scales: @@ -1261,7 +1239,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h // steps of size pi/100 double phiv_bins[101]; for (int i = 0; i <= 100; i++) - phiv_bins[i] = TMath::Pi() / 100. * i; + phiv_bins[i] = o2::constants::math::PI / 100. * i; int nbins_phiv = sizeof(phiv_bins) / sizeof(*phiv_bins) - 1; // 3D histo @@ -1450,29 +1428,29 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.EqualTo("jpsitomumu")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("jpsitoee")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("dmeson")) { hm->AddHistogram(histClass, "hMassVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitomumudmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitoeedmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); } } if (!groupStr.CompareTo("dilepton-dihadron")) { @@ -1534,7 +1512,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt_Photon", "p_{T} distribution", false, 4500, 0.0, 4.5, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Eta_Pt", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 60fe4cc8714..aa53a2674cc 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -18,6 +18,7 @@ #include #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" +#include "CommonConstants/MathConstants.h" namespace o2::aod { From 1232a7010977b05b0da096805fa8a966db8f6f90 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 4 Dec 2024 11:38:14 +0100 Subject: [PATCH 44/91] [PWGLF] ebyeMaker: CL0 correlation checks only for Run 2 (#8814) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index f6efa86fc3a..98580beb99b 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -418,12 +418,14 @@ struct ebyeMaker { } else { LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); } - Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); - Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); - if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { - Run2CL0Info.mCalibrationStored = true; - } else { - LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + if (doprocessRun2) { + Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); + Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); + if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { + Run2CL0Info.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + } } } else { auto grpmagPath{"GLO/Config/GRPMagField"}; From df9d9540904b9856b6547b2b677409919f997a41 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Wed, 4 Dec 2024 12:17:13 +0100 Subject: [PATCH 45/91] [PWGDQ] Adding TPC occupancy variables for PbPb (for now just testing) (#8809) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Core/HistogramsLibrary.cxx | 26 ++ PWGDQ/Core/VarManager.cxx | 27 +++ PWGDQ/Core/VarManager.h | 38 ++- PWGDQ/DataModel/ReducedInfoTables.h | 27 ++- PWGDQ/TableProducer/tableMaker.cxx | 2 +- PWGDQ/TableProducer/tableMakerMC.cxx | 92 +++---- .../TableProducer/tableMakerMC_withAssoc.cxx | 2 +- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 227 +++++++++++++++++- 8 files changed, 374 insertions(+), 67 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 92fbdd9fb3e..13ba242d8e8 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -132,6 +132,32 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "TPCpileupZC", "TPC pileup Z, C-side", false, 200, -50.0, 50.0, VarManager::kNTPCpileupZC); hm->AddHistogram(histClass, "TPCpileupNcontribA", "TPC pileup n-contributors, A-side", false, 300, 0.0, 3000.0, VarManager::kNTPCpileupContribA); hm->AddHistogram(histClass, "TPCpileupNcontribC", "TPC pileup n-contributors, C-side", false, 300, 0.0, 3000.0, VarManager::kNTPCpileupContribC); + hm->AddHistogram(histClass, "TPCoccupContribLongA", "TPC occupancy from pileup, n-contrib, A-side, long time range", false, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongA); + hm->AddHistogram(histClass, "TPCoccupContribLongAvsTime", "TPC occupancy from pileup, n-contrib, A-side, long time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribLongA); + hm->AddHistogram(histClass, "TPCoccupContribLongAvsContribPV", "TPC occupancy from pileup, n-contrib, A-side, long time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongA); + hm->AddHistogram(histClass, "TPCoccupContribLongC", "TPC occupancy from pileup, n-contrib, C-side, long time range", false, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupContribLongCvsTime", "TPC occupancy from pileup, n-contrib, C-side, long time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupContribLongCvsContribPV", "TPC occupancy from pileup, n-contrib, C-side, long time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupContribLongAvsC", "TPC occupancy from pileup, n-contrib, A-side vs C-side, long time range", false, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongA, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeLongA", "TPC occupancy from pileup, mean time, A-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongA); + hm->AddHistogram(histClass, "TPCoccupMeanTimeLongC", "TPC occupancy from pileup, mean time, C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeLongAvsC", "TPC occupancy from pileup, mean time, A-side vs C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongA, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeLongA", "TPC occupancy from pileup, median time, A-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongA); + hm->AddHistogram(histClass, "TPCoccupMedianTimeLongC", "TPC occupancy from pileup, median time, C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeLongAvsC", "TPC occupancy from pileup, median time, A-side vs C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongA, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongC); + hm->AddHistogram(histClass, "TPCoccupContribShortA", "TPC occupancy from pileup, n-contrib, A-side, short time range", false, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortA); + hm->AddHistogram(histClass, "TPCoccupContribShortAvsTime", "TPC occupancy from pileup, n-contrib, A-side, short time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribShortA); + hm->AddHistogram(histClass, "TPCoccupContribShortAvsContribPV", "TPC occupancy from pileup, n-contrib, A-side, short time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortA); + hm->AddHistogram(histClass, "TPCoccupContribShortC", "TPC occupancy from pileup, n-contrib, C-side, short time range", false, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupContribShortCvsTime", "TPC occupancy from pileup, n-contrib, C-side, short time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupContribShortAvsC", "TPC occupancy from pileup, n-contrib, A-side vs C-side, short time range", false, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortA, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupContribShortCvsContribPV", "TPC occupancy from pileup, n-contrib, C-side, short time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeShortA", "TPC occupancy from pileup, mean time, A-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortA); + hm->AddHistogram(histClass, "TPCoccupMeanTimeShortC", "TPC occupancy from pileup, mean time, C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeShortAvsC", "TPC occupancy from pileup, mean time, A-side vs C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortA, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeShortA", "TPC occupancy from pileup, median time, A-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortA); + hm->AddHistogram(histClass, "TPCoccupMedianTimeShortC", "TPC occupancy from pileup, median time, C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeShortAvsC", "TPC occupancy from pileup, median time, A-side vs C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortA, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortC); } } if (subGroupStr.Contains("ftmulpbpb")) { diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index 537afde077b..77de7838f8e 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -9,6 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. #include +#include +#include +#include #include "PWGDQ/Core/VarManager.h" #include "Tools/KFparticle/KFUtilities.h" @@ -378,6 +381,30 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kNTPCtracksInPast] = ""; fgVariableNames[kNTPCtracksInFuture] = "# TPC tracks in future"; fgVariableUnits[kNTPCtracksInFuture] = ""; + fgVariableNames[kNTPCcontribLongA] = "# TPC-A pileup, long time range"; + fgVariableUnits[kNTPCcontribLongA] = ""; + fgVariableNames[kNTPCcontribLongC] = "# TPC-C pileup, long time range"; + fgVariableUnits[kNTPCcontribLongC] = ""; + fgVariableNames[kNTPCmeanTimeLongA] = "# TPC-A pileup mean time, long time range"; + fgVariableUnits[kNTPCmeanTimeLongA] = "#mu s"; + fgVariableNames[kNTPCmeanTimeLongC] = "# TPC-C pileup mean time, long time range"; + fgVariableUnits[kNTPCmeanTimeLongC] = "#mu s"; + fgVariableNames[kNTPCmedianTimeLongA] = "# TPC-A pileup median time, long time range"; + fgVariableUnits[kNTPCmedianTimeLongA] = "#mu s"; + fgVariableNames[kNTPCmedianTimeLongC] = "# TPC-C pileup median time, long time range"; + fgVariableUnits[kNTPCmedianTimeLongC] = "#mu s"; + fgVariableNames[kNTPCcontribShortA] = "# TPC-A pileup, short time range"; + fgVariableUnits[kNTPCcontribShortA] = ""; + fgVariableNames[kNTPCcontribShortC] = "# TPC-C pileup, short time range"; + fgVariableUnits[kNTPCcontribShortC] = ""; + fgVariableNames[kNTPCmeanTimeShortA] = "# TPC-A pileup mean time, short time range"; + fgVariableUnits[kNTPCmeanTimeShortA] = "#mu s"; + fgVariableNames[kNTPCmeanTimeShortC] = "# TPC-C pileup mean time, short time range"; + fgVariableUnits[kNTPCmeanTimeShortC] = "#mu s"; + fgVariableNames[kNTPCmedianTimeShortA] = "# TPC-A pileup median time, short time range"; + fgVariableUnits[kNTPCmedianTimeShortA] = "#mu s"; + fgVariableNames[kNTPCmedianTimeShortC] = "# TPC-C pileup median time, short time range"; + fgVariableUnits[kNTPCmedianTimeShortC] = "#mu s"; fgVariableNames[kPt] = "p_{T}"; fgVariableUnits[kPt] = "GeV/c"; fgVariableNames[kInvPt] = "1/p_{T}"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 9e10ea58049..8a24d5aec51 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -244,6 +244,18 @@ class VarManager : public TObject kNTPCpileupZC, kNTPCtracksInPast, kNTPCtracksInFuture, + kNTPCcontribLongA, + kNTPCcontribLongC, + kNTPCmeanTimeLongA, + kNTPCmeanTimeLongC, + kNTPCmedianTimeLongA, + kNTPCmedianTimeLongC, + kNTPCcontribShortA, + kNTPCcontribShortC, + kNTPCmeanTimeShortA, + kNTPCmeanTimeShortC, + kNTPCmedianTimeShortA, + kNTPCmedianTimeShortC, kMCEventGeneratorId, kMCEventSubGeneratorId, kMCVtxX, @@ -1474,12 +1486,18 @@ void VarManager::FillEvent(T const& event, float* values) values[kMultAllTracksTPCOnly] = event.multAllTracksTPCOnly(); values[kMultAllTracksITSTPC] = event.multAllTracksITSTPC(); if constexpr ((fillMap & ReducedEventMultExtra) > 0) { - values[kNTPCpileupContribA] = event.nTPCpileupContribA(); - values[kNTPCpileupContribC] = event.nTPCpileupContribC(); - values[kNTPCpileupZA] = event.nTPCpileupZA(); - values[kNTPCpileupZC] = event.nTPCpileupZC(); - values[kNTPCtracksInPast] = event.nTPCtracksInPast(); - values[kNTPCtracksInFuture] = event.nTPCtracksInFuture(); + values[kNTPCcontribLongA] = event.nTPCoccupContribLongA(); + values[kNTPCcontribLongC] = event.nTPCoccupContribLongC(); + values[kNTPCcontribShortA] = event.nTPCoccupContribShortA(); + values[kNTPCcontribShortC] = event.nTPCoccupContribShortC(); + values[kNTPCmeanTimeLongA] = event.nTPCoccupMeanTimeLongA(); + values[kNTPCmeanTimeLongC] = event.nTPCoccupMeanTimeLongC(); + values[kNTPCmeanTimeShortA] = event.nTPCoccupMeanTimeShortA(); + values[kNTPCmeanTimeShortC] = event.nTPCoccupMedianTimeShortC(); + values[kNTPCmedianTimeLongA] = event.nTPCoccupMedianTimeLongA(); + values[kNTPCmedianTimeLongC] = event.nTPCoccupMedianTimeLongC(); + values[kNTPCmedianTimeShortA] = event.nTPCoccupMedianTimeShortA(); + values[kNTPCmedianTimeShortC] = event.nTPCoccupMedianTimeShortC(); } } // TODO: need to add EvSels and Cents tables, etc. in case of the central data model @@ -1756,11 +1774,11 @@ void VarManager::FillEvent(T const& event, float* values) } if constexpr ((fillMap & EventFilter) > 0) { - values[kIsDoubleGap] = (event.eventFilter() & (uint64_t(1) << kDoubleGap)) > 0; - values[kIsSingleGapA] = (event.eventFilter() & (uint64_t(1) << kSingleGapA)) > 0; - values[kIsSingleGapC] = (event.eventFilter() & (uint64_t(1) << kSingleGapC)) > 0; + values[kIsDoubleGap] = (event.eventFilter() & (static_cast(1) << kDoubleGap)) > 0; + values[kIsSingleGapA] = (event.eventFilter() & (static_cast(1) << kSingleGapA)) > 0; + values[kIsSingleGapC] = (event.eventFilter() & (static_cast(1) << kSingleGapC)) > 0; values[kIsSingleGap] = values[kIsSingleGapA] || values[kIsSingleGapC]; - values[kIsITSUPCMode] = (event.eventFilter() & (uint64_t(1) << kITSUPCMode)) > 0; + values[kIsITSUPCMode] = (event.eventFilter() & (static_cast(1) << kITSUPCMode)) > 0; } if constexpr ((fillMap & ReducedZdc) > 0) { diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index f50c92dc5ec..587c70349e2 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -16,6 +16,7 @@ #define PWGDQ_DATAMODEL_REDUCEDINFOTABLES_H_ #include +#include #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Common/DataModel/Centrality.h" @@ -47,12 +48,18 @@ DECLARE_SOA_BITMAP_COLUMN(Tag, tag, 64); //! Bit-field for storing event DECLARE_SOA_COLUMN(MCPosX, mcPosX, float); //! MC event position X DECLARE_SOA_COLUMN(MCPosY, mcPosY, float); //! MC event position Y DECLARE_SOA_COLUMN(MCPosZ, mcPosZ, float); //! MC event position Z -DECLARE_SOA_COLUMN(NTPCpileupContribA, nTPCpileupContribA, int); //! Number of TPC pileup tracks on A side -DECLARE_SOA_COLUMN(NTPCpileupContribC, nTPCpileupContribC, int); //! Number of TPC pileup tracks on C side -DECLARE_SOA_COLUMN(NTPCpileupZA, nTPCpileupZA, float); //! Median Z position of pileup tracks on A side -DECLARE_SOA_COLUMN(NTPCpileupZC, nTPCpileupZC, float); //! Median Z position of pileup tracks on C side -DECLARE_SOA_COLUMN(NTPCtracksInPast, nTPCtracksInPast, int); //! Number of TPC tracks in the past events (configurable, but e.g. one drift time) -DECLARE_SOA_COLUMN(NTPCtracksInFuture, nTPCtracksInFuture, int); //! Number of TPC tracks in the future events (configurable, but e.g. one drift time) +DECLARE_SOA_COLUMN(NTPCoccupContribLongA, nTPCoccupContribLongA, int); //! TPC pileup occupancy on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupContribLongC, nTPCoccupContribLongC, int); //! TPC pileup occupancy on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongA, nTPCoccupMeanTimeLongA, float); //! TPC pileup mean time on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongC, nTPCoccupMeanTimeLongC, float); //! TPC pileup mean time on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongA, nTPCoccupMedianTimeLongA, float); //! TPC pileup median time on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongC, nTPCoccupMedianTimeLongC, float); //! TPC pileup median time on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupContribShortA, nTPCoccupContribShortA, int); //! TPC pileup occupancy on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupContribShortC, nTPCoccupContribShortC, int); //! TPC pileup occupancy on C side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortA, nTPCoccupMeanTimeShortA, float); //! TPC pileup mean time on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortC, nTPCoccupMeanTimeShortC, float); //! TPC pileup mean time on C side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortA, nTPCoccupMedianTimeShortA, float); //! TPC pileup median time on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortC, nTPCoccupMedianTimeShortC, float); //! TPC pileup median time on C side (short time range) // Columns declared to guarantee the backward compatibility of the tables DECLARE_SOA_COLUMN(QvecBPosRe, qvecBPosRe, float); @@ -129,8 +136,12 @@ DECLARE_SOA_TABLE(ReducedEventsMultPV, "AOD", "REMULTPV", //! Multiplicity info DECLARE_SOA_TABLE(ReducedEventsMultAll, "AOD", "REMULTALL", //! Multiplicity information for all tracks in the event mult::MultAllTracksTPCOnly, mult::MultAllTracksITSTPC, - reducedevent::NTPCpileupContribA, reducedevent::NTPCpileupContribC, reducedevent::NTPCpileupZA, reducedevent::NTPCpileupZC, - reducedevent::NTPCtracksInPast, reducedevent::NTPCtracksInFuture); + reducedevent::NTPCoccupContribLongA, reducedevent::NTPCoccupContribLongC, + reducedevent::NTPCoccupMeanTimeLongA, reducedevent::NTPCoccupMeanTimeLongC, + reducedevent::NTPCoccupMedianTimeLongA, reducedevent::NTPCoccupMedianTimeLongC, + reducedevent::NTPCoccupContribShortA, reducedevent::NTPCoccupContribShortC, + reducedevent::NTPCoccupMeanTimeShortA, reducedevent::NTPCoccupMeanTimeShortC, + reducedevent::NTPCoccupMedianTimeShortA, reducedevent::NTPCoccupMedianTimeShortC); DECLARE_SOA_TABLE(ReducedEventsVtxCov, "AOD", "REVTXCOV", //! Event vertex covariance matrix collision::CovXX, collision::CovXY, collision::CovXZ, diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index 5a6fc2f09a7..0e54baa926f 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -492,7 +492,7 @@ struct TableMaker { multPV(collision.multNTracksHasITS(), collision.multNTracksHasTPC(), collision.multNTracksHasTOF(), collision.multNTracksHasTRD(), collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - 0, 0, 0.0, 0.0, 0, 0); + 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0); } uint64_t trackFilteringTag = 0; diff --git a/PWGDQ/TableProducer/tableMakerMC.cxx b/PWGDQ/TableProducer/tableMakerMC.cxx index fde24653c03..cd25c5c1a9d 100644 --- a/PWGDQ/TableProducer/tableMakerMC.cxx +++ b/PWGDQ/TableProducer/tableMakerMC.cxx @@ -17,6 +17,10 @@ // and the MC truth particles corresponding to the reconstructed tracks selected by the specified track cuts on reconstructed data. #include +#include +#include +#include +#include #include "TList.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -397,7 +401,7 @@ struct TableMakerMC { // store the selection decisions uint64_t tag = collision.selection_raw(); if (collision.sel7()) { - tag |= (uint64_t(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map + tag |= (static_cast(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map } auto mcCollision = collision.mcCollision(); @@ -413,7 +417,7 @@ struct TableMakerMC { } // fill stats information, before selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); } } @@ -429,7 +433,7 @@ struct TableMakerMC { // fill stats information, after selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); } } @@ -466,7 +470,7 @@ struct TableMakerMC { multPV(collision.multNTracksHasITS(), collision.multNTracksHasTPC(), collision.multNTracksHasTOF(), collision.multNTracksHasTRD(), collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - 0, 0, 0.0, 0.0, 0, 0); + 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0); } // loop over the MC truth tracks and find those that need to be written @@ -484,7 +488,7 @@ struct TableMakerMC { checked = sig.CheckSignal(true, mctrack); } if (checked) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } @@ -505,7 +509,7 @@ struct TableMakerMC { VarManager::FillTrackMC(mcTracks, mctrack); int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { - if (mcflags & (uint16_t(1) << j)) { + if (mcflags & (static_cast(1) << j)) { fHistMan->FillHistClass(Form("MCTruth_%s", (*signal).GetName()), VarManager::fgValues); } } @@ -539,8 +543,8 @@ struct TableMakerMC { } } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); VarManager::FillTrack(track); // If no MC particle is found, skip the track if (!track.has_mcParticle()) { @@ -576,23 +580,23 @@ struct TableMakerMC { // store filtering information if (track.isGlobalTrack()) { - trackFilteringTag |= (uint64_t(1) << 0); // BIT0: global track + trackFilteringTag |= (static_cast(1) << 0); // BIT0: global track } if (track.isGlobalTrackSDD()) { - trackFilteringTag |= (uint64_t(1) << 1); // BIT1: global track SSD + trackFilteringTag |= (static_cast(1) << 1); // BIT1: global track SSD } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackV0Bits)) { // BIT2-6: V0Bits - trackFilteringTag |= (uint64_t(track.pidbit()) << 2); + trackFilteringTag |= (static_cast(track.pidbit()) << 2); for (int iv0 = 0; iv0 < 5; iv0++) { - if (track.pidbit() & (uint8_t(1) << iv0)) { + if (track.pidbit() & (static_cast(1) << iv0)) { (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::DalitzBits)) { - trackFilteringTag |= (uint64_t(track.dalitzBits()) << 7); // BIT7-14: Dalitz + trackFilteringTag |= (static_cast(track.dalitzBits()) << 7); // BIT7-14: Dalitz } - trackFilteringTag |= (uint64_t(trackTempFilterMap) << 15); // BIT15-...: user track filters + trackFilteringTag |= (static_cast(trackTempFilterMap) << 15); // BIT15-...: user track filters mcflags = 0; i = 0; // runs over the MC signals @@ -600,7 +604,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { j = 0; for (auto& cut : fTrackCuts) { @@ -678,7 +682,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } @@ -735,8 +739,8 @@ struct TableMakerMC { std::map newMFTMatchIndex; for (auto& muon : groupedMuons) { - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -785,8 +789,8 @@ struct TableMakerMC { } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -821,7 +825,7 @@ struct TableMakerMC { continue; } // store the cut decisions - trackFilteringTag |= uint64_t(trackTempFilterMap); // BIT0-7: user selection cuts + trackFilteringTag |= static_cast(trackTempFilterMap); // BIT0-7: user selection cuts mcflags = 0; i = 0; // runs over the MC signals @@ -829,7 +833,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { for (auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { @@ -962,7 +966,7 @@ struct TableMakerMC { mctrack.weight(), mctrack.pt(), mctrack.eta(), mctrack.phi(), mctrack.e(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { - if (mcflags & (uint16_t(1) << isig)) { + if (mcflags & (static_cast(1) << isig)) { (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } @@ -1035,7 +1039,7 @@ struct TableMakerMC { // store the selection decisions uint64_t tag = collision.selection_raw(); if (collision.sel7()) { - tag |= (uint64_t(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map + tag |= (static_cast(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map } auto mcCollision = collision.mcCollision(); @@ -1051,7 +1055,7 @@ struct TableMakerMC { } // fill stats information, before selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); } } @@ -1067,7 +1071,7 @@ struct TableMakerMC { // fill stats information, after selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); } } @@ -1116,7 +1120,7 @@ struct TableMakerMC { checked = sig.CheckSignal(true, mctrack); } if (checked) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } @@ -1137,7 +1141,7 @@ struct TableMakerMC { VarManager::FillTrackMC(mcTracks, mctrack); int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { - if (mcflags & (uint16_t(1) << j)) { + if (mcflags & (static_cast(1) << j)) { fHistMan->FillHistClass(Form("MCTruth_%s", (*signal).GetName()), VarManager::fgValues); } } @@ -1166,8 +1170,8 @@ struct TableMakerMC { isAmbiguous = (track.compatibleCollIds().size() != 1); } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); VarManager::FillTrack(track); // If no MC particle is found, skip the track if (!track.has_mcParticle()) { @@ -1203,23 +1207,23 @@ struct TableMakerMC { // store filtering information if (track.isGlobalTrack()) { - trackFilteringTag |= (uint64_t(1) << 0); // BIT0: global track + trackFilteringTag |= (static_cast(1) << 0); // BIT0: global track } if (track.isGlobalTrackSDD()) { - trackFilteringTag |= (uint64_t(1) << 1); // BIT1: global track SSD + trackFilteringTag |= (static_cast(1) << 1); // BIT1: global track SSD } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackV0Bits)) { // BIT2-6: V0Bits - trackFilteringTag |= (uint64_t(track.pidbit()) << 2); + trackFilteringTag |= (static_cast(track.pidbit()) << 2); for (int iv0 = 0; iv0 < 5; iv0++) { - if (track.pidbit() & (uint8_t(1) << iv0)) { + if (track.pidbit() & (static_cast(1) << iv0)) { (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::DalitzBits)) { - trackFilteringTag |= (uint64_t(track.dalitzBits()) << 7); // BIT7-14: Dalitz + trackFilteringTag |= (static_cast(track.dalitzBits()) << 7); // BIT7-14: Dalitz } - trackFilteringTag |= (uint64_t(trackTempFilterMap) << 15); // BIT15-...: user track filters + trackFilteringTag |= (static_cast(trackTempFilterMap) << 15); // BIT15-...: user track filters mcflags = 0; i = 0; // runs over the MC signals @@ -1227,7 +1231,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { j = 0; for (auto& cut : fTrackCuts) { @@ -1298,8 +1302,8 @@ struct TableMakerMC { for (auto& muonId : fwdtrackIdsThisCollision) { auto muon = muonId.template fwdtrack_as(); - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -1343,8 +1347,8 @@ struct TableMakerMC { } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -1381,7 +1385,7 @@ struct TableMakerMC { continue; } // store the cut decisions - trackFilteringTag |= uint64_t(trackTempFilterMap); // BIT0-7: user selection cuts + trackFilteringTag |= static_cast(trackTempFilterMap); // BIT0-7: user selection cuts mcflags = 0; i = 0; // runs over the MC signals @@ -1389,7 +1393,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { for (auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { @@ -1504,7 +1508,7 @@ struct TableMakerMC { mctrack.weight(), mctrack.pt(), mctrack.eta(), mctrack.phi(), mctrack.e(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { - if (mcflags & (uint16_t(1) << isig)) { + if (mcflags & (static_cast(1) << isig)) { (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index d6a4270bb10..c85d44a4a19 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -532,7 +532,7 @@ struct TableMakerMC { multPV(collision.multNTracksHasITS(), collision.multNTracksHasTPC(), collision.multNTracksHasTOF(), collision.multNTracksHasTRD(), collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - 0, 0, 0.0, 0.0, 0, 0); + 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0); } // add an element for this collision into the map diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 8f437b7955c..5aae38f65df 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -235,6 +235,13 @@ struct TableMaker { Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + + // TPC occupancy related variables + Configurable fTPCShortPast{"cfgTPCShortPast", 8.0f, "Time in short past to look for occupancy (micro-seconds)"}; + Configurable fTPCShortFuture{"cfgTPCShortFuture", 8.0f, "Time in short future to look for occupancy (micro-seconds)"}; + Configurable fTPCLongPast{"cfgTPCLongPast", 100.0f, "Time in long past to look for occupancy (micro-seconds)"}; + Configurable fTPCLongFuture{"cfgTPCLongFuture", 100.0f, "Time in long future to look for occupancy (micro-seconds)"}; + Configurable fExcludeShort{"cfgTPCExcludeShort", true, "Exclude short term from long term occupancy (micro-seconds)"}; } fConfigVariousOptions; Service fCCDB; @@ -273,6 +280,25 @@ struct TableMaker { Preslice fwdtrackIndicesPerCollision = aod::track_association::collisionId; Preslice mfttrackIndicesPerCollision = aod::track_association::collisionId; + Preslice preslice = aod::track::collisionId; + Partition tracksPos = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl > static_cast(0.05))); + Partition tracksNeg = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast(-0.05))); + + struct { + std::map oMeanTimeShortA; + std::map oMeanTimeShortC; + std::map oMeanTimeLongA; + std::map oMeanTimeLongC; + std::map oMedianTimeShortA; + std::map oMedianTimeShortC; + std::map oMedianTimeLongA; + std::map oMedianTimeLongC; + std::map oContribShortA; + std::map oContribShortC; + std::map oContribLongA; + std::map oContribLongC; + } fOccup; + void init(o2::framework::InitContext& context) { // CCDB configuration @@ -497,8 +523,183 @@ struct TableMaker { fStatsList->AddAt(histZorroSel, kStatsZorroSel); } + template + void computeOccupancyEstimators(TEvents const& collisions, TTracks const& /*tracks*/, Preslice& preslice, TBCs const&) + { + + // clear the occupancy maps for this time frame + fOccup.oMeanTimeLongA.clear(); + fOccup.oMeanTimeLongC.clear(); + fOccup.oMeanTimeShortA.clear(); + fOccup.oMeanTimeShortC.clear(); + fOccup.oMedianTimeLongA.clear(); + fOccup.oMedianTimeLongC.clear(); + fOccup.oMedianTimeShortA.clear(); + fOccup.oMedianTimeShortC.clear(); + fOccup.oContribLongA.clear(); + fOccup.oContribLongC.clear(); + fOccup.oContribShortA.clear(); + fOccup.oContribShortC.clear(); + + std::map oBC; // key: collision index; value: global BC + std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC + std::map oVtxZ; // key: collision index; value: vtx-z position + std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side + std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side + + const double bcUS = o2::constants::lhc::LHCBunchSpacingNS / 1000.0; // BC spacing in micro-seconds + const double vdrift = 2.5; // cm / mus + int32_t bcShortPast = std::lrint(fConfigVariousOptions.fTPCShortPast / bcUS); // (close in time collisions) 8 micro-seconds in BC intervals + int32_t bcShortFuture = std::lrint(fConfigVariousOptions.fTPCShortFuture / bcUS); // (close in time collisions) 8 micro-seconds in BC intervals + int32_t bcLongPast = std::lrint(fConfigVariousOptions.fTPCLongPast / bcUS); // (wide time range collisions) past 40 micro-seconds in BC intervals + int32_t bcLongFuture = std::lrint(fConfigVariousOptions.fTPCLongFuture / bcUS); // // (wide time range collisions) future 100 micro-seconds in BC intervals + + // Loop over collisions and extract needed info (BC, vtxZ, multiplicity separately in A and C sides) + for (const auto& collision : collisions) { + + auto bcEvSel = collision.template foundBC_as(); + int64_t bc = bcEvSel.globalBC(); + oBC[collision.globalIndex()] = bc; + oVtxZ[collision.globalIndex()] = collision.posZ(); + + // if more than one collision per bunch, add that collision to the list for that bunch + if (oBCreversed.find(bc) == oBCreversed.end()) { + std::vector evs = {collision.globalIndex()}; + oBCreversed[bc] = evs; + } else { + auto& evs = oBCreversed[bc]; + evs.push_back(collision.globalIndex()); + } + + // make a slice for this collision and get the number of tracks + auto thisCollTrackPos = tracksPos.sliceBy(preslice, collision.globalIndex()); + auto thisCollTrackNeg = tracksNeg.sliceBy(preslice, collision.globalIndex()); + collMultPos[collision.globalIndex()] = thisCollTrackPos.size(); + collMultNeg[collision.globalIndex()] = thisCollTrackNeg.size(); + } + + // loop over collisions and sum the multiplicity in the past and future + for (const auto& [collision, bc] : oBC) { + + int64_t pastShortBC = oBCreversed.lower_bound(bc - bcShortPast)->first; + int64_t futureShortBC = oBCreversed.lower_bound(bc + bcShortFuture)->first; + int64_t pastLongBC = oBCreversed.lower_bound(bc - bcLongPast)->first; + int64_t futureLongBC = oBCreversed.lower_bound(bc + bcLongFuture)->first; + + fOccup.oContribLongA[collision] = 0; + fOccup.oContribLongC[collision] = 0; + fOccup.oMeanTimeLongA[collision] = 0.0; + fOccup.oMeanTimeLongC[collision] = 0.0; + fOccup.oContribShortA[collision] = 0; + fOccup.oContribShortC[collision] = 0; + fOccup.oMeanTimeShortA[collision] = 0.0; + fOccup.oMeanTimeShortC[collision] = 0.0; + std::map oTimeMapShortA; + std::map oTimeMapShortC; + std::map oTimeMapLongA; + std::map oTimeMapLongC; + // loop over the BCs in the past and future wrt this one + for (auto bcIt = oBCreversed.find(pastLongBC); bcIt != oBCreversed.find(futureLongBC); ++bcIt) { + int64_t thisBC = bcIt->first; + auto colls = bcIt->second; + // delta time due to the different BCs + float dt = (thisBC - bc) * bcUS; + // check if this collision is also within the short time range + bool isShort = (thisBC >= pastShortBC && thisBC < futureShortBC); + // loop over all collisions in this BC + for (auto& thisColl : colls) { + // skip if this is the same collision + if (thisColl == collision) { + continue; + } + // compute the delta time due to the difference in longitudinal position + float dtDrift = (oVtxZ[thisColl] - oVtxZ[collision]) / vdrift; + + if (!(fConfigVariousOptions.fExcludeShort && isShort)) { + // sum the collision multiplicity on A and C sides + fOccup.oContribLongA[collision] += collMultPos[thisColl]; + fOccup.oContribLongC[collision] += collMultNeg[thisColl]; + // compute the multiplicity weighted average time + fOccup.oMeanTimeLongA[collision] += collMultPos[thisColl] * (dt + dtDrift); + fOccup.oMeanTimeLongC[collision] += collMultNeg[thisColl] * (dt - dtDrift); + // fill the time map + oTimeMapLongA[dt + dtDrift] = collMultPos[thisColl]; + oTimeMapLongC[dt - dtDrift] = collMultNeg[thisColl]; + } + + if (isShort) { + fOccup.oContribShortA[collision] += collMultPos[thisColl]; + fOccup.oContribShortC[collision] += collMultNeg[thisColl]; + fOccup.oMeanTimeShortA[collision] += collMultPos[thisColl] * (dt + dtDrift); + fOccup.oMeanTimeShortC[collision] += collMultNeg[thisColl] * (dt - dtDrift); + oTimeMapShortA[dt + dtDrift] = collMultPos[thisColl]; + oTimeMapShortC[dt - dtDrift] = collMultNeg[thisColl]; + } + } + } + // normalize to obtain the mean time + if (fOccup.oContribLongA[collision] > 0) { + fOccup.oMeanTimeLongA[collision] /= fOccup.oContribLongA[collision]; + } + if (fOccup.oContribLongC[collision] > 0) { + fOccup.oMeanTimeLongC[collision] /= fOccup.oContribLongC[collision]; + } + if (fOccup.oContribShortA[collision] > 0) { + fOccup.oMeanTimeShortA[collision] /= fOccup.oContribShortA[collision]; + } + if (fOccup.oContribShortC[collision] > 0) { + fOccup.oMeanTimeShortC[collision] /= fOccup.oContribShortC[collision]; + } + // iterate over the time maps to obtain the median time + fOccup.oMedianTimeLongA[collision] = 0.0; + float sumMult = 0.0; + if (oTimeMapLongA.size() > 0) { + for (auto& [dt, mult] : oTimeMapLongA) { + sumMult += mult; + if (sumMult > fOccup.oContribLongA[collision] / 2.0) { + fOccup.oMedianTimeLongA[collision] = dt; + break; + } + } + } + fOccup.oMedianTimeLongC[collision] = 0.0; + sumMult = 0.0; + if (oTimeMapLongC.size() > 0) { + for (auto& [dt, mult] : oTimeMapLongC) { + sumMult += mult; + if (sumMult > fOccup.oContribLongC[collision] / 2.0) { + fOccup.oMedianTimeLongC[collision] = dt; + break; + } + } + } + fOccup.oMedianTimeShortA[collision] = 0.0; + sumMult = 0.0; + if (oTimeMapShortA.size() > 0) { + for (auto& [dt, mult] : oTimeMapShortA) { + sumMult += mult; + if (sumMult > fOccup.oContribShortA[collision] / 2.0) { + fOccup.oMedianTimeShortA[collision] = dt; + break; + } + } + } + fOccup.oMedianTimeShortC[collision] = 0.0; + sumMult = 0.0; + if (oTimeMapShortC.size() > 0) { + for (auto& [dt, mult] : oTimeMapShortC) { + sumMult += mult; + if (sumMult > fOccup.oContribShortC[collision] / 2.0) { + fOccup.oMedianTimeShortC[collision] = dt; + break; + } + } + } + } // end loop over collisions + } + template - void skimCollisions(TEvents const& collisions, TBCs const& /*bcs*/, TZdcs const& /*zdcs*/, + void skimCollisions(TEvents const& collisions, TBCs const& bcs, TZdcs const& /*zdcs*/, TTrackAssoc const& trackAssocs, TTracks const& tracks) { // Skim collisions @@ -562,6 +763,21 @@ struct TableMaker { auto groupedTrackIndices = trackAssocs.sliceBy(trackIndicesPerCollision, collision.globalIndex()); VarManager::FillEventTrackEstimators(collision, groupedTrackIndices, tracks); } + // Exceptionally fill the TPC occupancy quantities here + if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionMultExtra) > 0) { + VarManager::fgValues[VarManager::kNTPCcontribLongA] = fOccup.oContribLongA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCcontribLongC] = fOccup.oContribLongC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeLongA] = fOccup.oMeanTimeLongA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeLongC] = fOccup.oMeanTimeLongC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeLongA] = fOccup.oMedianTimeLongA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeLongC] = fOccup.oMedianTimeLongC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCcontribShortA] = fOccup.oContribShortA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCcontribShortC] = fOccup.oContribShortC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeShortA] = fOccup.oMeanTimeShortA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeShortC] = fOccup.oMeanTimeShortC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeShortA] = fOccup.oMedianTimeShortA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeShortC] = fOccup.oMedianTimeShortC[collision.globalIndex()]; + } if (fDoDetailedQA) { fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); } @@ -637,8 +853,12 @@ struct TableMaker { collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - VarManager::fgValues[VarManager::kNTPCpileupContribA], VarManager::fgValues[VarManager::kNTPCpileupContribC], - VarManager::fgValues[VarManager::kNTPCpileupZA], VarManager::fgValues[VarManager::kNTPCpileupZC], 0, 0); + fOccup.oContribLongA[collision.globalIndex()], fOccup.oContribLongC[collision.globalIndex()], + fOccup.oMeanTimeLongA[collision.globalIndex()], fOccup.oMeanTimeLongC[collision.globalIndex()], + fOccup.oMedianTimeLongA[collision.globalIndex()], fOccup.oMedianTimeLongC[collision.globalIndex()], + fOccup.oContribShortA[collision.globalIndex()], fOccup.oContribShortC[collision.globalIndex()], + fOccup.oMeanTimeShortA[collision.globalIndex()], fOccup.oMeanTimeShortC[collision.globalIndex()], + fOccup.oMedianTimeShortA[collision.globalIndex()], fOccup.oMedianTimeShortC[collision.globalIndex()]); } fCollIndexMap[collision.globalIndex()] = event.lastIndex(); @@ -1148,6 +1368,7 @@ struct TableMaker { MyBarrelTracksWithV0Bits const& tracksBarrel, TrackAssoc const& trackAssocs) { + computeOccupancyEstimators(collisions, tracksBarrel, preslice, bcs); fullSkimming(collisions, bcs, nullptr, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr); } From f685d10b4cfda75dd38093cfca52e39271eef601 Mon Sep 17 00:00:00 2001 From: MaolinZH <109225729+MaolinZH@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:49:55 +0100 Subject: [PATCH 46/91] [PWGDQ] Add the electron-muon pair process in filterPPwithAssociation (#8716) --- PWGDQ/Tasks/filterPPwithAssociation.cxx | 228 ++++++++++++++++++++---- 1 file changed, 197 insertions(+), 31 deletions(-) diff --git a/PWGDQ/Tasks/filterPPwithAssociation.cxx b/PWGDQ/Tasks/filterPPwithAssociation.cxx index 4f92cf7cc90..d2d374b06ef 100644 --- a/PWGDQ/Tasks/filterPPwithAssociation.cxx +++ b/PWGDQ/Tasks/filterPPwithAssociation.cxx @@ -13,6 +13,8 @@ // #include #include +#include +#include #include #include #include @@ -68,6 +70,7 @@ enum DQTriggers { kSingleMuLow, kSingleMuHigh, kDiMuon, + // kElectronMuon, // the ElectronMuon trigger is not available now kNTriggersDQ }; } // namespace @@ -78,6 +81,8 @@ namespace dqppfilter DECLARE_SOA_COLUMN(IsDQEventSelected, isDQEventSelected, int); DECLARE_SOA_COLUMN(IsDQBarrelSelected, isDQBarrelSelected, uint32_t); DECLARE_SOA_COLUMN(IsDQMuonSelected, isDQMuonSelected, uint32_t); +DECLARE_SOA_COLUMN(IsDQEMuBarrelSelected, isDQEMuBarrelSelected, uint32_t); // for electron-muon pair +DECLARE_SOA_COLUMN(IsDQEMuMuonSelected, isDQEMuMuonSelected, uint32_t); // for electron-muon pair DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! Collision index DECLARE_SOA_INDEX_COLUMN(Track, track); //! Track index DECLARE_SOA_INDEX_COLUMN(FwdTrack, fwdtrack); //! FwdTrack index @@ -86,6 +91,8 @@ DECLARE_SOA_INDEX_COLUMN(FwdTrack, fwdtrack); //! FwdTrack index DECLARE_SOA_TABLE(DQEventCuts, "AOD", "DQEVENTCUTS", dqppfilter::IsDQEventSelected); DECLARE_SOA_TABLE(DQBarrelTrackCuts, "AOD", "DQBARRELCUTS", dqppfilter::IsDQBarrelSelected); DECLARE_SOA_TABLE(DQMuonsCuts, "AOD", "DQMUONCUTS", dqppfilter::IsDQMuonSelected); +DECLARE_SOA_TABLE(DQEMuBarrelTrackCuts, "AOD", "DQEMUBARRELCUTS", dqppfilter::IsDQEMuBarrelSelected); // for electron-muon pair +DECLARE_SOA_TABLE(DQEMuMuonsCuts, "AOD", "DQEMUMUONCUTS", dqppfilter::IsDQEMuMuonSelected); // for electron-muon pair } // namespace o2::aod using MyEvents = soa::Join; @@ -103,10 +110,10 @@ using MyBarrelTracksSelected = soa::Join; -using MyBarrelTracksAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the tracks everytime it is associated to a collision, the selection is done not on the tracks, but on the track-collision association +using MyBarrelTracksAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the tracks everytime it is associated to a collision, the selection is done not on the tracks, but on the track-collision association using MyMuons = soa::Join; -using MyMuonsAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the muons tracks everytime it is associated to a collision, the selection is done not on the muon, but on the muon-collision association +using MyMuonsAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the muons tracks everytime it is associated to a collision, the selection is done not on the muon, but on the muon-collision association constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision; constexpr static uint32_t gkTrackFillMap = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackPID; @@ -185,10 +192,12 @@ struct DQEventSelectionTask { struct DQBarrelTrackSelection { Produces trackSel; + Produces emuSel; OutputObj fOutputList{"output"}; HistogramManager* fHistMan; Configurable fConfigCuts{"cfgBarrelTrackCuts", "jpsiPID1", "Comma separated list of barrel track cuts"}; + Configurable fConfigCutsForEMu{"cfgBarrelTrackCutsForEMu", "jpsiPID1", "Comma separated list of barrel track cuts"}; Configurable fConfigQA{"cfgWithQA", false, "If true, fill QA histograms"}; Configurable fPropTrack{"cfgPropTrack", false, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -201,6 +210,7 @@ struct DQBarrelTrackSelection { Preslice barrelTrackIndicesPerCollision = aod::track_association::collisionId; std::vector fTrackCuts; + std::vector fEMuTrackCuts; std::vector fCutHistNames; int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. @@ -208,6 +218,7 @@ struct DQBarrelTrackSelection { void init(o2::framework::InitContext&) { TString cutNamesStr = fConfigCuts.value; + TString cutEMuNamesStr = fConfigCutsForEMu.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -219,6 +230,17 @@ struct DQBarrelTrackSelection { } } } + if (!cutEMuNamesStr.IsNull()) { + std::unique_ptr objArray2(cutEMuNamesStr.Tokenize(",")); + for (int icut = 0; icut < objArray2->GetEntries(); ++icut) { + AnalysisCompositeCut* cut2 = dqcuts::GetCompositeCut(objArray2->At(icut)->GetName()); + if (cut2) { + fEMuTrackCuts.push_back(*cut2); + } else { + LOGF(fatal, "Invalid e-mu cut provided: %s", objArray2->At(icut)->GetName()); + } + } + } VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill if (fConfigQA) { @@ -272,12 +294,15 @@ struct DQBarrelTrackSelection { // o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - uint32_t filterMap = uint32_t(0); + uint32_t filterMap = static_cast(0); + uint32_t filterMapEMu = static_cast(0); trackSel.reserve(tracksBarrel.size()); + emuSel.reserve(tracksBarrel.size()); VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); for (auto& trackAssoc : trackAssocs) { - filterMap = uint32_t(0); + filterMap = static_cast(0); + filterMapEMu = static_cast(0); auto track = trackAssoc.template track_as(); @@ -292,13 +317,20 @@ struct DQBarrelTrackSelection { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); ++cut, ++i) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << i); + filterMap |= (static_cast(1) << i); if (fConfigQA) { fHistMan->FillHistClass(fCutHistNames[i].Data(), VarManager::fgValues); } } } + int j = 0; + for (auto cut = fEMuTrackCuts.begin(); cut != fEMuTrackCuts.end(); ++cut, ++j) { + if ((*cut).IsSelected(VarManager::fgValues)) { + filterMapEMu |= (static_cast(1) << j); + } + } trackSel(filterMap); + emuSel(filterMapEMu); } // end loop over tracks } @@ -321,10 +353,12 @@ struct DQBarrelTrackSelection { struct DQMuonsSelection { Produces trackSel; + Produces emuSel; OutputObj fOutputList{"output"}; HistogramManager* fHistMan; Configurable fConfigCuts{"cfgMuonsCuts", "muonQualityCuts", "Comma separated list of ADDITIONAL muon track cuts"}; + Configurable fConfigCutsForEMu{"cfgMuonsCutsForEMu", "muonQualityCuts", "Comma separated list of ADDITIONAL muon track cuts"}; Configurable fConfigQA{"cfgWithQA", false, "If true, fill QA histograms"}; Configurable fPropMuon{"cfgPropMuon", false, "Propgate muon tracks through absorber"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -341,6 +375,7 @@ struct DQMuonsSelection { // TODO: configure the histogram classes to be filled by QA std::vector fTrackCuts; + std::vector fEMuTrackCuts; std::vector fCutHistNames; void init(o2::framework::InitContext&) @@ -355,12 +390,19 @@ struct DQMuonsSelection { } TString cutNamesStr = fConfigCuts.value; + TString cutEMuNamesStr = fConfigCutsForEMu.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { fTrackCuts.push_back(*dqcuts::GetCompositeCut(objArray->At(icut)->GetName())); } } + if (!cutEMuNamesStr.IsNull()) { + std::unique_ptr objArray2(cutEMuNamesStr.Tokenize(",")); + for (int icut = 0; icut < objArray2->GetEntries(); ++icut) { + fEMuTrackCuts.push_back(*dqcuts::GetCompositeCut(objArray2->At(icut)->GetName())); + } + } VarManager::SetUseVars(AnalysisCut::fgUsedVars); if (fConfigQA) { @@ -396,13 +438,16 @@ struct DQMuonsSelection { } } - uint32_t filterMap = uint32_t(0); + uint32_t filterMap = static_cast(0); + uint32_t filterMapEMu = static_cast(0); trackSel.reserve(muons.size()); + emuSel.reserve(muons.size()); VarManager::ResetValues(0, VarManager::kNMuonTrackVariables); for (auto& muonAssoc : muonAssocs) { - filterMap = uint32_t(0); + filterMap = static_cast(0); + filterMapEMu = static_cast(0); auto muon = muonAssoc.template fwdtrack_as(); VarManager::FillTrack(muon); if (fPropMuon) { @@ -414,13 +459,20 @@ struct DQMuonsSelection { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); ++cut, ++i) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << i); + filterMap |= (static_cast(1) << i); if (fConfigQA) { fHistMan->FillHistClass(fCutHistNames[i].Data(), VarManager::fgValues); } } } + int j = 0; + for (auto cut = fEMuTrackCuts.begin(); cut != fEMuTrackCuts.end(); ++cut, ++j) { + if ((*cut).IsSelected(VarManager::fgValues)) { + filterMapEMu |= (static_cast(1) << j); + } + } trackSel(filterMap); + emuSel(filterMapEMu); } // end loop over muons } @@ -510,10 +562,11 @@ struct DQFilterPPTask { Configurable fConfigBarrelSelections{"cfgBarrelSels", "jpsiPID1:pairMassLow:1", ":[]:,[:[]:],..."}; Configurable fConfigMuonSelections{"cfgMuonSels", "muonQualityCuts:pairNoCut:1", ":[]:"}; + Configurable fConfigElectronMuonSelections{"cfgElectronMuonSels", "jpsiPID1:muonQualityCuts:pairNoCut:1", "::[]:"}; Configurable fConfigQA{"cfgWithQA", false, "If true, fill QA histograms"}; Configurable fConfigFilterLsBarrelTracksPairs{"cfgWithBarrelLS", "false", "Comma separated list of booleans for each trigger, If true, also select like sign (--/++) barrel track pairs"}; Configurable fConfigFilterLsMuonsPairs{"cfgWithMuonLS", "false", "Comma separated list of booleans for each trigger, If true, also select like sign (--/++) muon pairs"}; - + Configurable fConfigFilterLsElectronMuonsPairs{"cfgWithElectronMuonLS", "false", "Comma separated list of booleans for each trigger, If true, also select like sign (--/++) muon pairs"}; Configurable fPropMuon{"cfgPropMuon", false, "Propgate muon tracks through absorber"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; @@ -526,14 +579,19 @@ struct DQFilterPPTask { int fNBarrelCuts; // number of barrel selections int fNMuonCuts; // number of muon selections + int fNElectronMuonCuts; // number of electron-muon selections std::vector fBarrelRunPairing; // bit map on whether the selections require pairing (barrel) std::vector fMuonRunPairing; // bit map on whether the selections require pairing (muon) + std::vector fElectronMuonRunPairing; // bit map on whether the selections require pairing (e-mu) std::vector fBarrelNreqObjs; // minimal number of tracks/pairs required (barrel) std::vector fMuonNreqObjs; // minimal number of tracks/pairs required (muon) + std::vector fElectronMuonNreqObjs; // minimal number of electron-muon pairs required std::map fBarrelPairCuts; // map of barrel pair cuts std::map fMuonPairCuts; // map of muon pair cuts + std::map fElectronMuonPairCuts; // map of electron-muon pair cuts std::map fBarrelPairHistNames; // map with names of the barrel pairing histogram directories std::map fMuonPairHistNames; // map with names of the muon pairing histogram directories + std::map fElectronMuonPairHistNames; // map with names of the electron-muon pairing histogram directories std::map fFiltersMap; // map of filters for events that passed at least one filter std::map> fCEFPfilters; // map of CEFP filters for events that passed at least one filter @@ -584,10 +642,32 @@ struct DQFilterPPTask { } } } + // electron-muon pair + TString electronMuonSelsStr = fConfigElectronMuonSelections.value; + std::unique_ptr objArray3(electronMuonSelsStr.Tokenize(",")); + fNElectronMuonCuts = objArray3->GetEntries(); + if (fNElectronMuonCuts) { + for (int icut = 0; icut < fNElectronMuonCuts; ++icut) { + TString selStr = objArray3->At(icut)->GetName(); + std::unique_ptr sel(selStr.Tokenize(":")); + if (sel->GetEntries() < 3 || sel->GetEntries() > 4) { + continue; + } + if (sel->GetEntries() == 4) { + fElectronMuonPairCuts[icut] = (*dqcuts::GetCompositeCut(sel->At(2)->GetName())); + fElectronMuonRunPairing.push_back(true); + fElectronMuonNreqObjs.push_back(std::atoi(sel->At(3)->GetName())); + fElectronMuonPairHistNames[icut] = Form("PairsElectronMuonSEPM_%s_%s_%s", sel->At(0)->GetName(), sel->At(1)->GetName(), sel->At(2)->GetName()); + } else { + fElectronMuonNreqObjs.push_back(std::atoi(sel->At(2)->GetName())); + fElectronMuonRunPairing.push_back(false); + } + } + } VarManager::SetUseVars(AnalysisCut::fgUsedVars); // setup the Stats histogram - fStats.setObject(new TH1D("Statistics", "Stats for DQ triggers", fNBarrelCuts + fNMuonCuts + 2, -2.5, -0.5 + fNBarrelCuts + fNMuonCuts)); + fStats.setObject(new TH1D("Statistics", "Stats for DQ triggers", fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts + 2, -2.5, -0.5 + fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts)); fStats->GetXaxis()->SetBinLabel(1, "Events inspected"); fStats->GetXaxis()->SetBinLabel(2, "Events selected"); if (fNBarrelCuts) { @@ -600,6 +680,11 @@ struct DQFilterPPTask { fStats->GetXaxis()->SetBinLabel(ib, objArray2->At(ib - 3 - fNBarrelCuts)->GetName()); } } + if (fNElectronMuonCuts) { + for (int ib = 3 + fNBarrelCuts + fNMuonCuts; ib < 3 + fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts; ib++) { + fStats->GetXaxis()->SetBinLabel(ib, objArray3->At(ib - 3 - fNBarrelCuts - fNMuonCuts)->GetName()); + } + } } void init(o2::framework::InitContext&) @@ -629,6 +714,10 @@ struct DQFilterPPTask { histNames += value; histNames += ";"; } + for (const auto& [key, value] : fElectronMuonPairHistNames) { + histNames += value; + histNames += ";"; + } DefineHistograms(fHistMan, histNames.Data()); VarManager::SetUseVars(fHistMan->GetUsedVars()); fOutputList.setObject(fHistMan->GetMainHistogramList()); @@ -661,7 +750,7 @@ struct DQFilterPPTask { // count the number of barrel tracks fulfilling each cut for (auto trackAssoc : barrelAssocs) { for (int i = 0; i < fNBarrelCuts; ++i) { - if (trackAssoc.isDQBarrelSelected() & (uint32_t(1) << i)) { + if (trackAssoc.isDQBarrelSelected() & (static_cast(1) << i)) { objCountersBarrel[i] += 1; } } @@ -672,7 +761,7 @@ struct DQFilterPPTask { for (int i = 0; i < fNBarrelCuts; i++) { if (fBarrelRunPairing[i]) { if (objCountersBarrel[i] > 1) { // pairing has to be enabled and at least two tracks are needed - pairingMask |= (uint32_t(1) << i); + pairingMask |= (static_cast(1) << i); } objCountersBarrel[i] = 0; // reset counters for selections where pairing is needed (count pairs instead) } @@ -685,7 +774,7 @@ struct DQFilterPPTask { for (int icut = 0; icut < fNBarrelCuts; icut++) { TString objStr = objArrayLS->At(icut)->GetName(); if (!objStr.CompareTo("true")) { - pairingLS |= (uint32_t(1) << icut); + pairingLS |= (static_cast(1) << icut); } } @@ -708,13 +797,13 @@ struct DQFilterPPTask { VarManager::FillPair(t1, t2); // compute pair quantities for (int icut = 0; icut < fNBarrelCuts; icut++) { // select like-sign pairs if trigger has set boolean true within fConfigFilterLsBarrelTracksPairs - if (!(pairingLS & (uint32_t(1) << icut))) { + if (!(pairingLS & (static_cast(1) << icut))) { if (t1.sign() * t2.sign() > 0) { continue; } } - if (!(pairFilter & (uint32_t(1) << icut))) { + if (!(pairFilter & (static_cast(1) << icut))) { continue; } if (!fBarrelPairCuts[icut].IsSelected(VarManager::fgValues)) { @@ -732,7 +821,7 @@ struct DQFilterPPTask { // count the number of muon-collision associations fulfilling each selection for (auto muon : muonAssocs) { for (int i = 0; i < fNMuonCuts; ++i) { - if (muon.isDQMuonSelected() & (uint32_t(1) << i)) { + if (muon.isDQMuonSelected() & (static_cast(1) << i)) { objCountersMuon[i] += 1; } } @@ -743,7 +832,7 @@ struct DQFilterPPTask { for (int i = 0; i < fNMuonCuts; i++) { if (fMuonRunPairing[i]) { // pairing has to be enabled and at least two tracks are needed if (objCountersMuon[i] > 1) { - pairingMask |= (uint32_t(1) << i); + pairingMask |= (static_cast(1) << i); } objCountersMuon[i] = 0; // reset counters for selections where pairing is needed (count pairs instead) } @@ -756,7 +845,7 @@ struct DQFilterPPTask { for (int icut = 0; icut < fNMuonCuts; icut++) { TString objStr = objArrayMuonLS->At(icut)->GetName(); if (!objStr.CompareTo("true")) { - pairingLS |= (uint32_t(1) << icut); + pairingLS |= (static_cast(1) << icut); } } @@ -783,12 +872,12 @@ struct DQFilterPPTask { } for (int icut = 0; icut < fNMuonCuts; icut++) { // select like-sign pairs if trigger has set boolean true within fConfigFilterLsMuonsPairs - if (!(pairingLS & (uint32_t(1) << icut))) { + if (!(pairingLS & (static_cast(1) << icut))) { if (t1.sign() * t2.sign() > 0) { continue; } } - if (!(pairFilter & (uint32_t(1) << icut))) { + if (!(pairFilter & (static_cast(1) << icut))) { continue; } if (!fMuonPairCuts[icut].IsSelected(VarManager::fgValues)) { @@ -802,16 +891,79 @@ struct DQFilterPPTask { } } + // electron-muon pair + std::vector objCountersElectronMuon(fNElectronMuonCuts, 0); // init all counters to zero + pairingMask = 0; + for (auto& [trackAssoc, muon] : combinations(barrelAssocs, muonAssocs)) { + for (int i = 0; i < fNElectronMuonCuts; ++i) { + if (trackAssoc.isDQEMuBarrelSelected() & muon.isDQEMuMuonSelected() & (static_cast(1) << i)) { + if (fElectronMuonRunPairing[i]) { + pairingMask |= (static_cast(1) << i); + } + } + } + } + // check which selection should use like sign (LS) (--/++) muon track pairs + pairingLS = 0; // reset the decisions for electron-muons + TString electronMuonLSstr = fConfigFilterLsElectronMuonsPairs.value; + std::unique_ptr objArrayElectronMuonLS(electronMuonLSstr.Tokenize(",")); + for (int icut = 0; icut < fNElectronMuonCuts; icut++) { + TString objStr = objArrayElectronMuonLS->At(icut)->GetName(); + if (!objStr.CompareTo("true")) { + pairingLS |= (static_cast(1) << icut); + } + } + + // run pairing if there is at least one selection that requires it + pairFilter = 0; + if (pairingMask > 0) { + // pairing is done using the collision grouped electron and muon associations + for (auto& [a1, a2] : combinations(barrelAssocs, muonAssocs)) { + // check the pairing mask and that the tracks share a cut bit + pairFilter = pairingMask & a1.isDQEMuBarrelSelected() & a2.isDQEMuMuonSelected(); + if (pairFilter == 0) { + continue; + } + // get the real electron and muon tracks + auto t1 = a1.template track_as(); + auto t2 = a2.template fwdtrack_as(); + // construct the pair and apply cuts + VarManager::FillPair(t1, t2); // compute pair quantities + for (int icut = 0; icut < fNElectronMuonCuts; icut++) { + // select like-sign pairs if trigger has set boolean true within fConfigFilterLsElectronMuonsPairs + if (!(pairingLS & (static_cast(1) << icut))) { + if (t1.sign() * t2.sign() > 0) { + continue; + } + } + if (!(pairFilter & (static_cast(1) << icut))) { + continue; + } + if (!fElectronMuonPairCuts[icut].IsSelected(VarManager::fgValues)) { + continue; + } + objCountersElectronMuon[icut] += 1; + if (fConfigQA) { + fHistMan->FillHistClass(fElectronMuonPairHistNames[icut].Data(), VarManager::fgValues); + } + } + } + } // compute the decisions and publish uint64_t filter = 0; for (int i = 0; i < fNBarrelCuts; i++) { if (objCountersBarrel[i] >= fBarrelNreqObjs[i]) { - filter |= (uint64_t(1) << i); + filter |= (static_cast(1) << i); } } for (int i = 0; i < fNMuonCuts; i++) { if (objCountersMuon[i] >= fMuonNreqObjs[i]) { - filter |= (uint64_t(1) << (i + fNBarrelCuts)); + filter |= (static_cast(1) << (i + fNBarrelCuts)); + } + } + for (int i = 0; i < fNElectronMuonCuts; i++) { + if (objCountersElectronMuon[i] >= fElectronMuonNreqObjs[i]) { + filter |= (static_cast(1) << (i + fNBarrelCuts + fNMuonCuts)); } } return filter; @@ -833,13 +985,12 @@ struct DQFilterPPTask { uint64_t barrelMask = 0; for (int i = 0; i < fNBarrelCuts; i++) { - barrelMask |= (uint64_t(1) << i); + barrelMask |= (static_cast(1) << i); } uint64_t muonMask = 0; for (int i = fNBarrelCuts; i < fNBarrelCuts + fNMuonCuts; i++) { - muonMask |= (uint64_t(1) << i); + muonMask |= (static_cast(1) << i); } - // Loop over collisions // int event = 0; int eventsFired = 0; @@ -866,20 +1017,29 @@ struct DQFilterPPTask { // compute the CEPF decisions (this is done in a spacial setup with exactly kNTriggersDQ configured triggers) std::vector decisions(kNTriggersDQ, false); // event decisions to be transmitted to CEFP for (int i = 0; i < fNBarrelCuts; i++) { - if (filter & (uint64_t(1) << i)) { + if (filter & (static_cast(1) << i)) { if (i < kNTriggersDQ) { decisions[i] = true; } } } for (int i = fNBarrelCuts; i < fNBarrelCuts + fNMuonCuts; i++) { - if (filter & (uint64_t(1) << i)) { + if (filter & (static_cast(1) << i)) { if (i < kNTriggersDQ) { decisions[i] = true; } } } - + // the ElectronMuon trigger is not available now + /* + for (int i = fNBarrelCuts + fNMuonCuts; i < fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts; i++) { + if (filter & (static_cast(1) << i)) { + if (i < kNTriggersDQ) { + decisions[i] = true; + } + } + } + */ // if this collision fired at least one input, add it to the map, or if it is there already, update the decisions with a logical OR // This may happen in the case when some collisions beyond the iterator are added because they contain ambiguous tracks fired on by another collision if (fFiltersMap.find(collision.globalIndex()) == fFiltersMap.end()) { @@ -961,6 +1121,7 @@ struct DQFilterPPTask { if (!collision.isDQEventSelected()) { eventFilter(0); dqtable(false, false, false, false, false, false, false); + // dqtable(false, false, false, false, false, false, false, false); // the ElectronMuon trigger is not available now continue; } fStats->Fill(-1.0); @@ -968,15 +1129,17 @@ struct DQFilterPPTask { if (fFiltersMap.find(collision.globalIndex()) == fFiltersMap.end()) { eventFilter(0); dqtable(false, false, false, false, false, false, false); + // dqtable(false, false, false, false, false, false, false, false); // the ElectronMuon trigger is not available now } else { totalEventsTriggered++; - for (int i = 0; i < fNBarrelCuts + fNMuonCuts; i++) { - if (fFiltersMap[collision.globalIndex()] & (uint32_t(1) << i)) + for (int i = 0; i < fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts; i++) { + if (fFiltersMap[collision.globalIndex()] & (static_cast(1) << i)) fStats->Fill(static_cast(i)); } eventFilter(fFiltersMap[collision.globalIndex()]); auto dqDecisions = fCEFPfilters[collision.globalIndex()]; dqtable(dqDecisions[0], dqDecisions[1], dqDecisions[2], dqDecisions[3], dqDecisions[4], dqDecisions[5], dqDecisions[6]); + // dqtable(dqDecisions[0], dqDecisions[1], dqDecisions[2], dqDecisions[3], dqDecisions[4], dqDecisions[5], dqDecisions[6], dqDecisions[7]); // the ElectronMuon trigger is not available now } } @@ -1021,7 +1184,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses) dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "its,tpcpid,dca"); } - if (classStr.Contains("Muon")) { + if (classStr.Contains("Muon") && !classStr.Contains("Electron")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "muon"); } @@ -1032,6 +1195,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses) if (classStr.Contains("Forward")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", "dimuon,vertexing-forward"); } + if (classStr.Contains("ElectronMuon")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", "electronmuon"); + } } } } From 9cc26f052f4fbcd9a8ca48cf98f32134c57f466c Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:59:52 +0100 Subject: [PATCH 47/91] [PWGJE,EMCAL-670] Add LG cell time correction parameters (#8815) Co-authored-by: Nicolas Strangmann --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 253 ++++++++++---------- 1 file changed, 132 insertions(+), 121 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 0a84a66b23b..e2a0b1a3a9d 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -8,14 +8,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -// EMCAL Correction Task -// -/// \author Raymond Ehlers , ORNL -/// \author Florian Jonas +/// +/// EMCAL Correction Task +/// +/// \file emcalCorrectionTask.cxx +/// +/// \brief Task that provides EMCal clusters and applies necessary corrections +/// +/// \author Raymond Ehlers (raymond.ehlers@cern.ch) ORNL, Florian Jonas (florian.jonas@cern.ch) +/// #include -#include #include #include #include @@ -51,12 +54,12 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using myGlobTracks = o2::soa::Join; -using bcEvSels = o2::soa::Join; -using collEventSels = o2::soa::Join; -using filteredCells = o2::soa::Filtered; -using mcCells = o2::soa::Join; -using filteredMCCells = o2::soa::Filtered; +using MyGlobTracks = o2::soa::Join; +using BcEvSels = o2::soa::Join; +using CollEventSels = o2::soa::Join; +using FilteredCells = o2::soa::Filtered; +using McCells = o2::soa::Join; +using FilteredMcCells = o2::soa::Filtered; struct EmcalCorrectionTask { Produces clusters; @@ -68,22 +71,22 @@ struct EmcalCorrectionTask { Produces emcalcollisionmatch; // Preslices - Preslice perCollision = o2::aod::track::collisionId; - PresliceUnsorted collisionsPerFoundBC = aod::evsel::foundBCId; + Preslice perCollision = o2::aod::track::collisionId; + PresliceUnsorted collisionsPerFoundBC = aod::evsel::foundBCId; Preslice collisionsPerBC = aod::collision::bcId; - Preslice cellsPerFoundBC = aod::calo::bcId; - Preslice mcCellsPerFoundBC = aod::calo::bcId; + Preslice cellsPerFoundBC = aod::calo::bcId; + Preslice mcCellsPerFoundBC = aod::calo::bcId; // Options for the clusterization // 1 corresponds to EMCAL cells based on the Run2 definition. Configurable selectedCellType{"selectedCellType", 1, "EMCAL Cell type"}; - Configurable clusterDefinitions{"clusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default. Multiple definitions can be specified separated by comma"}; + Configurable clusterDefinitions{"clusterDefinitions", "kV3Default", "cluster definition to be selected, e.g. V3Default. Multiple definitions can be specified separated by comma"}; Configurable maxMatchingDistance{"maxMatchingDistance", 0.4f, "Max matching distance track-cluster"}; Configurable nonlinearityFunction{"nonlinearityFunction", "DATA_TestbeamFinal", "Nonlinearity correction at cluster level"}; Configurable disableNonLin{"disableNonLin", false, "Disable NonLin correction if set to true"}; Configurable hasShaperCorrection{"hasShaperCorrection", true, "Apply correction for shaper saturation"}; Configurable applyCellAbsScale{"applyCellAbsScale", 0, "Enable absolute cell energy scale to correct for energy loss in material in front of EMCal"}; - Configurable> vCellAbsScaleFactor{"cellAbsScaleFactor", {1.f}, "values for absolute cell energy calibration. Different values correspond to different regions or SM types of EMCal"}; + Configurable> cellAbsScaleFactors{"cellAbsScaleFactors", {1.f}, "values for absolute cell energy calibration. Different values correspond to different regions or SM types of EMCal"}; Configurable logWeight{"logWeight", 4.5, "logarithmic weight for the cluster center of gravity calculation"}; Configurable exoticCellFraction{"exoticCellFraction", 0.97, "Good cell if fraction < 1-ecross/ecell"}; Configurable exoticCellDiffTime{"exoticCellDiffTime", 1.e6, "If time of candidate to exotic and close cell is larger than exoticCellDiffTime (in ns), it must be noisy, set amp to 0"}; @@ -159,7 +162,7 @@ struct EmcalCorrectionTask { mClusterFactories.setExoticCellMinAmplitude(exoticCellMinAmplitude); mClusterFactories.setExoticCellInCrossMinAmplitude(exoticCellInCrossMinAmplitude); mClusterFactories.setUseWeightExotic(useWeightExotic); - for (auto& clusterDefinition : mClusterDefinitions) { + for (const auto& clusterDefinition : mClusterDefinitions) { mClusterizers.emplace_back(std::make_unique>(1E9, clusterDefinition.timeMin, clusterDefinition.timeMax, clusterDefinition.gradientCut, clusterDefinition.doGradientCut, clusterDefinition.seedEnergy, clusterDefinition.minCellEnergy)); LOG(info) << "Cluster definition initialized: " << clusterDefinition.toString(); LOG(info) << "timeMin: " << clusterDefinition.timeMin; @@ -169,7 +172,7 @@ struct EmcalCorrectionTask { LOG(info) << "minCellEnergy: " << clusterDefinition.minCellEnergy; LOG(info) << "storageID" << clusterDefinition.storageID; } - for (auto& clusterizer : mClusterizers) { + for (const auto& clusterizer : mClusterizers) { clusterizer->setGeometry(geometry); } @@ -194,39 +197,38 @@ struct EmcalCorrectionTask { // Setup QA hists. // NOTE: This is not comprehensive. - using o2HistType = o2::framework::HistType; - using o2Axis = o2::framework::AxisSpec; - o2Axis energyAxis{200, 0., 100., "E (GeV)"}, + using O2HistType = o2::framework::HistType; + o2::framework::AxisSpec energyAxis{200, 0., 100., "E (GeV)"}, timeAxis{300, -100, 200., "t (ns)"}, etaAxis{160, -0.8, 0.8, "#eta"}, phiAxis{72, 0, 2 * 3.14159, "phi"}, nlmAxis{50, -0.5, 49.5, "NLM"}; - mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis}); - mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}}); - mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hHGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) - mHistManager.add("hLGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) + mHistManager.add("hCellE", "hCellE", O2HistType::kTH1F, {energyAxis}); + mHistManager.add("hCellTowerID", "hCellTowerID", O2HistType::kTH1D, {{20000, 0, 20000}}); + mHistManager.add("hCellEtaPhi", "hCellEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hHGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) + mHistManager.add("hLGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) // NOTE: Reversed column and row because it's more natural for presentation. - mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); - mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis}); - mHistManager.add("hClusterNLM", "hClusterNLM", o2HistType::kTH1F, {nlmAxis}); - mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hClusterTime", "hClusterTime", o2HistType::kTH1F, {timeAxis}); - mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hGlobalTrackMult", "hGlobalTrackMult", o2HistType::kTH1D, {{200, -0.5, 199.5, "N_{trk}"}}); - mHistManager.add("hCollisionType", "hCollisionType;;#it{count}", o2HistType::kTH1D, {{3, -0.5, 2.5}}); + mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", O2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); + mHistManager.add("hClusterE", "hClusterE", O2HistType::kTH1F, {energyAxis}); + mHistManager.add("hClusterNLM", "hClusterNLM", O2HistType::kTH1F, {nlmAxis}); + mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hClusterTime", "hClusterTime", O2HistType::kTH1F, {timeAxis}); + mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hGlobalTrackMult", "hGlobalTrackMult", O2HistType::kTH1D, {{200, -0.5, 199.5, "N_{trk}"}}); + mHistManager.add("hCollisionType", "hCollisionType;;#it{count}", O2HistType::kTH1D, {{3, -0.5, 2.5}}); auto hCollisionType = mHistManager.get(HIST("hCollisionType")); hCollisionType->GetXaxis()->SetBinLabel(1, "no collision"); hCollisionType->GetXaxis()->SetBinLabel(2, "normal collision"); hCollisionType->GetXaxis()->SetBinLabel(3, "mult. collisions"); - mHistManager.add("hClusterType", "hClusterType;;#it{count}", o2HistType::kTH1D, {{3, -0.5, 2.5}}); + mHistManager.add("hClusterType", "hClusterType;;#it{count}", O2HistType::kTH1D, {{3, -0.5, 2.5}}); auto hClusterType = mHistManager.get(HIST("hClusterType")); hClusterType->GetXaxis()->SetBinLabel(1, "no collision"); hClusterType->GetXaxis()->SetBinLabel(2, "normal collision"); hClusterType->GetXaxis()->SetBinLabel(3, "mult. collisions"); - mHistManager.add("hCollPerBC", "hCollPerBC;#it{N}_{coll.};#it{count}", o2HistType::kTH1D, {{100, -0.5, 99.5}}); - mHistManager.add("hBC", "hBC;;#it{count}", o2HistType::kTH1D, {{8, -0.5, 7.5}}); - mHistManager.add("hCollisionTimeReso", "hCollisionTimeReso;#Delta t_{coll};#it{count}", o2HistType::kTH1D, {{2000, 0, 2000}}); + mHistManager.add("hCollPerBC", "hCollPerBC;#it{N}_{coll.};#it{count}", O2HistType::kTH1D, {{100, -0.5, 99.5}}); + mHistManager.add("hBC", "hBC;;#it{count}", O2HistType::kTH1D, {{8, -0.5, 7.5}}); + mHistManager.add("hCollisionTimeReso", "hCollisionTimeReso;#Delta t_{coll};#it{count}", O2HistType::kTH1D, {{2000, 0, 2000}}); auto hBC = mHistManager.get(HIST("hBC")); hBC->GetXaxis()->SetBinLabel(1, "with EMCal cells"); hBC->GetXaxis()->SetBinLabel(2, "with EMCal cells but no collision"); @@ -237,8 +239,8 @@ struct EmcalCorrectionTask { hBC->GetXaxis()->SetBinLabel(7, "no EMCal cells and mult. collisions"); hBC->GetXaxis()->SetBinLabel(8, "all BC"); if (isMC) { - mHistManager.add("hContributors", "hContributors;contributor per cell hit;#it{counts}", o2HistType::kTH1I, {{20, 0, 20}}); - mHistManager.add("hMCParticleEnergy", "hMCParticleEnergy;#it{E} (GeV/#it{c});#it{counts}", o2HistType::kTH1F, {energyAxis}); + mHistManager.add("hContributors", "hContributors;contributor per cell hit;#it{counts}", O2HistType::kTH1I, {{20, 0, 20}}); + mHistManager.add("hMCParticleEnergy", "hMCParticleEnergy;#it{E} (GeV/#it{c});#it{counts}", O2HistType::kTH1F, {energyAxis}); } } @@ -247,7 +249,7 @@ struct EmcalCorrectionTask { // void process(aod::BCs const& bcs, aod::Collision const& collision, aod::Calos const& cells) // Appears to need the BC to be accessed to be available in the collision table... - void processFull(bcEvSels const& bcs, collEventSels const& collisions, myGlobTracks const& tracks, filteredCells const& cells) + void processFull(BcEvSels const& bcs, CollEventSels const& collisions, MyGlobTracks const& tracks, FilteredCells const& cells) { LOG(debug) << "Starting process full."; @@ -255,7 +257,7 @@ struct EmcalCorrectionTask { int nCellsProcessed = 0; std::unordered_map numberCollsInBC; // Number of collisions mapped to the global BC index of all BCs std::unordered_map numberCellsInBC; // Number of cells mapped to the global BC index of all BCs to check whether EMCal was readout - for (auto bc : bcs) { + for (const auto& bc : bcs) { LOG(debug) << "Next BC"; // Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer. // In particular, we need to filter only EMCAL cells. @@ -276,13 +278,13 @@ struct EmcalCorrectionTask { countBC(collisionsInFoundBC.size(), true); std::vector cellsBC; std::vector cellIndicesBC; - for (auto& cell : cellsInBC) { + for (const auto& cell : cellsInBC) { auto amplitude = cell.amplitude(); if (static_cast(hasShaperCorrection)) { amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude); } if (applyCellAbsScale) { - amplitude *= GetAbsCellScale(cell.cellNumber()); + amplitude *= getAbsCellScale(cell.cellNumber()); } cellsBC.emplace_back(cell.cellNumber(), amplitude, @@ -297,7 +299,7 @@ struct EmcalCorrectionTask { // TODO: Helpful for now, but should be removed. LOG(debug) << "Converted EMCAL cells"; - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); } @@ -315,17 +317,17 @@ struct EmcalCorrectionTask { mHistManager.fill(HIST("hCollisionTimeReso"), col.collisionTimeRes()); mHistManager.fill(HIST("hCollPerBC"), 1); mHistManager.fill(HIST("hCollisionType"), 1); - math_utils::Point3D vertex_pos = {col.posX(), col.posY(), col.posZ()}; + math_utils::Point3D vertexPos = {col.posX(), col.posY(), col.posZ()}; std::vector> clusterToTrackIndexMap; std::vector> trackToClusterIndexMap; - std::tuple>, std::vector>> IndexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; + std::tuple>, std::vector>> indexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; std::vector trackGlobalIndex; - doTrackMatching(col, tracks, IndexMapPair, vertex_pos, trackGlobalIndex); + doTrackMatching(col, tracks, indexMapPair, vertexPos, trackGlobalIndex); // Store the clusters in the table where a matching collision could // be identified. - FillClusterTable(col, vertex_pos, iClusterizer, cellIndicesBC, IndexMapPair, trackGlobalIndex); + fillClusterTable(col, vertexPos, iClusterizer, cellIndicesBC, indexMapPair, trackGlobalIndex); } } } else { // ambiguous @@ -338,7 +340,7 @@ struct EmcalCorrectionTask { hasCollision = true; mHistManager.fill(HIST("hCollisionType"), 2); } - FillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); + fillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); } LOG(debug) << "Cluster loop done for clusterizer " << iClusterizer; @@ -349,7 +351,7 @@ struct EmcalCorrectionTask { // Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC) for (const auto& collision : collisions) { - auto globalbcid = collision.foundBC_as().globalIndex(); + auto globalbcid = collision.foundBC_as().globalIndex(); auto foundColls = numberCollsInBC.find(globalbcid); auto foundCells = numberCellsInBC.find(globalbcid); if (foundColls != numberCollsInBC.end() && foundCells != numberCellsInBC.end()) { @@ -363,7 +365,7 @@ struct EmcalCorrectionTask { } PROCESS_SWITCH(EmcalCorrectionTask, processFull, "run full analysis", true); - void processMCFull(bcEvSels const& bcs, collEventSels const& collisions, myGlobTracks const& tracks, filteredMCCells const& cells, aod::StoredMcParticles_001 const&) + void processMCFull(BcEvSels const& bcs, CollEventSels const& collisions, MyGlobTracks const& tracks, FilteredMcCells const& cells, aod::StoredMcParticles_001 const&) { LOG(debug) << "Starting process full."; @@ -371,7 +373,7 @@ struct EmcalCorrectionTask { int nCellsProcessed = 0; std::unordered_map numberCollsInBC; // Number of collisions mapped to the global BC index of all BCs std::unordered_map numberCellsInBC; // Number of cells mapped to the global BC index of all BCs to check whether EMCal was readout - for (auto bc : bcs) { + for (const auto& bc : bcs) { LOG(debug) << "Next BC"; // Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer. // In particular, we need to filter only EMCAL cells. @@ -393,10 +395,10 @@ struct EmcalCorrectionTask { std::vector cellsBC; std::vector cellIndicesBC; std::vector cellLabels; - for (auto& cell : cellsInBC) { + for (const auto& cell : cellsInBC) { mHistManager.fill(HIST("hContributors"), cell.mcParticle_as().size()); auto cellParticles = cell.mcParticle_as(); - for (auto& cellparticle : cellParticles) { + for (const auto& cellparticle : cellParticles) { mHistManager.fill(HIST("hMCParticleEnergy"), cellparticle.e()); } auto amplitude = cell.amplitude(); @@ -417,7 +419,7 @@ struct EmcalCorrectionTask { // TODO: Helpful for now, but should be removed. LOG(debug) << "Converted EMCAL cells"; - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); } @@ -434,17 +436,17 @@ struct EmcalCorrectionTask { if (col.foundBCId() == bc.globalIndex()) { mHistManager.fill(HIST("hCollPerBC"), 1); mHistManager.fill(HIST("hCollisionType"), 1); - math_utils::Point3D vertex_pos = {col.posX(), col.posY(), col.posZ()}; + math_utils::Point3D vertexPos = {col.posX(), col.posY(), col.posZ()}; std::vector> clusterToTrackIndexMap; std::vector> trackToClusterIndexMap; - std::tuple>, std::vector>> IndexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; + std::tuple>, std::vector>> indexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; std::vector trackGlobalIndex; - doTrackMatching(col, tracks, IndexMapPair, vertex_pos, trackGlobalIndex); + doTrackMatching(col, tracks, indexMapPair, vertexPos, trackGlobalIndex); // Store the clusters in the table where a matching collision could // be identified. - FillClusterTable(col, vertex_pos, iClusterizer, cellIndicesBC, IndexMapPair, trackGlobalIndex); + fillClusterTable(col, vertexPos, iClusterizer, cellIndicesBC, indexMapPair, trackGlobalIndex); } } } else { // ambiguous @@ -457,7 +459,7 @@ struct EmcalCorrectionTask { hasCollision = true; mHistManager.fill(HIST("hCollisionType"), 2); } - FillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); + fillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); } LOG(debug) << "Cluster loop done for clusterizer " << iClusterizer; } // end of clusterizer loop @@ -467,7 +469,7 @@ struct EmcalCorrectionTask { // Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC) for (const auto& collision : collisions) { - auto globalbcid = collision.foundBC_as().globalIndex(); + auto globalbcid = collision.foundBC_as().globalIndex(); auto foundColls = numberCollsInBC.find(globalbcid); auto foundCells = numberCellsInBC.find(globalbcid); if (foundColls != numberCollsInBC.end() && foundCells != numberCellsInBC.end()) { @@ -480,12 +482,12 @@ struct EmcalCorrectionTask { LOG(detail) << "Processed " << nBCsProcessed << " BCs with " << nCellsProcessed << " cells"; } PROCESS_SWITCH(EmcalCorrectionTask, processMCFull, "run full analysis with MC info", false); - void processStandalone(aod::BCs const& bcs, aod::Collisions const& collisions, filteredCells const& cells) + void processStandalone(aod::BCs const& bcs, aod::Collisions const& collisions, FilteredCells const& cells) { LOG(debug) << "Starting process standalone."; int nBCsProcessed = 0; int nCellsProcessed = 0; - for (auto bc : bcs) { + for (const auto& bc : bcs) { LOG(debug) << "Next BC"; // Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer. // In particular, we need to filter only EMCAL cells. @@ -504,7 +506,7 @@ struct EmcalCorrectionTask { countBC(collisionsInBC.size(), true); std::vector cellsBC; std::vector cellIndicesBC; - for (auto& cell : cellsInBC) { + for (const auto& cell : cellsInBC) { cellsBC.emplace_back(cell.cellNumber(), cell.amplitude(), cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude(), o2::emcal::intToChannelType(cell.cellType())), @@ -518,7 +520,7 @@ struct EmcalCorrectionTask { // TODO: Helpful for now, but should be removed. LOG(debug) << "Converted EMCAL cells"; - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); } @@ -535,11 +537,11 @@ struct EmcalCorrectionTask { for (const auto& col : collisionsInBC) { mHistManager.fill(HIST("hCollPerBC"), 1); mHistManager.fill(HIST("hCollisionType"), 1); - math_utils::Point3D vertex_pos = {col.posX(), col.posY(), col.posZ()}; + math_utils::Point3D vertexPos = {col.posX(), col.posY(), col.posZ()}; // Store the clusters in the table where a matching collision could // be identified. - FillClusterTable(col, vertex_pos, iClusterizer, cellIndicesBC); + fillClusterTable(col, vertexPos, iClusterizer, cellIndicesBC); } } else { // ambiguous // LOG(warning) << "No vertex found for event. Assuming (0,0,0)."; @@ -551,7 +553,7 @@ struct EmcalCorrectionTask { hasCollision = true; mHistManager.fill(HIST("hCollisionType"), 2); } - FillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); + fillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); } LOG(debug) << "Cluster loop done for clusterizer " << iClusterizer; @@ -599,7 +601,7 @@ struct EmcalCorrectionTask { } template - void FillClusterTable(Collision const& col, math_utils::Point3D const& vertex_pos, size_t iClusterizer, const gsl::span cellIndicesBC, std::optional>, std::vector>>> const& IndexMapPair = std::nullopt, std::optional> const& trackGlobalIndex = std::nullopt) + void fillClusterTable(Collision const& col, math_utils::Point3D const& vertexPos, size_t iClusterizer, const gsl::span cellIndicesBC, std::optional>, std::vector>>> const& indexMapPair = std::nullopt, std::optional> const& trackGlobalIndex = std::nullopt) { // we found a collision, put the clusters into the none ambiguous table clusters.reserve(mAnalysisClusters.size()); @@ -611,7 +613,7 @@ struct EmcalCorrectionTask { for (const auto& cluster : mAnalysisClusters) { // Determine the cluster eta, phi, correcting for the vertex position. auto pos = cluster.getGlobalPosition(); - pos = pos - vertex_pos; + pos = pos - vertexPos; // Normalize the vector and rescale by energy. pos *= (cluster.E() / std::sqrt(pos.Mag2())); @@ -651,11 +653,11 @@ struct EmcalCorrectionTask { mHistManager.fill(HIST("hClusterNLM"), cluster.getNExMax()); mHistManager.fill(HIST("hClusterTime"), cluster.getClusterTime()); mHistManager.fill(HIST("hClusterEtaPhi"), pos.Eta(), TVector2::Phi_0_2pi(pos.Phi())); - if (IndexMapPair && trackGlobalIndex) { - for (unsigned int iTrack = 0; iTrack < std::get<0>(*IndexMapPair)[iCluster].size(); iTrack++) { - if (std::get<0>(*IndexMapPair)[iCluster][iTrack] >= 0) { - LOG(debug) << "Found track " << (*trackGlobalIndex)[std::get<0>(*IndexMapPair)[iCluster][iTrack]] << " in cluster " << cluster.getID(); - matchedTracks(clusters.lastIndex(), (*trackGlobalIndex)[std::get<0>(*IndexMapPair)[iCluster][iTrack]]); + if (indexMapPair && trackGlobalIndex) { + for (unsigned int iTrack = 0; iTrack < std::get<0>(*indexMapPair)[iCluster].size(); iTrack++) { + if (std::get<0>(*indexMapPair)[iCluster][iTrack] >= 0) { + LOG(debug) << "Found track " << (*trackGlobalIndex)[std::get<0>(*indexMapPair)[iCluster][iTrack]] << " in cluster " << cluster.getID(); + matchedTracks(clusters.lastIndex(), (*trackGlobalIndex)[std::get<0>(*indexMapPair)[iCluster][iTrack]]); } } } @@ -664,7 +666,7 @@ struct EmcalCorrectionTask { } template - void FillAmbigousClusterTable(BC const& bc, size_t iClusterizer, const gsl::span cellIndicesBC, bool hasCollision) + void fillAmbigousClusterTable(BC const& bc, size_t iClusterizer, const gsl::span cellIndicesBC, bool hasCollision) { int cellindex = -1; clustersAmbiguous.reserve(mAnalysisClusters.size()); @@ -706,23 +708,23 @@ struct EmcalCorrectionTask { } template - void doTrackMatching(Collision const& col, myGlobTracks const& tracks, std::tuple>, std::vector>>& IndexMapPair, math_utils::Point3D& vertex_pos, std::vector& trackGlobalIndex) + void doTrackMatching(Collision const& col, MyGlobTracks const& tracks, std::tuple>, std::vector>>& indexMapPair, math_utils::Point3D& vertexPos, std::vector& trackGlobalIndex) { auto groupedTracks = tracks.sliceBy(perCollision, col.globalIndex()); - int NTracksInCol = groupedTracks.size(); + int nTracksInCol = groupedTracks.size(); std::vector trackPhi; std::vector trackEta; // reserve memory to reduce on the fly memory allocation - trackPhi.reserve(NTracksInCol); - trackEta.reserve(NTracksInCol); - trackGlobalIndex.reserve(NTracksInCol); - FillTrackInfo(groupedTracks, trackPhi, trackEta, trackGlobalIndex); + trackPhi.reserve(nTracksInCol); + trackEta.reserve(nTracksInCol); + trackGlobalIndex.reserve(nTracksInCol); + fillTrackInfo(groupedTracks, trackPhi, trackEta, trackGlobalIndex); - int NClusterInCol = mAnalysisClusters.size(); + int nClusterInCol = mAnalysisClusters.size(); std::vector clusterPhi; std::vector clusterEta; - clusterPhi.reserve(NClusterInCol); - clusterEta.reserve(NClusterInCol); + clusterPhi.reserve(nClusterInCol); + clusterEta.reserve(nClusterInCol); // TODO one loop that could in principle be combined with the other // loop to improve performance @@ -730,40 +732,40 @@ struct EmcalCorrectionTask { // Determine the cluster eta, phi, correcting for the vertex // position. auto pos = cluster.getGlobalPosition(); - pos = pos - vertex_pos; + pos = pos - vertexPos; // Normalize the vector and rescale by energy. pos *= (cluster.E() / std::sqrt(pos.Mag2())); clusterPhi.emplace_back(TVector2::Phi_0_2pi(pos.Phi())); clusterEta.emplace_back(pos.Eta()); } - IndexMapPair = + indexMapPair = jetutilities::MatchClustersAndTracks(clusterPhi, clusterEta, trackPhi, trackEta, maxMatchingDistance, 20); } template - void FillTrackInfo(Tracks const& tracks, std::vector& trackPhi, std::vector& trackEta, std::vector& trackGlobalIndex) + void fillTrackInfo(Tracks const& tracks, std::vector& trackPhi, std::vector& trackEta, std::vector& trackGlobalIndex) { - int NTrack = 0; - for (auto& track : tracks) { + int nTrack = 0; + for (const auto& track : tracks) { // TODO only consider tracks in current emcal/dcal acceptanc if (!track.isGlobalTrack()) { // only global tracks continue; } - NTrack++; + nTrack++; trackPhi.emplace_back(TVector2::Phi_0_2pi(track.trackPhiEmcal())); trackEta.emplace_back(track.trackEtaEmcal()); mHistManager.fill(HIST("hGlobalTrackEtaPhi"), track.trackEtaEmcal(), TVector2::Phi_0_2pi(track.trackPhiEmcal())); trackGlobalIndex.emplace_back(track.globalIndex()); } - mHistManager.fill(HIST("hGlobalTrackMult"), NTrack); + mHistManager.fill(HIST("hGlobalTrackMult"), nTrack); } - void countBC(int numberOfCollisions, bool hasEMCcells) + void countBC(int numberOfCollisions, bool hasEMCCells) { - int emcDataOffset = hasEMCcells ? 0 : 3; + int emcDataOffset = hasEMCCells ? 0 : 3; int collisionOffset = 2; switch (numberOfCollisions) { case 0: @@ -777,7 +779,7 @@ struct EmcalCorrectionTask { break; } mHistManager.fill(HIST("hBC"), 7); // All collisions - if (hasEMCcells) { + if (hasEMCCells) { mHistManager.fill(HIST("hBC"), 0); } mHistManager.fill(HIST("hBC"), 1 + emcDataOffset + collisionOffset); @@ -787,7 +789,7 @@ struct EmcalCorrectionTask { { // Cell QA // For convenience, use the clusterizer stored geometry to get the eta-phi - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { mHistManager.fill(HIST("hCellE"), cell.getEnergy()); if (cell.getLowGain()) mHistManager.fill(HIST("hLGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); @@ -802,18 +804,18 @@ struct EmcalCorrectionTask { } } - float GetAbsCellScale(const int cellID) + float getAbsCellScale(const int cellID) { // Apply cell scale based on SM types (Full, Half (not used), EMC 1/3, DCal, DCal 1/3) // Same as in Run2 data if (applyCellAbsScale == 1) { int iSM = mClusterizers.at(0)->getGeometry()->GetSuperModuleNumber(cellID); - return vCellAbsScaleFactor.value[mClusterizers.at(0)->getGeometry()->GetSMType(iSM)]; + return cellAbsScaleFactors.value[mClusterizers.at(0)->getGeometry()->GetSMType(iSM)]; // Apply cell scale based on columns to accoutn for material of TRD structures } else if (applyCellAbsScale == 2) { auto res = mClusterizers.at(0)->getGeometry()->GlobalRowColFromIndex(cellID); - return vCellAbsScaleFactor.value[std::get<1>(res)]; + return cellAbsScaleFactors.value[std::get<1>(res)]; } else { return 1.f; } @@ -822,41 +824,50 @@ struct EmcalCorrectionTask { // Apply shift of the cell time in data and MC // In MC this has to be done to shift the cell time, which is not calibrated to 0 due to the flight time of the particles to the EMCal surface (~15ns) // In data this is done to correct for the time walk effect - float getCellTimeShift(const int16_t cellID, const float cellEnergy, const o2::emcal::ChannelType_t cellType) + float getCellTimeShift(const int16_t cellID, const float cellEnergy, const emcal::ChannelType_t cellType) { if (!applyCellTimeCorrection) { return 0.f; } float timeshift = 0.f; float timesmear = 0.f; - if (isMC) { + if (isMC) { // ---> MC // Shift the time to 0, as the TOF was simulated -> eta dependent shift (as larger eta values are further away from collision point) // Use distance between vertex and EMCal (at eta = 0) and distance on EMCal surface (cell size times column) to calculate distance to cell // 0.2 is cell size in m (0.06) divided by the speed of light in m/ns (0.3) - 47.5 is the "middle" of the EMCal (2*48 cells in one column) float timeCol = 0.2f * (geometry->GlobalCol(cellID) - 47.5f); // calculate time to get to specific column - timeshift = -sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0) + timeshift = -std::sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0) + // Also smear the time to account for the broader time resolution in data than in MC - timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods - } else { // data - if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration - timeshift = 0.; - } else if (cellType == o2::emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies - if (cellEnergy < 4.) // Low energy regime - timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods - else // Medium energy regime - timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods - } else if (cellType == o2::emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies - timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), will be updated by LHC24aj input + if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + timesmear = 0.; // They will therefore not be smeared and only get their shift + else if (cellType == emcal::ChannelType_t::HIGH_GAIN) // High gain cells -> Low energies + timesmear = normalgaus(rdgen) * (1.6 + 9.5 * std::exp(-3. * cellEnergy)); // Parameters extracted from LHC24f3b & LHC22o (pp), but also usable for other periods + else if (cellType == emcal::ChannelType_t::LOW_GAIN) // Low gain cells -> High energies + timesmear = normalgaus(rdgen) * (5.0); // Parameters extracted from LHC24g4 & LHC24aj (pp), but also usable for other periods + + } else { // ---> Data + if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + timeshift = 0.; // In data they will not be shifted (they are close to 0 anyways) + } else if (cellType == emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies + if (cellEnergy < 4.) // Low energy regime + timeshift = 0.8 * std::log(2.7 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + else // Medium energy regime + timeshift = 1.5 * std::log(0.9 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else if (cellType == emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies + if (cellEnergy < 30.) // High energy regime + timeshift = 1.9 * std::log(0.09 * cellEnergy); // Parameters extracted from LHC24aj (pp), but also usable for other periods + else // Very high energy regime + timeshift = 1.9; // Parameters extracted from LHC24aj (pp), but also usable for other periods } + LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; + return timeshift + timesmear; } - - LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; - return timeshift + timesmear; - } + }; }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"emcal-correction-task"})}; + adaptAnalysisTask(cfgc)}; } From 97a03c01f0a184e7b6b915549798ae02e67d4cd6 Mon Sep 17 00:00:00 2001 From: Sandeep Dudi <69388148+sdudi123@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:34:29 +0530 Subject: [PATCH 48/91] [PWGUD] mixed event bkg added (#8812) Co-authored-by: Sandeep Dudi --- PWGUD/Tasks/sginclusivePhiKstarSD.cxx | 314 ++++++++++++++++++++++---- 1 file changed, 266 insertions(+), 48 deletions(-) diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index 90b692a9af3..29cab7ee483 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -13,21 +13,27 @@ // \since May 2024 #include +#include +#include +#include +#include +#include "Math/Vector4D.h" +#include "Math/Vector3D.h" +#include "Math/GenVector/Boost.h" + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" #include "Framework/ASoAHelpers.h" +#include "ReconstructionDataFormats/Vertex.h" + #include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/Core/UPCHelpers.h" + #include "Common/DataModel/PIDResponse.h" -#include -#include "TLorentzVector.h" -#include -#include "Math/Vector4D.h" -#include "Math/Vector3D.h" -#include "Math/GenVector/Boost.h" using namespace std; using namespace o2; @@ -59,17 +65,22 @@ struct SGResonanceAnalyzer { Configurable itsChi2_cut{"itsChi2_cut", 36, "Max itsChi2NCl"}; Configurable eta_cut{"eta_cut", 0.9, "Track Pseudorapidity"}; Configurable pt_cut{"pt_cut", 0.15, "Track pt cut"}; + Configurable pt1{"pt1", 0.3, "pid selection pt1"}; + Configurable pt2{"pt2", 0.4, "pid selection pt2"}; + Configurable pt3{"pt3", 0.5, "pid selection pt3"}; Configurable EtaGapMin{"EtaGapMin", 0.0, "Track eta min"}; Configurable EtaGapMax{"EtaGapMax", 0.9, "Track eta min"}; Configurable EtaDG{"EtaDG", 0.5, "Track eta DG"}; + Configurable nsigmatpc_cut1{"nsigmatpc1", 3.0, "nsigma tpc cut1"}; + Configurable nsigmatpc_cut2{"nsigmatpc2", 3.0, "nsigma tpc cut2"}; + Configurable nsigmatpc_cut3{"nsigmatpc3", 3.0, "nsigma tpc cut3"}; Configurable nsigmatpc_cut{"nsigmatpc", 3.0, "nsigma tpc cut"}; Configurable nsigmatof_cut{"nsigmatof", 9.0, "nsigma tof cut"}; Configurable mintrack{"min_track", 1, "min track"}; Configurable maxtrack{"max_track", 50, "max track"}; - Configurable use_tof{"Use_TOF", true, "TOF PID"}; Configurable QA{"QA", true, ""}; Configurable rapidity_gap{"rapidity_gap", true, ""}; @@ -78,17 +89,32 @@ struct SGResonanceAnalyzer { Configurable rho{"rho", true, ""}; Configurable kstar{"kstar", true, ""}; Configurable fourpion{"fourpion", true, ""}; + + Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 1, "Number of mixed events per event"}; + Configurable nBkgRotations{"nBkgRotations", 9, "Number of rotated copies (background) per each original candidate"}; + Configurable fillRotation{"fillRotation", true, "fill rotation"}; + Configurable confMinRot{"confMinRot", 5.0 * TMath::Pi() / 6.0, "Minimum of rotation"}; + Configurable confMaxRot{"confMaxRot", 7.0 * TMath::Pi() / 6.0, "Maximum of rotation"}; + void init(InitContext const&) { registry.add("GapSide", "Gap Side; Entries", kTH1F, {{4, -1.5, 2.5}}); registry.add("TrueGapSide", "Gap Side; Entries", kTH1F, {{4, -1.5, 2.5}}); if (phi) { - registry.add("os_KK_pT_0", "pt kaon pair", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_pT_1", "pt kaon pair", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_pT_2", "pt kaon pair", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_ls_pT_0", "kaon pair like sign", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_ls_pT_1", "kaon pair like sign", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_ls_pT_2", "kaon pair like sign", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_pT_0", "pt kaon pair", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_pT_1", "pt kaon pair", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_pT_2", "pt kaon pair", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_ls_pT_0", "kaon pair like sign", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_ls_pT_1", "kaon pair like sign", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_ls_pT_2", "kaon pair like sign", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_KK_mix_pT_0", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_mix_pT_1", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_mix_pT_2", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_KK_rot_pT_0", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_rot_pT_1", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_rot_pT_2", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); } if (rho) { registry.add("os_pp_pT_0", "pt pion pair", kTH3F, {{120, 1.44, 2.04}, {80, -2.0, 2.0}, {100, 0, 10}}); @@ -102,13 +128,26 @@ struct SGResonanceAnalyzer { registry.add("os_pk_pT_0", "pion-kaon pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_pT_1", "pion-kaon pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_pT_2", "pion-kaon pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_pk_mix_pT_0", "pion-kaon mix pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_mix_pT_1", "pion-kaon mix pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_mix_pT_2", "pion-kaon mix pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_pk_rot_pT_0", "pion-kaon rotional pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_rot_pT_1", "pion-kaon rotional pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_rot_pT_2", "pion-kaon rotional pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_ls_pT_0", "pion-kaon pair like sign", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_ls_pT_1", "pion-kaon like sign", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_ls_pT_2", "pion-kaon like sign", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("hRotation", "hRotation", kTH1F, {{360, 0.0, 2.0 * TMath::Pi()}}); } // QA plots if (QA) { registry.add("tpc_dedx", "p vs dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); + registry.add("tof_beta", "p vs beta", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); + registry.add("tpc_dedx_kaon", "p#k dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); registry.add("tpc_dedx_pion", "p#pi dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); registry.add("tpc_dedx_kaon_1", "tpc+tof pid cut p#k dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); @@ -119,6 +158,9 @@ struct SGResonanceAnalyzer { registry.add("tpc_tof_nsigma_kaon", "p#k n#sigma TPC vs TOF", kTH2F, {{100, -10.0, 10.0}, {100, -10.0, 10.0}}); registry.add("tpc_tof_nsigma_pion", "p#pi n#sigma TPC vs TOF", kTH2F, {{100, -10.0, 10.0}, {100, -10.0, 10.0}}); + registry.add("tof_nsigma_kaon", "p#k n#sigma", kTH2F, {{100, 0.0, 10.0}, {100, -10.0, 10.0}}); + registry.add("tof_nsigma_pion", "p#pi n#sigma", kTH2F, {{100, 0.0, 10.0}, {100, -10.0, 10.0}}); + registry.add("FT0A", "T0A amplitude", kTH1F, {{500, 0.0, 500.0}}); registry.add("FT0A_0", "T0A amplitude", kTH1F, {{500, 0.0, 500.0}}); registry.add("FT0A_1", "T0A amplitude", kTH1F, {{20000, 0.0, 20000.0}}); @@ -150,31 +192,32 @@ struct SGResonanceAnalyzer { registry.add("rap2_mult3", "rap2_mult3", kTH1F, {{150, 0, 150}}); } } + registry.add("gap_mult0", "Mult 0", kTH1F, {{100, 0.0, 100.0}}); registry.add("gap_mult1", "Mult 1", kTH1F, {{100, 0.0, 100.0}}); registry.add("gap_mult2", "Mult 2", kTH1F, {{100, 0.0, 100.0}}); // Multiplicity plot if (rapidity_gap && phi) { - registry.add("os_kk_mass_rap", "phi mass1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass_rap1", "phi mass2", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass_rap2", "phi mass3", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass1_rap", "phi mass1 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass1_rap1", "phi mass2 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass1_rap2", "phi mass3 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass2_rap", "phi mass1 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass2_rap1", "phi mass2 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass2_rap2", "phi mass3 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass_rap", "phi mass1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass_rap1", "phi mass2", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass_rap2", "phi mass3", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass1_rap", "phi mass1 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass1_rap1", "phi mass2 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass1_rap2", "phi mass3 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass2_rap", "phi mass1 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass2_rap1", "phi mass2 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass2_rap2", "phi mass3 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); // like sign bkg - registry.add("os_kk_ls_mass_rap", "phi ls mass1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass_rap1", "phi ls mass2", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass_rap2", "phi ls mass3", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass1_rap", "phi ls mass1 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass1_rap1", "phi ls mass2 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass1_rap2", "phi ls mass3 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass2_rap", "phi ls mass1 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass2_rap1", "phi ls mass2 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass2_rap2", "phi ls mass3 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass_rap", "phi ls mass1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass_rap1", "phi ls mass2", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass_rap2", "phi ls mass3", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass1_rap", "phi ls mass1 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass1_rap1", "phi ls mass2 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass1_rap2", "phi ls mass3 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass2_rap", "phi ls mass1 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass2_rap1", "phi ls mass2 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass2_rap2", "phi ls mass3 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); } if (rapidity_gap && kstar) { @@ -246,6 +289,53 @@ struct SGResonanceAnalyzer { Double_t CosThetaCS = zaxis_CS.Dot((v1_CM)); return CosThetaCS; } + + template + bool selectionPIDKaon1(const T& candidate) + { + auto pt = TMath::Sqrt(candidate.px() * candidate.px() + candidate.py() * candidate.py()); + // float pt1, pt2, pt3 , nsigmatpc_cut1, nsigmatpc_cut2, nsigmatpc_cut3; + if (use_tof && pt < pt1 && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut1) { + return true; + } + if (use_tof && pt >= pt1 && pt < pt2 && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut2) { + return true; + } + if (use_tof && pt >= pt2 && pt < pt3 && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut3) { + return true; + } + if (pt > pt3 && use_tof && candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < nsigmatof_cut) { + return true; + } + if (!use_tof && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut) { + return true; + } + return false; + } + + template + bool selectionPIDPion1(const T& candidate) + { + auto pt = TMath::Sqrt(candidate.px() * candidate.px() + candidate.py() * candidate.py()); + + if (use_tof && pt < pt1 && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut1) { + return true; + } + if (use_tof && pt >= pt1 && pt < pt2 && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut2) { + return true; + } + if (use_tof && pt >= pt2 && pt < pt3 && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut3) { + return true; + } + if (pt > pt3 && use_tof && candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < nsigmatof_cut) { + return true; + } + if (!use_tof && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut) { + return true; + } + return false; + } + //------------------------------------------------------------------------------------------------------ Double_t PhiCollinsSoperFrame(ROOT::Math::PtEtaPhiMVector pair1, ROOT::Math::PtEtaPhiMVector pair2, ROOT::Math::PtEtaPhiMVector fourpion) { @@ -285,6 +375,11 @@ struct SGResonanceAnalyzer { TLorentzVector v1; TLorentzVector v01; TLorentzVector v0_1; + int gapSide = collision.gapSide(); + float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; + std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; + int truegapSide = sgSelector.trueGap(collision, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + ROOT::Math::PtEtaPhiMVector phiv; ROOT::Math::PtEtaPhiMVector phiv1; @@ -297,10 +392,6 @@ struct SGResonanceAnalyzer { std::vector onlyPionTracks_n; std::vector rawPionTracks_n; - int gapSide = collision.gapSide(); - float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; - std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; - int truegapSide = sgSelector.trueGap(collision, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); registry.fill(HIST("GapSide"), gapSide); registry.fill(HIST("TrueGapSide"), truegapSide); gapSide = truegapSide; @@ -331,7 +422,7 @@ struct SGResonanceAnalyzer { continue; v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassPionCharged); ROOT::Math::PtEtaPhiMVector vv1(v0.Pt(), v0.Eta(), v0.Phi(), o2::constants::physics::MassPionCharged); - if (selectionPIDPion(track1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (selectionPIDPion1(track1)) { onlyPionTracks_pm.push_back(vv1); rawPionTracks_pm.push_back(track1); if (track1.sign() == 1) { @@ -371,20 +462,24 @@ struct SGResonanceAnalyzer { if (QA) { registry.fill(HIST("tpc_dedx"), v0.P(), track1.tpcSignal()); + registry.fill(HIST("tof_beta"), v0.P(), track1.beta()); + registry.fill(HIST("tof_nsigma_kaon"), v0.Pt(), track1.tofNSigmaKa()); + registry.fill(HIST("tof_nsigma_pion"), v0.Pt(), track1.tofNSigmaPi()); + if (std::abs(track1.tpcNSigmaKa()) < 3.0) { registry.fill(HIST("tpc_dedx_kaon"), v0.P(), track1.tpcSignal()); } else if (std::abs(track1.tpcNSigmaPi()) < 3.0) { registry.fill(HIST("tpc_dedx_pion"), v0.P(), track1.tpcSignal()); } - if (selectionPIDKaon(track1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (selectionPIDKaon1(track1)) { registry.fill(HIST("tpc_dedx_kaon_1"), v0.P(), track1.tpcSignal()); registry.fill(HIST("tpc_nsigma_kaon"), v0.Pt(), track1.tpcNSigmaKa()); registry.fill(HIST("tpc_tof_nsigma_kaon"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); } - if (selectionPIDKaon(track1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(track1.tpcNSigmaPi()) > 3.0) { + if (selectionPIDKaon1(track1) && std::abs(track1.tpcNSigmaPi()) > 3.0) { registry.fill(HIST("tpc_dedx_kaon_2"), v0.P(), track1.tpcSignal()); } - if (selectionPIDPion(track1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (selectionPIDPion1(track1)) { registry.fill(HIST("tpc_dedx_pion_1"), v0.P(), track1.tpcSignal()); registry.fill(HIST("tpc_nsigma_pion"), v0.Pt(), track1.tpcNSigmaPi()); registry.fill(HIST("tpc_tof_nsigma_pion"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); @@ -467,7 +562,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -496,7 +591,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -532,7 +627,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -561,7 +656,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -596,7 +691,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -625,7 +720,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -661,7 +756,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -690,8 +785,36 @@ struct SGResonanceAnalyzer { registry.fill(HIST("os_KK_ls_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); } } + + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) { + auto anglestart = confMinRot; + auto angleend = confMaxRot; + auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1)); + auto rotangle = anglestart + nrotbkg * anglestep; + registry.fill(HIST("hRotation"), rotangle); + + auto rotkaonPx = t0.px() * std::cos(rotangle) - t0.py() * std::sin(rotangle); + auto rotkaonPy = t0.px() * std::sin(rotangle) + t0.py() * std::cos(rotangle); + + v0.SetXYZM(rotkaonPx, rotkaonPy, t0.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); + v01 = v0 + v1; + if (t0.sign() != t1.sign()) { + if (gapSide == 0) { + registry.fill(HIST("os_KK_rot_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 1) { + registry.fill(HIST("os_KK_rot_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 2) { + registry.fill(HIST("os_KK_rot_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + } } - if (rho && selectionPIDProton(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (rho && selectionPIDPion1(t0) && selectionPIDPion1(t1)) { v0.SetXYZM(t0.px(), t0.py(), t0.pz(), mproton); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; @@ -719,7 +842,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; @@ -746,6 +869,33 @@ struct SGResonanceAnalyzer { registry.fill(HIST("os_pk_ls_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); } } + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) { + auto anglestart = confMinRot; + auto angleend = confMaxRot; + auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1)); + auto rotangle = anglestart + nrotbkg * anglestep; + registry.fill(HIST("hRotation"), rotangle); + + auto rotkaonPx = t0.px() * std::cos(rotangle) - t0.py() * std::sin(rotangle); + auto rotkaonPy = t0.px() * std::sin(rotangle) + t0.py() * std::cos(rotangle); + + v0.SetXYZM(rotkaonPx, rotkaonPy, t0.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); + v01 = v0 + v1; + if (t0.sign() != t1.sign()) { + if (gapSide == 0) { + registry.fill(HIST("os_pk_rot_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 1) { + registry.fill(HIST("os_pk_rot_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 2) { + registry.fill(HIST("os_pk_rot_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + } } } if (fourpion) { @@ -791,6 +941,74 @@ struct SGResonanceAnalyzer { } } } + PROCESS_SWITCH(SGResonanceAnalyzer, process, "Process unlike event", false); + + using UDCollisionsFull1 = soa::Join; // + SliceCache cache; + Partition posTracks = aod::udtrack::sign > 0; + Partition negTracks = aod::udtrack::sign < 0; + + ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for bin"}; + ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for bin"}; + using BinningTypeVertexContributor = ColumnBinningPolicy; + void mixprocess(UDCollisionsFull1 const& collisions, udtracksfull const& track) + { + TLorentzVector v0; + TLorentzVector v1; + TLorentzVector v01; + float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; + std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; + BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicityClass}, true}; + for (auto const& [collision1, collision2] : o2::soa::selfCombinations(binningOnPositions, cfgNoMixedEvents, -1, collisions, collisions)) { + int truegapSide1 = sgSelector.trueGap(collision1, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + int truegapSide2 = sgSelector.trueGap(collision2, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + if (truegapSide1 != truegapSide2) + continue; + if (truegapSide1 == -1) + continue; + auto posThisColl = posTracks->sliceByCached(aod::udtrack::udCollisionId, collision1.globalIndex(), cache); + auto negThisColl = negTracks->sliceByCached(aod::udtrack::udCollisionId, collision2.globalIndex(), cache); + for (auto& [track1, track2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(posThisColl, negThisColl))) { + if (!trackselector(track1, parameters) || !trackselector(track2, parameters)) + continue; + if (selectionPIDKaon1(track1) && selectionPIDKaon1(track2)) { + v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(track2.px(), track2.py(), track2.pz(), o2::constants::physics::MassKaonCharged); + v01 = v0 + v1; + // Opposite sign pairs + if (track1.sign() != track2.sign()) { + if (truegapSide1 == 0) { + registry.fill(HIST("os_KK_mix_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 1) { + registry.fill(HIST("os_KK_mix_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 2) { + registry.fill(HIST("os_KK_mix_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + if (selectionPIDKaon1(track1) && std::abs(track1.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(track2) && std::abs(track2.tpcNSigmaKa()) > 3.0) { + v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(track2.px(), track2.py(), track2.pz(), o2::constants::physics::MassPionCharged); + v01 = v0 + v1; + // Opposite sign pairs + if (track1.sign() != track2.sign()) { + if (truegapSide1 == 0) { + registry.fill(HIST("os_pk_mix_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 1) { + registry.fill(HIST("os_pk_mix_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 2) { + registry.fill(HIST("os_pk_mix_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + } + } + } + PROCESS_SWITCH(SGResonanceAnalyzer, mixprocess, "Process Mixed event", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From e631987dc26c4a2bc3d29fac6d521a21759ae8c3 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:29:49 +0100 Subject: [PATCH 49/91] =?UTF-8?q?[PWGDQ]=20Revert=20"[PWGDQ]=20Adding=20Tp?= =?UTF-8?q?rofiles=20with=20Cumulants=20weights=20+=20fixing=20Pi=20consta?= =?UTF-8?q?nt=20=E2=80=A6"=20(#8818)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGDQ/Core/HistogramsLibrary.cxx | 88 ++++++++++++++++++++------------ PWGDQ/Core/HistogramsLibrary.h | 1 - 2 files changed, 55 insertions(+), 34 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 13ba242d8e8..4bc43fe386e 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,7 +13,6 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" #include "VarManager.h" -#include "CommonConstants/MathConstants.h" void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) { @@ -276,9 +275,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); - hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); - hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); @@ -384,8 +380,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (!groupStr.CompareTo("track")) { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); - hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("ambiguity") && !subGroupStr.Contains("muon")) { @@ -397,10 +393,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("cent")) { hm->AddHistogram(histClass, "Pt_CentFT0C", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt, 20, 0.0, 100.0, VarManager::kCentFT0C); hm->AddHistogram(histClass, "Eta_CentFT0C", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C); - hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); + hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); } if (subGroupStr.Contains("kine")) { - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "Eta_Pt", "", false, 20, -1.0, 1.0, VarManager::kEta, 100, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta_VtxZ", "", false, 100, -1.0, 1.0, VarManager::kEta, 300, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "Px", "p_{x} distribution", false, 200, 0.0, 20.0, VarManager::kPx); @@ -459,8 +455,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_vsTimeFromSOR", "Number of cluster in TPC vs time from SOR", true, 10000, 0.0, 1000., VarManager::kTimeFromSOR, 160, -0.5, 159.5, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "TPCncls_TPCnclsCR", "Number of TPC cluster vs Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "IsTPCrefit", "", false, 2, -0.5, 1.5, VarManager::kIsTPCrefit); @@ -773,14 +769,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCHBitMap_vs_pt", "MCH vs pt", false, 1025, 0.0, 1025.0, VarManager::kMCHBitMap, 400, 0, 100, VarManager::kPt); hm->AddHistogram(histClass, "MuonTime", "", false, 100, -1.0, 1.0, VarManager::kMuonTime); hm->AddHistogram(histClass, "MuonTimeRes", "", false, 100, -1.0, 1.0, VarManager::kMuonTimeRes); - hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); - hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); @@ -803,7 +799,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta); - hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 50, 0.0, o2::constants::math::TwoPI, VarManager::kMCPhi); + hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kPhi, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); hm->AddHistogram(histClass, "TrackPDGcode", "PDG code of track", false, 10001, -5000, 5000, VarManager::kMCPdgCode); } if (subGroupStr.Contains("mcmother")) { @@ -824,7 +820,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1); hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Eta_Pt_Photon", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPairPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPairPhi); hm->AddHistogram(histClass, "Mass_Dilepton", "", false, 4500, 0.0, 4.5, VarManager::kPairMassDau); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Photon", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); @@ -846,7 +842,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 5.0, VarManager::kMass); hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); @@ -891,12 +887,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("polarization")) { hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "PhiHE", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); - hm->AddHistogram(histClass, "PhiCS", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); + hm->AddHistogram(histClass, "PhiHE", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); + hm->AddHistogram(histClass, "PhiCS", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); - hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); + hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); + hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); @@ -1060,6 +1056,18 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_phiCS", "", 4, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); hm->AddHistogram(histClass, "Mass_y_cosThetaCS_phiCS", "", 4, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp")) { + int varspTCS[3] = {VarManager::kMass, VarManager::kPt, VarManager::kPhiVP}; + int varsrapCS[3] = {VarManager::kMass, VarManager::kRap, VarManager::kPhiVP}; + int binspT[3] = {100, 20, 24}; + int binsy[3] = {100, 10, 24}; + double xminpT[3] = {1., 0., 0.}; + double xmaxpT[3] = {5., 20., +3.14}; + double xminy[3] = {1., 2.5, 0.}; + double xmaxy[3] = {5., 4.0, +3.14}; + hm->AddHistogram(histClass, "Mass_Pt_phiVP", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + hm->AddHistogram(histClass, "Mass_y_phiVP", "", 3, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap")) { int vars[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kRap}; int binspT[4] = {150, 200, 10, 6}; @@ -1095,6 +1103,20 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h double xmaxpT[5] = {1.2, 3., 100, 1., 3.14}; hm->AddHistogram(histClass, "Mass_Pt_Cent_cosThetaCS_lowmass", "", 5, varsCSpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {150, 30, 10, 24}; + double xminpT[4] = {2., 0., 0, 0.}; + double xmaxpT[4] = {5., 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } + if (subGroupStr.Contains("dimuon-polarization-lowmass-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {200, 30, 10, 24}; + double xminpT[4] = {0.2, 0., 0, 0.}; + double xmaxpT[4] = {1.2, 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP_lowmass", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap-polarization-he-pbpb")) { int varsHEpbpb[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kCosThetaHE, VarManager::kRap}; int binspT[5] = {150, 30, 10, 10, 6}; @@ -1226,19 +1248,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "DeltaPhiPair", "", false, 130, -6.5, 6.5, VarManager::kDeltaPhiPair); } if (subGroupStr.Contains("correlation-emu")) { - hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2); hm->AddHistogram(histClass, "DeltaEtaPair2", "", false, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); - hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); } if (subGroupStr.Contains("dielectrons")) { if (subGroupStr.Contains("prefilter")) { hm->AddHistogram(histClass, "MassLow_OpeningAngle", "", false, 150, 0., 0.15, VarManager::kMass, 80, 0., 0.8, VarManager::kOpeningAngle); } if (subGroupStr.Contains("phiv")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv); } if (subGroupStr.Contains("double-phi-v")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv, "", "", "", -1, -1, true); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv, "", "", "", -1, -1, true); } if (subGroupStr.Contains("largemass-phi-v")) { // binning for mee at large scales: @@ -1265,7 +1287,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h // steps of size pi/100 double phiv_bins[101]; for (int i = 0; i <= 100; i++) - phiv_bins[i] = o2::constants::math::PI / 100. * i; + phiv_bins[i] = TMath::Pi() / 100. * i; int nbins_phiv = sizeof(phiv_bins) / sizeof(*phiv_bins) - 1; // 3D histo @@ -1454,29 +1476,29 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.EqualTo("jpsitomumu")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("jpsitoee")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("dmeson")) { hm->AddHistogram(histClass, "hMassVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitomumudmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitoeedmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); } } if (!groupStr.CompareTo("dilepton-dihadron")) { @@ -1538,7 +1560,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt_Photon", "p_{T} distribution", false, 4500, 0.0, 4.5, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Eta_Pt", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index aa53a2674cc..60fe4cc8714 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -18,7 +18,6 @@ #include #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" -#include "CommonConstants/MathConstants.h" namespace o2::aod { From dc928a416773818242260c93325e042919966217 Mon Sep 17 00:00:00 2001 From: rolavick Date: Thu, 5 Dec 2024 02:34:29 +0100 Subject: [PATCH 50/91] [PWGUD] update of personal task (#8819) --- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 5b80f5972ae..819301ea6a1 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -2148,27 +2148,27 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); - if (countElectrons == 2) + if (countElectrons == 2 && countMuons == 0 && countPions == 0) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); - if (countElectrons == 1 && countMuons == 1) + if (countElectrons == 1 && countMuons == 1 && countPions == 0) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); - if (countElectrons == 1 && countPions == 1) + if (countElectrons == 1 && countMuons == 0 && countPions == 1) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); - if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) + if ((countElectrons == 1 && countMuons == 1 && countPions == 0) || (countElectrons == 1 && countMuons == 0 && countPions == 1)) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); - if (countMuons == 2) + if (countElectrons == 0 && countMuons == 2 && countPions == 0) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); - if (countMuons == 1 && countPions == 1) + if (countElectrons == 0 && countMuons == 1 && countPions == 1) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); - if (countPions == 2) + if (countElectrons == 0 && countMuons == 0 && countPions == 2) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); - if (countPions == 4) + if (countElectrons == 0 && countMuons == 0 && countPions == 4) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); - if (countPions == 3 && countElectrons == 1) + if (countElectrons == 1 && countMuons == 0 && countPions == 3) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); - if (countPions == 3 && countMuons == 1) + if (countElectrons == 0 && countMuons == 1 && countPions == 3) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); - if (countPions == 6) + if (countElectrons == 0 && countMuons == 0 && countPions == 6) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); } From afa450f86612d1cb49c96b533f7043190b5af848 Mon Sep 17 00:00:00 2001 From: Katarzyna <116073883+kgwizdzi@users.noreply.github.com> Date: Thu, 5 Dec 2024 03:57:44 +0100 Subject: [PATCH 51/91] [PWGCF] FemtoUniverse - D0 task update (#8821) --- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 391 +++++++++--------- 1 file changed, 198 insertions(+), 193 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 273ff0e629e..a994a047157 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -26,7 +26,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" @@ -53,11 +52,11 @@ using namespace o2::soa; namespace { -static constexpr int nPart = 2; -static constexpr int nCuts = 5; +static constexpr int kNPart = 2; +static constexpr int kNCuts = 5; static const std::vector partNames{"D0", "Track"}; static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTable[nPart][nCuts]{{4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; +static const float cutsTable[kNPart][kNCuts]{{4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace /// Returns deltaPhi value within the range [-pi/2, 3/2*pi] @@ -73,16 +72,13 @@ double wrapDeltaPhi0PI(double phiD, double phiDbar) { double deltaPhi = 0.0; deltaPhi = RecoDecay::constrainAngle(phiDbar - phiD, 0.0); - if (deltaPhi < 0.) { - deltaPhi = deltaPhi + o2::constants::math::TwoPI; - } if (deltaPhi > o2::constants::math::TwoPI) { deltaPhi = o2::constants::math::TwoPI - deltaPhi; } return deltaPhi; } -struct femtoUniversePairTaskTrackD0 { +struct FemtoUniversePairTaskTrackD0 { using FemtoFullParticles = soa::Join; SliceCache cache; @@ -90,56 +86,55 @@ struct femtoUniversePairTaskTrackD0 { /// Table for both particles struct : o2::framework::ConfigurableGroup { - Configurable ConfNsigmaCombinedProton{"ConfNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; - Configurable ConfNsigmaTPCProton{"ConfNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < 0.5"}; - Configurable ConfNsigmaCombinedPion{"ConfNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; - Configurable ConfNsigmaTPCPion{"ConfNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < 0.5"}; - - Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; - Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; - Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; - Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; - Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; + Configurable confNsigmaCombinedProton{"confNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; + Configurable confNsigmaTPCProton{"confNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < 0.5"}; + Configurable confNsigmaCombinedPion{"confNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; + Configurable confNsigmaTPCPion{"confNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < 0.5"}; + + Configurable> confCutTable{"confCutTable", {cutsTable[0], kNPart, kNCuts, partNames, cutNames}, "Particle selections"}; + Configurable confNspecies{"confNspecies", 2, "Number of particle spieces with PID info"}; + Configurable confIsMC{"confIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable> confTrkPIDnSigmaMax{"confTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable confUse3D{"confUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; + Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; } ConfBothTracks; /// Particle 1 --- IDENTIFIED TRACK struct : o2::framework::ConfigurableGroup { - Configurable ConfIsSame{"ConfIsSame", false, "Pairs of the same particle"}; - Configurable ConfPDGCodeTrack{"ConfPDGCodeTrack", 2212, "Particle 2 - PDG code"}; - Configurable ConfPIDTrack{"ConfPIDTrack", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> - Configurable ConfTrackSign{"ConfTrackSign", 1, "Track sign"}; - Configurable ConfIsTrackIdentified{"ConfIsTrackIdentified", true, "Enable PID for the track"}; - Configurable ConfTrackLowPtCut{"ConfTrackLowPtCut", 0.5, "Low pT cut of the track"}; - Configurable ConfTrackHighPtCut{"ConfTrackHighPtCut", 2.5, "High pT cut of the track"}; + Configurable confIsSame{"confIsSame", false, "Pairs of the same particle"}; + Configurable confPDGCodeTrack{"confPDGCodeTrack", 2212, "Particle 2 - PDG code"}; + Configurable confPIDTrack{"confPIDTrack", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable confTrackSign{"confTrackSign", 1, "Track sign"}; + Configurable confIsTrackIdentified{"confIsTrackIdentified", true, "Enable PID for the track"}; + Configurable confTrackLowPtCut{"confTrackLowPtCut", 0.5, "Low pT cut of the track"}; + Configurable confTrackHighPtCut{"confTrackHighPtCut", 2.5, "High pT cut of the track"}; } ConfTrack; /// Particle 2 --- D0/D0bar meson struct : o2::framework::ConfigurableGroup { - Configurable ConfPDGCodeD0{"ConfPDGCodeD0", 421, "D0 meson - PDG code"}; - Configurable ConfPDGCodeD0bar{"ConfPDGCodeD0bar", -421, "D0bar meson - PDG code"}; - Configurable ConfMinPtD0D0bar{"ConfMinPtD0D0bar", 3.0, "D0/D0bar sel. - min. pT"}; - Configurable ConfMaxPtD0D0bar{"ConfMaxPtD0D0bar", 5.0, "D0/D0bar sel. - max. pT"}; - Configurable ConfMinInvMassD0D0bar{"ConfMinInvMassD0D0bar", 1.65, "D0/D0bar sel. - min. invMass"}; - Configurable ConfMaxInvMassD0D0bar{"ConfMaxInvMassD0D0bar", 2.05, "D0/D0bar sel. - max. invMass"}; + Configurable confPDGCodeD0{"confPDGCodeD0", 421, "D0 meson - PDG code"}; + Configurable confPDGCodeD0bar{"confPDGCodeD0bar", -421, "D0bar meson - PDG code"}; + Configurable confMinPtD0D0bar{"confMinPtD0D0bar", 1.0, "D0/D0bar sel. - min. pT"}; + Configurable confMaxPtD0D0bar{"confMaxPtD0D0bar", 3.0, "D0/D0bar sel. - max. pT"}; + Configurable confMinInvMassD0D0bar{"confMinInvMassD0D0bar", 1.65, "D0/D0bar sel. - min. invMass"}; + Configurable confMaxInvMassD0D0bar{"confMaxInvMassD0D0bar", 2.05, "D0/D0bar sel. - max. invMass"}; } ConfDmesons; struct : o2::framework::ConfigurableGroup { - Configurable ConfSignalRegionMin{"ConfSignalRegionMin", 1.810, "Min. inv. mass for D0/D0bar in the signal region"}; - Configurable ConfSignalRegionMax{"ConfSignalRegionMax", 1.922, "Max. inv. mass for D0/D0bar in the signal region"}; - Configurable ConfMinInvMassLeftSB{"ConfMinInvMassLeftSB", 1.642, "Min. inv. mass for D0/D0bar in the left sideband region"}; - Configurable ConfMaxInvMassLeftSB{"ConfMaxInvMassLeftSB", 1.754, "Max. inv. mass for D0/D0bar in the left sideband region"}; - Configurable ConfMinInvMassRightSB{"ConfMinInvMassRightSB", 1.978, "Min. inv. mass for D0/D0bar in the right sideband region"}; - Configurable ConfMaxInvMassRightSB{"ConfMaxInvMassRightSB", 2.090, "Max. inv. mass for D0/D0bar in the right sideband region"}; + Configurable confSignalRegionMin{"confSignalRegionMin", 1.810, "Min. inv. mass for D0/D0bar in the signal region"}; + Configurable confSignalRegionMax{"confSignalRegionMax", 1.922, "Max. inv. mass for D0/D0bar in the signal region"}; + Configurable confMinInvMassLeftSB{"confMinInvMassLeftSB", 1.642, "Min. inv. mass for D0/D0bar in the left sideband region"}; + Configurable confMaxInvMassLeftSB{"confMaxInvMassLeftSB", 1.754, "Max. inv. mass for D0/D0bar in the left sideband region"}; + Configurable confMinInvMassRightSB{"confMinInvMassRightSB", 1.978, "Min. inv. mass for D0/D0bar in the right sideband region"}; + Configurable confMaxInvMassRightSB{"confMaxInvMassRightSB", 2.090, "Max. inv. mass for D0/D0bar in the right sideband region"}; } ConfD0D0barSideBand; Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; - Configurable ConfChooseD0trackCorr{"ConfChooseD0trackCorr", 3, "If 0 - only D0s, 1 - only D0bars, 2 - D0/D0bar (one mass hypo.), 3 - all D0/D0bar cand."}; - Configurable ConfUseMassCutForD0D0bar{"ConfUseMassCutForD0D0bar", false, "Switch to save D0/D0bar within declared inv. mass range"}; + Configurable confChooseD0trackCorr{"confChooseD0trackCorr", 2, "If 0 - only D0s, 1 - only D0bars, 2 - D0/D0bar (one mass hypo.), 3 - all D0/D0bar cand."}; /// Partitions for particle 1 - Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.ConfTrackSign)) && (aod::femtouniverseparticle::pt > ConfTrack.ConfTrackLowPtCut) && (aod::femtouniverseparticle::pt < ConfTrack.ConfTrackHighPtCut); + Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.confTrackSign)) && (aod::femtouniverseparticle::pt > ConfTrack.confTrackLowPtCut) && (aod::femtouniverseparticle::pt < ConfTrack.confTrackHighPtCut); Partition> partsTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)); /// Partitions for particle 2 @@ -148,9 +143,9 @@ struct femtoUniversePairTaskTrackD0 { /// Partition with D0/D0bar candidates, which pass only one mass hypothesis Partition partsOnlyD0D0bar = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f || aod::femtouniverseparticle::mAntiLambda < 0.0f); /// Partition with D0 mesons only (one mass hypothesis) - Partition partsD0s = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > 0.0f) && (aod::femtouniverseparticle::mAntiLambda < 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.ConfMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.ConfMaxPtD0D0bar); + Partition partsD0s = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > ConfDmesons.confMinInvMassD0D0bar) && (aod::femtouniverseparticle::mLambda < ConfDmesons.confMaxInvMassD0D0bar) && (aod::femtouniverseparticle::mAntiLambda < 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.confMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.confMaxPtD0D0bar); /// Partition with D0bar mesons only (one mass hypothesis) - Partition partsD0bars = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f) && (aod::femtouniverseparticle::mAntiLambda > 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.ConfMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.ConfMaxPtD0D0bar); + Partition partsD0bars = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f) && (aod::femtouniverseparticle::mAntiLambda > ConfDmesons.confMinInvMassD0D0bar) && (aod::femtouniverseparticle::mAntiLambda < ConfDmesons.confMaxInvMassD0D0bar) && (aod::femtouniverseparticle::pt > ConfDmesons.confMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.confMaxPtD0D0bar); /// Partition for D0/D0bar mesons from MC Partition> partsD0D0barMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)); @@ -171,33 +166,33 @@ struct femtoUniversePairTaskTrackD0 { std::vector kNsigma; /// particle part - ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarInvMassBins{"ConfDTempFitVarInvMassBins", {6000, 0.9, 4.0}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarBins{"confTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarInvMassBins{"confTempFitVarInvMassBins", {6000, 0.9, 4.0}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarpTBins{"confTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; /// Correlation part - ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task - // ConfigurableAxis ConfMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfmultBins3D{"ConfmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - - ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; - - ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {360, 0., 36.}, "binning pT"}; - ConfigurableAxis ConfInvMassBins{"ConfInvMassBins", {500, 0., 5.0}, "binning inv. mass"}; - ConfigurableAxis ConfInvMassFinerBins{"ConfInvMassFinerBins", {120, 1.5848, 2.1848}, "finer binning of inv. mass"}; - - Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; - Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; - Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task + // ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis confmTBins3D{"confmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confmultBins3D{"confmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; + + ConfigurableAxis confkstarBins{"confkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis confkTBins{"confkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis confmTBins{"confmTBins", {225, 0., 7.5}, "binning mT"}; + ConfigurableAxis confPtBins{"confPtBins", {360, 0., 36.}, "binning pT"}; + ConfigurableAxis confInvMassBins{"confInvMassBins", {500, 0., 5.0}, "binning inv. mass"}; + ConfigurableAxis confInvMassFinerBins{"confInvMassFinerBins", {120, 1.5848, 2.1848}, "finer binning of inv. mass"}; + + Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; FemtoUniverseFemtoContainer sameEventFemtoCont; FemtoUniverseFemtoContainer mixedEventFemtoCont; @@ -210,18 +205,18 @@ struct femtoUniversePairTaskTrackD0 { /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry mixQaRegistry{"mixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registry{"registry", - {{"hInvMassD0", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {ConfInvMassBins}}}, - {"hInvMassD0bar", ";#it{M}(#pi^{-}K^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {ConfInvMassBins}}}, - {"hPtDmesonCand", "2-prong candidates;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPtD0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPtD0D0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPhiDmesonCand", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., 2. * o2::constants::math::PI}}}}, - {"hPhiD0", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., 2. * o2::constants::math::PI}}}}, - {"hPhiD0bar", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., 2. * o2::constants::math::PI}}}}, + {{"hInvMassD0", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {confInvMassBins}}}, + {"hInvMassD0bar", ";#it{M}(#pi^{-}K^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {confInvMassBins}}}, + {"hPtDmesonCand", "2-prong candidates;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPtD0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPtD0D0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPhiDmesonCand", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}}, + {"hPhiD0", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}}, + {"hPhiD0bar", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}}, {"hEtaDmesonCand", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}}, {"hEtaD0", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}}, {"hEtaD0bar", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}}, @@ -235,16 +230,16 @@ struct femtoUniversePairTaskTrackD0 { {"hDCAzDaughters", "; #it{DCA}_{z} (cm); counts", {HistType::kTH1F, {{140, 0., 0.14}}}}}}; // PID for protons - bool IsProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx + bool isProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfNsigmaTPCProton) { + if (std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaTPCProton) { return true; } else { return false; } } else if (mom > 0.4) { - if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaCombinedProton) { + if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confNsigmaCombinedProton) { return true; } else { return false; @@ -253,28 +248,28 @@ struct femtoUniversePairTaskTrackD0 { return false; } - bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -282,7 +277,7 @@ struct femtoUniversePairTaskTrackD0 { return false; } } else if (mom > 1.5) { - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -292,23 +287,23 @@ struct femtoUniversePairTaskTrackD0 { } } - bool IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) + bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) { //|nsigma_TPC| < 3 for p < 0.5 GeV/c //|nsigma_combined| < 3 for p > 0.5 // using configurables: - // ConfNsigmaTPCPion -> TPC Kaon Sigma for momentum < 0.5 - // ConfNsigmaCombinedPion -> TPC and TOF Pion Sigma (combined) for momentum > 0.5 + // confNsigmaTPCPion -> TPC Kaon Sigma for momentum < 0.5 + // confNsigmaCombinedPion -> TPC and TOF Pion Sigma (combined) for momentum > 0.5 if (true) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPi) < ConfBothTracks.ConfNsigmaTPCPion) { + if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaTPCPion) { return true; } else { return false; } } else if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaCombinedPion) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confNsigmaCombinedPion) { return true; } else { return false; @@ -318,20 +313,20 @@ struct femtoUniversePairTaskTrackD0 { return false; } - bool IsParticleNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool isParticleNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { - switch (ConfTrack.ConfPDGCodeTrack) { + switch (ConfTrack.confPDGCodeTrack) { case 2212: // Proton case -2212: // anty Proton - return IsProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- - return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; default: return false; @@ -341,32 +336,36 @@ struct femtoUniversePairTaskTrackD0 { void init(InitContext&) { eventHisto.init(&qaRegistry); + qaRegistry.add("QA_D0D0barSelection/hInvMassD0", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", kTH1F, {confInvMassBins}); + qaRegistry.add("QA_D0D0barSelection/hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", kTH1F, {confPtBins}); + qaRegistry.add("QA_D0D0barSelection/hInvMassD0bar", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", kTH1F, {confInvMassBins}); + qaRegistry.add("QA_D0D0barSelection/hPtD0bar", "#bar{D^{0}} cand.;#it{p}_{T} (GeV/#it{c});counts", kTH1F, {confPtBins}); qaRegistry.add("D0_pos_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_pos_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_pos_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0_pos_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0_pos_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("D0_neg_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_neg_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_neg_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0_neg_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0_neg_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("D0bar_pos_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_pos_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_pos_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0bar_pos_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0bar_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0bar_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0bar_pos_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("D0bar_neg_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_neg_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_neg_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0bar_neg_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0bar_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0bar_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0bar_neg_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("Hadron/nSigmaTPCPr", "; #it{p} (GeV/#it{c}); n#sigma_{TPCPr}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); @@ -376,36 +375,36 @@ struct femtoUniversePairTaskTrackD0 { qaRegistry.add("Hadron/nSigmaTPCKa", "; #it{p} (GeV/#it{c}); n#sigma_{TPCKa}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Hadron/nSigmaTOFKa", "; #it{p} (GeV/#it{c}); n#sigma_{TOFKa}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); - trackHistoPartD0D0bar.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarInvMassBins, ConfBothTracks.ConfIsMC, ConfDmesons.ConfPDGCodeD0); - if (!ConfTrack.ConfIsSame) { - trackHistoPartTrack.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, ConfBothTracks.ConfIsMC, ConfTrack.ConfPDGCodeTrack); + trackHistoPartD0D0bar.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarInvMassBins, ConfBothTracks.confIsMC, ConfDmesons.confPDGCodeD0); + if (!ConfTrack.confIsSame) { + trackHistoPartTrack.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, ConfBothTracks.confIsMC, ConfTrack.confPDGCodeTrack); } - MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - sameEventFemtoCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - mixedEventFemtoCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - sameEventAngularCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfEtaBins, ConfBothTracks.ConfPhiBins, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - mixedEventAngularCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfEtaBins, ConfBothTracks.ConfPhiBins, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); + sameEventFemtoCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + mixedEventFemtoCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + sameEventAngularCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confEtaBins, ConfBothTracks.confPhiBins, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + mixedEventAngularCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confEtaBins, ConfBothTracks.confPhiBins, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); - sameEventFemtoCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); - mixedEventFemtoCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); - sameEventAngularCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); - mixedEventAngularCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); + sameEventFemtoCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); + mixedEventFemtoCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); + sameEventAngularCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); + mixedEventAngularCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); pairCleaner.init(&qaRegistry); - if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + if (confIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } - vPIDTrack = ConfTrack.ConfPIDTrack.value; - kNsigma = ConfBothTracks.ConfTrkPIDnSigmaMax.value; + vPIDTrack = ConfTrack.confPIDTrack.value; + kNsigma = ConfBothTracks.confTrkPIDnSigmaMax.value; // D0/D0bar histograms auto vbins = (std::vector)binsPt; - registry.add("D0D0bar_oneMassHypo/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("D0D0bar_oneMassHypo/hMassVsPtFinerBinning", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassFinerBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("D0D0bar_oneMassHypo/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("D0D0bar_oneMassHypo/hMassVsPtFinerBinning", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassFinerBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDeltaPhiSigSig", "SxS correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); registry.add("hDeltaPhiD0BgD0barSig", "B(D0)x S(D0bar) correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); registry.add("hDeltaPhiD0SigD0barBg", "S(D0)x B(D0bar) correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); @@ -417,11 +416,31 @@ struct femtoUniversePairTaskTrackD0 { template void fillCollision(CollisionType col) { - MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); } - void processD0mesons(o2::aod::FDCollision& col, FemtoFullParticles&) + void processQAD0D0barSel(o2::aod::FDCollision const& col, FemtoFullParticles const&) + { + auto groupPartsD0s = partsD0s->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto groupPartsD0bars = partsD0bars->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + // loop over selected D0 candidates + for (auto const& d0cand : groupPartsD0s) { + + qaRegistry.fill(HIST("QA_D0D0barSelection/hInvMassD0"), d0cand.mLambda()); + qaRegistry.fill(HIST("QA_D0D0barSelection/hPtD0"), d0cand.pt()); + } + // loop over selected D0bar candidates + for (auto const& d0barcand : groupPartsD0bars) { + + qaRegistry.fill(HIST("QA_D0D0barSelection/hInvMassD0bar"), d0barcand.mAntiLambda()); + qaRegistry.fill(HIST("QA_D0D0barSelection/hPtD0bar"), d0barcand.pt()); + } + } + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processQAD0D0barSel, "Enable filling QA plots for selected D0/D0bar cand.", true); + + void processD0mesons(o2::aod::FDCollision const& col, FemtoFullParticles const&) { auto groupPartsOnlyD0D0bar = partsOnlyD0D0bar->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsAllDmesons = partsAllDmesons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -442,18 +461,14 @@ struct femtoUniversePairTaskTrackD0 { if (d0d0bar.mLambda() > 0.0f && d0d0bar.mAntiLambda() < 0.0f) { registry.fill(HIST("D0D0bar_oneMassHypo/hMassVsPt"), d0d0bar.mLambda(), d0d0bar.pt()); - if (d0d0bar.mLambda() > ConfDmesons.ConfMinInvMassD0D0bar && d0d0bar.mLambda() < ConfDmesons.ConfMaxInvMassD0D0bar) { - registry.fill(HIST("hInvMassD0"), d0d0bar.mLambda()); - } + registry.fill(HIST("hInvMassD0"), d0d0bar.mLambda()); registry.fill(HIST("hPtD0"), d0d0bar.pt()); registry.fill(HIST("hPhiD0"), d0d0bar.phi()); registry.fill(HIST("hEtaD0"), d0d0bar.eta()); } if (d0d0bar.mLambda() < 0.0f && d0d0bar.mAntiLambda() > 0.0f) { registry.fill(HIST("D0D0bar_oneMassHypo/hMassVsPt"), d0d0bar.mAntiLambda(), d0d0bar.pt()); - if (d0d0bar.mAntiLambda() > ConfDmesons.ConfMinInvMassD0D0bar && d0d0bar.mAntiLambda() < ConfDmesons.ConfMaxInvMassD0D0bar) { - registry.fill(HIST("hInvMassD0bar"), d0d0bar.mAntiLambda()); - } + registry.fill(HIST("hInvMassD0bar"), d0d0bar.mAntiLambda()); registry.fill(HIST("hPtD0bar"), d0d0bar.pt()); registry.fill(HIST("hPhiD0bar"), d0d0bar.phi()); registry.fill(HIST("hEtaD0bar"), d0d0bar.eta()); @@ -490,10 +505,10 @@ struct femtoUniversePairTaskTrackD0 { } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processD0mesons, "Enable processing D0 mesons", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processD0mesons, "Enable processing D0 mesons", true); // D0-D0bar pair correlations (side-band methode) - void processSideBand(o2::aod::FDCollision& col, FemtoFullParticles&) + void processSideBand(o2::aod::FDCollision const& col, FemtoFullParticles const&) { auto groupPartsOnlyD0D0bar = partsOnlyD0D0bar->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -521,33 +536,33 @@ struct femtoUniversePairTaskTrackD0 { registry.fill(HIST("hDeltaEtaDeltaPhi"), deltaEta, deltaPhi); // ----------------------------------- Creating D0-D0bar pairs correlations ------------------------------------------------ - if (cand1.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMin.value && cand1.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMax.value) { + if (cand1.mLambda() > ConfD0D0barSideBand.confSignalRegionMin.value && cand1.mLambda() < ConfD0D0barSideBand.confSignalRegionMax.value) { // S(D0) x S(D0bar) correlation - if (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMax.value) { + if (cand2.mAntiLambda() > ConfD0D0barSideBand.confSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confSignalRegionMax.value) { registry.fill(HIST("hDeltaPhiSigSig"), deltaPhi); } // S(D0) x B(D0bar) correlation - if ((cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassLeftSB.value) || - (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassRightSB.value)) { + if ((cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassLeftSB.value) || + (cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassRightSB.value)) { registry.fill(HIST("hDeltaPhiD0SigD0barBg"), deltaPhi); } } - if ((cand1.mLambda() > ConfD0D0barSideBand.ConfMinInvMassLeftSB.value && cand1.mLambda() < ConfD0D0barSideBand.ConfMaxInvMassLeftSB.value) || - (cand1.mLambda() > ConfD0D0barSideBand.ConfMinInvMassRightSB.value && cand1.mLambda() < ConfD0D0barSideBand.ConfMaxInvMassRightSB.value)) { + if ((cand1.mLambda() > ConfD0D0barSideBand.confMinInvMassLeftSB.value && cand1.mLambda() < ConfD0D0barSideBand.confMaxInvMassLeftSB.value) || + (cand1.mLambda() > ConfD0D0barSideBand.confMinInvMassRightSB.value && cand1.mLambda() < ConfD0D0barSideBand.confMaxInvMassRightSB.value)) { // B(D0) x S (D0bar) correlation - if (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMax.value) { + if (cand2.mAntiLambda() > ConfD0D0barSideBand.confSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confSignalRegionMax.value) { registry.fill(HIST("hDeltaPhiD0BgD0barSig"), deltaPhi); } // B(D0) x B(D0bar) correlation - if ((cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassLeftSB.value) || - (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassRightSB.value)) { + if ((cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassLeftSB.value) || + (cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassRightSB.value)) { registry.fill(HIST("hDeltaPhiBgBg"), deltaPhi); } } } // It is the end of the for loop over D0bar mesons } // It is the end of the for loop over all candidates } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false); /// This function processes the same event and takes care of all the histogramming /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -564,16 +579,16 @@ struct femtoUniversePairTaskTrackD0 { { /// Histogramming same event - for (auto& d0candidate : groupPartsD0) { + for (auto const& d0candidate : groupPartsD0) { trackHistoPartD0D0bar.fillQA(d0candidate); } float tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa; - if (!ConfTrack.ConfIsSame) { - for (auto& track : groupPartsTrack) { - if (ConfTrack.ConfIsTrackIdentified) { - if (!IsParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { + if (!ConfTrack.confIsSame) { + for (auto const& track : groupPartsTrack) { + if (ConfTrack.confIsTrackIdentified) { + if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } @@ -595,20 +610,14 @@ struct femtoUniversePairTaskTrackD0 { } } /// Now build the combinations - for (auto& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { - if (ConfTrack.ConfIsTrackIdentified) { - if (!IsParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { - continue; - } - } - // // Set inv. mass cut for D0/D0bar candidates - if (ConfUseMassCutForD0D0bar) { - if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { + for (auto const& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { + if (ConfTrack.confIsTrackIdentified) { + if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } // // Close Pair Rejection - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } @@ -618,16 +627,16 @@ struct femtoUniversePairTaskTrackD0 { if (!pairCleaner.isCleanPair(track, d0candidate, parts)) { continue; } - sameEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); - sameEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); + sameEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); + sameEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); } } /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, - FemtoFullParticles& parts) + void processSameEvent(o2::aod::FDCollision const& col, + FemtoFullParticles const& parts) { fillCollision(col); @@ -637,7 +646,7 @@ struct femtoUniversePairTaskTrackD0 { auto theGroupPartsD0s = partsD0s->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto theGroupPartsD0bars = partsD0bars->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - switch (ConfChooseD0trackCorr) { + switch (confChooseD0trackCorr) { case 0: doSameEvent(thegroupPartsTrack, theGroupPartsD0s, parts, col.magField(), col.multNtr()); break; @@ -649,19 +658,20 @@ struct femtoUniversePairTaskTrackD0 { break; case 3: doSameEvent(thegroupPartsTrack, thegroupPartsAllD0D0bar, parts, col.magField(), col.multNtr()); + break; default: break; } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processSameEvent, "Enable processing same event", true); /// process function for to call doSameEvent with Monte Carlo /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processSameEventMC(o2::aod::FDCollision const& col, + soa::Join const& parts, + o2::aod::FDMCParticles const&) { fillCollision(col); @@ -670,7 +680,7 @@ struct femtoUniversePairTaskTrackD0 { doSameEvent(thegroupPartsTrack, thegroupPartsD0, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSameEventMC, "Enable processing same event for Monte Carlo", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processSameEventMC, "Enable processing same event for Monte Carlo", false); /// This function processes the mixed event /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -686,40 +696,34 @@ struct femtoUniversePairTaskTrackD0 { void doMixedEvent(PartitionType groupPartsTrack, PartitionType groupPartsD0, PartType parts, float magFieldTesla, int multCol) { - for (auto& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { - if (ConfTrack.ConfIsTrackIdentified) { - if (!IsParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { - continue; - } - } - // // Set inv. mass cut for D0/D0bar candidates - if (ConfUseMassCutForD0D0bar) { - if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { + for (auto const& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { + if (ConfTrack.confIsTrackIdentified) { + if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } // // Close Pair Rejection - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { continue; } } - mixedEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); - mixedEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); + mixedEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); + mixedEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); } } /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, - FemtoFullParticles& parts) + void processMixedEvent(o2::aod::FDCollisions const& cols, + FemtoFullParticles const& parts) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsTrack = partsTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); auto groupPartsAllD0D0bar = partsAllDmesons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -734,9 +738,9 @@ struct femtoUniversePairTaskTrackD0 { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsD0.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; + // if (partsD0.size() == 0 || kNPart2Evt1 == 0 || kNPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; - switch (ConfChooseD0trackCorr) { + switch (confChooseD0trackCorr) { case 0: doMixedEvent(groupPartsTrack, theGroupPartsD0s, parts, magFieldTesla1, multiplicityCol); break; @@ -748,25 +752,26 @@ struct femtoUniversePairTaskTrackD0 { break; case 3: doMixedEvent(groupPartsTrack, groupPartsAllD0D0bar, parts, magFieldTesla1, multiplicityCol); + break; default: break; } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processMixedEvent, "Enable processing mixed events", true); /// brief process function for to call doMixedEvent with Monte Carlo /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processMixedEventMC(o2::aod::FDCollisions const& cols, + soa::Join const& parts, + o2::aod::FDMCParticles const&) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsTrack = partsTrackMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); auto groupPartsD0 = partsD0D0barMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -778,18 +783,18 @@ struct femtoUniversePairTaskTrackD0 { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsD0.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; + // if (partsD0.size() == 0 || kNPart2Evt1 == 0 || kNPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; doMixedEvent(groupPartsTrack, groupPartsD0, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processMixedEventMC, "Enable processing mixed events MC", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processMixedEventMC, "Enable processing mixed events MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } From 61f9b9cb4f04aede4afe56b40c527b5fdac9dcfe Mon Sep 17 00:00:00 2001 From: yuanzhe <90246048+wang-yuanzhe@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:28:59 +0100 Subject: [PATCH 52/91] [PWGLF] Add Zorro tool to get normalisation factor of trigger for analysis of H3L 3body decay (#8823) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Nuspex/CMakeLists.txt | 2 +- .../Nuspex/threebodyRecoTask.cxx | 225 +++++++++++------- 2 files changed, 144 insertions(+), 83 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/CMakeLists.txt b/PWGLF/TableProducer/Nuspex/CMakeLists.txt index 29c6f4ea637..99b1df8d314 100644 --- a/PWGLF/TableProducer/Nuspex/CMakeLists.txt +++ b/PWGLF/TableProducer/Nuspex/CMakeLists.txt @@ -66,7 +66,7 @@ o2physics_add_dpl_workflow(threebodymcfinder o2physics_add_dpl_workflow(threebody-reco-task SOURCES threebodyRecoTask.cxx - PUBLIC_LINK_LIBRARIES O2::DCAFitter O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2::DCAFitter O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(ebye-maker diff --git a/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx b/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx index 0f728f37574..624ab1efa1b 100644 --- a/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx @@ -9,14 +9,16 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -// StoredVtx3BodyDatas analysis task -// ======================== +/// \file threebodyRecoTask.cxx +/// \brief Analysis task for 3-body decay process (now mainly for hypertriton) +/// \author Yuanzhe Wang #include #include #include #include #include +#include #include #include "Framework/runDataProcessing.h" @@ -34,11 +36,14 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/PIDResponse.h" #include "CommonConstants/PhysicsConstants.h" +#include "CCDB/BasicCCDBManager.h" + +#include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using FullTracksExtIU = soa::Join; using MCLabeledTracksIU = soa::Join; @@ -76,17 +81,21 @@ struct Candidate3body { bool isSignal = false; bool isReco = false; int pdgCode = -1; - bool SurvivedEventSelection = false; + bool survivedEventSelection = false; }; -struct threebodyRecoTask { +struct ThreebodyRecoTask { Produces outputDataTable; Produces outputMCTable; - std::vector Candidates3body; + std::vector candidates3body; std::vector filledMothers; std::vector isGoodCollision; + Service ccdb; + Zorro zorro; + OutputObj zorroSummary{"zorroSummary"}; + //------------------------------------------------------------------ Preslice perCollisionVtx3BodyDatas = o2::aod::vtx3body::collisionId; @@ -96,9 +105,9 @@ struct threebodyRecoTask { Configurable dcapiontopv{"dcapiontopv", .05, "DCA Pion To PV"}; Configurable etacut{"etacut", 0.9, "etacut"}; Configurable rapiditycut{"rapiditycut", 1, "rapiditycut"}; - Configurable TofPidNsigmaMin{"TofPidNsigmaMin", -5, "TofPidNsigmaMin"}; - Configurable TofPidNsigmaMax{"TofPidNsigmaMax", 5, "TofPidNsigmaMax"}; - Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; + Configurable tofPIDNSigmaMin{"tofPIDNSigmaMin", -5, "tofPIDNSigmaMin"}; + Configurable tofPIDNSigmaMax{"tofPIDNSigmaMax", 5, "tofPIDNSigmaMax"}; + Configurable tpcPIDNSigmaCut{"tpcPIDNSigmaCut", 5, "tpcPIDNSigmaCut"}; Configurable event_sel8_selection{"event_sel8_selection", true, "event selection count post sel8 cut"}; Configurable mc_event_selection{"mc_event_selection", true, "mc event selection count post kIsTriggerTVX and kNoTimeFrameBorder"}; Configurable event_posZ_selection{"event_posZ_selection", true, "event selection count post poZ cut"}; @@ -124,10 +133,22 @@ struct threebodyRecoTask { float lowersignallimit = o2::constants::physics::MassHyperTriton - 3 * mcsigma; float uppersignallimit = o2::constants::physics::MassHyperTriton + 3 * mcsigma; + // CCDB options + Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable pidPath{"pidPath", "", "Path to the PID response object"}; + + // Zorro counting + Configurable cfgSkimmedProcessing{"cfgSkimmedProcessing", false, "Skimmed dataset processing"}; + HistogramRegistry registry{ "registry", { - {"hEventCounter", "hEventCounter", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, + {"hEventCounter", "hEventCounter", {HistType::kTH1F, {{5, 0.0f, 5.0f}}}}, {"hCentFT0C", "hCentFT0C", {HistType::kTH1F, {{100, 0.0f, 100.0f, "FT0C Centrality"}}}}, {"hCandidatesCounter", "hCandidatesCounter", {HistType::kTH1F, {{12, 0.0f, 12.0f}}}}, {"hMassHypertriton", "hMassHypertriton", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, @@ -149,7 +170,7 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Fill stats histograms - enum vtxstep { kCandAll = 0, + enum Vtxstep { kCandAll = 0, kCandDauEta, kCandDauPt, kCandTPCNcls, @@ -170,12 +191,12 @@ struct threebodyRecoTask { void resetHistos() { - for (Int_t ii = 0; ii < kNCandSteps; ii++) { + for (int ii = 0; ii < kNCandSteps; ii++) { statisticsRegistry.candstats[ii] = 0; statisticsRegistry.truecandstats[ii] = 0; } } - void FillCandCounter(int kn, bool istrue = false) + void fillCandCounter(int kn, bool istrue = false) { statisticsRegistry.candstats[kn]++; if (istrue) { @@ -184,7 +205,7 @@ struct threebodyRecoTask { } void fillHistos() { - for (Int_t ii = 0; ii < kNCandSteps; ii++) { + for (int ii = 0; ii < kNCandSteps; ii++) { registry.fill(HIST("hCandidatesCounter"), ii, statisticsRegistry.candstats[ii]); if (doprocessMC == true) { registry.fill(HIST("hTrueHypertritonCounter"), ii, statisticsRegistry.truecandstats[ii]); @@ -192,15 +213,24 @@ struct threebodyRecoTask { } } - ConfigurableAxis dcaBinning{"dca-binning", {200, 0.0f, 1.0f}, ""}; - ConfigurableAxis ptBinning{"pt-binning", {200, 0.0f, 10.0f}, ""}; + int mRunNumber; void init(InitContext const&) { + + zorroSummary.setObject(zorro.getZorroSummary()); + mRunNumber = 0; + + ccdb->setURL(ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(1, "total"); registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(2, "sel8"); registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(3, "vertexZ"); - registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(4, "has Candidate"); + registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(4, "Zorro H3L 3body event"); + registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(5, "has Candidate"); // Check for selection criteria !!! TracksIU required !!! registry.add("hDiffRVtxProton", "hDiffRVtxProton", HistType::kTH1F, {{100, -10, 10}}); // difference between the radius of decay vertex and minR of proton @@ -227,15 +257,29 @@ struct threebodyRecoTask { registry.add("hRapidityGeneratedAntiHypertriton", "hRapidityGeneratedAntiHypertriton", HistType::kTH1F, {{40, -2.0f, 2.0f}}); } - TString CandCounterbinLabel[kNCandSteps] = {"Total", "TrackEta", "DauPt", "TPCNcls", "TPCPID", "d TOFPID", "PionDcatoPV", "MomRapidity", "Lifetime", "VtxCosPA", "VtxDcaDau", "InvMass"}; + TString candCounterbinLabel[kNCandSteps] = {"Total", "TrackEta", "DauPt", "TPCNcls", "TPCPID", "d TOFPID", "PionDcatoPV", "MomRapidity", "Lifetime", "VtxCosPA", "VtxDcaDau", "InvMass"}; for (int i{0}; i < kNCandSteps; i++) { - registry.get(HIST("hCandidatesCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + registry.get(HIST("hCandidatesCounter"))->GetXaxis()->SetBinLabel(i + 1, candCounterbinLabel[i]); if (doprocessMC == true) { - registry.get(HIST("hTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + registry.get(HIST("hTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(i + 1, candCounterbinLabel[i]); } } } + void initCCDB(aod::BCsWithTimestamps::iterator const& bc) + { + if (mRunNumber == bc.runNumber()) { + return; + } + + if (cfgSkimmedProcessing) { + zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), "fH3L3Body"); + zorro.populateHistRegistry(registry, bc.runNumber()); + } + + mRunNumber = bc.runNumber(); + } + //------------------------------------------------------------------ // Check if the mcparticle is hypertriton which decays into 3 daughters template @@ -246,7 +290,7 @@ struct threebodyRecoTask { } bool haveProton = false, havePion = false, haveBachelor = false; bool haveAntiProton = false, haveAntiPion = false, haveAntiBachelor = false; - for (auto& mcparticleDaughter : particle.template daughters_as()) { + for (const auto& mcparticleDaughter : particle.template daughters_as()) { if (mcparticleDaughter.pdgCode() == 2212) haveProton = true; if (mcparticleDaughter.pdgCode() == -2212) @@ -271,7 +315,7 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Fill candidate table template - void FillCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) + void fillCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) { double cospa = candData.vtxcosPA(collision.posX(), collision.posY(), collision.posZ()); @@ -327,11 +371,11 @@ struct threebodyRecoTask { cand3body.isSignal = true; cand3body.isReco = true; cand3body.pdgCode = cand3body.isMatter ? motherPdgCode : -motherPdgCode; - cand3body.SurvivedEventSelection = true; + cand3body.survivedEventSelection = true; filledMothers.push_back(lLabel); } - Candidates3body.push_back(cand3body); + candidates3body.push_back(cand3body); registry.fill(HIST("hProtonTPCBB"), trackProton.sign() * trackProton.p(), trackProton.tpcSignal()); registry.fill(HIST("hPionTPCBB"), trackPion.sign() * trackPion.p(), trackPion.tpcSignal()); @@ -350,85 +394,85 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Selections for candidates template - bool SelectCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false) + bool selectCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false) { - FillCandCounter(kCandAll, isTrueCand); + fillCandCounter(kCandAll, isTrueCand); // Selection on daughters if (std::abs(trackProton.eta()) > etacut || std::abs(trackPion.eta()) > etacut || std::abs(trackDeuteron.eta()) > etacut) { return false; } - FillCandCounter(kCandDauEta, isTrueCand); + fillCandCounter(kCandDauEta, isTrueCand); if (trackProton.pt() < minProtonPt || trackProton.pt() > maxProtonPt || trackPion.pt() < minPionPt || trackPion.pt() > maxPionPt || trackDeuteron.pt() < minDeuteronPt || trackDeuteron.pt() > maxDeuteronPt) { return false; } - FillCandCounter(kCandDauPt, isTrueCand); + fillCandCounter(kCandDauPt, isTrueCand); if (trackProton.tpcNClsFound() < mintpcNClsproton || trackPion.tpcNClsFound() < mintpcNClspion || trackDeuteron.tpcNClsFound() < mintpcNClsdeuteron) { return false; } - FillCandCounter(kCandTPCNcls, isTrueCand); + fillCandCounter(kCandTPCNcls, isTrueCand); - if (std::abs(trackProton.tpcNSigmaPr()) > TpcPidNsigmaCut || std::abs(trackPion.tpcNSigmaPi()) > TpcPidNsigmaCut || std::abs(trackDeuteron.tpcNSigmaDe()) > TpcPidNsigmaCut) { + if (std::abs(trackProton.tpcNSigmaPr()) > tpcPIDNSigmaCut || std::abs(trackPion.tpcNSigmaPi()) > tpcPIDNSigmaCut || std::abs(trackDeuteron.tpcNSigmaDe()) > tpcPIDNSigmaCut) { return false; } - FillCandCounter(kCandTPCPID, isTrueCand); + fillCandCounter(kCandTPCPID, isTrueCand); registry.fill(HIST("hDeuteronTOFVsPBeforeTOFCut"), trackDeuteron.sign() * trackDeuteron.p(), candData.tofNSigmaBachDe()); - if ((candData.tofNSigmaBachDe() < TofPidNsigmaMin || candData.tofNSigmaBachDe() > TofPidNsigmaMax) && trackDeuteron.p() > minDeuteronPUseTOF) { + if ((candData.tofNSigmaBachDe() < tofPIDNSigmaMin || candData.tofNSigmaBachDe() > tofPIDNSigmaMax) && trackDeuteron.p() > minDeuteronPUseTOF) { return false; } - FillCandCounter(kCandTOFPID, isTrueCand); + fillCandCounter(kCandTOFPID, isTrueCand); registry.fill(HIST("hDeuteronTOFVsPAtferTOFCut"), trackDeuteron.sign() * trackDeuteron.p(), candData.tofNSigmaBachDe()); double dcapion = isMatter ? candData.dcatrack1topv() : candData.dcatrack0topv(); if (std::abs(dcapion) < dcapiontopv) { return false; } - FillCandCounter(kCandDcaToPV, isTrueCand); + fillCandCounter(kCandDcaToPV, isTrueCand); // Selection on candidate hypertriton if (std::abs(candData.yHypertriton()) > rapiditycut) { return false; } - FillCandCounter(kCandRapidity, isTrueCand); + fillCandCounter(kCandRapidity, isTrueCand); double ct = candData.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassHyperTriton; if (ct > lifetimecut) { return false; } - FillCandCounter(kCandct, isTrueCand); + fillCandCounter(kCandct, isTrueCand); double cospa = candData.vtxcosPA(collision.posX(), collision.posY(), collision.posZ()); if (cospa < vtxcospa) { return false; } - FillCandCounter(kCandCosPA, isTrueCand); + fillCandCounter(kCandCosPA, isTrueCand); if (candData.dcaVtxdaughters() > dcavtxdau) { return false; } - FillCandCounter(kCandDcaDau, isTrueCand); + fillCandCounter(kCandDcaDau, isTrueCand); if ((isMatter && candData.mHypertriton() > h3LMassLowerlimit && candData.mHypertriton() < h3LMassUpperlimit)) { // Hypertriton registry.fill(HIST("hMassHypertriton"), candData.mHypertriton()); registry.fill(HIST("hMassHypertritonTotal"), candData.mHypertriton()); if (candData.mHypertriton() > lowersignallimit && candData.mHypertriton() < uppersignallimit) { - registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(array{array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + registry.fill(HIST("hDalitz"), RecoDecay::m2(std::array{std::array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, std::array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(std::array{std::array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, std::array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); } } else if ((!isMatter && candData.mAntiHypertriton() > h3LMassLowerlimit && candData.mAntiHypertriton() < h3LMassUpperlimit)) { // AntiHypertriton registry.fill(HIST("hMassAntiHypertriton"), candData.mAntiHypertriton()); registry.fill(HIST("hMassHypertritonTotal"), candData.mAntiHypertriton()); if (candData.mAntiHypertriton() > lowersignallimit && candData.mAntiHypertriton() < uppersignallimit) { - registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(array{array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + registry.fill(HIST("hDalitz"), RecoDecay::m2(std::array{std::array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, std::array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(std::array{std::array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, std::array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); } } else { return false; } - FillCandCounter(kCandInvMass, isTrueCand); + fillCandCounter(kCandInvMass, isTrueCand); return true; } @@ -436,7 +480,7 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Analysis process for a single candidate template - void CandidateAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) + void candidateAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) { auto track0 = candData.template track0_as(); @@ -449,16 +493,16 @@ struct threebodyRecoTask { auto& trackPion = isMatter ? track1 : track0; auto& trackDeuteron = track2; - if (SelectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { + if (selectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { if_hasvtx = true; - FillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); + fillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); } } //------------------------------------------------------------------ // Analysis process for like-sign background : (p pi- anti-d) or (anti-p pi+ d) template - void LikeSignAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) + void likeSignAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) { auto track0 = candData.template track0_as(); @@ -472,9 +516,9 @@ struct threebodyRecoTask { auto& trackPion = isMatter ? track1 : track0; auto& trackDeuteron = track2; - if (SelectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { + if (selectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { if_hasvtx = true; - FillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); + fillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); // QA for if signals have the possibility to be reconginzed as a like-sign background if (isMatter) { registry.fill(HIST("hCorrectMassHypertriton"), candData.mHypertriton()); @@ -486,9 +530,9 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // collect information for generated hypertriton (should be called after event selection) - void GetGeneratedH3LInfo(aod::McParticles const& particlesMC) + void getGeneratedH3LInfo(aod::McParticles const& particlesMC) { - for (auto& mcparticle : particlesMC) { + for (const auto& mcparticle : particlesMC) { if (std::abs(mcparticle.pdgCode()) != motherPdgCode) { continue; } @@ -497,7 +541,7 @@ struct threebodyRecoTask { bool haveProton = false, havePionPlus = false, haveDeuteron = false; bool haveAntiProton = false, havePionMinus = false, haveAntiDeuteron = false; double MClifetime = -1; - for (auto& mcparticleDaughter : mcparticle.template daughters_as()) { + for (const auto& mcparticleDaughter : mcparticle.template daughters_as()) { if (mcparticleDaughter.pdgCode() == 2212) haveProton = true; if (mcparticleDaughter.pdgCode() == -2212) @@ -533,32 +577,42 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // process real data analysis - void processData(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, FullTracksExtIU const& /*tracks*/) + void processData(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, FullTracksExtIU const&, aod::BCsWithTimestamps const&) { - for (auto collision : collisions) { - Candidates3body.clear(); + for (const auto& collision : collisions) { + candidates3body.clear(); + + auto bc = collision.bc_as(); + initCCDB(bc); registry.fill(HIST("hEventCounter"), 0.5); if (event_sel8_selection && !collision.sel8()) { continue; } registry.fill(HIST("hEventCounter"), 1.5); - if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm + if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm continue; } registry.fill(HIST("hEventCounter"), 2.5); registry.fill(HIST("hCentFT0C"), collision.centFT0C()); + if (cfgSkimmedProcessing) { + bool zorroSelected = zorro.isSelected(collision.bc_as().globalBC()); /// Just let Zorro do the accounting + if (zorroSelected) { + registry.fill(HIST("hEventCounter"), 3.5); + } + } + bool if_hasvtx = false; auto d3bodyCands = vtx3bodydatas.sliceBy(perCollisionVtx3BodyDatas, collision.globalIndex()); - for (auto vtx : d3bodyCands) { - CandidateAnalysis(collision, vtx, if_hasvtx); + for (const auto& vtx : d3bodyCands) { + candidateAnalysis(collision, vtx, if_hasvtx); } if (if_hasvtx) - registry.fill(HIST("hEventCounter"), 3.5); + registry.fill(HIST("hEventCounter"), 4.5); fillHistos(); resetHistos(); - for (auto& cand3body : Candidates3body) { + for (const auto& cand3body : candidates3body) { outputDataTable(collision.centFT0C(), cand3body.isMatter, cand3body.invmass, cand3body.lcand.P(), cand3body.lcand.Pt(), cand3body.ct, cand3body.cosPA, cand3body.dcadaughters, cand3body.dcacandtopv, cand3body.vtxradius, @@ -573,36 +627,43 @@ struct threebodyRecoTask { } } } - PROCESS_SWITCH(threebodyRecoTask, processData, "Real data reconstruction", true); + PROCESS_SWITCH(ThreebodyRecoTask, processData, "Real data reconstruction", true); //------------------------------------------------------------------ // process like-sign signal void processDataLikeSign(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, FullTracksExtIU const& /*tracks*/) { - for (auto collision : collisions) { - Candidates3body.clear(); + for (const auto& collision : collisions) { + candidates3body.clear(); registry.fill(HIST("hEventCounter"), 0.5); if (event_sel8_selection && !collision.sel8()) { continue; } registry.fill(HIST("hEventCounter"), 1.5); - if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm + if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm continue; } registry.fill(HIST("hEventCounter"), 2.5); registry.fill(HIST("hCentFT0C"), collision.centFT0C()); + if (cfgSkimmedProcessing) { + bool zorroSelected = zorro.isSelected(collision.bc_as().globalBC()); /// Just let Zorro do the accounting + if (zorroSelected) { + registry.fill(HIST("hEventCounter"), 3.5); + } + } + bool if_hasvtx = false; auto d3bodyCands = vtx3bodydatas.sliceBy(perCollisionVtx3BodyDatas, collision.globalIndex()); - for (auto vtx : d3bodyCands) { - LikeSignAnalysis(collision, vtx, if_hasvtx); + for (const auto& vtx : d3bodyCands) { + likeSignAnalysis(collision, vtx, if_hasvtx); } if (if_hasvtx) - registry.fill(HIST("hEventCounter"), 3.5); + registry.fill(HIST("hEventCounter"), 4.5); fillHistos(); resetHistos(); - for (auto& cand3body : Candidates3body) { + for (const auto& cand3body : candidates3body) { outputDataTable(collision.centFT0C(), cand3body.isMatter, cand3body.invmass, cand3body.lcand.P(), cand3body.lcand.Pt(), cand3body.ct, cand3body.cosPA, cand3body.dcadaughters, cand3body.dcacandtopv, cand3body.vtxradius, @@ -617,24 +678,24 @@ struct threebodyRecoTask { } } } - PROCESS_SWITCH(threebodyRecoTask, processDataLikeSign, "Like-sign signal reconstruction", false); + PROCESS_SWITCH(ThreebodyRecoTask, processDataLikeSign, "Like-sign signal reconstruction", false); //------------------------------------------------------------------ // process mc analysis void processMC(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, aod::McParticles const& particlesMC, MCLabeledTracksIU const& /*tracks*/, aod::McCollisions const& mcCollisions) { filledMothers.clear(); - GetGeneratedH3LInfo(particlesMC); + getGeneratedH3LInfo(particlesMC); isGoodCollision.resize(mcCollisions.size(), false); for (const auto& collision : collisions) { - Candidates3body.clear(); + candidates3body.clear(); registry.fill(HIST("hEventCounter"), 0.5); if (mc_event_selection && (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) { continue; } registry.fill(HIST("hEventCounter"), 1.5); - if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm + if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm continue; } registry.fill(HIST("hEventCounter"), 2.5); @@ -647,7 +708,7 @@ struct threebodyRecoTask { bool if_hasvtx = false; auto vtxsthiscol = vtx3bodydatas.sliceBy(perCollisionVtx3BodyDatas, collision.globalIndex()); - for (auto& vtx : vtxsthiscol) { + for (const auto& vtx : vtxsthiscol) { int lLabel = -1; int lPDG = -1; double MClifetime = -1; @@ -661,9 +722,9 @@ struct threebodyRecoTask { auto lMCTrack1 = track1.mcParticle_as(); auto lMCTrack2 = track2.mcParticle_as(); if (lMCTrack0.has_mothers() && lMCTrack1.has_mothers() && lMCTrack2.has_mothers()) { - for (auto& lMother0 : lMCTrack0.mothers_as()) { - for (auto& lMother1 : lMCTrack1.mothers_as()) { - for (auto& lMother2 : lMCTrack2.mothers_as()) { + for (const auto& lMother0 : lMCTrack0.mothers_as()) { + for (const auto& lMother1 : lMCTrack1.mothers_as()) { + for (const auto& lMother2 : lMCTrack2.mothers_as()) { if (lMother0.globalIndex() == lMother1.globalIndex() && lMother0.globalIndex() == lMother2.globalIndex()) { lLabel = lMother0.globalIndex(); lPDG = lMother0.pdgCode(); @@ -680,15 +741,15 @@ struct threebodyRecoTask { } } - CandidateAnalysis(collision, vtx, if_hasvtx, isTrueCand, lLabel, lmother, MClifetime); + candidateAnalysis(collision, vtx, if_hasvtx, isTrueCand, lLabel, lmother, MClifetime); } if (if_hasvtx) - registry.fill(HIST("hEventCounter"), 3.5); + registry.fill(HIST("hEventCounter"), 4.5); fillHistos(); resetHistos(); - for (auto& cand3body : Candidates3body) { + for (const auto& cand3body : candidates3body) { outputMCTable(collision.centFT0C(), cand3body.isMatter, cand3body.invmass, cand3body.lcand.P(), cand3body.lcand.Pt(), cand3body.ct, cand3body.cosPA, cand3body.dcadaughters, cand3body.dcacandtopv, cand3body.vtxradius, @@ -701,12 +762,12 @@ struct threebodyRecoTask { cand3body.daudcaxytopv[0], cand3body.daudcaxytopv[1], cand3body.daudcaxytopv[2], cand3body.daudcatopv[0], cand3body.daudcatopv[1], cand3body.daudcatopv[2], cand3body.lgencand.P(), cand3body.lgencand.Pt(), cand3body.genct, cand3body.lgencand.Phi(), cand3body.lgencand.Eta(), cand3body.lgencand.Rapidity(), - cand3body.isSignal, cand3body.isReco, cand3body.pdgCode, cand3body.SurvivedEventSelection); + cand3body.isSignal, cand3body.isReco, cand3body.pdgCode, cand3body.survivedEventSelection); } } // now we fill only the signal candidates that were not reconstructed - for (auto& mcparticle : particlesMC) { + for (const auto& mcparticle : particlesMC) { if (!is3bodyDecayed(mcparticle)) { continue; } @@ -715,7 +776,7 @@ struct threebodyRecoTask { } bool isSurEvSelection = isGoodCollision[mcparticle.mcCollisionId()]; std::array posSV{0.f}; - for (auto& mcDaughter : mcparticle.daughters_as()) { + for (const auto& mcDaughter : mcparticle.daughters_as()) { if (std::abs(mcDaughter.pdgCode()) == bachelorPdgCode) { posSV = {mcDaughter.vx(), mcDaughter.vy(), mcDaughter.vz()}; } @@ -736,12 +797,12 @@ struct threebodyRecoTask { true, false, mcparticle.pdgCode(), isSurEvSelection); } } - PROCESS_SWITCH(threebodyRecoTask, processMC, "MC reconstruction", false); + PROCESS_SWITCH(ThreebodyRecoTask, processMC, "MC reconstruction", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; } From ec01879054c1f09b463975b71d06169357e3cd01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20L=C3=B6mker?= Date: Thu, 5 Dec 2024 11:32:02 +0100 Subject: [PATCH 53/91] [PWGJE] fix snp binning trackJetQA.cxx (#8824) --- PWGJE/Tasks/trackJetQA.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/trackJetQA.cxx b/PWGJE/Tasks/trackJetQA.cxx index 9477f88d66e..437fdd914a0 100644 --- a/PWGJE/Tasks/trackJetQA.cxx +++ b/PWGJE/Tasks/trackJetQA.cxx @@ -171,7 +171,7 @@ struct TrackJetQa { histos.add("TrackPar/xyz", "track #it{x}, #it{y}, #it{z} position at dca in local coordinate system", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisTrackX, axisTrackY, axisTrackZ, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/alpha", "rotation angle of local wrt. global coordinate system", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisRotation, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/signed1Pt", "track signed 1/#it{p}_{T}", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisSignedPt, axisPercentileFT0A, axisPercentileFT0C}); - histos.add("TrackPar/snp", "sinus of track momentum azimuthal angle (snp)", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, {11, -0.05, 0.5, "snp"}, axisPercentileFT0A, axisPercentileFT0C}); + histos.add("TrackPar/snp", "sinus of track momentum azimuthal angle (snp)", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, {11, -0.5, 0.5, "snp"}, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/tgl", "tangent of the track momentum dip angle (tgl)", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, {200, -1., 1., "tgl"}, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/flags", "track flag;#it{p}_{T} [GeV/c];flag bit", {HistType::kTH2F, {{200, 0, 200}, {64, -0.5, 63.5}}}); histos.add("TrackPar/dcaXY", "distance of closest approach in #it{xy} plane", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisDcaXY, axisPercentileFT0A, axisPercentileFT0C}); From a106d9793bc7bdc3d9be4356b77c8bc838b2574a Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:39:02 +0100 Subject: [PATCH 54/91] [PWGHF] Add variables and selections to pid studies task (#8807) --- PWGHF/Tasks/CMakeLists.txt | 10 +- .../{pidStudies.cxx => taskPidStudies.cxx} | 133 ++++++++++++++---- 2 files changed, 108 insertions(+), 35 deletions(-) rename PWGHF/Tasks/{pidStudies.cxx => taskPidStudies.cxx} (75%) diff --git a/PWGHF/Tasks/CMakeLists.txt b/PWGHF/Tasks/CMakeLists.txt index 888961a70de..9a46eeba773 100644 --- a/PWGHF/Tasks/CMakeLists.txt +++ b/PWGHF/Tasks/CMakeLists.txt @@ -44,12 +44,12 @@ o2physics_add_dpl_workflow(task-multiplicity-estimator-correlation PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-pid-studies + SOURCES taskPidStudies.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # o2physics_add_dpl_workflow(task-sel-optimisation # SOURCES taskSelOptimisation.cxx # PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore # COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(pid-studies - SOURCES pidStudies.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) diff --git a/PWGHF/Tasks/pidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx similarity index 75% rename from PWGHF/Tasks/pidStudies.cxx rename to PWGHF/Tasks/taskPidStudies.cxx index 6b72dc01378..8516963bafc 100644 --- a/PWGHF/Tasks/pidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file pidStudies.cxx +/// \file taskPidStudies.cxx /// \brief task for studies of PID performance /// /// \author Fabrizio Chinu , Università and INFN Torino @@ -49,8 +49,12 @@ DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) +DECLARE_SOA_COLUMN(TpcInnerParPos, tpcInnerParPos, float); //! Momentum of positive track at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(TpcInnerParNeg, tpcInnerParNeg, float); //! Momentum of negative track at inner wall of TPC (GeV/c) DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle +DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float); //! DCA between V0 daughters +DECLARE_SOA_COLUMN(DcaV0ToPv, dcaV0ToPv, float); //! DCA V0 to PV DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis @@ -66,10 +70,10 @@ DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass DECLARE_SOA_COLUMN(BachPt, bachPt, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(TpcInnerParBach, tpcInnerParBach, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! Daughter lambda mass (GeV/c^2) DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA -DECLARE_SOA_COLUMN(CascCosPA, casccosPA, float); //! Cascade CPA -DECLARE_SOA_COLUMN(DCAV0daughters, dcaV0daughters, float); //! DCA of V0 daughters -DECLARE_SOA_COLUMN(DCAv0topv, dcav0topv, float); //! V0 DCA to PV +DECLARE_SOA_COLUMN(CascCosPa, cascCosPa, float); //! Cascade CPA DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of bachelor with kaon hypothesis DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis @@ -88,8 +92,12 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information pid_studies::Pt, pid_studies::PtPos, pid_studies::PtNeg, + pid_studies::TpcInnerParPos, + pid_studies::TpcInnerParNeg, pid_studies::Radius, pid_studies::Cpa, + pid_studies::DcaV0Daughters, + pid_studies::DcaV0ToPv, pid_studies::NSigmaTpcPosPi, pid_studies::NSigmaTpcNegPi, pid_studies::NSigmaTpcPosPr, @@ -110,11 +118,13 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat pid_studies::MassOmega, pid_studies::Pt, pid_studies::BachPt, + pid_studies::TpcInnerParBach, + pid_studies::MLambda, pid_studies::V0cosPA, pid_studies::MassXi, - pid_studies::CascCosPA, - pid_studies::DCAV0daughters, - pid_studies::DCAv0topv, + pid_studies::CascCosPa, + pid_studies::DcaV0Daughters, + pid_studies::DcaV0ToPv, pid_studies::NSigmaTpcBachKa, pid_studies::NSigmaTofBachKa, pid_studies::OccupancyFt0c, @@ -124,7 +134,7 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat pid_studies::CandFlag); } // namespace o2::aod -struct HfPidStudies { +struct HfTaskPidStudies { Produces pidV0; Produces pidCascade; @@ -134,6 +144,8 @@ struct HfPidStudies { Configurable massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; + Configurable qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; + Configurable qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -144,6 +156,13 @@ struct HfPidStudies { using V0sMcRec = soa::Join; using CascsMcRec = soa::Join; + void init(InitContext&) + { + if ((doprocessV0Mc && doprocessV0Data) || (doprocessCascMc && doprocessCascData)) { + LOGP(fatal, "Both data and MC process functions were enabled! Please check your configuration!"); + } + } + template void fillTree(Cand const& candidate, const int flag) { @@ -163,8 +182,12 @@ struct HfPidStudies { candidate.pt(), posTrack.pt(), negTrack.pt(), + posTrack.tpcInnerParam(), + negTrack.tpcInnerParam(), candidate.v0radius(), candidate.v0cosPA(), + candidate.dcaV0daughters(), + candidate.dcav0topv(), posTrack.tofNSigmaPi(), negTrack.tofNSigmaPi(), posTrack.tofNSigmaPr(), @@ -186,6 +209,8 @@ struct HfPidStudies { candidate.mOmega(), candidate.pt(), candidate.bachelorpt(), + bachTrack.tpcInnerParam(), + candidate.mLambda(), candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), candidate.mXi(), candidate.casccosPA(coll.posX(), coll.posY(), coll.posZ()), @@ -242,25 +267,78 @@ struct HfPidStudies { return aod::pid_studies::Particle::NotMatched; } - void processMc(V0sMcRec const& V0s, - aod::V0MCCores const&, - CascsMcRec const& cascades, - aod::CascMCCores const&, - CollSels const&, - PidTracks const&) + template + bool isSelectedV0AsK0s(const V0Cand& v0) + { + if (v0.mK0Short() < massK0Min || v0.mK0Short() > massK0Max) { + return false; + } + if (v0.qtarm() < qtArmenterosMinForK0) { + return false; + } + return true; + } + + template + bool isSelectedV0AsLambda(const V0Cand& v0) + { + if ((v0.mLambda() < massLambdaMin || v0.mLambda() > massLambdaMax) && + (v0.mAntiLambda() < massLambdaMin || v0.mAntiLambda() > massLambdaMax)) { + return false; + } + if (v0.qtarm() > qtArmenterosMaxForLambda) { + return false; + } + return true; + } + + template + bool isSelectedCascAsOmega(const CascCand& casc) + { + if (casc.mOmega() < massOmegaMin || casc.mOmega() > massOmegaMax) { + return false; + } + if (casc.mLambda() < massLambdaMin || casc.mLambda() > massLambdaMax) { + return false; + } + return true; + } + + void processV0Mc(V0sMcRec const& V0s, + aod::V0MCCores const&, + CollSels const&, + PidTracks const&) { for (const auto& v0 : V0s) { - if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || - (v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || - (v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { + if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { int matched = isMatched(v0); if (matched != aod::pid_studies::Particle::NotMatched) { fillTree(v0, matched); } } } + } + PROCESS_SWITCH(HfTaskPidStudies, processV0Mc, "Process MC", true); + + void processV0Data(aod::V0Datas const& V0s, + CollSels const&, + PidTracks const&) + { + for (const auto& v0 : V0s) { + if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { + fillTree(v0, aod::pid_studies::Particle::NotMatched); + } + } + } + PROCESS_SWITCH(HfTaskPidStudies, processV0Data, "Process data", false); + + void processCascMc(CascsMcRec const& cascades, + aod::CascMCCores const&, + CollSels const&, + PidTracks const&) + { for (const auto& casc : cascades) { - if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { + if (isSelectedCascAsOmega(casc)) { int matched = isMatched(casc); if (matched != aod::pid_studies::Particle::NotMatched) { fillTree(casc, matched); @@ -268,27 +346,22 @@ struct HfPidStudies { } } } - PROCESS_SWITCH(HfPidStudies, processMc, "Process MC", true); + PROCESS_SWITCH(HfTaskPidStudies, processCascMc, "Process MC", true); - void processData(aod::V0Datas const& V0s, aod::CascDatas const& cascades, CollSels const&, PidTracks const&) + void processCascData(aod::CascDatas const& cascades, + CollSels const&, + PidTracks const&) { - for (const auto& v0 : V0s) { - if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || - (v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || - (v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { - fillTree(v0, aod::pid_studies::Particle::NotMatched); - } - } for (const auto& casc : cascades) { - if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { + if (isSelectedCascAsOmega(casc)) { fillTree(casc, aod::pid_studies::Particle::NotMatched); } } } - PROCESS_SWITCH(HfPidStudies, processData, "Process data", false); + PROCESS_SWITCH(HfTaskPidStudies, processCascData, "Process data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From aa2575c5b31ce9784205eab6195c2a828ba9c72f Mon Sep 17 00:00:00 2001 From: dajones2 <140733426+dajones2@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:06:08 +0000 Subject: [PATCH 55/91] [PWGJE] Adding 1D matched histograms for jet efficiency (#8822) --- PWGJE/Tasks/jetHadronRecoil.cxx | 218 ++++++++++++++++---------------- 1 file changed, 111 insertions(+), 107 deletions(-) diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index df4569a415e..b6cb7d9ee6d 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -8,10 +8,10 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -// h+jet analysis task // -// Authors: Daniel Jones +/// \file jetHadronRecoil.cxx +/// \brief Task for analysing hadron triggered events. +/// \author Daniel Jones #include #include @@ -45,27 +45,27 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct hJetAnalysis { +struct JetHadronRecoil { - Configurable eventSelections{"eventSelection", "sel8", "choose event selection"}; - Configurable trackSelections{"trackSelection", "globalTracks", "set track selections"}; + Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; Configurable trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"}; Configurable trackPtMax{"trackPtMax", 100.0, "maximum pT acceptance for tracks"}; Configurable trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"}; Configurable trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"}; Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; - Configurable pt_TTref_min{"pt_TTref_min", 5, "reference minimum trigger track pt"}; - Configurable pt_TTref_max{"pt_TTref_max", 7, "reference maximum trigger track pt"}; - Configurable pt_TTsig_min{"pt_TTsig_min", 20, "signal minimum trigger track pt"}; - Configurable pt_TTsig_max{"pt_TTsig_max", 50, "signal maximum trigger track pt"}; - Configurable frac_sig{"frac_sig", 0.5, "fraction of events to use for signal"}; + Configurable ptTTrefMin{"ptTTrefMin", 5, "reference minimum trigger track pt"}; + Configurable ptTTrefMax{"ptTTrefMax", 7, "reference maximum trigger track pt"}; + Configurable ptTTsigMin{"ptTTsigMin", 20, "signal minimum trigger track pt"}; + Configurable ptTTsigMax{"ptTTsigMax", 50, "signal maximum trigger track pt"}; + Configurable fracSig{"fracSig", 0.5, "fraction of events to use for signal"}; Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; - Preslice> PartJetsPerCollision = aod::jet::mcCollisionId; + Preslice> partJetsPerCollision = aod::jet::mcCollisionId; TRandom3* rand = new TRandom3(0); @@ -79,18 +79,18 @@ struct hJetAnalysis { {"hPtTrack", "Track p_{T};p_{T};entries", {HistType::kTH1F, {{200, 0, 200}}}}, {"hEtaTrack", "Track #eta;#eta;entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}}, {"hPhiTrack", "Track #phi;#phi;entries", {HistType::kTH1F, {{160, -1.0, 7.0}}}}, - {"hReferencePtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, - {"hSignalPtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, + {"hReferencePtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, + {"hSignalPtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, {"hReferencePt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{150, 0, 150}}}}, {"hSignalPt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{150, 0, 150}}}}, - {"hSignalLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, - {"hReferenceLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, + {"hSignalLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, + {"hReferenceLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, {"hJetSignalMultiplicity", "jet multiplicity;N_{jets};entries", {HistType::kTH1F, {{10, 0, 10}}}}, {"hJetReferenceMultiplicity", "jet multiplicity;N_{jets};entries", {HistType::kTH1F, {{10, 0, 10}}}}, - {"hJetSignalConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {50, 0, 50}}}}, - {"hJetReferenceConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {50, 0, 50}}}}, - {"hJetSignalConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, - {"hJetReferenceConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, + {"hJetSignalConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {50, 0, 50}}}}, + {"hJetReferenceConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {50, 0, 50}}}}, + {"hJetSignalConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, + {"hJetReferenceConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, {"hSigEventTriggers", "N_{triggers};events", {HistType::kTH1F, {{10, 0, 10}}}}, {"hRefEventTriggers", "N_{triggers};events", {HistType::kTH1F, {{10, 0, 10}}}}, {"hJetPt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{200, 0, 200}}}}, @@ -107,17 +107,19 @@ struct hJetAnalysis { {"hDeltaRSignalPart", "Particle #DeltaR;#DeltaR;#frac{1}{N_{jets}}#frac{dN_{jets}}{d#DeltaR}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hDeltaRpTSignal", "jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, {"hDeltaRpTSignalPart", "Particle jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiSignal", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiSignalPart", "Particle jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiSignal", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiSignalPart", "Particle jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, {"hDeltaRReference", "#DeltaR;#DeltaR;#frac{dN_{jets}}{d#DeltaR}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hDeltaRPartReference", "Particle #DeltaR;#DeltaR;#frac{1}{N_{jets}}#frac{dN_{jets}}{d#DeltaR}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hDeltaRpTReference", "jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, {"hDeltaRpTPartReference", "Particle jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiReference", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiReferencePart", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiReference", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiReferencePart", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, {"hPtMatched", "p_{T} matching;p_{T,det};p_{T,part}", {HistType::kTH2F, {{200, 0, 200}, {200, 0, 200}}}}, {"hPhiMatched", "#phi matching;#phi_{det};#phi_{part}", {HistType::kTH2F, {{160, -1.0, 7.0}, {160, -1.0, 7.0}}}}, {"hDeltaRMatched", "#DeltaR matching;#DeltaR_{det};#DeltaR_{part}", {HistType::kTH2F, {{50, 0.0, 0.15}, {50, 0.0, 0.15}}}}, + {"hPtMatched1d", "p_{T} matching 1d;p_{T,part}", {HistType::kTH1F, {{200, 0, 200}}}}, + {"hDeltaRMatched1d", "#DeltaR matching 1d;#DeltaR_{part}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hPtResolution", "p_{T} resolution;p_{T,part};Relative Resolution", {HistType::kTH2F, {{200, 0, 200}, {1000, -5.0, 5.0}}}}, {"hPhiResolution", "#phi resolution;#p{T,part};Resolution", {HistType::kTH2F, {{200, 0, 200}, {1000, -7.0, 7.0}}}}, {"hDeltaRResolution", "#DeltaR Resolution;p_{T,part};Resolution", {HistType::kTH2F, {{200, 0, 200}, {1000, -0.15, 0.15}}}}, @@ -143,70 +145,70 @@ struct hJetAnalysis { template void fillHistograms(T const& jets, W const& /*jetsWTA*/, U const& tracks, float weight = 1.0) { - bool is_sig_col; - std::vector phi_TT_ar; - double phi_TT = 0; - int trig_number = 0; - int n_TT = 0; + bool isSigCol; + std::vector phiTTAr; + double phiTT = 0; + int trigNumber = 0; + int nTT = 0; double leadingPT = 0; float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); float dice = rand->Rndm(); - if (dice < frac_sig) - is_sig_col = true; + if (dice < fracSig) + isSigCol = true; else - is_sig_col = false; + isSigCol = false; - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { continue; } - if (is_sig_col && track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { - phi_TT_ar.push_back(track.phi()); - n_TT++; + if (isSigCol && track.pt() < ptTTsigMax && track.pt() > ptTTsigMin) { + phiTTAr.push_back(track.phi()); + nTT++; } - if (!is_sig_col && track.pt() < pt_TTref_max && track.pt() > pt_TTref_min) { - phi_TT_ar.push_back(track.phi()); - n_TT++; + if (!isSigCol && track.pt() < ptTTrefMax && track.pt() > ptTTrefMin) { + phiTTAr.push_back(track.phi()); + nTT++; } registry.fill(HIST("hPtTrack"), track.pt(), weight); registry.fill(HIST("hEtaTrack"), track.eta(), weight); registry.fill(HIST("hPhiTrack"), track.phi(), weight); } - if (n_TT > 0) { - trig_number = rand->Integer(n_TT); - phi_TT = phi_TT_ar[trig_number]; - if (is_sig_col) { + if (nTT > 0) { + trigNumber = rand->Integer(nTT); + phiTT = phiTTAr[trigNumber]; + if (isSigCol) { registry.fill(HIST("hNtrig"), 1.5, weight); registry.fill(HIST("hJetSignalMultiplicity"), jets.size(), weight); - registry.fill(HIST("hSigEventTriggers"), n_TT, weight); + registry.fill(HIST("hSigEventTriggers"), nTT, weight); } - if (!is_sig_col) { + if (!isSigCol) { registry.fill(HIST("hNtrig"), 0.5, weight); registry.fill(HIST("hJetReferenceMultiplicity"), jets.size(), weight); - registry.fill(HIST("hRefEventTriggers"), n_TT, weight); + registry.fill(HIST("hRefEventTriggers"), nTT, weight); } } - for (auto& jet : jets) { + for (const auto& jet : jets) { if (jet.pt() > pTHatMaxMCD * pTHat) { continue; } registry.fill(HIST("hJetPt"), jet.pt(), weight); registry.fill(HIST("hJetEta"), jet.eta(), weight); registry.fill(HIST("hJetPhi"), jet.phi(), weight); - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); registry.fill(HIST("hDeltaR"), dR, weight); registry.fill(HIST("hDeltaRpT"), jet.pt(), dR, weight); } - if (n_TT > 0) { - float dphi = RecoDecay::constrainAngle(jet.phi() - phi_TT); - if (is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (nTT > 0) { + float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT); + if (isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -221,7 +223,7 @@ struct hJetAnalysis { registry.fill(HIST("hSignalPt"), jet.pt(), weight); } registry.fill(HIST("hJetSignalConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -229,8 +231,8 @@ struct hJetAnalysis { } registry.fill(HIST("hSignalLeadingTrack"), jet.pt(), dphi, leadingPT, weight); } - if (!is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (!isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -245,7 +247,7 @@ struct hJetAnalysis { registry.fill(HIST("hReferencePt"), jet.pt(), weight); } registry.fill(HIST("hJetReferenceConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -260,21 +262,21 @@ struct hJetAnalysis { template void fillMCPHistograms(T const& jets, W const& /*jetsWTA*/, U const& particles, float weight = 1.0) { - bool is_sig_col; - std::vector phi_TT_ar; - double phi_TT = 0; - int trig_number = 0; - int n_TT = 0; + bool isSigCol; + std::vector phiTTAr; + double phiTT = 0; + int trigNumber = 0; + int nTT = 0; double leadingPT = 0; float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); float dice = rand->Rndm(); - if (dice < frac_sig) - is_sig_col = true; + if (dice < fracSig) + isSigCol = true; else - is_sig_col = false; + isSigCol = false; - for (auto& particle : particles) { + for (const auto& particle : particles) { auto pdgParticle = pdg->GetParticle(particle.pdgCode()); if (!pdgParticle) { continue; @@ -282,52 +284,52 @@ struct hJetAnalysis { if ((pdgParticle->Charge() == 0.0) || (!particle.isPhysicalPrimary())) { continue; } - if (is_sig_col && particle.pt() < pt_TTsig_max && particle.pt() > pt_TTsig_min) { - phi_TT_ar.push_back(particle.phi()); - n_TT++; + if (isSigCol && particle.pt() < ptTTsigMax && particle.pt() > ptTTsigMin) { + phiTTAr.push_back(particle.phi()); + nTT++; } - if (!is_sig_col && particle.pt() < pt_TTref_max && particle.pt() > pt_TTref_min) { - phi_TT_ar.push_back(particle.phi()); - n_TT++; + if (!isSigCol && particle.pt() < ptTTrefMax && particle.pt() > ptTTrefMin) { + phiTTAr.push_back(particle.phi()); + nTT++; } registry.fill(HIST("hPtPart"), particle.pt(), weight); registry.fill(HIST("hEtaPart"), particle.eta(), weight); registry.fill(HIST("hPhiPart"), particle.phi(), weight); } - if (n_TT > 0) { - trig_number = rand->Integer(n_TT); - phi_TT = phi_TT_ar[trig_number]; - if (is_sig_col) { + if (nTT > 0) { + trigNumber = rand->Integer(nTT); + phiTT = phiTTAr[trigNumber]; + if (isSigCol) { registry.fill(HIST("hNtrig"), 1.5, weight); registry.fill(HIST("hJetSignalMultiplicity"), jets.size(), weight); - registry.fill(HIST("hSigEventTriggers"), n_TT, weight); + registry.fill(HIST("hSigEventTriggers"), nTT, weight); } - if (!is_sig_col) { + if (!isSigCol) { registry.fill(HIST("hNtrig"), 0.5, weight); registry.fill(HIST("hJetReferenceMultiplicity"), jets.size(), weight); - registry.fill(HIST("hRefEventTriggers"), n_TT, weight); + registry.fill(HIST("hRefEventTriggers"), nTT, weight); } } - for (auto& jet : jets) { + for (const auto& jet : jets) { if (jet.pt() > pTHatMaxMCP * pTHat) { continue; } registry.fill(HIST("hJetPt"), jet.pt(), weight); registry.fill(HIST("hJetEta"), jet.eta(), weight); registry.fill(HIST("hJetPhi"), jet.phi(), weight); - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); registry.fill(HIST("hDeltaRPart"), dR, weight); registry.fill(HIST("hDeltaRpTPart"), jet.pt(), dR, weight); } - if (n_TT > 0) { - float dphi = RecoDecay::constrainAngle(jet.phi() - phi_TT); - if (is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (nTT > 0) { + float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT); + if (isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -342,7 +344,7 @@ struct hJetAnalysis { registry.fill(HIST("hSignalPt"), jet.pt(), weight); } registry.fill(HIST("hJetSignalConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -350,8 +352,8 @@ struct hJetAnalysis { } registry.fill(HIST("hSignalLeadingTrack"), jet.pt(), dphi, leadingPT, weight); } - if (!is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (!isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -366,7 +368,7 @@ struct hJetAnalysis { registry.fill(HIST("hReferencePt"), jet.pt(), weight); } registry.fill(HIST("hJetReferenceConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -401,7 +403,7 @@ struct hJetAnalysis { } if (jetBase.has_matchedJetGeo()) { - for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { + for (const auto& jetTag : jetBase.template matchedJetGeo_as>()) { if (jetTag.pt() > pTHatMaxMCP * pTHat) { continue; } @@ -422,6 +424,8 @@ struct hJetAnalysis { registry.fill(HIST("hDeltaRMatched"), dR, dRp, weight); registry.fill(HIST("hDeltaRResolution"), jetTag.pt(), dRp - dR, weight); registry.fill(HIST("hFullMatching"), jetBase.pt(), jetTag.pt(), jetBase.phi(), jetTag.phi(), dR, dRp, weight); + registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight); + registry.fill(HIST("hDeltaRMatched1d"), dRp, weight); } } } @@ -440,7 +444,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillHistograms(jets, jetsWTA, tracks); } - PROCESS_SWITCH(hJetAnalysis, processData, "process data", true); + PROCESS_SWITCH(JetHadronRecoil, processData, "process data", true); void processMCD(soa::Filtered::iterator const& collision, soa::Filtered> const& jets, @@ -456,7 +460,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillHistograms(jets, jetsWTA, tracks); } - PROCESS_SWITCH(hJetAnalysis, processMCD, "process MC detector level", false); + PROCESS_SWITCH(JetHadronRecoil, processMCD, "process MC detector level", false); void processMCDWeighted(soa::Filtered>::iterator const& collision, aod::JMcCollisions const&, @@ -473,7 +477,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.mcCollision().weight()); fillHistograms(jets, jetsWTA, tracks, collision.mcCollision().weight()); } - PROCESS_SWITCH(hJetAnalysis, processMCDWeighted, "process MC detector level with event weights", false); + PROCESS_SWITCH(JetHadronRecoil, processMCDWeighted, "process MC detector level with event weights", false); void processMCP(aod::JetMcCollision const& collision, soa::Filtered> const& jets, @@ -486,7 +490,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillMCPHistograms(jets, jetsWTA, particles); } - PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false); + PROCESS_SWITCH(JetHadronRecoil, processMCP, "process MC particle level", false); void processMCPWeighted(aod::JetMcCollision const& collision, soa::Filtered> const& jets, @@ -499,7 +503,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.weight()); fillMCPHistograms(jets, jetsWTA, particles, collision.weight()); } - PROCESS_SWITCH(hJetAnalysis, processMCPWeighted, "process MC particle level with event weights", false); + PROCESS_SWITCH(JetHadronRecoil, processMCPWeighted, "process MC particle level with event weights", false); void processJetsMCPMCDMatched(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -517,12 +521,12 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); for (const auto& mcdjet : mcdjets) { fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets); } } - PROCESS_SWITCH(hJetAnalysis, processJetsMCPMCDMatched, "process MC matched (inc jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processJetsMCPMCDMatched, "process MC matched (inc jets)", false); void processJetsMCPMCDMatchedWeighted(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -540,12 +544,12 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); for (const auto& mcdjet : mcdjets) { fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets, mcdjet.eventWeight()); } } - PROCESS_SWITCH(hJetAnalysis, processJetsMCPMCDMatchedWeighted, "process MC matched with event weights (inc jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processJetsMCPMCDMatchedWeighted, "process MC matched with event weights (inc jets)", false); void processRecoilJetsMCPMCDMatched(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -563,10 +567,10 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); bool ishJetEvent = false; - for (auto& track : tracks) { - if (track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { + for (const auto& track : tracks) { + if (track.pt() < ptTTsigMax && track.pt() > ptTTsigMin) { ishJetEvent = true; break; } @@ -577,7 +581,7 @@ struct hJetAnalysis { } } } - PROCESS_SWITCH(hJetAnalysis, processRecoilJetsMCPMCDMatched, "process MC matched (recoil jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processRecoilJetsMCPMCDMatched, "process MC matched (recoil jets)", false); void processRecoilJetsMCPMCDMatchedWeighted(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -595,10 +599,10 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); bool ishJetEvent = false; - for (auto& track : tracks) { - if (track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { + for (const auto& track : tracks) { + if (track.pt() < ptTTsigMax && track.pt() > ptTTsigMin) { ishJetEvent = true; break; } @@ -609,7 +613,7 @@ struct hJetAnalysis { } } } - PROCESS_SWITCH(hJetAnalysis, processRecoilJetsMCPMCDMatchedWeighted, "process MC matched with event weights (recoil jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processRecoilJetsMCPMCDMatchedWeighted, "process MC matched with event weights (recoil jets)", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hJetAnalysis"})}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 91d52aa7785e1e49d28705b7f4b1d083ecde1aeb Mon Sep 17 00:00:00 2001 From: choich08365 <157435123+choich08365@users.noreply.github.com> Date: Thu, 5 Dec 2024 23:07:13 +0900 Subject: [PATCH 56/91] [PWGJE] Applied jet reduction factor for GNN process (#8811) Co-authored-by: chchoi --- PWGJE/Tasks/bjetTreeCreator.cxx | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index 5c291077d81..6f9fe6a85b1 100644 --- a/PWGJE/Tasks/bjetTreeCreator.cxx +++ b/PWGJE/Tasks/bjetTreeCreator.cxx @@ -293,12 +293,12 @@ struct BJetTreeCreator { if (doprocessMCJetsForGNN) { //+jet - registry.add("h_jet_pt", "jet_pt;#it{p}_{T}^{ch jet} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 200.}}}); - registry.add("h_jet_eta", "jet_eta;#it{#eta}_{ch jet};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("h_jet_phi", "jet_phi;#it{#phi}_{ch jet};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_jet_pt", "jet_pt;#it{p}_{T}^{ch jet} (GeV/#it{c});Entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_jet_eta", "jet_eta;#it{#eta}_{ch jet};Entries", {HistType::kTH1F, {{200, -2., 2.}}}); + registry.add("h_jet_phi", "jet_phi;#it{#phi}_{ch jet};Entries", {HistType::kTH1F, {{200, 0., 2. * M_PI}}}); registry.add("h_jet_flav", "jet_flav;jet flavor;Entries", {HistType::kTH1F, {{4, 0., 4.}}}); registry.add("h_n_trks", "n_trks;#it{n}_{tracks};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); - registry.add("h_jet_mass", "jet_mass;#it{m}_{jet} (GeV/#it{c}^2);Entries", {HistType::kTH1F, {{100, 0., 50.}}}); + registry.add("h_jet_mass", "jet_mass;#it{m}_{jet} (GeV/#it{c}^2);Entries", {HistType::kTH1F, {{200, 0., 50.}}}); auto h_jet_flav = registry.get(HIST("h_jet_flav")); h_jet_flav->GetXaxis()->SetBinLabel(1, "no mcparticle"); // 0 h_jet_flav->GetXaxis()->SetBinLabel(2, "c-jet"); // 1 @@ -306,21 +306,20 @@ struct BJetTreeCreator { h_jet_flav->GetXaxis()->SetBinLabel(4, "lf-jet"); // 3 registry.add("h_n_vertices", "n_vertices;#it{n}_{vertex};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); //+trk - registry.add("h_trk_pt", "trk_pt;#it{p}_{T} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 100.}}}); - registry.add("h_trk_eta", "trk_eta;#it{#eta};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("h_trk_phi", "trk_phi;#it{#phi};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_trk_pt", "trk_pt;#it{p}_{T} (GeV/#it{c});Entries", {HistType::kTH1F, {{200, 0., 100.}}}); + registry.add("h_trk_eta", "trk_eta;#it{#eta};Entries", {HistType::kTH1F, {{200, -2., 2.}}}); + registry.add("h_trk_phi", "trk_phi;#it{#phi};Entries", {HistType::kTH1F, {{200, 0., 2. * M_PI}}}); registry.add("h_trk_charge", "trk_charge;#it{q};Entries", {HistType::kTH1F, {{3, -1.5, 1.5}}}); - registry.add("h_trk_dcaxy", "trk_dcaxy;#it{DCA}_{xy} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); - registry.add("h_trk_dcaxyz", "trk_dcaxyz;#it{DCA}_{xyz} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); - registry.add("h_trk_sigmadcaxy", "trk_sigmadcaxy;#it{#sigma}_{#it{DCA}_{xy}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); - registry.add("h_trk_sigmadcaxyz", "trk_sigmadcaxyz;#it{#sigma}_{#it{DCA}_{xyz}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); + registry.add("h_trk_dcaxy", "trk_dcaxy;#it{DCA}_{xy} (cm);Entries", {HistType::kTH1F, {{200, -0.1, 0.1}}}); + registry.add("h_trk_dcaxyz", "trk_dcaxyz;#it{DCA}_{xyz} (cm);Entries", {HistType::kTH1F, {{200, -0.1, 0.1}}}); + registry.add("h_trk_sigmadcaxy", "trk_sigmadcaxy;#it{#sigma}_{#it{DCA}_{xy}} (cm);Entries", {HistType::kTH1F, {{200, 0., 0.1}}}); + registry.add("h_trk_sigmadcaxyz", "trk_sigmadcaxyz;#it{#sigma}_{#it{DCA}_{xyz}} (cm);Entries", {HistType::kTH1F, {{200, 0., 0.1}}}); registry.add("h_trk_itsncls", "trk_itsncls;ITS NCls;Entries", {HistType::kTH1F, {{10, 0., 10.}}}); registry.add("h_trk_tpcncls", "trk_tpcncls;TPC NCls (Found);Entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_trk_tpcncrs", "trk_tpcncrs;TPC NCrossedRows;Entries", {HistType::kTH1F, {{200, 0., 200.}}}); - registry.add("h_trk_itschi2ncl", "trk_itschi2ncl;ITS #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 20.}}}); - registry.add("h_trk_tpcchi2ncl", "trk_tpcchi2ncl;TPC #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("h_jtrack_counter", "jtrack counter", {HistType::kTH1F, {{1, 0., 1.}}}); - registry.add("h2_trk_jtrackpt_vs_origtrackpt", "JTracks::pt vs Tracks::pt", {HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}}); + registry.add("h_trk_itschi2ncl", "trk_itschi2ncl;ITS #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{200, 0., 20.}}}); + registry.add("h_trk_tpcchi2ncl", "trk_tpcchi2ncl;TPC #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{200, 0., 10.}}}); + registry.add("h2_trk_jtrackpt_vs_origtrackpt", "JTracks::pt vs Tracks::pt", {HistType::kTH2F, {{200, 0., 100.}, {200, 0., 100.}}}); registry.add("h_trk_vtx_index", "trk_vtx_index;Vertex index;Entries", {HistType::kTH1F, {{20, 0., 20.}}}); registry.add("h_trk_origin", "trk_origin;Track origin;Entries", {HistType::kTH1F, {{5, 0., 5.}}}); auto h_trk_origin = registry.get(HIST("h_trk_origin")); @@ -735,6 +734,10 @@ struct BJetTreeCreator { } } + if ((jetFlavor != JetTaggingSpecies::charm && jetFlavor != JetTaggingSpecies::beauty) && (static_cast(std::rand()) / RAND_MAX < getReductionFactor(analysisJet.pt()))) { + continue; + } + float eventWeight = analysisJet.eventWeight(); //+ From 8c224880609fb8c04e92683fe9f4a2e5257fc0cc Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Thu, 5 Dec 2024 17:26:16 +0100 Subject: [PATCH 57/91] [PWGDQ] Adding protections to the prefiltering task; fix problem with exclusive MCSignals (#8831) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Core/MCSignal.cxx | 10 ++-- PWGDQ/Core/MCSignal.h | 19 ++++--- PWGDQ/Core/MCSignalLibrary.cxx | 8 +-- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 75 ++++++++++++++++---------- PWGDQ/Tasks/tableReader_withAssoc.cxx | 75 ++++++++++++++++---------- 5 files changed, 119 insertions(+), 68 deletions(-) diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index c35e0548e98..bf08b1fab4e 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -27,7 +27,8 @@ MCSignal::MCSignal() : TNamed("", ""), fExcludeCommonAncestor(false), fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), - fDecayChannelIsNotExclusive(false) + fDecayChannelIsNotExclusive(false), + fNAncestorDirectProngs(0) { } @@ -39,7 +40,8 @@ MCSignal::MCSignal(int nProngs, const char* name /*= ""*/, const char* title /*= fExcludeCommonAncestor(false), fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), - fDecayChannelIsNotExclusive(false) + fDecayChannelIsNotExclusive(false), + fNAncestorDirectProngs(0) { fProngs.reserve(nProngs); } @@ -52,7 +54,8 @@ MCSignal::MCSignal(const char* name, const char* title, std::vector pro fExcludeCommonAncestor(excludeCommonAncestor), fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), - fDecayChannelIsNotExclusive(false) + fDecayChannelIsNotExclusive(false), + fNAncestorDirectProngs(0) { } @@ -82,6 +85,7 @@ void MCSignal::PrintConfig() cout << "Exclude common ancestor combinations: " << fExcludeCommonAncestor << endl; cout << "Decay channel is exclusive: " << fDecayChannelIsExclusive << endl; cout << "Decay channel is not exclusive: " << fDecayChannelIsNotExclusive << endl; + cout << "Decay channel direct prongs for the common ancestor: " << fNAncestorDirectProngs << endl; cout << "Printing " << fNProngs << "/" << fProngs.size() << " prongs:" << endl; int i = 0; for (auto& pr : fProngs) { diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index d91e8f7424d..0e979aae8b2 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -73,13 +73,15 @@ class MCSignal : public TNamed void SetProngs(std::vector prongs, std::vector commonAncestors); void AddProng(MCProng prong, int8_t commonAncestor = -1); - void SetDecayChannelIsExclusive(bool option = true) + void SetDecayChannelIsExclusive(int nProngs, bool option = true) { fDecayChannelIsExclusive = option; + fNAncestorDirectProngs = nProngs; } - void SetDecayChannelIsNotExclusive(bool option = true) + void SetDecayChannelIsNotExclusive(int nProngs, bool option = true) { fDecayChannelIsNotExclusive = option; + fNAncestorDirectProngs = nProngs; } int GetNProngs() const @@ -98,6 +100,10 @@ class MCSignal : public TNamed { return fDecayChannelIsNotExclusive; } + int GetNAncestorDirectProngs() const + { + return fNAncestorDirectProngs; + } template bool CheckSignal(bool checkSources, const T&... args) @@ -117,8 +123,9 @@ class MCSignal : public TNamed unsigned int fNProngs; // number of prongs std::vector fCommonAncestorIdxs; // index of the most recent ancestor, relative to each prong's history bool fExcludeCommonAncestor; // explicitly request that there is no common ancestor - bool fDecayChannelIsExclusive; // if true, then the indicated mother particle has a number of daughters which is equal to the number of prongs defined in this MC signal - bool fDecayChannelIsNotExclusive; // if true, then the indicated mother particle has a number of daughters which is larger than the number of prongs defined in this MC signal + bool fDecayChannelIsExclusive; // if true, then the indicated mother particle has a number of daughters which is equal to the number of direct prongs defined in this MC signal + bool fDecayChannelIsNotExclusive; // if true, then the indicated mother particle has a number of daughters which is larger than the number of direct prongs defined in this MC signal + int fNAncestorDirectProngs; // number of direct prongs belonging to the common ancestor specified by this signal int fTempAncestorLabel; template @@ -162,10 +169,10 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) // If these numbers are equal, it means this decay MCSignal match is exclusive (there are no additional prongs for this mother besides the // prongs defined here). if (currentMCParticle.has_daughters()) { - if (fDecayChannelIsExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 != fNProngs) { + if (fDecayChannelIsExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 != fNAncestorDirectProngs) { return false; } - if (fDecayChannelIsNotExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 == fNProngs) { + if (fDecayChannelIsNotExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 == fNAncestorDirectProngs) { return false; } } diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 8c1c8af9fde..54cf2cb549a 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -712,14 +712,14 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prong.SetSourceBit(0, MCProng::kPhysicalPrimary); signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level - signal->SetDecayChannelIsExclusive(true); + signal->SetDecayChannelIsExclusive(2, true); return signal; } if (!nameStr.compare("eeFromJpsiNotExclusive")) { MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prong.SetSourceBit(0, MCProng::kPhysicalPrimary); signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level - signal->SetDecayChannelIsNotExclusive(true); + signal->SetDecayChannelIsNotExclusive(2, true); return signal; } if (!nameStr.compare("eePrimaryFromPromptJPsi")) { @@ -1145,7 +1145,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) MCProng pronge(3, {11, 443, 521}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); MCProng prongKaon(2, {321, 521}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); signal = new MCSignal(name, "Kaon and electron pair from B+", {pronge, pronge, prongKaon}, {2, 2, 1}); - signal->SetDecayChannelIsExclusive(true); + signal->SetDecayChannelIsExclusive(2, true); return signal; } @@ -1153,7 +1153,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) MCProng pronge(3, {11, 443, 521}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); MCProng prongKaon(2, {321, 521}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); signal = new MCSignal(name, "Kaon and electron pair from B+", {pronge, pronge, prongKaon}, {2, 2, 1}); - signal->SetDecayChannelIsNotExclusive(true); + signal->SetDecayChannelIsNotExclusive(2, true); return signal; } diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 1f190c9fae4..62dfcd46652 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -919,7 +919,7 @@ struct AnalysisPrefilterSelection { Configurable fConfigPrefilterPairCut{"cfgPrefilterPairCut", "", "Prefilter pair cut"}; Configurable fConfigTrackCuts{"cfgTrackCuts", "", "Track cuts for which to run the prefilter"}; // Track related options - Configurable fPropTrack{"cfgPropTrack", true, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; + Configurable fPropTrack{"cfgPropTrack", false, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; std::map fPrefilterMap; AnalysisCompositeCut* fPairCut; @@ -934,23 +934,39 @@ struct AnalysisPrefilterSelection { return; } + bool runPrefilter = true; // get the list of track cuts to be prefiltered TString trackCutsStr = fConfigTrackCuts.value; TObjArray* objArrayTrackCuts = nullptr; if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); + if (objArrayTrackCuts == nullptr) { + runPrefilter = false; + } + } else { + LOG(warn) << " No track cuts to prefilter! Prefilter will not be run"; + runPrefilter = false; + } + // get the cut to be used as loose selection + TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; + if (prefilterTrackCutStr.IsNull()) { + LOG(warn) << " No prefilter loose selection specified! Prefilter will not be run"; + runPrefilter = false; } - // get the list of cuts that were computed in the barrel track-selection task and create a bit mask - // to mark just the ones we want to apply a prefilter on fPrefilterMask = 0; fPrefilterCutBit = -1; - string trackCuts; - getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); - TString allTrackCutsStr = trackCuts; - TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; - if (!trackCutsStr.IsNull()) { + if (runPrefilter) { + // get the list of cuts that were computed in the barrel track-selection task and create a bit mask + // to mark just the ones we want to apply a prefilter on + string trackCuts; + getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); + TString allTrackCutsStr = trackCuts; + std::unique_ptr objArray(allTrackCutsStr.Tokenize(",")); + if (objArray == nullptr) { + LOG(fatal) << " Not getting any track cuts from the barrel-track-selection "; + } if (objArray->FindObject(prefilterTrackCutStr.Data()) == nullptr) { LOG(fatal) << " Prefilter track cut not among the cuts calculated by the track-selection task! "; } @@ -963,18 +979,15 @@ struct AnalysisPrefilterSelection { fPrefilterCutBit = icut; } } + // setup the prefilter pair cut + fPairCut = new AnalysisCompositeCut(true); + TString pairCutStr = fConfigPrefilterPairCut.value; + if (!pairCutStr.IsNull()) { + fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); + } } - // NOTE: If no prefilter loose cut is specified to be "prefiltered" or no track cuts are asked to be prefiltered, - // then make a warning. In the processing, the produced table will just lead to a neutral behaviour (no prefilter applied) if (fPrefilterMask == static_cast(0) || fPrefilterCutBit < 0) { - LOG(warn) << "No loose cut or track cuts for prefiltering are specified. This task will do nothing."; - } - - // setup the prefilter pair cut - fPairCut = new AnalysisCompositeCut(true); - TString pairCutStr = fConfigPrefilterPairCut.value; - if (!pairCutStr.IsNull()) { - fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); + LOG(warn) << "No specified loose cut or track cuts for prefiltering. This task will do nothing."; } VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill @@ -1039,18 +1052,26 @@ struct AnalysisPrefilterSelection { runPrefilter(event, groupedAssocs, tracks); } } + uint32_t mymap = -1; - for (auto& assoc : assocs) { - auto track = assoc.template reducedtrack_as(); - mymap = -1; - // If cuts were not configured, then produce a map with all 1's - if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { - prefilter(mymap); - } else if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { - // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else - mymap = ~fPrefilterMap[track.globalIndex()]; + // If cuts were not configured, then produce a map with all 1's and publish it for all associations + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + for (int i = 0; i < assocs.size(); ++i) { prefilter(mymap); } + } else { + for (auto& assoc : assocs) { + // TODO: just use the index from the assoc (no need to cast the whole track) + auto track = assoc.template reducedtrack_as(); + mymap = -1; + if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { + // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else + mymap = ~fPrefilterMap[track.globalIndex()]; + prefilter(mymap); + } else { + prefilter(mymap); // track did not pass the prefilter selections, so publish just 1's + } + } } } diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 194dd3b67ef..65c89b78918 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -856,32 +856,47 @@ struct AnalysisPrefilterSelection { uint32_t fPrefilterMask; int fPrefilterCutBit; + Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; + void init(o2::framework::InitContext& context) { if (context.mOptions.get("processDummy")) { return; } + bool runPrefilter = true; // get the list of track cuts to be prefiltered TString trackCutsStr = fConfigTrackCuts.value; TObjArray* objArrayTrackCuts = nullptr; if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); + if (objArrayTrackCuts == nullptr) { + runPrefilter = false; + } + } else { + LOG(warn) << " No track cuts to prefilter! Prefilter will not be run"; + runPrefilter = false; } - if (objArrayTrackCuts->GetEntries() == 0) { - LOG(fatal) << " No track cuts to prefilter!"; + // get the cut to be used as loose selection + TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; + if (prefilterTrackCutStr.IsNull()) { + LOG(warn) << " No prefilter loose selection specified! Prefilter will not be run"; + runPrefilter = false; } - // get the list of cuts that were computed in the barrel track-selection task and create a bit mask - // to mark just the ones we want to apply a prefilter on fPrefilterMask = static_cast(0); fPrefilterCutBit = -1; - string trackCuts; - getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); - TString allTrackCutsStr = trackCuts; - TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; - if (!trackCutsStr.IsNull()) { + if (runPrefilter) { + // get the list of cuts that were computed in the barrel track-selection task and create a bit mask + // to mark just the ones we want to apply a prefilter on + string trackCuts; + getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); + TString allTrackCutsStr = trackCuts; + std::unique_ptr objArray(allTrackCutsStr.Tokenize(",")); + if (objArray == nullptr) { + LOG(fatal) << " Not getting any track cuts from the barrel-track-selection "; + } if (objArray->FindObject(prefilterTrackCutStr.Data()) == nullptr) { LOG(fatal) << " Prefilter track cut not among the cuts calculated by the track-selection task! "; } @@ -894,18 +909,17 @@ struct AnalysisPrefilterSelection { fPrefilterCutBit = icut; } } + // setup the prefilter pair cut + fPairCut = new AnalysisCompositeCut(true); + TString pairCutStr = fConfigPrefilterPairCut.value; + if (!pairCutStr.IsNull()) { + fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); + } } if (fPrefilterMask == static_cast(0) || fPrefilterCutBit < 0) { LOG(warn) << "No specified loose cut or track cuts for prefiltering. This task will do nothing."; } - // setup the prefilter pair cut - fPairCut = new AnalysisCompositeCut(true); - TString pairCutStr = fConfigPrefilterPairCut.value; - if (!pairCutStr.IsNull()) { - fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); - } - VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill VarManager::SetDefaultVarNames(); @@ -955,11 +969,8 @@ struct AnalysisPrefilterSelection { } // end loop over combinations } - Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; - void processBarrelSkimmed(MyEvents const& events, soa::Join const& assocs, MyBarrelTracks const& tracks) { - fPrefilterMap.clear(); for (auto& event : events) { @@ -968,18 +979,26 @@ struct AnalysisPrefilterSelection { runPrefilter(groupedAssocs, tracks); } } + uint32_t mymap = -1; - for (auto& assoc : assocs) { - auto track = assoc.template reducedtrack_as(); - mymap = -1; - // If cuts were not configured, then produce a map with all 1's - if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { - prefilter(mymap); - } else if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { - // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else - mymap = ~fPrefilterMap[track.globalIndex()]; + // If cuts were not configured, then produce a map with all 1's and publish it for all associations + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + for (int i = 0; i < assocs.size(); ++i) { prefilter(mymap); } + } else { + for (auto& assoc : assocs) { + // TODO: just use the index from the assoc (no need to cast the whole track) + auto track = assoc.template reducedtrack_as(); + mymap = -1; + if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { + // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else + mymap = ~fPrefilterMap[track.globalIndex()]; + prefilter(mymap); + } else { + prefilter(mymap); // track did not pass the prefilter selections, so publish just 1's + } + } } } From d76b432e0bd6ab4b87ad984fe81d9dc3695210f0 Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:09:15 +0100 Subject: [PATCH 58/91] [PWGLF] Fixed bug in histos filling in phik0sanalysis.cxx (#8832) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 42 +++++++++++++++------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 6ad2e6a774e..11ef94f75ce 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -684,7 +684,8 @@ struct phik0shortanalysis { } } - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -715,7 +716,8 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -763,7 +765,9 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -835,7 +839,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector vecPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector vecPi; + vecPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; @@ -1001,7 +1007,8 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1037,7 +1044,8 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1109,7 +1117,9 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1219,7 +1229,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1359,7 +1371,8 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1390,7 +1403,8 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1441,7 +1455,9 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1514,7 +1530,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector vecPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector vecPi; + vecPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; From e5db4d43883a2bb82270e74597363a955ddc8960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Eduardo=20Mu=C3=B1oz=20M=C3=A9ndez?= <56033627+jmunozme@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:50:57 -0600 Subject: [PATCH 59/91] [PWGLF] Modification to efficiency fit (#8810) --- PWGMM/UE/Tasks/uecharged.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 18e59f8338d..12148212e49 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -198,7 +198,7 @@ void ueCharged::init(InitContext const&) ConfigurableAxis ptBinning{"ptBinning", {0, 0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 40.0, 50.0}, "pTassoc bin limits"}; AxisSpec ptAxis = {ptBinning, "#it{p}_{T}^{assoc} (GeV/#it{c})"}; - f_Eff.setObject(new TF1("fpara", "(x<0.3)*((0.221456)+x*(3.4271)+x*x*(-6.7668))+(x>=0.3&&x<2.1)*((0.610649)+(0.148627)*x+(-0.0772185)*x*x+(0.0157586)*x*x*x)+(x>=2.1)*(0.726557)", 0., 1e5)); + f_Eff.setObject(new TF1("fpara", "(x<0.3)*((0.283781)+x*(3.0492)+x*x*(-6.17018)) + (x>=0.3&&x<1.8)*((0.597121)+(0.200737)*x+(-0.11255)*x*x+(0.0242807)*x*x*x) + (x>=1.8&&x<14.)*((0.729892)+(0.0018516)*x+(0.000257896)*x*x+(-2.05202e-05)*x*x*x) + (x>=14)*(0.749313)", 0., 1e5)); if (doprocessMC) { ue.add("hPtOut", "pT all rec; pT; Nch", HistType::kTH1D, {ptAxis}); From 10646579146f1bf7423da6d7f5a2c3250e5fec28 Mon Sep 17 00:00:00 2001 From: Rik Spijkers <78484875+rspijkers@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:07:19 +0100 Subject: [PATCH 60/91] [PWGLF] Add rapidity cut and trigger selection to cascade correlations task (#8817) --- PWGLF/Tasks/Strangeness/CMakeLists.txt | 2 +- .../Tasks/Strangeness/cascadecorrelations.cxx | 215 ++++++++++++------ 2 files changed, 145 insertions(+), 72 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/CMakeLists.txt b/PWGLF/Tasks/Strangeness/CMakeLists.txt index 660c7ce8610..bdc6624af49 100644 --- a/PWGLF/Tasks/Strangeness/CMakeLists.txt +++ b/PWGLF/Tasks/Strangeness/CMakeLists.txt @@ -41,7 +41,7 @@ o2physics_add_dpl_workflow(v0postprocessing o2physics_add_dpl_workflow(cascadecorrelations SOURCES cascadecorrelations.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(non-prompt-cascade diff --git a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx index c9ff1f74f88..4c8531213bb 100644 --- a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx +++ b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -35,6 +37,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" #include "CCDB/BasicCCDBManager.h" +#include "EventFiltering/Zorro.h" #include #include @@ -42,7 +45,7 @@ #include #include #include -#include +// #include using namespace o2; using namespace o2::soa; @@ -57,6 +60,8 @@ using FullTracksExtIU = soa::Join; using FullTracksExtIUWithPID = soa::Join; +Zorro zorro; + // Add a column to the cascdataext table: IsSelected. // 0 = not selected, 1 = Xi, 2 = both, 3 = Omega namespace o2::aod @@ -70,16 +75,29 @@ DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //! using CascDataExtSelected = soa::Join; } // namespace o2::aod -struct cascadeSelector { +using MyCollisions = soa::Join; +using MyCollisionsMult = soa::Join; +using MyCascades = soa::Filtered; + +struct CascadeSelector { + Service ccdb; + Produces cascflags; // Configurables + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable useTrigger{"useTrigger", false, "Use trigger selection on skimmed data"}; + Configurable triggerList{"triggerList", "fDoubleXi, fDoubleOmega, fOmegaXi", "List of triggers used to select events"}; + Configurable doTFBorderCut{"doTFBorderCut", true, "Switch to apply TimeframeBorderCut event selection"}; + Configurable doSel8{"doSel8", true, "Switch to apply sel8 event selection"}; + + // Tracklevel Configurable tpcNsigmaBachelor{"tpcNsigmaBachelor", 3, "TPC NSigma bachelor"}; Configurable tpcNsigmaProton{"tpcNsigmaProton", 3, "TPC NSigma proton <- lambda"}; Configurable tpcNsigmaPion{"tpcNsigmaPion", 3, "TPC NSigma pion <- lambda"}; Configurable minTPCCrossedRows{"minTPCCrossedRows", 80, "min N TPC crossed rows"}; // TODO: finetune! 80 > 159/2, so no split tracks? Configurable minITSClusters{"minITSClusters", 4, "minimum number of ITS clusters"}; - // Configurable etaTracks{"etaTracks", 0.8, "min/max of eta for tracks"} + Configurable etaTracks{"etaTracks", 1.0, "min/max of eta for tracks"}; // Selection criteria - compatible with core wagon autodetect - copied from cascadeanalysis.cxx //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* @@ -132,23 +150,50 @@ struct cascadeSelector { {"hITSnClustersPos", "hITSnClustersPos", {HistType::kTH3F, {{8, -0.5, 7.5, "number of ITS clusters"}, invMassAxis, ptAxis}}}, {"hITSnClustersNeg", "hITSnClustersNeg", {HistType::kTH3F, {{8, -0.5, 7.5, "number of ITS clusters"}, invMassAxis, ptAxis}}}, {"hITSnClustersBach", "hITSnClustersBach", {HistType::kTH3F, {{8, -0.5, 7.5, "number of ITS clusters"}, invMassAxis, ptAxis}}}, + + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, }, }; // Keep track of which selections the candidates pass void init(InitContext const&) { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + auto h = registry.add("hSelectionStatus", "hSelectionStatus", HistType::kTH1I, {{10, 0, 10, "status"}}); h->GetXaxis()->SetBinLabel(1, "All"); h->GetXaxis()->SetBinLabel(2, "nTPC OK"); h->GetXaxis()->SetBinLabel(3, "nITS OK"); h->GetXaxis()->SetBinLabel(4, "Topo OK"); - h->GetXaxis()->SetBinLabel(5, "V0 PID OK"); - h->GetXaxis()->SetBinLabel(6, "Bach PID OK"); + h->GetXaxis()->SetBinLabel(5, "Track eta OK"); + h->GetXaxis()->SetBinLabel(6, "V0 PID OK"); + h->GetXaxis()->SetBinLabel(7, "Bach PID OK"); } - void process(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, FullTracksExtIUWithPID const&) + void process(MyCollisions::iterator const& collision, aod::CascDataExt const& Cascades, FullTracksExtIUWithPID const&, aod::BCsWithTimestamps const&) { - for (auto& casc : Cascades) { + bool evSel = true; + if (useTrigger) { + auto bc = collision.bc_as(); + zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), triggerList); + bool eventTrigger = zorro.isSelected(bc.globalBC()); + if (eventTrigger) { + registry.fill(HIST("hTriggerQA"), 1); + } else { + registry.fill(HIST("hTriggerQA"), 0); + evSel = false; + } + } + + if ((doSel8 && !collision.sel8()) || (doTFBorderCut && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) { + evSel = false; // do not skip the collision - this will lead to the cascadeFlag table having less entries than the Cascade table, and therefor not joinable. + } + + for (auto const& casc : Cascades) { + if (!evSel) { + cascflags(0); + continue; + } // these are the tracks: auto bachTrack = casc.bachelor_as(); @@ -178,7 +223,7 @@ struct cascadeSelector { registry.fill(HIST("hSelectionStatus"), 0); // all the cascade before selections registry.fill(HIST("hMassXi0"), casc.mXi(), casc.pt()); - // TPC N crossed rows + // TPC N crossed rows todo: check if minTPCCrossedRows > 50 if (posTrack.tpcNClsCrossedRows() < minTPCCrossedRows || negTrack.tpcNClsCrossedRows() < minTPCCrossedRows || bachTrack.tpcNClsCrossedRows() < minTPCCrossedRows) { cascflags(0); continue; @@ -186,7 +231,7 @@ struct cascadeSelector { registry.fill(HIST("hSelectionStatus"), 1); // passes nTPC crossed rows registry.fill(HIST("hMassXi1"), casc.mXi(), casc.pt()); - // ITS N clusters + // ITS N clusters todo: check if minITSClusters > 0 if (posTrack.itsNCls() < minITSClusters || negTrack.itsNCls() < minITSClusters || bachTrack.itsNCls() < minITSClusters) { cascflags(0); continue; @@ -211,6 +256,12 @@ struct cascadeSelector { registry.fill(HIST("hSelectionStatus"), 3); // passes topo registry.fill(HIST("hMassXi3"), casc.mXi(), casc.pt()); + if (TMath::Abs(posTrack.eta()) > etaTracks || TMath::Abs(negTrack.eta()) > etaTracks || TMath::Abs(bachTrack.eta()) > etaTracks) { + cascflags(0); + continue; + } + registry.fill(HIST("hSelectionStatus"), 4); // passes track eta + // TODO: TOF (for pT > 2 GeV per track?) //// TPC PID //// @@ -238,7 +289,7 @@ struct cascadeSelector { continue; } } - registry.fill(HIST("hSelectionStatus"), 4); // fails at V0 daughters PID + registry.fill(HIST("hSelectionStatus"), 5); // passes V0 daughters PID registry.fill(HIST("hMassXi4"), casc.mXi(), casc.pt()); // Bachelor check @@ -246,42 +297,49 @@ struct cascadeSelector { if (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) { // consistent with both! cascflags(2); - registry.fill(HIST("hSelectionStatus"), 5); // passes bach PID + registry.fill(HIST("hSelectionStatus"), 6); // passes bach PID registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt()); continue; } cascflags(1); - registry.fill(HIST("hSelectionStatus"), 5); // passes bach PID + registry.fill(HIST("hSelectionStatus"), 6); // passes bach PID registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt()); continue; } else if (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) { cascflags(3); - registry.fill(HIST("hSelectionStatus"), 5); // passes bach PID + registry.fill(HIST("hSelectionStatus"), 6); // passes bach PID continue; } // if we reach here, the bachelor was neither pion nor kaon cascflags(0); } // cascade loop - } // process -}; // struct + } // process +}; // struct -struct cascadeCorrelations { +struct CascadeCorrelations { Service ccdb; + OutputObj zorroSummary{"zorroSummary"}; + // Configurables + Configurable maxRapidity{"maxRapidity", 0.5, "|y| < maxRapidity"}; Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; Configurable nMixedEvents{"nMixedEvents", 10, "Number of events to be mixed"}; Configurable doEfficiencyCorrection{"doEfficiencyCorrection", true, "flag to do efficiency corrections"}; - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable useTrigger{"useTrigger", false, "Use trigger selection on skimmed data"}; + Configurable triggerList{"triggerList", "fDoubleXi, fDoubleOmega, fOmegaXi", "List of triggers used to select events"}; Configurable efficiencyCCDBPath{"efficiencyCCDBPath", "Users/r/rspijker/test/EffTest", "Path of the efficiency corrections"}; + Configurable doTFBorderCut{"doTFBorderCut", true, "Switch to apply TimeframeBorderCut event selection"}; + Configurable doSel8{"doSel8", true, "Switch to apply sel8 event selection"}; - AxisSpec invMassAxis = {2000, 1.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}; - AxisSpec deltaPhiAxis = {100, -PI / 2, 1.5 * PI, "#Delta#varphi"}; - AxisSpec deltaYAxis = {40, -2, 2, "#Delta y"}; // TODO: narrower range? - AxisSpec ptAxis = {200, 0, 15, "#it{p}_{T}"}; + AxisSpec invMassAxis = {1000, 1.0f, 2.0f, "Inv. Mass (GeV/c^{2})"}; + AxisSpec deltaPhiAxis = {180, -PIHalf, 3 * PIHalf, "#Delta#varphi"}; // 180 is divisible by 18 (tpc sectors) and 20 (run 2 binning) + AxisSpec deltaYAxis = {40, -2 * maxRapidity, 2 * maxRapidity, "#Delta y"}; // TODO: narrower range? + AxisSpec ptAxis = {150, 0, 15, "#it{p}_{T}"}; AxisSpec selectionFlagAxis = {4, -0.5f, 3.5f, "Selection flag of casc candidate"}; AxisSpec vertexAxis = {200, -10.0f, 10.0f, "cm"}; AxisSpec multiplicityAxis{100, 0, 100, "Multiplicity (MultFT0M?)"}; - AxisSpec rapidityAxis{100, -2, 2, "y"}; + AxisSpec rapidityAxis{100, -maxRapidity, maxRapidity, "y"}; // initialize efficiency maps TH1D* hEffXiMin; @@ -291,7 +349,7 @@ struct cascadeCorrelations { void init(InitContext const&) { - ccdb->setURL(ccdburl); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); if (doEfficiencyCorrection) { TList* effList = ccdb->getForTimeStamp(efficiencyCCDBPath, 1); @@ -303,6 +361,8 @@ struct cascadeCorrelations { hEffOmegaMin = static_cast(effList->FindObject("hOmegaMinEff")); hEffOmegaPlus = static_cast(effList->FindObject("hOmegaPlusEff")); } + + zorroSummary.setObject(zorro.getZorroSummary()); } double getEfficiency(TH1D* h, double pT) @@ -323,6 +383,9 @@ struct cascadeCorrelations { {"hMassXiEffCorrected", "hMassXiEffCorrected", {HistType::kTHnSparseF, {invMassAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, {"hMassOmegaEffCorrected", "hMassOmegaEffCorrected", {HistType::kTHnSparseF, {invMassAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, + // trigger QA + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, + // basic selection variables {"hV0Radius", "hV0Radius", {HistType::kTH1F, {{1000, 0.0f, 100.0f, "cm"}}}}, {"hCascRadius", "hCascRadius", {HistType::kTH1F, {{1000, 0.0f, 100.0f, "cm"}}}}, @@ -339,7 +402,7 @@ struct cascadeCorrelations { {"hSelectionFlag", "hSelectionFlag", {HistType::kTH1I, {selectionFlagAxis}}}, {"hAutoCorrelation", "hAutoCorrelation", {HistType::kTH1I, {{4, -0.5f, 3.5f, "Types of SS autocorrelation"}}}}, {"hAutoCorrelationOS", "hAutoCorrelationOS", {HistType::kTH1I, {{2, -1.f, 1.f, "Charge of OS autocorrelated track"}}}}, - {"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2 * PI, "#varphi"}}}}, + {"hPhi", "hPhi", {HistType::kTH1F, {{180, 0, TwoPI, "#varphi"}}}}, {"hEta", "hEta", {HistType::kTH1F, {{100, -2, 2, "#eta"}}}}, {"hRapidityXi", "hRapidityXi", {HistType::kTH1F, {rapidityAxis}}}, {"hRapidityOmega", "hRapidityOmega", {HistType::kTH1F, {rapidityAxis}}}, @@ -376,29 +439,33 @@ struct cascadeCorrelations { }; // cascade filter - Filter Selector = aod::cascadeflags::isSelected > 0; - - // Mixed events setup: - using myCascades = soa::Filtered; - using myCollisions = soa::Join; + Filter cascadeSelector = aod::cascadeflags::isSelected > 0; SliceCache cache; ConfigurableAxis axisVtxZ{"axisVtxZ", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100, 1000}, "Mixing bins - multiplicity"}; - using BinningType = ColumnBinningPolicy>; - BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. - // Preslice collisionSliceCascades = aod::CascDataExtSelected::collisionId; - SameKindPair pair{colBinning, nMixedEvents, -1, &cache}; + // ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100, 1000}, "Mixing bins - multiplicity"}; - void processSameEvent(myCollisions::iterator const& collision, myCascades const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&) + void processSameEvent(MyCollisionsMult::iterator const& collision, MyCascades const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&, aod::BCsWithTimestamps const&) { - if (!collision.sel8()) { + if (useTrigger) { + auto bc = collision.bc_as(); + zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), triggerList); + bool eventTrigger = zorro.isSelected(bc.globalBC()); + if (eventTrigger) { + registry.fill(HIST("hTriggerQA"), 1); + } else { + registry.fill(HIST("hTriggerQA"), 0); + return; + } + } + + if ((doSel8 && !collision.sel8()) || (doTFBorderCut && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) { return; } double weight; // Some QA on the cascades - for (auto& casc : Cascades) { + for (auto const& casc : Cascades) { if (casc.isSelected() <= 2) { // not exclusively an Omega --> consistent with Xi or both if (casc.sign() < 0) { registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt()); @@ -407,6 +474,7 @@ struct cascadeCorrelations { registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt()); weight = 1. / getEfficiency(hEffXiPlus, casc.pt()); } + // LOGF(info, "casc pt %f, weight %f", casc.pt(), weight); registry.fill(HIST("hMassXiEffCorrected"), casc.mXi(), casc.pt(), casc.yXi(), collision.posZ(), collision.multFT0M(), weight); registry.fill(HIST("hRapidityXi"), casc.yXi()); } @@ -456,7 +524,7 @@ struct cascadeCorrelations { int negIdAssoc = assoc.negTrackId(); // calculate angular correlations - double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -0.5 * PI); + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); double invMassXiTrigg = trigger.mXi(); double invMassOmTrigg = trigger.mOmega(); @@ -495,29 +563,29 @@ struct cascadeCorrelations { } registry.fill(HIST("hDeltaPhiOS"), dphi); // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information) - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hXiXiOS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hXiOmOS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hOmXiOS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hOmOmOS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); @@ -559,29 +627,29 @@ struct cascadeCorrelations { } registry.fill(HIST("hDeltaPhiSS"), dphi); // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information) - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hXiXiSS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hXiOmSS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hOmXiSS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hOmOmSS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); @@ -591,12 +659,17 @@ struct cascadeCorrelations { } // correlations } // process same event - void processMixedEvent(myCollisions const& /*collisions*/, myCascades const& /*Cascades*/, + void processMixedEvent(MyCollisionsMult const& /*collisions*/, MyCascades const& /*Cascades*/, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&) { // mixed events + // using BinningType = ColumnBinningPolicy>; + // BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + using BinningType = ColumnBinningPolicy; + BinningType colBinning{{axisVtxZ}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + SameKindPair pair{colBinning, nMixedEvents, -1, &cache}; - for (auto& [col1, cascades1, col2, cascades2] : pair) { + for (auto const& [col1, cascades1, col2, cascades2] : pair) { if (!col1.sel8() || !col2.sel8()) continue; if (TMath::Abs(col1.posZ()) > zVertexCut || TMath::Abs(col2.posZ()) > zVertexCut) @@ -624,7 +697,7 @@ struct cascadeCorrelations { continue; } - double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -0.5 * PI); + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); double invMassXiTrigg = trigger.mXi(); double invMassOmTrigg = trigger.mOmega(); @@ -671,29 +744,29 @@ struct cascadeCorrelations { registry.fill(HIST("MixedEvents/hMEDeltaPhiOS"), dphi); // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information) - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiXiOS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiOmOS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmXiOS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmOmOS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); @@ -736,29 +809,29 @@ struct cascadeCorrelations { registry.fill(HIST("MixedEvents/hMEDeltaPhiSS"), dphi); - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiXiSS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiOmSS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmXiSS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmOmSS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); @@ -766,17 +839,17 @@ struct cascadeCorrelations { } } // same sign } // correlations - } // collisions + } // collisions } // process mixed events - PROCESS_SWITCH(cascadeCorrelations, processSameEvent, "Process same events", true); - PROCESS_SWITCH(cascadeCorrelations, processMixedEvent, "Process mixed events", true); + PROCESS_SWITCH(CascadeCorrelations, processSameEvent, "Process same events", true); + PROCESS_SWITCH(CascadeCorrelations, processMixedEvent, "Process mixed events", true); -}; // struct +}; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } From 276f9278a12556271b2fc8ac1015c0c910b84271 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:16:09 +0100 Subject: [PATCH 61/91] [PWGDQ] Fix vector type (#8825) --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 5aae38f65df..7d14f564809 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -542,7 +542,7 @@ struct TableMaker { fOccup.oContribShortC.clear(); std::map oBC; // key: collision index; value: global BC - std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC + std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC std::map oVtxZ; // key: collision index; value: vtx-z position std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side @@ -564,7 +564,7 @@ struct TableMaker { // if more than one collision per bunch, add that collision to the list for that bunch if (oBCreversed.find(bc) == oBCreversed.end()) { - std::vector evs = {collision.globalIndex()}; + std::vector evs = {collision.globalIndex()}; oBCreversed[bc] = evs; } else { auto& evs = oBCreversed[bc]; From bfae9e310310d1dbf2f7307b8b5dad71baca2197 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:30:37 +0100 Subject: [PATCH 62/91] [PWGDQ] Adding TProfile with cumulants weights + PI constants correctly (#8828) --- PWGDQ/Core/HistogramsLibrary.cxx | 48 +++++++++++++++++--------------- PWGDQ/Core/HistogramsLibrary.h | 1 + 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 4bc43fe386e..8c5723839cc 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,6 +13,7 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" #include "VarManager.h" +#include "CommonConstants/MathConstants.h" void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) { @@ -275,6 +276,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); @@ -380,8 +384,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (!groupStr.CompareTo("track")) { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("ambiguity") && !subGroupStr.Contains("muon")) { @@ -393,10 +397,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("cent")) { hm->AddHistogram(histClass, "Pt_CentFT0C", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt, 20, 0.0, 100.0, VarManager::kCentFT0C); hm->AddHistogram(histClass, "Eta_CentFT0C", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C); - hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); + hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); } if (subGroupStr.Contains("kine")) { - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "Eta_Pt", "", false, 20, -1.0, 1.0, VarManager::kEta, 100, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta_VtxZ", "", false, 100, -1.0, 1.0, VarManager::kEta, 300, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "Px", "p_{x} distribution", false, 200, 0.0, 20.0, VarManager::kPx); @@ -455,8 +459,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_vsTimeFromSOR", "Number of cluster in TPC vs time from SOR", true, 10000, 0.0, 1000., VarManager::kTimeFromSOR, 160, -0.5, 159.5, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "TPCncls_TPCnclsCR", "Number of TPC cluster vs Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "IsTPCrefit", "", false, 2, -0.5, 1.5, VarManager::kIsTPCrefit); @@ -769,14 +773,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCHBitMap_vs_pt", "MCH vs pt", false, 1025, 0.0, 1025.0, VarManager::kMCHBitMap, 400, 0, 100, VarManager::kPt); hm->AddHistogram(histClass, "MuonTime", "", false, 100, -1.0, 1.0, VarManager::kMuonTime); hm->AddHistogram(histClass, "MuonTimeRes", "", false, 100, -1.0, 1.0, VarManager::kMuonTimeRes); - hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); @@ -799,7 +803,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta); - hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kPhi, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); + hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * o2::constants::math::PI, VarManager::kPhi, 50, 0.0, 2. * o2::constants::math::PI, VarManager::kMCPhi); hm->AddHistogram(histClass, "TrackPDGcode", "PDG code of track", false, 10001, -5000, 5000, VarManager::kMCPdgCode); } if (subGroupStr.Contains("mcmother")) { @@ -820,7 +824,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1); hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Eta_Pt_Photon", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPairPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPairPhi); hm->AddHistogram(histClass, "Mass_Dilepton", "", false, 4500, 0.0, 4.5, VarManager::kPairMassDau); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Photon", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); @@ -842,7 +846,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 5.0, VarManager::kMass); hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); @@ -887,12 +891,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("polarization")) { hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "PhiHE", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "PhiCS", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "PhiHE", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "PhiCS", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); @@ -1248,19 +1252,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "DeltaPhiPair", "", false, 130, -6.5, 6.5, VarManager::kDeltaPhiPair); } if (subGroupStr.Contains("correlation-emu")) { - hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2); hm->AddHistogram(histClass, "DeltaEtaPair2", "", false, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); - hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); } if (subGroupStr.Contains("dielectrons")) { if (subGroupStr.Contains("prefilter")) { hm->AddHistogram(histClass, "MassLow_OpeningAngle", "", false, 150, 0., 0.15, VarManager::kMass, 80, 0., 0.8, VarManager::kOpeningAngle); } if (subGroupStr.Contains("phiv")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv); } if (subGroupStr.Contains("double-phi-v")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv, "", "", "", -1, -1, true); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv, "", "", "", -1, -1, true); } if (subGroupStr.Contains("largemass-phi-v")) { // binning for mee at large scales: @@ -1287,7 +1291,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h // steps of size pi/100 double phiv_bins[101]; for (int i = 0; i <= 100; i++) - phiv_bins[i] = TMath::Pi() / 100. * i; + phiv_bins[i] = o2::constants::math::PI / 100. * i; int nbins_phiv = sizeof(phiv_bins) / sizeof(*phiv_bins) - 1; // 3D histo @@ -1560,7 +1564,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt_Photon", "p_{T} distribution", false, 4500, 0.0, 4.5, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Eta_Pt", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 60fe4cc8714..aa53a2674cc 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -18,6 +18,7 @@ #include #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" +#include "CommonConstants/MathConstants.h" namespace o2::aod { From 03c8eb28901e5432a1cb2cb59304835fd359846c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 5 Dec 2024 21:04:11 +0100 Subject: [PATCH 63/91] [PWGHF] Remove unnecessary subscriptions from B+ derived data creator (#8829) --- PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 3ee02a28bb8..c2e424c460c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -91,7 +91,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; - using TracksWPid = soa::Join; + using TracksWPid = soa::Join; using SelectedCandidates = soa::Filtered>; using SelectedCandidatesMc = soa::Filtered>; using SelectedCandidatesMl = soa::Filtered>; From ac76a276dade944e26d9a72bc51c032c72626cc4 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Fri, 6 Dec 2024 08:00:49 +0100 Subject: [PATCH 64/91] [PWGDQ] Small fixes for data type of collision indices (#8837) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 7d14f564809..e87c49de296 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -541,11 +541,11 @@ struct TableMaker { fOccup.oContribShortA.clear(); fOccup.oContribShortC.clear(); - std::map oBC; // key: collision index; value: global BC + std::map oBC; // key: collision index; value: global BC std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC - std::map oVtxZ; // key: collision index; value: vtx-z position - std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side - std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side + std::map oVtxZ; // key: collision index; value: vtx-z position + std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side + std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side const double bcUS = o2::constants::lhc::LHCBunchSpacingNS / 1000.0; // BC spacing in micro-seconds const double vdrift = 2.5; // cm / mus From 01ac4ff057ee32e9bbfc96aaf93122f2afbab203 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Fri, 6 Dec 2024 09:12:19 +0100 Subject: [PATCH 65/91] [PWGLF] fix trigger efficiency (#8839) --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 42a316319de..441a42f841a 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -495,7 +495,8 @@ struct EbyeMult { int partType = getPartType(particle.pdgCode()); if (partType < PartTypes::kOther) { - ++nParticles; + if (std::abs(particle.eta()) < etaMax) + ++nParticles; if (std::abs(particle.eta()) < 1.f) { ++partInAcc; } @@ -567,7 +568,7 @@ struct EbyeMult { // search generated INEL > 0 (one charged particle in |eta| < 1) for (const auto& mcCollision : mcCollisions) { - int mult = genMultINELgtZERO(mcCollision, mcParticles) > 0; + int mult = genMultINELgtZERO(mcCollision, mcParticles); if (mult > 0) { histos.fill(HIST("GenINELgtZERO"), mult); } From dfeace611e3bcd53d43098a98bdbb2f5a5620028 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:05:47 +0100 Subject: [PATCH 66/91] [PWGLF] Update PWGLF/Tasks/Nuspex/spectraTOF.cxx (#8826) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 40 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index ce950f9c0b9..dd7d43705f6 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -735,7 +735,6 @@ struct tofSpectra { const auto& nsigmaTPC = o2::aod::pidutils::tpcNSigma(track); // const auto id = track.sign() > 0 ? id : id + Np; const float multiplicity = getMultiplicity(collision); - if (multiplicityEstimator == MultCodes::kNoMultiplicity) { if (track.sign() > 0) { histos.fill(HIST(hnsigmatpc[id]), track.pt(), nsigmaTPC); @@ -1345,6 +1344,15 @@ struct tofSpectra { 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) { if (track.sign() > 0) { @@ -1369,32 +1377,26 @@ struct tofSpectra { } } } - 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); - 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); if (track.sign() > 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + 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(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + 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(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + 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(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + 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 From b0236c3a530ae3d20731d37a7077d04e7a23f370 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:20:04 +0100 Subject: [PATCH 67/91] [PWGEM/PhotonMeson,PWGJE] Add clusterizer selection to EM tasks (#8820) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx | 12 +++++++++++- PWGEM/PhotonMeson/Core/EMCPhotonCut.h | 11 ++++++++++- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 2 ++ PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 2 ++ PWGEM/PhotonMeson/DataModel/gammaTables.h | 2 +- .../TableProducer/skimmerGammaCalo.cxx | 3 ++- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 17 ++++++++++++----- PWGJE/TableProducer/emcalCorrectionTask.cxx | 2 +- 8 files changed, 41 insertions(+), 10 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx index 4fea46fe3cd..582b9754057 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx @@ -13,13 +13,20 @@ // Class for EMCal cluster selection // +#include #include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "PWGJE/DataModel/EMCALClusters.h" ClassImp(EMCPhotonCut); -const char* EMCPhotonCut::mCutNames[static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"}; +const char* EMCPhotonCut::mCutNames[static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"}; +void EMCPhotonCut::SetClusterizer(std::string clusterDefinitionString) +{ + mDefinition = static_cast(o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionString)); + LOG(info) << "EMCal Photon Cut, set cluster definition to: " << mDefinition << " (" << clusterDefinitionString << ")"; +} void EMCPhotonCut::SetMinE(float min) { mMinE = min; @@ -72,6 +79,9 @@ void EMCPhotonCut::print() const LOG(info) << "EMCal Photon Cut:"; for (int i = 0; i < static_cast(EMCPhotonCuts::kNCuts); i++) { switch (static_cast(i)) { + case EMCPhotonCuts::kDefinition: + LOG(info) << mCutNames[i] << " > " << mDefinition; + break; case EMCPhotonCuts::kEnergy: LOG(info) << mCutNames[i] << " > " << mMinE; break; diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h index 2ce3d91173c..8bfd8ca630f 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -34,7 +34,8 @@ class EMCPhotonCut : public TNamed enum class EMCPhotonCuts : int { // cluster cut - kEnergy = 0, + kDefinition = 0, + kEnergy, kNCell, kM02, kTiming, @@ -49,6 +50,9 @@ class EMCPhotonCut : public TNamed template bool IsSelected(Cluster const& cluster) const { + if (!IsSelectedEMCal(EMCPhotonCuts::kDefinition, cluster)) { + return false; + } if (!IsSelectedEMCal(EMCPhotonCuts::kEnergy, cluster)) { return false; } @@ -75,6 +79,9 @@ class EMCPhotonCut : public TNamed bool IsSelectedEMCal(const EMCPhotonCuts& cut, Cluster const& cluster) const { switch (cut) { + case EMCPhotonCuts::kDefinition: + return cluster.definition() == mDefinition; + case EMCPhotonCuts::kEnergy: return cluster.e() > mMinE; @@ -113,6 +120,7 @@ class EMCPhotonCut : public TNamed } // Setters + void SetClusterizer(std::string clusterDefinitionString = "kV3Default"); void SetMinE(float min = 0.7f); void SetMinNCell(int min = 1); void SetM02Range(float min = 0.1f, float max = 0.7f); @@ -128,6 +136,7 @@ class EMCPhotonCut : public TNamed private: // EMCal cluster cuts + int mDefinition{10}; ///< clusterizer definition float mMinE{0.7f}; ///< minimum energy int mMinNCell{1}; ///< minimum number of cells per cluster float mMinM02{0.1f}; ///< minimum M02 for a cluster diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 8856fdaf6dd..b452030bc24 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -180,6 +180,7 @@ struct Pi0EtaToGammaGamma { EMCPhotonCut fEMCCut; struct : ConfigurableGroup { std::string prefix = "emccut_group"; + Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; @@ -422,6 +423,7 @@ struct Pi0EtaToGammaGamma { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); + fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.EMC_minE); fEMCCut.SetMinNCell(emccuts.EMC_minNCell); fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index c342423eff9..4ce009632dc 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -168,6 +168,7 @@ struct Pi0EtaToGammaGammaMC { EMCPhotonCut fEMCCut; struct : ConfigurableGroup { std::string prefix = "emccut_group"; + Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; @@ -385,6 +386,7 @@ struct Pi0EtaToGammaGammaMC { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); + fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.EMC_minE); fEMCCut.SetMinNCell(emccuts.EMC_minNCell); fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 9b91eb0864f..5c366715b44 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -459,7 +459,7 @@ DECLARE_SOA_COLUMN(TrackPt, trackpt, std::vector); DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float e, float eta, float m = 0) -> float { return sqrt(e * e - m * m) / cosh(eta); }); //! cluster pt, mass to be given as argument when getter is called! } // namespace emccluster DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTERS", //! table of skimmed EMCal clusters - o2::soa::Index<>, skimmedcluster::CollisionId, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, + o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::TrackEta, emccluster::TrackPhi, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt); using SkimEMCCluster = SkimEMCClusters::iterator; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx index aff407a83f3..c7da3fa270f 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx @@ -14,6 +14,7 @@ /// \author marvin.hemmer@cern.ch #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -137,7 +138,7 @@ struct skimmerGammaCalo { historeg.fill(HIST("hCaloClusterEOut"), emccluster.energy()); historeg.fill(HIST("hCaloClusterFilter"), 4); - tableGammaEMCReco(emccluster.collisionId(), emccluster.energy(), emccluster.eta(), emccluster.phi(), emccluster.m02(), + tableGammaEMCReco(emccluster.collisionId(), emccluster.definition(), emccluster.energy(), emccluster.eta(), emccluster.phi(), emccluster.m02(), emccluster.nCells(), emccluster.time(), emccluster.isExotic(), vEta, vPhi, vP, vPt); } } diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index dc5590fd795..fe81608516c 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -76,6 +76,7 @@ struct emcalQC { EMCPhotonCut fEMCCut; struct : ConfigurableGroup { std::string prefix = "emccut_group"; + Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; @@ -115,6 +116,7 @@ struct emcalQC { const float f = emccuts.EMC_TM_Phi->at(2); LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); + fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.EMC_minE); fEMCCut.SetMinNCell(emccuts.EMC_minNCell); fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); @@ -193,9 +195,13 @@ struct emcalQC { auto clusters_per_coll = clusters.sliceBy(perCollision, collision.collisionId()); fRegistry.fill(HIST("Cluster/before/hNgamma"), clusters_per_coll.size(), collision.weight()); - int ng = 0; + int ngBefore = 0; + int ngAfter = 0; for (auto& cluster : clusters_per_coll) { // Fill the cluster properties before applying any cuts + if (!fEMCCut.IsSelectedEMCal(EMCPhotonCut::EMCPhotonCuts::kDefinition, cluster)) + continue; + ngBefore++; o2::aod::pwgem::photonmeson::utils::clusterhistogram::fillClusterHistograms<0>(&fRegistry, cluster, cfgDo2DQA, collision.weight()); // Apply cuts one by one and fill in hClusterQualityCuts histogram @@ -205,10 +211,10 @@ struct emcalQC { bool survivesIsSelectedEMCalCuts = true; // Survives "manual" cuts listed in this task bool survivesIsSelectedCuts = fEMCCut.IsSelected(cluster); // Survives the cutlist defines in EMCPhotonCut.h, which is also used in the Pi0Eta task - for (int icut = 0; icut < static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts); icut++) { // Loop through different cut observables + for (int icut = 1; icut < static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts); icut++) { // Loop through different cut observables, start at 1 to ignore ClusterDefinition EMCPhotonCut::EMCPhotonCuts specificcut = static_cast(icut); if (!fEMCCut.IsSelectedEMCal(specificcut, cluster)) { // Check whether cluster passes this cluster requirement, if not, fill why in the next row - fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), icut + 1, cluster.e(), collision.weight()); + fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), icut, cluster.e(), collision.weight()); survivesIsSelectedEMCalCuts = false; } } @@ -220,10 +226,11 @@ struct emcalQC { if (survivesIsSelectedCuts) { o2::aod::pwgem::photonmeson::utils::clusterhistogram::fillClusterHistograms<1>(&fRegistry, cluster, cfgDo2DQA, collision.weight()); fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), 7., cluster.e(), collision.weight()); - ng++; + ngAfter++; } } - fRegistry.fill(HIST("Cluster/after/hNgamma"), ng, collision.weight()); + fRegistry.fill(HIST("Cluster/before/hNgamma"), ngBefore, collision.weight()); + fRegistry.fill(HIST("Cluster/after/hNgamma"), ngAfter, collision.weight()); } // end of collision loop } // end of process diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index e2a0b1a3a9d..576df1a585a 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -861,8 +861,8 @@ struct EmcalCorrectionTask { timeshift = 1.9; // Parameters extracted from LHC24aj (pp), but also usable for other periods } LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; - return timeshift + timesmear; } + return timeshift + timesmear; }; }; From 80895680fcd99e15aca9b10c9bcfc2c1d8ecab3f Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Fri, 6 Dec 2024 13:23:58 +0100 Subject: [PATCH 68/91] [PWGLF] revert flag checks (#8842) --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 441a42f841a..7763d1d3e3b 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -373,8 +373,8 @@ struct EbyeMult { } } - histos.fill(HIST("QA/nTrklCorrelation"), nTracklets[0], nTracklets[1]); - histos.fill(HIST("QA/nV0MCorrelation"), nTracklets[0], centrality); + histos.fill(HIST("QA/nTrklCorrelation"), nTracklets[1], nTracklets[0]); + histos.fill(HIST("QA/nV0MCorrelation"), centrality, nTracklets[0]); nTrackletsColl = nTracklets[1]; candidateEvent.nTklRec = nTracklets[0]; @@ -396,7 +396,7 @@ struct EbyeMult { auto mcLab = mcLabels.rawIteratorAt(candidateTracks[iT].globalIndex); if (mcLab.has_mcParticle()) { auto mcTrack = mcLab.template mcParticle_as(); - if (((mcTrack.flags() & 0x8) && (doprocessMcRun2)) || (mcTrack.flags() & 0x2)) + if (((mcTrack.flags() & 0x8) && (doprocessMcRun2)) || (mcTrack.flags() & 0x2) || (mcTrack.flags() & 0x1)) continue; if (!mcTrack.isPhysicalPrimary()) { if (mcTrack.has_mothers()) { // sec WD @@ -442,7 +442,7 @@ struct EbyeMult { if (std::abs(genEta) > etaMax) { continue; } - if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2)) + if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2) || (mcPart.flags() & 0x1)) continue; if (!mcPart.isPhysicalPrimary() /* && !mcPart.has_mothers() */) continue; @@ -485,7 +485,7 @@ struct EbyeMult { int partInAcc = 0; auto particlesThisCollision = particles.sliceBy(perCollisionMcParts, collision.globalIndex()); for (auto const& particle : particlesThisCollision) { - if (((particle.flags() & 0x8) && (doprocessMcRun2)) || (particle.flags() & 0x2)) + if (((particle.flags() & 0x8) && (doprocessMcRun2)) || (particle.flags() & 0x2) || (particle.flags() & 0x1)) continue; if (!particle.isPhysicalPrimary() /* && !particle.has_mothers() */) continue; From 3c36a4df2b5b1b0c387e3d8b576bd30e1197f39a Mon Sep 17 00:00:00 2001 From: nzardosh Date: Fri, 6 Dec 2024 14:05:57 +0100 Subject: [PATCH 69/91] [PWGJE] fixing default process functions (#8846) --- PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx | 2 +- PWGJE/TableProducer/rhoEstimator.cxx | 2 +- PWGJE/Tasks/jetSubstructureHF.cxx | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index f1dae6bb061..c1c1dc19b54 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -138,7 +138,7 @@ struct eventWiseConstituentSubtractorTask { particleSubtractedTable(mcCollision.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.rap(), trackSubtracted.e(), 211, 1, 1, 1); // everything after phi is artificial and should not be used for analyses } } - PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processMcCollisions, "Fill table of subtracted tracks for Mc collisions", true); + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processMcCollisions, "Fill table of subtracted tracks for Mc collisions", false); void processD0Collisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index ff0072f7052..b8a74936bfd 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -99,7 +99,7 @@ struct RhoEstimatorTask { auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); rhoChargedMcTable(rho, rhoM); } - PROCESS_SWITCH(RhoEstimatorTask, processChargedMcCollisions, "Fill rho tables for MC collisions using charged tracks", true); + PROCESS_SWITCH(RhoEstimatorTask, processChargedMcCollisions, "Fill rho tables for MC collisions using charged tracks", false); void processD0Collisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesD0Data const& candidates) { diff --git a/PWGJE/Tasks/jetSubstructureHF.cxx b/PWGJE/Tasks/jetSubstructureHF.cxx index 2ad5ddb4bac..46572c17f07 100644 --- a/PWGJE/Tasks/jetSubstructureHF.cxx +++ b/PWGJE/Tasks/jetSubstructureHF.cxx @@ -243,11 +243,6 @@ struct JetSubstructureHFTask { outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec, angularity); } - void processDummy(aod::JetTracks const&) - { - } - PROCESS_SWITCH(JetSubstructureHFTask, processDummy, "Dummy process function turned on by default", true); - void processChargedJetsData(typename JetTableData::iterator const& jet, CandidateTable const& candidates, aod::JetTracks const& tracks) From 52ec9a6020a898d2b46c6d4dec27f406a51786e9 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:36:40 +0100 Subject: [PATCH 70/91] [PWGLF] added checks for misidentification of particle with antiparticle and comparison with other particles (#8830) Co-authored-by: Prottay Das --- PWGLF/Tasks/Resonances/lambdav2.cxx | 700 +++++++++++------------- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 53 +- 2 files changed, 346 insertions(+), 407 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambdav2.cxx b/PWGLF/Tasks/Resonances/lambdav2.cxx index 4fbb16beddc..4a43c5d2d4b 100644 --- a/PWGLF/Tasks/Resonances/lambdav2.cxx +++ b/PWGLF/Tasks/Resonances/lambdav2.cxx @@ -8,47 +8,53 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief this is a code for flow of lambda baryons for exotic pheno -/// \author prottay das -/// \since 25/04/2024 +// Particle flow task +// prottay.das@cern.ch -#include -#include -#include #include -#include +#include #include #include #include #include +#include +#include +#include #include -#include "TF1.h" - -#include +#include #include +#include #include -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" +#include "TRandom3.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include "TF1.h" + +// #include "Common/DataModel/Qvectors.h" +#include "PWGLF/DataModel/SPCalibrationTables.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/Core/trackUtilities.h" #include "CommonConstants/PhysicsConstants.h" +#include "Common/Core/TrackSelection.h" #include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "ReconstructionDataFormats/Track.h" - -#include "PWGLF/DataModel/EPCalibrationTables.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "CCDB/BasicCCDBManager.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/DataModel/FT0Corrected.h" using namespace o2; using namespace o2::framework; @@ -57,302 +63,148 @@ using std::array; struct lambdav2 { - // Connect to ccdb - Service ccdb; - Configurable nolaterthan{ - "ccdb-no-later-than", - std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()) - .count(), - "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", - "url of the ccdb repository"}; - - SliceCache cache; - - // Histograms are defined with HistogramRegistry - HistogramRegistry rEventSelection{"eventSelection", - {}, - OutputObjHandlingPolicy::AnalysisObject, - true, - true}; - HistogramRegistry histos{ - "histos", - {}, - OutputObjHandlingPolicy::AnalysisObject, - true, - true}; - - // Configurable for histograms - Configurable nBins{"nBins", 100, "N bins in all histos"}; - // Confugrable for QA histograms - Configurable QA{"QA", true, "QA"}; - Configurable QAv0{"QAv0", false, "QAv0"}; - // Configurable for event selection - Configurable cutzvertex{"cutzvertex", 10.0f, - "Accepted z-vertex range (cm)"}; - // Configurable parameters for V0 selection - Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, - "Minimum transverse momentum of V0"}; - Configurable ConfV0DCADaughMax{"ConfV0DCADaughMax", 1.0f, - "Maximum DCA between the V0 daughters"}; - Configurable ConfV0CPAMin{"ConfV0CPAMin", 0.985f, "Minimum CPA of V0"}; - Configurable ConfV0TranRadV0Min{"ConfV0TranRadV0Min", 0.5f, - "Minimum transverse radius"}; - Configurable ConfV0TranRadV0Max{"ConfV0TranRadV0Max", 200.f, - "Maximum transverse radius"}; - Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 4, - "Maximum V0 life time"}; - Configurable cMaxV0DCA{"cMaxV0DCA", 0.3, "DCA V0 to PV"}; - Configurable cSigmaMassLambda{"cSigmaMassLambda", 4, - "n Sigma cut on Lambda mass"}; - Configurable cWidthLambda{"cWidthLambda", 0.005, "Width of Lambda"}; - Configurable ConfDaughEta{"ConfDaughEta", 0.8f, - "V0 Daugh sel: max eta"}; - Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 70.f, - "V0 Daugh sel: Min. nCls TPC"}; - Configurable ConfDaughDCAMin{ - "ConfDaughDCAMin", 0.06f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; - Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 4, - "PID selections for KS0 daughters"}; - - // Configurables for track selections - Configurable cfgCutPT{"cfgCutPT", 0.2f, "PT cut on daughter track"}; - Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta cut on daughter track"}; - Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, - "DCAxy range for tracks"}; - Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, - "Value of the TPC Nsigma cut"}; - Configurable nsigmaCutTOF{"nsigmacutTOF", 3.0, - "Value of the TOF Nsigma cut"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, - "Value of the Combined Nsigma cut"}; - Configurable iscustomDCAcut{"iscustomDCAcut", false, "iscustomDCAcut"}; - Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; - Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; + int mRunNumber; + int multEstimator; + float d_bz; + Service ccdb; + Service pdg; + + // fill output + Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; + Configurable additionalEvSel2{"additionalEvSel2", false, "additionalEvSel2"}; + Configurable additionalEvSel3{"additionalEvSel3", false, "additionalEvSel3"}; + Configurable correction1{"correction1", false, "fill histograms including corrections 1"}; + Configurable correction2{"correction2", false, "fill histograms including corrections 2"}; + Configurable QA{"QA", false, "flag for QA"}; + Configurable mycut{"mycut", false, "select tracks based on my cuts"}; + Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; + Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; + Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; + Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; + Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; + Configurable hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 1000, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + + // events + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgCutCentralityMax{"cfgCutCentralityMax", 50.0f, "Accepted maximum Centrality"}; + Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 30.0f, "Accepted minimum Centrality"}; + // proton track cut + Configurable confRapidity{"confRapidity", 0.8, "cut on Rapidity"}; + Configurable cfgCutPT{"cfgCutPT", 0.15, "PT cut on daughter track"}; + Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta cut on daughter track"}; + Configurable cfgCutDCAxy{"cfgCutDCAxy", 0.1f, "DCAxy range for tracks"}; + Configurable cfgCutDCAz{"cfgCutDCAz", 0.1f, "DCAz range for tracks"}; + Configurable cfgITScluster{"cfgITScluster", 5, "Number of ITS cluster"}; Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; - Configurable isNoTOF{"isNoTOF", false, "isNoTOF"}; - Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; - Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; - - // Event selection cuts - Alex - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultMultPVCut = nullptr; - - void init(InitContext const&) - { - // Axes - AxisSpec vertexZAxis = {nBins, -10., 10., "vrtx_{Z} [cm]"}; - AxisSpec ptAxis = {200, 0.0f, 20.0f, "#it{p}_{T} (GeV/#it{c})"}; - - // Event selection - rEventSelection.add("hVertexZRec", "hVertexZRec", - {HistType::kTH1F, {vertexZAxis}}); - rEventSelection.add("hmult", "Centrality distribution", kTH1F, - {{100, 0.0f, 100.0f}}); - - // from sourav da - AxisSpec phiAxis = {500, -6.28, 6.28, "phi"}; - AxisSpec resAxis = {400, -2, 2, "Res"}; - AxisSpec centAxis = {100, 0, 100, "V0M (%)"}; - - if (QA) { - histos.add("hFTOCvsTPCNoCut", "Mult correlation FT0C vs. TPC without any cut", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}}); - histos.add("hFTOCvsTPCSelected", "Mult correlation FT0C vs. TPC after selection", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}}); - histos.add("hPsiFT0C", "PsiFT0C", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiFT0A", "PsiFT0A", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiTPC", "PsiTPC", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiTPCR", "PsiTPCR", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiTPCL", "PsiTPCL", kTH2F, {centAxis, phiAxis}); - // histogram for resolution - histos.add("ResFT0CTPC", "ResFT0CTPC", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0CTPCR", "ResFT0CTPCR", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0CTPCL", "ResFT0CTPCL", kTH2F, {centAxis, resAxis}); - histos.add("ResTPCRTPCL", "ResTPCRTPCL", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0CFT0A", "ResFT0CFT0A", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0ATPC", "ResFT0ATPC", kTH2F, {centAxis, resAxis}); - } - - if (QAv0) { - // Lambda topological cuts - histos.add("hDCAV0Daughters", "hDCAV0Daughters", - {HistType::kTH1F, {{50, 0.0f, 5.0f}}}); - histos.add("hLT", "hLT", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); - histos.add("hV0CosPA", "hV0CosPA", - {HistType::kTH1F, {{100, 0.95f, 1.f}}}); - } - - // CKStar histograms - histos.add("hLamInvMass", - "Invariant mass of Lambda baryon", kTHnSparseF, - {{100, 0.0, 100.0}, {200, 0.0f, 20.0f}, {200, 1.0, 1.2}, {100, -1, 1}}, true); - - // Event selection cut additional - Alex - if (additionalEvsel) { - fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); - fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - fMultPVCutHigh->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); - fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x)", 0, 100); - fMultCutLow->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); - fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 3.*([4]+[5]*x)", 0, 100); - fMultCutHigh->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); - fMultMultPVCut = new TF1("fMultMultPVCut", "[0]+[1]*x+[2]*x*x", 0, 5000); - fMultMultPVCut->SetParameters(-0.1, 0.785, -4.7e-05); - } - } + Configurable isPVContributor{"isPVContributor", true, "is PV contributor"}; + Configurable checkwithpub{"checkwithpub", true, "checking results with published"}; + Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3, "PID selections for Pions"}; + Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3, "PID selections for Kaons"}; + Configurable nsigmaCutTPCPr{"nsigmaCutTPCPr", 3, "PID selections for Protons"}; + Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3, "PID selections for TOF Pions"}; + Configurable nsigmaCutTOFKa{"nsigmaCutTOFKa", 3, "PID selections for TOF Kaons"}; + Configurable nsigmaCutTOFPr{"nsigmaCutTOFPr", 3, "PID selections for TOF Protons"}; + Configurable cfgCutTOFBeta{"cfgCutTOFBeta", 0, "Beta selections for Particles"}; + + Configurable CentNbins{"CentNbins", 16, "Number of bins in cent histograms"}; + Configurable lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"}; + Configurable hbinCent{"hbinCent", 80.0, "higher bin value in cent histograms"}; + Configurable SANbins{"SANbins", 20, "Number of bins in costhetastar"}; + Configurable lbinSA{"lbinSA", -1.0, "lower bin value in costhetastar histograms"}; + Configurable hbinSA{"hbinSA", 1.0, "higher bin value in costhetastar histograms"}; + Configurable PolNbins{"PolNbins", 20, "Number of bins in polarisation"}; + Configurable lbinPol{"lbinPol", -1.0, "lower bin value in #phi-#psi histograms"}; + Configurable hbinPol{"hbinPol", 1.0, "higher bin value in #phi-#psi histograms"}; + Configurable IMNbins{"IMNbins", 100, "Number of bins in invariant mass"}; + Configurable lbinIM{"lbinIM", 1.0, "lower bin value in IM histograms"}; + Configurable hbinIM{"hbinIM", 1.2, "higher bin value in IM histograms"}; + Configurable ptNbins{"ptNbins", 50, "Number of bins in pt"}; + Configurable lbinpt{"lbinpt", 0.0, "lower bin value in pt histograms"}; + Configurable hbinpt{"hbinpt", 10.0, "higher bin value in pt histograms"}; + Configurable resNbins{"resNbins", 50, "Number of bins in reso"}; + Configurable lbinres{"lbinres", 0.0, "lower bin value in reso histograms"}; + Configurable hbinres{"hbinres", 10.0, "higher bin value in reso histograms"}; + Configurable etaNbins{"etaNbins", 20, "Number of bins in eta"}; + Configurable lbineta{"lbineta", -1.0, "lower bin value in eta histograms"}; + Configurable hbineta{"hbineta", 1.0, "higher bin value in eta histograms"}; + Configurable spNbins{"spNbins", 2000, "Number of bins in sp"}; + Configurable lbinsp{"lbinsp", -1.0, "lower bin value in sp histograms"}; + Configurable hbinsp{"hbinsp", 1.0, "higher bin value in sp histograms"}; + Configurable phiNbins{"phiNbins", 30, "Number of bins in phi"}; + + ConfigurableAxis configcentAxis{"configcentAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "Cent V0M"}; + ConfigurableAxis configthnAxispT{"configthnAxisPt", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis configetaAxis{"configetaAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "Eta"}; + ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"}; + ConfigurableAxis configphiAxis{"configphiAxis", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.8, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 5.5, 6.28}, "PhiAxis"}; - double massLambda = TDatabasePDG::Instance() - ->GetParticle(kLambda0) - ->Mass(); // FIXME: Get from the common header + SliceCache cache; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - template - bool eventSelected(TCollision collision, const float& centrality) + void init(o2::framework::InitContext&) { - if (collision.alias_bit(kTVXinTRD)) { - // TRD triggered - // return 0; - } - auto multNTracksPV = collision.multNTracksPV(); - if (multNTracksPV < fMultPVCutLow->Eval(centrality)) - return 0; - if (multNTracksPV > fMultPVCutHigh->Eval(centrality)) - return 0; - // if (multTrk < fMultCutLow->Eval(centrality)) - // return 0; - // if (multTrk > fMultCutHigh->Eval(centrality)) - // return 0; - // if (multTrk > fMultMultPVCut->Eval(multNTracksPV)) - // return 0; - - return 1; + AxisSpec thnAxispT{ptNbins, lbinpt, hbinpt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec thnAxisRap{100, -0.5, 0.5, "Rapidity"}; + AxisSpec thnAxisres{resNbins, lbinres, hbinres, "Reso"}; + AxisSpec thnAxisInvMass{IMNbins, lbinIM, hbinIM, "#it{M} (GeV/#it{c}^{2})"}; + AxisSpec thnAxisPol{PolNbins, lbinPol, hbinPol, "Sin(#phi - #psi)"}; + AxisSpec thnAxisCosThetaStar{SANbins, lbinSA, hbinSA, "SA"}; + AxisSpec centAxis = {CentNbins, lbinCent, hbinCent, "V0M (%)"}; + AxisSpec etaAxis = {etaNbins, lbineta, hbineta, "Eta"}; + AxisSpec spAxis = {spNbins, lbinsp, hbinsp, "Sp"}; + AxisSpec qxZDCAxis = {QxyNbins, lbinQxy, hbinQxy, "Qx"}; + AxisSpec phiAxis = {phiNbins, 0.0, 6.28, "phi-phiStar"}; + /* + histos.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxytvscentpteta", "hpuxyQxytvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxypvscentpteta", "hpuxyQxypvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true);*/ + histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetakaon", "hpoddv1vscentptetakaon", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetakaon", "hpevenv1vscentptetakaon", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetaproton", "hpoddv1vscentptetaproton", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaproton", "hpevenv1vscentptetaproton", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + + /* histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQytvscentptetaneg", "hpuyQytvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxytvscentptetaneg", "hpuxyQxytvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxypvscentptetaneg", "hpuxyQxypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true);*/ + histos.add("hpoddv1vscentptetaneg", "hpoddv1vscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaneg", "hpevenv1vscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetakaonneg", "hpoddv1vscentptetakaonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetakaonneg", "hpevenv1vscentptetakaonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetaprotonneg", "hpoddv1vscentptetaprotonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaprotonneg", "hpevenv1vscentptetaprotonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + + histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + + histos.add("hCentrality", "Centrality distribution", kTH1F, {{centAxis}}); } template bool selectionTrack(const T& candidate) - { - if (iscustomDCAcut && - (!candidate.isGlobalTrack() || !candidate.isPVContributor() || - candidate.itsNCls() < cfgITScluster)) { - return false; - } - - if (ismanualDCAcut && !(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() && std::abs(candidate.dcaXY()) < cfgCutDCAxy && std::abs(candidate.dcaZ()) < cfgCutDCAz && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) { - return false; - } - - return true; - } - - template - bool selectionPID(const T& candidate) { - if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) { - return true; - } else if (candidate.hasTOF() && - std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOF) { - return true; - } - - return false; - } - - template - bool SelectionV0(Collision const& collision, V0 const& candidate, - float /*multiplicity*/) - { - if (fabs(candidate.dcav0topv()) > cMaxV0DCA) { - return false; - } - - const float pT = candidate.pt(); - const float tranRad = candidate.v0radius(); - const float dcaDaughv0 = candidate.dcaV0daughters(); - const float cpav0 = candidate.v0cosPA(); - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), - collision.posZ()) * - TDatabasePDG::Instance() - ->GetParticle(kLambda0) - ->Mass(); // FIXME: Get from the common header - // float lowmasscutks0 = 0.497 - cWidthKs0 * cSigmaMassKs0; - // float highmasscutks0 = 0.497 + cWidthKs0 * cSigmaMassKs0; - float lowmasscutlambda = 1.0; - float highmasscutlambda = 1.2; - // float decayLength = candidate.distovertotmom(collision.posX(), - // collision.posY(), collision.posZ()) * - // RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), - // candidate.pz()); - - if (pT < ConfV0PtMin) { - return false; - } - if (dcaDaughv0 > ConfV0DCADaughMax) { - return false; - } - if (cpav0 < ConfV0CPAMin) { - return false; - } - if (tranRad < ConfV0TranRadV0Min) { - return false; - } - if (tranRad > ConfV0TranRadV0Max) { - return false; - } - if (fabs(CtauK0s) > cMaxV0LifeTime || - candidate.mLambda() < lowmasscutlambda || - candidate.mLambda() > highmasscutlambda) { - return false; - } - - if (QAv0) { - histos.fill(HIST("hLT"), CtauK0s); - histos.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); - histos.fill(HIST("hV0CosPA"), candidate.v0cosPA()); - } - return true; - } - - template - bool isSelectedV0Daughter(T const& track, float charge, - double nsigmaV0Daughter) - { - const auto eta = track.eta(); - const auto tpcNClsF = track.tpcNClsFound(); - const auto dcaXY = track.dcaXY(); - const auto sign = track.sign(); - - if (!track.hasTPC()) - return false; - if (track.tpcNClsCrossedRows() < 70) - return false; - if (track.tpcCrossedRowsOverFindableCls() < 0.8) - return false; - - if (charge < 0 && sign > 0) { - return false; - } - if (charge > 0 && sign < 0) { - return false; - } - if (std::abs(eta) > ConfDaughEta) { - return false; - } - if (tpcNClsF < ConfDaughTPCnclsMin) { - return false; - } - if (std::abs(dcaXY) < ConfDaughDCAMin) { - return false; - } - if (std::abs(nsigmaV0Daughter) > ConfDaughPIDCuts) { - return false; + if (mycut) { + if (!candidate.isGlobalTrack() || !candidate.isPVContributor() || !(candidate.itsNCls() > cfgITScluster) || !(candidate.tpcNClsFound() > cfgTPCcluster) || !(candidate.itsNClsInnerBarrel() >= 1)) { + return false; + } + } else { + if (!(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.itsNClsInnerBarrel() >= 1)) { + return false; + } } - return true; } @@ -360,119 +212,183 @@ struct lambdav2 { { double result = phi; while (result < 0) { - result = result + 2. * TMath::Pi() / 2; + result = result + 2. * TMath::Pi(); } - while (result > 2. * TMath::Pi() / 2) { - result = result - 2. * TMath::Pi() / 2; + while (result > 2. * TMath::Pi()) { + result = result - 2. * TMath::Pi(); } return result; } - // Defining filters for events (event selection) - // Processed events will be already fulfilling the event selection - // requirements - // Filter eventFilter = (o2::aod::evsel::sel8 == true); - Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); - - Filter acceptanceFilter = - (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - - using EventCandidates = soa::Filtered>; - - using TrackCandidates = soa::Filtered>; - using V0TrackCandidate = aod::V0Datas; - - ROOT::Math::PxPyPzMVector Lambda; - - void processSE(EventCandidates::iterator const& collision, - TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s, - aod::BCs const&) + template + bool SelectionPID(const T& candidate, int PID) + { + if (PID == 0) // pion + { + auto combPIDPi = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi())); + if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.6 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { + return true; + } + if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDPi < nsigmaCutTOFPi) { + return true; + } + } else if (PID == 1) // kaon + { + auto combPIDKa = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa())); + if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.45 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { + return true; + } + if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDKa < nsigmaCutTOFKa) { + return true; + } + } else // proton + { + auto combPIDPr = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr())); + if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.6 && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPCPr) { + return true; + } + if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDPr < nsigmaCutTOFPr) { + return true; + } + } + return false; + } + ROOT::Math::PxPyPzMVector Lambda, Proton, Pion, fourVecDauCM; + // ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm, beamvector; + ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY; + double phiangle = 0.0; + double massPi = o2::constants::physics::MassPionCharged; + double massKa = o2::constants::physics::MassKaonCharged; + double massPr = o2::constants::physics::MassProton; + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin); + Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); + Filter dcaCutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + + using EventCandidates = soa::Filtered>; + // using AllTrackCandidates = soa::Join; + using AllTrackCandidates = soa::Filtered>; + using ResoV0s = aod::V0Datas; + + // void processData(EventCandidates::iterator const& collision, AllTrackCandidates const&, ResoV0s const& V0s, aod::BCs const&) + void processData(EventCandidates::iterator const& collision, AllTrackCandidates const& tracks, ResoV0s const& V0s, aod::BCs const&) { if (!collision.sel8()) { return; } - - float centrality = 0.0f; - centrality = collision.centFT0C(); - auto multTPC = collision.multNTracksPV(); - - if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + auto centrality = collision.centFT0C(); + // histos.fill(HIST("hCentrality0"), centrality); + if (!collision.triggereventsp()) { return; } + // histos.fill(HIST("hCentrality1"), centrality); - if (additionalEvsel && !eventSelected(collision, centrality)) { + if (additionalEvSel && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { return; } - - if (QA) { - histos.fill(HIST("hFTOCvsTPCNoCut"), centrality, multTPC); - } - if (!collision.triggereventep()) { + // histos.fill(HIST("hCentrality2"), centrality); + // if (additionalEvSel2 && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) { + if (additionalEvSel2 && (collision.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision.trackOccupancyInTimeRange() < cfgMinOccupancy)) { return; } - auto psiFT0C = collision.psiFT0C(); - auto psiFT0A = collision.psiFT0A(); - auto psiTPC = collision.psiTPC(); - auto psiTPCR = collision.psiTPCR(); - auto psiTPCL = collision.psiTPCL(); - if (QA) { - histos.fill(HIST("hFTOCvsTPCSelected"), centrality, multTPC); - histos.fill(HIST("hPsiFT0C"), centrality, psiFT0C); - histos.fill(HIST("hPsiFT0A"), centrality, psiFT0A); - histos.fill(HIST("hPsiTPC"), centrality, psiTPC); - histos.fill(HIST("hPsiTPCR"), centrality, psiTPCR); - histos.fill(HIST("hPsiTPCL"), centrality, psiTPCL); - histos.fill(HIST("ResFT0CTPC"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPC))); - histos.fill(HIST("ResFT0CTPCR"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPCR))); - histos.fill(HIST("ResFT0CTPCL"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPCL))); - histos.fill(HIST("ResTPCRTPCL"), centrality, TMath::Cos(2.0 * (psiTPCR - psiTPCL))); - histos.fill(HIST("ResFT0CFT0A"), centrality, TMath::Cos(2.0 * (psiFT0C - psiFT0A))); - histos.fill(HIST("ResFT0ATPC"), centrality, TMath::Cos(2.0 * (psiTPC - psiFT0A))); + // histos.fill(HIST("hCentrality3"), centrality); + if (additionalEvSel3 && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + return; } - // Fill the event counter - rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); - rEventSelection.fill(HIST("hmult"), centrality); + auto qxZDCA = collision.qxZDCA(); + auto qxZDCC = collision.qxZDCC(); + auto qyZDCA = collision.qyZDCA(); + auto qyZDCC = collision.qyZDCC(); + auto psiZDCC = collision.psiZDCC(); + auto psiZDCA = collision.psiZDCA(); + + histos.fill(HIST("hCentrality"), centrality); + + auto QxtQxp = qxZDCA * qxZDCC; + auto QytQyp = qyZDCA * qyZDCC; + auto Qxytp = QxtQxp + QytQyp; + auto QxpQyt = qxZDCA * qyZDCC; + auto QxtQyp = qxZDCC * qyZDCA; + + histos.fill(HIST("hpQxtQxpvscent"), centrality, QxtQxp); + histos.fill(HIST("hpQytQypvscent"), centrality, QytQyp); + histos.fill(HIST("hpQxytpvscent"), centrality, Qxytp); + histos.fill(HIST("hpQxpQytvscent"), centrality, QxpQyt); + histos.fill(HIST("hpQxtQypvscent"), centrality, QxtQyp); + + for (auto track : tracks) { + if (!selectionTrack(track)) { + continue; + } - for (auto& v0 : V0s) { + bool ispion = 0; + bool iskaon = 0; + bool isproton = 0; - auto postrack = v0.template posTrack_as(); - auto negtrack = v0.template negTrack_as(); - double nTPCSigmaPos[1]{postrack.tpcNSigmaPr()}; - double nTPCSigmaNeg[1]{negtrack.tpcNSigmaPi()}; - double nTPCSigmaPos2[1]{postrack.tpcNSigmaPi()}; - double nTPCSigmaNeg2[1]{negtrack.tpcNSigmaPr()}; + if (SelectionPID(track, 0)) + ispion = 1; + if (SelectionPID(track, 1)) + iskaon = 1; + if (SelectionPID(track, 2)) + isproton = 1; - if (!isSelectedV0Daughter(postrack, 1, nTPCSigmaPos[0]) && !isSelectedV0Daughter(postrack, 1, nTPCSigmaPos2[0])) { + if (ispion && iskaon) continue; - } - if (!isSelectedV0Daughter(negtrack, -1, nTPCSigmaNeg[0]) && !isSelectedV0Daughter(negtrack, -1, nTPCSigmaNeg2[0])) { + if (ispion && isproton) continue; - } - - if (!SelectionV0(collision, v0, centrality)) { + if (iskaon && isproton) continue; - } - - Lambda = ROOT::Math::PxPyPzMVector(v0.px(), v0.py(), v0.pz(), massLambda); - auto phiminuspsi = GetPhiInRange(Lambda.Phi() - psiFT0C); - auto v2 = TMath::Cos(2.0 * phiminuspsi); + float sign = track.sign(); + if (sign == 0.0) // removing neutral particles + continue; - if (TMath::Abs(Lambda.Rapidity()) < 0.5) { - histos.fill(HIST("hLamInvMass"), centrality, - Lambda.Pt(), v0.mLambda(), v2); + auto ux = TMath::Cos(GetPhiInRange(track.phi())); + auto uy = TMath::Sin(GetPhiInRange(track.phi())); + + auto uxQxp = ux * qxZDCA; + auto uyQyp = uy * qyZDCA; + auto uxyQxyp = uxQxp + uyQyp; + auto uxQxt = ux * qxZDCC; + auto uyQyt = uy * qyZDCC; + auto uxyQxyt = uxQxt + uyQyt; + auto oddv1 = ux * (qxZDCA - qxZDCC) + uy * (qyZDCA - qyZDCC); + auto evenv1 = ux * (qxZDCA + qxZDCC) + uy * (qyZDCA + qyZDCC); + + if (sign > 0) { + if (ispion) { + histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.rapidity(massPi), oddv1); + histos.fill(HIST("hpevenv1vscentpteta"), centrality, track.pt(), track.rapidity(massPi), evenv1); + } else if (iskaon) { + histos.fill(HIST("hpoddv1vscentptetakaon"), centrality, track.pt(), track.rapidity(massKa), oddv1); + histos.fill(HIST("hpevenv1vscentptetakaon"), centrality, track.pt(), track.rapidity(massKa), evenv1); + } else if (isproton) { + histos.fill(HIST("hpoddv1vscentptetaproton"), centrality, track.pt(), track.rapidity(massPr), oddv1); + histos.fill(HIST("hpevenv1vscentptetaproton"), centrality, track.pt(), track.rapidity(massPr), evenv1); + } + + } else { + if (ispion) { + histos.fill(HIST("hpoddv1vscentptetaneg"), centrality, track.pt(), track.rapidity(massPi), oddv1); + histos.fill(HIST("hpevenv1vscentptetaneg"), centrality, track.pt(), track.rapidity(massPi), evenv1); + } else if (iskaon) { + histos.fill(HIST("hpoddv1vscentptetakaonneg"), centrality, track.pt(), track.rapidity(massKa), oddv1); + histos.fill(HIST("hpevenv1vscentptetakaonneg"), centrality, track.pt(), track.rapidity(massKa), evenv1); + } else if (isproton) { + histos.fill(HIST("hpoddv1vscentptetaprotonneg"), centrality, track.pt(), track.rapidity(massPr), oddv1); + histos.fill(HIST("hpevenv1vscentptetaprotonneg"), centrality, track.pt(), track.rapidity(massPr), evenv1); + } } } } - - PROCESS_SWITCH(lambdav2, processSE, "Process Same event", true); + PROCESS_SWITCH(lambdav2, processData, "Process data", true); }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"lambdav2"})}; } diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 041ed4da0b6..083790327b8 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -79,6 +79,8 @@ struct lambdapolsp { Configurable mycut{"mycut", false, "select tracks based on my cuts"}; Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; + Configurable usefourvectormass{"usefourvectormass", true, "select invariant mass based on four vector"}; + Configurable checksign{"checksign", true, "check sign of daughter tracks"}; Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; @@ -408,7 +410,7 @@ struct lambdapolsp { return result; } - ROOT::Math::PxPyPzMVector Lambda, Proton, Pion, fourVecDauCM; + ROOT::Math::PxPyPzMVector Lambda, Lambdacopy, Proton, Pion, fourVecDauCM; // ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm, beamvector; ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY; double phiangle = 0.0; @@ -585,6 +587,14 @@ struct lambdapolsp { int LambdaTag = 0; int aLambdaTag = 0; + const auto signpos = postrack.sign(); + const auto signneg = negtrack.sign(); + + if (checksign) { + if (signpos < 0 || signneg > 0) + continue; + } + if (isSelectedV0Daughter(postrack, 0) && isSelectedV0Daughter(negtrack, 1)) { LambdaTag = 1; } @@ -608,6 +618,7 @@ struct lambdapolsp { Pion = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPi); } Lambda = Proton + Pion; + Lambdacopy = Proton + Pion; Lambda.SetM(massLambda); ROOT::Math::Boost boost{Lambda.BoostToCM()}; @@ -637,29 +648,41 @@ struct lambdapolsp { auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(Lambda.Phi() - phiangle)); // A2 correction auto phiphiStar = GetPhiInRange(Lambda.Phi() - phiangle); + double candmass = 0.0; + if (LambdaTag) { - histos.fill(HIST("hSparseLambdaPolA"), v0.mLambda(), v0.pt(), v0.eta(), PolA, centrality); - histos.fill(HIST("hSparseLambdaPolC"), v0.mLambda(), v0.pt(), v0.eta(), PolC, centrality); + if (usefourvectormass) + candmass = Lambdacopy.M(); + else + candmass = v0.mLambda(); + + histos.fill(HIST("hSparseLambdaPolA"), candmass, v0.pt(), v0.eta(), PolA, centrality); + histos.fill(HIST("hSparseLambdaPolC"), candmass, v0.pt(), v0.eta(), PolC, centrality); if (correction1) { - histos.fill(HIST("hSparseLambda_corr1a"), v0.mLambda(), v0.pt(), v0.eta(), sinPhiStar, centrality); - histos.fill(HIST("hSparseLambda_corr1b"), v0.mLambda(), v0.pt(), v0.eta(), cosPhiStar, centrality); - histos.fill(HIST("hSparseLambda_corr1c"), v0.mLambda(), v0.pt(), v0.eta(), phiphiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1a"), candmass, v0.pt(), v0.eta(), sinPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1b"), candmass, v0.pt(), v0.eta(), cosPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1c"), candmass, v0.pt(), v0.eta(), phiphiStar, centrality); if (correction2) { - histos.fill(HIST("hSparseLambda_corr2a"), v0.mLambda(), v0.pt(), v0.eta(), sinThetaStar, centrality); - histos.fill(HIST("hSparseLambda_corr2b"), v0.mLambda(), v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); + histos.fill(HIST("hSparseLambda_corr2a"), candmass, v0.pt(), v0.eta(), sinThetaStar, centrality); + histos.fill(HIST("hSparseLambda_corr2b"), candmass, v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); } } } if (aLambdaTag) { - histos.fill(HIST("hSparseAntiLambdaPolA"), v0.mAntiLambda(), v0.pt(), v0.eta(), PolA, centrality); - histos.fill(HIST("hSparseAntiLambdaPolC"), v0.mAntiLambda(), v0.pt(), v0.eta(), PolC, centrality); + if (usefourvectormass) + candmass = Lambdacopy.M(); + else + candmass = v0.mAntiLambda(); + + histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, v0.pt(), v0.eta(), PolA, centrality); + histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, v0.pt(), v0.eta(), PolC, centrality); if (correction1) { - histos.fill(HIST("hSparseAntiLambda_corr1a"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinPhiStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr1b"), v0.mAntiLambda(), v0.pt(), v0.eta(), cosPhiStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr1c"), v0.mAntiLambda(), v0.pt(), v0.eta(), phiphiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1a"), candmass, v0.pt(), v0.eta(), sinPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1b"), candmass, v0.pt(), v0.eta(), cosPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, v0.pt(), v0.eta(), phiphiStar, centrality); if (correction2) { - histos.fill(HIST("hSparseAntiLambda_corr2a"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinThetaStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr2b"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, v0.pt(), v0.eta(), sinThetaStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); } } } From 4d77591373958e6fd639aa279b33c280f3e8e75a Mon Sep 17 00:00:00 2001 From: Thorkj <154221526+Thorkj@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:45:24 +0100 Subject: [PATCH 71/91] [PWGCF] Updated CorrSparse with added histograms and a changed dPhi definition (#8770) Co-authored-by: Thor Jensen Co-authored-by: ALICE Action Bot --- .../Tasks/CMakeLists.txt | 4 +- .../Tasks/{CorrSparse.cxx => corrSparse.cxx} | 64 ++++++++++--------- 2 files changed, 37 insertions(+), 31 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{CorrSparse.cxx => corrSparse.cxx} (75%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index bb41ca1ccab..fe8f8ed9e1a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -48,8 +48,8 @@ o2physics_add_dpl_workflow(twopartcorr-per-run-extraqc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(corrsparses - SOURCES CorrSparse.cxx +o2physics_add_dpl_workflow(corr-sparse + SOURCES corrSparse.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx similarity index 75% rename from PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 0d840103eb2..9d7463534bf 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -9,6 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file corrSparse.cxx +/// \brief Provides a sparse with usefull two particle correlation info +/// \author Thor Jensen (djt288@alumni.ku.dk) + #include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -16,29 +20,25 @@ #include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" #include "Framework/RunningWorkflowInfo.h" -#include "Common/Core/RecoDecay.h" #include "CommonConstants/MathConstants.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Centrality.h" #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" +#include "Common/Core/RecoDecay.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; struct CorrSparse { - Configurable cfgZVtxCut = {"zvtxcut", 10.0, "Vertex z cut. Default 10 cm"}; - Configurable cfgPtCutMin = {"minpt", 0.2, "Minimum accepted track pT. Default 0.2 GeV"}; - Configurable cfgPtCutMax = {"maxpt", 5.0, "Maximum accepted track pT. Default 5.0 GeV"}; - Configurable cfgEtaCut = {"etacut", 0.8, "Eta cut. Default 0.8"}; - Configurable cfgDCAzCut = {"dcacut", 0.3, "DCA z cut. Default 0.3 cm"}; - Configurable cfgDCAxyCut = {"dcacutxy", 0.3, "DCA xy cut. Default 0.2 cm"}; - Configurable cfgDCAxySigmaCut = {"dcacutxysigma", 1, "DCA xy sigma cut. Default 0.3"}; - Configurable cfgCutChi2prTPCcls = {"chi2cut", 2.5, "Chi2 cut. Default 2.5"}; + Configurable cfgZVtxCut = {"cfgZVtxCut", 10.0, "Vertex z cut. Default 10 cm"}; + Configurable cfgPtCutMin = {"cfgPtCutMin", 0.2, "Minimum accepted track pT. Default 0.2 GeV"}; + Configurable cfgPtCutMax = {"cfgPtCutMax", 5.0, "Maximum accepted track pT. Default 5.0 GeV"}; + Configurable cfgEtaCut = {"cfgEtaCut", 0.8, "Eta cut. Default 0.8"}; ConfigurableAxis axisVertex{"axisVertex", {7, -7, 7}, "vertex axis for histograms"}; - ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -constants::math::PIHalf, constants::math::PIHalf * 3}, "delta phi axis for histograms"}; + ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; ConfigurableAxis axisDeltaEta{"axisDeltaEta", {40, -2, 2}, "delta eta axis for histograms"}; ConfigurableAxis axisPtTrigger{"axisPtTrigger", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt trigger axis for histograms"}; ConfigurableAxis axisPtAssoc{"axisPtAssoc", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt associated axis for histograms"}; @@ -51,10 +51,15 @@ struct CorrSparse { { LOGF(info, "Starting init"); registry.add("Yield", "pT vs eta vs Nch", {HistType::kTH3F, {{40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}, {100, 0, 100, "Nch"}}}); // check to see total number of tracks - registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, {{100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}, {100, 0, 100, "Nch"}}}); + registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, {{100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}, {100, 0, 100, "Nch"}}}); + // Make histograms to check the distributions after cuts registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); + registry.add("Phi", "Phi", {HistType::kTH1D, {{72, 0, TwoPI, "Phi"}}}); + registry.add("Eta", "Eta", {HistType::kTH1D, {{40, -2, 2, "Eta"}}}); + registry.add("pT", "pT", {HistType::kTH1D, {axisPtTrigger}}); + registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); registry.add("Sparse_mixed", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse registry.add("Sparse_same", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); @@ -63,12 +68,17 @@ struct CorrSparse { registry.add("eventcount", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); // histogram to see how many events are in the same and mixed event } + // fill multiple histograms template - void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. (This is not needed can be removed) + void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. { - for (auto& track1 : tracks) { + registry.fill(HIST("Nch"), tracks.size()); + for (auto const& track1 : tracks) { registry.fill(HIST("Yield"), track1.pt(), track1.eta(), track1.size()); - registry.fill(HIST("etaphi_Trigger"), track1.size(), track1.phi(), track1.eta()); + registry.fill(HIST("etaphi_Trigger"), track1.eta(), track1.phi(), track1.size()); + registry.fill(HIST("Phi"), track1.phi()); + registry.fill(HIST("Eta"), track1.eta()); + registry.fill(HIST("pT"), track1.pt()); } } @@ -94,9 +104,8 @@ struct CorrSparse { continue; } - float deltaPhi = track1.phi() - track2.phi(); + float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -PIHalf); float deltaEta = track1.eta() - track2.eta(); - RecoDecay::constrainAngle(deltaPhi, -PIHalf); // fill the right sparse and histograms if (system == 1) { @@ -110,21 +119,18 @@ struct CorrSparse { } } - // make the filters and cuts. I was told not to include chi2 since its not needed for run 3 data. + // make the filters and cuts. Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut; - Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) - //&& (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) - && (nabs(aod::track::dcaZ) > cfgDCAzCut) && (cfgDCAxySigmaCut * (0.0015f + 0.005f / npow(aod::track::pt, 1.1f)) < nabs(aod::track::dcaXY)); - // + Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); // define the filtered collisions and tracks - using aodCollisions = soa::Filtered>; - using aodTracks = soa::Filtered>; - // process for the same event - void processSame(aodCollisions::iterator const& collision, aodTracks const& tracks) + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; + + void processSame(AodCollisions::iterator const& collision, AodTracks const& tracks) { const auto centrality = collision.centFT0C(); @@ -141,15 +147,15 @@ struct CorrSparse { ColumnBinningPolicy bindingOnVtxAndMult{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - SameKindPair> pair{bindingOnVtxAndMult, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored // the process for filling the mixed events - void processMixed(aodCollisions& collisions, aodTracks const& tracks) + void processMixed(AodCollisions const& collisions, AodTracks const& tracks) { - for (auto& [collision1, tracks1, collision2, tracks2] : pair) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pair) { if (fillCollision(collision1, collision1.centFT0C()) == false) { continue; From 4574a1f46eed565c794e705649249f15dba10e60 Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:46:01 +0100 Subject: [PATCH 72/91] [PWGCF] Added pt bins and fixed bins in getCorrection function (#8845) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 45 +++++++++---- PWGCF/Flow/Tasks/flowSP.cxx | 82 ++++++++++++------------ 2 files changed, 72 insertions(+), 55 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index de946251704..f0f27f675af 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -103,7 +103,7 @@ std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, double centrality = 0; int runnumber = 0; std::vector v(3, 0); // vx, vy, vz -bool isSelected = false; +bool isSelected = true; } // namespace o2::analysis::qvectortask @@ -133,6 +133,7 @@ struct ZdcQVectors { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/Energy", "ccdb path for energy calibration histos") O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/vmean", "ccdb path for mean v histos") + O2_DEFINE_CONFIGURABLE(cfgMinEntriesSparseBin, int, 100, "Minimal number of entries allowed in 4D recentering histogram to use for recentering.") Configurable> cfgRec1{"cfgRec1", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step5"}, "ccdb paths for recentering calibration histos iteration 1"}; Configurable> cfgRec2{"cfgRec2", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step5"}, "ccdb paths for recentering calibration histos iteration 2"}; @@ -229,8 +230,11 @@ struct ZdcQVectors { // recentered q-vectors (to check what steps are finished in the end) registry.add("hStep", "hStep", {HistType::kTH1D, {{10, 0., 10.}}}); registry.add("hIteration", "hIteration", {HistType::kTH1D, {{10, 0., 10.}}}); + registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}); registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}); + registry.add("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}}); + registry.add("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}}); registry.add("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}}); @@ -420,14 +424,14 @@ struct ZdcQVectors { return; } if (counter < 1) - LOGF(info, "<--------OK----------> Calibrations loaded for iteration %i and step %i", iteration, step + 1); + LOGF(info, "<--------OK----------> Calibrations loaded for cal.calibfilesLoaded[%i][%i]", iteration, step); cal.calibfilesLoaded[iteration][step] = true; cal.atIteration = iteration; cal.atStep = step; return; } else { if (counter < 1) - LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step + 1); + LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step); } } @@ -465,22 +469,25 @@ struct ZdcQVectors { bin = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); calibConstant = h->GetBinContent(bin); } else if (hist->InheritsFrom("THnSparse")) { - std::vector sparsePars; + std::vector sparsePars; THnSparseD* h = reinterpret_cast(hist); if (step == 0 && iteration > 0) { + // Axis(0) is runnuber, but we don't need this sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); sparsePars.push_back(h->GetAxis(3)->FindBin(v[1])); sparsePars.push_back(h->GetAxis(4)->FindBin(v[2])); } - for (std::size_t i = 0; i < sparsePars.size(); i++) { - h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); + + for (std::size_t i = 0; i < sparsePars.size() + 1; i++) { + h->GetAxis(i + 1)->SetRange(sparsePars[i], sparsePars[i]); } - calibConstant = h->Projection(sparsePars.size())->GetMean(); + calibConstant = h->Projection(5)->GetMean(); - if (h->Projection(sparsePars.size())->GetEntries() < 2) { + if (h->Projection(sparsePars.size())->GetEntries() < cfgMinEntriesSparseBin) { LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); calibConstant = 0; + isSelected = false; } } return calibConstant; @@ -503,10 +510,13 @@ struct ZdcQVectors { std::vector xEnZN(2, 0.); std::vector yEnZN(2, 0.); + isSelected = true; + auto cent = collision.centFT0C(); if (cent < 0 || cent > 90) { - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } @@ -515,7 +525,8 @@ struct ZdcQVectors { const auto& foundBC = collision.foundBC_as(); if (!foundBC.has_zdc()) { - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } @@ -548,6 +559,7 @@ struct ZdcQVectors { LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + registry.get(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]); } if (counter < 1) @@ -588,13 +600,15 @@ struct ZdcQVectors { // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation if (!isZNAhit || !isZNChit) { counter++; - spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } if (!cal.calibfilesLoaded[0][0]) { counter++; - spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } @@ -674,11 +688,14 @@ struct ZdcQVectors { } } + if (counter < 1) + LOGF(info, "We evaluate cal.atIteration=%i and cal.atStep=%i ", cal.atIteration, cal.atStep); + if (cal.atIteration == 0) { if (counter < 1) LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); fillAllRegistries(0, 0); - spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], isSelected, 0, 0); counter++; return; } else { @@ -707,7 +724,7 @@ struct ZdcQVectors { LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); fillAllRegistries(cal.atIteration, cal.atStep + 1); registry.fill(HIST("QA/centrality_after"), centrality); - spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], isSelected, cal.atIteration, cal.atStep); counter++; return; } diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 975698931bf..1bf72ba2bd9 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -119,33 +119,33 @@ struct FlowSP { registry.add("pt_phi_bef", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); registry.add("pt_phi_aft", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - registry.add("v1_eta", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1A_eta", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1C_eta", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1AC_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1A_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1C_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1AC_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_dev", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_dev", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_dev", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_dev", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_dev_pos", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_dev_pos", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_odd_pos", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_dev_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_dev_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_odd_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_dev_neg", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_dev_neg", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_odd_neg", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_dev_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_dev_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_odd_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v2_cent", "", kTProfile, {{80, 0, 80}}); - registry.add("v2A_cent", "", kTProfile, {{80, 0, 80}}); - registry.add("v2C_cent", "", kTProfile, {{80, 0, 80}}); - registry.add("v2AC_cent", "", kTProfile, {{80, 0, 80}}); + registry.add("v2_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + registry.add("v2A_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + registry.add("v2C_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + registry.add("v2AC_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); - registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{10, 0, 10}}}); + registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{11, 0, 11}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "sel8"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "occupancy"); @@ -371,39 +371,39 @@ struct FlowSP { double v1AC = std::cos(phi - (psiA - psiC)); - registry.fill(HIST("v1_eta"), track.eta(), (1. / std::sqrt(2)) * (v1A - v1C)); - registry.fill(HIST("v1A_eta"), track.eta(), (v1A)); - registry.fill(HIST("v1C_eta"), track.eta(), (v1C)); - registry.fill(HIST("v1AC_eta"), track.eta(), (v1AC)); + registry.fill(HIST("v1_eta"), track.eta(), track.pt(), (1. / std::sqrt(2)) * (v1A - v1C)); + registry.fill(HIST("v1A_eta"), track.eta(), track.pt(), (v1A)); + registry.fill(HIST("v1C_eta"), track.eta(), track.pt(), (v1C)); + registry.fill(HIST("v1AC_eta"), track.eta(), track.pt(), (v1AC)); - registry.fill(HIST("v1_eta_odd"), track.eta(), oddv1); - registry.fill(HIST("v1_eta_even"), track.eta(), evenv1); + registry.fill(HIST("v1_eta_odd"), track.eta(), track.pt(), oddv1); + registry.fill(HIST("v1_eta_even"), track.eta(), track.pt(), evenv1); - registry.fill(HIST("v1_eta_odd_dev"), track.eta(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev"), track.eta(), evenv1Dev); + registry.fill(HIST("v1_eta_odd_dev"), track.eta(), track.pt(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev"), track.eta(), track.pt(), evenv1Dev); if (pos) { - registry.fill(HIST("v1_eta_odd_pos"), track.eta(), oddv1); - registry.fill(HIST("v1_eta_even_pos"), track.eta(), evenv1); + registry.fill(HIST("v1_eta_odd_pos"), track.eta(), track.pt(), oddv1); + registry.fill(HIST("v1_eta_even_pos"), track.eta(), track.pt(), evenv1); - registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), evenv1Dev); + registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), track.pt(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), track.pt(), evenv1Dev); } else { - registry.fill(HIST("v1_eta_odd_neg"), track.eta(), oddv1); - registry.fill(HIST("v1_eta_even_neg"), track.eta(), evenv1); + registry.fill(HIST("v1_eta_odd_neg"), track.eta(), track.pt(), oddv1); + registry.fill(HIST("v1_eta_even_neg"), track.eta(), track.pt(), evenv1); - registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), evenv1Dev); + registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), track.pt(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), track.pt(), evenv1Dev); } double v2A = std::cos(2 * (phi - psiA)); double v2C = std::cos(2 * (phi - psiC)); double v2AC = std::cos(2 * (phi - (psiA - psiC))); - registry.fill(HIST("v2_cent"), centrality, (1. / std::sqrt(2)) * (v2A - v2C)); - registry.fill(HIST("v2A_cent"), centrality, (v2A)); - registry.fill(HIST("v2C_cent"), centrality, (v2C)); - registry.fill(HIST("v2AC_cent"), centrality, (v2AC)); + registry.fill(HIST("v2_cent"), centrality, track.pt(), (1. / std::sqrt(2)) * (v2A - v2C)); + registry.fill(HIST("v2A_cent"), centrality, track.pt(), (v2A)); + registry.fill(HIST("v2C_cent"), centrality, track.pt(), (v2C)); + registry.fill(HIST("v2AC_cent"), centrality, track.pt(), (v2AC)); } float qIm = collision.qvecIm()[0]; From 34c968adaa34faee9ffb6cb3d90e8ecde8135ccf Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Sat, 7 Dec 2024 13:03:04 +0100 Subject: [PATCH 73/91] [PWGLF] fill also zero in gen histogram (#8854) --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 7763d1d3e3b..7fc0ca8e941 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -502,7 +502,7 @@ struct EbyeMult { } } } - if (partInAcc > 0) + if (partInAcc >= 0) return nParticles; return -1; } @@ -569,7 +569,7 @@ struct EbyeMult { // search generated INEL > 0 (one charged particle in |eta| < 1) for (const auto& mcCollision : mcCollisions) { int mult = genMultINELgtZERO(mcCollision, mcParticles); - if (mult > 0) { + if (mult >= 0) { histos.fill(HIST("GenINELgtZERO"), mult); } } From 442ad4b4e611d91f7ae779f43b3e1bc5ab48968b Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:01:52 +0100 Subject: [PATCH 74/91] [PWGCF] FemtoUniverse -- Add minus-plus combination to track-nucleus task. (#8834) --- .../femtoUniversePairTaskTrackNucleus.cxx | 386 +++++++++--------- 1 file changed, 194 insertions(+), 192 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index 4906ec103c0..b9bbf923c88 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -27,7 +27,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" @@ -68,7 +67,7 @@ struct femtoUniversePairTaskTrackNucleus { Configurable IsKaonNsigma{"IsKaonNsigma", false, "Enable a strict cut selection for K+ and K-"}; Configurable ConfNsigmaCombined{"ConfNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > ConfTOFpMin"}; Configurable ConfNsigmaTPC{"ConfNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < ConfTOFpMin"}; - Configurable ConfTOFpMin{"ConfTOFpMin", 0.5f, "Min. momentum for which TOF is required for PID."}; + Configurable ConfTOFpMin{"ConfTOFpMin", 0.45f, "Min. momentum for which TOF is required for PID."}; Configurable ConfEtaMax{"ConfEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; @@ -82,7 +81,7 @@ struct femtoUniversePairTaskTrackNucleus { struct : o2::framework::ConfigurableGroup { Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; - Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; + Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 1.0f, "Min. momentum for deuterons for which TOF is required for PID"}; Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; } deuteronconfigs; @@ -93,7 +92,7 @@ struct femtoUniversePairTaskTrackNucleus { Configurable LinCutpLow{"LinCutpLow", 0.0f, "Lower limit of momentum for linear cut of TPC Deuteron Sigma"}; Configurable LinCutpHigh{"LinCutpHigh", 1.4f, "Higher limit of momentum for linear cut of TPC Deuteron Sigma"}; Configurable LinCutParA{"LinCutParA", -167.0f, "Parameter 'A' of a linear function 'y = A * x + B'"}; - Configurable LinCutParB{"B", 300.0f, "Parameter 'B' of a linear function 'y = A * x + B'"}; + Configurable LinCutParB{"LinCutParB", 300.0f, "Parameter 'B' of a linear function 'y = A * x + B'"}; } lincut; /// Table for polynomial 3 cut for TPC Deuteron Sigma @@ -126,9 +125,9 @@ struct femtoUniversePairTaskTrackNucleus { } trackfilter; /// Partition for track - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + Partition partTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; - Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + Partition> partTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; /// Histogramming for track FemtoUniverseParticleHisto trackHistoTrack; @@ -144,9 +143,9 @@ struct femtoUniversePairTaskTrackNucleus { } nucleusfilter; /// Partition for nucleus - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + Partition partNucleus = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; - Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + Partition> partNucleusMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; /// Histogramming for nucleus FemtoUniverseParticleHisto trackHistoNucleus; @@ -195,56 +194,66 @@ struct femtoUniversePairTaskTrackNucleus { Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; - Configurable IsPairIdentical{"IsPairIdentical", true, "'true' for identical particles, 'false' for non-identical particles"}; - Configurable cfgProcessPM{"cfgProcessPM", true, "Process differently charged particles (plus-minus)"}; Configurable cfgProcessPP{"cfgProcessPP", true, "Process positively charged particles (plus-plus)"}; Configurable cfgProcessMM{"cfgProcessMM", true, "Process negatively charged particles (minus-minus)"}; + Configurable cfgProcessPM{"cfgProcessPM", false, "Process differently charged particles (plus-minus)"}; + Configurable cfgProcessMP{"cfgProcessMP", false, "Process differently charged particles (minus-plus)"}; Configurable cfgProcessMultBins{"cfgProcessMultBins", true, "Process kstar histograms (in multiplicity bins)"}; Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if 'cfgProcessMultBins' is false, it will not be processed regardless of 'cfgProcessKtBins' state)"}; Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and MultBins"}; - FemtoUniverseFemtoContainer sameEventCont; - FemtoUniverseFemtoContainer mixedEventCont; - FemtoUniverseFemtoContainer sameEventContPP; FemtoUniverseFemtoContainer mixedEventContPP; FemtoUniverseFemtoContainer sameEventContMM; FemtoUniverseFemtoContainer mixedEventContMM; + FemtoUniverseFemtoContainer sameEventContPM; + FemtoUniverseFemtoContainer mixedEventContPM; + + FemtoUniverseFemtoContainer sameEventContMP; + FemtoUniverseFemtoContainer mixedEventContMP; + FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairWithCentMultKt sameEventMultCont; - PairWithCentMultKt mixedEventMultCont; - PairWithCentMultKt sameEventMultContPP; PairWithCentMultKt mixedEventMultContPP; PairWithCentMultKt sameEventMultContMM; PairWithCentMultKt mixedEventMultContMM; + PairWithCentMultKt sameEventMultContPM; + PairWithCentMultKt mixedEventMultContPM; + + PairWithCentMultKt sameEventMultContMP; + PairWithCentMultKt mixedEventMultContMP; + float mass1 = -1; float mass2 = -1; /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry resultRegistryPM{"CorrelationsPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry resultRegistryPP{"CorrelationsPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry resultRegistryMM{"CorrelationsMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryPM{"CorrelationsPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryMP{"CorrelationsMP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry SameMultRegistryPM{"SameMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry MixedMultRegistryPM{"MixedMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry SameMultRegistryPP{"SameMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MixedMultRegistryPP{"MixedMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry SameMultRegistryMM{"SameMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MixedMultRegistryMM{"MixedMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry SameMultRegistryPM{"SameMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryPM{"MixedMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry SameMultRegistryMP{"SameMultRegistryMP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryMP{"MixedMultRegistryMP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry sphericityRegistry{"SphericityHisto", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; /// TPC Pion/Kaon/Proton Sigma selection (general) @@ -408,19 +417,6 @@ struct femtoUniversePairTaskTrackNucleus { mass1 = pdg->Mass(trackfilter.ConfPDGCodeTrack); mass2 = pdg->Mass(nucleusfilter.ConfPDGCodeNucleus); - if (cfgProcessPM) { - sameEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); - mixedEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); - - sameEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); - mixedEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); - - if (cfgProcessMultBins) { - sameEventMultCont.init(&SameMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); - mixedEventMultCont.init(&MixedMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); - } - } - if (cfgProcessPP) { sameEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); mixedEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); @@ -445,6 +441,32 @@ struct femtoUniversePairTaskTrackNucleus { } } + if (cfgProcessPM) { + sameEventContPM.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContPM.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + + sameEventContPM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContPM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContPM.init(&SameMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContPM.init(&MixedMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + if (cfgProcessMP) { + sameEventContMP.init(&resultRegistryMP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContMP.init(&resultRegistryMP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + + sameEventContMP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContMP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContMP.init(&SameMultRegistryMP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContMP.init(&MixedMultRegistryMP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + pairCleaner.init(&qaRegistry); if (ConfIsCPR.value) { pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); @@ -472,132 +494,98 @@ struct femtoUniversePairTaskTrackNucleus { /// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision - /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) + /// \param pairType describes charge of correlation pair (plus-plus (1), minus-minus (2), plus-minus (3), minus-plus (4)) /// \param fillQA enables filling of QA histograms template void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool fillQA) { - /// Histogramming SameEvent - if ((pairType == 1 || pairType == 2) && fillQA) { - for (auto& part : groupTrack) { - if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { - continue; - } - trackHistoTrack.fillQA(part); + for (auto& part : groupTrack) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; } + trackHistoTrack.fillQA(part); } - if ((pairType == 1 || pairType == 3) && fillQA) { - for (auto& part : groupNucleus) { - if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { - continue; - } - trackHistoNucleus.fillQA(part); + for (auto& part : groupNucleus) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; } + trackHistoNucleus.fillQA(part); } - if (pairType == 1) { - /// Combinations for non-identical pairs - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { + /// Combinations for identical pairs + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupTrack))) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { - continue; - } - - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { - continue; - } + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { - continue; - } - } + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } - // Cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } + } - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - - sameEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - - if (cfgProcessMultBins) - sameEventMultCont.fill(kstar, multCol, kT); + // Cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; } - } else { - /// Combinations for identical pairs - for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupTrack, groupTrack))) { - if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { - continue; - } + switch (pairType) { + case 1: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { - continue; - } + sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { - continue; - } - } + if (cfgProcessMultBins) + sameEventMultContPP.fill(kstar, multCol, kT); - // Cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { - continue; + break; } - switch (pairType) { - case 2: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); - - sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + case 2: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - if (cfgProcessMultBins) - sameEventMultContPP.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + if (cfgProcessMultBins) + sameEventMultContMM.fill(kstar, multCol, kT); - if (cfgProcessMultBins) - sameEventMultContPP.fill(kstar, multCol, kT); - } + break; + } - break; - } + case 3: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - case 3: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + sameEventContPM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + if (cfgProcessMultBins) + sameEventMultContPM.fill(kstar, multCol, kT); - if (cfgProcessMultBins) - sameEventMultContMM.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + break; + } - sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + case 4: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - if (cfgProcessMultBins) - sameEventMultContMM.fill(kstar, multCol, kT); - } + sameEventContMP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - break; - } + if (cfgProcessMultBins) + sameEventMultContMP.fill(kstar, multCol, kT); - default: - break; + break; } + + default: + break; } } } @@ -611,21 +599,26 @@ struct femtoUniversePairTaskTrackNucleus { fillCollision(col); sphericityRegistry.fill(HIST("sphericity"), col.sphericity()); - auto thegroupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); bool fillQA = true; - if (cfgProcessPM) { + if (cfgProcessPP) doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); fillQA = false; } - if (cfgProcessPP) - doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); - - if (cfgProcessMM) - doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + if (cfgProcessMP) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 4, fillQA); + fillQA = false; + } } PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEvent, "Enable processing same event", true); @@ -639,21 +632,26 @@ struct femtoUniversePairTaskTrackNucleus { { fillCollision(col); - auto thegroupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupTrack = partTrackMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partNucleusMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); bool fillQA = true; - if (cfgProcessPM) { + if (cfgProcessPP) doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); fillQA = false; } - if (cfgProcessPP) - doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); - - if (cfgProcessMM) - doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + if (cfgProcessMP) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 4, fillQA); + fillQA = false; + } } PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEventMC, "Enable processing same event for Monte Carlo", false); @@ -692,54 +690,46 @@ struct femtoUniversePairTaskTrackNucleus { float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - mixedEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); if (cfgProcessMultBins) - mixedEventMultCont.fill(kstar, multCol, kT); + mixedEventMultContPP.fill(kstar, multCol, kT); break; } case 2: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); - - mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - - if (cfgProcessMultBins) - mixedEventMultContPP.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - if (cfgProcessMultBins) - mixedEventMultContPP.fill(kstar, multCol, kT); - } + if (cfgProcessMultBins) + mixedEventMultContMM.fill(kstar, multCol, kT); break; } case 3: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + mixedEventContPM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - if (cfgProcessMultBins) - mixedEventMultContMM.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + if (cfgProcessMultBins) + mixedEventMultContPM.fill(kstar, multCol, kT); - mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + break; + } - if (cfgProcessMultBins) - mixedEventMultContMM.fill(kstar, multCol, kT); - } + case 4: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventContMP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContMP.fill(kstar, multCol, kT); break; } @@ -768,23 +758,29 @@ struct femtoUniversePairTaskTrackNucleus { continue; } - if (cfgProcessPM) { - auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + if (cfgProcessPP) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); } - if (cfgProcessPP) { - auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + if (cfgProcessMM) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); } - if (cfgProcessMM) { - auto groupTrack = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + if (cfgProcessPM) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); } + + if (cfgProcessMP) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 4); + } } } PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processMixedEvent, "Enable processing mixed events", true); @@ -809,24 +805,30 @@ struct femtoUniversePairTaskTrackNucleus { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsOne.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTwo.size() == 0 ) continue; - - if (cfgProcessPM) { - auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); - } + // if partTrack.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partNucleus.size() == 0 ) continue; if (cfgProcessPP) { - auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); } if (cfgProcessMM) { - auto groupTrack = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + } + + if (cfgProcessPM) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + } + + if (cfgProcessMP) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 4); } } } From a81730de940a19155d60c001a8cc6e7638827315 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Sat, 7 Dec 2024 15:59:44 +0100 Subject: [PATCH 75/91] [PWGLF] Update collision selection for Run2 converted data (#8836) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Resonances/CMakeLists.txt | 4 +- ...itializer.cxx => resonanceInitializer.cxx} | 356 +++++++++--------- PWGLF/Utils/collisionCuts.h | 90 +++-- 3 files changed, 238 insertions(+), 212 deletions(-) rename PWGLF/TableProducer/Resonances/{LFResonanceInitializer.cxx => resonanceInitializer.cxx} (80%) diff --git a/PWGLF/TableProducer/Resonances/CMakeLists.txt b/PWGLF/TableProducer/Resonances/CMakeLists.txt index b8a16e14c53..d6ca37b8d0c 100644 --- a/PWGLF/TableProducer/Resonances/CMakeLists.txt +++ b/PWGLF/TableProducer/Resonances/CMakeLists.txt @@ -25,8 +25,8 @@ o2physics_add_dpl_workflow(filterf1proton PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(reso2initializer - SOURCES LFResonanceInitializer.cxx +o2physics_add_dpl_workflow(resonance-initializer + SOURCES resonanceInitializer.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) diff --git a/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx similarity index 80% rename from PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx rename to PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 23876a82286..8a76e68ddef 100644 --- a/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -8,19 +8,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -/// \file LFResonanceInitializer.cxx -/// \brief Initializes variables for the resonance candidate producers -/// /// +/// \file resonanceInitializer.cxx +/// \brief Initializes variables for the resonance candidate producers /// \author Bong-Hwi Lim +/// #include #include #include "Common/DataModel/PIDResponse.h" #include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" -// #include "Common/DataModel/Multiplicity.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" @@ -40,19 +38,22 @@ #include "DataFormatsParameters/GRPObject.h" #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "CommonConstants/MathConstants.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; +using namespace o2::constants::physics; +using namespace o2::constants::math; /// Initializer for the resonance candidate producers -struct reso2initializer { +struct ResonanceInitializer { SliceCache cache; - float cXiMass; int mRunNumber; int multEstimator; - float d_bz; + float dBz; Service ccdb; Service pdg; @@ -67,7 +68,7 @@ struct reso2initializer { Produces reso2mccascades; // CCDB options - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbURL{"ccdbURL", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; @@ -76,9 +77,9 @@ struct reso2initializer { Configurable cfgFatalWhenNull{"cfgFatalWhenNull", true, "Fatal when null on ccdb access"}; // Configurables - Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; - Configurable ConfFillQA{"ConfFillQA", false, "Fill QA histograms"}; - Configurable ConfBypassCCDB{"ConfBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value. + Configurable dBzInput{"dBzInput", -999, "bz field, -999 is automatic"}; + Configurable cfgFillQA{"cfgFillQA", false, "Fill QA histograms"}; + Configurable cfgBypassCCDB{"cfgBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value. // Track filter from tpcSkimsTableCreator Configurable trackSelection{"trackSelection", 0, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; @@ -90,22 +91,22 @@ struct reso2initializer { /// Event cuts o2::analysis::CollisonCuts colCuts; - Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable ConfEvtOccupancyInTimeRange{"ConfEvtOccupancyInTimeRange", -1, "Evt sel: maximum track occupancy"}; - Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", false, "Evt sel: check for trigger"}; - Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", 8, "Evt sel: trigger"}; - Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", true, "Evt sel: check for offline selection"}; - Configurable ConfEvtTriggerTVXSel{"ConfEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; - Configurable ConfEvtTFBorderCut{"ConfEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; - Configurable ConfEvtUseITSTPCvertex{"ConfEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; - Configurable ConfEvtZvertexTimedifference{"ConfEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; - Configurable ConfEvtPileupRejection{"ConfEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; - Configurable ConfEvtNoITSROBorderCut{"ConfEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable cfgEvtOccupancyInTimeRange{"cfgEvtOccupancyInTimeRange", -1, "Evt sel: maximum track occupancy"}; + Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable cfgEvtTriggerSel{"cfgEvtTriggerSel", 8, "Evt sel: trigger"}; + Configurable cfgEvtOfflineCheck{"cfgEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable cfgEvtUseITSTPCvertex{"cfgEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; + Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; + Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; Configurable cfgMultName{"cfgMultName", "FT0M", "The name of multiplicity estimator"}; // Qvector configuration - Configurable ConfBypassQvec{"ConfBypassQvec", true, "Bypass for qvector task"}; + Configurable cfgBypassQvec{"cfgBypassQvec", true, "Bypass for qvector task"}; Configurable cfgEvtPl{"cfgEvtPl", 40500, "Configuration of three subsystems for the event plane and its resolution, 10000*RefA + 100*RefB + S, where FT0C:0, FT0A:1, FT0M:2, FV0A:3, BPos:5, BNeg:6"}; // Pre-selection cuts @@ -127,7 +128,7 @@ struct reso2initializer { Configurable cMinV0CosPA{"cMinV0CosPA", 0.995, "Minimum V0 CosPA to PV"}; /// DCA Selections for Cascades - Configurable mincrossedrows_cascbach{"mincrossedrows_cascbach", 70, "min crossed rows for bachelor track from cascade"}; + Configurable cfgMinCrossedRowsCascBach{"cfgMinCrossedRowsCascBach", 70, "min crossed rows for bachelor track from cascade"}; Configurable cMinCascBachDCArToPVcut{"cMinCascBachDCArToPVcut", 0.05f, "Cascade Bachelor Track DCAr cut to PV Minimum"}; // Pre-selection Configurable cMaxCascBachDCArToPVcut{"cMaxCascBachDCArToPVcut", 999.0f, "Cascade Bachelor Track DCAr cut to PV Maximum"}; // Pre-selection Configurable cMaxCascDCAV0Daughters{"cMaxCascDCAV0Daughters", 1.6, "Cascade DCA between V0 daughters Maximum"}; @@ -155,9 +156,9 @@ struct reso2initializer { EventPlaneHelper helperEP; - int EvtPlRefAId = static_cast(cfgEvtPl / 10000); - int EvtPlRefBId = static_cast((cfgEvtPl - EvtPlRefAId * 10000) / 100); - int EvtPlDetId = cfgEvtPl - EvtPlRefAId * 10000 - EvtPlRefBId * 100; + int evtPlRefAId = static_cast(cfgEvtPl / 10000); + int evtPlRefBId = static_cast((cfgEvtPl - evtPlRefAId * 10000) / 100); + int evtPlDetId = cfgEvtPl - evtPlRefAId * 10000 - evtPlRefBId * 100; // MC Resonance parent filter Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == 313) // K* @@ -189,40 +190,41 @@ struct reso2initializer { using ResoV0sMC = soa::Join; using ResoCascades = aod::CascDatas; using ResoCascadesMC = soa::Join; + using BCsWithRun2Info = soa::Join; template - bool IsTrackSelected(CollisionType const&, TrackType const& track) + bool isTrackSelected(CollisionType const&, TrackType const& track) { // Track selection - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 0.5); // MC case can be handled here if constexpr (isMC) { // MC check - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodMCTrackIndices"), 0.5); } // DCAxy cut - if (fabs(track.dcaXY()) > cMaxDCArToPVcut) + if (std::fabs(track.dcaXY()) > cMaxDCArToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 1.5); // DCAz cut - if (fabs(track.dcaZ()) > cMaxDCAzToPVcut || fabs(track.dcaZ()) < cMinDCAzToPVcut) + if (std::fabs(track.dcaZ()) > cMaxDCAzToPVcut || std::fabs(track.dcaZ()) < cMinDCAzToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 2.5); - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 7.5); return true; } template - bool IsV0Selected(CollisionType const&, V0Type const& v0, TrackType const&) + bool isV0Selected(CollisionType const&, V0Type const& v0, TrackType const&) { // V0 selection - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 0.5); auto postrack = v0.template posTrack_as(); @@ -232,39 +234,39 @@ struct reso2initializer { return false; if (negtrack.tpcNClsCrossedRows() < mincrossedrows) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 1.5); - if (fabs(postrack.dcaXY()) < cMinV0PosDCArToPVcut) + if (std::fabs(postrack.dcaXY()) < cMinV0PosDCArToPVcut) return false; - if (fabs(negtrack.dcaXY()) < cMinV0NegDCArToPVcut) + if (std::fabs(negtrack.dcaXY()) < cMinV0NegDCArToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 2.5); if ((v0.v0radius() > cMaxV0Radius) || (v0.v0radius() < cMinV0Radius)) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 3.5); if (v0.v0cosPA() < cMinV0CosPA) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 4.5); // MC case can be handled here if constexpr (isMC) { // MC check - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodMCV0Indices"), 0.5); } return true; } template - bool IsCascSelected(CollisionType const& collision, CascType const& casc, TrackType const&) + bool isCascSelected(CollisionType const& collision, CascType const& casc, TrackType const&) { // V0 selection - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 0.5); auto trackBach = casc.template bachelor_as(); @@ -272,16 +274,16 @@ struct reso2initializer { // auto trackNeg = casc.template negTrack_as(); // track cuts - if (trackBach.tpcNClsCrossedRows() < mincrossedrows_cascbach) + if (trackBach.tpcNClsCrossedRows() < cfgMinCrossedRowsCascBach) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 1.5); - if (fabs(trackBach.dcaXY()) < cMinCascBachDCArToPVcut) + if (std::fabs(trackBach.dcaXY()) < cMinCascBachDCArToPVcut) return false; - if (fabs(trackBach.dcaXY()) > cMaxCascBachDCArToPVcut) + if (std::fabs(trackBach.dcaXY()) > cMaxCascBachDCArToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 2.5); // DCA daugthers @@ -289,7 +291,7 @@ struct reso2initializer { return false; if (casc.dcacascdaughters() > cMaxCascDCACascDaughters) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 3.5); // CPA cuts @@ -297,34 +299,34 @@ struct reso2initializer { return false; if (casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cMinCascV0CosPA) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 4.5); // V0 radius auto v0radius = casc.v0radius(); if ((v0radius > cMaxCascV0Radius) || (v0radius < cMinCascV0Radius)) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 5.5); // Casc radius auto cascradius = casc.cascradius(); if ((cascradius > cMaxCascRadius) || (cascradius < cMinCascRadius)) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 6.5); // Casc mass auto cascMass = casc.mXi(); - if (abs(cascMass - cXiMass) > cCascMassResol) + if (std::abs(cascMass - MassXiMinus) > cCascMassResol) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 7.5); // MC case can be handled here if constexpr (isMC) { // MC check - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodMCCascIndices"), 0.5); } return true; @@ -332,9 +334,9 @@ struct reso2initializer { // Check if the collision is INEL>0 template - bool IsTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts) + bool isTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts) { - for (auto& mcparticle : mcparts) { + for (auto const& mcparticle : mcparts) { if (!mcparticle.isPhysicalPrimary()) continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); @@ -350,7 +352,7 @@ struct reso2initializer { // Centralicity estimator selection template - float CentEst(ResoColl ResoEvents) + float centEst(ResoColl ResoEvents) { float returnValue = -999.0; switch (multEstimator) { @@ -380,7 +382,7 @@ struct reso2initializer { /// \param tracks All tracks /// \return value of the spherocity of the event template - float ComputeSpherocity(T const& tracks, int nTracksMin, int spdef) + float computeSpherocity(T const& tracks, int nTracksMin, int spdef) { // if number of tracks is not enough for spherocity estimation. int ntrks = tracks.size(); @@ -391,7 +393,7 @@ struct reso2initializer { float ptSum = 0.; for (auto const& track : tracks) { - if (ConfFillQA) { + if (cfgFillQA) { qaRegistry.fill(HIST("Phi"), track.phi()); } if (spdef == 0) { @@ -404,39 +406,39 @@ struct reso2initializer { float tempSph = 1.; for (int i = 0; i < 360 / 0.1; ++i) { float sum = 0., pt = 0.; - float phiparm = (TMath::Pi() * i * 0.1) / 180.; - float nx = TMath::Cos(phiparm); - float ny = TMath::Sin(phiparm); + float phiparm = (PI * i * 0.1) / 180.; + float nx = std::cos(phiparm); + float ny = std::sin(phiparm); for (auto const& trk : tracks) { pt = trk.pt(); if (spdef == 0) { pt = 1.; } float phi = trk.phi(); - float px = pt * TMath::Cos(phi); - float py = pt * TMath::Sin(phi); + float px = pt * std::cos(phi); + float py = pt * std::sin(phi); // sum += pt * abs(sin(phiparm - phi)); - sum += TMath::Abs(px * ny - py * nx); + sum += std::abs(px * ny - py * nx); } - float sph = TMath::Power((sum / ptSum), 2); + float sph = std::pow((sum / ptSum), 2); if (sph < tempSph) tempSph = sph; } - return TMath::Power(TMath::Pi() / 2., 2) * tempSph; + return std::pow(PIHalf, 2) * tempSph; } template - float GetEvtPl(ResoColl ResoEvents) + float getEvtPl(ResoColl ResoEvents) { float returnValue = -999.0; - if (ResoEvents.qvecAmp()[EvtPlDetId] > 1e-8) - returnValue = helperEP.GetEventPlane(ResoEvents.qvecRe()[EvtPlDetId * 4 + 3], ResoEvents.qvecIm()[EvtPlDetId * 4 + 3], 2); + if (ResoEvents.qvecAmp()[evtPlDetId] > 1e-8) + returnValue = helperEP.GetEventPlane(ResoEvents.qvecRe()[evtPlDetId * 4 + 3], ResoEvents.qvecIm()[evtPlDetId * 4 + 3], 2); return returnValue; } template - float GetEvtPlRes(ResoColl ResoEvents, int a, int b) + float getEvtPlRes(ResoColl ResoEvents, int a, int b) { float returnValue = -999.0; if (ResoEvents.qvecAmp()[a] < 1e-8 || ResoEvents.qvecAmp()[b] < 1e-8) @@ -450,8 +452,8 @@ struct reso2initializer { void fillTracks(CollisionType const& collision, TrackType const& tracks) { // Loop over tracks - for (auto& track : tracks) { - if (!IsTrackSelected(collision, track)) + for (auto const& track : tracks) { + if (!isTrackSelected(collision, track)) continue; reso2trks(resoCollisions.lastIndex(), track.pt(), @@ -500,8 +502,8 @@ struct reso2initializer { void fillV0s(CollisionType const& collision, V0Type const& v0s, TrackType const& tracks) { int childIDs[2] = {0, 0}; // these IDs are necessary to keep track of the children - for (auto& v0 : v0s) { - if (!IsV0Selected(collision, v0, tracks)) + for (auto const& v0 : v0s) { + if (!isV0Selected(collision, v0, tracks)) continue; childIDs[0] = v0.posTrackId(); childIDs[1] = v0.negTrackId(); @@ -545,8 +547,8 @@ struct reso2initializer { void fillCascades(CollisionType const& collision, CascType const& cascades, TrackType const& tracks) { int childIDs[3] = {0, 0, 0}; // these IDs are necessary to keep track of the children - for (auto& casc : cascades) { - if (!IsCascSelected(collision, casc, tracks)) + for (auto const& casc : cascades) { + if (!isCascSelected(collision, casc, tracks)) continue; childIDs[0] = casc.posTrackId(); childIDs[1] = casc.negTrackId(); @@ -602,7 +604,7 @@ struct reso2initializer { // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); lMothersIndeces.push_back(lMother.globalIndex()); } @@ -610,7 +612,7 @@ struct reso2initializer { }; auto getMothersPDGCodes = [&](auto const& theMcParticle) { std::vector lMothersPDGs{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); lMothersPDGs.push_back(lMother.pdgCode()); } @@ -618,9 +620,9 @@ struct reso2initializer { }; auto getSiblingsIndeces = [&](auto const& theMcParticle) { std::vector lSiblingsIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); - for (auto& lDaughter : lMother.template daughters_as()) { + for (auto const& lDaughter : lMother.template daughters_as()) { LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); if (lDaughter.globalIndex() != 0 && lDaughter.globalIndex() != theMcParticle.globalIndex()) { lSiblingsIndeces.push_back(lDaughter.globalIndex()); @@ -633,7 +635,7 @@ struct reso2initializer { std::vector mothers = {-1, -1}; std::vector motherPDGs = {-1, -1}; int siblings[2] = {0, 0}; - std::vector siblings_temp = {-1, -1}; + std::vector siblingsTemp = {-1, -1}; if (track.has_mcParticle()) { // // Get the MC particle @@ -641,16 +643,16 @@ struct reso2initializer { if (particle.has_mothers()) { mothers = getMothersIndeces(particle); motherPDGs = getMothersPDGCodes(particle); - siblings_temp = getSiblingsIndeces(particle); + siblingsTemp = getSiblingsIndeces(particle); } while (mothers.size() > 2) { mothers.pop_back(); motherPDGs.pop_back(); } - if (siblings_temp.size() > 0) - siblings[0] = siblings_temp[0]; - if (siblings_temp.size() > 1) - siblings[1] = siblings_temp[1]; + if (siblingsTemp.size() > 0) + siblings[0] = siblingsTemp[0]; + if (siblingsTemp.size() > 1) + siblings[1] = siblingsTemp[1]; reso2mctracks(particle.pdgCode(), mothers[0], motherPDGs[0], @@ -674,7 +676,7 @@ struct reso2initializer { // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); lMothersIndeces.push_back(lMother.globalIndex()); } @@ -682,7 +684,7 @@ struct reso2initializer { }; auto getMothersPDGCodes = [&](auto const& theMcParticle) { std::vector lMothersPDGs{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); lMothersPDGs.push_back(lMother.pdgCode()); } @@ -690,7 +692,7 @@ struct reso2initializer { }; auto getDaughtersIndeces = [&](auto const& theMcParticle) { std::vector lDaughtersIndeces{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); if (lDaughter.globalIndex() != 0) { lDaughtersIndeces.push_back(lDaughter.globalIndex()); @@ -700,7 +702,7 @@ struct reso2initializer { }; auto getDaughtersPDGCodes = [&](auto const& theMcParticle) { std::vector lDaughtersPDGs{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter pdgcode lDaughter: %d", lDaughter.pdgCode()); if (lDaughter.globalIndex() != 0) { lDaughtersPDGs.push_back(lDaughter.pdgCode()); @@ -760,7 +762,7 @@ struct reso2initializer { // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); lMothersIndeces.push_back(lMother.globalIndex()); } @@ -768,7 +770,7 @@ struct reso2initializer { }; auto getMothersPDGCodes = [&](auto const& theMcParticle) { std::vector lMothersPDGs{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); lMothersPDGs.push_back(lMother.pdgCode()); } @@ -776,7 +778,7 @@ struct reso2initializer { }; auto getDaughtersIndeces = [&](auto const& theMcParticle) { std::vector lDaughtersIndeces{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); if (lDaughter.globalIndex() != 0) { lDaughtersIndeces.push_back(lDaughter.globalIndex()); @@ -786,7 +788,7 @@ struct reso2initializer { }; auto getDaughtersPDGCodes = [&](auto const& theMcParticle) { std::vector lDaughtersPDGs{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter pdgcode lDaughter: %d", lDaughter.pdgCode()); if (lDaughter.globalIndex() != 0) { lDaughtersPDGs.push_back(lDaughter.pdgCode()); @@ -843,7 +845,7 @@ struct reso2initializer { template void fillMCParticles(SelectedMCPartType const& mcParts, TotalMCParts const& mcParticles) { - for (auto& mcPart : mcParts) { + for (auto const& mcPart : mcParts) { std::vector daughterPDGs; if (mcPart.has_daughters()) { auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset()); @@ -876,11 +878,11 @@ struct reso2initializer { { auto centrality = 0.0; if constexpr (!isRun2) - centrality = CentEst(mccol); + centrality = centEst(mccol); else centrality = mccol.centRun2V0M(); - bool inVtx10 = (abs(mccol.mcCollision().posZ()) > 10.) ? false : true; - bool isTrueINELgt0 = IsTrueINEL0(mccol, mcparts); + bool inVtx10 = (std::abs(mccol.mcCollision().posZ()) > 10.) ? false : true; + bool isTrueINELgt0 = isTrueINEL0(mccol, mcparts); bool isTriggerTVX = mccol.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = mccol.sel8(); bool isSelected = colCuts.isSelected(mccol); @@ -928,9 +930,8 @@ struct reso2initializer { void init(InitContext&) { - cXiMass = pdg->GetParticle(3312)->Mass(); mRunNumber = 0; - d_bz = 0; + dBz = 0; // Multiplicity estimator selection (0: FT0M, 1: FT0C, 2: FT0A, 99: FV0A) if (cfgMultName.value == "FT0M") { multEstimator = 0; @@ -956,19 +957,19 @@ struct reso2initializer { // Case selector based on the process. if (doprocessTrackDataRun2 || doprocessTrackV0DataRun2 || doprocessTrackV0CascDataRun2 || doprocessTrackMCRun2 || doprocessTrackV0MCRun2 || doprocessTrackV0CascMCRun2) { - colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, false); + colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtTriggerSel, cfgEvtOfflineCheck, false); } else if (doprocessTrackData || doprocessTrackV0Data || doprocessTrackV0CascData || doprocessTrackMC || doprocessTrackV0MC || doprocessTrackV0CascMC || doprocessTrackEPData) { - colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, true, false, ConfEvtOccupancyInTimeRange); + colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtTriggerSel, cfgEvtOfflineCheck, true, false, cfgEvtOccupancyInTimeRange); } colCuts.init(&qaRegistry); - colCuts.setTriggerTVX(ConfEvtTriggerTVXSel); - colCuts.setApplyTFBorderCut(ConfEvtTFBorderCut); - colCuts.setApplyITSTPCvertex(ConfEvtUseITSTPCvertex); - colCuts.setApplyZvertexTimedifference(ConfEvtZvertexTimedifference); - colCuts.setApplyPileupRejection(ConfEvtPileupRejection); - colCuts.setApplyNoITSROBorderCut(ConfEvtNoITSROBorderCut); - if (!ConfBypassCCDB) { - ccdb->setURL(ccdburl.value); + colCuts.setTriggerTVX(cfgEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(cfgEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(cfgEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(cfgEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(cfgEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(cfgEvtNoITSROBorderCut); + if (!cfgBypassCCDB) { + ccdb->setURL(ccdbURL.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(cfgFatalWhenNull); @@ -983,7 +984,7 @@ struct reso2initializer { qaRegistry.add("Event/hMCEventIndices", "hMCEventIndices", kTH2D, {centAxis, idxMCAxis}); } AxisSpec idxAxis = {8, 0, 8, "Index"}; - if (ConfFillQA) { + if (cfgFillQA) { qaRegistry.add("hGoodTrackIndices", "hGoodTrackIndices", kTH1F, {idxAxis}); qaRegistry.add("hGoodMCTrackIndices", "hGoodMCTrackIndices", kTH1F, {idxAxis}); qaRegistry.add("hGoodV0Indices", "hGoodV0Indices", kTH1F, {idxAxis}); @@ -996,48 +997,53 @@ struct reso2initializer { void initCCDB(aod::BCsWithTimestamps::iterator const& bc) // Simple copy from LambdaKzeroFinder.cxx { - if (ConfBypassCCDB) + if (cfgBypassCCDB) return; if (mRunNumber == bc.runNumber()) { return; } // In case override, don't proceed, please - no CCDB access required - if (d_bz_input > -990) { - d_bz = d_bz_input; + if (dBzInput > -990) { + dBz = dBzInput; ; o2::parameters::GRPMagField grpmag; - if (fabs(d_bz) > 1e-5) { - grpmag.setL3Current(30000.f / (d_bz / 5.0f)); + if (std::fabs(dBz) > 1e-5) { + grpmag.setL3Current(30000.f / (dBz / 5.0f)); } o2::base::Propagator::initFieldFromGRP(&grpmag); mRunNumber = bc.runNumber(); return; } - auto run3grp_timestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); + auto run3GRPTimestamp = bc.timestamp(); + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3GRPTimestamp); o2::parameters::GRPMagField* grpmag = 0x0; if (grpo) { o2::base::Propagator::initFieldFromGRP(grpo); // Fetch magnetic field from ccdb for current collision - d_bz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + dBz = grpo->getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); + grpmag = ccdb->getForTimeStamp(grpmagPath, run3GRPTimestamp); if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3GRPTimestamp; } o2::base::Propagator::initFieldFromGRP(grpmag); // Fetch magnetic field from ccdb for current collision - d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + dBz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; } mRunNumber = bc.runNumber(); // Set magnetic field value once known - LOGF(info, "Bz set to %f for run: ", d_bz, mRunNumber); + LOGF(info, "Bz set to %f for run: ", dBz, mRunNumber); } + void processDummy(ResoRun2Events const& collisions) + { + } + PROCESS_SWITCH(ResonanceInitializer, processDummy, "Process for dummy", true); + void processTrackData(ResoEvents::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) @@ -1049,28 +1055,27 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackData, "Process for data", true); + PROCESS_SWITCH(ResonanceInitializer, processTrackData, "Process for data", false); void processTrackDataRun2(ResoRun2Events::iterator const& collision, soa::Filtered const& tracks, - aod::BCsWithTimestamps const&) + BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); // Default event selection if (!colCuts.isSelected(collision)) return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackDataRun2, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackDataRun2, "Process for data", false); void processTrackEPData(soa::Join::iterator const& collision, soa::Filtered const& tracks, @@ -1083,11 +1088,11 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), GetEvtPl(collision), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefAId), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefBId), GetEvtPlRes(collision, EvtPlRefAId, EvtPlRefBId), d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackEPData, "Process for data and ep ana", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackEPData, "Process for data and ep ana", false); void processTrackV0Data(ResoEvents::iterator const& collision, soa::Filtered const& tracks, @@ -1101,31 +1106,30 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0Data, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0Data, "Process for data", false); void processTrackV0DataRun2(ResoRun2Events::iterator const& collision, soa::Filtered const& tracks, ResoV0s const& V0s, - aod::BCsWithTimestamps const&) + BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); // Default event selection if (!colCuts.isSelected(collision)) return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0DataRun2, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0DataRun2, "Process for data", false); void processTrackV0CascData(ResoEvents::iterator const& collision, soa::Filtered const& tracks, @@ -1140,34 +1144,33 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascData, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascData, "Process for data", false); void processTrackV0CascDataRun2(ResoRun2Events::iterator const& collision, soa::Filtered const& tracks, ResoV0s const& V0s, ResoCascades const& Cascades, - aod::BCsWithTimestamps const&) + BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); // Default event selection if (!colCuts.isSelected(collision)) return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascDataRun2, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascDataRun2, "Process for data", false); Preslice perMcCollision = aod::mcparticle::mcCollisionId; void processTrackMC(soa::Join::iterator const& collision, @@ -1178,7 +1181,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); auto mccollision = collision.mcCollision_as(); float impactpar = mccollision.impactParameter(); @@ -1191,7 +1194,7 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackMC, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackMC, "Process for MC", false); void processTrackEPMC(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, @@ -1201,7 +1204,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), GetEvtPl(collision), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefAId), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefBId), GetEvtPlRes(collision, EvtPlRefAId, EvtPlRefBId), d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1210,18 +1213,17 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackEPMC, "Process for MC and ep ana", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackEPMC, "Process for MC and ep ana", false); Preslice perMcCollisionRun2 = aod::mcparticle::mcCollisionId; void processTrackMCRun2(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, - aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + aod::McParticles const& mcParticles, BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1231,7 +1233,7 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollisionRun2, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackMCRun2, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackMCRun2, "Process for MC", false); void processTrackV0MC(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, @@ -1242,7 +1244,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1253,18 +1255,17 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0MC, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0MC, "Process for MC", false); void processTrackV0MCRun2(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, ResoV0sMC const& V0s, - aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + aod::McParticles const& mcParticles, BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1275,7 +1276,7 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0MCRun2, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0MCRun2, "Process for MC", false); void processTrackV0CascMC(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, @@ -1287,7 +1288,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1300,19 +1301,18 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascMC, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascMC, "Process for MC", false); void processTrackV0CascMCRun2(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, ResoV0sMC const& V0s, ResoCascadesMC const& Cascades, - aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + aod::McParticles const& mcParticles, BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1325,12 +1325,12 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascMCRun2, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascMCRun2, "Process for MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"lf-reso2initializer"}), + adaptAnalysisTask(cfgc), }; } diff --git a/PWGLF/Utils/collisionCuts.h b/PWGLF/Utils/collisionCuts.h index 8d1e563d427..6322e272083 100644 --- a/PWGLF/Utils/collisionCuts.h +++ b/PWGLF/Utils/collisionCuts.h @@ -24,8 +24,6 @@ #include "Framework/Logger.h" #include "Common/DataModel/EventSelection.h" -using namespace o2::framework; - namespace o2::analysis { @@ -58,7 +56,7 @@ class CollisonCuts /// \param checkTrigger whether or not to check for the trigger alias /// \param trig Requested trigger alias /// \param checkOffline whether or not to check for offline selection criteria - void setCuts(float zvtxMax, bool checkTrigger, int trig, bool checkOffline, bool checkRun3, bool triggerTVXsel = false, int trackOccupancyInTimeRangeMax = -1) + void setCuts(float zvtxMax, bool checkTrigger, int trig, bool checkOffline, bool checkRun3, bool triggerTVXsel = false, int trackOccupancyInTimeRangeMax = -1, int trackOccupancyInTimeRangeMin = -1) { mCutsSet = true; mZvtxMax = zvtxMax; @@ -72,31 +70,33 @@ class CollisonCuts mApplyZvertexTimedifference = false; mApplyPileupRejection = false; mApplyNoITSROBorderCut = false; + mApplyCollInTimeRangeStandard = false; mtrackOccupancyInTimeRangeMax = trackOccupancyInTimeRangeMax; + mtrackOccupancyInTimeRangeMin = trackOccupancyInTimeRangeMin; } /// Initializes histograms for the task /// \param registry Histogram registry to be passed - void init(HistogramRegistry* registry) + void init(o2::framework::HistogramRegistry* registry) { if (!mCutsSet) { LOGF(error, "Event selection not set - quitting!"); } mHistogramRegistry = registry; - mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections - mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections + mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections + mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections if (mCheckIsRun3) { - mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", kTH1F, {{500, 0., 20000.}}); + mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", o2::framework::kTH1F, {{500, 0., 20000.}}); } else { - mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); } - mHistogramRegistry->add("CollCutCounts", "; ; Entries", kTH1F, {{11, 0., 11.}}); + mHistogramRegistry->add("CollCutCounts", "; ; Entries", o2::framework::kTH1F, {{11, 0., 11.}}); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kAllEvent), "all"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagZvertex), "Zvtx"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagTrigerTVX), "IsTriggerTVX"); @@ -113,8 +113,8 @@ class CollisonCuts /// Print some debug information void printCuts() { - LOGF(info, "Debug information for Collison Cuts \n Max. z-vertex: %f \n Check trigger: %d \n Trigger: %d \n Check offline: %d \n Check Run3: %d \n Trigger TVX selection: %d \n Apply time frame border cut: %d \n Apply ITS-TPC vertex: %d \n Apply Z-vertex time difference: %d \n Apply Pileup rejection: %d \n Apply NoITSRO frame border cut: %d \n Track occupancy in time range max: %d", - mZvtxMax, mCheckTrigger, mTrigger, mCheckOffline, mCheckIsRun3, mTriggerTVXselection, mApplyTFBorderCut, mApplyITSTPCvertex, mApplyZvertexTimedifference, mApplyPileupRejection, mApplyNoITSROBorderCut, mtrackOccupancyInTimeRangeMax); + LOGF(info, "Debug information for Collison Cuts \n Max. z-vertex: %f \n Check trigger: %d \n Trigger: %d \n Check offline: %d \n Check Run3: %d \n Trigger TVX selection: %d \n Apply time frame border cut: %d \n Apply ITS-TPC vertex: %d \n Apply Z-vertex time difference: %d \n Apply Pileup rejection: %d \n Apply NoITSRO frame border cut: %d \n Track occupancy in time range max: %d \n Track occupancy in time range min: %d \n Apply NoCollInTimeRangeStandard: %d", + mZvtxMax, mCheckTrigger, mTrigger, mCheckOffline, mCheckIsRun3, mTriggerTVXselection, mApplyTFBorderCut, mApplyITSTPCvertex, mApplyZvertexTimedifference, mApplyPileupRejection, mApplyNoITSROBorderCut, mtrackOccupancyInTimeRangeMax, mtrackOccupancyInTimeRangeMin, mApplyCollInTimeRangeStandard); } /// Set MB selection @@ -138,6 +138,16 @@ class CollisonCuts /// Set the NoITSRO frame border cut void setApplyNoITSROBorderCut(bool applyNoITSROBorderCut) { mApplyNoITSROBorderCut = applyNoITSROBorderCut; } + /// Set the track occupancy in time range cut + void setTrackOccupancyInTimeRange(int trackOccupancyInTimeRangeMax, int trackOccupancyInTimeRangeMin) + { + mtrackOccupancyInTimeRangeMax = trackOccupancyInTimeRangeMax; + mtrackOccupancyInTimeRangeMin = trackOccupancyInTimeRangeMin; + } + + /// Set the NoCollInTimeRangeStandard cut + void setApplyCollInTimeRangeStandard(bool applyCollInTimeRangeStandard) { mApplyCollInTimeRangeStandard = applyCollInTimeRangeStandard; } + /// Check whether the collisions fulfills the specified selections /// \tparam T type of the collision /// \param col Collision @@ -195,12 +205,25 @@ class CollisonCuts LOGF(debug, "trackOccupancyInTimeRange selection failed"); return false; } + if (mtrackOccupancyInTimeRangeMin > 0 && col.trackOccupancyInTimeRange() < mtrackOccupancyInTimeRangeMin) { + LOGF(debug, "trackOccupancyInTimeRange selection failed"); + return false; + } + if ((!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) && mApplyCollInTimeRangeStandard) { + LOGF(debug, "NoCollInTimeRangeStandard selection failed"); + return false; + } mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagOccupancy); } else { // Run2 case if (mCheckOffline && !col.sel7()) { LOGF(debug, "Offline selection failed (sel7)"); return false; } + auto bc = col.template bc_as(); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) { + LOGF(debug, "Offline selection failed (AliEventCuts)"); + return false; + } mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX); } if (mCheckTrigger && !col.alias_bit(mTrigger)) { @@ -253,21 +276,24 @@ class CollisonCuts } private: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - bool mCutsSet = false; ///< Protection against running without cuts - bool mCheckTrigger = false; ///< Check for trigger - bool mTriggerTVXselection = false; ///< Check for trigger TVX selection - bool mCheckOffline = false; ///< Check for offline criteria (might change) - bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam - bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected - bool mApplyTFBorderCut = false; ///< Apply time frame border cut - bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing - bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. - bool mApplyPileupRejection = false; ///< Pileup rejection - bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut - int mTrigger = kINT7; ///< Trigger to check for - float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) - int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) + using BCsWithRun2Info = soa::Join; + o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + bool mCutsSet = false; ///< Protection against running without cuts + bool mCheckTrigger = false; ///< Check for trigger + bool mTriggerTVXselection = false; ///< Check for trigger TVX selection + bool mCheckOffline = false; ///< Check for offline criteria (might change) + bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam + bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected + bool mApplyTFBorderCut = false; ///< Apply time frame border cut + bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing + bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. + bool mApplyPileupRejection = false; ///< Pileup rejection + bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut + bool mApplyCollInTimeRangeStandard = false; ///< Apply NoCollInTimeRangeStandard selection + int mTrigger = kINT7; ///< Trigger to check for + float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) + int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) + int mtrackOccupancyInTimeRangeMin = -1; ///< Minimum trackOccupancyInTimeRange cut (-1 no cut) }; } // namespace o2::analysis From 90b609ca3635d3a7090712961e600ae9454c56e7 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sat, 7 Dec 2024 20:58:33 +0100 Subject: [PATCH 76/91] [PWGCF] FemtoUniverse: Changing fillCollisionsCent to bool (#8847) --- .../femtoUniverseProducerTask.cxx | 207 ++++++++++-------- 1 file changed, 117 insertions(+), 90 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index a9853b29e1b..384cba579bc 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -17,13 +17,15 @@ /// \author Pritam Chakraborty, WUT Warsaw, pritam.chakraborty@cern.ch #include -#include // FIXME +#include #include #include #include +#include "CommonConstants/PhysicsConstants.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" @@ -57,6 +59,7 @@ using namespace o2; using namespace o2::analysis::femtoUniverse; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::constants::physics; namespace o2::aod { @@ -297,25 +300,25 @@ struct femtoUniverseProducerTask { { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -323,7 +326,7 @@ struct femtoUniverseProducerTask { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -337,31 +340,31 @@ struct femtoUniverseProducerTask { { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { return true; } else { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { return true; } else { return false; @@ -374,25 +377,25 @@ struct femtoUniverseProducerTask { bool IsKaonNSigmaTOFLoose(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -400,7 +403,7 @@ struct femtoUniverseProducerTask { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -413,16 +416,16 @@ struct femtoUniverseProducerTask { bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { + if (std::abs(nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { return true; - } else if (TMath::Abs(nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { + } else if (std::abs(nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { return true; } } if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { return true; - } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { + } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { return true; } else { return false; @@ -449,10 +452,10 @@ struct femtoUniverseProducerTask { void init(InitContext&) { - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessV0CentRun3Data || doprocessCascadeCentRun3Data) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { LOGF(fatal, "Neither processFullData nor processFullMC enabled. Please choose one."); } - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessV0CentRun3Data || doprocessCascadeCentRun3Data) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { LOGF(fatal, "Cannot enable process Data and process MC at the same time. " "Please choose one."); @@ -682,7 +685,7 @@ struct femtoUniverseProducerTask { int particleOrigin = 99; auto motherparticlesMC = particleMC.template mothers_as(); - if (abs(pdgCode) == abs(ConfPDGCodePartOne.value) || abs(pdgCode) == abs(ConfPDGCodePartTwo.value)) { + if (std::abs(pdgCode) == std::abs(ConfPDGCodePartOne.value) || std::abs(pdgCode) == std::abs(ConfPDGCodePartTwo.value)) { if (particleMC.isPhysicalPrimary()) { particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; } else if (!motherparticlesMC.empty()) { @@ -717,7 +720,7 @@ struct femtoUniverseProducerTask { auto motherskaon1MC = kaon1MC.template mothers_as(); auto motherskaon2MC = kaon2MC.template mothers_as(); - if (abs(pdgCode1) == abs(321) || abs(pdgCode2) == abs(-321)) { + if (std::abs(pdgCode1) == std::abs(321) || std::abs(pdgCode2) == std::abs(-321)) { if ((kaon1MC.isPhysicalPrimary() && kaon2MC.isPhysicalPrimary()) && (!motherskaon1MC.empty() && !motherskaon2MC.empty())) { for (auto& particleMotherOfNeg : motherskaon1MC) { for (auto& particleMotherOfPos : motherskaon2MC) { @@ -738,8 +741,8 @@ struct femtoUniverseProducerTask { TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header + const auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header + const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header part1Vec.SetPtEtaPhiM(kaon1MC.pt(), kaon1MC.eta(), kaon1MC.phi(), mMassOne); part2Vec.SetPtEtaPhiM(kaon2MC.pt(), kaon2MC.eta(), kaon2MC.phi(), mMassTwo); @@ -820,16 +823,12 @@ struct femtoUniverseProducerTask { } } - template - void fillCollisionsCentRun2(CollisionType const& col, TrackType const& tracks) + template + bool fillCollisionsCentRun2(CollisionType const& col) { const auto vtxZ = col.posZ(); - float cent = 0; - int multNtr = 0; - if (!ConfIsRun3) { - cent = col.centRun2V0M(); - multNtr = col.multNTracksPV(); - } + const auto cent = col.centRun2V0M(); + const auto multNtr = col.multNTracksPV(); // check whether the basic event selection criteria are fulfilled // if the basic selection is NOT fulfilled: @@ -837,54 +836,33 @@ struct femtoUniverseProducerTask { // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions if (!colCuts.isSelected(col)) { - return; - } - - // colCuts.fillQA(col); //for now, TODO: create a configurable so in the FemroUniverseCollisionSelection.h there is an option to plot QA just for the posZ - if (ConfDoSpher) { - outputCollision(vtxZ, cent, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + return false; } else { outputCollision(vtxZ, cent, multNtr, 2, mMagField); + return true; } } - template - void fillCollisionsCentRun3(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s, CascadeType const& fullCascades, double irrate) + template + bool fillCollisionsCentRun3(CollisionType const& col) { const auto vtxZ = col.posZ(); - float cent = 0; - int multNtr = 0; - if (ConfIsRun3) { - multNtr = col.multNTracksPV(); - cent = col.centFT0C(); - } + const auto multNtr = col.multNTracksPV(); + const auto cent = col.centFT0C(); - int occupancy = col.trackOccupancyInTimeRange(); // check whether the basic event selection criteria are fulfilled // if the basic selection is NOT fulfilled: // in case of skimming run - don't store such collisions // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions if (!colCuts.isSelectedRun3(col)) { - return; - } - - // colCuts.fillQA(col); //for now, TODO: create a configurable so in the FemroUniverseCollisionSelection.h there is an option to plot QA just for the posZ - if ((col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (occupancy > ConfTPCOccupancyMin && occupancy <= ConfTPCOccupancyMax)) { - if (ConfDoSpher) { - outputCollision(vtxZ, cent, multNtr, colCuts.computeSphericity(col, tracks), mMagField); - } else { + return false; + } else { + if ((col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { outputCollision(vtxZ, cent, multNtr, 2, mMagField); - } - - fillCollisionsCentRun3ColExtra(col, irrate); - - fillTracks(tracks); - if (ConfV0Selection.ConfIsFillV0s) { - fillV0(col, fullV0s, tracks); - } - if (ConfCascadeSelection.ConfIsFillCascades) { - fillCascade(col, fullCascades, tracks); + return true; + } else { + return false; } } } @@ -892,7 +870,7 @@ struct femtoUniverseProducerTask { template void fillCollisionsCentRun3ColExtra(CollisionType const& col, double irrate) { - int occupancy = col.trackOccupancyInTimeRange(); + const auto occupancy = col.trackOccupancyInTimeRange(); outputCollExtra(irrate, occupancy); } @@ -1347,8 +1325,8 @@ struct femtoUniverseProducerTask { TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header + const auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header + const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header part1Vec.SetPtEtaPhiM(p1.pt(), p1.eta(), p1.phi(), mMassOne); part2Vec.SetPtEtaPhiM(p2.pt(), p2.eta(), p2.phi(), mMassTwo); @@ -1357,7 +1335,7 @@ struct femtoUniverseProducerTask { sumVec += part2Vec; float phiEta = sumVec.Eta(); - if (TMath::Abs(phiEta) > 0.8) { + if (std::abs(phiEta) > 0.8) { continue; } @@ -1366,12 +1344,13 @@ struct femtoUniverseProducerTask { continue; } - float phiPhi = sumVec.Phi(); + /*float phiPhi = sumVec.Phi(); if (sumVec.Phi() < 0) { - phiPhi = sumVec.Phi() + 2 * o2::constants::math::PI; + phiPhi = sumVec.Phi() + o2::constants::math::TwoPI; } else if (sumVec.Phi() >= 0) { phiPhi = sumVec.Phi(); - } + }*/ + float phiPhi = RecoDecay::constrainAngle(sumVec.Phi(), 0); float phiM = sumVec.M(); if (((phiM < ConfPhiSelection.ConfInvMassLowLimitPhi.value) || (phiM > ConfPhiSelection.ConfInvMassUpLimitPhi.value))) { @@ -1782,49 +1761,97 @@ struct femtoUniverseProducerTask { aod::BCsWithTimestamps const&, soa::Join const& tracks, aod::McCollisions const&, - aod::McParticles const&, - soa::Join const& fullV0s, - soa::Join const& fullCascades) + aod::McParticles const&) { // get magnetic field for run auto bc = col.bc_as(); getMagneticFieldTesla(bc); - double ir = 0.; - ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + const double ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR // fill the tables - fillCollisionsCentRun3(col, tracks, fullV0s, fullCascades, ir); + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processFullMCCent, "Provide MC data with centrality bins", false); void processTrackCentRun2Data(aod::FemtoFullCollisionCentRun2 const& col, aod::BCsWithTimestamps const&, - aod::FemtoFullTracks const& tracks) + soa::Filtered const& tracks) { // get magnetic field for run - getMagneticFieldTesla(col.bc_as()); + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + const double ir = 0.0; // fetch IR + // fill the tables - fillCollisionsCentRun2(col, tracks); - fillTracks(tracks); + const auto colcheck = fillCollisionsCentRun2(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun2Data, "Provide experimental data for Run 2 with centrality for track track", false); void processTrackCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, - soa::Filtered const& tracks, - aod::V0Datas const& fullV0s, - aod::CascDatas const& fullCascades) + soa::Filtered const& tracks) { // get magnetic field for run auto bc = col.bc_as(); getMagneticFieldTesla(bc); - double ir = 0.; - ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR // fill the tables - fillCollisionsCentRun3(col, tracks, fullV0s, fullCascades, ir); + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + + void processV0CentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, + aod::BCsWithTimestamps const&, + soa::Filtered const& tracks, + soa::Join const& fullV0s) + { + // get magnetic field for run + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + + // fill the tables + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + fillV0(col, fullV0s, tracks); + } + } + PROCESS_SWITCH(femtoUniverseProducerTask, processV0CentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + + void processCascadeCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, + aod::BCsWithTimestamps const&, + soa::Filtered const& tracks, + aod::CascDatas const& fullCascades) + { + // get magnetic field for run + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + + // fill the tables + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + fillCascade(col, fullCascades, tracks); + } + } + PROCESS_SWITCH(femtoUniverseProducerTask, processCascadeCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From c23149383fb53f4306f080080d3f97156cb00330 Mon Sep 17 00:00:00 2001 From: Zhen Zhang <74494053+zz951@users.noreply.github.com> Date: Sat, 7 Dec 2024 21:32:17 +0100 Subject: [PATCH 77/91] [PWGHF] Fixing bugs for Lc-H correlation (#8799) Co-authored-by: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> --- .../HFC/TableProducer/correlatorLcHadrons.cxx | 56 ++++++++++--------- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 41 ++++++++++---- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index c3ef512f6fa..d9ed5d26163 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -75,6 +75,7 @@ struct HfCorrelatorLcHadronsSelection { // filter on selection of Lc and decay channel Lc->PKPi Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); + /// Code to select collisions with at least one Lc - for real data and data-like analysis void processLcSelectionData(SelCollisions::iterator const& collision, CandidatesLcData const& candidates) { @@ -182,21 +183,11 @@ struct HfCorrelatorLcHadrons { Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for assoc particle"}; Configurable> binsPtEfficiencyLc{"binsPtEfficiencyLc", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for efficiency"}; Configurable> efficiencyLc{"efficiencyLc", {1., 1., 1., 1., 1., 1.}, "efficiency values for Lc"}; - ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; - ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; - ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks - ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; - ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; - ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; - ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its Lc mother instead of skipping it"}; Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; HfHelper hfHelper; SliceCache cache; - BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; int leadingIndex = 0; bool correlationStatus = false; @@ -218,6 +209,19 @@ struct HfCorrelatorLcHadrons { Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + // configurable axis definition + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; + ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; + ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + + BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) { @@ -242,7 +246,7 @@ struct HfCorrelatorLcHadrons { registry.add("hEta", "Lc,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {axisEta}}); registry.add("hPhi", "Lc,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {axisPhi}}); registry.add("hY", "Lc,Hadron candidates;candidate #it{#y};entries", {HistType::kTH1F, {axisRapidity}}); - registry.add("hcountLcHadronPerEvent", "Lc,Hadron particles - MC gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}); + registry.add("hCountLcHadronPerEvent", "Lc,Hadron particles - MC gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}); registry.add("hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); registry.add("hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); registry.add("hMultFT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); @@ -293,6 +297,7 @@ struct HfCorrelatorLcHadrons { corrBinning = {{binsZVtx, binsMultiplicity}, true}; } + /// Lc-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(SelCollisionsWithLc::iterator const& collision, TracksData const& tracks, CandidatesLcData const& candidates) @@ -409,7 +414,7 @@ struct HfCorrelatorLcHadrons { cntLc++; } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultT0M"), collision.multFT0M()); + registry.fill(HIST("hMultFT0M"), collision.multFT0M()); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processData, "Process data", true); @@ -486,7 +491,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + registry.fill(HIST("hSelectionStatusLcToPKPiMcRec"), candidate.isSelLcToPKPi()); entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } @@ -504,7 +509,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + registry.fill(HIST("hSelectionStatusLcToPiKPMcRec"), candidate.isSelLcToPiKP()); entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } @@ -521,7 +526,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + registry.fill(HIST("hSelectionStatusLcToPKPiMcRec"), candidate.isSelLcToPKPi()); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { @@ -530,7 +535,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + registry.fill(HIST("hSelectionStatusLcToPiKPMcRec"), candidate.isSelLcToPiKP()); } } registry.fill(HIST("hLcBin"), poolBin); @@ -612,11 +617,11 @@ struct HfCorrelatorLcHadrons { } // end inner loop (Tracks) } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultT0M"), collision.multFT0M()); + registry.fill(HIST("hMultFT0M"), collision.multFT0M()); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRec, "Process Mc Reco mode", false); - /// Lc-Hadron correlation pair builder - for Mc gen-level analysis + /// Lc-Hadron correlation pair builder - for Mc Gen-level analysis void processMcGen(SelCollisionsWithLcMc::iterator const& mcCollision, CandidatesLcMcGen const& mcParticles) { @@ -635,7 +640,7 @@ struct HfCorrelatorLcHadrons { leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax.value, ptTrackMin.value); } - // Mc gen level + // Mc Gen level for (const auto& particle : mcParticles) { if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { continue; @@ -684,14 +689,14 @@ struct HfCorrelatorLcHadrons { continue; } if (particleAssoc.globalIndex() == prongsId[0] || particleAssoc.globalIndex() == prongsId[1] || particleAssoc.globalIndex() == prongsId[2]) { - continue; - } - if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { if (!storeAutoCorrelationFlag) { continue; } correlationStatus = true; } + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { + continue; + } if (!particleAssoc.isPhysicalPrimary()) { continue; } @@ -723,9 +728,6 @@ struct HfCorrelatorLcHadrons { CandidatesLcData const& candidates, TracksData const& tracks) { - if (candidates.size() == 0) { - return; - } auto tracksTuple = std::make_tuple(candidates, tracks); Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; @@ -819,8 +821,8 @@ struct HfCorrelatorLcHadrons { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); int poolBinLc = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hMultFT0M"), c1.multFT0M()); - registry.fill(HIST("hZVtx"), c1.posZ()); - registry.fill(HIST("TracksPoolBin"), poolBin); + registry.fill(HIST("hZvtx"), c1.posZ()); + registry.fill(HIST("hTracksPoolBin"), poolBin); registry.fill(HIST("hLcPoolBin"), poolBinLc); for (const auto& [candidate, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 6a6c241a518..734fa86b484 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -79,8 +79,8 @@ struct HfTaskCorrelationLcHadrons { Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing"}; Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; - Configurable> mlOutputPrompt{"mlScorePrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; - Configurable> mlOutputBkg{"mlScoreBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; + Configurable> mlOutputPrompt{"mlOutputPrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; + Configurable> mlOutputBkg{"mlOutputBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; // Pt ranges for correlation plots: the default values are those embedded in hf_cuts_lc_to_p_k_pi (i.e. the mass Pt bins), but can be redefined via json files Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{vecBinsPtCorrelations}, "Pt bin limits for correlation plots"}; Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "Pt bin limits for assoc particle efficiency"}; @@ -117,20 +117,13 @@ struct HfTaskCorrelationLcHadrons { Configurable fdEffCcdbPath{"fdEffCcdbPath", "", "CCDB path for trigger efficiency"}; Configurable timestampCcdb{"timestampCcdb", -1, "timestamp of the efficiency files used to query in CCDB"}; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - // configurable axis definition - ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; - ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; - ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; - ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; - ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - Service ccdb; std::shared_ptr mEfficiencyPrompt = nullptr; std::shared_ptr mEfficiencyFD = nullptr; std::shared_ptr mEfficiencyAssociated = nullptr; HfHelper hfHelper; + Service ccdb; enum CandidateStep { kCandidateStepMcGenAll = 0, kCandidateStepMcGenLcToPKPi, @@ -149,6 +142,14 @@ struct HfTaskCorrelationLcHadrons { Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + // configurable axis definition + ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -164,11 +165,13 @@ struct HfTaskCorrelationLcHadrons { AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; AxisSpec axisLcPrompt = {2, -0.5, 1.5, "Prompt #Lambda_c"}; AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec axisCorrelationState = {2, 0., 2., ""}; // Histograms for data analysis registry.add("hBdtScorePrompt", "Lc BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); registry.add("hBdtScoreBkg", "Lc BDT bkg score", {HistType::kTH1F, {axisBdtScore}}); registry.add("hMassLcVsPt", "Lc candidates massVsPt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassLcVsPtWoEff", "Lc candidates massVsPt without efficiency", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); if (fillHistoData) { registry.add("hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); @@ -185,6 +188,11 @@ struct HfTaskCorrelationLcHadrons { registry.add("hCorrel2DVsPtSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + // Toward Transverse Away + registry.add("hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandLeft"))->Sumw2(); @@ -214,6 +222,11 @@ struct HfTaskCorrelationLcHadrons { registry.add("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec", stringLcHadron + "signal region PromptLc - Prompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec", stringLcHadron + " signal region PromptLc - NonPrompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + // Toward Transverse Away for McRec + registry.add("hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandsMcRec"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->Sumw2(); @@ -234,6 +247,11 @@ struct HfTaskCorrelationLcHadrons { registry.add("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron", stringLcHadron + " non prompt Lc non prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtMcGenNonPrompt", stringLcHadron + " NonPrompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + // Toward Transverse Away for McGen + registry.add("hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtMcGenPrompt"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtMcGenNonPrompt"))->Sumw2(); @@ -320,6 +338,7 @@ struct HfTaskCorrelationLcHadrons { } } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); } @@ -440,6 +459,7 @@ struct HfTaskCorrelationLcHadrons { efficiencyWeightLc = 1. / mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)); } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); registry.fill(HIST("hMassPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); @@ -449,6 +469,7 @@ struct HfTaskCorrelationLcHadrons { efficiencyWeightLc = 1. / mEfficiencyFD->GetBinContent(mEfficiencyFD->FindBin(ptLc)); } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); registry.fill(HIST("hMassNonPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); From fc7b48cf19e7df97b4a4c8786d56508a0eb85539 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:55:04 +0100 Subject: [PATCH 78/91] [PWGCF] FemtoUniverse: Changing fillCollisions() to bool (#8856) --- .../femtoUniverseProducerTask.cxx | 123 +++++++++++------- 1 file changed, 73 insertions(+), 50 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 384cba579bc..0599cd04f02 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -123,6 +123,7 @@ struct femtoUniverseProducerTask { Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; Configurable ConfDoSpher{"ConfDoSpher", false, "Calculate sphericity. If false sphericity will take value of 2."}; + Configurable ConfFillCollExt{"ConfFillCollExt", false, "Option to fill collision extended table"}; /// Event cuts FemtoUniverseCollisionSelection colCuts; @@ -722,8 +723,8 @@ struct femtoUniverseProducerTask { if (std::abs(pdgCode1) == std::abs(321) || std::abs(pdgCode2) == std::abs(-321)) { if ((kaon1MC.isPhysicalPrimary() && kaon2MC.isPhysicalPrimary()) && (!motherskaon1MC.empty() && !motherskaon2MC.empty())) { - for (auto& particleMotherOfNeg : motherskaon1MC) { - for (auto& particleMotherOfPos : motherskaon2MC) { + for (const auto& particleMotherOfNeg : motherskaon1MC) { + for (const auto& particleMotherOfPos : motherskaon2MC) { if (particleMotherOfNeg == particleMotherOfPos && particleMotherOfNeg.pdgCode() == 333) { phiOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; } else { @@ -762,7 +763,7 @@ struct femtoUniverseProducerTask { } template - void fillCollisions(CollisionType const& col, TrackType const& tracks) + bool fillCollisions(CollisionType const& col, TrackType const& tracks) { const auto vtxZ = col.posZ(); float mult = 0; @@ -785,28 +786,30 @@ struct femtoUniverseProducerTask { // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions if (!colCuts.isSelected(col)) { - return; - } - if (!ConfIsUsePileUp) { - if (ConfDoSpher) { - outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); - } else { - outputCollision(vtxZ, mult, multNtr, 2, mMagField); - } + return false; } else { - if (ConfDoSpher && (!ConfEvNoSameBunchPileup || col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (!ConfEvIsGoodZvtxFT0vsPV || col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (!ConfEvIsVertexITSTPC || col.selection_bit(aod::evsel::kIsVertexITSTPC))) { - outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + if (!ConfIsUsePileUp) { + if (ConfDoSpher) { + outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + } else { + outputCollision(vtxZ, mult, multNtr, 2, mMagField); + } } else { - outputCollision(vtxZ, mult, multNtr, 2, mMagField); + if (ConfDoSpher && (!ConfEvNoSameBunchPileup || col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (!ConfEvIsGoodZvtxFT0vsPV || col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (!ConfEvIsVertexITSTPC || col.selection_bit(aod::evsel::kIsVertexITSTPC))) { + outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + } else { + outputCollision(vtxZ, mult, multNtr, 2, mMagField); + } } + colCuts.fillQA(col); + return true; } - colCuts.fillQA(col); } template void fillMCTruthCollisions(CollisionType const& col, TrackType const& tracks) { - for (auto& c : col) { + for (const auto& c : col) { const auto vtxZ = c.posZ(); float mult = 0; int multNtr = 0; @@ -880,7 +883,7 @@ struct femtoUniverseProducerTask { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index - for (auto& track : tracks) { + for (const auto& track : tracks) { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track if (!trackCuts.isSelectedMinimal(track)) { @@ -932,7 +935,7 @@ struct femtoUniverseProducerTask { { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index - for (auto& v0 : fullV0s) { + for (const auto& v0 : fullV0s) { auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); ///\tocheck funnily enough if we apply the filter the @@ -1169,7 +1172,7 @@ struct femtoUniverseProducerTask { bool isD0D0bar = false; uint8_t daughFlag = 0; // flag = 0 (daugh of D0 or D0bar), 1 (daug of D0), -1 (daugh of D0bar) - for (auto const& hfCand : hfCands) { + for (const auto& hfCand : hfCands) { if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { continue; @@ -1283,7 +1286,7 @@ struct femtoUniverseProducerTask { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index // lorentz vectors and filling the tables - for (auto& [p1, p2] : combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { + for (const auto& [p1, p2] : combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { if (!trackCuts.isSelectedMinimal(p1) || !trackCuts.isSelectedMinimal(p1)) { continue; } @@ -1429,7 +1432,7 @@ struct femtoUniverseProducerTask { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; - for (auto& particle : tracks) { + for (const auto& particle : tracks) { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track @@ -1536,13 +1539,15 @@ struct femtoUniverseProducerTask { typename CollisionType> void fillCollisionsAndTracksAndV0AndPhi(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s) { - fillCollisions(col, tracks); - fillTracks(tracks); - if (ConfIsActivateV0) { - fillV0(col, fullV0s, tracks); - } - if (ConfIsActivatePhi) { - fillPhi(col, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + if (ConfIsActivateV0) { + fillV0(col, fullV0s, tracks); + } + if (ConfIsActivatePhi) { + fillPhi(col, tracks); + } } // if (ConfIsActivateCascade) { // fillCascade(col, fullCascades, tracks); @@ -1581,9 +1586,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillCascade(col, fullCascades, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillCascade(col, fullCascades, tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCascadeData, "Provide experimental data for track cascades", false); @@ -1624,8 +1631,10 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackMC, "Provide MC data for track analysis", false); @@ -1638,9 +1647,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillPhi(col, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillPhi(col, tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackPhiMC, "Provide MC data for track Phi analysis", false); @@ -1653,9 +1664,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - // fillD0mesons(col, tracks, candidates); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + // fillD0mesons(col, tracks, candidates); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackD0MC, "Provide MC data for track D0 analysis", false); @@ -1665,9 +1678,15 @@ struct femtoUniverseProducerTask { { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); + const double ir = 0.0; // fetch IR // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + if (ConfFillCollExt) { + fillCollisionsCentRun3ColExtra(col, ir); + } + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackData, "Provide experimental data for track track", true); @@ -1680,9 +1699,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillPhi(col, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillPhi(col, tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackPhiData, "Provide experimental data for track phi", false); @@ -1695,9 +1716,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillD0mesons(col, tracks, candidates); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillD0mesons(col, tracks, candidates); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackD0mesonData, "Provide experimental data for track D0 meson", false); @@ -1736,19 +1759,19 @@ struct femtoUniverseProducerTask { { // recos std::set recoMcIds; - for (auto& col : collisions) { + for (const auto& col : collisions) { auto groupedTracks = tracks.sliceBy(perCollisionTracks, col.globalIndex()); auto groupedV0s = fullV0s.sliceBy(perCollisionV0s, col.globalIndex()); getMagneticFieldTesla(col.bc_as()); fillCollisionsAndTracksAndV0AndPhi(col, groupedTracks, groupedV0s); - for (auto& track : groupedTracks) { + for (const auto& track : groupedTracks) { if (trackCuts.isSelectedMinimal(track)) recoMcIds.insert(track.mcParticleId()); } } // truth - for (auto& mccol : mccols) { + for (const auto& mccol : mccols) { auto groupedMCParticles = mcParticles.sliceBy(perMCCollision, mccol.globalIndex()); auto groupedCollisions = collisions.sliceBy(recoCollsPerMCColl, mccol.globalIndex()); fillMCTruthCollisions(groupedCollisions, groupedMCParticles); // fills the reco collisions for mc collision From 422f890e8a23bacc3e7cc39af742a14e3088628f Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 8 Dec 2024 17:05:09 +0100 Subject: [PATCH 79/91] [PWGEM/Dilepton] update prefilter (#8861) --- PWGEM/Dilepton/Core/Dilepton.h | 62 ++------------------ PWGEM/Dilepton/Core/DileptonMC.h | 12 ++-- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 28 +++++---- PWGEM/Dilepton/Utils/PairUtilities.h | 7 ++- 4 files changed, 29 insertions(+), 80 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index d3de41a05f7..8e31f9c63a7 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -181,7 +181,7 @@ struct Dilepton { Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrack : 4] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; @@ -534,8 +534,7 @@ struct Dilepton { fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -1, +1}, {180, -M_PI, M_PI}}, true); fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron - fRegistry.add("Pair/same/uls/hMvsPhiV_prop", Form("m_{ee} vs. #varphi_{V} at r = %2.1f cm;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", dielectroncuts.cfg_x_to_go.value), kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", kTH2D, {{100, 0, 10.0}, {100, 0, 10}}, true); } @@ -778,9 +777,6 @@ struct Dilepton { std::map, float> map_z_prop; // map -> geometrical z position at propagated point std::map, float> map_phi_prop; // map -> geometrical phi position at propagated point - std::map, float> map_px_prop; // map -> px at propagated point - std::map, float> map_py_prop; // map -> py at propagated point - std::map, float> map_pz_prop; // map -> pz at propagated point template void propagateElectron(TTracks const& tracks) @@ -796,17 +792,8 @@ struct Dilepton { o2::math_utils::bringTo02Pi(phi); map_z_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = xyz.Z(); map_phi_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; - - std::array pxpypz_prop = {0, 0, 0}; // px, py, pz - getPxPyPz(track_par_cov, pxpypz_prop); - map_px_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[0]; - map_py_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[1]; - map_pz_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[2]; - - // float r = sqrt(pow(xyz.X(),2) + pow(xyz.Y(), 2)); - // float theta = 2.f * std::atan(std::exp(-eta)); - // float z = r/std::tan(theta); - // LOGF(info, "r = %f, z = %f , xyz.Z() = %f", r, z, xyz.Z()); + // std::array pxpypz_prop = {0, 0, 0}; // px, py, pz + // getPxPyPz(track_par_cov, pxpypz_prop); } } @@ -856,52 +843,20 @@ struct Dilepton { } float dphi_geom = 999.f, dz_geom = 999.f, rdphi_geom = 999.f; - float phiv_prop = 999.f, mee_prop = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } - if constexpr (ev_id == 0) { dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - float px1 = map_px_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float py1 = map_py_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float pz1 = map_pz_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float px2 = map_px_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; - float py2 = map_py_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; - float pz2 = map_pz_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; - - ROOT::Math::PxPyPzMVector v1prop(px1, py1, pz1, leptonM1); - ROOT::Math::PxPyPzMVector v2prop(px2, py2, pz2, leptonM2); - ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - mee_prop = v12prop.M(); - phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); } else { // mixed event dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - float px1 = map_px_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - float py1 = map_py_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - float pz1 = map_pz_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - float px2 = map_px_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; - float py2 = map_py_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; - float pz2 = map_pz_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; - - ROOT::Math::PxPyPzMVector v1prop(px1, py1, pz1, leptonM1); - ROOT::Math::PxPyPzMVector v2prop(px2, py2, pz2, leptonM2); - ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - mee_prop = v12prop.M(); - phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); } if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; @@ -969,7 +924,6 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV"), phiv, v12.M(), weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsOpAng"), opAng, v12.M(), weight); } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ @@ -978,7 +932,6 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV"), phiv, v12.M(), weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsOpAng"), opAng, v12.M(), weight); } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- @@ -987,7 +940,6 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV"), phiv, v12.M(), weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsOpAng"), opAng, v12.M(), weight); } } @@ -1186,7 +1138,8 @@ struct Dilepton { Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); @@ -1438,9 +1391,6 @@ struct Dilepton { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 1bab04568a3..c686c102a25 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -159,7 +159,7 @@ struct DileptonMC { Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrack : 4] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; @@ -724,9 +724,6 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); @@ -1064,7 +1061,9 @@ struct DileptonMC { Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Preslice perCollision_muon = aod::emprimarymuon::emeventId; @@ -1648,9 +1647,6 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); track_par_cov1.setPID(o2::track::PID::Electron); diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index a787d9acd6c..a5e7db3d50d 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -76,7 +76,7 @@ struct prefilterDielectron { Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; + Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; @@ -92,8 +92,10 @@ struct prefilterDielectron { Configurable cfg_max_mass{"cfg_max_mass", 0.0, "max mass for prefilter ULS"}; // region to be rejected Configurable cfg_apply_dzrdphi_geom_uls{"cfg_apply_dzrdphi_geom_uls", false, "flag to apply generator dz-rdphi elliptic cut in ULS"}; // region to be rejected Configurable cfg_apply_dzrdphi_geom_ls{"cfg_apply_dzrdphi_geom_ls", false, "flag to apply generator dz-rdphi elliptic cut in LS"}; // region to be rejected - Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_dz_geom_ls{"cfg_min_dz_geom_ls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom_ls{"cfg_min_rdphi_geom_ls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_dz_geom_uls{"cfg_min_dz_geom_uls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom_uls{"cfg_min_rdphi_geom_uls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected Configurable cfg_apply_phiv{"cfg_apply_phiv", false, "flag to apply phiv cut"}; // region to be rejected Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; // region to be rejected @@ -380,7 +382,7 @@ struct prefilterDielectron { continue; } - if (dielectroncuts.cfg_x_to_go > 0.f && (dielectroncuts.cfg_apply_dzrdphi_geom_uls || dielectroncuts.cfg_apply_dzrdphi_geom_ls)) { + if (dielectroncuts.cfg_x_to_go > 0.f) { propagateElectron(posTracks_per_coll); propagateElectron(negTracks_per_coll); } @@ -421,9 +423,9 @@ struct prefilterDielectron { map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); } - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_uls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_uls, 2) < 1.f) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS); } } @@ -451,9 +453,9 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); + map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); } } @@ -481,9 +483,9 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); + map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); } } diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index a462720bd07..35dd675a92d 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -42,9 +42,10 @@ enum class DileptonAnalysisType : int { kHFll = 6, }; enum class DileptonPrefilterBit : int { - kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 - kPhiV = 1, // reject tracks from photon conversions - kSplitOrMergedTrack = 2, // reject split or marged tracks + kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 + kPhiV = 1, // reject tracks from photon conversions + kSplitOrMergedTrackLS = 2, // reject split or marged tracks in LS pairs + kSplitOrMergedTrackULS = 3, // reject split or marged tracks in ULS pairs }; using SMatrix55 = ROOT::Math::SMatrix>; From 3300278a29cdfac6e262f22808ca4cbe9478829c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Sun, 8 Dec 2024 17:48:20 +0100 Subject: [PATCH 80/91] [Common] RecoDecay::constrainAngle: Support harmonics (#8816) --- Common/Core/RecoDecay.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Common/Core/RecoDecay.h b/Common/Core/RecoDecay.h index a8e4de1216f..5cbb4bbae7e 100644 --- a/Common/Core/RecoDecay.h +++ b/Common/Core/RecoDecay.h @@ -208,18 +208,23 @@ struct RecoDecay { /// Constrains angle to be within a range. /// \note Inspired by TVector2::Phi_0_2pi in ROOT. /// \param angle angle - /// \param min minimum of the range - /// \return value within [min, min + 2π). + /// \param minimum minimum of the range + /// \param harmonic harmonic number + /// \return value of angle within [minimum, minimum + 2π / harmonic). template - static T constrainAngle(T angle, U min = 0.) + static T constrainAngle(T angle, U minimum = 0.0F, unsigned int harmonic = 1U) { - while (angle < min) { - angle += o2::constants::math::TwoPI; + auto period = o2::constants::math::TwoPI; + if (harmonic != 1U) { + period /= harmonic; } - while (angle >= min + o2::constants::math::TwoPI) { - angle -= o2::constants::math::TwoPI; + while (angle < minimum) { + angle += period; } - return (T)angle; + while (angle >= minimum + period) { + angle -= period; + } + return angle; } /// Calculates cosine of pointing angle. From 936ee58135285315378e9d319ce4072c7e1891f5 Mon Sep 17 00:00:00 2001 From: Tanu Gahlaut <154991749+TGahlaut1@users.noreply.github.com> Date: Sun, 8 Dec 2024 20:13:16 +0100 Subject: [PATCH 81/91] [PWGCF] Changes in Reconstructed level process (#8851) --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 2 +- ...nPtFlucIdentified.cxx => meanPtFlucId.cxx} | 678 ++++++++---------- 2 files changed, 319 insertions(+), 361 deletions(-) rename PWGCF/EbyEFluctuations/Tasks/{MeanPtFlucIdentified.cxx => meanPtFlucId.cxx} (64%) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 1332c9ef1dd..d22d2af4dd7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -15,7 +15,7 @@ o2physics_add_dpl_workflow(meanpt-fluctuations COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mean-pt-fluc-id - SOURCES MeanPtFlucIdentified.cxx + SOURCES meanPtFlucId.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx similarity index 64% rename from PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx rename to PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx index 709554718a1..60207675815 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file MeanPtFlucIdentified.cxx +/// \file meanPtFlucId.cxx /// \brief Calculate EbyE fluctuations with cumulant method. /// For charged particles and identified particles. /// For RUN-3 @@ -39,7 +39,7 @@ using namespace o2::framework::expressions; using namespace o2::constants::physics; using namespace std; -struct meanPtFlucId { +struct MeanPtFlucId { Configurable nPtBins{"nPtBins", 300, ""}; Configurable nPartBins{"nPartBins", 250, ""}; Configurable nCentBins{"nCentBins", 101, ""}; @@ -92,9 +92,9 @@ struct meanPtFlucId { ConfigurableAxis multFT0MMCBins{"multFT0MMCBins", {250, 0, 250}, "Forward Multiplicity bins"}; ConfigurableAxis dcaXYBins{"dcaXYBins", {100, -0.15, 0.15}, "dcaXY bins"}; ConfigurableAxis dcaZBins{"dcaZBins", {100, -1.2, 1.2}, "dcaZ bins"}; - ConfigurableAxis QnBins{"QnBins", {1000, 0., 100.}, "nth moments bins"}; - ConfigurableAxis TpNBins{"TpNBins", {300, 0., 3000.}, ""}; - ConfigurableAxis TpDBins{"TpDBins", {100, 0., 2000.}, ""}; + ConfigurableAxis qNBins{"qNBins", {1000, 0., 100.}, "nth moments bins"}; + ConfigurableAxis tpNBins{"tpNBins", {300, 0., 3000.}, ""}; + ConfigurableAxis tpDBins{"tpDBins", {100, 0., 2000.}, ""}; using MyAllTracks = soa::Join ", kTH1D, {axisMeanPt}); hist.add("Analysis/Charged/p_mean_pT_Mult_var", " ", kTProfile, {axisMultTPC}); - hist.add("Analysis/Charged/p_CheckNCH", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); - hist.add("Analysis/Charged/h_CheckNCH", " 1/denominator vs N_{TPC} ", DenoHist); - hist.add("Analysis/Charged/h_Q1_var", "Q1 vs N_{TPC}", QnHist); + hist.add("Analysis/Charged/p_CheckNCh", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); + hist.add("Analysis/Charged/h_CheckNCh", " 1/denominator vs N_{TPC} ", denoHist); + hist.add("Analysis/Charged/h_Q1_var", "Q1 vs N_{TPC}", qNHist); hist.add("Analysis/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0M}); hist.add("Analysis/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0M}); hist.add("Analysis/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0M}); - hist.add("Analysis/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", PartHist); + hist.add("Analysis/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", partHist); hist.addClone("Analysis/Charged/", "Analysis/Pion/"); hist.addClone("Analysis/Charged/", "Analysis/Kaon/"); @@ -293,34 +293,34 @@ struct meanPtFlucId { hist.add("Gen/Charged/h_Mult", "Multiplicity", kTH1D, {axisMult}); hist.add("Gen/Charged/h_mean_pT", " ", kTH1D, {axisMeanPt}); - hist.add("Gen/Charged/h_Q1", "Q1", QnMCHist); - hist.add("Gen/Charged/h_Q2", "Q2", QnMCHist); - hist.add("Gen/Charged/h_Q3", "Q3", QnMCHist); - hist.add("Gen/Charged/h_Q4", "Q4", QnMCHist); - hist.add("Gen/Charged/h_Q1_var", "Q1 vs N_{TPC}", QnMCHist); + hist.add("Gen/Charged/h_Q1", "Q1", qNMCHist); + hist.add("Gen/Charged/h_Q2", "Q2", qNMCHist); + hist.add("Gen/Charged/h_Q3", "Q3", qNMCHist); + hist.add("Gen/Charged/h_Q4", "Q4", qNMCHist); + hist.add("Gen/Charged/h_Q1_var", "Q1 vs N_{TPC}", qNMCHist); hist.add("Gen/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0MMC}); hist.add("Gen/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0MMC}); hist.add("Gen/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0MMC}); hist.add("Gen/Charged/p_mean_pT_Mult_var", " ", kTProfile, {axisMultTPC}); - hist.add("Gen/Charged/p_CheckNCH", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); - hist.add("Gen/Charged/h_CheckNCH", " 1/denominator vs N_{TPC} ", DenoMCHist); - hist.add("Gen/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", PartMCHist); + hist.add("Gen/Charged/p_CheckNCh", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); + hist.add("Gen/Charged/h_CheckNCh", " 1/denominator vs N_{TPC} ", denoMCHist); + hist.add("Gen/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", partMCHist); hist.addClone("Gen/Charged/", "Gen/Pion/"); hist.addClone("Gen/Charged/", "Gen/Kaon/"); hist.addClone("Gen/Charged/", "Gen/Proton/"); } - enum mode { + enum Mode { QA_Pion = 0, QA_Kaon, QA_Proton, @@ -334,7 +334,7 @@ struct meanPtFlucId { Gen_Proton }; - static constexpr std::string_view dire[] = { + static constexpr std::string_view Dire[] = { "QA/Pion/", "QA/Kaon/", "QA/Proton/", @@ -542,9 +542,9 @@ struct meanPtFlucId { // Fill hist before selection cuts: template - void FillBeforeQAHistos(T const& col, U const& tracks) + void fillBeforeQAHistos(T const& col, U const& tracks) { - for (auto& track : tracks) { + for (const auto& track : tracks) { hist.fill(HIST("QA/before/h_Eta"), track.eta()); hist.fill(HIST("QA/before/h_Phi"), track.phi()); hist.fill(HIST("QA/before/h_Pt"), track.pt()); @@ -564,50 +564,50 @@ struct meanPtFlucId { hist.fill(HIST("QA/before/h_VtxZ"), col.posZ()); hist.fill(HIST("QA/before/h_Counts"), 2); - int NTPC = col.multNTracksHasTPC(); - int N_FT0M = col.multFT0M(); - int N_FT0C = col.multFT0C(); - double cent_FT0C = col.centFT0C(); - - if (NTPC != 0 && N_FT0M != 0) { - hist.fill(HIST("QA/before/h_NTPC"), NTPC); - hist.fill(HIST("QA/before/h_Cent"), cent_FT0C); - hist.fill(HIST("QA/before/h_NFT0M"), N_FT0M); - hist.fill(HIST("QA/before/h_NFT0C"), N_FT0M); - hist.fill(HIST("QA/before/h2_NTPC_NFT0M"), N_FT0M, NTPC); - hist.fill(HIST("QA/before/h2_NTPC_NFT0C"), N_FT0C, NTPC); - hist.fill(HIST("QA/before/h2_NTPC_Cent"), cent_FT0C, NTPC); + int nTPC = col.multNTracksHasTPC(); + int nFT0M = col.multFT0M(); + int nFT0C = col.multFT0C(); + double centFT0C = col.centFT0C(); + + if (nTPC != 0 && nFT0M != 0) { + hist.fill(HIST("QA/before/h_NTPC"), nTPC); + hist.fill(HIST("QA/before/h_Cent"), centFT0C); + hist.fill(HIST("QA/before/h_NFT0M"), nFT0M); + hist.fill(HIST("QA/before/h_NFT0C"), nFT0M); + hist.fill(HIST("QA/before/h2_NTPC_NFT0M"), nFT0M, nTPC); + hist.fill(HIST("QA/before/h2_NTPC_NFT0C"), nFT0C, nTPC); + hist.fill(HIST("QA/before/h2_NTPC_Cent"), centFT0C, nTPC); } } // Fill hist after selection cuts: template - void FillAfterQAHistos(T const& col) + void fillAfterQAHistos(T const& col) { - int NTPC = col.multNTracksHasTPC(); - int N_FT0M = col.multFT0M(); - int N_FT0C = col.multFT0C(); - double cent_FT0C = col.centFT0C(); + int nTPC = col.multNTracksHasTPC(); + int nFT0M = col.multFT0M(); + int nFT0C = col.multFT0C(); + double centFT0C = col.centFT0C(); hist.fill(HIST("QA/after/h_VtxZ"), col.posZ()); hist.fill(HIST("QA/after/h_Counts"), 2); - if (NTPC != 0 && N_FT0M != 0) { - hist.fill(HIST("QA/after/h_NTPC"), NTPC); - hist.fill(HIST("QA/after/h_Cent"), cent_FT0C); - hist.fill(HIST("QA/after/h_NFT0M"), N_FT0M); - hist.fill(HIST("QA/after/h_NFT0C"), N_FT0C); - hist.fill(HIST("QA/after/h2_NTPC_NFT0M"), N_FT0M, NTPC); - hist.fill(HIST("QA/after/h2_NTPC_NFT0C"), N_FT0C, NTPC); - hist.fill(HIST("QA/after/h2_NTPC_Cent"), cent_FT0C, NTPC); - hist.fill(HIST("QA/after/p_NTPC_Cent"), cent_FT0C, NTPC); - hist.fill(HIST("QA/after/p_NTPC_NFT0M"), N_FT0M, NTPC); - hist.fill(HIST("QA/after/p_NTPC_NFT0C"), N_FT0C, NTPC); + if (nTPC != 0 && nFT0M != 0) { + hist.fill(HIST("QA/after/h_NTPC"), nTPC); + hist.fill(HIST("QA/after/h_Cent"), centFT0C); + hist.fill(HIST("QA/after/h_NFT0M"), nFT0M); + hist.fill(HIST("QA/after/h_NFT0C"), nFT0C); + hist.fill(HIST("QA/after/h2_NTPC_NFT0M"), nFT0M, nTPC); + hist.fill(HIST("QA/after/h2_NTPC_NFT0C"), nFT0C, nTPC); + hist.fill(HIST("QA/after/h2_NTPC_Cent"), centFT0C, nTPC); + hist.fill(HIST("QA/after/p_NTPC_Cent"), centFT0C, nTPC); + hist.fill(HIST("QA/after/p_NTPC_NFT0M"), nFT0M, nTPC); + hist.fill(HIST("QA/after/p_NTPC_NFT0C"), nFT0C, nTPC); } } // Fill Charged particles QA: template - void FillChargedQAHistos(T const& track) + void fillChargedQAHistos(T const& track) { hist.fill(HIST("QA/after/h_Eta"), track.eta()); hist.fill(HIST("QA/after/h_Phi"), track.phi()); @@ -629,7 +629,7 @@ struct meanPtFlucId { // Fill before PID cut QA hist: template - void FillBeforePIDQAHistos(T const& track) + void fillBeforePIDQAHistos(T const& track) { hist.fill(HIST("QA/before/h2_TOFSignal"), track.p(), track.beta()); hist.fill(HIST("QA/before/h2_TPCSignal"), track.p(), track.tpcSignal()); @@ -670,140 +670,140 @@ struct meanPtFlucId { } // Fill after PID cut QA hist: - template - void FillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF, int& N, double& Q1, double& Q2, double& Q3, double& Q4) + template + void fillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF, int& N, double& Q1, double& Q2, double& Q3, double& Q4) { N++; moments(track.pt(), Q1, Q2, Q3, Q4); - hist.fill(HIST(dire[mode]) + HIST("h_Pt"), track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h_Pt"), track.pt()); if (track.sign() > 0) - hist.fill(HIST(dire[mode]) + HIST("h_PtPos"), track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h_PtPos"), track.pt()); if (track.sign() < 0) - hist.fill(HIST(dire[mode]) + HIST("h_PtNeg"), track.pt()); - - hist.fill(HIST(dire[mode]) + HIST("h_Eta"), track.eta()); - hist.fill(HIST(dire[mode]) + HIST("h_Phi"), track.phi()); - hist.fill(HIST(dire[mode]) + HIST("h_rap"), rap); - hist.fill(HIST(dire[mode]) + HIST("h2_Pt_rap"), rap, track.pt()); - hist.fill(HIST(dire[mode]) + HIST("h_DcaZ"), track.dcaZ()); - hist.fill(HIST(dire[mode]) + HIST("h_DcaXY"), track.dcaXY()); - hist.fill(HIST(dire[mode]) + HIST("h2_DcaZ"), track.pt(), track.dcaZ()); - hist.fill(HIST(dire[mode]) + HIST("h2_DcaXY"), track.pt(), track.dcaXY()); - hist.fill(HIST(dire[mode]) + HIST("h2_Pt_Pinner"), track.tpcInnerParam(), track.pt()); - hist.fill(HIST(dire[mode]) + HIST("h2_P_Pinner"), track.tpcInnerParam(), track.p()); - - hist.fill(HIST(dire[mode]) + HIST("h2_TPCNsigma_El"), track.p(), track.tpcNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("h2_TOFNsigma_El"), track.p(), track.tofNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("h2_TPCNsigma"), track.p(), nSigmaTPC); - hist.fill(HIST(dire[mode]) + HIST("h2_TOFNsigma"), track.p(), nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("h2_TPCSignal"), track.p(), track.tpcSignal()); - hist.fill(HIST(dire[mode]) + HIST("h2_TOFSignal"), track.p(), track.beta()); - hist.fill(HIST(dire[mode]) + HIST("h2_pvsm2"), track.mass() * track.mass(), track.p()); + hist.fill(HIST(Dire[Mode]) + HIST("h_PtNeg"), track.pt()); + + hist.fill(HIST(Dire[Mode]) + HIST("h_Eta"), track.eta()); + hist.fill(HIST(Dire[Mode]) + HIST("h_Phi"), track.phi()); + hist.fill(HIST(Dire[Mode]) + HIST("h_rap"), rap); + hist.fill(HIST(Dire[Mode]) + HIST("h2_Pt_rap"), rap, track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h_DcaZ"), track.dcaZ()); + hist.fill(HIST(Dire[Mode]) + HIST("h_DcaXY"), track.dcaXY()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_DcaZ"), track.pt(), track.dcaZ()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_DcaXY"), track.pt(), track.dcaXY()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_Pt_Pinner"), track.tpcInnerParam(), track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_P_Pinner"), track.tpcInnerParam(), track.p()); + + hist.fill(HIST(Dire[Mode]) + HIST("h2_TPCNsigma_El"), track.p(), track.tpcNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TOFNsigma_El"), track.p(), track.tofNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TPCNsigma"), track.p(), nSigmaTPC); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TOFNsigma"), track.p(), nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TPCSignal"), track.p(), track.tpcSignal()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TOFSignal"), track.p(), track.beta()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_pvsm2"), track.mass() * track.mass(), track.p()); hist.fill(HIST("QA/after/h2_TPCSignal"), track.p(), track.tpcSignal()); hist.fill(HIST("QA/after/h2_TOFSignal"), track.p(), track.beta()); hist.fill(HIST("QA/after/h2_pvsm2"), track.mass() * track.mass(), track.p()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TPCNsigma_El"), track.tpcInnerParam(), track.tpcNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TOFNsigma_El"), track.tpcInnerParam(), track.tofNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TPCNsigma"), track.tpcInnerParam(), nSigmaTPC); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TOFNsigma"), track.tpcInnerParam(), nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TPCSignal"), track.tpcInnerParam(), track.tpcSignal()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TOFSignal"), track.tpcInnerParam(), track.beta()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TPCNsigma_El"), track.tpcInnerParam(), track.tpcNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TOFNsigma_El"), track.tpcInnerParam(), track.tofNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TPCNsigma"), track.tpcInnerParam(), nSigmaTPC); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TOFNsigma"), track.tpcInnerParam(), nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TPCSignal"), track.tpcInnerParam(), track.tpcSignal()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TOFSignal"), track.tpcInnerParam(), track.beta()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); hist.fill(HIST("QA/after/innerParam/h2_TPCSignal"), track.tpcInnerParam(), track.tpcSignal()); hist.fill(HIST("QA/after/innerParam/h2_TOFSignal"), track.tpcInnerParam(), track.beta()); hist.fill(HIST("QA/after/innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); } - template - void FillPtMCHist(double pt, int PID, int pdgCodePos, int pdgCodeNeg) + template + void fillPtMCHist(double pt, int pid, int pdgCodePos, int pdgCodeNeg) { - hist.fill(HIST(dire[mode]) + HIST("h_PtTruth"), pt); - if (PID == pdgCodePos) { - hist.fill(HIST(dire[mode]) + HIST("h_PtPosTruth"), pt); + hist.fill(HIST(Dire[Mode]) + HIST("h_PtTruth"), pt); + if (pid == pdgCodePos) { + hist.fill(HIST(Dire[Mode]) + HIST("h_PtPosTruth"), pt); } - if (PID == pdgCodeNeg) { - hist.fill(HIST(dire[mode]) + HIST("h_PtNegTruth"), pt); + if (pid == pdgCodeNeg) { + hist.fill(HIST(Dire[Mode]) + HIST("h_PtNegTruth"), pt); } } - template - void FillAnalysisHistos(int NTPC, int N_FT0M, int N, double Q1, double Q2, double Q3, double Q4) + template + void fillAnalysisHistos(int nTPC, int nFT0M, int N, double Q1, double Q2, double Q3, double Q4) { - if (N == 0 /* || Q1 == 0 || Q2 == 0 || Q3 == 0 || Q4 == 0 */) { + if (N == 0) { return; } double twopart1 = ((Q1 * Q1) - Q2); double threepart1 = ((Q1 * Q1 * Q1) - (3 * Q2 * Q1) + 2 * Q3); double fourpart1 = ((Q1 * Q1 * Q1 * Q1) - (6 * Q2 * Q1 * Q1) + (3 * Q2 * Q2) + (8 * Q3 * Q1) - 6 * Q4); - hist.fill(HIST(dire[mode]) + HIST("h_Mult"), N); - hist.fill(HIST(dire[mode]) + HIST("h_Q1"), NTPC, Q1, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_Q2"), NTPC, Q2, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_Q3"), NTPC, Q3, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_Q4"), NTPC, Q4, N_FT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Mult"), N); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q1"), nTPC, Q1, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q2"), nTPC, Q2, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q3"), nTPC, Q3, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q4"), nTPC, Q4, nFT0M); if (N > 1) { - double mean_pT = Q1 / static_cast(N); - double N_pair = (static_cast(N) * (static_cast(N) - 1)); - double twopart = twopart1 / N_pair; - double checkN_deno_var = (1 / std::sqrt(1 - (1 / static_cast(N)))); - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT"), mean_pT); - hist.fill(HIST(dire[mode]) + HIST("p_mean_pT_Mult_var"), NTPC, mean_pT); - - hist.fill(HIST(dire[mode]) + HIST("h_Q1_var"), NTPC, Q1, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_N_var"), NTPC, N, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_nume_Mult_var"), NTPC, twopart1, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_deno_Mult_var"), NTPC, N_pair, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_var"), NTPC, mean_pT, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_var"), NTPC, twopart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("p_CheckNCH"), NTPC, checkN_deno_var); - hist.fill(HIST(dire[mode]) + HIST("h_CheckNCH"), NTPC, checkN_deno_var, N_FT0M); + double meanPt = Q1 / static_cast(N); + double nPair = (static_cast(N) * (static_cast(N) - 1)); + double twopart = twopart1 / nPair; + double checkNDenoVar = (1 / std::sqrt(1 - (1 / static_cast(N)))); + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT"), meanPt); + hist.fill(HIST(Dire[Mode]) + HIST("p_mean_pT_Mult_var"), nTPC, meanPt); + + hist.fill(HIST(Dire[Mode]) + HIST("h_Q1_var"), nTPC, Q1, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_N_var"), nTPC, N, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_nume_Mult_var"), nTPC, twopart1, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_deno_Mult_var"), nTPC, nPair, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT_Mult_var"), nTPC, meanPt, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_Mult_var"), nTPC, twopart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("p_CheckNCh"), nTPC, checkNDenoVar); + hist.fill(HIST(Dire[Mode]) + HIST("h_CheckNCh"), nTPC, checkNDenoVar, nFT0M); if (N > 2) { - double N_triplet = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2)); - double threepart = threepart1 / N_triplet; - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_skew"), NTPC, mean_pT, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_skew"), NTPC, twopart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_skew"), NTPC, threepart, N_FT0M); + double nTriplet = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2)); + double threepart = threepart1 / nTriplet; + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT_Mult_skew"), nTPC, meanPt, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_Mult_skew"), nTPC, twopart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_threepart_Mult_skew"), nTPC, threepart, nFT0M); if (N > 3) { - double N_quad = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2) * (static_cast(N) - 3)); - double fourpart = fourpart1 / N_quad; - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_kurto"), NTPC, mean_pT, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_kurto"), NTPC, twopart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_kurto"), NTPC, threepart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_fourpart_Mult_kurto"), NTPC, fourpart, N_FT0M); + double nQuad = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2) * (static_cast(N) - 3)); + double fourpart = fourpart1 / nQuad; + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT_Mult_kurto"), nTPC, meanPt, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_Mult_kurto"), nTPC, twopart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_threepart_Mult_kurto"), nTPC, threepart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_fourpart_Mult_kurto"), nTPC, fourpart, nFT0M); } } } } template - void FillHistos(T const& col, U const& tracks) + void fillHistos(T const& col, U const& tracks) { - int Nch = 0, N_TPC = 0, N_FT0M = 0; - int N_Pi = 0, N_Ka = 0, N_Pr = 0; - double pt_ch = 0, Q1_ch = 0, Q2_ch = 0, Q3_ch = 0, Q4_ch = 0; - double pt_Pi = 0, Q1_Pi = 0, Q2_Pi = 0, Q3_Pi = 0, Q4_Pi = 0; - double pt_Pr = 0, Q1_Pr = 0, Q2_Pr = 0, Q3_Pr = 0, Q4_Pr = 0; - double pt_Ka = 0, Q1_Ka = 0, Q2_Ka = 0, Q3_Ka = 0, Q4_Ka = 0; - - int Nch_sim = 0, N_sim = 0, NFT0C_sim = 0; - int N_Pi_sim = 0, N_Ka_sim = 0, N_Pr_sim = 0; - double pt_ch_sim = 0, Q1_ch_sim = 0, Q2_ch_sim = 0, Q3_ch_sim = 0, Q4_ch_sim = 0; - double pt_Pi_sim = 0, Q1_Pi_sim = 0, Q2_Pi_sim = 0, Q3_Pi_sim = 0, Q4_Pi_sim = 0; - double pt_Pr_sim = 0, Q1_Pr_sim = 0, Q2_Pr_sim = 0, Q3_Pr_sim = 0, Q4_Pr_sim = 0; - double pt_Ka_sim = 0, Q1_Ka_sim = 0, Q2_Ka_sim = 0, Q3_Ka_sim = 0, Q4_Ka_sim = 0; + int nCh = 0, nTPC = 0, nFT0M = 0; + int nPi = 0, nKa = 0, nPr = 0; + double ptCh = 0, q1Ch = 0, q2Ch = 0, q3Ch = 0, q4Ch = 0; + double ptPi = 0, q1Pi = 0, q2Pi = 0, q3Pi = 0, q4Pi = 0; + double ptPr = 0, q1Pr = 0, q2Pr = 0, q3Pr = 0, q4Pr = 0; + double ptKa = 0, q1Ka = 0, q2Ka = 0, q3Ka = 0, q4Ka = 0; + + int nChSim = 0, nSim = 0, NFT0CSim = 0; + int nPiSim = 0, nKaSim = 0, nPrSim = 0; + double ptChSim = 0, q1ChSim = 0, q2ChSim = 0, q3ChSim = 0, q4ChSim = 0; + double ptPiSim = 0, q1PiSim = 0, q2PiSim = 0, q3PiSim = 0, q4PiSim = 0; + double ptPrSim = 0, q1PrSim = 0, q2PrSim = 0, q3PrSim = 0, q4PrSim = 0; + double ptKaSim = 0, q1KaSim = 0, q2KaSim = 0, q3KaSim = 0, q4KaSim = 0; array p1, p2; double invMassGamma = 0.0; - for (auto const& [trkEl, trkPos] : soa::combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { + for (const auto& [trkEl, trkPos] : soa::combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { if (trkEl.index() == trkPos.index()) continue; @@ -813,15 +813,15 @@ struct meanPtFlucId { if (!selElectrons(trkEl) || !selElectrons(trkPos)) continue; - p1 = array{trkEl.px(), trkEl.py(), trkEl.pz()}; - p2 = array{trkPos.px(), trkPos.py(), trkPos.pz()}; + p1 = std::array{trkEl.px(), trkEl.py(), trkEl.pz()}; + p2 = std::array{trkPos.px(), trkPos.py(), trkPos.pz()}; - invMassGamma = RecoDecay::m(array{p1, p2}, array{MassElectron, MassElectron}); + invMassGamma = RecoDecay::m(std::array{p1, p2}, std::array{MassElectron, MassElectron}); hist.fill(HIST("QA/after/h_invMass_gamma"), invMassGamma); } if constexpr (DataFlag) { - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!selTrack(track)) { continue; } @@ -838,13 +838,13 @@ struct meanPtFlucId { double innerParam = track.tpcInnerParam(); if (std::fabs(track.eta()) < 0.8) { - Nch++; - pt_ch = track.pt(); - moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillChargedQAHistos(track); + nCh++; + ptCh = track.pt(); + moments(ptCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillChargedQAHistos(track); } - FillBeforePIDQAHistos(track); + fillBeforePIDQAHistos(track); if (rejectTracks(track)) { return; @@ -856,31 +856,31 @@ struct meanPtFlucId { if (cfgSelOR == true && cfgSelAND == false) { if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); } } if (cfgSelOR == true && cfgSelAND == false) { if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); } } if (cfgSelOR == true && cfgSelAND == false) { if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); } } } @@ -890,20 +890,20 @@ struct meanPtFlucId { return; } - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!track.has_mcParticle()) { LOGF(warning, "No MC Particle for this track, skip..."); continue; } auto mcPart = track.mcParticle(); - int PID = mcPart.pdgCode(); + int pid = mcPart.pdgCode(); if (!mcPart.isPhysicalPrimary()) { continue; } //___________________________________Truth Level____________________________________________________// auto charge = 0.; - auto* pd = pdg->GetParticle(PID); + auto* pd = pdg->GetParticle(pid); if (pd != nullptr) { charge = pd->Charge(); } @@ -911,10 +911,10 @@ struct meanPtFlucId { continue; } if (std::abs(mcPart.eta()) < 0.8) { - N_sim++; + nSim++; } if (-3.3 < mcPart.eta() && mcPart.eta() < -2.1) { - NFT0C_sim++; + NFT0CSim++; } if (mcPart.pt() > cfgCutPtMin && mcPart.pt() < cfgCutPtMax) { @@ -922,61 +922,61 @@ struct meanPtFlucId { continue; } - Nch_sim++; - pt_ch_sim = mcPart.pt(); - moments(pt_ch_sim, Q1_ch_sim, Q2_ch_sim, Q3_ch_sim, Q4_ch_sim); + nChSim++; + ptChSim = mcPart.pt(); + moments(ptChSim, q1ChSim, q2ChSim, q3ChSim, q4ChSim); hist.fill(HIST("Gen/Charged/h_PtTruth"), mcPart.pt()); - if (std::abs(PID) == kPiPlus && mcPart.pt() >= cfgCutPiPtMin) { + if (std::abs(pid) == kPiPlus && mcPart.pt() >= cfgCutPiPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if (mcPart.p() <= cfgCutPiThrsldP || mcPart.p() > cfgCutPiThrsldP) { - N_Pi_sim++; - pt_Pi_sim = mcPart.pt(); - moments(pt_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); - FillPtMCHist(pt_Pi_sim, PID, kPiPlus, kPiMinus); + nPiSim++; + ptPiSim = mcPart.pt(); + moments(ptPiSim, q1PiSim, q2PiSim, q3PiSim, q4PiSim); + fillPtMCHist(ptPiSim, pid, kPiPlus, kPiMinus); } } else if (cfgSelOR == false && cfgSelAND == true) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPiThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutPiThrsldP)) { - N_Pi_sim++; - pt_Pi_sim = mcPart.pt(); - moments(pt_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); - FillPtMCHist(pt_Pi_sim, PID, kPiPlus, kPiMinus); + nPiSim++; + ptPiSim = mcPart.pt(); + moments(ptPiSim, q1PiSim, q2PiSim, q3PiSim, q4PiSim); + fillPtMCHist(ptPiSim, pid, kPiPlus, kPiMinus); } } } - if (std::abs(PID) == kKPlus && mcPart.pt() >= cfgCutKaPtMin) { + if (std::abs(pid) == kKPlus && mcPart.pt() >= cfgCutKaPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPiThrsldP) || (cfgSelHigh == true && mcPart.p() > cfgCutPiThrsldP)) { - N_Ka_sim++; - pt_Ka_sim = mcPart.pt(); - moments(pt_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); - FillPtMCHist(pt_Ka_sim, PID, kKPlus, kKMinus); + nKaSim++; + ptKaSim = mcPart.pt(); + moments(ptKaSim, q1KaSim, q2KaSim, q3KaSim, q4KaSim); + fillPtMCHist(ptKaSim, pid, kKPlus, kKMinus); } } else if (cfgSelOR == false && cfgSelAND == true) { if ((cfgSelLow == true && mcPart.p() <= cfgCutKaThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutKaThrsldP)) { - N_Ka_sim++; - pt_Ka_sim = mcPart.pt(); - moments(pt_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); - FillPtMCHist(pt_Ka_sim, PID, kKPlus, kKMinus); + nKaSim++; + ptKaSim = mcPart.pt(); + moments(ptKaSim, q1KaSim, q2KaSim, q3KaSim, q4KaSim); + fillPtMCHist(ptKaSim, pid, kKPlus, kKMinus); } } } - if (std::abs(PID) == kProton && mcPart.pt() >= cfgCutPrPtMin) { + if (std::abs(pid) == kProton && mcPart.pt() >= cfgCutPrPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPrThrsldP) || (cfgSelHigh == true && mcPart.p() > cfgCutPrThrsldP)) { - N_Pr_sim++; - pt_Pr_sim = mcPart.pt(); - moments(pt_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); - FillPtMCHist(pt_Pr_sim, PID, kProton, kProtonBar); + nPrSim++; + ptPrSim = mcPart.pt(); + moments(ptPrSim, q1PrSim, q2PrSim, q3PrSim, q4PrSim); + fillPtMCHist(ptPrSim, pid, kProton, kProtonBar); } } else if (cfgSelOR == false && cfgSelAND == true) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPrThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutPrThrsldP)) { - N_Pr_sim++; - pt_Pr_sim = mcPart.pt(); - moments(pt_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); - FillPtMCHist(pt_Pr_sim, PID, kProton, kProtonBar); + nPrSim++; + ptPrSim = mcPart.pt(); + moments(ptPrSim, q1PrSim, q2PrSim, q3PrSim, q4PrSim); + fillPtMCHist(ptPrSim, pid, kProton, kProtonBar); } } } @@ -997,15 +997,14 @@ struct meanPtFlucId { double rapPi = track.rapidity(MassPiPlus); double rapKa = track.rapidity(MassKPlus); double rapPr = track.rapidity(MassProton); - double innerParam = track.tpcInnerParam(); if (std::fabs(track.eta()) < 0.8) { - Nch++; - pt_ch = track.pt(); - moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillChargedQAHistos(track); + nCh++; + ptCh = track.pt(); + moments(ptCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillChargedQAHistos(track); } - FillBeforePIDQAHistos(track); + fillBeforePIDQAHistos(track); if (rejectTracks(track)) { return; @@ -1015,133 +1014,92 @@ struct meanPtFlucId { continue; } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { - pt_Pi = track.pt(); - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - - if (std::abs(PID) == kPiPlus) { - FillPtMCHist(pt_Pi, PID, kPiPlus, kPiMinus); - } - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { - pt_Pi = track.pt(); - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - - if (std::abs(PID) == kPiPlus) { - FillPtMCHist(pt_Pi, PID, kPiPlus, kPiMinus); - } - } + if (std::abs(pid) == kPiPlus && track.pt() >= cfgCutPiPtMin) { + ptPi = track.pt(); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + fillPtMCHist(ptPi, pid, kPiPlus, kPiMinus); } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { - pt_Ka = track.pt(); - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - if (std::abs(PID) == kKPlus) { - FillPtMCHist(pt_Ka, PID, kKPlus, kKMinus); - } - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { - pt_Ka = track.pt(); - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - - if (std::abs(PID) == kKPlus) { - FillPtMCHist(pt_Ka, PID, kKPlus, kKMinus); - } - } + if (std::abs(pid) == kKPlus && track.pt() >= cfgCutKaPtMin) { + ptKa = track.pt(); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + fillPtMCHist(ptKa, pid, kKPlus, kKMinus); } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPr(track, innerParam) == cfgSelLow || selHighPr(track) == cfgSelHigh) { - pt_Pr = track.pt(); - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - - if (std::abs(PID) == kProton) { - FillPtMCHist(pt_Pr, PID, kProton, kProtonBar); - } - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - pt_Pr = track.pt(); - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - - if (std::abs(PID) == kProton) { - FillPtMCHist(pt_Pr, PID, kProton, kProtonBar); - } - } + if (std::abs(pid) == kProton && track.pt() >= cfgCutPrPtMin) { + ptPr = track.pt(); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); + fillPtMCHist(ptPr, pid, kProton, kProtonBar); } } - hist.fill(HIST("QA/after/h_vtxZ_sim"), col.mcCollision().posZ()); + hist.fill(HIST("QA/after/h_vtxZSim"), col.mcCollision().posZ()); } - N_TPC = col.multNTracksHasTPC(); - N_FT0M = col.multFT0M(); + nTPC = col.multNTracksHasTPC(); + nFT0M = col.multFT0M(); if (cfgMCTruth) { - if (N_sim != 0) - hist.fill(HIST("QA/after/h_NSim"), N_sim); + if (nSim != 0) + hist.fill(HIST("QA/after/h_NSim"), nSim); - if (N_sim != 0 && Nch != 0) - hist.fill(HIST("QA/after/h2_NchSim_NSim"), N_sim, Nch_sim); + if (nSim != 0 && nCh != 0) + hist.fill(HIST("QA/after/h2_NChSim_NSim"), nSim, nChSim); - if (N_sim != 0 && N_TPC != 0) - hist.fill(HIST("QA/after/h2_NTPC_NSim"), N_sim, N_TPC); + if (nSim != 0 && nTPC != 0) + hist.fill(HIST("QA/after/h2_NTPC_NSim"), nSim, nTPC); - int NFT0C = col.multFT0C(); - if (NFT0C != 0 && NFT0C_sim != 0) - hist.fill(HIST("QA/after/h2_NFT0C_NFT0CSim"), NFT0C_sim, NFT0C); + int nFT0C = col.multFT0C(); + if (nFT0C != 0 && NFT0CSim != 0) + hist.fill(HIST("QA/after/h2_NFT0C_NFT0CSim"), NFT0CSim, nFT0C); - N_TPC = N_sim; + nTPC = nSim; - hist.fill(HIST("Gen/NTPC"), N_TPC); - hist.fill(HIST("Gen/NFT0C"), NFT0C_sim); - hist.fill(HIST("Gen/h2_NTPC_NFT0C"), NFT0C_sim, N_TPC); + hist.fill(HIST("Gen/NTPC"), nTPC); + hist.fill(HIST("Gen/NFT0C"), NFT0CSim); + hist.fill(HIST("Gen/h2_NTPC_NFT0C"), NFT0CSim, nTPC); - FillAnalysisHistos(N_TPC, N_FT0M, Nch_sim, Q1_ch_sim, Q2_ch_sim, Q3_ch_sim, Q4_ch_sim); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); - FillAnalysisHistos(N_TPC, N_FT0M, N_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); + fillAnalysisHistos(nTPC, nFT0M, nChSim, q1ChSim, q2ChSim, q3ChSim, q4ChSim); + fillAnalysisHistos(nTPC, nFT0M, nPiSim, q1PiSim, q2PiSim, q3PiSim, q4PiSim); + fillAnalysisHistos(nTPC, nFT0M, nKaSim, q1KaSim, q2KaSim, q3KaSim, q4KaSim); + fillAnalysisHistos(nTPC, nFT0M, nPrSim, q1PrSim, q2PrSim, q3PrSim, q4PrSim); } - FillAfterQAHistos(col); - if (N_TPC != 0 && Nch != 0) - hist.fill(HIST("QA/after/h2_NTPC_Nch"), N_TPC, Nch); + fillAfterQAHistos(col); + if (nTPC != 0 && nCh != 0) + hist.fill(HIST("QA/after/h2_NTPC_NCh"), nTPC, nCh); - FillAnalysisHistos(N_TPC, N_FT0M, Nch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - FillAnalysisHistos(N_TPC, N_FT0M, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + fillAnalysisHistos(nTPC, nFT0M, nCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillAnalysisHistos(nTPC, nFT0M, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + fillAnalysisHistos(nTPC, nFT0M, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + fillAnalysisHistos(nTPC, nFT0M, nPr, q1Pr, q2Pr, q3Pr, q4Pr); } - void process_Run3(MyCollisions::iterator const& col, MyAllTracks const& tracks) + void processRun3(MyCollisions::iterator const& col, MyAllTracks const& tracks) { // Before Collision and Track Cuts: - FillBeforeQAHistos(col, tracks); + fillBeforeQAHistos(col, tracks); // After Collision and Track Cuts: if (selRun3Col(col)) { - FillHistos(col, tracks); + fillHistos(col, tracks); } } - PROCESS_SWITCH(meanPtFlucId, process_Run3, "Process for Run3", false); + PROCESS_SWITCH(MeanPtFlucId, processRun3, "Process for Run3", false); - void process_MCRecoSimRun3(MyMCCollisions::iterator const& col, aod::McCollisions const&, MyMCTracks const& tracks, aod::McParticles const&) + void processMCRecoSimRun3(MyMCCollisions::iterator const& col, aod::McCollisions const&, MyMCTracks const& tracks, aod::McParticles const&) { // Before Collision and Track Cuts: - FillBeforeQAHistos(col, tracks); + fillBeforeQAHistos(col, tracks); // After Collision and Track Cuts: if (selRun3Col(col)) { - FillHistos(col, tracks); + fillHistos(col, tracks); } } - PROCESS_SWITCH(meanPtFlucId, process_MCRecoSimRun3, "process MC Reconstructed & Truth Run-3", true); + PROCESS_SWITCH(MeanPtFlucId, processMCRecoSimRun3, "process MC Reconstructed & Truth Run-3", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 2706f4bdafd739a96fd83f1897c76d5745821226 Mon Sep 17 00:00:00 2001 From: abilandz Date: Sun, 8 Dec 2024 20:46:56 +0100 Subject: [PATCH 82/91] [PWGCF] additions to IV, validations of banishment loop, support for ES, etc. (#8859) --- .../Core/MuPa-Configurables.h | 16 + .../Core/MuPa-DataMembers.h | 31 +- .../Core/MuPa-Enums.h | 8 +- .../Core/MuPa-GlobalConstants.h | 7 +- .../Core/MuPa-MemberFunctions.h | 818 +++++++++++++++--- .../Tasks/multiparticle-correlations-ab.cxx | 1 + 6 files changed, 752 insertions(+), 129 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index 578738396c9..eab94f015a4 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -26,6 +26,7 @@ struct : ConfigurableGroup { Configurable cfVerboseUtility{"cfVerboseUtility", false, "run or not in verbose mode, also for simple utility functions (but not for function calls per particle)"}; Configurable cfVerboseForEachParticle{"cfVerboseForEachParticle", false, "run or not in verbose mode (also for function calls per particle)"}; Configurable cfVerboseEventCounter{"cfVerboseEventCounter", false, "print or not only event counter"}; + Configurable cfVerboseEventCut{"cfVerboseEventCut", false, "print or not which event cut didn't survive"}; Configurable cfPlainPrintout{"cfPlainPrintout", false, "print in color or in plain (use the latter in HL)"}; Configurable cfDoAdditionalInsanityChecks{"cfDoAdditionalInsanityChecks", false, "do additional insanity checks at run time (this leads to small loss of performance)"}; Configurable cfInsanityCheckForEachParticle{"cfInsanityCheckForEachParticle", false, "do insanity checks at run time for each particle, at the expense of losing a lot of performance. Use only during debugging."}; @@ -168,6 +169,21 @@ struct : ConfigurableGroup { Configurable cfWhichDefaultLabels{"cfWhichDefaultLabels", "standard", "only for testing purposes, select one set of default labels, see GetDefaultObjArrayWithLabels for supported options"}; } cf_t0; +// *) Eta separation: +struct : ConfigurableGroup { + Configurable cfCalculateEtaSeparations{"cfCalculateEtaSeparations", false, "calculate or not 2p corr. vs. eta separations"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfIntegrated{"cfCalculateEtaSeparationsAsFunctionOfIntegrated", false, "calculate or not 2p corr. vs. eta separations ..."}; + Configurable cfCalculateEtaSeparationsAsFunctionOfMultiplicity{"cfCalculateEtaSeparationsAsFunctionOfMultiplicity", false, "calculate or not 2p corr. vs. eta separations as a function of multiplicity"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfCentrality{"cfCalculateEtaSeparationsAsFunctionOfCentrality", false, "calculate or not 2p corr. vs. eta separations as a function of centrality"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfPt{"cfCalculateEtaSeparationsAsFunctionOfPt", false, "calculate or not 2p corr. vs. eta separations as a function of pt"}; + // Configurable cfCalculateEtaSeparationsAsFunctionOfEta{"cfCalculateEtaSeparationsAsFunctionOfEta", false, "this one doesn't make sense in this context"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfOccupancy{"cfCalculateEtaSeparationsAsFunctionOfOccupancy", false, "calculate or not 2p corr. vs. eta separations as a function of occupancy"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfInteractionRate{"cfCalculateEtaSeparationsAsFunctionOfInteractionRate", false, "calculate or not 2p corr. vs. eta separations as a function of interaction rate"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfCurrentRunDuration{"cfCalculateEtaSeparationsAsFunctionOfCurrentRunDuration", false, "calculate or not E2p corr. vs. eta separations as a function of current run duration (i.e. vs. seconds since start of run)"}; + Configurable> cfEtaSeparationsValues{"cfEtaSeparationsValues", {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8}, "Eta separation between interval A (-eta) and B (+eta)"}; + Configurable> cfEtaSeparationsSkipHarmonics{"cfEtaSeparationsSkipHarmonics", {"0-v1", "0-v2", "0-v3", "0-v4", "1-v5", "1-v6", "1-v7", "1-v8", "1-v9"}, "For calculation of 2p correlation with eta separation these harmonics will be skipped (if first flag = \"0-v1\", v1 will be NOT be skipped in the calculus of 2p correlations with eta separations, etc.)"}; +} cf_es; + // *) Particle weights: struct : ConfigurableGroup { Configurable cfUsePhiWeights{"cfUsePhiWeights", false, "use or not phi weights"}; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index ab4f7a28135..8878439b7e3 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -47,6 +47,7 @@ struct TaskConfiguration { Bool_t fVerboseUtility = kFALSE; // print additional info during debugging also for simply utility function, but not for function calls per particle (see next) Bool_t fVerboseForEachParticle = kFALSE; // print additional info during debugging, also for function calls per particle Bool_t fVerboseEventCounter = kTRUE; // print or not only event counter + Bool_t fVerboseEventCut = kTRUE; // print or not only which event cut didn't survive Bool_t fPlainPrintout = kFALSE; // print in color or in plain (use the latter in HL) Bool_t fDoAdditionalInsanityChecks = kFALSE; // do additional insanity checks at run time, at the expense of losing a bit of performance // (for instance, check if the run number in the current 'collision' is the same as run number in the first 'collision', etc.) @@ -183,10 +184,16 @@ struct Qvector { TList* fQvectorList = NULL; // list to hold all Q-vector objects TProfile* fQvectorFlagsPro = NULL; // profile to hold all flags for Q-vector Bool_t fCalculateQvectors = kTRUE; // to calculate or not to calculate Q-vectors, that's a Boolean... + // Does NOT apply to Qa, Qb, etc., vectors, needed for eta separ. TComplex fQ[gMaxHarmonic * gMaxCorrelator + 1][gMaxCorrelator + 1] = {{TComplex(0., 0.)}}; //! generic Q-vector TComplex fQvector[gMaxHarmonic * gMaxCorrelator + 1][gMaxCorrelator + 1] = {{TComplex(0., 0.)}}; //! "integrated" Q-vector TComplex fqvector[eqvectorKine_N][gMaxNoBinsKine][gMaxHarmonic * gMaxCorrelator + 1][gMaxCorrelator + 1] = {{{{TComplex(0., 0.)}}}}; //! "differenttial" q-vector [kine var.][binNo][fMaxHarmonic*fMaxCorrelator+1][fMaxCorrelator+1] = [6*12+1][12+1] Int_t fqVectorEntries[eqvectorKine_N][gMaxNoBinsKine] = {{0}}; // count number of entries in each differential q-vector + TComplex fQabVector[2][gMaxHarmonic][gMaxNumberEtaSeparations] = {{{TComplex(0., 0.)}}}; //! integrated [-eta or +eta][harmonic][eta separation] + Double_t fMab[2][gMaxNumberEtaSeparations] = {{0.}}; //! multiplicities in 2 eta separated intervals + TH1F* fMabDist[2][2][2][gMaxNumberEtaSeparations] = {{{{NULL}}}}; // multiplicity distributions in A and B, for each eta separation [ A or B ] [rec or sim] [ before or after cuts ] [ eta separation value ] + TComplex fqabVector[2][gMaxNoBinsKine][gMaxHarmonic][gMaxNumberEtaSeparations] = {{{{TComplex(0., 0.)}}}}; //! differential in pt [-eta or +eta][binNo][harmonic][eta separation] + Double_t fmab[2][gMaxNoBinsKine][gMaxNumberEtaSeparations] = {{{0.}}}; //! multiplicities vs pt in 2 eta separated intervals } qv; // "qv" is a common label for objects in this struct // *) Multiparticle correlations (standard, isotropic, same harmonic): @@ -208,7 +215,7 @@ struct ParticleWeights { Bool_t fUseWeights[eWeights_N] = {false}; // use weights [phi,pt,eta] TH1D* fWeightsHist[eWeights_N] = {NULL}; //! use only in Run 3, both for data and MC // *) As of 20240410, kNoITSROFrameBorder (only in MC) and kNoTimeFrameBorder event selection cuts are part of Sel8 // See also email from EK from 2024041 - eMultiplicityEstimator, // see documentation below for ebye.fMultiplicity - eReferenceMultiplicityEstimator, // see documentation below for ebye.fReferenceMultiplicity + eMultiplicityEstimator, // see documentation for ebye.fMultiplicity + eReferenceMultiplicityEstimator, // see documentation for ebye.fReferenceMultiplicity eCentralityEstimator, // the default centrality estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eCentralityEstimators eSelectedEvents, // selected events = eNumberOfEvents + eAfter => therefore I do not need a special histogram for it eNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC (emails from IA on 20240404 and EK on 20240410) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h index b7cc29c4232..c62ffeaf6c8 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h @@ -14,8 +14,9 @@ const Int_t gMaxCorrelator = 12; const Int_t gMaxHarmonic = 9; -const Int_t gMaxIndex = 300; // per order, used only in Test0 -const Int_t gMaxNoBinsKine = 1000; // max number of bins for differential q-vector -const Int_t fMaxBinsDiffWeights = 100; // max number of bins for differential weights, see MakeWeights.C +const Int_t gMaxIndex = 300; // per order, used only in Test0 +const Int_t gMaxNoBinsKine = 1000; // max number of bins for differential q-vector +const Int_t gMaxBinsDiffWeights = 100; // max number of bins for differential weights, see MakeWeights.C +const Int_t gMaxNumberEtaSeparations = 9; // max number of different eta separations used to calculated 2p corr. with eta separations #endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_GLOBALCONSTANTS_H_ diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index a4a699dfe90..0e2fafcf4e7 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -354,28 +354,30 @@ void DefaultConfiguration() // *) Multiparticle correlations: mupa.fCalculateCorrelations = cf_mupa.cfCalculateCorrelations; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTEGRATED] = cf_mupa.cfCalculateCorrelationsAsFunctionOfIntegrated; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_MULTIPLICITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfMultiplicity; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_CENTRALITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCentrality; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] = cf_mupa.cfCalculateCorrelationsAsFunctionOfPt; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] = cf_mupa.cfCalculateCorrelationsAsFunctionOfEta; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_OCCUPANCY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfOccupancy; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_mupa.cfCalculateCorrelationsAsFunctionOfInteractionRate; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCurrentRunDuration; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTEGRATED] = cf_mupa.cfCalculateCorrelationsAsFunctionOfIntegrated && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_MULTIPLICITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfMultiplicity && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_CENTRALITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCentrality && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] = cf_mupa.cfCalculateCorrelationsAsFunctionOfPt && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] = cf_mupa.cfCalculateCorrelationsAsFunctionOfEta && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_OCCUPANCY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfOccupancy && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_mupa.cfCalculateCorrelationsAsFunctionOfInteractionRate && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCurrentRunDuration && mupa.fCalculateCorrelations; // *) Test0: t0.fCalculateTest0 = cf_t0.cfCalculateTest0; - t0.fCalculateTest0AsFunctionOf[AFO_INTEGRATED] = cf_t0.cfCalculateTest0AsFunctionOfIntegrated; - t0.fCalculateTest0AsFunctionOf[AFO_MULTIPLICITY] = cf_t0.cfCalculateTest0AsFunctionOfMultiplicity; - t0.fCalculateTest0AsFunctionOf[AFO_CENTRALITY] = cf_t0.cfCalculateTest0AsFunctionOfCentrality; - t0.fCalculateTest0AsFunctionOf[AFO_PT] = cf_t0.cfCalculateTest0AsFunctionOfPt; - t0.fCalculateTest0AsFunctionOf[AFO_ETA] = cf_t0.cfCalculateTest0AsFunctionOfEta; - t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY] = cf_t0.cfCalculateTest0AsFunctionOfOccupancy; - t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE] = cf_t0.cfCalculateTest0AsFunctionOfInteractionRate; - t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION] = cf_t0.cfCalculateTest0AsFunctionOfCurrentRunDuration; - t0.fFileWithLabels = TString(cf_t0.cfFileWithLabels); - t0.fUseDefaultLabels = cf_t0.cfUseDefaultLabels; - t0.fWhichDefaultLabels = TString(cf_t0.cfWhichDefaultLabels); + t0.fCalculateTest0AsFunctionOf[AFO_INTEGRATED] = cf_t0.cfCalculateTest0AsFunctionOfIntegrated && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_MULTIPLICITY] = cf_t0.cfCalculateTest0AsFunctionOfMultiplicity && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_CENTRALITY] = cf_t0.cfCalculateTest0AsFunctionOfCentrality && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_PT] = cf_t0.cfCalculateTest0AsFunctionOfPt && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_ETA] = cf_t0.cfCalculateTest0AsFunctionOfEta && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY] = cf_t0.cfCalculateTest0AsFunctionOfOccupancy && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE] = cf_t0.cfCalculateTest0AsFunctionOfInteractionRate && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION] = cf_t0.cfCalculateTest0AsFunctionOfCurrentRunDuration && t0.fCalculateTest0; + if (t0.fCalculateTest0) { + t0.fFileWithLabels = TString(cf_t0.cfFileWithLabels); + t0.fUseDefaultLabels = cf_t0.cfUseDefaultLabels; + t0.fWhichDefaultLabels = TString(cf_t0.cfWhichDefaultLabels); + } // *) Particle weights: pw.fUseWeights[wPHI] = cf_pw.cfUsePhiWeights; @@ -561,6 +563,43 @@ void DefaultConfiguration() } } + // ** Eta separations: + es.fCalculateEtaSeparations = cf_es.cfCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTEGRATED] = cf_es.cfCalculateEtaSeparationsAsFunctionOfIntegrated && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_MULTIPLICITY] = cf_es.cfCalculateEtaSeparationsAsFunctionOfMultiplicity && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_CENTRALITY] = cf_es.cfCalculateEtaSeparationsAsFunctionOfCentrality && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT] = cf_es.cfCalculateEtaSeparationsAsFunctionOfPt && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_ETA] = false; // this one doesn't make sense in this context, obviously + es.fCalculateEtaSeparationsAsFunctionOf[AFO_OCCUPANCY] = cf_es.cfCalculateEtaSeparationsAsFunctionOfOccupancy && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_es.cfCalculateEtaSeparationsAsFunctionOfInteractionRate && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_es.cfCalculateEtaSeparationsAsFunctionOfCurrentRunDuration && es.fCalculateEtaSeparations; + + if (es.fCalculateEtaSeparations) { + auto lEtaSeparationsValues = cf_es.cfEtaSeparationsValues.value; + if (lEtaSeparationsValues.size() != gMaxNumberEtaSeparations) { + LOGF(info, "\033[1;31m%s at line %d : lEtaSeparationsValues.size() = %d\n \033[0m", __FUNCTION__, __LINE__, lEtaSeparationsValues.size()); + LOGF(fatal, "\033[1;31m%s at line %d : Provide in configurable cfEtaSeparationsValues precisely %d entries\n \033[0m", __FUNCTION__, __LINE__, static_cast(gMaxNumberEtaSeparations)); + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (lEtaSeparationsValues[e] < 0.) { + LOGF(fatal, "\033[1;31m%s at line %d : lEtaSeparationsValues[%d] = %f is not >= 0. \n \033[0m", __FUNCTION__, __LINE__, e, static_cast(lEtaSeparationsValues[e])); + } + es.fEtaSeparationsValues[e] = lEtaSeparationsValues[e]; + } + + auto lEtaSeparationsSkipHarmonics = cf_es.cfEtaSeparationsSkipHarmonics.value; + if (lEtaSeparationsSkipHarmonics.size() != gMaxHarmonic) { + LOGF(info, "\033[1;31m lEtaSeparationsSkipHarmonics.size() = %d\033[0m", lEtaSeparationsSkipHarmonics.size()); + LOGF(info, "\033[1;31m gMaxHarmonic) = %d\033[0m", static_cast(gMaxHarmonic)); + LOGF(fatal, "\033[1;31m%s at line %d : Mismatch in the number of flags in configurable cfEtaSeparationsSkipHarmonics, and max number of supported harmonics \n \033[0m", __FUNCTION__, __LINE__); + } + + for (Int_t h = 0; h < static_cast(lEtaSeparationsSkipHarmonics.size()); h++) { + es.fEtaSeparationsSkipHarmonics[h] = Alright(lEtaSeparationsSkipHarmonics[h]); + } + + } // if(es.fCalculateEtaSeparations) { + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -1641,9 +1680,14 @@ void InsanityChecksBeforeBooking() // a) Insanity checks on configuration: + // **) Dry run and internal validation are not meant to be run together: + if (tc.fDryRun && iv.fUseInternalValidation) { + LOGF(fatal, "\033[1;31m%s at line %d : Dry run and internal validation are not meant to be run together\033[0m", __FUNCTION__, __LINE__); + } + // **) Cannot calculate multiparticle correlations, in case Q-vectors are not filled: if (mupa.fCalculateCorrelations && !qv.fCalculateQvectors) { - LOGF(fatal, "\033[1;31m%s at line %d : Cannot calculate multiparticle correlations, in case Q-vectors are not filled \033[0m", __FUNCTION__, __LINE__); + LOGF(fatal, "\033[1;31m%s at line %d : Cannot calculate multiparticle correlations, in case Q-vectors are not calculated \033[0m", __FUNCTION__, __LINE__); } // **) If some differential "correlations" flag is set to true, but the main fCalculateCorrelations is false, only print the warning that that differential correlations won't be calculated. @@ -1869,14 +1913,6 @@ void InsanityChecksBeforeBooking() LOGF(fatal, "\033[1;31m%s at line %d : iv.fnEventsInternalValidation <= 0 => Set number of events to positive integer\033[0m", __FUNCTION__, __LINE__); } - if (pw.fUseWeights[wPHI] || pw.fUseWeights[wPT] || pw.fUseWeights[wETA]) { - LOGF(fatal, "\033[1;31m%s at line %d : integrated weights are not supported (yet) for internal validation. \033[0m", __FUNCTION__, __LINE__); - } - - if (pw.fUseDiffWeights[wPHIPT] || pw.fUseDiffWeights[wPHIETA]) { - LOGF(fatal, "\033[1;31m%s at line %d : differential weights are not supported (yet) for internal validation. \033[0m", __FUNCTION__, __LINE__); - } - if (iv.fRescaleWithTheoreticalInput && (nl.fCalculateNestedLoops || nl.fCalculateCustomNestedLoops || nl.fCalculateKineCustomNestedLoops)) { LOGF(fatal, "\033[1;31m%s at line %d : rescaling with theoretical input is not supported when cross-check is done with nested loops. \033[0m", __FUNCTION__, __LINE__); } @@ -2011,6 +2047,7 @@ void BookAndNestAllLists() // *) Toy NUA; // *) Internal validation; // *) Test0; + // *) Eta separations; // *) Results. if (tc.fVerbose) { @@ -2095,6 +2132,12 @@ void BookAndNestAllLists() t0.fTest0List->SetOwner(kTRUE); fBaseList->Add(t0.fTest0List); + // *) Eta separations: + es.fEtaSeparationsList = new TList(); + es.fEtaSeparationsList->SetName("EtaSeparations"); + es.fEtaSeparationsList->SetOwner(kTRUE); + fBaseList->Add(es.fEtaSeparationsList); + // *) Results: res.fResultsList = new TList(); res.fResultsList->SetName("Results"); @@ -2155,10 +2198,7 @@ void BookQAHistograms() qa.fQAList->Add(qa.fQAHistogramsPro); // b) Common local variables: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString sba[2] = {"before", "after"}; - TString sba_long[2] = {"before cuts", "after cuts"}; + // ... // c) Book specific QA 2D event histograms: // Binning of 2D event histos: TBI 20240503 see if you can automate all this @@ -2421,8 +2461,8 @@ void BookQAHistograms() } qa.fQAEventHistograms2D[t][rs][ba] = new TH2F( - Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Event[t], min_x_Event[t], max_x_Event[t], nBins_y_Event[t], min_y_Event[t], max_y_Event[t]); qa.fQAEventHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Event[t].Data()); qa.fQAEventHistograms2D[t][rs][ba]->GetYaxis()->SetTitle(title_y_Event[t].Data()); @@ -2485,8 +2525,8 @@ void BookQAHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { qa.fQAParticleHistograms2D[t][rs][ba] = new TH2F( - Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Particle[t], min_x_Particle[t], max_x_Particle[t], nBins_y_Particle[t], min_y_Particle[t], max_y_Particle[t]); qa.fQAParticleHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Particle[t].Data()); @@ -2530,10 +2570,7 @@ void BookEventHistograms() eh.fEventHistogramsList->Add(eh.fEventHistogramsPro); // b) Book specific control event histograms 1D: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString sba[2] = {"before", "after"}; - TString sba_long[2] = {"before cuts", "after cuts"}; + // ... for (Int_t t = 0; t < eEventHistograms_N; t++) // type, see enum eEventHistograms { @@ -2556,8 +2593,8 @@ void BookEventHistograms() continue; } eh.fEventHistograms[t][rs][ba] = new TH1F( - Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) static_cast(eh.fEventHistogramsBins[t][0]), eh.fEventHistogramsBins[t][1], eh.fEventHistogramsBins[t][2]); eh.fEventHistograms[t][rs][ba]->GetXaxis()->SetTitle(FancyFormatting(eh.fEventHistogramsName[t].Data())); @@ -2611,10 +2648,7 @@ void BookEventCutsHistograms() } // c) Book event cut counter histograms: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString scc[eCutCounter_N] = {"abs", "seq"}; - TString scc_long[eCutCounter_N] = {"absolute", "sequential"}; + // ... for (Int_t rs = 0; rs < 2; rs++) // reco/sim { @@ -2622,22 +2656,22 @@ void BookEventCutsHistograms() continue; } - for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // cut counter. I have to use "cuco", because "cc." is already reserved for struct "common cosmetics" { - if ((!ec.fUseEventCutCounterAbsolute && cc == eAbsolute) || (!ec.fUseEventCutCounterSequential && cc == eSequential)) { + if ((!ec.fUseEventCutCounterAbsolute && cuco == eAbsolute) || (!ec.fUseEventCutCounterSequential && cuco == eSequential)) { continue; } - ec.fEventCutCounterHist[rs][cc] = new TH1I(Form("fEventCutCounterHist[%s][%s]", srs[rs].Data(), scc[cc].Data()), Form("%s, %s, event cut counter (%s)", "__RUN_NUMBER__", srs_long[rs].Data(), scc_long[cc].Data()), eEventCuts_N, 0.5, static_cast(eEventCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects - // Yes, +0.5, because eEventCuts kicks off from 0 - ec.fEventCutCounterHist[rs][cc]->SetStats(kFALSE); - ec.fEventCutCounterHist[rs][cc]->SetLineColor(eColor); - ec.fEventCutCounterHist[rs][cc]->SetFillColor(eFillColor); + ec.fEventCutCounterHist[rs][cuco] = new TH1I(Form("fEventCutCounterHist[%s][%s]", cc.srs[rs].Data(), cc.scc[cuco].Data()), Form("%s, %s, event cut counter (%s)", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.scc_long[cuco].Data()), eEventCuts_N, 0.5, static_cast(eEventCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects + // Yes, +0.5, because eEventCuts kicks off from 0 + ec.fEventCutCounterHist[rs][cuco]->SetStats(kFALSE); + ec.fEventCutCounterHist[rs][cuco]->SetLineColor(eColor); + ec.fEventCutCounterHist[rs][cuco]->SetFillColor(eFillColor); // Remark: Bin labels are set later in a dry call to EventCuts, to accomodate sequential event cut counting - ec.fEventCutsList->Add(ec.fEventCutCounterHist[rs][cc]); + ec.fEventCutsList->Add(ec.fEventCutCounterHist[rs][cuco]); - } // for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + } // for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // enum eCutCounter } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim @@ -2673,11 +2707,7 @@ void BookParticleHistograms() ph.fParticleHistogramsList->Add(ph.fParticleHistogramsPro); // b) Book specific particle histograms 1D: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString sba[2] = {"before", "after"}; - TString sba_long[2] = {"before cuts", "after cuts"}; - + // ... for (Int_t t = 0; t < eParticleHistograms_N; t++) // type, see enum eParticleHistograms { if (!ph.fBookParticleHistograms[t]) { @@ -2699,8 +2729,8 @@ void BookParticleHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { - ph.fParticleHistograms[t][rs][ba] = new TH1F(Form("fParticleHistograms[%s][%s][%s]", ph.fParticleHistogramsName[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms[t][rs][ba] = new TH1F(Form("fParticleHistograms[%s][%s][%s]", ph.fParticleHistogramsName[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins[t][0]), ph.fParticleHistogramsBins[t][1], ph.fParticleHistogramsBins[t][2]); ph.fParticleHistograms[t][rs][ba]->SetLineColor(ec.fBeforeAfterColor[ba]); ph.fParticleHistograms[t][rs][ba]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); @@ -2754,21 +2784,21 @@ void BookParticleHistograms() // Remark: placeholder __RUN_NUMBER__ is handled in PropagateRunNumber(...) // *) variable-length binning for phi vs pt, but only in pt axis: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], res.fResultsPro[AFO_PT]->GetXaxis()->GetXbins()->GetSize() - 1, res.fResultsPro[AFO_PT]->GetXaxis()->GetXbins()->GetArray()); // yes, x-axis of "results vs pt" hist is y-axis here for 2D. } else if (ph.fParticleHistogramsName2D[t].EqualTo("Phi_vs_Eta") && res.fUseResultsProVariableLengthBins[AFO_ETA]) { // *) variable-length binning for phi vs eta, but only in eta axis: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], res.fResultsPro[AFO_ETA]->GetXaxis()->GetXbins()->GetSize() - 1, res.fResultsPro[AFO_ETA]->GetXaxis()->GetXbins()->GetArray()); // yes, x-axis of "results vs pt" hist is y-axis here for 2D } else { // default fixed-length binning: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], static_cast(ph.fParticleHistogramsBins2D[t][eY][0]), ph.fParticleHistogramsBins2D[t][eY][1], ph.fParticleHistogramsBins2D[t][eY][2]); } @@ -2826,11 +2856,7 @@ void BookParticleCutsHistograms() } // c) Book the particle cut counter (absolute): - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString scc[eCutCounter_N] = {"abs", "seq"}; - TString scc_long[eCutCounter_N] = {"absolute", "sequential"}; - + // ... for (Int_t rs = 0; rs < 2; rs++) // reco/sim { @@ -2838,23 +2864,23 @@ void BookParticleCutsHistograms() continue; } - for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // cut counter. I have to use "cuco", because "cc." is already reserved for struct "common cosmetics" { - if ((!pc.fUseParticleCutCounterAbsolute && cc == eAbsolute) || (!pc.fUseParticleCutCounterSequential && cc == eSequential)) { + if ((!pc.fUseParticleCutCounterAbsolute && cuco == eAbsolute) || (!pc.fUseParticleCutCounterSequential && cuco == eSequential)) { continue; } - pc.fParticleCutCounterHist[rs][cc] = new TH1I(Form("fParticleCutCounterHist[%s][%s]", srs[rs].Data(), scc[cc].Data()), Form("%s, %s, particle cut counter (%s)", "__RUN_NUMBER__", srs_long[rs].Data(), scc_long[cc].Data()), eParticleCuts_N, 0.5, static_cast(eParticleCuts_N) + 0.5); + pc.fParticleCutCounterHist[rs][cuco] = new TH1I(Form("fParticleCutCounterHist[%s][%s]", cc.srs[rs].Data(), cc.scc[cuco].Data()), Form("%s, %s, particle cut counter (%s)", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.scc_long[cuco].Data()), eParticleCuts_N, 0.5, static_cast(eParticleCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects // Yes, +0.5, because eParticleCuts kicks off from 0 - pc.fParticleCutCounterHist[rs][cc]->SetStats(kFALSE); - pc.fParticleCutCounterHist[rs][cc]->SetLineColor(eColor); - pc.fParticleCutCounterHist[rs][cc]->SetFillColor(eFillColor); + pc.fParticleCutCounterHist[rs][cuco]->SetStats(kFALSE); + pc.fParticleCutCounterHist[rs][cuco]->SetLineColor(eColor); + pc.fParticleCutCounterHist[rs][cuco]->SetFillColor(eFillColor); // Remark: Bin labels are set later in a dry call to ParticleCuts, to accomodate sequential particle cut counting - pc.fParticleCutsList->Add(pc.fParticleCutCounterHist[rs][cc]); + pc.fParticleCutsList->Add(pc.fParticleCutCounterHist[rs][cuco]); - } // for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + } // for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // enum eCutCounter } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim @@ -2880,7 +2906,8 @@ void BookQvectorHistograms() // Book all Q-vector histograms. // a) Book the profile holding flags; - // b) ... + // b) Book multiplicity distributions in A and B, for each eta separation; + // c) ... if (tc.fVerbose) { StartFunction(__FUNCTION__); @@ -2901,7 +2928,40 @@ void BookQvectorHistograms() qv.fQvectorFlagsPro->Fill(2.5, gMaxCorrelator); qv.fQvectorList->Add(qv.fQvectorFlagsPro); - // b) ... + // b) Book multiplicity distributions in A and B, for each eta separation: + TString sEtaSep[2] = {"A", "B"}; // A <=> -eta , B <=> + eta + TString sEtaSep_long[2] = {Form("%.2f < #eta <", pc.fdParticleCuts[eEta][eMin]), Form("< #eta < %.2f", pc.fdParticleCuts[eEta][eMax])}; + // yes, here I define first the part of intervals as etaCutMin < eta < "subevent boundary", and "subevent" boundary < eta < etaCutMax + // Then below in the loop, I inject for "subevent boundary" the corresponding fEtaSeparationsValues (devided by 2, becaus it's symmetric round 0) + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t rs = 0; rs < 2; rs++) { // reco/sim + if (Skip(rs)) { + continue; + } + for (Int_t ba = 0; ba < 2; ba++) { // before/after cuts + if (eBefore == ba) { + continue; // it make sense to fill these histos only for "eAfter", because Q-vectors are not filled for "eBefore" + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + qv.fMabDist[ab][rs][ba][e] = new TH1F(Form("fMabDist[%s][%s][%s][%d]", sEtaSep[ab].Data(), cc.srs[rs].Data(), cc.sba[ba].Data(), e), + Form("%s, %s, %s, %s", "__RUN_NUMBER__", + 0 == ab ? Form("%s -%.2f", sEtaSep_long[ab].Data(), es.fEtaSeparationsValues[e] / 2.) : Form("%.2f %s", es.fEtaSeparationsValues[e] / 2., sEtaSep_long[ab].Data()), cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + static_cast(eh.fEventHistogramsBins[eMultiplicity][0]), eh.fEventHistogramsBins[eMultiplicity][1], eh.fEventHistogramsBins[eMultiplicity][2]); // TBI 20241207 I have hardwired in this constructor "0 == ab", this can backfire... + qv.fMabDist[ab][rs][ba][e]->SetLineColor(ec.fBeforeAfterColor[ba]); + qv.fMabDist[ab][rs][ba][e]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); + qv.fMabDist[ab][rs][ba][e]->GetXaxis()->SetTitle("subevent multiplicity (sum of particle weights)"); + qv.fMabDist[ab][rs][ba][e]->SetMinimum(1.e-4); // so that I can switch to log scale, even if some bins are empty + // Remark: For empty histograms, when plotting interactively, because of this line, I will get + // E-TCanvas::Range: illegal world coordinates range .... + // But it's harmless, because in any case I do not care about the content of empty histogram... + qv.fMabDist[ab][rs][ba][e]->SetOption("hist"); // do not plot marker and error (see BanishmentLoopOverParticles why errors are not reliable) for each bin, only content + filled area. + qv.fQvectorList->Add(qv.fMabDist[ab][rs][ba][e]); + } + } + } + } + + // c) ... if (tc.fVerbose) { ExitFunction(__FUNCTION__); @@ -3507,6 +3567,8 @@ void InternalValidation() // To do: // 20231114 Do I need to add support for diff. weights also here? + // *) Set and propagate some fake run number; + // *) Fetch the weights for this particular run number. Do it only once; // a) Fourier like p.d.f. for azimuthal angles and flow amplitudes; // b) Loop over on-the-fly events. // b0) Reset ebye quantities; @@ -3521,6 +3583,19 @@ void InternalValidation() StartFunction(__FUNCTION__); } + // *) Set and propagate some fake run number: + tc.fRunNumber = "123456"; + PropagateRunNumber(); + + // *) Fetch the weights for this particular run number. Do it only once. + // TBI 20231012 If eventualy I can access programatically run number in init(...) at run time, this shall go there. + if (!pw.fParticleWeightsAreFetched) { + if (pw.fUseWeights[wPHI] || pw.fUseWeights[wPT] || pw.fUseWeights[wETA] || pw.fUseDiffWeights[wPHIPT] || pw.fUseDiffWeights[wPHIETA]) { + GetParticleWeights(); + pw.fParticleWeightsAreFetched = kTRUE; + } + } + // a) Fourier like p.d.f. for azimuthal angles and flow amplitudes: TF1* fPhiPDF = NULL; TF3* fvnPDF = NULL; @@ -3635,11 +3710,12 @@ void InternalValidation() dPhi = fPhiPDF->GetRandom(); // *) To increase performance, sample pt or eta only if requested: - if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT]) { + if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT] || es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { dPt = gRandom->Uniform(dPt_min, dPt_max); } - if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA]) { + if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA] || es.fCalculateEtaSeparations) { + // Yes, I have to use here es.fCalculateEtaSeparations , and not some differential flag, like for pt case above dEta = gRandom->Uniform(dEta_min, dEta_max); } @@ -3679,16 +3755,25 @@ void InternalValidation() !ph.fParticleHistograms2D[ePhiEta][eSim][eAfter] ? true : ph.fParticleHistograms2D[ePhiEta][eSim][eAfter]->Fill(dPhi, dEta); } + // Remark: Keep in sync all calls and flags below with the ones in MainLoopOverParticles(). // *) Integrated Q-vectors: - if (qv.fCalculateQvectors) { + if (qv.fCalculateQvectors || es.fCalculateEtaSeparations) { this->FillQvector(dPhi, dPt, dEta); // all 3 arguments are passed by reference } // *) Differential q-vectors: - if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT])) { + // **) pt-dependence: + if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT]) && !es.fCalculateEtaSeparations) { + // In this branch I do not need eta separation, so the ligher call can be executed: this->Fillqvector(dPhi, dPt, PTq); // first 2 arguments are passed by reference, 3rd argument is enum + } else if (es.fCalculateEtaSeparations && es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + // In this branch I do need eta separation, so the heavier call must be executed: + // Remark: Within Fillqvector() I check again all the relevant flags. + this->Fillqvector(dPhi, dPt, PTq, dEta); // first 2 arguments and the last one are passed by reference, 3rd argument is enum. "kine" variable is the 2nd argument } + // **) eta-dependence: if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA])) { + // Remark: For eta dependence I do not consider es.fCalculateEtaSeparations, because in this context that calculation is meaningless. this->Fillqvector(dPhi, dEta, ETAq); // first 2 arguments are passed by reference, 3rd argument is enum } @@ -3720,6 +3805,12 @@ void InternalValidation() !eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter] ? true : eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter]->Fill(ebye.fCurrentRunDuration); } + // *) Fill subevent multiplicities: + // Remark: I can call this one only after Qa and Qb vectors are filled: + if (es.fCalculateEtaSeparations) { + FillSubeventMultiplicities(); + } + // b5) Calculate everything for selected events and particles: CalculateEverything(); @@ -3918,6 +4009,95 @@ void BookTest0Histograms() //============================================================ +void BookEtaSeparationsHistograms() +{ + // Book all eta separations histograms. + + // a) Book the profile holding flags; + // b) Book what needs to be booked; + // c) Few quick insanity checks on booking. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Book the profile holding flags: + es.fEtaSeparationsFlagsPro = new TProfile("fEtaSeparationsFlagsPro", "flags for eta separations", 1, 0., 1.); + es.fEtaSeparationsFlagsPro->SetStats(kFALSE); + es.fEtaSeparationsFlagsPro->SetLineColor(eColor); + es.fEtaSeparationsFlagsPro->SetFillColor(eFillColor); + es.fEtaSeparationsFlagsPro->GetXaxis()->SetLabelSize(0.04); + es.fEtaSeparationsFlagsPro->GetXaxis()->SetBinLabel(1, "fCalculateEtaSeparations"); + es.fEtaSeparationsFlagsPro->Fill(0.5, es.fCalculateEtaSeparations); + es.fEtaSeparationsList->Add(es.fEtaSeparationsFlagsPro); + + if (!es.fCalculateEtaSeparations) { + return; + } + + // b) Book what needs to be booked: + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + for (Int_t v = 0; v < eAsFunctionOf_N; v++) { + // decide what is booked, then later valid pointer to fCorrelationsPro[k][n][v] is used as a boolean, in the standard way: + if (AFO_INTEGRATED == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTEGRATED]) { + continue; + } + if (AFO_MULTIPLICITY == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_MULTIPLICITY]) { + continue; + } + if (AFO_CENTRALITY == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_CENTRALITY]) { + continue; + } + if (AFO_PT == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + continue; + } + if (AFO_ETA == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_ETA]) { + continue; + } + if (AFO_OCCUPANCY == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_OCCUPANCY]) { + continue; + } + if (AFO_INTERACTIONRATE == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTERACTIONRATE]) { + continue; + } + if (AFO_CURRENTRUNDURATION == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_CURRENTRUNDURATION]) { + continue; + } + + if (!res.fResultsPro[v]) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + } + + es.fEtaSeparationsPro[h][e][v] = reinterpret_cast(res.fResultsPro[v]->Clone(Form("fEtaSeparationsPro[%d][%d][%s]", h, e, res.fResultsProRawName[v].Data()))); // yes + es.fEtaSeparationsPro[h][e][v]->SetStats(kFALSE); + es.fEtaSeparationsPro[h][e][v]->Sumw2(); + es.fEtaSeparationsPro[h][e][v]->SetTitle(Form("%d -%d, |#Delta#eta| > %.2f", h + 1, h + 1, es.fEtaSeparationsValues[e])); + es.fEtaSeparationsPro[h][e][v]->GetXaxis()->SetTitle(FancyFormatting(res.fResultsProXaxisTitle[v].Data())); + es.fEtaSeparationsList->Add(es.fEtaSeparationsPro[h][e][v]); // yes, this has to be here + } // for(Int_t v=0;vGetXaxis()->GetTitle()).EqualTo("integrated")) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); // ordering in enum eAsFunctionOf is not the same as in TString fResultsProXaxisTitle[eAsFunctionOf_N] + } + if (es.fEtaSeparationsPro[0][0][AFO_PT] && !TString(es.fEtaSeparationsPro[0][0][AFO_PT]->GetXaxis()->GetTitle()).EqualTo("p_{T}")) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); // ordering in enum eAsFunctionOf is not the same as in TString fResultsProXaxisTitle[eAsFunctionOf_N] + } + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void BookEtaSeparationsHistograms() + +//============================================================ + void BookResultsHistograms() { // Book all results histograms. @@ -4252,6 +4432,24 @@ void PropagateRunNumber() } // for(Int_t rs=0;rs<2;rs++) // reco/sim } // for(Int_t t=0;t -eta , ab = 1 <=> + eta + for (Int_t rs = 0; rs < 2; rs++) { // reco/sim + for (Int_t ba = 0; ba < 2; ba++) { // before/after cuts + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + if (!qv.fMabDist[ab][rs][ba][e]) { + continue; + } + histTitle = qv.fMabDist[ab][rs][ba][e]->GetTitle(); + if (histTitle.Contains("__RUN_NUMBER__")) { + histTitle.ReplaceAll("__RUN_NUMBER__", tc.fRunNumber.Data()); // it replaces in-place + qv.fMabDist[ab][rs][ba][e]->SetTitle(histTitle.Data()); + } + } + } + } + } + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -4349,6 +4547,7 @@ void ResetEventByEventQuantities() // b) Q-vectors: if (qv.fCalculateQvectors) { + // b0) generic Q-vector: ResetQ(); // b1) integrated Q-vector: @@ -4358,6 +4557,7 @@ void ResetEventByEventQuantities() qv.fQvector[h][wp] = TComplex(0., 0.); } } + // b2) diff. Q-vector: for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { qv.fqVectorEntries[PTq][bin - 1] = 0; // TBI 20240214 shall I loop also over enum's PTq and ETAq? If yes, fix it also below for qv.fqvector[PTq][bin - 1][... @@ -4371,6 +4571,49 @@ void ResetEventByEventQuantities() } // for (Int_t b = 0; b < gMaxNoBinsKine; b++ ) { } // if(qv.fCalculateQvectors) + // b3) integrated Q-vector needed for calculations with eta separations: + if (es.fCalculateEtaSeparations) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + qv.fQabVector[ab][h][e] = TComplex(0., 0.); + } + } + } + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + qv.fMab[ab][e] = 0.; + } + } + } + + // b4) diff. q-vector in pt needed for calculations with eta separations: + if (es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { // yes, for the time being, only as a function of pt makes sense if eta separation is used + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + qv.fqabVector[ab][bin][h][e] = TComplex(0., 0.); + } + } + } + } + + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + qv.fmab[ab][bin][e] = 0.; + } + } + } + } + // c) Reset ebe containers for nested loops: if (nl.fCalculateNestedLoops || nl.fCalculateCustomNestedLoops) { if (nl.ftaNestedLoops[0]) { @@ -4990,8 +5233,8 @@ Bool_t EventCut(Int_t rs, Int_t eventCut, eCutModus cutModus) // *) Do the thing: switch (cutModus) { case eCut: - if (tc.fVerbose) { - LOGF(info, "\033[1;31mEvent didn't pass the cut: %s\033[0m", ec.fEventCutName[eventCut].Data()); + if (tc.fVerboseEventCut) { + LOGF(info, "\033[1;31mEvent didn't survive the cut: %s\033[0m", ec.fEventCutName[eventCut].Data()); } return kFALSE; break; @@ -5020,6 +5263,88 @@ Bool_t EventCut(Int_t rs, Int_t eventCut, eCutModus cutModus) //============================================================ +bool RemainingEventCuts() +{ + // Remaining event cuts which can be applied ONLY after the main loop over particles. + // For instance, cut on total number of selected particles (eMultiplicity). + // Remark #1: Whichever cut I implement here, update EventCutsCounters(...) for that cut (like I did for eMultiplicity, as a sort of template). + // Remark #2: I do not have here templated arguments like in EventCuts(), because I do not anticipate using any getter from the framework directly here. + // Remark #3: With the current implementation, I support here only eCutCounterSequential, i.e. eCutCounterAbsolute is not supported for cuts applied here. + + // a) Determine if this function was called for generic rec or generic sim: + // *) eMultiplicity; + // ... + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Determine if this function was called for generic rec or generic sim: + // Remark: I can do it in this simplified way, because I do not anticipate I will call here any getters from the framework. + int rs = -1; + if (tc.fProcess[eGenericRec] || tc.fProcess[eGenericRecSim]) { + rs = eRec; // yes, I do not count in RecSim mode separately particles and rec and sim level which survived particle cuts + } else if (tc.fProcess[eGenericSim]) { + rs = eSim; + } + + // *) Multiplicity: (see documentation for ebye.fMultiplicity for its definition) + if (ec.fUseEventCuts[eMultiplicity]) { + if (ebye.fMultiplicity < ec.fdEventCuts[eMultiplicity][eMin] || ebye.fMultiplicity > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(ebye.fMultiplicity - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision) { + // Remark: I have to implement RemainingEventCuts() in a slightly different way as EventCuts() + EventCut(rs, eMultiplicity, eCut); // just a printout that this event didn't survive this cut + EventCut(rs, eMultiplicity, eCutCounterSequential); + return kFALSE; + } + } + + return kTRUE; + +} // bool RemainingEventCuts() + +//============================================================ + +template +void FillSubeventMultiplicities() +{ + // Fill subevent (defined via eta separation) multiplicities. + + // a) Fill reconstructed (common to Run 3, Run 2 and Run 1 + Test mode); + // b) Fill only simulated (common to Run 3, Run 2 and Run 1). + + // Remark: This function has to be called after Q-vectors are filled. It makes sense to fill these histograms only for "eAfter", + // becase Q-vectors are not filled before the event cuts. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Fill reconstructed (common to Run 3, Run 2 and Run 1 + Test mode): + if constexpr (rs == eRec || rs == eRecAndSim || rs == eRec_Run2 || rs == eRecAndSim_Run2 || rs == eRec_Run1 || rs == eRecAndSim_Run1 || rs == eTest) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + !qv.fMabDist[ab][eRec][eAfter][e] ? true : qv.fMabDist[ab][eRec][eAfter][e]->Fill(qv.fMab[ab][e]); + } + } + } + + // b) Fill only simulated (common to Run 3, Run 2 and Run 1): + if constexpr (rs == eSim || rs == eSim_Run2 || rs == eSim_Run1) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + !qv.fMabDist[ab][eSim][eAfter][e] ? true : qv.fMabDist[ab][eSim][eAfter][e]->Fill(qv.fMab[ab][e]); + } + } + } + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void FillSubeventMultiplicities() + +//============================================================ + template void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) { @@ -5052,6 +5377,7 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !eh.fEventHistograms[eReferenceMultiplicity][eRec][ba] ? true : eh.fEventHistograms[eReferenceMultiplicity][eRec][ba]->Fill(ebye.fReferenceMultiplicity); !eh.fEventHistograms[eCentrality][eRec][ba] ? true : eh.fEventHistograms[eCentrality][eRec][ba]->Fill(ebye.fCentrality); } + // QA: if (qa.fFillQAEventHistograms2D) { !qa.fQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity][eRec][ba]->Fill(ebye.fMultiplicity, ebye.fReferenceMultiplicity); @@ -5099,6 +5425,15 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // eh.fEventHistograms[eReferenceMultiplicity][eSim][ba]->Fill(ebye.fReferenceMultiplicity); // TBI 20241123 this case is still not supported in DetermineReferenceMultiplicity() // eh.fEventHistograms[eTotalMultiplicity][eSim][ba]->Fill(tracks.size()); // TBI 20231030 check further how to use the same thing for 'sim' } + + // Eta separations: + if (es.fCalculateEtaSeparations) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + !qv.fMabDist[ab][eSim][ba][e] ? true : qv.fMabDist[ab][eSim][ba][e]->Fill(qv.fMab[ab][e]); + } + } + } } // ----------------------------------------------------------------------------- @@ -7121,7 +7456,166 @@ void CalculateKineTest0(eAsFunctionOf AFO_variable) ExitFunction(__FUNCTION__); } -} // CalculateKineTest0(const char* kc) +} // CalculateKineTest0(eAsFunctionOf AFO_variable) + +//============================================================ + +void CalculateEtaSeparations() +{ + // Calculate correlations with pseudorapidity separations. + + // Remark: this is a port and generalization of void AliFlowAnalysisWithMultiparticleCorrelations::CalculateEtaGaps(AliFlowEventSimple *anEvent) + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // Calculate 2-p correlations with eta separations from Qa (-eta, index [0]) and Qb (+eta, index [1]) vectors: + Double_t correlation = 0.; + Double_t weight = 0.; + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (!(qv.fQabVector[0][h][e].Rho() > 0. && qv.fQabVector[1][h][e].Rho() > 0.)) { + continue; + } + if (!(qv.fMab[0][e] > 0. && qv.fMab[1][e] > 0.)) { + continue; + } + + // calculate correlation and weights with particular eta separation: + correlation = TComplex(qv.fQabVector[0][h][e] * TComplex::Conjugate(qv.fQabVector[1][h][e])).Re(); + weight = qv.fMab[0][e] * qv.fMab[1][e]; + + // for on-the-fly and internal validation, rescale results with theoretical value: + if (iv.fUseInternalValidation && iv.fRescaleWithTheoreticalInput && iv.fInternalValidationVnPsin[eVn] && TMath::Abs(iv.fInternalValidationVnPsin[eVn]->GetAt(h)) > 0.) { + correlation /= pow(iv.fInternalValidationVnPsin[eVn]->GetAt(h), 2.); + } + + // integrated: + if (es.fEtaSeparationsPro[h][e][AFO_INTEGRATED]) { + es.fEtaSeparationsPro[h][e][AFO_INTEGRATED]->Fill(0.5, correlation / weight, weight); + } + + // vs. multiplicity: + if (es.fEtaSeparationsPro[h][e][AFO_MULTIPLICITY]) { + es.fEtaSeparationsPro[h][e][AFO_MULTIPLICITY]->Fill(ebye.fMultiplicity + 0.5, correlation / weight, weight); + } + + // vs. centrality: + if (es.fEtaSeparationsPro[h][e][AFO_CENTRALITY]) { + es.fEtaSeparationsPro[h][e][AFO_CENTRALITY]->Fill(ebye.fCentrality, correlation / weight, weight); + } + + // vs. occupancy: + if (es.fEtaSeparationsPro[h][e][AFO_OCCUPANCY]) { + es.fEtaSeparationsPro[h][e][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, correlation / weight, weight); + } + + // vs. interaction rate: + if (es.fEtaSeparationsPro[h][e][AFO_INTERACTIONRATE]) { + es.fEtaSeparationsPro[h][e][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, correlation / weight, weight); + } + + // vs. current run duration: + if (es.fEtaSeparationsPro[h][e][AFO_CURRENTRUNDURATION]) { + es.fEtaSeparationsPro[h][e][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, correlation / weight, weight); + } + + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void CalculateEtaSeparations() + +//============================================================ + +void CalculateKineEtaSeparations(eAsFunctionOf AFO_variable) +{ + // Calculate differential correlations with pseudorapidity separations. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // *) ... + eqvectorKine qvKine = eqvectorKine_N; // which eqvectorKine enum + Int_t nBins = -1; + + switch (AFO_variable) { + case AFO_PT: + qvKine = PTq; + nBins = res.fResultsPro[AFO_PT]->GetNbinsX(); + break; + case AFO_ETA: + LOGF(fatal, "\033[1;31m%s at line %d : It doesn't make sense (i.e. AFO_ETA cannot be used here). \033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable)); + break; // obsolete, but it supresses the warning + default: + LOGF(fatal, "\033[1;31m%s at line %d : This AFO_variable = %d is not supported yet. \033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable)); + break; + } // switch(AFO_variable) + + // *) Insanity checks on above settings: + if (qvKine == eqvectorKine_N) { + LOGF(fatal, "\033[1;31m%s at line %d : qvKine == eqvectorKine_N => add some more entries to the case statement \033[0m", __FUNCTION__, __LINE__); + } + + // *) Uniform loop over bin for all kine variables: + for (Int_t b = 0; b < nBins; b++) { + + /* TBI 20241206 Do I need to adapt and apply this cut, also for Qa and Qb? If so, most likely I would need to apply it on sum, i.e. on entries in Qa + Qb + + // *) Ensures that in each bin of interest, I have the same cut on number of particles, like in integrated analysis: + if ((qv.fqVectorEntries[qvKine][b] < ec.fdEventCuts[eMultiplicity][eMin]) || (qv.fqVectorEntries[qvKine][b] > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(qv.fqVectorEntries[qvKine][b] - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision)) { + if (tc.fVerbose) { + LOGF(info, "\033[1;31m%s eMultiplicity cut in bin = %d, for qvKine = %d\033[0m", __FUNCTION__, b, static_cast(qvKine)); + } + } + */ + + // Calculate differential 2-p correlations with eta separations from Qa (-eta, index [0]) and Qb (+eta, index [1]) vectors: + Double_t correlation = 0.; + Double_t weight = 0.; + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (!(qv.fqabVector[0][b][h][e].Rho() > 0. && qv.fqabVector[1][b][h][e].Rho() > 0.)) { + continue; + } + if (!(qv.fmab[0][b][e] > 0. && qv.fmab[1][b][e] > 0.)) { + continue; + } + + // calculate correlation and weights with particular eta separation: + correlation = TComplex(qv.fqabVector[0][b][h][e] * TComplex::Conjugate(qv.fqabVector[1][b][h][e])).Re(); + weight = qv.fmab[0][b][e] * qv.fmab[1][b][e]; + + // for on-the-fly and internal validation, rescale results with theoretical value: + if (iv.fUseInternalValidation && iv.fRescaleWithTheoreticalInput && iv.fInternalValidationVnPsin[eVn] && TMath::Abs(iv.fInternalValidationVnPsin[eVn]->GetAt(h)) > 0.) { + correlation /= pow(iv.fInternalValidationVnPsin[eVn]->GetAt(h), 2.); + } + + // finally, fill: + if (es.fEtaSeparationsPro[h][e][AFO_variable]) { + es.fEtaSeparationsPro[h][e][AFO_variable]->Fill(es.fEtaSeparationsPro[h][e][AFO_variable]->GetXaxis()->GetBinCenter(b + 1), correlation / weight, weight); + } + } + } + } // for (Int_t b = 0; b < nBins; b++) { + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void CalculateKineEtaSeparations() //============================================================ @@ -7536,7 +8030,7 @@ void ComparisonNestedLoopsVsCorrelations() } } // if(TMath::Abs(valueQV)>0. && TMath::Abs(valueNL)>0.) } // for(Int_t b=1;b<=nBinsQV;b++) - } // for(Int_t h=0;h<6;h++) + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { LOGF(info, ""); // new line } // for(Int_t o=0;o<4;o++) } // for (Int_t v = 0; v < 3; v++) @@ -8103,7 +8597,8 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const runNumberWithLeadingZeroes += runNumber; // another try, with "000" prepended to run number listWithRuns = reinterpret_cast(GetObjectFromList(baseList, runNumberWithLeadingZeroes.Data())); if (!listWithRuns) { - LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + // baseList->ls(); + LOGF(fatal, "\033[1;31m%s at line %d : this crash can happen if in the output file there is no list with weights for the current run number = %s\033[0m", __FUNCTION__, __LINE__, tc.fRunNumber.Data()); } } @@ -8182,7 +8677,7 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const LOGF(fatal, "\033[1;33m min = %f, max = %f, res.fResultsPro[AFO]->GetName() = %s\033[0m", min, max, res.fResultsPro[AFO]->GetName()); } - // Compare with min and max value store in external weights.root file using MakeWeights.C: + // Compare with min and max value stored in external weights.root file using MakeWeights.C: if (!(TMath::Abs(TString(oa->At(nEntries - 1)->GetName()).Atof() - max) < tc.fFloatingPointPrecision)) { LOGF(info, "\033[1;33m hist->GetTitle() = %s, res.fResultsPro[AFO]->GetName() = %s\033[0m", hist->GetTitle(), res.fResultsPro[AFO]->GetName()); LOGF(fatal, "in function \033[1;31m%s at line %d : mismatch in upper bin boundaries \n from title = %f , local = %f\033[0m", __FUNCTION__, __LINE__, TString(oa->At(nEntries - 1)->GetName()).Atof(), max); @@ -10251,7 +10746,7 @@ void RandomIndices(Int_t nTracks) template void BanishmentLoopOverParticles(T const& tracks) { - // This is the quick banishment loop over particles, as a support for eSelectedTracks cut. + // This is the quick banishment loop over particles, as a support for eSelectedTracks cut (used through eMultiplicity, see comments for ebye.fMultiplicity). // This is particularly relevant to get all efficiency corrections right. // The underlying problem is that particle histograms got filled before eSelectedTracks could be applied in Steer. // Therefore, particle histograms got filled even for events which were rejected by eSelectedTracks cut. @@ -10275,7 +10770,7 @@ void BanishmentLoopOverParticles(T const& tracks) } // *) Counter of selected tracks in the current event: - Int_t lSelectedTracks = 0; // I could reset and reuse here ebye.fSelectedTracks, but it's safer to use separate local variable, as I can did additional insanity checks here + Int_t lSelectedTracks = 0; // I could reset and reuse here ebye.fSelectedTracks, but it's safer to use separate local variable, as I can do additional insanity checks here // *) Banishment loop over particles: // for (auto& track : tracks) { // default standard way of looping of tracks @@ -10303,18 +10798,21 @@ void BanishmentLoopOverParticles(T const& tracks) // } // *) Particle cuts: - if (!ParticleCuts(track, eCut)) { // Main call for event cuts. + if (!ParticleCuts(track, eCut)) { // Main call for particle cuts. continue; // not return!! } - // *) Increase the local selected particle counter: - lSelectedTracks++; - // *) Banish particle histograms after particle cuts: if (ph.fFillParticleHistograms || ph.fFillParticleHistograms2D || qa.fFillQAParticleHistograms2D) { FillParticleHistograms(track, eAfter, -1); // with negative weight -1, I effectively remove the previous fill for this track } + // *) Increase the local selected particle counter: + lSelectedTracks++; + if (lSelectedTracks >= ec.fdEventCuts[eMultiplicity][eMax]) { + break; + } + // *) Break the loop if fixed number of particles is taken randomly from each event (use always in combination with tc.fUseFisherYates = kTRUE): if (tc.fFixedNumberOfRandomlySelectedTracks > 0 && tc.fFixedNumberOfRandomlySelectedTracks == lSelectedTracks) { LOGF(info, "%s : Breaking the loop over particles, since requested fixed number of %d particles was reached", __FUNCTION__, tc.fFixedNumberOfRandomlySelectedTracks); @@ -10478,6 +10976,7 @@ void BailOut(Bool_t finalBailout = kFALSE) bailOutList->Add(nua.fNUAList); bailOutList->Add(iv.fInternalValidationList); bailOutList->Add(t0.fTest0List); + bailOutList->Add(es.fEtaSeparationsList); bailOutList->Add(res.fResultsList); // *) Add list with nested list to TDirectoryFile: @@ -10563,6 +11062,36 @@ void FillQvector(const Double_t& dPhi, const Double_t& dPt, const Double_t& dEta } // for(Int_t h=0;h 0.) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (dEta > es.fEtaSeparationsValues[e] / 2.) { // yes, if eta separation is 0.2, then separation interval runs from -0.1 to 0.1 + qv.fMab[1][e] += wPhi * wPt * wEta; + for (Int_t h = 0; h < gMaxHarmonic; h++) { + { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + qv.fQabVector[1][h][e] += TComplex(wPhi * wPt * wEta * TMath::Cos((h + 1) * dPhi), wPhi * wPt * wEta * TMath::Sin((h + 1) * dPhi)); + } + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + } + } + } // if(es.fCalculateEtaSeparations) { + if (tc.fVerboseForEachParticle) { ExitFunction(__FUNCTION__); } @@ -10571,10 +11100,11 @@ void FillQvector(const Double_t& dPhi, const Double_t& dPt, const Double_t& dEta //============================================================ -void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKine kineVarChoice) +void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKine kineVarChoice, const Double_t& dEta = 0.) { // Fill differential q-vector, in generic kinematic variable. Here "kine" originally meant vs. pt or vs. eta, now it's general. - // Example usage: this->Fillqvector(dPhi, dPt, PTq); + // Example usage #1: this->Fillqvector(dPhi, dPt, PTq); // differential q-vectors without using eta separations + // Example usage #2: this->Fillqvector(dPhi, dPt, PTq, dEta); // differential q-vectors with using eta separations (I need dEta of particle to decide whether particle is added to qa or qb) if (tc.fVerboseForEachParticle) { StartFunction(__FUNCTION__); @@ -10666,11 +11196,47 @@ void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKin // *) Multiplicity counter in this bin: qv.fqVectorEntries[kineVarChoice][bin - 1]++; // count number of particles in this pt bin in this event + // *) Usage of eta separations in differential correlations: + if (es.fCalculateEtaSeparations && es.fCalculateEtaSeparationsAsFunctionOf[AFO_var]) { // yes, I can decouple this one from if (qv.fCalculateQvectors) + + if (AFO_var == AFO_ETA) { + LOGF(fatal, "\033[1;31m%s at line %d : AFO_var == AFO_ETA . This doesn't make any sense in this context. \033[0m", __FUNCTION__, __LINE__); + } + + if (dEta < 0.) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (dEta < -1. * es.fEtaSeparationsValues[e] / 2.) { // yes, if eta separation is 0.2, then separation interval runs from -0.1 to 0.1 + qv.fmab[0][bin - 1][e] += diffPhiWeightsForThisKineVar * kineVarWeight; // Remark: I can hardwire linear weight like this only for 2-p correlation + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + qv.fqabVector[0][bin - 1][h][e] += TComplex(diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Cos((h + 1) * dPhi), diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Sin((h + 1) * dPhi)); // Remark: I can hardwire linear weight like this only for 2-p correlation + } + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + } else if (dEta > 0.) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (dEta > es.fEtaSeparationsValues[e] / 2.) { // yes, if eta separation is 0.2, then separation interval runs from -0.1 to 0.1 + qv.fmab[1][bin - 1][e] += diffPhiWeightsForThisKineVar * kineVarWeight; // Remark: I can hardwire linear weight like this only for 2-p correlation + for (Int_t h = 0; h < gMaxHarmonic; h++) { + { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + qv.fqabVector[1][bin - 1][h][e] += TComplex(diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Cos((h + 1) * dPhi), diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Sin((h + 1) * dPhi)); // Remark: I can hardwire linear weight like this only for 2-p correlation + } + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + } + } + } // if(es.fCalculateEtaSeparations) { + if (tc.fVerboseForEachParticle) { ExitFunction(__FUNCTION__); } -} // void Fillqvector(const Double_t &dPhi, const Double_t &kineVarValue, eqvectorKine kineVarChoice) +} // void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKine kineVarChoice) //============================================================ @@ -10722,6 +11288,14 @@ void CalculateEverything() } } + // *) Calculate correlations with eta separations: + if (es.fCalculateEtaSeparations) { + this->CalculateEtaSeparations(); + if (es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + this->CalculateKineEtaSeparations(AFO_PT); // The implementation of CalculateKineEtaSeparations( ... ) is generic and can be used for any other "kine" variable, for which it makes sense + } + } + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -10816,16 +11390,25 @@ void MainLoopOverParticles(T const& tracks) dPt = track.pt(); dEta = track.eta(); + // Remark: Keep in sync all calls and flags below with the ones in InternalValidation(). // *) Integrated Q-vectors: - if (qv.fCalculateQvectors) { + if (qv.fCalculateQvectors || es.fCalculateEtaSeparations) { this->FillQvector(dPhi, dPt, dEta); // all 3 arguments are passed by reference } // *) Differential q-vectors: - if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT])) { + // **) pt-dependence: + if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT]) && !es.fCalculateEtaSeparations) { + // In this branch I do not need eta separation, so the ligher call can be executed: this->Fillqvector(dPhi, dPt, PTq); // first 2 arguments are passed by reference, 3rd argument is enum + } else if (es.fCalculateEtaSeparations && es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + // In this branch I do need eta separation, so the heavier call must be executed: + // Remark: Within Fillqvector() I check again all the relevant flags. + this->Fillqvector(dPhi, dPt, PTq, dEta); // first 2 arguments and the last one are passed by reference, 3rd argument is enum. "kine" variable is the 2nd argument } + // **) eta-dependence: if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA])) { + // Remark: For eta dependence I do not consider es.fCalculateEtaSeparations, because in this context that calculation is meaningless. this->Fillqvector(dPhi, dEta, ETAq); // first 2 arguments are passed by reference, 3rd argument is enum } @@ -10942,31 +11525,24 @@ void Steer(T1 const& collision, T2 const& bcs, T3 const& tracks) DetermineMultiplicity(); // *) Remaining event cuts which can be applied only after the loop over particles is performed: - if (ebye.fMultiplicity < ec.fdEventCuts[eMultiplicity][eMin] || ebye.fMultiplicity > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(ebye.fMultiplicity - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision) { - if (tc.fVerbose) { - LOGF(info, "\033[1;31m%s eMultiplicity \033[0m", __FUNCTION__); - } - // **) Special treatment for event cut counter: - // TBI 20240514 not sure if everything is done here correctly. Do some additional validation checks, and them move all this to some dedicated member function, e.g. RemainingEventCuts() - if (tc.fProcess[eGenericRec] || tc.fProcess[eGenericRecSim]) { - EventCut(eRec, eMultiplicity, eCutCounterSequential); - } - if (tc.fProcess[eGenericSim] || tc.fProcess[eGenericRecSim]) { - EventCut(eSim, eMultiplicity, eCutCounterSequential); - } - - // TBI 20240514 Do I need to do here also something about particle cut counters? Most likely yes, but it's not that important, really - - BanishmentLoopOverParticles(tracks); // yes, I need to remove particles from ParticleHistograms, which were filled in the MainLoopOverParticles also for events < eMultiplicity + if (!RemainingEventCuts()) { + // yes, I need to remove particles from ParticleHistograms, which were filled in the MainLoopOverParticles also for events which didn't survive RemainingEventCuts + BanishmentLoopOverParticles(tracks); ResetEventByEventQuantities(); return; } - // *) Fill event histograms after event AND particle cuts: // TBI 20240110 not sure still if this one is called here, or it has to be moved above + // *) Fill event histograms after event AND particle cuts: if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { FillEventHistograms(collision, tracks, eAfter); } + // *) Fill subevent multiplicities: + // Remark: I can call this one only after Qa and Qb vectors are filled, and after all particle and event cuts: + if (es.fCalculateEtaSeparations) { + FillSubeventMultiplicities(); + } + // *) Calculate everything for selected events and particles: CalculateEverything(); diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index 16ff6dae966..26bf84b0403 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -153,6 +153,7 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to BookNUAHistograms(); BookInternalValidationHistograms(); BookTest0Histograms(); + BookEtaSeparationsHistograms(); BookTheRest(); // here I book everything that was not sorted (yet) in the specific functions above // *) Insanity checks after booking: From 01bf22666f282913f69a2a06b94f3277a88e3d37 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 9 Dec 2024 00:23:03 +0100 Subject: [PATCH 83/91] [PWGCF] DptDpt - Making the corrections dimensions configurable (#8864) Co-authored-by: Victor --- PWGCF/Tasks/dptdptcorrelations.cxx | 540 +++++++++++++++-------------- 1 file changed, 281 insertions(+), 259 deletions(-) diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index 2d751a00db0..62e71e28e90 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -10,8 +10,10 @@ // or submit itself to any jurisdiction. /// \file dptdptcorrelations.cxx +/// \brief implements two-particle correlations base data collection +/// \author victor.gonzalez.sebastian@gmail.com + #include -#include #include #include #include @@ -66,6 +68,7 @@ float deltaphibinwidth = constants::math::TwoPI / deltaphibins; float deltaphilow = 0.0 - deltaphibinwidth / 2.0; float deltaphiup = constants::math::TwoPI - deltaphibinwidth / 2.0; +int nNoOfDimensions = 1; // number of dimensions for the NUA & NUE corrections bool processpairs = false; // process pairs analysis bool processmixedevents = false; // process mixed events bool ptorder = false; // consider pt ordering @@ -94,34 +97,34 @@ struct DptDptCorrelationsTask { // The DptDptCorrelationsAnalysisTask output objects //============================================================================================ /* histograms */ - TH1F* fhVertexZA; //! fhN1_vsPt{nch, nullptr}; //! fhN1_vsEtaPhi{nch, nullptr}; //! fhSum1Pt_vsEtaPhi{nch, nullptr}; //! fhN1_vsZEtaPhiPt{nch, nullptr}; //! fhSum1Pt_vsZEtaPhiPt{nch, nullptr}; //! fhNuaNue{nch, nullptr}; //! fhPtAvg_vsEtaPhi{nch, nullptr}; //!> fhN2_vsPtPt{nch, {nch, nullptr}}; //!> fhN2_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhN2cont_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2PtPt_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2DptDpt_vsDEtaDPhi{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ for the different species combinations - std::vector> fhSupN1N1_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSupPt1Pt1_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhInvMassDEta{nch, {nch, nullptr}}; //!> fhInvMassDPhi{nch, {nch, nullptr}}; //! fhN1VsPt{nch, nullptr}; //! fhN1VsEtaPhi{nch, nullptr}; //! fhSum1PtVsEtaPhi{nch, nullptr}; //! fhN1VsZEtaPhiPt{nch, nullptr}; //! fhSum1PtVsZEtaPhiPt{nch, nullptr}; //! fhNuaNue{nch, nullptr}; //! fhPtAvgVsEtaPhi{nch, nullptr}; //!> fhN2VsPtPt{nch, {nch, nullptr}}; //!> fhN2VsDEtaDPhi{nch, {nch, nullptr}}; //!> fhN2contVsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2PtPtVsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2DptDptVsDEtaDPhi{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ for the different species combinations + std::vector> fhSupN1N1VsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSupPt1Pt1VsDEtaDPhi{nch, {nch, nullptr}}; //!> fhInvMassDEta{nch, {nch, nullptr}}; //!> fhInvMassDPhi{nch, {nch, nullptr}}; //! fhN1_vsC{nch, nullptr}; //! fhSum1Pt_vsC{nch, nullptr}; //! fhN1nw_vsC{nch, nullptr}; //! fhSum1Ptnw_vsC{nch, nullptr}; //!> fhN2_vsC{nch, {nch, nullptr}}; //!> fhSum2PtPt_vsC{nch, {nch, nullptr}}; //!> fhSum2DptDpt_vsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations - std::vector> fhN2nw_vsC{nch, {nch, nullptr}}; //!> fhSum2PtPtnw_vsC{nch, {nch, nullptr}}; //!> fhSum2DptDptnw_vsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations + std::vector fhN1VsC{nch, nullptr}; //! fhSum1PtVsC{nch, nullptr}; //! fhN1nwVsC{nch, nullptr}; //! fhSum1PtnwVsC{nch, nullptr}; //!> fhN2VsC{nch, {nch, nullptr}}; //!> fhSum2PtPtVsC{nch, {nch, nullptr}}; //!> fhSum2DptDptVsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations + std::vector> fhN2nwVsC{nch, {nch, nullptr}}; //!> fhSum2PtPtnwVsC{nch, {nch, nullptr}}; //!> fhSum2DptDptnwVsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations bool ccdbstored = false; @@ -133,7 +136,7 @@ struct DptDptCorrelationsTask { /// \brief Returns the potentially phi origin shifted phi /// \param phi the track azimuthal angle /// \return the track phi origin shifted azimuthal angle - float GetShiftedPhi(float phi) + float getShiftedPhi(float phi) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; @@ -157,14 +160,14 @@ struct DptDptCorrelationsTask { /// the track has been accepted and it is within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - int GetEtaPhiIndex(TrackObject const& t) + int getEtaPhiIndex(TrackObject const& t) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; int etaix = static_cast((t.eta() - etalow) / etabinwidth); /* consider a potential phi origin shift */ - float phi = GetShiftedPhi(t.phi()); + float phi = getShiftedPhi(t.phi()); int phiix = static_cast((phi - philow) / phibinwidth); return etaix * phibins + phiix; } @@ -179,18 +182,18 @@ struct DptDptCorrelationsTask { /// the tracks have been accepted and they are within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - float GetDEtaValue(TrackObject const& t1, TrackObject const& t2) + float getDEtaValue(TrackObject const& t1, TrackObject const& t2) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; /* rule: ix are always zero based while bins are always one based */ - int etaix_1 = static_cast((t1.eta() - etalow) / etabinwidth); - int etaix_2 = static_cast((t2.eta() - etalow) / etabinwidth); + int etaIx1 = static_cast((t1.eta() - etalow) / etabinwidth); + int etaIx2 = static_cast((t2.eta() - etalow) / etabinwidth); - int deltaeta_ix = etaix_1 - etaix_2 + etabins - 1; + int deltaEtaIx = etaIx1 - etaIx2 + etabins - 1; - return deltaetalow + (deltaeta_ix + 0.5) * deltaetabinwidth; + return deltaetalow + (deltaEtaIx + 0.5) * deltaetabinwidth; } /// \brief Returns the delta phi value for the differential phi @@ -203,25 +206,25 @@ struct DptDptCorrelationsTask { /// the tracks have been accepted and they are within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - float GetDPhiValue(TrackObject const& t1, TrackObject const& t2) + float getDPhiValue(TrackObject const& t1, TrackObject const& t2) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; /* rule: ix are always zero based while bins are always one based */ /* consider a potential phi origin shift */ - float phi = GetShiftedPhi(t1.phi()); - int phiix_1 = static_cast((phi - philow) / phibinwidth); + float phi = getShiftedPhi(t1.phi()); + int phiIx1 = static_cast((phi - philow) / phibinwidth); /* consider a potential phi origin shift */ - phi = GetShiftedPhi(t2.phi()); - int phiix_2 = static_cast((phi - philow) / phibinwidth); + phi = getShiftedPhi(t2.phi()); + int phiIx2 = static_cast((phi - philow) / phibinwidth); - int deltaphi_ix = phiix_1 - phiix_2; - if (deltaphi_ix < 0) { - deltaphi_ix += phibins; + int deltaPhiIx = phiIx1 - phiIx2; + if (deltaPhiIx < 0) { + deltaPhiIx += phibins; } - float value = deltaphilow + (deltaphi_ix + 0.5) * deltaphibinwidth; + float value = deltaphilow + (deltaPhiIx + 0.5) * deltaphibinwidth; return (value < (deltaphiup - constants::math::PI)) ? value : value - constants::math::TwoPI; } @@ -236,28 +239,28 @@ struct DptDptCorrelationsTask { /// the tracks have been accepted and they are within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - int GetDEtaDPhiGlobalBin(TrackObject const& t1, TrackObject const& t2) + int getDEtaDPhiGlobalBin(TrackObject const& t1, TrackObject const& t2) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; /* rule: ix are always zero based while bins are always one based */ - int etaix_1 = static_cast((t1.eta() - etalow) / etabinwidth); + int etaIx1 = static_cast((t1.eta() - etalow) / etabinwidth); /* consider a potential phi origin shift */ - float phi = GetShiftedPhi(t1.phi()); - int phiix_1 = static_cast((phi - philow) / phibinwidth); - int etaix_2 = static_cast((t2.eta() - etalow) / etabinwidth); + float phi = getShiftedPhi(t1.phi()); + int phiIx1 = static_cast((phi - philow) / phibinwidth); + int etaIx2 = static_cast((t2.eta() - etalow) / etabinwidth); /* consider a potential phi origin shift */ - phi = GetShiftedPhi(t2.phi()); - int phiix_2 = static_cast((phi - philow) / phibinwidth); + phi = getShiftedPhi(t2.phi()); + int phiIx2 = static_cast((phi - philow) / phibinwidth); - int deltaeta_ix = etaix_1 - etaix_2 + etabins - 1; - int deltaphi_ix = phiix_1 - phiix_2; - if (deltaphi_ix < 0) { - deltaphi_ix += phibins; + int deltaEtaIx = etaIx1 - etaIx2 + etabins - 1; + int deltaPhiIx = phiIx1 - phiIx2; + if (deltaPhiIx < 0) { + deltaPhiIx += phibins; } - return fhN2_vsDEtaDPhi[0][0]->GetBin(deltaeta_ix + 1, deltaphi_ix + 1); + return fhN2VsDEtaDPhi[0][0]->GetBin(deltaEtaIx + 1, deltaPhiIx + 1); } /* taken from PWGCF/Core/PairCuts.h implemented by JFGO */ @@ -295,25 +298,32 @@ struct DptDptCorrelationsTask { void storeTrackCorrections(std::vector corrs) { + using namespace correlationstask; + LOGF(info, "Stored NUA&NUE corrections for %d track ids", corrs.size()); for (uint i = 0; i < corrs.size(); ++i) { - int nDimensions = corrs[i] != nullptr ? corrs[i]->GetDimension() : 0; - LOGF(info, " Stored NUA&NUE corrections %s for track id %d with %d dimensions %s", - corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nDimensions, corrs[i] != nullptr ? "yes" : "no"); + if (corrs[i] != nullptr) { + if (nNoOfDimensions != corrs[i]->GetDimension()) { + LOGF(fatal, " Corrections receved dimensions %d for track id %d different than expected %d", corrs[i]->GetDimension(), i, nNoOfDimensions); + } else { + LOGF(info, " Storing NUA&NUE corrections %s for track id %d with %d dimensions %s", + corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nNoOfDimensions, corrs[i] != nullptr ? "yes" : "no"); + } + } fhNuaNue[i] = corrs[i]; if (fhNuaNue[i] != nullptr) { int nbins = 0; double avg = 0.0; for (int ix = 0; ix < fhNuaNue[i]->GetNbinsX(); ++ix) { - if (nDimensions == 1) { + if (nNoOfDimensions == 1) { nbins++; avg += fhNuaNue[i]->GetBinContent(ix + 1); } else { for (int iy = 0; iy < fhNuaNue[i]->GetNbinsY(); ++iy) { - if (nDimensions == 2) { + if (nNoOfDimensions == 2) { nbins++; avg += fhNuaNue[i]->GetBinContent(ix + 1, iy + 1); - } else { + } else if (nNoOfDimensions == 3 || nNoOfDimensions == 4) { for (int iz = 0; iz < fhNuaNue[i]->GetNbinsZ(); ++iz) { nbins++; avg += fhNuaNue[i]->GetBinContent(ix + 1, iy + 1, iz + 1); @@ -333,25 +343,24 @@ struct DptDptCorrelationsTask { LOGF(info, "Stored pT average for %d track ids", ptavgs.size()); for (uint i = 0; i < ptavgs.size(); ++i) { LOGF(info, " Stored pT average for track id %d %s", i, ptavgs[i] != nullptr ? "yes" : "no"); - fhPtAvg_vsEtaPhi[i] = ptavgs[i]; + fhPtAvgVsEtaPhi[i] = ptavgs[i]; } ccdbstored = true; } - template + template std::vector* getTrackCorrections(TrackListObject const& tracks, float zvtx) { std::vector* corr = new std::vector(tracks.size(), 1.0f); int index = 0; - for (auto& t : tracks) { + for (const auto& t : tracks) { if (fhNuaNue[t.trackacceptedid()] != nullptr) { - int nDimensions = fhNuaNue[t.trackacceptedid()]->GetDimension(); - if (nDimensions == 1) { + if constexpr (nDim == 1) { (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(t.pt())); - } else if (nDimensions == 2) { + } else if constexpr (nDim == 2) { (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(t.eta(), t.pt())); - } else { - (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(zvtx, GetEtaPhiIndex(t) + 0.5, t.pt())); + } else if constexpr (nDim == 3) { + (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(zvtx, getEtaPhiIndex(t) + 0.5, t.pt())); } } index++; @@ -359,14 +368,29 @@ struct DptDptCorrelationsTask { return corr; } + template + std::vector* getTrackCorrections(TrackListObject const& tracks, float zvtx) + { + using namespace correlationstask; + + if (nNoOfDimensions == 1) { + return getTrackCorrections<1>(tracks, zvtx); + } else if (nNoOfDimensions == 2) { + return getTrackCorrections<2>(tracks, zvtx); + } else if (nNoOfDimensions == 3) { + return getTrackCorrections<3>(tracks, zvtx); + } + return getTrackCorrections<4>(tracks, zvtx); + } + template std::vector* getPtAvg(TrackListObject const& tracks) { std::vector* ptavg = new std::vector(tracks.size(), 0.0f); int index = 0; - for (auto& t : tracks) { - if (fhPtAvg_vsEtaPhi[t.trackacceptedid()] != nullptr) { - (*ptavg)[index] = fhPtAvg_vsEtaPhi[t.trackacceptedid()]->GetBinContent(fhPtAvg_vsEtaPhi[t.trackacceptedid()]->FindFixBin(t.eta(), t.phi())); + for (auto const& t : tracks) { + if (fhPtAvgVsEtaPhi[t.trackacceptedid()] != nullptr) { + (*ptavg)[index] = fhPtAvgVsEtaPhi[t.trackacceptedid()]->GetBinContent(fhPtAvgVsEtaPhi[t.trackacceptedid()]->FindFixBin(t.eta(), t.phi())); index++; } } @@ -380,15 +404,15 @@ struct DptDptCorrelationsTask { void processSingles(TrackListObject const& passedtracks, std::vector* corrs, float zvtx) { int index = 0; - for (auto& track : passedtracks) { + for (auto const& track : passedtracks) { float corr = (*corrs)[index]; - fhN1_vsPt[track.trackacceptedid()]->Fill(track.pt(), corr); + fhN1VsPt[track.trackacceptedid()]->Fill(track.pt(), corr); if constexpr (smallsingles) { - fhN1_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), corr); - fhSum1Pt_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), track.pt() * corr); + fhN1VsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), corr); + fhSum1PtVsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), track.pt() * corr); } else { - fhN1_vsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), corr); - fhSum1Pt_vsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), track.pt() * corr); + fhN1VsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, getEtaPhiIndex(track) + 0.5, track.pt(), corr); + fhSum1PtVsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, getEtaPhiIndex(track) + 0.5, track.pt(), track.pt() * corr); } index++; } @@ -409,22 +433,22 @@ struct DptDptCorrelationsTask { std::vector n1nw(nch, 0.0); ///< not weighted number of single tracks for current collision std::vector sum1Ptnw(nch, 0.0); ///< accumulated sum of not weighted single \f$p_T\f$ for current collision int index = 0; - for (auto& track : passedtracks) { + for (auto const& track : passedtracks) { float corr = (*corrs)[index]; n1[track.trackacceptedid()] += corr; sum1Pt[track.trackacceptedid()] += track.pt() * corr; n1nw[track.trackacceptedid()] += 1; sum1Ptnw[track.trackacceptedid()] += track.pt(); - fhN1_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), corr); - fhSum1Pt_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), track.pt() * corr); + fhN1VsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), corr); + fhSum1PtVsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), track.pt() * corr); index++; } for (uint tid = 0; tid < nch; ++tid) { - fhN1_vsC[tid]->Fill(cmul, n1[tid]); - fhSum1Pt_vsC[tid]->Fill(cmul, sum1Pt[tid]); - fhN1nw_vsC[tid]->Fill(cmul, n1nw[tid]); - fhSum1Ptnw_vsC[tid]->Fill(cmul, sum1Ptnw[tid]); + fhN1VsC[tid]->Fill(cmul, n1[tid]); + fhSum1PtVsC[tid]->Fill(cmul, sum1Pt[tid]); + fhN1nwVsC[tid]->Fill(cmul, n1nw[tid]); + fhSum1PtnwVsC[tid]->Fill(cmul, sum1Ptnw[tid]); } } @@ -450,11 +474,11 @@ struct DptDptCorrelationsTask { int globalbin = 0; LOGF(debug, "Initializing globalbin to ", globalbin); - for (auto& track1 : trks1) { - double ptavg_1 = (*ptavgs1)[index1]; + for (auto const& track1 : trks1) { + double ptAvg1 = (*ptavgs1)[index1]; double corr1 = (*corrs1)[index1]; int index2 = 0; - for (auto& track2 : trks2) { + for (auto const& track2 : trks2) { /* checking the same track id condition */ if (track1 == track2) { /* exclude autocorrelations */ @@ -469,15 +493,15 @@ struct DptDptCorrelationsTask { } } /* process pair magnitudes */ - double ptavg_2 = (*ptavgs2)[index2]; + double ptAvg2 = (*ptavgs2)[index2]; double corr2 = (*corrs2)[index2]; double corr = corr1 * corr2; - double dptdptnw = (track1.pt() - ptavg_1) * (track2.pt() - ptavg_2); - double dptdptw = (corr1 * track1.pt() - ptavg_1) * (corr2 * track2.pt() - ptavg_2); + double dptdptnw = (track1.pt() - ptAvg1) * (track2.pt() - ptAvg2); + double dptdptw = (corr1 * track1.pt() - ptAvg1) * (corr2 * track2.pt() - ptAvg2); /* get the global bin for filling the differential histograms */ if constexpr (docorrelations) { - globalbin = GetDEtaDPhiGlobalBin(track1, track2); + globalbin = getDEtaDPhiGlobalBin(track1, track2); } float deltaeta = track1.eta() - track2.eta(); float deltaphi = track1.phi() - track2.phi(); @@ -490,8 +514,8 @@ struct DptDptCorrelationsTask { if ((fUseConversionCuts && fPairCuts.conversionCuts(track1, track2)) || (fUseTwoTrackCut && fPairCuts.twoTrackCut(track1, track2, bfield))) { /* suppress the pair */ if constexpr (docorrelations) { - fhSupN1N1_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); - fhSupPt1Pt1_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); + fhSupN1N1VsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); + fhSupPt1Pt1VsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); } n2sup[track1.trackacceptedid()][track2.trackacceptedid()] += corr; } else { @@ -504,18 +528,18 @@ struct DptDptCorrelationsTask { sum2DptDptnw[track1.trackacceptedid()][track2.trackacceptedid()] += dptdptnw; if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); - fhN2cont_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(deltaeta, deltaphi, corr); - fhSum2DptDpt_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, dptdptw); - fhSum2PtPt_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); - fhN2_vsPtPt[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(track1.pt(), track2.pt(), corr); + fhN2VsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); + fhN2contVsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(deltaeta, deltaphi, corr); + fhSum2DptDptVsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, dptdptw); + fhSum2PtPtVsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); + fhN2VsPtPt[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(track1.pt(), track2.pt(), corr); } if constexpr (doinvmass) { if (!(track2.trackacceptedid() < track1.trackacceptedid())) { /* only 12 combinations, 21 are exactly the same */ double invariantMass = std::sqrt(getInvMassSquared(track1, poimass[static_cast(track1.trackacceptedid() / 2)], track2, poimass[static_cast(track2.trackacceptedid() / 2)])) * 1000.0f; - fhInvMassDEta[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(GetDEtaValue(track1, track2), invariantMass); - fhInvMassDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(GetDPhiValue(track1, track2), invariantMass); + fhInvMassDEta[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(getDEtaValue(track1, track2), invariantMass); + fhInvMassDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(getDPhiValue(track1, track2), invariantMass); } } } @@ -525,19 +549,19 @@ struct DptDptCorrelationsTask { } for (uint pid1 = 0; pid1 < nch; ++pid1) { for (uint pid2 = 0; pid2 < nch; ++pid2) { - fhN2_vsC[pid1][pid2]->Fill(cmul, n2[pid1][pid2]); - fhSum2PtPt_vsC[pid1][pid2]->Fill(cmul, sum2PtPt[pid1][pid2]); - fhSum2DptDpt_vsC[pid1][pid2]->Fill(cmul, sum2DptDpt[pid1][pid2]); - fhN2nw_vsC[pid1][pid2]->Fill(cmul, n2nw[pid1][pid2]); - fhSum2PtPtnw_vsC[pid1][pid2]->Fill(cmul, sum2PtPtnw[pid1][pid2]); - fhSum2DptDptnw_vsC[pid1][pid2]->Fill(cmul, sum2DptDptnw[pid1][pid2]); + fhN2VsC[pid1][pid2]->Fill(cmul, n2[pid1][pid2]); + fhSum2PtPtVsC[pid1][pid2]->Fill(cmul, sum2PtPt[pid1][pid2]); + fhSum2DptDptVsC[pid1][pid2]->Fill(cmul, sum2DptDpt[pid1][pid2]); + fhN2nwVsC[pid1][pid2]->Fill(cmul, n2nw[pid1][pid2]); + fhSum2PtPtnwVsC[pid1][pid2]->Fill(cmul, sum2PtPtnw[pid1][pid2]); + fhSum2DptDptnwVsC[pid1][pid2]->Fill(cmul, sum2DptDptnw[pid1][pid2]); /* let's also update the number of entries in the differential histograms */ if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[pid1][pid2]->SetEntries(fhN2_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); - fhSum2DptDpt_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2DptDpt_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); - fhSum2PtPt_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2PtPt_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); - fhSupN1N1_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSupN1N1_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); - fhSupPt1Pt1_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSupPt1Pt1_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); + fhN2VsDEtaDPhi[pid1][pid2]->SetEntries(fhN2VsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); + fhSum2DptDptVsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2DptDptVsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); + fhSum2PtPtVsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2PtPtVsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); + fhSupN1N1VsDEtaDPhi[pid1][pid2]->SetEntries(fhSupN1N1VsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); + fhSupPt1Pt1VsDEtaDPhi[pid1][pid2]->SetEntries(fhSupPt1Pt1VsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); } } } @@ -635,7 +659,7 @@ struct DptDptCorrelationsTask { LOGF(info, "Do invariant mass: %s; do correlation histograms: %s", doinvmass ? "yes" : "no", docorrelations ? "yes" : "no"); /* create the histograms */ - Bool_t oldstatus = TH1::AddDirectoryStatus(); + bool oldstatus = TH1::AddDirectoryStatus(); TH1::AddDirectory(kFALSE); if (!processpairs) { @@ -643,23 +667,23 @@ struct DptDptCorrelationsTask { fOutputList->Add(fhVertexZA); for (uint i = 0; i < nch; ++i) { /* histograms for each track, one and two */ - fhN1_vsPt[i] = new TH1F(TString::Format("n1_%s_vsPt", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;p_{t,%s} (GeV/c);#LT n_{1} #GT", tnames[i].c_str()).Data(), - ptbins, ptlow, ptup); + fhN1VsPt[i] = new TH1F(TString::Format("n1_%s_vsPt", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;p_{t,%s} (GeV/c);#LT n_{1} #GT", tnames[i].c_str()).Data(), + ptbins, ptlow, ptup); /* we don't want the Sumw2 structure being created here */ bool defSumw2 = TH1::GetDefaultSumw2(); if constexpr (smallsingles) { - fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), - etabins, etalow, etaup, phibins, philow, phiup); - fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", - tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) - .Data(), - etabins, etalow, etaup, phibins, philow, phiup); + fhN1VsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), + etabins, etalow, etaup, phibins, philow, phiup); + fhSum1PtVsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", + tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) + .Data(), + etabins, etalow, etaup, phibins, philow, phiup); } else { TH1::SetDefaultSumw2(false); - fhN1_vsZEtaPhiPt[i] = new TH3F( + fhN1VsZEtaPhiPt[i] = new TH3F( TString::Format("n1_%s_vsZ_vsEtaPhi_vsPt", tnames[i].c_str()).Data(), TString::Format("#LT n_{1} #GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)", tnames[i].c_str(), @@ -675,7 +699,7 @@ struct DptDptCorrelationsTask { ptbins, ptlow, ptup); - fhSum1Pt_vsZEtaPhiPt[i] = new TH3F( + fhSum1PtVsZEtaPhiPt[i] = new TH3F( TString::Format("sumPt1_%s_vsZ_vsEtaPhi_vsPt", tnames[i].c_str()).Data(), TString::Format( "#LT #Sigma p_{t,%s}#GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)", @@ -699,58 +723,58 @@ struct DptDptCorrelationsTask { /* the statistical uncertainties will be estimated by the subsamples method so let's get rid of the error tracking */ if constexpr (smallsingles) { - fhN1_vsEtaPhi[i]->SetBit(TH1::kIsNotW); - fhN1_vsEtaPhi[i]->Sumw2(false); - fhSum1Pt_vsEtaPhi[i]->SetBit(TH1::kIsNotW); - fhSum1Pt_vsEtaPhi[i]->Sumw2(false); + fhN1VsEtaPhi[i]->SetBit(TH1::kIsNotW); + fhN1VsEtaPhi[i]->Sumw2(false); + fhSum1PtVsEtaPhi[i]->SetBit(TH1::kIsNotW); + fhSum1PtVsEtaPhi[i]->Sumw2(false); } else { - fhN1_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); - fhN1_vsZEtaPhiPt[i]->Sumw2(false); - fhSum1Pt_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); - fhSum1Pt_vsZEtaPhiPt[i]->Sumw2(false); + fhN1VsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); + fhN1VsZEtaPhiPt[i]->Sumw2(false); + fhSum1PtVsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); + fhSum1PtVsZEtaPhiPt[i]->Sumw2(false); } fhNuaNue[i] = nullptr; - fhPtAvg_vsEtaPhi[i] = nullptr; + fhPtAvgVsEtaPhi[i] = nullptr; - fOutputList->Add(fhN1_vsPt[i]); + fOutputList->Add(fhN1VsPt[i]); if constexpr (smallsingles) { - fOutputList->Add(fhN1_vsEtaPhi[i]); - fOutputList->Add(fhSum1Pt_vsEtaPhi[i]); + fOutputList->Add(fhN1VsEtaPhi[i]); + fOutputList->Add(fhSum1PtVsEtaPhi[i]); } else { - fOutputList->Add(fhN1_vsZEtaPhiPt[i]); - fOutputList->Add(fhSum1Pt_vsZEtaPhiPt[i]); + fOutputList->Add(fhN1VsZEtaPhiPt[i]); + fOutputList->Add(fhSum1PtVsZEtaPhiPt[i]); } } } else { for (uint i = 0; i < nch; ++i) { /* histograms for each track species */ - fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), - etabins, etalow, etaup, phibins, philow, phiup); - fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", - tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) - .Data(), - etabins, etalow, etaup, phibins, philow, phiup); - fhN1_vsC[i] = new TProfile(TString::Format("n1_%s_vsM", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT (weighted);Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), - 100, 0.0, 100.0); - fhSum1Pt_vsC[i] = new TProfile(TString::Format("sumPt_%s_vsM", tnames[i].c_str()), - TString::Format("#LT #Sigma p_{t,%s} #GT (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), - 100, 0.0, 100.0); - fhN1nw_vsC[i] = new TProfile(TString::Format("n1Nw_%s_vsM", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), - 100, 0.0, 100.0); - fhSum1Ptnw_vsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tnames[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); + fhN1VsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), + etabins, etalow, etaup, phibins, philow, phiup); + fhSum1PtVsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", + tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) + .Data(), + etabins, etalow, etaup, phibins, philow, phiup); + fhN1VsC[i] = new TProfile(TString::Format("n1_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT (weighted);Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), + 100, 0.0, 100.0); + fhSum1PtVsC[i] = new TProfile(TString::Format("sumPt_%s_vsM", tnames[i].c_str()), + TString::Format("#LT #Sigma p_{t,%s} #GT (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), + 100, 0.0, 100.0); + fhN1nwVsC[i] = new TProfile(TString::Format("n1Nw_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), + 100, 0.0, 100.0); + fhSum1PtnwVsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); fhNuaNue[i] = nullptr; - fhPtAvg_vsEtaPhi[i] = nullptr; - fOutputList->Add(fhN1_vsEtaPhi[i]); - fOutputList->Add(fhSum1Pt_vsEtaPhi[i]); - fOutputList->Add(fhN1_vsC[i]); - fOutputList->Add(fhSum1Pt_vsC[i]); - fOutputList->Add(fhN1nw_vsC[i]); - fOutputList->Add(fhSum1Ptnw_vsC[i]); + fhPtAvgVsEtaPhi[i] = nullptr; + fOutputList->Add(fhN1VsEtaPhi[i]); + fOutputList->Add(fhSum1PtVsEtaPhi[i]); + fOutputList->Add(fhN1VsC[i]); + fOutputList->Add(fhSum1PtVsC[i]); + fOutputList->Add(fhN1nwVsC[i]); + fOutputList->Add(fhSum1PtnwVsC[i]); } for (uint i = 0; i < nch; ++i) { @@ -761,20 +785,20 @@ struct DptDptCorrelationsTask { TH1::SetDefaultSumw2(false); const char* pname = trackPairsNames[i][j].c_str(); if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhN2cont_vsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12cont_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSum2PtPt_vsDEtaDPhi[i][j] = new TH2F(TString::Format("sumPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSum2DptDpt_vsDEtaDPhi[i][j] = new TH2F(TString::Format("sumDptDpt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSupN1N1_vsDEtaDPhi[i][j] = new TH2F(TString::Format("suppn1n1_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT n_{1} #GT#LT n_{1} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{1} #GT#LT n_{1} #GT", pname), + fhN2VsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhN2contVsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12cont_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhSum2PtPtVsDEtaDPhi[i][j] = new TH2F(TString::Format("sumPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSupPt1Pt1_vsDEtaDPhi[i][j] = new TH2F(TString::Format("suppPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT p_{t,1} #GT#LT p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT p_{t,1} #GT#LT p_{t,2} #GT (GeV^{2})", pname), + fhSum2DptDptVsDEtaDPhi[i][j] = new TH2F(TString::Format("sumDptDpt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhN2_vsPtPt[i][j] = new TH2F(TString::Format("n2_12_vsPtVsPt_%s", pname), TString::Format("#LT n_{2} #GT (%s);p_{t,1} (GeV/c);p_{t,2} (GeV/c);#LT n_{2} #GT", pname), - ptbins, ptlow, ptup, ptbins, ptlow, ptup); + fhSupN1N1VsDEtaDPhi[i][j] = new TH2F(TString::Format("suppn1n1_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT n_{1} #GT#LT n_{1} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{1} #GT#LT n_{1} #GT", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhSupPt1Pt1VsDEtaDPhi[i][j] = new TH2F(TString::Format("suppPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT p_{t,1} #GT#LT p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT p_{t,1} #GT#LT p_{t,2} #GT (GeV^{2})", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhN2VsPtPt[i][j] = new TH2F(TString::Format("n2_12_vsPtVsPt_%s", pname), TString::Format("#LT n_{2} #GT (%s);p_{t,1} (GeV/c);p_{t,2} (GeV/c);#LT n_{2} #GT", pname), + ptbins, ptlow, ptup, ptbins, ptlow, ptup); } if constexpr (doinvmass) { if (!(j < i)) { @@ -788,27 +812,27 @@ struct DptDptCorrelationsTask { /* we return it back to previuos state */ TH1::SetDefaultSumw2(defSumw2); - fhN2_vsC[i][j] = new TProfile(TString::Format("n2_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); - fhSum2PtPt_vsC[i][j] = new TProfile(TString::Format("sumPtPt_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); - fhSum2DptDpt_vsC[i][j] = new TProfile(TString::Format("sumDptDpt_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); - fhN2nw_vsC[i][j] = new TProfile(TString::Format("n2Nw_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); - fhSum2PtPtnw_vsC[i][j] = new TProfile(TString::Format("sumPtPtNw_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); - fhSum2DptDptnw_vsC[i][j] = new TProfile(TString::Format("sumDptDptNw_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhN2VsC[i][j] = new TProfile(TString::Format("n2_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); + fhSum2PtPtVsC[i][j] = new TProfile(TString::Format("sumPtPt_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhSum2DptDptVsC[i][j] = new TProfile(TString::Format("sumDptDpt_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhN2nwVsC[i][j] = new TProfile(TString::Format("n2Nw_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); + fhSum2PtPtnwVsC[i][j] = new TProfile(TString::Format("sumPtPtNw_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhSum2DptDptnwVsC[i][j] = new TProfile(TString::Format("sumDptDptNw_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); /* the statistical uncertainties will be estimated by the subsamples method so let's get rid of the error tracking */ if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhN2_vsDEtaDPhi[i][j]->Sumw2(false); - fhN2cont_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhN2cont_vsDEtaDPhi[i][j]->Sumw2(false); - fhSum2PtPt_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSum2PtPt_vsDEtaDPhi[i][j]->Sumw2(false); - fhSum2DptDpt_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSum2DptDpt_vsDEtaDPhi[i][j]->Sumw2(false); - fhSupN1N1_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSupN1N1_vsDEtaDPhi[i][j]->Sumw2(false); - fhSupPt1Pt1_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSupPt1Pt1_vsDEtaDPhi[i][j]->Sumw2(false); + fhN2VsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhN2VsDEtaDPhi[i][j]->Sumw2(false); + fhN2contVsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhN2contVsDEtaDPhi[i][j]->Sumw2(false); + fhSum2PtPtVsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSum2PtPtVsDEtaDPhi[i][j]->Sumw2(false); + fhSum2DptDptVsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSum2DptDptVsDEtaDPhi[i][j]->Sumw2(false); + fhSupN1N1VsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSupN1N1VsDEtaDPhi[i][j]->Sumw2(false); + fhSupPt1Pt1VsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSupPt1Pt1VsDEtaDPhi[i][j]->Sumw2(false); } if constexpr (doinvmass) { if (!(j < i)) { @@ -821,13 +845,13 @@ struct DptDptCorrelationsTask { } if constexpr (docorrelations) { - fOutputList->Add(fhN2_vsDEtaDPhi[i][j]); - fOutputList->Add(fhN2cont_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSum2PtPt_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSum2DptDpt_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSupN1N1_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSupPt1Pt1_vsDEtaDPhi[i][j]); - fOutputList->Add(fhN2_vsPtPt[i][j]); + fOutputList->Add(fhN2VsDEtaDPhi[i][j]); + fOutputList->Add(fhN2contVsDEtaDPhi[i][j]); + fOutputList->Add(fhSum2PtPtVsDEtaDPhi[i][j]); + fOutputList->Add(fhSum2DptDptVsDEtaDPhi[i][j]); + fOutputList->Add(fhSupN1N1VsDEtaDPhi[i][j]); + fOutputList->Add(fhSupPt1Pt1VsDEtaDPhi[i][j]); + fOutputList->Add(fhN2VsPtPt[i][j]); } if constexpr (doinvmass) { if (!(j < i)) { @@ -836,12 +860,12 @@ struct DptDptCorrelationsTask { fOutputList->Add(fhInvMassDPhi[i][j]); } } - fOutputList->Add(fhN2_vsC[i][j]); - fOutputList->Add(fhSum2PtPt_vsC[i][j]); - fOutputList->Add(fhSum2DptDpt_vsC[i][j]); - fOutputList->Add(fhN2nw_vsC[i][j]); - fOutputList->Add(fhSum2PtPtnw_vsC[i][j]); - fOutputList->Add(fhSum2DptDptnw_vsC[i][j]); + fOutputList->Add(fhN2VsC[i][j]); + fOutputList->Add(fhSum2PtPtVsC[i][j]); + fOutputList->Add(fhSum2DptDptVsC[i][j]); + fOutputList->Add(fhN2nwVsC[i][j]); + fOutputList->Add(fhSum2PtPtnwVsC[i][j]); + fOutputList->Add(fhSum2DptDptnwVsC[i][j]); } } } @@ -859,7 +883,7 @@ struct DptDptCorrelationsTask { /* the data collecting engine instances */ DataCollectingEngine** dataCE; - DataCollectingEngine** dataCE_small; + DataCollectingEngine** dataCEsmall; DataCollectingEngine** dataCEME; /* the input file structure from CCDB */ @@ -871,8 +895,8 @@ struct DptDptCorrelationsTask { std::string cfgCCDBPeriod{"LHC22o"}; /* pair conversion suppression defaults */ - static constexpr float cfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; - Configurable> cfgPairCut{"paircut", {cfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Conversion suppressions"}; + static constexpr float kCfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; + Configurable> cfgPairCut{"paircut", {kCfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Conversion suppressions"}; /* two tracks cut */ Configurable cfgTwoTrackCut{"twotrackcut", -1, "Two-tracks cut: -1 = off; >0 otherwise distance value (suggested: 0.02"}; Configurable cfgTwoTrackCutMinRadius{"twotrackcutminradius", 0.8f, "Two-tracks cut: radius in m from which two-tracks cut is applied"}; @@ -883,6 +907,7 @@ struct DptDptCorrelationsTask { Configurable cfgProcessPairs{"processpairs", false, "Process pairs: false = no, just singles, true = yes, process pairs"}; Configurable cfgProcessME{"processmixedevents", false, "Process mixed events: false = no, just same event, true = yes, also process mixed events"}; Configurable cfgPtOrder{"ptorder", false, "enforce pT_1 < pT_2. Defalut: false"}; + Configurable cfgNoOfDimensions{"cfgNoOfDimensions", 1, "Number of dimensions for the NUA&NUE corrections. Default 1"}; OutputObj fOutput{"DptDptCorrelationsData", OutputObjHandlingPolicy::AnalysisObject, OutputObjSourceType::OutputObjSource}; void init(InitContext& initContext) @@ -925,6 +950,7 @@ struct DptDptCorrelationsTask { ptorder = cfgPtOrder.value; invmass = cfgDoInvMass.value; corrana = cfgDoCorrelations.value; + nNoOfDimensions = cfgNoOfDimensions.value; /* self configure the CCDB access to the input file */ getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdburl", cfgCCDBUrl, false); @@ -1039,7 +1065,7 @@ struct DptDptCorrelationsTask { fCentMultMax[0] = 100.0f; } if (cfgSmallDCE) { - dataCE_small = new DataCollectingEngine*[ncmranges]; + dataCEsmall = new DataCollectingEngine*[ncmranges]; } else { dataCE = new DataCollectingEngine*[ncmranges]; } @@ -1088,7 +1114,7 @@ struct DptDptCorrelationsTask { if (invmass) { LOGF(fatal, "Invariant mass cannot be used with singles in the small DCE mode, please configure properly!!"); } - dataCE_small[i] = builSmallDCEInstance(range.Data()); + dataCEsmall[i] = builSmallDCEInstance(range.Data()); } else { if (invmass) { if (!processpairs) { @@ -1171,6 +1197,14 @@ struct DptDptCorrelationsTask { return grpo->getNominalL3Field(); } + const char* getDimensionStr() + { + using namespace correlationstask; + + static constexpr std::string_view kStrDim[] = {"", "2D", "3D", "4D"}; + return kStrDim[nNoOfDimensions].data(); + } + template void processSame(FilterdCollision const& collision, FilteredTracks const& tracks, uint64_t timestamp = 0) { @@ -1187,21 +1221,21 @@ struct DptDptCorrelationsTask { if (!(ixDCE < 0)) { auto isCCDBstored = [&]() { if (cfgSmallDCE.value) { - return dataCE_small[ixDCE]->isCCDBstored(); + return dataCEsmall[ixDCE]->isCCDBstored(); } else { return dataCE[ixDCE]->isCCDBstored(); } }; auto storePtAverages = [&](auto& ptavgs) { if (cfgSmallDCE.value) { - dataCE_small[ixDCE]->storePtAverages(ptavgs); + dataCEsmall[ixDCE]->storePtAverages(ptavgs); } else { dataCE[ixDCE]->storePtAverages(ptavgs); } }; auto storeTrackCorrections = [&](auto& corrs) { if (cfgSmallDCE.value) { - dataCE_small[ixDCE]->storeTrackCorrections(corrs); + dataCEsmall[ixDCE]->storeTrackCorrections(corrs); } else { dataCE[ixDCE]->storeTrackCorrections(corrs); } @@ -1222,7 +1256,8 @@ struct DptDptCorrelationsTask { std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { corrs[isp] = reinterpret_cast(ccdblst->FindObject( - TString::Format("correction_%02d-%02d_%s", + TString::Format("correction%s_%02d-%02d_%s", + getDimensionStr(), static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), tnames[isp].c_str()) @@ -1259,7 +1294,7 @@ struct DptDptCorrelationsTask { bfield = (fUseConversionCuts || fUseTwoTrackCut) ? getMagneticField(timestamp) : 0; } if (cfgSmallDCE.value) { - dataCE_small[ixDCE]->processCollision(tracks, tracks, collision.posZ(), collision.centmult(), bfield); + dataCEsmall[ixDCE]->processCollision(tracks, tracks, collision.posZ(), collision.centmult(), bfield); } else { dataCE[ixDCE]->processCollision(tracks, tracks, collision.posZ(), collision.centmult(), bfield); } @@ -1296,7 +1331,8 @@ struct DptDptCorrelationsTask { std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { corrs[isp] = reinterpret_cast(ccdblst->FindObject( - TString::Format("correction_%02d-%02d_%s", + TString::Format("correction%s_%02d-%02d_%s", + getDimensionStr(), static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), tnames[isp].c_str()) @@ -1341,20 +1377,20 @@ struct DptDptCorrelationsTask { Filter onlyacceptedcollisions = (aod::dptdptfilter::collisionaccepted == uint8_t(true)); Filter onlyacceptedtracks = (aod::dptdptfilter::trackacceptedid >= int8_t(0)); - void processRecLevel(soa::Filtered::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered& tracks) + void processRecLevel(soa::Filtered::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered const& tracks) { processSame(collision, tracks, collision.bc_as().timestamp()); } PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevel, "Process reco level correlations", false); - void processRecLevelCheck(aod::Collisions const& collisions, aod::Tracks& tracks) + void processRecLevelCheck(aod::Collisions const& collisions, aod::Tracks const& tracks) { int nAssignedTracks = 0; int nNotAssignedTracks = 0; int64_t firstNotAssignedIndex = -1; int64_t lastNotAssignedIndex = -1; - for (auto track : tracks) { + for (auto const& track : tracks) { if (track.has_collision()) { nAssignedTracks++; } else { @@ -1374,14 +1410,14 @@ struct DptDptCorrelationsTask { } PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelCheck, "Process reco level checks", true); - void processGenLevelCheck(aod::McCollisions const& mccollisions, aod::McParticles& particles) + void processGenLevelCheck(aod::McCollisions const& mccollisions, aod::McParticles const& particles) { int nAssignedParticles = 0; int nNotAssignedParticles = 0; int64_t firstNotAssignedIndex = -1; int64_t lastNotAssignedIndex = -1; - for (auto particle : particles) { + for (auto const& particle : particles) { if (particle.has_mcCollision()) { nAssignedParticles++; } else { @@ -1404,18 +1440,15 @@ struct DptDptCorrelationsTask { void processRecLevelNotStored( soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, - soa::Filtered>& tracks) + soa::Filtered> const& tracks) { processSame(collision, tracks, collision.bc_as().timestamp()); } - PROCESS_SWITCH(DptDptCorrelationsTask, - processRecLevelNotStored, - "Process reco level correlations for not stored derived data", - true); + PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelNotStored, "Process reco level correlations for not stored derived data", true); void processGenLevel( soa::Filtered::iterator const& collision, - soa::Filtered>& tracks) + soa::Filtered> const& tracks) { processSame(collision, tracks); } @@ -1423,14 +1456,11 @@ struct DptDptCorrelationsTask { void processGenLevelNotStored( soa::Filtered>::iterator const& collision, - soa::Filtered>& particles) + soa::Filtered> const& particles) { processSame(collision, particles); } - PROCESS_SWITCH(DptDptCorrelationsTask, - processGenLevelNotStored, - "Process generator level correlations for not stored derived data", - false); + PROCESS_SWITCH(DptDptCorrelationsTask, processGenLevelNotStored, "Process generator level correlations for not stored derived data", false); std::vector vtxBinsEdges{VARIABLE_WIDTH, -7.0f, -5.0f, -3.0f, -1.0f, 1.0f, 3.0f, 5.0f, 7.0f}; @@ -1439,14 +1469,14 @@ struct DptDptCorrelationsTask { using BinningZVtxMultRec = ColumnBinningPolicy; BinningZVtxMultRec bindingOnVtxAndMultRec{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - void processRecLevelMixed(soa::Filtered& collisions, aod::BCsWithTimestamps const&, soa::Filtered& tracks) + void processRecLevelMixed(soa::Filtered const& collisions, aod::BCsWithTimestamps const&, soa::Filtered const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair, soa::Filtered, BinningZVtxMultRec> pairreco{bindingOnVtxAndMultRec, 5, -1, collisions, tracksTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored LOGF(DPTDPTLOGCOLLISIONS, "Received %d collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairreco) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairreco) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), collision1.posZ(), collision1.centmult(), collision1.collisionaccepted() ? "accepted" : "not accepted", @@ -1464,9 +1494,9 @@ struct DptDptCorrelationsTask { PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelMixed, "Process reco level mixed events correlations", false); void processRecLevelMixedNotStored( - soa::Filtered>& collisions, + soa::Filtered> const& collisions, aod::BCsWithTimestamps const&, - soa::Filtered>& tracks) + soa::Filtered> const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair>, @@ -1481,7 +1511,7 @@ struct DptDptCorrelationsTask { LOGF(DPTDPTLOGCOLLISIONS, "Received %d collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairreco) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairreco) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", @@ -1513,22 +1543,19 @@ struct DptDptCorrelationsTask { collision1.bc_as().timestamp()); } } - PROCESS_SWITCH(DptDptCorrelationsTask, - processRecLevelMixedNotStored, - "Process reco level mixed events correlations for not stored derived data", - false); + PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelMixedNotStored, "Process reco level mixed events correlations for not stored derived data", false); using BinningZVtxMultGen = ColumnBinningPolicy; BinningZVtxMultGen bindingOnVtxAndMultGen{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - void processGenLevelMixed(soa::Filtered& collisions, soa::Filtered& tracks) + void processGenLevelMixed(soa::Filtered const& collisions, soa::Filtered const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair, soa::Filtered, BinningZVtxMultGen> pairgen{bindingOnVtxAndMultGen, 5, -1, collisions, tracksTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored LOGF(DPTDPTLOGCOLLISIONS, "Received %d generated collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairgen) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairgen) { if (logcomb < 10) { 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", @@ -1544,9 +1571,7 @@ struct DptDptCorrelationsTask { } PROCESS_SWITCH(DptDptCorrelationsTask, processGenLevelMixed, "Process generator level mixed events correlations", false); - void processGenLevelMixedNotStored( - soa::Filtered>& collisions, - soa::Filtered>& tracks) + void processGenLevelMixedNotStored(soa::Filtered> const& collisions, soa::Filtered> const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair>, @@ -1561,7 +1586,7 @@ struct DptDptCorrelationsTask { LOGF(DPTDPTLOGCOLLISIONS, "Received %d generated collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairgen) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairgen) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received generated collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", @@ -1589,10 +1614,7 @@ struct DptDptCorrelationsTask { processMixed(collision1, tracks1, tracks2); } } - PROCESS_SWITCH(DptDptCorrelationsTask, - processGenLevelMixedNotStored, - "Process generator level mixed events correlations for not stored derived data", - false); + PROCESS_SWITCH(DptDptCorrelationsTask, processGenLevelMixedNotStored, "Process generator level mixed events correlations for not stored derived data", false); /// cleans the output object when the task is not used void processCleaner(soa::Filtered const& colls) @@ -1606,7 +1628,7 @@ struct DptDptCorrelationsTask { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskRec"}, SetDefaultProcesses{{{"processRecLevel", true}, {"processRecLevelMixed", false}, {"processCleaner", false}}}), - adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskGen"}, SetDefaultProcesses{{{"processGenLevel", false}, {"processGenLevelMixed", false}, {"processCleaner", true}}})}; + adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskRec"}, SetDefaultProcesses{{{"processRecLevel", true}, {"processRecLevelMixed", false}, {"processCleaner", false}}}), // o2-linter: disable=name/o2-task + adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskGen"}, SetDefaultProcesses{{{"processGenLevel", false}, {"processGenLevelMixed", false}, {"processCleaner", true}}})}; // o2-linter: disable=name/o2-task return workflow; } From 76f547bddf043b9ffc37fdd1078aed02c74567d5 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 9 Dec 2024 05:02:57 +0100 Subject: [PATCH 84/91] [Common] mult framework cleanup + timestamps (#8862) Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 78 ++++++++----------- .../TableProducer/multiplicityExtraTable.cxx | 1 + Common/Tasks/centralityStudy.cxx | 48 ++++++------ Common/Tasks/multiplicityQa.cxx | 6 +- 4 files changed, 61 insertions(+), 72 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index d6ffe63e2b4..1f4a17e11b3 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -206,54 +206,42 @@ DECLARE_SOA_TABLE(PVMultZeqs, "AOD", "PVMULTZEQ", //! Multiplicity equalized for using MultZeqs = soa::Join; using MultZeq = MultZeqs::iterator; -namespace multBC +namespace mult { -DECLARE_SOA_COLUMN(MultBCFT0A, multBCFT0A, float); //! -DECLARE_SOA_COLUMN(MultBCFT0C, multBCFT0C, float); //! -DECLARE_SOA_COLUMN(MultBCFV0A, multBCFV0A, float); //! -DECLARE_SOA_COLUMN(MultBCFDDA, multBCFDDA, float); //! -DECLARE_SOA_COLUMN(MultBCFDDC, multBCFDDC, float); //! - -DECLARE_SOA_COLUMN(MultBCZNA, multBCZNA, float); //! -DECLARE_SOA_COLUMN(MultBCZNC, multBCZNC, float); //! -DECLARE_SOA_COLUMN(MultBCZEM1, multBCZEM1, float); //! -DECLARE_SOA_COLUMN(MultBCZEM2, multBCZEM2, float); //! -DECLARE_SOA_COLUMN(MultBCZPA, multBCZPA, float); //! -DECLARE_SOA_COLUMN(MultBCZPC, multBCZPC, float); //! +// extra BC information +DECLARE_SOA_COLUMN(MultTVX, multTVX, bool); //! +DECLARE_SOA_COLUMN(MultFV0OrA, multFV0OrA, bool); //! +DECLARE_SOA_COLUMN(MultV0triggerBits, multV0triggerBits, uint8_t); //! +DECLARE_SOA_COLUMN(MultT0triggerBits, multT0triggerBits, uint8_t); //! +DECLARE_SOA_COLUMN(MultFDDtriggerBits, multFDDtriggerBits, uint8_t); //! +DECLARE_SOA_COLUMN(MultTriggerMask, multTriggerMask, uint64_t); //! CTP trigger mask +DECLARE_SOA_COLUMN(MultCollidingBC, multCollidingBC, bool); //! CTP trigger mask -DECLARE_SOA_COLUMN(MultBCTVX, multBCTVX, bool); //! -DECLARE_SOA_COLUMN(MultBCFV0OrA, multBCFV0OrA, bool); //! -DECLARE_SOA_COLUMN(MultBCV0triggerBits, multBCV0triggerBits, uint8_t); //! -DECLARE_SOA_COLUMN(MultBCT0triggerBits, multBCT0triggerBits, uint8_t); //! -DECLARE_SOA_COLUMN(MultBCFDDtriggerBits, multBCFDDtriggerBits, uint8_t); //! -DECLARE_SOA_COLUMN(MultBCTriggerMask, multBCTriggerMask, uint64_t); //! CTP trigger mask -DECLARE_SOA_COLUMN(MultBCColliding, multBCColliding, bool); //! CTP trigger mask - -DECLARE_SOA_COLUMN(MultBCFT0PosZ, multBCFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC -DECLARE_SOA_COLUMN(MultBCFT0PosZValid, multBCFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information within the BC - -} // namespace multBC +DECLARE_SOA_COLUMN(MultFT0PosZ, multFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC +DECLARE_SOA_COLUMN(MultFT0PosZValid, multFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information +} // namespace mult DECLARE_SOA_TABLE(MultBCs, "AOD", "MULTBC", //! - multBC::MultBCFT0A, - multBC::MultBCFT0C, - multBC::MultBCFT0PosZ, - multBC::MultBCFT0PosZValid, - multBC::MultBCFV0A, - multBC::MultBCFDDA, - multBC::MultBCFDDC, - multBC::MultBCZNA, - multBC::MultBCZNC, - multBC::MultBCZEM1, - multBC::MultBCZEM2, - multBC::MultBCZPA, - multBC::MultBCZPC, - multBC::MultBCTVX, - multBC::MultBCFV0OrA, - multBC::MultBCV0triggerBits, - multBC::MultBCT0triggerBits, - multBC::MultBCFDDtriggerBits, - multBC::MultBCTriggerMask, - multBC::MultBCColliding, + mult::MultFT0A, + mult::MultFT0C, + mult::MultFT0PosZ, + mult::MultFT0PosZValid, + mult::MultFV0A, + mult::MultFDDA, + mult::MultFDDC, + mult::MultZNA, + mult::MultZNC, + mult::MultZEM1, + mult::MultZEM2, + mult::MultZPA, + mult::MultZPC, + mult::MultTVX, + mult::MultFV0OrA, + mult::MultV0triggerBits, + mult::MultT0triggerBits, + mult::MultFDDtriggerBits, + mult::MultTriggerMask, + mult::MultCollidingBC, + timestamp::Timestamp, bc::Flags); using MultBC = MultBCs::iterator; diff --git a/Common/TableProducer/multiplicityExtraTable.cxx b/Common/TableProducer/multiplicityExtraTable.cxx index 216a1b7acc6..001e75e6adb 100644 --- a/Common/TableProducer/multiplicityExtraTable.cxx +++ b/Common/TableProducer/multiplicityExtraTable.cxx @@ -245,6 +245,7 @@ struct MultiplicityExtraTable { tru(multFDDA), tru(multFDDC), tru(multZNA), tru(multZNC), tru(multZEM1), tru(multZEM2), tru(multZPA), tru(multZPC), Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC, + bc.timestamp(), bc.flags()); } } diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index bcb714d2a87..f9774f0963e 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -412,59 +412,59 @@ struct centralityStudy { // process BCs, calculate FT0C distribution // conditionals suggested by FIT team (Jacek O. et al) histos.fill(HIST("hBCSelection"), 0); // all BCs - if (selectCollidingBCs && !multbc.multBCColliding()) + if (selectCollidingBCs && !multbc.multCollidingBC()) return; histos.fill(HIST("hBCSelection"), 1); // colliding - if (selectTVX && !multbc.multBCTVX()) + if (selectTVX && !multbc.multTVX()) return; histos.fill(HIST("hBCSelection"), 2); // TVX - if (selectFV0OrA && !multbc.multBCFV0OrA()) + if (selectFV0OrA && !multbc.multFV0OrA()) return; histos.fill(HIST("hBCSelection"), 3); // FV0OrA if (vertexZwithT0 < 100.0f) { - if (!multbc.multBCFT0PosZValid()) + if (!multbc.multFT0PosZValid()) return; - if (TMath::Abs(multbc.multBCFT0PosZ()) > vertexZwithT0) + if (TMath::Abs(multbc.multFT0PosZ()) > vertexZwithT0) return; } histos.fill(HIST("hBCSelection"), 4); // FV0OrA - if (multbc.multBCFT0C() < upcRejection.maxFT0CforZNACselection && - multbc.multBCZNA() < upcRejection.minZNACsignal && - multbc.multBCZNC() < upcRejection.minZNACsignal) { + if (multbc.multFT0C() < upcRejection.maxFT0CforZNACselection && + multbc.multZNA() < upcRejection.minZNACsignal && + multbc.multZNC() < upcRejection.minZNACsignal) { return; } - if (multbc.multBCFT0C() < upcRejection.maxFT0CforFV0Aselection && - multbc.multBCFV0A() < upcRejection.minFV0Asignal) { + if (multbc.multFT0C() < upcRejection.maxFT0CforFV0Aselection && + multbc.multFV0A() < upcRejection.minFV0Asignal) { return; } - if (multbc.multBCFT0C() < upcRejection.maxFT0CforFDDAselection && - multbc.multBCFDDA() < upcRejection.minFDDAsignal) { + if (multbc.multFT0C() < upcRejection.maxFT0CforFDDAselection && + multbc.multFDDA() < upcRejection.minFDDAsignal) { return; } histos.fill(HIST("hBCSelection"), 5); // znac // if we got here, we also finally fill the FT0C histogram, please - histos.fill(HIST("hFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C); + histos.fill(HIST("hFT0C_BCs"), multbc.multFT0C() * scaleSignalFT0C); // ZN signals - histos.fill(HIST("hZNAvsFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C, multbc.multBCZNA()); - histos.fill(HIST("hZNCvsFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C, multbc.multBCZNC()); - - histos.fill(HIST("hFT0M_BCs"), (multbc.multBCFT0A() + multbc.multBCFT0C()) * scaleSignalFT0M); - histos.fill(HIST("hFV0A_BCs"), multbc.multBCFV0A() * scaleSignalFV0A); - if (multbc.multBCFT0PosZValid()) { - histos.fill(HIST("hFT0CvsPVz_BCs_All"), multbc.multBCFT0PosZ(), multbc.multBCFT0C() * scaleSignalFT0C); - if (multbc.multBCFT0C() > minFT0CforVertexZ) { - histos.fill(HIST("hFT0CvsPVz_BCs"), multbc.multBCFT0PosZ(), multbc.multBCFT0C() * scaleSignalFT0C); + histos.fill(HIST("hZNAvsFT0C_BCs"), multbc.multFT0C() * scaleSignalFT0C, multbc.multZNA()); + histos.fill(HIST("hZNCvsFT0C_BCs"), multbc.multFT0C() * scaleSignalFT0C, multbc.multZNC()); + + histos.fill(HIST("hFT0M_BCs"), (multbc.multFT0A() + multbc.multFT0C()) * scaleSignalFT0M); + histos.fill(HIST("hFV0A_BCs"), multbc.multFV0A() * scaleSignalFV0A); + if (multbc.multFT0PosZValid()) { + histos.fill(HIST("hFT0CvsPVz_BCs_All"), multbc.multFT0PosZ(), multbc.multFT0C() * scaleSignalFT0C); + if (multbc.multFT0C() > minFT0CforVertexZ) { + histos.fill(HIST("hFT0CvsPVz_BCs"), multbc.multFT0PosZ(), multbc.multFT0C() * scaleSignalFT0C); } } if (multbc.has_ft0Mult()) { auto multco = multbc.ft0Mult_as>(); - if (multbc.multBCFT0PosZValid()) { - histos.fill(HIST("hVertexZ_BCvsCO"), multco.multPVz(), multbc.multBCFT0PosZ()); + if (multbc.multFT0PosZValid()) { + histos.fill(HIST("hVertexZ_BCvsCO"), multco.multPVz(), multbc.multFT0PosZ()); } } } diff --git a/Common/Tasks/multiplicityQa.cxx b/Common/Tasks/multiplicityQa.cxx index 3bf0f769b79..3fc2374c2cc 100644 --- a/Common/Tasks/multiplicityQa.cxx +++ b/Common/Tasks/multiplicityQa.cxx @@ -405,9 +405,9 @@ struct MultiplicityQa { void processFIT(aod::MultBCs const& multsdebug) { for (auto& mult : multsdebug) { - histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multBCFT0A()); - histos.fill(HIST("multiplicityQa/hIsolatedFT0C"), mult.multBCFT0C()); - histos.fill(HIST("multiplicityQa/hIsolatedFT0M"), mult.multBCFT0A() + mult.multBCFT0C()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multFT0A()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0C"), mult.multFT0C()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0M"), mult.multFT0A() + mult.multFT0C()); } } From ed83a4d71f3270a7f70b785dfb601a73f519ab95 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 9 Dec 2024 06:13:39 +0100 Subject: [PATCH 85/91] [PWGEM/Dilepton] update prefilter task (#8863) --- PWGEM/Dilepton/Core/Dilepton.h | 2 +- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 8e31f9c63a7..f6a5ceedbef 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -532,7 +532,7 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -1, +1}, {180, -M_PI, M_PI}}, true); - fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); + fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index a5e7db3d50d..b89874d9477 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -232,7 +232,7 @@ struct prefilterDielectron { fRegistry.add("Pair/before/uls/hMvsPt", "m_{ee} vs. p_{T,ee}", kTH2D, {axis_mass, axis_pair_pt}, true); fRegistry.add("Pair/before/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {axis_phiv, {200, 0, 1}}, true); fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -1, +1}}, true); - fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); + fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); fRegistry.addClone("Pair/before/uls/", "Pair/before/lspp/"); fRegistry.addClone("Pair/before/uls/", "Pair/before/lsmm/"); fRegistry.addClone("Pair/before/", "Pair/after/"); From 0e758c776de87866a9ec32ba8b78991b0321eaad Mon Sep 17 00:00:00 2001 From: blacwovie Date: Mon, 9 Dec 2024 15:00:17 +0800 Subject: [PATCH 86/91] [PWGLF] add ITSnsigma cut and configurable of saving LSandUS (#8853) --- PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx index c42e5eee06c..5f05fb4fa1d 100644 --- a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx +++ b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx @@ -46,6 +46,7 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/TableProducer/PID/pidTOFBase.h" @@ -174,10 +175,12 @@ struct he3hadronfemto { Configurable setting_cutPtMinhe3Had{"setting_cutPtMinhe3Had", 0.0f, "Minimum PT cut on he3Had4"}; Configurable setting_cutClSizeItsHe3{"setting_cutClSizeItsHe3", 4.0f, "Minimum ITS cluster size for He3"}; Configurable setting_cutNsigmaTPC{"setting_cutNsigmaTPC", 3.0f, "Value of the TPC Nsigma cut"}; + Configurable setting_cutNsigmaITS{"setting_cutNsigmaITS", -1.5f, "Value of the TPC Nsigma cut"}; Configurable setting_cutPtMinTOFHad{"setting_cutPtMinTOFHad", 0.4f, "Minimum pT to apply the TOF cut on hadrons"}; Configurable setting_cutNsigmaTOF{"setting_cutNsigmaTOF", 3.0f, "Value of the TOF Nsigma cut"}; Configurable setting_noMixedEvents{"setting_noMixedEvents", 5, "Number of mixed events per event"}; Configurable setting_enableBkgUS{"setting_enableBkgUS", false, "Enable US background"}; + Configurable setting_saveUSandLS{"setting_saveUSandLS", true, "Save All Pairs"}; Configurable setting_isMC{"setting_isMC", false, "Run MC"}; Configurable setting_fillMultiplicity{"setting_fillMultiplicity", false, "Fill multiplicity table"}; @@ -206,8 +209,8 @@ struct he3hadronfemto { // binning for EM background ConfigurableAxis axisVertex{"axisVertex", {30, -10, 10}, "Binning for multiplicity"}; - ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0., 15., 30., 45., 60., 75., 95., 250.}, "Binning for centrality"}; - using BinningType = ColumnBinningPolicy; + ConfigurableAxis axisCentrality{"axisCentrality", {40, 0, 100}, "Binning for centrality"}; + using BinningType = ColumnBinningPolicy; BinningType binningPolicy{{axisVertex, axisCentrality}, true}; SliceCache cache; SameKindPair m_pair{binningPolicy, setting_noMixedEvents, -1, &cache}; @@ -237,16 +240,17 @@ struct he3hadronfemto { {"hDCAxyHe3", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hDCAzHe3", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hhe3HadtInvMass", "; M(^{3}He + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{50, 3.74f, 3.85f}}}}, - {"hHe3Pt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{200, -6.0f, 6.0f}}}}, - {"hHadronPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{200, -3.0f, 3.0f}}}}, + {"hHe3Pt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, + {"hHadronPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"h2dEdxHe3candidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}}, - {"h2ClSizeCosLamHe3", "; n#sigma_{TPC} ; #LT ITS Cluster Size #GT #LT cos#lambda #GT (^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {120, 0.0f, 15.0f}}}}, - {"h2NsigmaHe3TPC", "NsigmaHe3 TPC distribution; #it{p}/z (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaHe3TPC_preselection", "NsigmaHe3 TPC distribution; #it{p}/z (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -10.0f, 10.0f}}}}, - {"h2NsigmaHadronTPC", "NsigmaHadron TPC distribution; #it{p}/z (GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadronTPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -10.0f, 10.0f}}}}, - {"h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #it{p} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -10.0f, 10.0f}}}}, + {"h2NsigmaHe3TPC", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaHe3TPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"h2NSigmaHe3ITS_preselection", "NsigmaHe3 ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} ^{3}He", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}}}}, + {"h2NSigmaHe3ITS", "NsigmaHe3 ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} ^{3}He", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}}}}, + {"h2NsigmaHadronTPC", "NsigmaHadron TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadronTPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #iit{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, }, OutputObjHandlingPolicy::AnalysisObject, false, @@ -425,15 +429,15 @@ struct he3hadronfemto { if (std::abs(tpcNSigmaHad) > setting_cutNsigmaTPC) { return false; } - m_qaRegistry.fill(HIST("h2NsigmaHadronTOF_preselection"), candidate.p(), tofNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTOF_preselection"), candidate.pt(), tofNSigmaHad); if (std::abs(tofNSigmaHad) > setting_cutNsigmaTOF) { return false; } - m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.tpcInnerParam(), tpcNSigmaHad); - m_qaRegistry.fill(HIST("h2NsigmaHadronTOF"), candidate.p(), tofNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.pt(), tpcNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTOF"), candidate.pt(), tofNSigmaHad); return true; } else if (std::abs(tpcNSigmaHad) < setting_cutNsigmaTPC) { - m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.tpcInnerParam(), tpcNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.pt(), tpcNSigmaHad); return true; } return false; @@ -460,30 +464,23 @@ struct he3hadronfemto { return false; } - float cosl = 1. / std::cosh(candidate.eta()); - float meanClsizeIts = 0.f; - int nHitsIts = 0; - for (int ilayer = 0; ilayer < 7; ilayer++) { - float clsizeLayer = (candidate.itsClusterSizes() >> ilayer * 4) & 0b1111; - if (clsizeLayer > 0) { - nHitsIts++; - meanClsizeIts += clsizeLayer; - } - } - float clsizeCoslIts = meanClsizeIts / nHitsIts * cosl; - if (clsizeCoslIts < setting_cutClSizeItsHe3) { - return false; - } - auto nSigmaHe3 = computeNSigmaHe3(candidate); - m_qaRegistry.fill(HIST("h2NsigmaHe3TPC_preselection"), candidate.sign() * correctedTPCinnerParam, nSigmaHe3); + m_qaRegistry.fill(HIST("h2NsigmaHe3TPC_preselection"), candidate.sign() * 2 * candidate.pt(), nSigmaHe3); if (std::abs(nSigmaHe3) > setting_cutNsigmaTPC) { return false; } + // + o2::aod::ITSResponse m_responseITS; + auto ITSnSigmaHe3 = m_responseITS.nSigmaITS(candidate.itsClusterSizes(), 2 * candidate.p(), candidate.eta()); + // + m_qaRegistry.fill(HIST("h2NSigmaHe3ITS_preselection"), candidate.sign() * 2 * candidate.pt(), ITSnSigmaHe3); + if (ITSnSigmaHe3 < setting_cutNsigmaITS) { + return false; + } m_qaRegistry.fill(HIST("h2dEdxHe3candidates"), candidate.sign() * correctedTPCinnerParam, candidate.tpcSignal()); - m_qaRegistry.fill(HIST("h2NsigmaHe3TPC"), candidate.sign() * correctedTPCinnerParam, nSigmaHe3); - m_qaRegistry.fill(HIST("h2ClSizeCosLamHe3"), nSigmaHe3, clsizeCoslIts); + m_qaRegistry.fill(HIST("h2NsigmaHe3TPC"), candidate.sign() * 2 * candidate.pt(), nSigmaHe3); + m_qaRegistry.fill(HIST("h2NSigmaHe3ITS"), candidate.sign() * 2 * candidate.pt(), ITSnSigmaHe3); return true; } @@ -571,7 +568,7 @@ struct he3hadronfemto { he3Hadcand.nTPCClustersHe3 = trackHe3.tpcNClsFound(); he3Hadcand.nSigmaHe3 = computeNSigmaHe3(trackHe3); he3Hadcand.nSigmaHad = computeTPCNSigmaHadron(trackHad); - // he3Hadcand.nSigmaHad = trackHad.tpcNSigmaPi();/*tpcNSigmaHad*/ + he3Hadcand.chi2TPCHe3 = trackHe3.tpcChi2NCl(); he3Hadcand.chi2TPCHad = trackHad.tpcChi2NCl(); @@ -645,11 +642,13 @@ struct he3hadronfemto { continue; } - if (!setting_enableBkgUS && (track0.sign() * track1.sign() < 0)) { - continue; - } - if (setting_enableBkgUS && (track0.sign() * track1.sign() > 0)) { - continue; + if (!setting_saveUSandLS) { + if (!setting_enableBkgUS && (track0.sign() * track1.sign() < 0)) { + continue; + } + if (setting_enableBkgUS && (track0.sign() * track1.sign() > 0)) { + continue; + } } if (!selectTrack(track1) || !selectionPIDHadron(track1)) { From 49b99d85a3f858ea8656a83159ce3122bc051c66 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:33:46 +0100 Subject: [PATCH 87/91] [PWGHF] added cumulant corrections for flow (#8855) Co-authored-by: Prottay Das --- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index a4d9b9fcfe1..75cfe1690c1 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -125,6 +125,13 @@ struct HfTaskDirectedFlowCharmHadrons { registry.add("hpuxyQxytvscentpteta", "hpuxyQxytvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpoddvscentpteta", "hpoddvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpevenvscentpteta", "hpevenvscentpteta", HistType::kTHnSparseF, axes, true); + + registry.add("hpQxpvscent", "hpQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQypvscent", "hpQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQxtvscent", "hpQxtvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQytvscent", "hpQytvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpuxvscentpteta", "hpuxvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuyvscentpteta", "hpuyvscentpteta", HistType::kTHnSparseF, axes, true); } else { registry.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); registry.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); @@ -134,6 +141,13 @@ struct HfTaskDirectedFlowCharmHadrons { registry.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, axes, true); + + registry.add("hpQxpvscent", "hpQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQypvscent", "hpQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQxtvscent", "hpQxtvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQytvscent", "hpQytvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpuxvscentpteta", "hpuxvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuyvscentpteta", "hpuyvscentpteta", HistType::kTHnSparseF, axes, true); } ccdb->setURL(ccdbUrl); @@ -198,11 +212,19 @@ struct HfTaskDirectedFlowCharmHadrons { // correlations in the denominators for SP calculation if (direct) { registry.fill(HIST("hpQxytpvscent"), cent, Qxytp); + registry.fill(HIST("hpQxpvscent"), cent, qxZDCA); + registry.fill(HIST("hpQxtvscent"), cent, qxZDCC); + registry.fill(HIST("hpQypvscent"), cent, qyZDCA); + registry.fill(HIST("hpQytvscent"), cent, qyZDCC); } else { registry.fill(HIST("hpQxtQxpvscent"), cent, QxtQxp); registry.fill(HIST("hpQytQypvscent"), cent, QytQyp); registry.fill(HIST("hpQxpQytvscent"), cent, QxpQyt); registry.fill(HIST("hpQxtQypvscent"), cent, QxtQyp); + registry.fill(HIST("hpQxpvscent"), cent, qxZDCA); + registry.fill(HIST("hpQxtvscent"), cent, qxZDCC); + registry.fill(HIST("hpQypvscent"), cent, qyZDCA); + registry.fill(HIST("hpQytvscent"), cent, qyZDCC); } for (const auto& candidate : candidates) { @@ -283,11 +305,18 @@ struct HfTaskDirectedFlowCharmHadrons { registry.fill(HIST("hpuxyQxytvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyt, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpoddvscentpteta"), massCand, cent, ptCand, etaCand, oddv1, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpevenvscentpteta"), massCand, cent, ptCand, etaCand, evenv1, sign, outputMl[0], outputMl[1]); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign, outputMl[0], outputMl[1]); + } else { registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign, outputMl[0], outputMl[1]); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign, outputMl[0], outputMl[1]); } } else { if (direct) { @@ -295,11 +324,17 @@ struct HfTaskDirectedFlowCharmHadrons { registry.fill(HIST("hpuxyQxytvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyt, sign); registry.fill(HIST("hpoddvscentpteta"), massCand, cent, ptCand, etaCand, oddv1, sign); registry.fill(HIST("hpevenvscentpteta"), massCand, cent, ptCand, etaCand, evenv1, sign); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign); } else { registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign); registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign); registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign); registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign); } } } From e25d139945ceaadd83a864f985476366de700e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:55:25 +0100 Subject: [PATCH 88/91] [PWGHF] Add missing subscription for D0 candidates tables (#8849) --- PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 75cfe1690c1..763a1292a52 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -341,6 +341,7 @@ struct HfTaskDirectedFlowCharmHadrons { } // D0 with ML void processD0Ml(CollsWithQvecs::iterator const& collision, + CandD0DataWMl const& /*candidatesD0*/, TracksWithExtra const& tracks) { auto candsD0ToPiKWMl = selectedD0ToPiKWMl->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); @@ -352,6 +353,7 @@ struct HfTaskDirectedFlowCharmHadrons { // D0 with rectangular cuts void processD0Std(CollsWithQvecs::iterator const& collision, + CandD0Data const& /*candidatesD0*/, TracksWithExtra const& tracks) { auto candsD0ToPiK = selectedD0ToPiK->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); From a721ddf15d8754ddae45c3a348b9eb5b7593c09d Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:12:55 +0100 Subject: [PATCH 89/91] [PWGDQ] Adding correct errors for Tprofiles Cumulants (#8860) --- PWGDQ/Core/HistogramsLibrary.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 8c5723839cc..335dbaaecf3 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -268,14 +268,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Psi2A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2A); hm->AddHistogram(histClass, "Psi2B_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2B); hm->AddHistogram(histClass, "Psi2C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2C); - hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "centrFT0C_Corr2REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); - hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "centrFT0C_Corr2REFetagap_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "centrFT0C_Corr4REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); - hm->AddHistogram(histClass, "centrFT0C_Corr2Corr4REF_ev", "centrFT0C_Corr2Corr4REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REF_ev", "Run2_centrFT0C_Corr2REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2REF, VarManager::kM11REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2Corr4REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2REF, VarManager::kM11REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); From 1d968f41f1f4677922789d472ef68cc09446780c Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 9 Dec 2024 11:50:22 +0100 Subject: [PATCH 90/91] [PWGEM/Dilepton] update createResolutionMap.cxx (#8871) --- PWGEM/Dilepton/Tasks/createResolutionMap.cxx | 40 ++++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx index bfcf7e4f8f4..6df7af5c768 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -13,6 +13,12 @@ // Analysis task to produce resolution mapfor electrons/muons in dilepton analysis // Please write to: daiki.sekihata@cern.ch +#include +#include +#include +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -66,6 +72,16 @@ struct CreateResolutionMap { Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; + ConfigurableAxis ConfPtGenBins{"ConfPtGenBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 8.50, 9.00, 9.50, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}, "gen. pT bins for output histograms"}; + + ConfigurableAxis ConfEtaCBGenBins{"ConfEtaCBGenBins", {30, -1.5, +1.5}, "gen. eta bins at midrapidity for output histograms"}; + ConfigurableAxis ConfEtaFWDGenBins{"ConfEtaFWDGenBins", {30, -5, -2.0}, "gen. eta bins at forward rapidity for output histograms"}; + ConfigurableAxis ConfPhiGenBins{"ConfPhiGenBins", {90, 0, 2.f * M_PI}, "gen. eta bins at forward rapidity for output histograms"}; + + ConfigurableAxis ConfRelDeltaPtBins{"ConfRelDeltaPtBins", {200, -1.f, +1.f}, "rel. dpt for output histograms"}; + ConfigurableAxis ConfDeltaEtaBins{"ConfDeltaEtaBins", {200, -0.1f, +0.1f}, "deta bins for output histograms"}; + ConfigurableAxis ConfDeltaPhiBins{"ConfDeltaPhiBins", {200, -0.1f, +0.1f}, "dphi bins for output histograms"}; + struct : ConfigurableGroup { std::string prefix = "electroncut_group"; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.01, "min pT for single track"}; @@ -113,10 +129,13 @@ struct CreateResolutionMap { ccdb->setFatalWhenNull(false); ccdbApi.init(ccdburl); - const AxisSpec axis_pt_gen{{0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 8.50, 9.00, 9.50, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}, "p_{T,l}^{gen} (GeV/c)"}; - const AxisSpec axis_dpt{400, -1, 1, "(p_{T,l}^{gen.} - p_{T,l}^{rec.})/p_{T,l}^{gen.}"}; - const AxisSpec axis_deta{500, -0.5, +0.5, "#eta_{l}^{gen.} - #eta_{l}^{rec.}"}; - const AxisSpec axis_dphi{500, -0.5, +0.5, "#varphi_{l}^{gen.} - #varphi_{l}^{rec.} (rad.)"}; + const AxisSpec axis_pt_gen{ConfPtGenBins, "p_{T,l}^{gen} (GeV/c)"}; + const AxisSpec axis_eta_cb_gen{ConfEtaCBGenBins, "#eta_{l}^{gen}"}; + const AxisSpec axis_eta_fwd_gen{ConfEtaFWDGenBins, "#eta_{l}^{gen}"}; + const AxisSpec axis_phi_gen{ConfPhiGenBins, "#varphi_{l}^{gen} (rad.)"}; + const AxisSpec axis_dpt{ConfRelDeltaPtBins, "(p_{T,l}^{gen} - p_{T,l}^{rec})/p_{T,l}^{gen}"}; + const AxisSpec axis_deta{ConfDeltaEtaBins, "#eta_{l}^{gen} - #eta_{l}^{rec}"}; + const AxisSpec axis_dphi{ConfDeltaPhiBins, "#varphi_{l}^{gen} - #varphi_{l}^{rec} (rad.)"}; registry.add("Electron/Ptgen_RelDeltaPt", "resolution", kTH2F, {{axis_pt_gen}, {axis_dpt}}, true); registry.add("Electron/Ptgen_DeltaEta", "resolution", kTH2F, {{axis_pt_gen}, {axis_deta}}, true); @@ -124,6 +143,13 @@ struct CreateResolutionMap { registry.add("Electron/Ptgen_DeltaPhi_Neg", "resolution", kTH2F, {{axis_pt_gen}, {axis_dphi}}, true); registry.addClone("Electron/", "StandaloneMuon/"); registry.addClone("Electron/", "GlobalMuon/"); + + registry.add("Electron/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("StandaloneMuon/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("GlobalMuon/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("Electron/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("StandaloneMuon/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("GlobalMuon/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -292,16 +318,20 @@ struct CreateResolutionMap { registry.fill(HIST("StandaloneMuon/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - eta); if (mctrack.pdgCode() == -13) { // positive muon registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("StandaloneMuon/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } else if (mctrack.pdgCode() == 13) { // negative muon registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("StandaloneMuon/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } } else if (muon.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) { registry.fill(HIST("GlobalMuon/Ptgen_RelDeltaPt"), mctrack.pt(), (mctrack.pt() - pt) / mctrack.pt()); registry.fill(HIST("GlobalMuon/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - eta); if (mctrack.pdgCode() == -13) { // positive muon registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("GlobalMuon/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } else if (mctrack.pdgCode() == 13) { // negative muon registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("GlobalMuon/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } } return true; @@ -355,8 +385,10 @@ struct CreateResolutionMap { registry.fill(HIST("Electron/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - track.eta()); if (mctrack.pdgCode() == -11) { // positron registry.fill(HIST("Electron/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - track.phi()); + registry.fill(HIST("Electron/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); } else if (mctrack.pdgCode() == 11) { // electron registry.fill(HIST("Electron/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - track.phi()); + registry.fill(HIST("Electron/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); } } // end of track loop From b77f0f44e92f7eb48d1cb1e677b1de3d57f91736 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:04:41 +0530 Subject: [PATCH 91/91] [DPG] Add the histo to cal. the decaylength of the mother particle (#8730) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 15d3eba14df..cf381726f50 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -106,6 +106,7 @@ std::array, nParticles> hPtItsTpcStr; std::array, nParticles> hPtTrkItsTpcStr; std::array, nParticles> hPtItsTpcTofStr; std::array, nParticles> hPtGeneratedStr; +std::array, nParticles> hdecaylengthmother; // histogram to store decaylength of mother // Pt for secondaries from material std::array, nParticles> hPtItsTpcMat; @@ -292,6 +293,7 @@ struct QaEfficiency { LOG(fatal) << "Can't interpret pdgSign " << pdgSign; } + AxisSpec axisDecayLength{100, 0.0, 10.0, "Decay Length (cm)"}; AxisSpec axisPt{ptBins, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisP{ptBins, "#it{p} (GeV/#it{c})"}; if (logPt) { @@ -365,6 +367,7 @@ struct QaEfficiency { hPtTrkItsTpcStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/trk/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (reco from weak decays) " + tagPt, kTH1D, {axisPt}); hPtItsTpcTofStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks (from weak decays) " + tagPt, kTH1D, {axisPt}); hPtGeneratedStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/generated", PDGs[histogramIndex]), "Generated (from weak decays) " + tagPt, kTH1D, {axisPt}); + hdecaylengthmother[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/decayLength", PDGs[histogramIndex]), "Decay Length of mother particle" + tagPt, kTH1D, {axisPt}); // Ter hPtItsTpcTer[histogramIndex] = histos.add(Form("MC/pdg%i/pt/ter/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (from secondary weak decays) " + tagPt, kTH1D, {axisPt}); @@ -1158,7 +1161,9 @@ struct QaEfficiency { break; } if (motherIsAccepted) { - break; + // Calculate the decay length + double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); + hdecaylengthmother[histogramIndex]->Fill(decayLength); } } }