From 8430c12adb57880c48a0b92153887b3ab66eb843 Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Thu, 19 Mar 2026 21:34:48 +0100 Subject: [PATCH 001/282] [PWGCF] normalisation by hadrons added (#15458) Co-authored-by: MaximVirta Co-authored-by: ALICE Action Bot --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 140 ++++++++++---------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 725e86277f4..158880474ae 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -105,6 +105,7 @@ struct FlowGfwV02 { O2_DEFINE_CONFIGURABLE(cfgUseItsPID, bool, true, "Use ITS PID for particle identification") O2_DEFINE_CONFIGURABLE(cfgGetNsigmaQA, bool, true, "Get QA histograms for selection of pions, kaons, and protons") O2_DEFINE_CONFIGURABLE(cfgUseMultiplicityFlowWeights, bool, true, "Enable or disable the use of multiplicity-based event weighting"); + O2_DEFINE_CONFIGURABLE(cfgNormalizeByCharged, bool, true, "Enable or disable the normalization by charged particles"); O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 15, "Flag for consistent event selection"); Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 5.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; @@ -174,18 +175,18 @@ struct FlowGfwV02 { using GFWTracks = soa::Filtered>; enum PIDIndex { - kCharged = 0, - kPions, - kKaons, - kProtons + PidCharged = 0, + PidPions, + PidKaons, + PidProtons }; enum PiKpArrayIndex { - iPionUp = 0, - iKaonUp, - iProtonUp, - iPionLow, - iKaonLow, - iProtonLow + IndPionUp = 0, + IndKaonUp, + IndProtonUp, + IndPionLow, + IndKaonLow, + IndProtonLow }; enum DetectorType { kTPC = 0, @@ -196,26 +197,26 @@ struct FlowGfwV02 { void init(InitContext const&) { - pidStates.tpcNsigmaCut[iPionUp] = nSigmas->getData()[iPionUp][kTPC]; - pidStates.tpcNsigmaCut[iKaonUp] = nSigmas->getData()[iKaonUp][kTPC]; - pidStates.tpcNsigmaCut[iProtonUp] = nSigmas->getData()[iProtonUp][kTPC]; - pidStates.tpcNsigmaCut[iPionLow] = nSigmas->getData()[iPionLow][kTPC]; - pidStates.tpcNsigmaCut[iKaonLow] = nSigmas->getData()[iKaonLow][kTPC]; - pidStates.tpcNsigmaCut[iProtonLow] = nSigmas->getData()[iProtonLow][kTPC]; - - pidStates.tofNsigmaCut[iPionUp] = nSigmas->getData()[iPionUp][kTOF]; - pidStates.tofNsigmaCut[iKaonUp] = nSigmas->getData()[iKaonUp][kTOF]; - pidStates.tofNsigmaCut[iProtonUp] = nSigmas->getData()[iProtonUp][kTOF]; - pidStates.tofNsigmaCut[iPionLow] = nSigmas->getData()[iPionLow][kTOF]; - pidStates.tofNsigmaCut[iKaonLow] = nSigmas->getData()[iKaonLow][kTOF]; - pidStates.tofNsigmaCut[iProtonLow] = nSigmas->getData()[iProtonLow][kTOF]; - - pidStates.itsNsigmaCut[iPionUp] = nSigmas->getData()[iPionUp][kITS]; - pidStates.itsNsigmaCut[iKaonUp] = nSigmas->getData()[iKaonUp][kITS]; - pidStates.itsNsigmaCut[iProtonUp] = nSigmas->getData()[iProtonUp][kITS]; - pidStates.itsNsigmaCut[iPionLow] = nSigmas->getData()[iPionLow][kITS]; - pidStates.itsNsigmaCut[iKaonLow] = nSigmas->getData()[iKaonLow][kITS]; - pidStates.itsNsigmaCut[iProtonLow] = nSigmas->getData()[iProtonLow][kITS]; + pidStates.tpcNsigmaCut[IndPionUp] = nSigmas->getData()[IndPionUp][kTPC]; + pidStates.tpcNsigmaCut[IndKaonUp] = nSigmas->getData()[IndKaonUp][kTPC]; + pidStates.tpcNsigmaCut[IndProtonUp] = nSigmas->getData()[IndProtonUp][kTPC]; + pidStates.tpcNsigmaCut[IndPionLow] = nSigmas->getData()[IndPionLow][kTPC]; + pidStates.tpcNsigmaCut[IndKaonLow] = nSigmas->getData()[IndKaonLow][kTPC]; + pidStates.tpcNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kTPC]; + + pidStates.tofNsigmaCut[IndPionUp] = nSigmas->getData()[IndPionUp][kTOF]; + pidStates.tofNsigmaCut[IndKaonUp] = nSigmas->getData()[IndKaonUp][kTOF]; + pidStates.tofNsigmaCut[IndProtonUp] = nSigmas->getData()[IndProtonUp][kTOF]; + pidStates.tofNsigmaCut[IndPionLow] = nSigmas->getData()[IndPionLow][kTOF]; + pidStates.tofNsigmaCut[IndKaonLow] = nSigmas->getData()[IndKaonLow][kTOF]; + pidStates.tofNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kTOF]; + + pidStates.itsNsigmaCut[IndPionUp] = nSigmas->getData()[IndPionUp][kITS]; + pidStates.itsNsigmaCut[IndKaonUp] = nSigmas->getData()[IndKaonUp][kITS]; + pidStates.itsNsigmaCut[IndProtonUp] = nSigmas->getData()[IndProtonUp][kITS]; + pidStates.itsNsigmaCut[IndPionLow] = nSigmas->getData()[IndPionLow][kITS]; + pidStates.itsNsigmaCut[IndKaonLow] = nSigmas->getData()[IndKaonLow][kITS]; + pidStates.itsNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kITS]; if (cfgGetNsigmaQA) { if (!cfgUseItsPID) { @@ -261,14 +262,14 @@ struct FlowGfwV02 { cfgGFWBinning->Print(); // Initialise pt spectra histograms for different particles - pidStates.hPtMid[kCharged] = new TH1D("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[kPions] = new TH1D("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[kKaons] = new TH1D("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[kProtons] = new TH1D("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[kCharged]->SetDirectory(nullptr); - pidStates.hPtMid[kPions]->SetDirectory(nullptr); - pidStates.hPtMid[kKaons]->SetDirectory(nullptr); - pidStates.hPtMid[kProtons]->SetDirectory(nullptr); + pidStates.hPtMid[PidCharged] = new TH1D("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidPions] = new TH1D("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidKaons] = new TH1D("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidProtons] = new TH1D("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidCharged]->SetDirectory(nullptr); + pidStates.hPtMid[PidPions]->SetDirectory(nullptr); + pidStates.hPtMid[PidKaons]->SetDirectory(nullptr); + pidStates.hPtMid[PidProtons]->SetDirectory(nullptr); AxisSpec phiAxis = {o2::analysis::gfw::phibins, o2::analysis::gfw::philow, o2::analysis::gfw::phiup, "#phi"}; AxisSpec etaAxis = {o2::analysis::gfw::etabins, -cfgTrackCuts.cfgEtaMax, cfgTrackCuts.cfgEtaMax, "#eta"}; @@ -389,13 +390,13 @@ struct FlowGfwV02 { std::array detectorNsigmaCut = cfgUseItsPID ? pidStates.itsNsigmaCut : pidStates.tpcNsigmaCut; // Choose which nSigma to use: TPC or ITS bool isPion, isKaon, isProton; - bool isDetectedPion = nSigmaToUse[iPionUp] < detectorNsigmaCut[iPionUp] && nSigmaToUse[iPionUp] > detectorNsigmaCut[iPionLow]; - bool isDetectedKaon = nSigmaToUse[iKaonUp] < detectorNsigmaCut[iKaonUp] && nSigmaToUse[iKaonUp] > detectorNsigmaCut[iKaonLow]; - bool isDetectedProton = nSigmaToUse[iProtonUp] < detectorNsigmaCut[iProtonUp] && nSigmaToUse[iProtonUp] > detectorNsigmaCut[iProtonLow]; + bool isDetectedPion = nSigmaToUse[IndPionUp] < detectorNsigmaCut[IndPionUp] && nSigmaToUse[IndPionUp] > detectorNsigmaCut[IndPionLow]; + bool isDetectedKaon = nSigmaToUse[IndKaonUp] < detectorNsigmaCut[IndKaonUp] && nSigmaToUse[IndKaonUp] > detectorNsigmaCut[IndKaonLow]; + bool isDetectedProton = nSigmaToUse[IndProtonUp] < detectorNsigmaCut[IndProtonUp] && nSigmaToUse[IndProtonUp] > detectorNsigmaCut[IndProtonLow]; - bool isTofPion = nSigmaTOF[iPionUp] < pidStates.tofNsigmaCut[iPionUp] && nSigmaTOF[iPionUp] > pidStates.tofNsigmaCut[iPionLow]; - bool isTofKaon = nSigmaTOF[iKaonUp] < pidStates.tofNsigmaCut[iKaonUp] && nSigmaTOF[iKaonUp] > pidStates.tofNsigmaCut[iKaonLow]; - bool isTofProton = nSigmaTOF[iProtonUp] < pidStates.tofNsigmaCut[iProtonUp] && nSigmaTOF[iProtonUp] > pidStates.tofNsigmaCut[iProtonLow]; + bool isTofPion = nSigmaTOF[IndPionUp] < pidStates.tofNsigmaCut[IndPionUp] && nSigmaTOF[IndPionUp] > pidStates.tofNsigmaCut[IndPionLow]; + bool isTofKaon = nSigmaTOF[IndKaonUp] < pidStates.tofNsigmaCut[IndKaonUp] && nSigmaTOF[IndKaonUp] > pidStates.tofNsigmaCut[IndKaonLow]; + bool isTofProton = nSigmaTOF[IndProtonUp] < pidStates.tofNsigmaCut[IndProtonUp] && nSigmaTOF[IndProtonUp] > pidStates.tofNsigmaCut[IndProtonLow]; if (track.pt() > cfgTofPtCut && !track.hasTOF()) { return -1; @@ -414,11 +415,11 @@ struct FlowGfwV02 { } if (isPion) { - pid = kPions; + pid = PidPions; } else if (isKaon) { - pid = kKaons; + pid = PidKaons; } else if (isProton) { - pid = kProtons; + pid = PidProtons; } else { return -1; // no particle satisfies the criteria } @@ -484,21 +485,21 @@ struct FlowGfwV02 { int getPIDIndex(const std::string& corrconfig) { if (boost::ifind_first(corrconfig, "pi")) - return kPions; + return PidPions; if (boost::ifind_first(corrconfig, "ka")) - return kKaons; + return PidKaons; if (boost::ifind_first(corrconfig, "pr")) - return kProtons; - return kCharged; + return PidProtons; + return PidCharged; } GFW::CorrConfig getRelevantCorrName(const int& pidInd) { - if (pidInd == kPions) + if (pidInd == PidPions) return fGFW->GetCorrelatorConfig("piP {2} refN {-2}", "PiGap22", kFALSE); - if (pidInd == kKaons) + if (pidInd == PidKaons) return fGFW->GetCorrelatorConfig("kaP {2} refN {-2}", "KaGap22", kFALSE); - if (pidInd == kProtons) + if (pidInd == PidProtons) return fGFW->GetCorrelatorConfig("prP {2} refN {-2}", "PrGap22", kFALSE); return fGFW->GetCorrelatorConfig("refP {2} refN {-2}", "ChGap22", kFALSE); } @@ -533,8 +534,9 @@ struct FlowGfwV02 { if (corrconfigs.at(l_ind).Head.find("nch") != std::string::npos) val = 1.0; double ptFraction = 0; - if (pidStates.hPtMid[pidInd]->Integral() > 0) { - ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[pidInd]->Integral(); + int normIndex = (cfgNormalizeByCharged) ? PidCharged : pidInd; // Configured to normalize by charged particles or the selected particle + if (pidStates.hPtMid[normIndex]->Integral() > 0) { + ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral(); if (std::abs(val) < 1.01) fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); } @@ -548,8 +550,8 @@ struct FlowGfwV02 { auto val = fGFW->Calculate(corrconfigs.at(0), 0, kFALSE).real() / dnx; for (int i = 1; i <= fSecondAxis->GetNbins(); i++) { double ptFraction = 0; - if (pidStates.hPtMid[kCharged]->Integral() > 0) { - ptFraction = pidStates.hPtMid[kCharged]->GetBinContent(i) / pidStates.hPtMid[kCharged]->Integral(); + if (pidStates.hPtMid[PidCharged]->Integral() > 0) { + ptFraction = pidStates.hPtMid[PidCharged]->GetBinContent(i) / pidStates.hPtMid[PidCharged]->Integral(); if (std::abs(val) < 1) registry.fill(HIST("v02pt"), fSecondAxis->GetBinCenter(i), centmult, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0); // printf("bincenter hPtMid: %f, fsecondaxis: %f\n", hPtMid->GetBinCenter(i), fSecondAxis->GetBinCenter(i)); @@ -583,10 +585,10 @@ struct FlowGfwV02 { if (xaxis.multiplicity < cfgFixedMultMin || xaxis.multiplicity > cfgFixedMultMax) return; fGFW->Clear(); - pidStates.hPtMid[kCharged]->Reset(); - pidStates.hPtMid[kPions]->Reset(); - pidStates.hPtMid[kKaons]->Reset(); - pidStates.hPtMid[kProtons]->Reset(); + pidStates.hPtMid[PidCharged]->Reset(); + pidStates.hPtMid[PidPions]->Reset(); + pidStates.hPtMid[PidKaons]->Reset(); + pidStates.hPtMid[PidProtons]->Reset(); float lRandom = fRndm->Rndm(); @@ -594,7 +596,7 @@ struct FlowGfwV02 { AcceptedTracks acceptedTracks{0, 0, 0, 0}; for (const auto& track : tracks) { processTrack(track, vtxz, xaxis.multiplicity, run, acceptedTracks); - pidStates.hPtMid[kCharged]->Fill(track.pt(), getEfficiency(track)); + pidStates.hPtMid[PidCharged]->Fill(track.pt(), getEfficiency(track)); // If PID is identified, fill pt spectrum for the corresponding particle int pidInd = getNsigmaPID(track); if (pidInd != -1 && track.eta() > -0.4 && track.eta() < 0.4) { @@ -663,12 +665,12 @@ struct FlowGfwV02 { // ***Need to add proper weights for each particle!*** if (withinPtRef) fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 0); - if (withinPtPOI && pidInd == kPions) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, kPions); - if (withinPtPOI && pidInd == kKaons) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, kKaons); - if (withinPtPOI && pidInd == kProtons) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, kProtons); + if (withinPtPOI && pidInd == PidPions) + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidPions); + if (withinPtPOI && pidInd == PidKaons) + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidKaons); + if (withinPtPOI && pidInd == PidProtons) + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons); return; } From 286a11d139e80a9bf5a20633e3df08371b57cbdb Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Fri, 20 Mar 2026 09:09:05 +0100 Subject: [PATCH 002/282] [PWGLF] Omegahm: table for resolution matrix (#15461) --- PWGLF/DataModel/LFNonPromptCascadeTables.h | 10 +++++++++- PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 10 +++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index 16c86667ad1..7d0a9c156a8 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -124,6 +124,9 @@ DECLARE_SOA_COLUMN(ToiMask, toiMask, uint32_t); DECLARE_SOA_COLUMN(RunNumber, runNumber, int); DECLARE_SOA_COLUMN(NoSameBunchPileup, noSameBunchPileup, bool); DECLARE_SOA_COLUMN(GlobalBC, globalBC, uint64_t); +DECLARE_SOA_COLUMN(PtGen, ptGen, float); +DECLARE_SOA_COLUMN(PtRec, ptRec, float); +DECLARE_SOA_COLUMN(MultGen, multGen, int); } // namespace NPCascadeTable DECLARE_SOA_TABLE(NPCascTable, "AOD", "NPCASCTABLE", @@ -454,7 +457,12 @@ DECLARE_SOA_TABLE(NPPileUpTable, "AOD", "NPPileUpTABLE", aod::collision::NumContrib, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::CentFT0M, - NPCascadeTable::MultFT0M); + NPCascadeTable::MultFT0M) +DECLARE_SOA_TABLE(NPMCNegativesTable, "AOD", "NPMCNegativesTABLE", + NPCascadeTable::PtGen, + NPCascadeTable::PtRec, + NPCascadeTable::MultNTracksGlobal, + NPCascadeTable::MultGen); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFNONPROMPTCASCADETABLES_H_ diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 4527b2342af..6639404d334 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -183,6 +183,7 @@ struct NonPromptCascadeTask { Produces NPCTableMCNT; Produces NPCTableGen; Produces NPPUTable; + Produces NPMCNTable; using TracksExtData = soa::Join; using TracksExtMC = soa::Join; @@ -743,7 +744,7 @@ struct NonPromptCascadeTask { { fillCandidatesVector(collisions, tracks, cascades, gCandidatesNT); fillMCtable(mcParticles, collisions, gCandidatesNT); - fillMultHistos(collisions); + // fillMultHistos(collisions); } PROCESS_SWITCH(NonPromptCascadeTask, processCascadesMC, "process cascades: MC analysis", false); @@ -794,7 +795,7 @@ struct NonPromptCascadeTask { zorroAccounting(collisions); fillCandidatesVector(collisions, tracks, cascades, gCandidatesNT); fillDataTable(gCandidatesNT); - fillMultHistos(collisions); + // fillMultHistos(collisions); } PROCESS_SWITCH(NonPromptCascadeTask, processCascadesData, "process cascades: Data analysis", false); @@ -950,6 +951,7 @@ struct NonPromptCascadeTask { const float ptMC = mcPar.pt(); mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRM"), mult, multReco, ptMC, ptReco); + NPMCNTable(ptMC, ptReco, mult, multReco); } // ------------------------------------------------------------ @@ -959,6 +961,7 @@ struct NonPromptCascadeTask { if (!isReco[pid]) { auto mcp = mcParticles.rawIteratorAt(pid); mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRMNotInRecoTrk"), isRecoMult[pid], mcp.pt()); + NPMCNTable(mcp.pt(), -1, isRecoMult[pid], -1); } } @@ -971,6 +974,7 @@ struct NonPromptCascadeTask { const int mult = mcMult[mcid]; for (auto const& pt : mcptvec) { mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRMNotInRecoCol"), mult, pt); + NPMCNTable(pt, -2, mult, -2); } } } @@ -1007,7 +1011,7 @@ struct NonPromptCascadeTask { } } }; - PROCESS_SWITCH(NonPromptCascadeTask, processPileUp, "pile up studies", true); + PROCESS_SWITCH(NonPromptCascadeTask, processPileUp, "pile up studies", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 6da687bd69495fa53abdfa41b28e1f06d311826f Mon Sep 17 00:00:00 2001 From: YazhenLin Date: Fri, 20 Mar 2026 16:31:50 +0800 Subject: [PATCH 003/282] [PWGDQ] Change some code in the dqEnergyCorrelator_direct.cxx for the energy correlator study (#15454) --- PWGDQ/Core/VarManager.h | 11 ++++++++--- PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 6402590ef5a..8af94063bbe 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -1364,7 +1364,7 @@ class VarManager : public TObject template static void FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, float* values = nullptr, float Translow = 1. / 3, float Transhigh = 2. / 3, bool applyFitMass = false, float sidebandMass = 0.0f); template - static void FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values = nullptr); + static void FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values = nullptr, bool applyFitMass = false); template static void FillDileptonPhoton(T1 const& dilepton, T2 const& photon, float* values = nullptr); template @@ -5858,7 +5858,7 @@ void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2 } template -void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values) +void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values, bool applyFitMass) { if (fgUsedVars[kMCCosChi_gen] || fgUsedVars[kMCWeight_gen] || fgUsedVars[kMCdeltaeta_gen] || fgUsedVars[kMCCosChi_rec] || fgUsedVars[kMCWeight_rec] || fgUsedVars[kMCdeltaeta_rec]) { // energy correlators @@ -5870,6 +5870,11 @@ void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 cons ROOT::Math::PtEtaPhiMVector v_lepton2(lepton2.pt(), lepton2.eta(), lepton2.phi(), m2); ROOT::Math::PtEtaPhiMVector dilepton = v_lepton1 + v_lepton2; + float dileptonmass = o2::constants::physics::MassJPsi; + if (applyFitMass) { + dileptonmass = dilepton.mass(); + } + float MassHadron; if constexpr (pairType == kJpsiHadronMass) { MassHadron = TMath::Sqrt(t1.e() * t1.e() - t1.p() * t1.p()); @@ -5885,7 +5890,7 @@ void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 cons values[kMCWeight_gen] = E_boost_gen / o2::constants::physics::MassJPsi; values[kMCdeltaeta_gen] = track.eta() - t1.eta(); - ROOT::Math::PtEtaPhiMVector v1_rec(dilepton.pt(), dilepton.eta(), dilepton.phi(), dilepton.mass()); + ROOT::Math::PtEtaPhiMVector v1_rec(dilepton.pt(), dilepton.eta(), dilepton.phi(), dileptonmass); ROOT::Math::PtEtaPhiMVector v2_rec(hadron.pt(), hadron.eta(), hadron.phi(), o2::constants::physics::MassPionCharged); values[kMCCosChi_rec] = LorentzTransformJpsihadroncosChi("coschi", v1_rec, v2_rec); float E_boost_rec = LorentzTransformJpsihadroncosChi("weight_boost", v1_rec, v2_rec); diff --git a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx index b70af0b51d4..b91e9ef5593 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -223,6 +223,7 @@ struct AnalysisEnergyCorrelator { for (auto& t : addTrackCuts) { fTrackCuts.push_back(reinterpret_cast(t)); fTrackCutNames.push_back(t->GetName()); + trackCutStr += Form(",%s", t->GetName()); } } @@ -797,13 +798,13 @@ struct AnalysisEnergyCorrelator { groupedMCTracks1.bindInternalIndicesTo(&mcTracks); groupedMCTracks2.bindInternalIndicesTo(&mcTracks); for (auto& t1 : groupedMCTracks1) { - auto t1_raw = groupedMCTracks1.rawIteratorAt(t1.globalIndex()); + auto t1_raw = mcTracks.rawIteratorAt(t1.globalIndex()); for (auto& sig : fGenMCSignals) { if (sig->CheckSignal(true, t1_raw)) { if (t1.mcCollisionId() != event1.mcCollisionId()) { // check that the mc track belongs to the same mc collision as the reconstructed event continue; } - VarManager::FillTrackMC(groupedMCTracks1, t1_raw); + VarManager::FillTrackMC(mcTracks, t1_raw); if (!MixedEvent && !PionMass) { fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), VarManager::fgValues); } From 6589397b486cba5abd9992730a850c9f730d51ef Mon Sep 17 00:00:00 2001 From: "Q.Y. Xia" <91366503+huinaibing@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:40:28 +0800 Subject: [PATCH 004/282] [PWGCF] Add closure test for rho calculation (#15459) --- PWGCF/Flow/Tasks/pidFlowPtCorr.cxx | 57 ++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx index bc38ec4cb09..0266e81304d 100644 --- a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx +++ b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx @@ -144,6 +144,7 @@ struct PidFlowPtCorr { O2_DEFINE_CONFIGURABLE(cfgOutPutPtSpectra, bool, false, "output pt spectra for data, MC and RECO"); O2_DEFINE_CONFIGURABLE(cfgCheck2MethodDiff, bool, false, "check difference between v2' && v2''"); O2_DEFINE_CONFIGURABLE(cfgUseITSOnly4MeanPt, bool, false, "use ITS only to calculate mean pt"); + O2_DEFINE_CONFIGURABLE(cfgClosureTest, int, 0, "choose (val) percent particle from charged to pass Pion PID selection"); } switchsOpts; /** @@ -566,14 +567,23 @@ struct PidFlowPtCorr { registry.add("meanptCentNbs/hChargedPionWithNpair", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hChargedPionFull", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hPion", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + registry.add("meanptCentNbs/hPionMeanptWeightPidflow", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + + if (switchsOpts.cfgClosureTest.value != 0) { + registry.add("meanptCentNbs/hPionMeanptWeightC22pure", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + registry.add("meanptCentNbs/hPionMeanptWeightMeanpt", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + registry.add("meanptCentNbs/hPionMeanptWeightC22prime", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + } registry.add("meanptCentNbs/hChargedKaonWithNpair", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hChargedKaonFull", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hKaon", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + registry.add("meanptCentNbs/hKaonMeanptWeightPidflow", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hChargedProtonWithNpair", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hChargedProtonFull", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); registry.add("meanptCentNbs/hProton", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); + registry.add("meanptCentNbs/hProtonMeanptWeightPidflow", "", {HistType::kTProfile3D, {cfgaxisMeanPt, axisMultiplicity, meanptC22GraphOpts.cfgaxisBootstrap}}); // end pid // end init tprofile3d for <2'> - meanpt @@ -715,6 +725,13 @@ struct PidFlowPtCorr { template bool isPion(TrackObject const& track) { + if (switchsOpts.cfgClosureTest.value != 0) { + float rnd4test = fRndm->Rndm() * 100; + if (rnd4test < switchsOpts.cfgClosureTest.value) { + return true; + } + } // closure test + bool resultPion = true; // Declare ITSResponse object internally to get ITS Sigma @@ -911,20 +928,19 @@ struct PidFlowPtCorr { return; registry.fill(HIST("meanptCentNbs/hCharged"), ptSum / nch, cent, rndm * cfgFlowNbootstrap, val, nch * dnx); - registry.fill(HIST("meanptCentNbs/hChargedMeanpt"), ptSum / nch, cent, rndm * cfgFlowNbootstrap, ptSum / nch, nch * dnx); + registry.fill(HIST("meanptCentNbs/hChargedMeanpt"), ptSum / nch, cent, rndm * cfgFlowNbootstrap, ptSum / nch, nch * dnx * val); } /** - * @brief note that the graph's x axis is pid meanpt, for <2'> weight is nPid * npairPID, for <2> weight is nch * npair + * @brief note that the graph's x axis is pid meanpt, for <2'> weight is nPid * npairPID, for <2> weight is nPid * npair * * @param cent - * @param nch * @param rndm * @param type * @param pidPtSum * @param nPid */ - void fillFC4PtC22(const double& cent, const double& nch, const double& rndm, MyParticleType type, const double& pidPtSum, const double& nPid) + void fillFC4PtC22(const double& cent, const double& rndm, MyParticleType type, const double& pidPtSum, const double& nPid) { // <2> double dnx, val; @@ -951,8 +967,27 @@ struct PidFlowPtCorr { return; registry.fill(HIST("meanptCentNbs/hPion"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, pidc22, nPid * npairPid); - registry.fill(HIST("meanptCentNbs/hChargedPionFull"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx * nch); + registry.fill(HIST("meanptCentNbs/hChargedPionFull"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx * nPid); registry.fill(HIST("meanptCentNbs/hChargedPionWithNpair"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx); + registry.fill(HIST("meanptCentNbs/hPionMeanptWeightPidflow"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, pidPtSum / nPid, nPid * npairPid * pidc22 * pidc22 / val); + + if (switchsOpts.cfgClosureTest.value != 0) { + double npair4c22pure = fGFW->Calculate(corrconfigs.at(29), 0, kTRUE).real(); + if (npair4c22pure > 1e-3) + registry.fill(HIST("meanptCentNbs/hPionMeanptWeightC22pure"), + pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, + pidPtSum / nPid, + nPid * npairPid * fGFW->Calculate(corrconfigs.at(29), 0, kFALSE).real() / npair4c22pure); + + registry.fill(HIST("meanptCentNbs/hPionMeanptWeightMeanpt"), + pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, + pidPtSum / nPid, + nPid * npairPid * pidPtSum / nPid); + registry.fill(HIST("meanptCentNbs/hPionMeanptWeightC22prime"), + pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, + pidPtSum / nPid, + nPid * npairPid * pidc22); + } break; // end pion @@ -967,8 +1002,9 @@ struct PidFlowPtCorr { return; registry.fill(HIST("meanptCentNbs/hKaon"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, pidc22, nPid * npairPid); - registry.fill(HIST("meanptCentNbs/hChargedKaonFull"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx * nch); + registry.fill(HIST("meanptCentNbs/hChargedKaonFull"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx * nPid); registry.fill(HIST("meanptCentNbs/hChargedKaonWithNpair"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx); + registry.fill(HIST("meanptCentNbs/hKaonMeanptWeightPidflow"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, pidPtSum / nPid, nPid * npairPid * pidc22 * pidc22 / val); break; // end kaon @@ -983,8 +1019,9 @@ struct PidFlowPtCorr { return; registry.fill(HIST("meanptCentNbs/hProton"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, pidc22, nPid * npairPid); - registry.fill(HIST("meanptCentNbs/hChargedProtonFull"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx * nch); + registry.fill(HIST("meanptCentNbs/hChargedProtonFull"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx * nPid); registry.fill(HIST("meanptCentNbs/hChargedProtonWithNpair"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, val, dnx); + registry.fill(HIST("meanptCentNbs/hProtonMeanptWeightPidflow"), pidPtSum / nPid, cent, rndm * cfgFlowNbootstrap, pidPtSum / nPid, nPid * npairPid * pidc22 * pidc22 / val); break; // end proton @@ -2066,13 +2103,13 @@ struct PidFlowPtCorr { fillFC4PtC22(cent, ptSum, nch, rndm); if (nPionWeighted > 0) - fillFC4PtC22(cent, nch, rndm, MyParticleType::kPion, pionPtSum, nPionWeighted); + fillFC4PtC22(cent, rndm, MyParticleType::kPion, pionPtSum, nPionWeighted); if (nKaonWeighted > 0) - fillFC4PtC22(cent, nch, rndm, MyParticleType::kKaon, kaonPtSum, nKaonWeighted); + fillFC4PtC22(cent, rndm, MyParticleType::kKaon, kaonPtSum, nKaonWeighted); if (nProtonWeighted > 0) - fillFC4PtC22(cent, nch, rndm, MyParticleType::kProton, protonPtSum, nProtonWeighted); + fillFC4PtC22(cent, rndm, MyParticleType::kProton, protonPtSum, nProtonWeighted); if (switchsOpts.cfgOutPutPtSpectra.value) { // charged calculation From 5a583e25e93f1a62c8aaa7dd225784357dc13960 Mon Sep 17 00:00:00 2001 From: Thorkj <154221526+Thorkj@users.noreply.github.com> Date: Fri, 20 Mar 2026 09:41:15 +0100 Subject: [PATCH 005/282] [PWGCF] small bug fixes in regard to TPC-FIT correlations, and the created histograms (#15450) Co-authored-by: ALICE Action Bot --- .../Tasks/corrSparse.cxx | 92 +++++++++++++------ 1 file changed, 66 insertions(+), 26 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index e0c75ff22a6..6c6e7464216 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -100,6 +100,7 @@ struct CorrSparse { O2_DEFINE_CONFIGURABLE(processFT0A, bool, true, "Process FT0A correlations") O2_DEFINE_CONFIGURABLE(processFT0C, bool, true, "Process FT0C correlations") O2_DEFINE_CONFIGURABLE(processMFT, bool, true, "Process MFT correlations") + O2_DEFINE_CONFIGURABLE(withGain, bool, true, "Use gain for FT0A and FT0C") } cfgDetectorConfig; @@ -143,9 +144,7 @@ struct CorrSparse { O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector") O2_DEFINE_CONFIGURABLE(cfgRemapFT0ADeadChannels, bool, false, "If true, remap FT0A channels 60-63 to amplitudes from 92-95 respectively") - O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115") - - } cfgFITConfig; + O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115")} cfgFITConfig; O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix") O2_DEFINE_CONFIGURABLE(cfgMergingCut, float, 0.02, "Merging cut on track merge") @@ -157,7 +156,6 @@ struct CorrSparse { O2_DEFINE_CONFIGURABLE(cfgCentralityWeight, std::string, "", "CCDB path to centrality weight object") O2_DEFINE_CONFIGURABLE(cfgLocalEfficiency, bool, false, "Use local efficiency object") O2_DEFINE_CONFIGURABLE(cfgUseEventWeights, bool, false, "Use event weights for mixed event") - O2_DEFINE_CONFIGURABLE(cfgCollType, int, 0, "Collision type: 0 = pp, 1 = pPb, 2 = pO, 3 = OO") struct : ConfigurableGroup { O2_DEFINE_CONFIGURABLE(cfgMultCentHighCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 10.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); @@ -190,6 +188,11 @@ struct CorrSparse { TF1* fT0AV0ASigma = nullptr; } cfgFuncParas; + Configurable cfgCutFV0{"cfgCutFV0", 50., "FV0A threshold"}; + Configurable cfgCutFT0A{"cfgCutFT0A", 150., "FT0A threshold"}; + Configurable cfgCutFT0C{"cfgCutFT0C", 50., "FT0C threshold"}; + Configurable cfgCutZDC{"cfgCutZDC", 10., "ZDC threshold"}; + SliceCache cache; SliceCache cacheNch; @@ -236,7 +239,7 @@ struct CorrSparse { // make the filters and cuts. Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut); - Filter trackFilter = (nabs(aod::track::eta) < cfgTrackCuts.cfgEtaCut) && (cfgTrackCuts.cfgPtCutMin < aod::track::pt) && (cfgTrackCuts.cfgPtCutMax > aod::track::pt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgTrackCuts.cfgCutChi2prTPCcls) && (aod::track::dcaZ < cfgTrackCuts.cfgCutDCAz); + Filter trackFilter = (nabs(aod::track::eta) < cfgTrackCuts.cfgEtaCut) && (cfgTrackCuts.cfgPtCutMin < aod::track::pt) && (cfgTrackCuts.cfgPtCutMax > aod::track::pt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgTrackCuts.cfgCutChi2prTPCcls) && (aod::track::dcaZ < cfgTrackCuts.cfgCutDCAz); Filter mftTrackEtaFilter = ((aod::fwdtrack::eta < cfgMftConfig.etaMftTrackMaxFilter) && (aod::fwdtrack::eta > cfgMftConfig.etaMftTrackMinFilter)); @@ -399,22 +402,22 @@ struct CorrSparse { if (cfgDetectorConfig.processFT0A) { registry.add("deltaEta_deltaPhi_same_TPC_FT0A", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0a}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed_TPC_FT0A", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0a}}); - registry.add("Assoc_amp_same_TPC_FT0A", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); - registry.add("Assoc_amp_mixed_TPC_FT0A", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); - registry.add("Trig_hist_TPC_FT0A", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); + registry.add("Assoc_amp_same", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); + registry.add("Assoc_amp_mixed", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); + registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); } if (cfgDetectorConfig.processFT0C) { registry.add("deltaEta_deltaPhi_same_TPC_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed_TPC_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); - registry.add("Assoc_amp_same_TPC_FT0C", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); - registry.add("Assoc_amp_mixed_TPC_FT0C", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); - registry.add("Trig_hist_TPC_FT0C", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); + registry.add("Assoc_amp_same", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); + registry.add("Assoc_amp_mixed", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}}); + registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); } if (cfgDetectorConfig.processFV0) { registry.add("deltaEta_deltaPhi_same_TPC_FV0", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFv0}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_same_TPC_FV0", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFv0}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed_TPC_FV0", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFv0}}); - registry.add("Trig_hist_FT0A_FT0C", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); + registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); } } @@ -768,7 +771,7 @@ struct CorrSparse { auto theta = std::atan2(r, z); return -std::log(std::tan(0.5 * theta)); } - + // checks if it is an accepted mft track template bool isAcceptedMftTrack(TTrack const& mftTrack) { @@ -1065,13 +1068,23 @@ struct CorrSparse { float deltaEta = track1.eta() - eta; if (system == SameEvent) { + if (cfgDetectorConfig.processMFT) { + registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FV0"), deltaPhi, deltaEta, amplitude * triggerWeight); + } else { + registry.fill(HIST("deltaEta_deltaPhi_same_TPC_FV0"), deltaPhi, deltaEta, amplitude * triggerWeight); + } + registry.fill(HIST("Assoc_amp_same"), channelID, amplitude); same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude * triggerWeight); - registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FV0"), deltaPhi, deltaEta, amplitude * triggerWeight); + } else if (system == MixedEvent) { + if (cfgDetectorConfig.processMFT) { + registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FV0"), deltaPhi, deltaEta, amplitude); + } else { + registry.fill(HIST("deltaEta_deltaPhi_mixed_TPC_FV0"), deltaPhi, deltaEta, amplitude); + } registry.fill(HIST("Assoc_amp_mixed"), channelID, amplitude); mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude); - registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FV0"), deltaPhi, deltaEta, amplitude); } } } @@ -1091,7 +1104,11 @@ struct CorrSparse { for (std::size_t iCh = 0; iCh < channelSize; iCh++) { int channelID = 0; float amplitude = 0.; - getChannelWithGain(tracks2, iCh, channelID, amplitude, corType); + if (cfgDetectorConfig.withGain) { + getChannelWithGain(tracks2, iCh, channelID, amplitude, corType); + } else { + getChannelFT0(tracks2, iCh, channelID, amplitude, corType); + } // reject depending on FT0C/FT0A rings if (corType == kFT0C) { @@ -1111,25 +1128,41 @@ struct CorrSparse { if (system == SameEvent) { if (corType == kFT0A) { + if (cfgDetectorConfig.processMFT) { + registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0A"), deltaPhi, deltaEta, amplitude * triggerWeight); + } else { + registry.fill(HIST("deltaEta_deltaPhi_same_TPC_FT0A"), deltaPhi, deltaEta, amplitude * triggerWeight); + } registry.fill(HIST("Assoc_amp_same"), channelID, amplitude); same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude * triggerWeight); - registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0A"), deltaPhi, deltaEta, amplitude * triggerWeight); } if (corType == kFT0C) { + if (cfgDetectorConfig.processMFT) { + registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0C"), deltaPhi, deltaEta, amplitude * triggerWeight); + } else { + registry.fill(HIST("deltaEta_deltaPhi_same_TPC_FT0C"), deltaPhi, deltaEta, amplitude * triggerWeight); + } registry.fill(HIST("Assoc_amp_same"), channelID, amplitude); same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude * triggerWeight); - registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0C"), deltaPhi, deltaEta, amplitude * triggerWeight); } } else if (system == MixedEvent) { if (corType == kFT0A) { + if (cfgDetectorConfig.processMFT) { + registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0A"), deltaPhi, deltaEta, amplitude); + } else { + registry.fill(HIST("deltaEta_deltaPhi_mixed_TPC_FT0A"), deltaPhi, deltaEta, amplitude); + } registry.fill(HIST("Assoc_amp_mixed"), channelID, amplitude); mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude); - registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0A"), deltaPhi, deltaEta, amplitude); } if (corType == kFT0C) { + if (cfgDetectorConfig.processMFT) { + registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0C"), deltaPhi, deltaEta, amplitude); + } else { + registry.fill(HIST("deltaEta_deltaPhi_mixed_TPC_FT0C"), deltaPhi, deltaEta, amplitude); + } registry.fill(HIST("Assoc_amp_mixed"), channelID, amplitude); mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude); - registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0C"), deltaPhi, deltaEta, amplitude); } } } @@ -1482,7 +1515,10 @@ struct CorrSparse { if (!collision.has_foundFT0()) return; loadAlignParam(bc.timestamp()); - loadGain(bc); + if (cfgDetectorConfig.withGain) { + loadGain(bc); + } + loadCorrection(bc.timestamp()); if ((tpctracks.size() < cfgEventSelection.cfgMinMult || tpctracks.size() >= cfgEventSelection.cfgMaxMult)) { @@ -1571,7 +1607,7 @@ struct CorrSparse { } } } - PROCESS_SWITCH(CorrSparse, processSameMftReassociated2DFIT, "Process same event for MFT-FIT correlation with reassociated tracks", true); + PROCESS_SWITCH(CorrSparse, processSameMftReassociated2DFIT, "Process same event for MFT-FIT correlation with reassociated tracks", false); ///////////////////////// ////////Mid-Mid////////// @@ -1588,14 +1624,15 @@ struct CorrSparse { if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), true)) return; - registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin + loadCorrection(bc.timestamp()); + + fillYield(collision, tracks); if (tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult) { return; } - loadCorrection(bc.timestamp()); - fillYield(collision, tracks); + registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin fillCorrelations(tracks, tracks, collision.posZ(), tracks.size(), SameEvent, getMagneticField(bc.timestamp())); } @@ -1623,7 +1660,10 @@ struct CorrSparse { } loadAlignParam(bc.timestamp()); - // loadGain(bc); + if (cfgDetectorConfig.withGain) { + loadGain(bc); + } + loadCorrection(bc.timestamp()); registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin From 5d54f1de0ee445384e8404daa779c38a08b33892 Mon Sep 17 00:00:00 2001 From: smaff92 <33285879+smaff92@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:04:19 +0900 Subject: [PATCH 006/282] =?UTF-8?q?[PWGJE]=20Temporary=20functions=20to=20?= =?UTF-8?q?quickly=20QA=20Prompt=20Photon=20MC=20production.=20Will=20m?= =?UTF-8?q?=E2=80=A6=20(#15462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ALICE Action Bot --- PWGJE/Tasks/statPromptPhoton.cxx | 467 ++++++++++++++++++++++++++++++- 1 file changed, 466 insertions(+), 1 deletion(-) diff --git a/PWGJE/Tasks/statPromptPhoton.cxx b/PWGJE/Tasks/statPromptPhoton.cxx index 98c52aa45e7..4e13332dcfe 100644 --- a/PWGJE/Tasks/statPromptPhoton.cxx +++ b/PWGJE/Tasks/statPromptPhoton.cxx @@ -51,9 +51,9 @@ #include #include +#include #include #include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -96,6 +96,7 @@ struct statPromptPhoton { Configurable cfgTrackFilter{"cfgTrackFilter", "globalTracks", "set track selections"}; Configurable cfgJETracks{"cfgJETracks", false, "Enables running on derived JE data"}; Configurable cfgGenHistograms{"cfgGenHistograms", false, "Enables Generated histograms"}; + Configurable cfgGenReqRec{"cfgGenReqRec", false, "Only consider generated events which are successfully reconstructed"}; Configurable cfgRecHistograms{"cfgRecHistograms", false, "Enables Reconstructed histograms"}; Configurable cfgDataHistograms{"cfgDataHistograms", false, "Enables Data histograms"}; Configurable cfgTriggerMasks{"cfgTriggerMasks", "", "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"}; @@ -191,9 +192,52 @@ struct statPromptPhoton { histos.add("REC_TrueTrigger_V_PtHadSum_Photon", "REC_Trigger_V_PtHadSum_Photon", kTH2F, {{100, 0, 100}, pthadAxis}); histos.add("REC_dR_Photon", "REC_dR_Photon", kTH1F, {{628, 0.0, 2 * TMath::Pi()}}); histos.add("REC_dR_Stern", "REC_dR_Stern", kTH1F, {{628, 0.0, 2 * TMath::Pi()}}); + histos.add("REC_prompt_phiQA", "REC_prompt_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_prompt_etaQA", "REC_prompt_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_prompt_ptQA", "REC_prompt_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_decay_phiQA", "REC_decay_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_decay_etaQA", "REC_decay_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_decay_ptQA", "REC_decay_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_frag_phiQA", "REC_frag_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_frag_etaQA", "REC_frag_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_frag_ptQA", "REC_frag_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_direct_phiQA", "REC_direct_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_direct_etaQA", "REC_direct_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_direct_ptQA", "REC_direct_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_cluster_phiQA", "REC_cluster_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_cluster_etaQA", "REC_cluster_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_cluster_energyQA", "REC_cluster_energyQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_clusteriso_phiQA", "REC_clusteriso_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_clusteriso_etaQA", "REC_clusteriso_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_clusteriso_energyQA", "REC_clusteriso_energyQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_track_phiQA", "REC_track_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_track_etaQA", "REC_track_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_track_ptQA", "REC_track_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_cluster_direct_phiQA", "REC_cluster_direct_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_cluster_direct_etaQA", "REC_cluster_direct_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_cluster_direct_energyQA", "REC_cluster_direct_energyQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_cluster_frag_phiQA", "REC_cluster_frag_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_cluster_frag_etaQA", "REC_cluster_frag_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_cluster_frag_energyQA", "REC_cluster_frag_energyQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("REC_cluster_both_phiQA", "REC_cluster_both_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("REC_cluster_both_etaQA", "REC_cluster_both_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("REC_cluster_both_energyQA", "REC_cluster_both_energyQA", kTH1F, {{82, -1.0, 40.0}}); } if (cfgGenHistograms) { + histos.add("GEN_prompt_phiQA", "GEN_prompt_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("GEN_prompt_etaQA", "GEN_prompt_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("GEN_prompt_ptQA", "GEN_prompt_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("GEN_decay_phiQA", "GEN_decay_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("GEN_decay_etaQA", "GEN_decay_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("GEN_decay_ptQA", "GEN_decay_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("GEN_frag_phiQA", "GEN_frag_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("GEN_frag_etaQA", "GEN_frag_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("GEN_frag_ptQA", "GEN_frag_ptQA", kTH1F, {{82, -1.0, 40.0}}); + histos.add("GEN_direct_phiQA", "GEN_direct_phiQA", kTH1F, {{640 * 2, 0, 2 * TMath::Pi()}}); + histos.add("GEN_direct_etaQA", "GEN_direct_etaQA", kTH1F, {{100, -1, 1}}); + histos.add("GEN_direct_ptQA", "GEN_direct_ptQA", kTH1F, {{82, -1.0, 40.0}}); histos.add("GEN_nEvents", "GEN_nEvents", kTH1F, {{4, 0.0, 4.0}}); + histos.add("GEN_nEvents_simple", "GEN_nEvents", kTH1F, {{4, 0.0, 4.0}}); histos.add("GEN_True_Trigger_Energy", "GEN_True_Trigger_Energy", kTH1F, {{82, -1.0, 40.0}}); histos.add("GEN_Particle_Pt", "GEN_Particle_Pt", kTH1F, {{82, -1.0, 40.0}}); histos.add("GEN_True_Photon_Energy", "GEN_True_Photon_Energy", kTH1F, {{8200, -1.0, 40.0}}); @@ -420,6 +464,71 @@ struct statPromptPhoton { }; // end of track selection ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// + // Below is shamelessly stolen from Florian's gammetreeproducer code. + template + T iTopCopy(const T& particle) const + { + int iUp = particle.globalIndex(); + T currentParticle = particle; + int pdgCode = particle.pdgCode(); + auto mothers = particle.template mothers_as(); + while (iUp > 0 && mothers.size() == 1 && mothers[0].globalIndex() > 0 && mothers[0].pdgCode() == pdgCode) { + iUp = mothers[0].globalIndex(); + currentParticle = mothers[0]; + mothers = currentParticle.template mothers_as(); + } + return currentParticle; + } + + /// \brief Checks if a particle is a prompt photon + /// \param particle The MC particle to check + /// \return true if particle is a prompt photon, false otherwise + bool isPromptPhoton(const auto& particle) + { + if (particle.pdgCode() == PDG_t::kGamma && particle.isPhysicalPrimary() && std::abs(particle.getGenStatusCode()) < 90) { + return true; + } + return false; + } + /// \brief Checks if a particle is a direct prompt photon + /// \param particle The particle to check + /// \return true if particle is a direct prompt photon, false otherwise + bool isDirectPromptPhoton(const auto& particle) + { + // check if particle isa prompt photon + if (particle.pdgCode() == PDG_t::kGamma && particle.isPhysicalPrimary() && std::abs(particle.getGenStatusCode()) < 90) { + // find the top carbon copy + auto topCopy = iTopCopy(particle); + if (topCopy.pdgCode() == PDG_t::kGamma && std::abs(topCopy.getGenStatusCode()) < 40) { // < 40 is particle directly produced in hard scattering + return true; + } + } + return false; + } + /// \brief Checks if a particle is a fragmentation photon + /// \param particle The particle to check + /// \return true if particle is a fragmentation photon, false otherwise + bool isFragmentationPhoton(const auto& particle) + { + if (particle.pdgCode() == PDG_t::kGamma && particle.isPhysicalPrimary() && std::abs(particle.getGenStatusCode()) < 90) { + // find the top carbon copy + auto topCopy = iTopCopy(particle); + if (topCopy.pdgCode() == PDG_t::kGamma && std::abs(topCopy.getGenStatusCode()) >= 40) { // frag photon + return true; + } + } + return false; + } + /// \brief Checks if a particle is a decay photon + /// \param particle The particle to check + /// \return true if particle is a decay photon, false otherwise + bool isDecayPhoton(const auto& particle) + { + if (particle.pdgCode() == PDG_t::kGamma && particle.isPhysicalPrimary() && std::abs(particle.getGenStatusCode()) >= 90) { + return true; + } + return false; + } ///////////////////////////////////////////////////////////////////////////// // PROCESS @@ -1364,6 +1473,362 @@ struct statPromptPhoton { PROCESS_SWITCH(statPromptPhoton, processData, "processJE data", false); + int nEventsGenMC_Simple = 0; + void processMCGen_simple(filteredMCCollisions::iterator const& collision, soa::SmallGroups> const& recocolls, aod::JMcParticles const& mcParticles, jfilteredMCClusters const&) + { + nEventsGenMC_Simple++; + if (cfgDebug) { + if ((nEventsGenMC_Simple + 1) % 10000 == 0) { + std::cout << "Processed Gen MC Events: " << nEventsGenMC_Simple << std::endl; + } + } + histos.fill(HIST("GEN_nEvents_simple"), 0.5); + if (fabs(collision.posZ()) > cfgVtxCut) + return; + + if (cfgGenReqRec) { + if (recocolls.size() <= 0) // not reconstructed + return; + for (auto& recocoll : recocolls) { // poorly reconstructed + if (!recocoll.sel8()) + return; + if (fabs(recocoll.posZ()) > cfgVtxCut) + + return; + histos.fill(HIST("GEN_nEvents_simple"), 1.5); + + if (cfgEmcTrigger) { + if (!recocoll.isEmcalReadout()) + return; + } + histos.fill(HIST("GEN_nEvents_simple"), 2.5); + } + } + + // First pass: find all status -23 particles + for (auto& hardParticle : mcParticles) { + if (hardParticle.getGenStatusCode() != -23) + continue; + + bool isPhoton23 = (hardParticle.pdgCode() == 22); + + // For prompt: find the final-state photon descending from this -23 photon// + // For frag: find any final-state photon descending from this -23 non-photon// + // We search all final-state photons and check if they trace back here// + + for (auto& mcParticle : mcParticles) { + if (mcParticle.pdgCode() != 22) + continue; + if (mcParticle.getGenStatusCode() < 0) + continue; + if (std::fabs(mcParticle.getGenStatusCode()) >= 81 || !mcParticle.isPhysicalPrimary()) + continue; + + // Chase this final-state photon upward + int chaseindex = -1; + for (auto& mom : mcParticle.mothers_as()) { + chaseindex = mom.globalIndex(); + break; + } + if (chaseindex < 0) + continue; + + std::set visited; + bool chase = true; + bool hadronInChain = false; + bool reachedThisHard = false; + bool cleanPhotonChain = true; // all intermediates are photons + + while (chase) { + if (visited.count(chaseindex)) { + chase = false; + break; + } + visited.insert(chaseindex); + + for (auto& particle : mcParticles) { + if (particle.globalIndex() != chaseindex) + continue; + + if (particle.globalIndex() == hardParticle.globalIndex()) { + reachedThisHard = true; + chase = false; + break; + } + + int abspdg = std::abs(particle.pdgCode()); + if (abspdg > 100) + hadronInChain = true; + if (abspdg != 22) + cleanPhotonChain = false; + + int nextindex = -1; + for (auto& mom : particle.mothers_as()) { + nextindex = mom.globalIndex(); + break; + } + if (nextindex < 0) { + chase = false; + } else { + chaseindex = nextindex; + } + break; + } + } + + if (!reachedThisHard) + continue; + + if (isPhoton23 && cleanPhotonChain) { + // Case 1: -23 photon, clean photon chain — direct prompt + histos.fill(HIST("GEN_direct_phiQA"), mcParticle.phi()); + histos.fill(HIST("GEN_direct_etaQA"), mcParticle.eta()); + histos.fill(HIST("GEN_direct_ptQA"), mcParticle.pt()); + } else if (!isPhoton23 && !hadronInChain) { + // Case 2: -23 non-photon, no hadrons — fragmentation + histos.fill(HIST("GEN_frag_phiQA"), mcParticle.phi()); + histos.fill(HIST("GEN_frag_etaQA"), mcParticle.eta()); + histos.fill(HIST("GEN_frag_ptQA"), mcParticle.pt()); + } + } // final-state photon loop + } // hard particle loop + } + PROCESS_SWITCH(statPromptPhoton, processMCGen_simple, "processMC_QA_Gen", false); + int nEventsRecMC_simple = 0; + void processMCRec_simple(jfilteredCollisions::iterator const& collision, jfilteredMCClusters const& mcclusters, jTrackCandidates const&, soa::Join const&, TrackCandidates const&, aod::JMcParticles const& mcparticles, BcCandidates const&, jEMCtracks const& emctracks, aod::JetMcCollisions const&) + { + nEventsRecMC_simple++; + if (cfgDebug) { + if ((nEventsRecMC_simple + 1) % 10000 == 0) { + std::cout << "Processed JE Rec MC Events: " << nEventsRecMC_simple << std::endl; + } + } + histos.fill(HIST("REC_nEvents"), 0.5); + if (fabs(collision.posZ()) > cfgVtxCut) + return; + if (!collision.sel8()) + return; + histos.fill(HIST("REC_nEvents"), 1.5); + if (cfgEmcTrigger) { + if (!collision.isEmcalReadout()) + return; + } + histos.fill(HIST("REC_nEvents"), 2.5); + if (!jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) + return; + + for (auto& mccluster : mcclusters) { + histos.fill(HIST("REC_M02_BC"), mccluster.m02()); + if (mccluster.m02() < cfgLowM02) + continue; + if (mccluster.m02() > cfgHighM02) + continue; + if (mccluster.energy() < cfgLowClusterE) + continue; + if (mccluster.energy() > cfgHighClusterE) + continue; + if (fabs(mccluster.eta()) > cfgtrkMaxEta) + continue; + int ClusterHasDirectPhoton = 0; + int ClusterHasFragPhoton = 0; + auto ClusterParticles = mccluster.mcParticles_as(); + for (auto& clusterparticle : ClusterParticles) { + if (clusterparticle.pdgCode() != 22 && std::fabs(clusterparticle.pdgCode()) != 13) + continue; + if (clusterparticle.getGenStatusCode() < 0) + continue; + if (std::fabs(clusterparticle.getGenStatusCode()) >= 81) + continue; + + int chaseindex = -1; + for (auto& mom : clusterparticle.mothers_as()) { + chaseindex = mom.globalIndex(); + break; + } + if (chaseindex < 0) + continue; + + std::set visited; + bool chase = true; + bool hadronInChain = false; + bool cleanPhotonChain = true; + bool adrianprompt = false; + bool adrianfrag = false; + + while (chase) { + if (visited.count(chaseindex)) { + chase = false; + break; + } + visited.insert(chaseindex); + + for (auto& particle : mcparticles) { + if (particle.globalIndex() != chaseindex) + continue; + + if (particle.getGenStatusCode() == -23) { + if (particle.pdgCode() == 22 && cleanPhotonChain) { + adrianprompt = true; + } else if (particle.pdgCode() != 22 && !hadronInChain) { + adrianfrag = true; + } + chase = false; + break; + } + + int abspdg = std::abs(particle.pdgCode()); + if (abspdg > 100) + hadronInChain = true; + if (abspdg != 22) + cleanPhotonChain = false; + + int nextindex = -1; + for (auto& mom : particle.mothers_as()) { + nextindex = mom.globalIndex(); + break; + } + if (nextindex < 0) { + chase = false; + } else { + chaseindex = nextindex; + } + break; + } + } // chase + + if (adrianprompt) { + ClusterHasDirectPhoton++; + histos.fill(HIST("REC_direct_phiQA"), clusterparticle.phi()); + histos.fill(HIST("REC_direct_etaQA"), clusterparticle.eta()); + histos.fill(HIST("REC_direct_ptQA"), clusterparticle.pt()); + } + if (adrianfrag) { + ClusterHasFragPhoton++; + histos.fill(HIST("REC_frag_phiQA"), clusterparticle.phi()); + histos.fill(HIST("REC_frag_etaQA"), clusterparticle.eta()); + histos.fill(HIST("REC_frag_ptQA"), clusterparticle.pt()); + } + } // clusterparticle loop + + if (ClusterHasFragPhoton > 0) { + histos.fill(HIST("REC_cluster_frag_phiQA"), mccluster.phi()); + histos.fill(HIST("REC_cluster_frag_etaQA"), mccluster.eta()); + histos.fill(HIST("REC_cluster_frag_energyQA"), mccluster.energy()); + } + if (ClusterHasDirectPhoton > 0) { + histos.fill(HIST("REC_cluster_direct_phiQA"), mccluster.phi()); + histos.fill(HIST("REC_cluster_direct_etaQA"), mccluster.eta()); + histos.fill(HIST("REC_cluster_direct_energyQA"), mccluster.energy()); + } + if (ClusterHasDirectPhoton > 0 && ClusterHasFragPhoton > 0) { + histos.fill(HIST("REC_cluster_both_phiQA"), mccluster.phi()); + histos.fill(HIST("REC_cluster_both_etaQA"), mccluster.eta()); + histos.fill(HIST("REC_cluster_both_energyQA"), mccluster.energy()); + } + + // now we do cluster tracks + bool photontrigger = false; // is a neutral cluster + bool chargetrigger = false; // is definitely not a neutral cluster + auto tracksofcluster = mccluster.matchedTracks_as>(); + // first, we check if veto is required + double sumptT = 0; + bool clusterqa = false; + for (auto& ctrack : tracksofcluster) { + double etaT, phiT; + if (cfgJETracks) { + if (!jetderiveddatautilities::selectTrack(ctrack, trackFilter)) { + continue; + } + auto emctracksPerTrack = emctracks.sliceBy(EMCTrackPerTrack, ctrack.globalIndex()); + auto emctrack = emctracksPerTrack.iteratorAt(0); + etaT = emctrack.etaEmcal(); + phiT = emctrack.phiEmcal(); + } else { + auto ogtrack = ctrack.track_as(); + if (!trackSelection(ogtrack)) { + continue; + } + if (!ogtrack.isGlobalTrack()) { + continue; + } + etaT = ogtrack.trackEtaEmcal(); + phiT = ogtrack.trackPhiEmcal(); + } + + double etaC = mccluster.eta(); + double phiC = mccluster.phi(); + double ptT = ctrack.pt(); + bool etatrigger = false; + bool phitrigger = false; + double phidiff = TVector2::Phi_mpi_pi(mccluster.phi() - ctrack.phi()); + double etadiff = mccluster.eta() - ctrack.eta(); + + if (cfgPtClusterCut) { + if (fabs(etaT - etaC) < (0.010 + pow(ptT + 4.07, -2.5))) { + etatrigger = true; + } + + if (fabs(TVector2::Phi_mpi_pi(phiT - phiC)) < (0.015 + pow(ptT + 3.65, -2.0))) { + phitrigger = true; + } + } else { + if (fabs(etadiff) < 0.05) { + etatrigger = true; + } + + if (fabs(phidiff) < 0.05) { + phitrigger = true; + } + } + + if (etatrigger && phitrigger) { + chargetrigger = true; + sumptT += ptT; + } + if (chargetrigger) { + if (!clusterqa) { + histos.fill(HIST("REC_Cluster_QA"), 1.5); + clusterqa = true; + } + } + histos.fill(HIST("REC_Track_v_Cluster_Phi"), phidiff); + histos.fill(HIST("REC_Track_v_Cluster_Eta"), etadiff); + histos.fill(HIST("REC_Track_v_Cluster_Phi_Eta"), phidiff, etadiff); + histos.fill(HIST("REC_track_phiQA"), ctrack.phi()); + histos.fill(HIST("REC_track_etaQA"), ctrack.eta()); + histos.fill(HIST("REC_track_ptQA"), ctrack.pt()); + } // track of cluster loop + + if (chargetrigger && sumptT > 0) { + double mccluster_over_sumptT = mccluster.energy() / sumptT; + histos.fill(HIST("REC_SumPt_BC"), mccluster_over_sumptT); + if (mccluster_over_sumptT < 1.7) { + histos.fill(HIST("REC_Cluster_QA"), 2.5); // veto fails, cluster is charged + } else { + histos.fill(HIST("REC_Cluster_QA"), 3.5); // veto is good, cluster is converted to neutral cluster + // chargetrigger = false; + histos.fill(HIST("REC_SumPt_AC"), mccluster_over_sumptT); + } + } // sumptT check + + if (!chargetrigger) { + photontrigger = true; + } + + if (photontrigger) { + histos.fill(HIST("REC_clusteriso_phiQA"), mccluster.phi()); + histos.fill(HIST("REC_clusteriso_etaQA"), mccluster.eta()); + histos.fill(HIST("REC_clusteriso_energyQA"), mccluster.energy()); + } + if (chargetrigger) { + histos.fill(HIST("REC_cluster_phiQA"), mccluster.phi()); + histos.fill(HIST("REC_cluster_etaQA"), mccluster.eta()); + histos.fill(HIST("REC_cluster_energyQA"), mccluster.energy()); + } + } // clusters + } // main function + PROCESS_SWITCH(statPromptPhoton, processMCRec_simple, "processMC_QA_Rce", false); + }; // end of main struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 13f367cc1e5a2bb7fae16e9d0d89f844cb6c5949 Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:49:51 +0100 Subject: [PATCH 007/282] [PWGDQ] Adding check if MC particle exists in mftMchMatcher (#15456) Co-authored-by: Maurice Coquet --- PWGDQ/Tasks/mftMchMatcher.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGDQ/Tasks/mftMchMatcher.cxx b/PWGDQ/Tasks/mftMchMatcher.cxx index a3b3779a83a..efabe3b2d51 100644 --- a/PWGDQ/Tasks/mftMchMatcher.cxx +++ b/PWGDQ/Tasks/mftMchMatcher.cxx @@ -544,6 +544,10 @@ struct mftMchMatcher { auto const& mchTrack = muonTrack.template matchMCHTrack_as(); auto const& mftTrack = muonTrack.template matchMFTTrack_as(); + if (!muonTrack.has_mcParticle() || !mftTrack.has_mcParticle()) { + return result; + } + bool isPaired = isPairedMuon(mchTrack.globalIndex(), matchablePairs); std::pair matchPair{mchTrack.globalIndex(), mftTrack.globalIndex()}; bool isTrueMatch = std::find(matchablePairs.begin(), matchablePairs.end(), matchPair) != matchablePairs.end(); From a4049f66c94db86fcd7cdab8045a88b80f3f651c Mon Sep 17 00:00:00 2001 From: chengtt0406 <39661669+chengtt0406@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:58:28 +0700 Subject: [PATCH 008/282] [PWGHF] Add MC matching for new decay channels (#15409) --- PWGHF/Core/DecayChannelsLegacy.h | 3 +- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 242 ++++++++++++++------ 2 files changed, 172 insertions(+), 73 deletions(-) diff --git a/PWGHF/Core/DecayChannelsLegacy.h b/PWGHF/Core/DecayChannelsLegacy.h index 675417d975b..0f0f8892a75 100644 --- a/PWGHF/Core/DecayChannelsLegacy.h +++ b/PWGHF/Core/DecayChannelsLegacy.h @@ -26,7 +26,8 @@ enum DecayType { OmegaczeroToXiPi, OmegaczeroToOmegaPi, OmegaczeroToOmegaK, - OmegaczeroToOmegaPiOneMu + OmegaczeroToOmegaPiOneMu, + XiczeroToOmegaK }; } // namespace hf_cand_xic0_omegac0 diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 448e67f7eec..5fb90429589 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -10,11 +10,12 @@ // or submit itself to any jurisdiction. /// \file treeCreatorOmegacSt.cxx -/// \brief Task to reconstruct Ωc from strangeness-tracked Ω and pion/kaon +/// \brief Task to reconstruct Ωc/Ξc from strangeness-tracked Ω/Ξ and pion/kaon /// /// \author Jochen Klein /// \author Tiantian Cheng +#include "PWGHF/Core/DecayChannelsLegacy.h" #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "PWGHF/Utils/utilsTrkCandHf.h" #include "PWGLF/DataModel/LFStrangenessTables.h" @@ -306,6 +307,8 @@ struct HfTreeCreatorOmegacSt { {"hMassOmegaPiVsPt", "inv. mass #Omega + #pi;inv. mass (GeV/#it{c}^{2});p_{T} (GeV/#it{c})", {HistType::kTH2D, {{400, 1.5, 3.}, {10, 0., 10.}}}}, {"hMassOmegaK", "inv. mass #Omega + K;inv. mass (GeV/#it{c}^{2})", {HistType::kTH1D, {{400, 1.5, 3.}}}}, {"hMassOmegaKVsPt", "inv. mass #Omega + K;inv. mass (GeV/#it{c}^{2});p_{T} (GeV/#it{c})", {HistType::kTH2D, {{400, 1.5, 3.}, {10, 0., 10.}}}}, + {"hMassXiPi", "inv. mass #Xi + #pi;inv. mass (GeV/#it{c}^{2})", {HistType::kTH1D, {{400, 1.2, 3.2}}}}, + {"hMassXiPiVsPt", "inv. mass #Xi + #pi;inv. mass (GeV/#it{c}^{2});p_{T} (GeV/#it{c})", {HistType::kTH2D, {{400, 1.2, 3.2}, {10, 0., 10.}}}}, {"hMassOmegacId", "inv. mass #Omega + #pi (MC ID);inv. mass (GeV/#it{c}^{2})", {HistType::kTH1D, {{400, 1.5, 3.}}}}, {"hMassOmegacGen", "inv. mass #Omega + #pi (from MC);inv. mass (GeV/#it{c}^{2})", {HistType::kTH1D, {{400, 1.5, 3.}}}}, {"hPtVsMassOmega", "#Omega mass;p_{T} (GeV/#it{c});m (GeV/#it{c}^3)", {HistType::kTH2D, {{200, 0., 10.}, {1000, 1., 3.}}}}, @@ -366,70 +369,111 @@ struct HfTreeCreatorOmegacSt { for (const auto& mcParticle : mcParticles) { const bool isOmegaC = std::abs(mcParticle.pdgCode()) == constants::physics::Pdg::kOmegaC0; const bool isXiC = std::abs(mcParticle.pdgCode()) == constants::physics::Pdg::kXiC0; - if (isOmegaC || isXiC) { - const auto daughters = mcParticle.daughters_as(); - if (daughters.size() == NDaughters) { - int idxPionDaughter = -1; - int idxCascDaughter = -1; - int idxKaonDaughter = -1; - const auto daughters = mcParticle.daughters_as(); - for (const auto& daughter : daughters) { - if (idxCascDaughter < 0 && (std::abs(daughter.pdgCode()) == (isOmegaC ? kOmegaMinus : kXiMinus))) { - idxCascDaughter = daughter.globalIndex(); - } - if (idxPionDaughter < 0 && (std::abs(daughter.pdgCode()) == kPiPlus)) { - idxPionDaughter = daughter.globalIndex(); - } - if (idxKaonDaughter < 0 && (std::abs(daughter.pdgCode()) == kKPlus)) { - idxKaonDaughter = daughter.globalIndex(); - } - } - if (idxPionDaughter >= 0 && idxCascDaughter >= 0) { - decayChannel = o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi; // OmegaC -> Omega + Pi - } else if (idxKaonDaughter >= 0 && idxCascDaughter >= 0) { - decayChannel = o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK; // OmegaC -> Omega + K - } else { - decayChannel = -1; // LOG(warning) << "Decay channel not recognized!"; + if (!isOmegaC && !isXiC) { + continue; + } + const auto daughters = mcParticle.daughters_as(); + if (daughters.size() != NDaughters) { + continue; + } + int idxPionDaughter = -1; + int idxCascDaughter = -1; + int idxKaonDaughter = -1; + for (const auto& daughter : daughters) { + const int absDauPdg = std::abs(daughter.pdgCode()); + if (idxCascDaughter < 0) { + if (absDauPdg == kOmegaMinus || absDauPdg == kXiMinus) { + idxCascDaughter = daughter.globalIndex(); } - if (decayChannel != -1) { - int const idxDaughter = (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) ? idxPionDaughter : idxKaonDaughter; - auto particle = mcParticles.rawIteratorAt(idxDaughter); - origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); + } + if (idxPionDaughter < 0 && absDauPdg == kPiPlus) { + idxPionDaughter = daughter.globalIndex(); + } + if (idxKaonDaughter < 0 && absDauPdg == kKPlus) { + idxKaonDaughter = daughter.globalIndex(); + } + } - const auto& cascDaughter = mcParticles.iteratorAt(idxCascDaughter); - const auto& mcColl = mcParticle.mcCollision(); - std::array const primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; - std::array const secondaryVertexGen = {cascDaughter.vx(), cascDaughter.vy(), cascDaughter.vz()}; - float decayLengthCascGen = -1.; - float decayLengthXYCascGen = -1.; - if (cascDaughter.has_daughters()) { - const auto& cascDecayDaughter = cascDaughter.daughters_as().iteratorAt(0); - std::array const tertiaryVertexGen = {cascDecayDaughter.vx(), cascDecayDaughter.vy(), cascDecayDaughter.vz()}; - decayLengthCascGen = RecoDecay::distance(tertiaryVertexGen, primaryVertexPosGen); - decayLengthXYCascGen = RecoDecay::distanceXY(tertiaryVertexGen, primaryVertexPosGen); - } - const auto decayLengthGen = RecoDecay::distance(secondaryVertexGen, primaryVertexPosGen); - const auto decayLengthXYGen = RecoDecay::distanceXY(secondaryVertexGen, primaryVertexPosGen); - registry.fill(HIST("hDecayLengthScaledMc"), decayLengthGen * o2::constants::physics::MassOmegaC0 / mcParticle.mothers_first_as().p() * 1e4); - outputTableGen( - mcParticle.px(), - mcParticle.py(), - mcParticle.pz(), - mcParticle.pdgCode(), - cascDaughter.px(), - cascDaughter.py(), - cascDaughter.pz(), - cascDaughter.pdgCode(), - decayLengthGen, - decayLengthXYGen, - decayLengthCascGen, - decayLengthXYCascGen, - origin, - decayChannel); - mapMcPartToGenTable[mcParticle.globalIndex()] = outputTableGen.lastIndex(); + if (idxCascDaughter < 0) { + continue; + } + + int decayChannel = -1; + const int pdgCasc = std::abs(mcParticles.iteratorAt(idxCascDaughter).pdgCode()); + + if (isOmegaC) { + // Omegac0 -> Omega- pi+ or Xi- pi+ + if (idxPionDaughter >= 0) { + if (pdgCasc == kOmegaMinus) { + decayChannel = o2::aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi; + } else if (pdgCasc == kXiMinus) { + decayChannel = o2::aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi; } } + } else if (isXiC) { + // Xic0 -> Omega- K+ or Xi- pi+ + if (pdgCasc == kOmegaMinus && idxKaonDaughter >= 0) { + decayChannel = o2::aod::hf_cand_xic0_omegac0::DecayType::XiczeroToOmegaK; + } else if (pdgCasc == kXiMinus && idxPionDaughter >= 0) { + decayChannel = o2::aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi; + } + } + + if (decayChannel == -1) { + continue; + } + + int idxDaughter = -1; + switch (decayChannel) { + case o2::aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi: + case o2::aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi: + case o2::aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi: + idxDaughter = idxPionDaughter; + break; + case o2::aod::hf_cand_xic0_omegac0::DecayType::XiczeroToOmegaK: + idxDaughter = idxKaonDaughter; + break; + default: + idxDaughter = -1; + break; + } + + if (idxDaughter >= 0) { + auto particle = mcParticles.rawIteratorAt(idxDaughter); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); } + + const auto& cascDaughter = mcParticles.iteratorAt(idxCascDaughter); + const auto& mcColl = mcParticle.mcCollision(); + std::array const primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; + std::array const secondaryVertexGen = {cascDaughter.vx(), cascDaughter.vy(), cascDaughter.vz()}; + float decayLengthCascGen = -1.; + float decayLengthXYCascGen = -1.; + if (cascDaughter.has_daughters()) { + const auto& cascDecayDaughter = cascDaughter.daughters_as().iteratorAt(0); + std::array const tertiaryVertexGen = {cascDecayDaughter.vx(), cascDecayDaughter.vy(), cascDecayDaughter.vz()}; + decayLengthCascGen = RecoDecay::distance(tertiaryVertexGen, primaryVertexPosGen); + decayLengthXYCascGen = RecoDecay::distanceXY(tertiaryVertexGen, primaryVertexPosGen); + } + const auto decayLengthGen = RecoDecay::distance(secondaryVertexGen, primaryVertexPosGen); + const auto decayLengthXYGen = RecoDecay::distanceXY(secondaryVertexGen, primaryVertexPosGen); + registry.fill(HIST("hDecayLengthScaledMc"), decayLengthGen * o2::constants::physics::MassOmegaC0 / mcParticle.mothers_first_as().p() * 1e4); + outputTableGen( + mcParticle.px(), + mcParticle.py(), + mcParticle.pz(), + mcParticle.pdgCode(), + cascDaughter.px(), + cascDaughter.py(), + cascDaughter.pz(), + cascDaughter.pdgCode(), + decayLengthGen, + decayLengthXYGen, + decayLengthCascGen, + decayLengthXYCascGen, + origin, + decayChannel); + mapMcPartToGenTable[mcParticle.globalIndex()] = outputTableGen.lastIndex(); } } PROCESS_SWITCH(HfTreeCreatorOmegacSt, processMc, "Process MC", true); @@ -476,7 +520,6 @@ struct HfTreeCreatorOmegacSt { } } } - const auto primaryVertex = getPrimaryVertex(collision); const std::array primaryVertexPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; @@ -570,7 +613,6 @@ struct HfTreeCreatorOmegacSt { const auto massXi = RecoDecay::m(momentaCascDaughters, massesXiDaughters); std::array const massesOmegaDaughters = {o2::constants::physics::MassLambda0, o2::constants::physics::MassKPlus}; const auto massOmega = RecoDecay::m(momentaCascDaughters, massesOmegaDaughters); - registry.fill(HIST("hDca"), std::sqrt(impactParameterCasc.getR2())); registry.fill(HIST("hDcaXY"), impactParameterCasc.getY()); registry.fill(HIST("hDcaXYVsPt"), trackParCovCasc.getPt(), impactParameterCasc.getY()); @@ -588,7 +630,8 @@ struct HfTreeCreatorOmegacSt { std::array const massesOmegacToOmegaPi{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; std::array const massesOmegacToOmegaK{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassKPlus}; - std::array const massesXicDaughters{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}; + // std::array const massesXicDaughters{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}; + std::array massesXicOrOmegacToXiPi{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}; std::array, NDaughters> momenta{}; auto trackParCovPr = getTrackParCov(v0TrackPr); @@ -662,11 +705,15 @@ struct HfTreeCreatorOmegacSt { df2.getTrackParamAtPCA(1).getPxPyPzGlo(momenta[1]); const auto massOmegaPi = RecoDecay::m(momenta, massesOmegacToOmegaPi); const auto massOmegaK = RecoDecay::m(momenta, massesOmegacToOmegaK); - const auto massXiC = RecoDecay::m(momenta, massesXicDaughters); + // const auto massXiC = RecoDecay::m(momenta, massesXicDaughters); + const auto massXiPi = RecoDecay::m(momenta, massesXicOrOmegacToXiPi); + registry.fill(HIST("hMassOmegaPi"), massOmegaPi); registry.fill(HIST("hMassOmegaPiVsPt"), massOmegaPi, RecoDecay::pt(momenta[0], momenta[1])); registry.fill(HIST("hMassOmegaK"), massOmegaK); registry.fill(HIST("hMassOmegaKVsPt"), massOmegaK, RecoDecay::pt(momenta[0], momenta[1])); + registry.fill(HIST("hMassXiPi"), massXiPi); + registry.fill(HIST("hMassXiPiVsPt"), massXiPi, RecoDecay::pt(momenta[0], momenta[1])); //--- do the MC Rec match if (mcParticles) { @@ -684,7 +731,7 @@ struct HfTreeCreatorOmegacSt { v0.posTrack_as(), // p <- lambda v0.negTrack_as()}; // pi <- lambda - if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { + if (decayChannel == o2::aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { // Match Omegac0 → Omega- + Pi+ indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughters, o2::constants::physics::kOmegaC0, std::array{+kPiPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); @@ -700,17 +747,65 @@ struct HfTreeCreatorOmegacSt { } } } - } else if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { - // Match Omegac0 → Omega- + K+ + // } else if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { + // // Match Omegac0 → Omega- + K+ + // indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughters, o2::constants::physics::kOmegaC0, + // std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); + // indexRecCharmBaryon = indexRec; + // if (indexRec > -1) { + // // Omega- → K pi p (Cascade match) + // indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2, &nPiToMuCasc, &nKaToPiCasc); + // if (indexRec > -1) { + // // Lambda → p pi (Lambda match) + // indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1, &nPiToMuV0); + // if (indexRec > -1) { + // isMatched = true; + // } + // } + // } + } else if (decayChannel == o2::aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { + // Match Omegac0 -> Xi Pion indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughters, o2::constants::physics::kOmegaC0, - std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); + std::array{+kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 3); + indexRecCharmBaryon = indexRec; + if (indexRec > -1) { + // Xi- → pi pi p (Cascade match) + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersCasc, +kXiMinus, std::array{+kPiMinus, +kProton, +kPiMinus}, true, &signCasc, 2); + if (indexRec > -1) { + // Lambda → p pi (Lambda match) + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1); + if (indexRec > -1) { + isMatched = true; + } + } + } + } else if (decayChannel == o2::aod::hf_cand_xic0_omegac0::DecayType::XiczeroToOmegaK) { + // Match Xic0 → Omega- + K+ + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughters, o2::constants::physics::kXiC0, + std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3); indexRecCharmBaryon = indexRec; if (indexRec > -1) { // Omega- → K pi p (Cascade match) - indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2, &nPiToMuCasc, &nKaToPiCasc); + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2); if (indexRec > -1) { // Lambda → p pi (Lambda match) - indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1, &nPiToMuV0); + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1); + if (indexRec > -1) { + isMatched = true; + } + } + } + } else if (decayChannel == o2::aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + // Match Xic0 -> Xi Pion + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughters, o2::constants::physics::kXiC0, + std::array{+kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 3); + indexRecCharmBaryon = indexRec; + if (indexRec > -1) { + // Xi- → pi pi p (Cascade match) + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersCasc, +kXiMinus, std::array{+kPiMinus, +kProton, +kPiMinus}, true, &signCasc, 2); + if (indexRec > -1) { + // Lambda → p pi (Lambda match) + indexRec = RecoDecay::getMatchedMCRec(mcParticles->get(), arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1); if (indexRec > -1) { isMatched = true; } @@ -723,9 +818,12 @@ struct HfTreeCreatorOmegacSt { } } - if ((std::abs(massOmegaK - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) || + if ((std::abs(massOmegaK - o2::constants::physics::MassXiC0) < massWindowXiC) || (std::abs(massOmegaPi - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) || - (std::abs(massXiC - o2::constants::physics::MassXiC0) < massWindowXiC)) { + (std::abs(massXiPi - o2::constants::physics::MassXiC0) < massWindowXiC) || + (std::abs(massXiPi - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) + + ) { registry.fill(HIST("hDecayLength"), decayLength * 1e4); registry.fill(HIST("hDecayLengthScaled"), decayLength * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); outputTable(massOmega, From a0f47eafe9da57b0e51010c191292d8fe2002891 Mon Sep 17 00:00:00 2001 From: mhartung71 <50153519+mhartung71@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:07:59 +0100 Subject: [PATCH 009/282] [PWGLF] Add TOF mass calculation, minor fixes (#15419) --- PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx | 87 +++++++++++++++----- 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx index 2018c6a53d4..fc5f9882729 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx @@ -16,6 +16,10 @@ #include "MetadataHelper.h" #include "PWGLF/DataModel/LFHypernucleiKfTables.h" +#include "PWGLF/DataModel/LFNucleiTables.h" +#include "PWGLF/DataModel/LFPIDTOFGenericTables.h" +#include "PWGLF/DataModel/LFParticleIdentification.h" +#include "PWGLF/Utils/pidTOFGeneric.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" @@ -65,7 +69,7 @@ using namespace o2::framework::expressions; using CollisionsFull = soa::Join; using CollisionsFullMC = soa::Join; -using TracksFull = soa::Join; +using TracksFull = soa::Join; o2::common::core::MetadataHelper metadataInfo; // Metadata helper //---------------------------------------------------------------------------------------------------------------- @@ -146,17 +150,17 @@ enum HYPNUCDEFS { kEnabled, kDsigns, kUseV0for }; static const std::vector hypNucDefsLb{"Enabled", "PDGCode", "d1", "d2", "d3", "d4", "daughterSigns", "useV0for"}; -static const std::string hypNucDefs[nHyperNuclei][nHypNucDefs]{ - {"0", "3122", "proton", "pion", "none", "none", "+-", ""}, - {"0", "1010010030", "helion", "pion", "none", "none", "+-", ""}, - {"0", "1010010030", "deuteron", "proton", "pion", "none", "++-", ""}, - {"0", "1010010040", "alpha", "pion", "none", "none", "+-", ""}, - {"0", "1010010040", "triton", "proton", "pion", "none", "++-", ""}, - {"0", "1010020040", "helion", "proton", "pion", "none", "++-", ""}, - {"0", "1010020050", "alpha", "proton", "pion", "none", "++-", ""}, - {"0", "1010020050", "helion", "deuteron", "pion", "none", "++-", ""}, - {"0", "0", "none", "none", "none", "none", "", ""}, - {"0", "0", "none", "none", "none", "none", "", ""}}; // NOLINT: runtime/string +const std::string hypNucDefs[nHyperNuclei][nHypNucDefs]{// NOLINT: runtime/string + {"0", "3122", "proton", "pion", "none", "none", "+-", ""}, + {"0", "1010010030", "helion", "pion", "none", "none", "+-", ""}, + {"0", "1010010030", "deuteron", "proton", "pion", "none", "++-", ""}, + {"0", "1010010040", "alpha", "pion", "none", "none", "+-", ""}, + {"0", "1010010040", "triton", "proton", "pion", "none", "++-", ""}, + {"0", "1010020040", "helion", "proton", "pion", "none", "++-", ""}, + {"0", "1010020050", "alpha", "proton", "pion", "none", "++-", ""}, + {"0", "1010020050", "helion", "deuteron", "pion", "none", "++-", ""}, + {"0", "0", "none", "none", "none", "none", "", ""}, + {"0", "0", "none", "none", "none", "none", "", ""}}; const int nSelPrim = 8; enum PRESELECTIONSPRIMARIES { kMinMass, @@ -263,7 +267,6 @@ struct DaughterKf { dcaToPv = daughterKfp.GetDistanceFromVertex(&vtx[0]); dcaToPvZ = std::sqrt(dcaToPv * dcaToPv - dcaToPvXY * dcaToPvXY); } - bool isTrack() { return daughterTrackId >= 0; } }; int DaughterKf::uniqueId = 0; @@ -429,6 +432,30 @@ struct IndexPairs { } }; // struct IndexPairs +struct IndexPairsVec { + std::vector>> pairs; + IndexPairsVec() + { + pairs.resize(nDaughterParticles); + } + void add(int i, int64_t a, int b) { pairs.at(i).push_back({a, b}); } + void clear() + { + for (size_t i = 0; i < nDaughterParticles; i++) + pairs.at(i).clear(); + } + bool getIndex(int i, int64_t a, int& b) + { + for (const auto& pair : pairs.at(i)) { + if (pair.first == a) { + b = pair.second; + return true; + } + } + return false; + } +}; // struct IndexPairsVec + struct McCollInfo { bool hasRecoColl; bool passedEvSel; @@ -526,7 +553,8 @@ struct HypKfRecoTask { std::vector singleHyperNuclei, cascadeHyperNuclei; std::vector primVtx, cents; std::vector mcCollInfos; - IndexPairs trackIndices, mcPartIndices; + IndexPairsVec trackIndices; + IndexPairs mcPartIndices; KFPVertex kfPrimVtx; bool collHasCandidate, collHasMcTrueCandidate, collPassedEvSel, activeCascade, isMC; int64_t mcCollTableIndex; @@ -610,8 +638,12 @@ struct HypKfRecoTask { const float itsNsigma = getITSnSigma(track, daughterParticles.at(i)); if (daughterParticles.at(i).trkSettings[kMaxITSnSigma] >= 0 && std::abs(itsNsigma) > daughterParticles.at(i).trkSettings[kMaxITSnSigma]) continue; + float tpcNsigmaNlp = NoVal; + if (daughterParticles.at(i).name == "alpha") { + tpcNsigmaNlp = getTPCnSigma(track, daughterParticles.at(i - 1)); + } filldedx(track, i); - foundDaughterKfs.at(i).push_back(DaughterKf(i, track.globalIndex(), track.sign(), primVtx, 0, 0, 0)); + foundDaughterKfs.at(i).push_back(DaughterKf(i, track.globalIndex(), track.sign(), primVtx, tpcNsigma, tpcNsigmaNlp, itsNsigma)); } } // track loop } @@ -865,14 +897,14 @@ struct HypKfRecoTask { continue; const auto& daughterTrackId = daughter->daughterTrackId; int trackTableId; - if (!trackIndices.getIndex(daughterTrackId, trackTableId)) { + if (!trackIndices.getIndex(daughter->species, daughterTrackId, trackTableId)) { const auto& track = tracks.rawIteratorAt(daughterTrackId); outputTrackTable( daughter->species * track.sign(), track.pt(), track.eta(), track.phi(), daughter->dcaToPvXY, daughter->dcaToPvZ, track.tpcNClsFound(), track.tpcChi2NCl(), track.itsClusterSizes(), track.itsChi2NCl(), getRigidity(track), track.tpcSignal(), daughter->tpcNsigma, daughter->tpcNsigmaNHP, daughter->tpcNsigmaNLP, - track.mass(), track.isPVContributor()); + getMass2(track), track.isPVContributor()); trackTableId = outputTrackTable.lastIndex(); - trackIndices.add(daughterTrackId, trackTableId); + trackIndices.add(daughter->species, daughterTrackId, trackTableId); } vecDaugtherTracks.push_back(trackTableId); } @@ -1162,7 +1194,7 @@ struct HypKfRecoTask { return false; if (getMeanItsClsSize(track) > particle.trkSettings[kMaxITSmeanClsSize]) return false; - if (particle.trkSettings[kTOFrequiredabove] >= 0 && getRigidity(track) > particle.trkSettings[kTOFrequiredabove] && (track.mass() < particle.trkSettings[kMinTOFmass] || track.mass() > particle.trkSettings[kMaxTOFmass])) + if (particle.trkSettings[kTOFrequiredabove] >= 0 && getRigidity(track) > particle.trkSettings[kTOFrequiredabove] && (getMass2(track) < particle.trkSettings[kMinTOFmass] || getMass2(track) > particle.trkSettings[kMaxTOFmass])) return false; return true; } @@ -1331,6 +1363,23 @@ struct HypKfRecoTask { return -1; } //---------------------------------------------------------------------------------------------------------------- + template + float getMass2(const T& track) + { + const float p = track.p(); + const float& tofStartTime = track.evTimeForTrack(); + const float& tofTime = track.tofSignal(); + constexpr float CInCmPs = 2.99792458e-2f; + const float& length = track.length(); + const float time = tofTime - tofStartTime; + if (time > 0.f && length > 0.f) { + const float beta = length / (CInCmPs * time); + const float gamma = 1.f / std::sqrt(1.f - beta * beta); + const float mass = p / std::sqrt(gamma * gamma - 1.f); + return mass * mass; + } + return -1.f; + } //---------------------------------------------------------------------------------------------------------------- }; //---------------------------------------------------------------------------------------------------------------- From 090227ff1cb17553bed5d3a23011302613b3c442 Mon Sep 17 00:00:00 2001 From: YazhenLin Date: Fri, 20 Mar 2026 20:12:10 +0800 Subject: [PATCH 010/282] [PWGDQ] Add some code for the energy correlator study (#15464) --- PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx index b91e9ef5593..50eef8685c5 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -296,6 +296,7 @@ struct AnalysisEnergyCorrelator { for (auto& t : addHadronCuts) { fHadronCuts.push_back(reinterpret_cast(t)); fHadronCutNames.push_back(t->GetName()); + hadronCutStr += Form(",%s", t->GetName()); } } @@ -446,12 +447,11 @@ struct AnalysisEnergyCorrelator { mcDecision |= (static_cast(1) << isig); } } - auto motherParticle = lepton1MC.template mothers_first_as(); // Fill dilepton-hadron variables std::vector fTransRange = fConfigDileptonHadronOptions.fConfigTransRange; VarManager::FillEnergyCorrelatorTriple(track1, track2, hadron, VarManager::fgValues, fTransRange[0], fTransRange[1], fConfigDileptonHadronOptions.fConfigApplyMassEC.value); - VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues); + VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); int iHadronCut = 0; for (auto hCut = fHadronCuts.begin(); hCut != fHadronCuts.end(); hCut++, iHadronCut++) { From 3a083da358a496ae63b5e9d048dc6e5fdf16e2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Jos=C3=A9?= <52935244+lucasjsilva@users.noreply.github.com> Date: Fri, 20 Mar 2026 14:31:42 +0100 Subject: [PATCH 011/282] [PWGLF] Inclusion of INEL grather than zero (#15460) Co-authored-by: ALICE Action Bot --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 59 ++++++++----------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 394c54b74d5..d4ab4f132ac 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -102,6 +102,7 @@ struct StudyPnch { Configurable isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"}; Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; + Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; void init(InitContext const&) { @@ -125,7 +126,7 @@ struct StudyPnch { x->SetBinLabel(6, "INEL > 0"); x->SetBinLabel(7, "|vz| < 10"); - if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessTreatedMonteCarlo) { + if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) { histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false); } if (doprocessData) { @@ -143,11 +144,6 @@ struct StudyPnch { histos.add("hMultiplicityMCgen", "hMultiplicityMCgen", kTH1F, {axisMult}, true); histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true); } - if (doprocessTreatedMonteCarlo) { - histos.add("hMultiplicityTreatMCrec", "hMultiplicityTreatMCrec", kTH1F, {axisMult}, true); - histos.add("hMultiplicityTreatMCgen", "hMultiplicityTreatMCgen", kTH1F, {axisMult}, true); - histos.add("hResponseMatrixTreat", "hResponseMatrixTreat", kTH2F, {axisMult, axisMult}, true); - } if (doprocessEvtLossSigLossMC) { histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); auto hstat = histos.get(HIST("MCEventHist")); @@ -163,7 +159,7 @@ struct StudyPnch { bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } histos.fill(HIST("EventHist"), 2); @@ -282,6 +278,11 @@ struct StudyPnch { return nTrk; } + bool isINELgt0(auto nTrk) + { + return nTrk > 0; + } + Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) && ncheckbit(aod::track::trackCutFlag, TrackSelectionIts); Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC), @@ -295,7 +296,9 @@ struct StudyPnch { return; } auto mult = countNTracks(tracks); - histos.fill(HIST("hMultiplicityData"), mult); + if (isINELgt0(mult)) { + histos.fill(HIST("hMultiplicityData"), mult); + } } void processCorrelation(ColDataTable::iterator const& cols, FilTrackDataTable const& tracks) @@ -319,30 +322,14 @@ struct StudyPnch { } auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); - histos.fill(HIST("hMultiplicityMCrec"), multrec); - auto multgen = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgen"), multgen); - histos.fill(HIST("hResponseMatrix"), multrec, multgen); - } - } - - void processTreatedMonteCarlo(ColMCTrueTable::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - // Count generated tracks at each iterator - auto multgen = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityTreatMCgen"), multgen); - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; + if (multrec > 0) { + histos.fill(HIST("hMultiplicityMCrec"), multrec); } - // Verify that the reconstructed collision corresponds to the given MC collision - if (RecCol.mcCollisionId() != mcCollision.globalIndex()) { - continue; + auto multgen = countGenTracks(GenParticles, mcCollision); + if (multgen > 0 && multrec > 0) { + histos.fill(HIST("hMultiplicityMCgen"), multgen); + histos.fill(HIST("hResponseMatrix"), multrec, multgen); } - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - auto multrec = countNTracksMcCol(recTracksPart, RecCol); - histos.fill(HIST("hMultiplicityTreatMCrec"), multrec); - histos.fill(HIST("hResponseMatrixTreat"), multrec, multgen); } } @@ -351,13 +338,18 @@ struct StudyPnch { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { return; } + if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } if (std::abs(mcCollision.posZ()) >= vtxRange) { return; } // All generated events histos.fill(HIST("MCEventHist"), 1); auto multAll = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgenAll"), multAll); + if (multAll > 0) { + histos.fill(HIST("hMultiplicityMCgenAll"), multAll); + } bool atLeastOne = false; auto numcontributors = -999; @@ -376,14 +368,15 @@ struct StudyPnch { if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); auto multSel = countGenTracks(GenParticles, mcCollision); - histos.fill(HIST("hMultiplicityMCgenSel"), multSel); + if (multSel > 0) { + histos.fill(HIST("hMultiplicityMCgenSel"), multSel); + } } } PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false); PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false); - PROCESS_SWITCH(StudyPnch, processTreatedMonteCarlo, "process Treated MC CentFT0C", false); PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); }; From 79fa3b630b089ae2e857020ea94a53c415dc8d25 Mon Sep 17 00:00:00 2001 From: Zhenjun Xiong <108917659+zjxiongOvO@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:57:33 +0100 Subject: [PATCH 012/282] [PWGDQ] add qa for number of pairs per event in pairing (#15468) Co-authored-by: ypwangg Co-authored-by: ALICE Action Bot --- PWGDQ/Core/HistogramsLibrary.cxx | 10 +++++++++- PWGDQ/Core/VarManager.cxx | 3 +++ PWGDQ/Core/VarManager.h | 9 +++++---- PWGDQ/Tasks/tableReader_withAssoc.cxx | 23 +++++++++++++++++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 89c1002ac47..9d12b892322 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -42,7 +42,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "TF_NMFTs", "Number of MFT tracks per TF", false, 1000, 0.0, 200000.0, VarManager::kTFNMFTs); } if (!groupStr.CompareTo("event")) { - if (!subGroupStr.Contains("generator")) { + if (!subGroupStr.Contains("generator") && !subGroupStr.Contains("pairing")) { hm->AddHistogram(histClass, "VtxZ", "Vtx Z", false, 60, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "VtxZ_Run", "Vtx Z", true, 1, -0.5, 0.5, VarManager::kRunNo, 60, -15.0, 15.0, VarManager::kVtxZ, 1, 0, 1, VarManager::kNothing, "", "", "", VarManager::kNothing, VarManager::kNothing, false, true); hm->AddHistogram(histClass, "BC", "Event per BC", false, 3564, 0.0, 3564.0, VarManager::kBCOrbit); @@ -583,6 +583,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "FracAbove500um_NTracksTRD", "Fraction of tracks with DCAz > 500 um vs number of tracks with TRD", false, 100, 0.0, 1000.0, VarManager::kMultNTracksHasTRD, 100, 0.0, 1.0, VarManager::kDCAzFracAbove500um); hm->AddHistogram(histClass, "FracAbove5mm_NTracksTRD", "Fraction of tracks with DCAz > 5 mm vs number of tracks with TRD", false, 100, 0.0, 1000.0, VarManager::kMultNTracksHasTRD, 100, 0.0, 1.0, VarManager::kDCAzFracAbove5mm); } + if (subGroupStr.Contains("pairing")) { + if (subGroupStr.Contains("sameevent")) { + hm->AddHistogram(histClass, "NPairsPerEvent", "Number of track pairs per event", false, 100, 0.0, 100.0, VarManager::kNPairsPerEvent); + } + if (subGroupStr.Contains("mixedevent")) { + hm->AddHistogram(histClass, "NPairsPerEvent", "Number of track pairs per event", false, 500, 0.0, 500.0, VarManager::kNPairsPerEvent); + } + } } // end "event" if (!groupStr.CompareTo("two-collisions")) { diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index b058531989f..ac2902c0f3a 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -1435,6 +1435,8 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kR3SP] = ""; fgVariableNames[kR3EP] = "R_{3}^{EP} "; fgVariableUnits[kR3EP] = ""; + fgVariableNames[kNPairsPerEvent] = "number of pairs per event"; + fgVariableUnits[kNPairsPerEvent] = ""; fgVariableNames[kPairMass] = "mass"; fgVariableUnits[kPairMass] = "GeV/c2"; fgVariableNames[kPairMassDau] = "mass dilepton"; @@ -2065,6 +2067,7 @@ void VarManager::SetDefaultVarNames() fgVarNamesMap["kTwoR2SP2"] = kTwoR2SP2; fgVarNamesMap["kTwoR2EP1"] = kTwoR2EP1; fgVarNamesMap["kTwoR2EP2"] = kTwoR2EP2; + fgVarNamesMap["kNPairsPerEvent"] = kNPairsPerEvent; fgVarNamesMap["kNEventWiseVariables"] = kNEventWiseVariables; fgVarNamesMap["kX"] = kX; fgVarNamesMap["kY"] = kY; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 8af94063bbe..fa0f694d227 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -480,10 +480,11 @@ class VarManager : public TObject kV2ME_EP, kWV2ME_SP, kWV2ME_EP, - kTwoR2SP1, // Scalar product resolution of event1 for ME technique - kTwoR2SP2, // Scalar product resolution of event2 for ME technique - kTwoR2EP1, // Event plane resolution of event2 for ME technique - kTwoR2EP2, // Event plane resolution of event2 for ME technique + kTwoR2SP1, // Scalar product resolution of event1 for ME technique + kTwoR2SP2, // Scalar product resolution of event2 for ME technique + kTwoR2EP1, // Event plane resolution of event2 for ME technique + kTwoR2EP2, // Event plane resolution of event2 for ME technique + kNPairsPerEvent, // number of pairs per event in same-event or mixed-event pairing // Variables for event mixing with cumulant kV22m, diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 89455c999aa..5a71f06bbce 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -1326,6 +1326,7 @@ struct AnalysisSameEventPairing { int fNCutsBarrel; int fNCutsMuon; int fNPairCuts; + int fNPairPerEvent; bool fEnableBarrelMixingHistos; bool fEnableBarrelHistos; @@ -1641,6 +1642,12 @@ struct AnalysisSameEventPairing { fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); VarManager::SetCollisionSystem((TString)fConfigOptions.collisionSystem, fConfigOptions.centerMassEnergy); // set collision system and center of mass energy DefineHistograms(fHistMan, histNames.Data(), fConfigAddSEPHistogram.value.data()); // define all histograms + if (fEnableBarrelHistos) { + DefineHistograms(fHistMan, "PairingSEQA", "sameevent-pairing"); // histograms for QA of the pairing + }; + if (fEnableBarrelMixingHistos) { + DefineHistograms(fHistMan, "PairingMEQA", "mixedevent-pairing"); // histograms for QA of the pairing + }; dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); @@ -1749,6 +1756,7 @@ struct AnalysisSameEventPairing { constexpr bool eventHasQvectorCentr = ((TEventFillMap & VarManager::ObjTypes::CollisionQvect) > 0); constexpr bool trackHasCov = ((TTrackFillMap & VarManager::ObjTypes::TrackCov) > 0 || (TTrackFillMap & VarManager::ObjTypes::ReducedTrackBarrelCov) > 0); bool isSelectedBDT = false; + fNPairPerEvent = 0; for (auto& event : events) { if (!event.isEventSelected_bit(0)) { @@ -1796,6 +1804,7 @@ struct AnalysisSameEventPairing { twoTrackFilter |= (static_cast(1) << 31); } + fNPairPerEvent++; VarManager::FillPair(t1, t2); // compute quantities which depend on the associated collision, such as DCA if (fConfigOptions.propTrack) { @@ -2101,6 +2110,10 @@ struct AnalysisSameEventPairing { } } // end loop (cuts) } // end loop over pairs of track associations + VarManager::fgValues[VarManager::kNPairsPerEvent] = fNPairPerEvent; + if (fEnableBarrelHistos && fConfigQA) { + fHistMan->FillHistClass("PairingSEQA", VarManager::fgValues); + } } // end loop over events } @@ -2120,6 +2133,7 @@ struct AnalysisSameEventPairing { } auto t1 = a1.template reducedtrack_as(); auto t2 = a2.template reducedtrack_as(); + fNPairPerEvent++; VarManager::FillPairME(t1, t2); if constexpr ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0) { VarManager::FillPairVn(t1, t2); @@ -2285,7 +2299,12 @@ struct AnalysisSameEventPairing { auto assocs2 = assocs.sliceBy(preSlice, event2.globalIndex()); assocs2.bindExternalIndices(&events); + fNPairPerEvent = 0; runMixedPairing(assocs1, assocs2, tracks, tracks); + VarManager::fgValues[VarManager::kNPairsPerEvent] = fNPairPerEvent; + if (fEnableBarrelMixingHistos && fConfigQA) { + fHistMan->FillHistClass("PairingMEQA", VarManager::fgValues); + } } // end event loop } @@ -4274,6 +4293,10 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", histName); } + if (classStr.Contains("Pairing")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "event", histName); + } + if (classStr.Contains("Triplets")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", histName); } From bfb07c5b345540046fea8f7ed763d7368256d1c1 Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Fri, 20 Mar 2026 16:08:58 +0100 Subject: [PATCH 013/282] [Common] Add flag to save QA histograms and add event selection (#15416) Co-authored-by: ALICE Action Bot --- .../TableProducer/zdcExtraTableProducer.cxx | 112 ++++++++++++------ 1 file changed, 75 insertions(+), 37 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 500854b196b..24e34f058df 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -58,17 +58,18 @@ struct ZdcExtraTableProducer { // Event selections Configurable cfgEvSelSel8{"cfgEvSelSel8", true, "Event selection: sel8"}; Configurable cfgEvSelVtxZ{"cfgEvSelVtxZ", 10, "Event selection: zVtx"}; - Configurable cfgEvSelsDoOccupancySel{"cfgEvSelsDoOccupancySel", true, "Event selection: do occupancy selection"}; + Configurable cfgEvSelsDoOccupancySel{"cfgEvSelsDoOccupancySel", false, "Event selection: do occupancy selection"}; Configurable cfgEvSelsMaxOccupancy{"cfgEvSelsMaxOccupancy", 10000, "Event selection: set max occupancy"}; - Configurable cfgEvSelsNoSameBunchPileupCut{"cfgEvSelsNoSameBunchPileupCut", true, "Event selection: no same bunch pileup cut"}; - Configurable cfgEvSelsIsGoodZvtxFT0vsPV{"cfgEvSelsIsGoodZvtxFT0vsPV", true, "Event selection: is good ZVTX FT0 vs PV"}; - Configurable cfgEvSelsNoCollInTimeRangeStandard{"cfgEvSelsNoCollInTimeRangeStandard", true, "Event selection: no collision in time range standard"}; - Configurable cfgEvSelsIsVertexITSTPC{"cfgEvSelsIsVertexITSTPC", true, "Event selection: is vertex ITSTPC"}; - Configurable cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", true, "Event selection: is good ITS layers all"}; + Configurable cfgEvSelsNoSameBunchPileupCut{"cfgEvSelsNoSameBunchPileupCut", false, "Event selection: no same bunch pileup cut"}; + Configurable cfgEvSelsIsGoodZvtxFT0vsPV{"cfgEvSelsIsGoodZvtxFT0vsPV", false, "Event selection: is good ZVTX FT0 vs PV"}; + Configurable cfgEvSelsNoCollInTimeRangeStandard{"cfgEvSelsNoCollInTimeRangeStandard", false, "Event selection: no collision in time range standard"}; + Configurable cfgEvSelsIsVertexITSTPC{"cfgEvSelsIsVertexITSTPC", false, "Event selection: is vertex ITSTPC"}; + Configurable cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", false, "Event selection: is good ITS layers all"}; // Calibration settings Configurable cfgCalibrationDownscaling{"cfgCalibrationDownscaling", 1.f, "Percentage of events to be saved to derived table"}; - HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // Output settings + Configurable cfgSaveQaHistos{"cfgSaveQaHistos", false, "Flag to save QA histograms"}; enum SelectionCriteria { evSel_zvtx, @@ -83,8 +84,27 @@ struct ZdcExtraTableProducer { nEventSelections }; + HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + void init(InitContext const&) { + + registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_allEvents + 1, "All events"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_zvtx + 1, "vtxZ"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_occupancy + 1, "kOccupancy"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoSameBunchPileup + 1, "kNoSameBunchPileup"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodZvtxFT0vsPV + 1, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeStandard + 1, "kNoCollInTimeRangeStandard"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kIsGoodITSLayersAll"); + + // Skip histogram registration if QA flag is false + if (!cfgSaveQaHistos) { + return; + } + registry.add("ZNApmc", "ZNApmc; ZNA PMC; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); registry.add("ZNCpmc", "ZNCpmc; ZNC PMC; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); registry.add("ZNApm1", "ZNApm1; ZNA PM1; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); @@ -100,17 +120,6 @@ struct ZdcExtraTableProducer { registry.add("ZNACentroid", "ZNA Centroid; X; Y", {HistType::kTH2F, {{50, -1.5, 1.5}, {50, -1.5, 1.5}}}); registry.add("ZNCCentroid", "ZNC Centroid; X; Y", {HistType::kTH2F, {{50, -1.5, 1.5}, {50, -1.5, 1.5}}}); - - registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_allEvents + 1, "All events"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_zvtx + 1, "vtxZ"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_occupancy + 1, "kOccupancy"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoSameBunchPileup + 1, "kNoSameBunchPileup"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodZvtxFT0vsPV + 1, "kIsGoodZvtxFT0vsPV"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeStandard + 1, "kNoCollInTimeRangeStandard"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kIsGoodITSLayersAll"); } template @@ -176,7 +185,7 @@ struct ZdcExtraTableProducer { void process(ColEvSels const& cols, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/) { // collision-based event selection - int nTowers = 4; // number of ZDC towers + constexpr int NTowers = 4; // number of ZDC towers for (auto const& collision : cols) { const auto& foundBC = collision.foundBC_as(); @@ -185,6 +194,24 @@ struct ZdcExtraTableProducer { uint8_t evSelection = eventSelected(collision); + // add event selection + if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8))) + continue; + if (!(evSelection & (1 << evSel_zvtx))) + continue; + if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy))) + continue; + if (cfgEvSelsNoSameBunchPileupCut && !(evSelection & (1 << evSel_kNoSameBunchPileup))) + continue; + if (cfgEvSelsIsGoodZvtxFT0vsPV && !(evSelection & (1 << evSel_kIsGoodZvtxFT0vsPV))) + continue; + if (cfgEvSelsNoCollInTimeRangeStandard && !(evSelection & (1 << evSel_kNoCollInTimeRangeStandard))) + continue; + if (cfgEvSelsIsVertexITSTPC && !(evSelection & (1 << evSel_kIsVertexITSTPC))) + continue; + if (cfgEvSelsIsGoodITSLayersAll && !(evSelection & (1 << evSel_kIsGoodITSLayersAll))) + continue; + float centrality = collision.centFT0C(); // To assure that ZN have a genuine signal (tagged by the relative TDC) @@ -196,6 +223,7 @@ struct ZdcExtraTableProducer { // double tdcZNC = zdc.timeZNC(); double tdcZNA = zdc.timeZNA(); + // OR we can select a narrow window in both ZN TDCs using the configurable parameters if (tdcCut) { // a narrow TDC window is set if ((tdcZNC >= tdcZNmincut) && (tdcZNC <= tdcZNmaxcut)) { @@ -219,29 +247,34 @@ struct ZdcExtraTableProducer { double pmqZNA[4] = {}; // if (isZNChit) { - for (int it = 0; it < nTowers; it++) { + for (int it = 0; it < NTowers; it++) { pmqZNC[it] = (zdc.energySectorZNC())[it]; sumZNC += pmqZNC[it]; } - registry.get(HIST("ZNCpmc"))->Fill(pmcZNC); - registry.get(HIST("ZNCpm1"))->Fill(pmqZNC[0]); - registry.get(HIST("ZNCpm2"))->Fill(pmqZNC[1]); - registry.get(HIST("ZNCpm3"))->Fill(pmqZNC[2]); - registry.get(HIST("ZNCpm4"))->Fill(pmqZNC[3]); - registry.get(HIST("ZNCsumq"))->Fill(sumZNC); + + if (cfgSaveQaHistos) { + registry.get(HIST("ZNCpmc"))->Fill(pmcZNC); + registry.get(HIST("ZNCpm1"))->Fill(pmqZNC[0]); + registry.get(HIST("ZNCpm2"))->Fill(pmqZNC[1]); + registry.get(HIST("ZNCpm3"))->Fill(pmqZNC[2]); + registry.get(HIST("ZNCpm4"))->Fill(pmqZNC[3]); + registry.get(HIST("ZNCsumq"))->Fill(sumZNC); + } } if (isZNAhit) { - for (int it = 0; it < nTowers; it++) { + for (int it = 0; it < NTowers; it++) { pmqZNA[it] = (zdc.energySectorZNA())[it]; sumZNA += pmqZNA[it]; } // - registry.get(HIST("ZNApmc"))->Fill(pmcZNA); - registry.get(HIST("ZNApm1"))->Fill(pmqZNA[0]); - registry.get(HIST("ZNApm2"))->Fill(pmqZNA[1]); - registry.get(HIST("ZNApm3"))->Fill(pmqZNA[2]); - registry.get(HIST("ZNApm4"))->Fill(pmqZNA[3]); - registry.get(HIST("ZNAsumq"))->Fill(sumZNA); + if (cfgSaveQaHistos) { + registry.get(HIST("ZNApmc"))->Fill(pmcZNA); + registry.get(HIST("ZNApm1"))->Fill(pmqZNA[0]); + registry.get(HIST("ZNApm2"))->Fill(pmqZNA[1]); + registry.get(HIST("ZNApm3"))->Fill(pmqZNA[2]); + registry.get(HIST("ZNApm4"))->Fill(pmqZNA[3]); + registry.get(HIST("ZNAsumq"))->Fill(sumZNA); + } } // Q-vectors (centroid) calculation @@ -257,8 +290,7 @@ struct ZdcExtraTableProducer { float numXZNA = 0., numYZNA = 0., denZNA = 0.; // Calculate weighted sums of the x and y coordinates - constexpr int kNTowers = 4; // number of ZDC towers - for (int i = 0; i < kNTowers; i++) { + for (int i = 0; i < NTowers; i++) { if (pmqZNC[i] > 0.) { float wZNC = std::pow(pmqZNC[i], kAlpha); numXZNC -= X[i] * wZNC; // numerator x (minus sign due to opposite orientation of ZNC) @@ -307,8 +339,14 @@ struct ZdcExtraTableProducer { centroidZNA[0] = 999.; centroidZNA[1] = 999.; } - registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); - registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); + if (cfgSaveQaHistos) { + if (isZNChit) { + registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); + } + if (isZNAhit) { + registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); + } + } auto vz = collision.posZ(); auto vx = collision.posX(); From 058aded91a0fec430df99498ee0aff5a862dbc41 Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:14:15 +0100 Subject: [PATCH 014/282] [PWGCF] Event-by-event weights fixed (#15466) Co-authored-by: MaximVirta --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 158880474ae..304b412696c 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -530,15 +530,18 @@ struct FlowGfwV02 { if (dnx == 0) continue; auto val = fGFW->Calculate(corrconfigs.at(0), 0, kFALSE).real() / dnx; + double ebyeWeight = (cfgUseMultiplicityFlowWeights) ? dnx : 1.0; for (int i = 1; i <= fSecondAxis->GetNbins(); i++) { - if (corrconfigs.at(l_ind).Head.find("nch") != std::string::npos) + if (corrconfigs.at(l_ind).Head.find("nch") != std::string::npos) { + ebyeWeight = 1.0; val = 1.0; + } double ptFraction = 0; int normIndex = (cfgNormalizeByCharged) ? PidCharged : pidInd; // Configured to normalize by charged particles or the selected particle if (pidStates.hPtMid[normIndex]->Integral() > 0) { ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral(); if (std::abs(val) < 1.01) - fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); + fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, ebyeWeight, rndm); } } } From d089bd2bfc3f85ddf6af77a1039d2696136015dc Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 20 Mar 2026 22:19:57 +0530 Subject: [PATCH 015/282] [PWGLF] Update to use Full PID tables (#15467) --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 000957d1fdf..fada8bbc6e4 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -218,7 +218,7 @@ struct Lambda1520analysisinpp { // Filter primarytrackFilter = requirePVContributor() && requirePrimaryTrack() && requireGlobalTrackWoDCA(); using EventCandidates = soa::Join; - using TrackCandidates = soa::Filtered>; + using TrackCandidates = soa::Filtered>; using MCEventCandidates = soa::Join; using MCTrackCandidates = soa::Filtered>; From ccf08e8f539139c3d3802a5ee7e5fccb8550dd75 Mon Sep 17 00:00:00 2001 From: Stefanie Mrozinski <63045530+Steffimro@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:03:52 +0100 Subject: [PATCH 016/282] [PWGEM] Add more differential pair QA histograms + MC QA (#15471) Co-authored-by: ALICE Action Bot --- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 1487 +++++++++++++++++++++---- 1 file changed, 1268 insertions(+), 219 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index bacb008cd47..40a6599bb71 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -10,11 +10,13 @@ // or submit itself to any jurisdiction. /// \file photonhbt.cxx -/// \brief This code loops over v0 photons and makes pairs for photon HBT analysis. -/// \author Daiki Sekihata, daiki.sekihata@cern.ch and Stefanie Mrozinski stefanie.mrozinski@cern.ch +/// \brief V0 photon HBT analysis. +/// \author Daiki Sekihata, daiki.sekihata@cern.ch +/// Stefanie Mrozinski, stefanie.mrozinski@cern.ch #include "PWGEM/Dilepton/Utils/EMTrack.h" #include "PWGEM/Dilepton/Utils/EventMixingHandler.h" +#include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" @@ -53,6 +55,7 @@ #include #include #include +#include #include #include @@ -60,8 +63,8 @@ enum class V0Combo : int { Inclusive = 0, ItstpcItstpc = 1, ///< both legs ITS+TPC - ItstpcTpconly = 2, /// one ITS+TPC leg, one TPC-only - TpconlyTpconly = 3, /// both legs TPC-only + ItstpcTpconly = 2, ///< one ITS+TPC leg, one TPC-only + TpconlyTpconly = 3, ///< both legs TPC-only }; /// Photon-pair track-type combo. @@ -82,12 +85,43 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::dilepton::utils; -using MyCollisions = soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; using MyV0Photons = soa::Join; using MyV0Photon = MyV0Photons::iterator; +using MyMCV0Legs = soa::Join; +using MyMCV0Leg = MyMCV0Legs::iterator; + +// ─── MC truth classification types ──────────────────────────────────────────── + +/// Per-photon MC truth information built from the two V0 legs. +struct PhotonMCInfo { + bool hasMC = false; // both legs have a valid MC label + bool sameMother = false; // both legs share the same MC mother + bool isTruePhoton = false; // mother PDG == 22 + + int mcPosId = -1; // MC particle index of the positive leg + int mcNegId = -1; // MC particle index of the negative leg + int motherId = -1; // MC particle index of the common mother + int motherPdg = 0; + + bool isPhysicalPrimary = false; +}; + +/// Classification of a photon pair at the MC-truth level. +enum class PairTruthType : uint8_t { + Unknown = 0, + TrueTrueDistinct, // both photons are true, from different MC photons + TrueTrueSamePhoton, // both photons are true, same MC photon (clone/split) + SharedMcLeg, // different reco tracks but same MC-level leg + TrueFake, // one photon is true, one is fake + FakeFake, // both photons are fake + Pi0Daughters, // both photons come from the same MC pi0 +}; + struct photonhbt { template @@ -116,13 +150,12 @@ struct photonhbt { return PairCombo::Inclusive; const int lo = std::min(i1, i2); const int hi = std::max(i1, i2); - static constexpr std::array, 4> kTable = {{{0, 0, 0, 0}, {0, 1, 2, 3}, {0, 2, 4, 5}, {0, 3, 5, 6}}}; + static constexpr std::array, 4> kTable = { + {{0, 0, 0, 0}, {0, 1, 2, 3}, {0, 2, 4, 5}, {0, 3, 5, 6}}}; return static_cast(kTable[lo][hi]); } - // --------------------------------------------------------------------------- - // Configurables: histogram axes - // --------------------------------------------------------------------------- + // ─── Configurables: histogram axis bins ─────────────────────────────────── // HBT physics ConfigurableAxis confQBins{"confQBins", {60, 0, +0.3f}, "q bins for output histograms"}; @@ -131,16 +164,29 @@ struct photonhbt { // Single-photon QA ConfigurableAxis confPtBins{"confPtBins", {100, 0.f, 2.f}, "pT bins (GeV/c)"}; ConfigurableAxis confEtaBins{"confEtaBins", {80, -0.8f, 0.8f}, "eta bins"}; - ConfigurableAxis confPhiBins{"confPhiBins", {90, -o2::constants::math::PI, o2::constants::math::PI}, "phi bins (rad)"}; + ConfigurableAxis confPhiBins{"confPhiBins", {90, 0.f, o2::constants::math::TwoPI}, "phi bins (rad) — O2 track phi is in [0, 2pi]"}; - // Pair QA + // Pair angular ConfigurableAxis confDeltaEtaBins{"confDeltaEtaBins", {100, -0.9f, +0.9f}, "Delta-eta bins"}; ConfigurableAxis confDeltaPhiBins{"confDeltaPhiBins", {100, -o2::constants::math::PI, o2::constants::math::PI}, "Delta-phi bins (rad)"}; ConfigurableAxis confEllipseValBins{"confEllipseValBins", {200, 0.f, 10.f}, "ellipse value bins"}; ConfigurableAxis confCosThetaBins{"confCosThetaBins", {100, 0.f, 1.f}, "cos(theta*) bins"}; ConfigurableAxis confOpeningAngleBins{"confOpeningAngleBins", {100, 0.f, o2::constants::math::PI}, "opening angle bins (rad)"}; - // Axis specs + // Pair geometry + ConfigurableAxis confRBins{"confRBins", {100, 0.f, 100.f}, "conversion radius bins (cm)"}; + ConfigurableAxis confDeltaRBins{"confDeltaRBins", {120, 0.f, 30.f}, "|R1-R2| bins (cm)"}; + ConfigurableAxis confDeltaR3DBins{"confDeltaR3DBins", {100, 0.f, 100.f}, "3D distance between conversion points (cm)"}; + ConfigurableAxis confDeltaRxyBins{"confDeltaRxyBins", {100, 0.f, 100.f}, "xy distance between conversion points (cm)"}; + ConfigurableAxis confZConvBins{"confZConvBins", {200, -100.f, 100.f}, "conversion z (cm)"}; + ConfigurableAxis confDeltaZBins{"confDeltaZBins", {200, -100.f, 100.f}, "#Deltaz bins (cm)"}; ///< FIX: was missing + + // Event QA + ConfigurableAxis confOccupancyQA{"confOccupancyQA", {100, 0.f, 50000.f}, "occupancy"}; + ConfigurableAxis confCentQABins{"confCentQABins", {110, 0.f, 110.f}, "centrality (%)"}; + + // ─── Axis specs ──────────────────────────────────────────────────────────── + const AxisSpec axisKt{confKtBins, "k_{T} (GeV/c)"}; const AxisSpec axisQinv{confQBins, "q_{inv} (GeV/c)"}; const AxisSpec axisQabsLcms{confQBins, "|#bf{q}|^{LCMS} (GeV/c)"}; @@ -155,39 +201,51 @@ struct photonhbt { const AxisSpec axisEllipseVal{confEllipseValBins, "(#Delta#eta/#sigma_{#eta})^{2}+(#Delta#phi/#sigma_{#phi})^{2}"}; const AxisSpec axisCosTheta{confCosThetaBins, "cos(#theta*)"}; const AxisSpec axisOpeningAngle{confOpeningAngleBins, "Opening angle (rad)"}; + const AxisSpec axisR{confRBins, "R_{conv} (cm)"}; + const AxisSpec axisDeltaR{confDeltaRBins, "|R_{1}-R_{2}| (cm)"}; + const AxisSpec axisDeltaR3D{confDeltaR3DBins, "|#vec{r}_{1}-#vec{r}_{2}| (cm)"}; + const AxisSpec axisDeltaRxy{confDeltaRxyBins, "#Delta r_{xy} (cm)"}; + const AxisSpec axisZConv{confZConvBins, "z_{conv} (cm)"}; + const AxisSpec axisDeltaZ{confDeltaZBins, "#Delta z (cm)"}; ///< FIX: was missing + const AxisSpec axisOccupancy{confOccupancyQA, "occupancy"}; + const AxisSpec axisCentQA{confCentQABins, "centrality (%)"}; - // --------------------------------------------------------------------------- - // Configurables: QA flags - // --------------------------------------------------------------------------- + // ─── Configurables: QA flags ─────────────────────────────────────────────── struct : ConfigurableGroup { std::string prefix = "qaflags_group"; - Configurable doPairQa{"doPairQa", true, "fill pair QA histograms (Before/After ellipse cut)"}; + Configurable doPairQa{"doPairQa", true, "fill pair QA histograms at each cut step"}; Configurable doSinglePhotonQa{"doSinglePhotonQa", true, "fill single-photon QA histograms (pT, eta, phi)"}; + Configurable cfgMaxQinvForQA{"cfgMaxQinvForQA", 0.1f, + "fill per-step pair QA histograms (hDeltaEta, hDeltaPhi, THnSparses, ...) " + "only when q_inv < this value (GeV/c). " + "Set to the HBT signal region, typically 0.1. " + "Set <= 0 to disable the gate. The CF is always filled regardless."}; + Configurable cfgMaxQinvForFullRange{"cfgMaxQinvForFullRange", 0.3f, + "fill full-range histograms (hDeltaRVsQinv, hSparseDeltaRDeltaZQinv, ...) " + "only when q_inv < this value (GeV/c). " + "Should match the upper edge of confQBins (default 0.3) — " + "fills beyond the axis range only go into the overflow bin. " + "Set <= 0 to disable the gate."}; } qaflags; - // --------------------------------------------------------------------------- - // Configurables: HBT kind - // --------------------------------------------------------------------------- + // ─── Configurables: HBT kind ─────────────────────────────────────────────── - Configurable cfgDo3D{"cfgDo3D", false, "enable 3D analysis"}; - Configurable cfgUseLCMS{"cfgUseLCMS", true, "measure relative momentum in LCMS for 1D"}; + Configurable cfgDo3D{"cfgDo3D", false, "enable 3D (qout,qside,qlong) analysis"}; + Configurable cfgDo2D{"cfgDo2D", false, "enable 2D (qout,qinv) projection (requires cfgDo3D)"}; + Configurable cfgUseLCMS{"cfgUseLCMS", true, "measure 1D relative momentum in LCMS"}; - // --------------------------------------------------------------------------- - // Configurables: events - // --------------------------------------------------------------------------- + // ─── Configurables: events ───────────────────────────────────────────────── Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; Configurable maxY{"maxY", 0.9, "maximum rapidity"}; - // --------------------------------------------------------------------------- - // Configurables: mixed event - // --------------------------------------------------------------------------- + // ─── Configurables: mixed event ──────────────────────────────────────────── Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; Configurable ndepth{"ndepth", 100, "depth for event mixing"}; - Configurable ndiffBCMix{"ndiffBCMix", 594, "difference in global BC required in mixed events"}; + Configurable ndiffBCMix{"ndiffBCMix", 594, "difference in global BC required for mixed events"}; Configurable cfgEP2EstimatorForMix{"cfgEP2EstimatorForMix", 3, "FT0M:0, FT0A:1, FT0C:2, FV0A:3, BTot:4, BPos:5, BNeg:6"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; @@ -197,22 +255,25 @@ struct photonhbt { ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}, "Mixing bins - EP angle"}; ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - // --------------------------------------------------------------------------- - // Configurables: pair cuts - // --------------------------------------------------------------------------- + // ─── Configurables: pair cuts ────────────────────────────────────────────── struct : ConfigurableGroup { std::string prefix = "ggpaircut_group"; - Configurable cfgMinDR_CosOA{"cfgMinDR_CosOA", -1, "min. dr/cosOA for kPCMPCM"}; - Configurable cfgApplyEllipseCut{"cfgApplyEllipseCut", false, "reject pairs inside ellipse in DeltaEta-DeltaPhi"}; + // dr/cosOA cut + Configurable cfgMinDRCosOA{"cfgMinDRCosOA", -1.f, "min. dr/cosOA; <0 = disabled"}; + // R/Z geometry cuts + Configurable cfgDoRCut{"cfgDoRCut", false, "apply |R1-R2| > cfgMinDeltaR cut"}; + Configurable cfgMinDeltaR{"cfgMinDeltaR", 0.f, "minimum |R1-R2| (cm)"}; + Configurable cfgDoZCut{"cfgDoZCut", false, "apply |DeltaZ| > cfgMinDeltaZ cut"}; + Configurable cfgMinDeltaZ{"cfgMinDeltaZ", 0.f, "minimum |DeltaZ| (cm)"}; + // Ellipse cut in (DeltaEta, DeltaPhi) + Configurable cfgDoEllipseCut{"cfgDoEllipseCut", false, "reject pairs inside ellipse in DeltaEta-DeltaPhi"}; Configurable cfgEllipseSigEta{"cfgEllipseSigEta", 0.02f, "sigma_eta for ellipse cut"}; Configurable cfgEllipseSigPhi{"cfgEllipseSigPhi", 0.02f, "sigma_phi for ellipse cut"}; - Configurable cfgEllipseR2{"cfgEllipseR2", 1.0f, "R^2 threshold: reject if value < R^2"}; + Configurable cfgEllipseR2{"cfgEllipseR2", 1.0f, "R^2 threshold: reject if ellipse value < R^2"}; } ggpaircuts; - // --------------------------------------------------------------------------- - // Event cut - // --------------------------------------------------------------------------- + // ─── Event cut ───────────────────────────────────────────────────────────── EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { @@ -240,40 +301,31 @@ struct photonhbt { Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "all ITS layers OK"}; } eventcuts; - // --------------------------------------------------------------------------- - // PCM cut - // --------------------------------------------------------------------------- + // ─── PCM cut ─────────────────────────────────────────────────────────────── V0PhotonCut fV0PhotonCut; struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; - Configurable cfgRequireV0WithITSTPC{"cfgRequireV0WithITSTPC", false, "select V0s with ITS-TPC tracks"}; Configurable cfgRequireV0WithITSOnly{"cfgRequireV0WithITSOnly", false, "select V0s with ITS-only tracks"}; Configurable cfgRequireV0WithTPCOnly{"cfgRequireV0WithTPCOnly", false, "select V0s with TPC-only tracks"}; - Configurable cfgMinPtV0{"cfgMinPtV0", 0.1, "min pT for V0 photons at PV"}; Configurable cfgMaxEtaV0{"cfgMaxEtaV0", 0.8, "max eta for V0 photons at PV"}; Configurable cfgMinV0Radius{"cfgMinV0Radius", 16.0, "min V0 radius"}; Configurable cfgMaxV0Radius{"cfgMaxV0Radius", 90.0, "max V0 radius"}; - Configurable cfgMaxAlphaAP{"cfgMaxAlphaAP", 0.95, "max alpha for AP cut"}; Configurable cfgMaxQtAP{"cfgMaxQtAP", 0.01, "max qT for AP cut"}; - Configurable cfgMinCosPA{"cfgMinCosPA", 0.997, "min V0 CosPA"}; Configurable cfgMaxPCA{"cfgMaxPCA", 3.0, "max distance between 2 legs"}; Configurable cfgMaxChi2KF{"cfgMaxChi2KF", 1e+10, "max chi2/ndf with KF"}; - Configurable cfgRejectV0OnITSIB{"cfgRejectV0OnITSIB", true, "reject V0s on ITSib"}; Configurable cfgDisableITSOnlyTrack{"cfgDisableITSOnlyTrack", false, "disable ITS-only tracks"}; Configurable cfgDisableTPCOnlyTrack{"cfgDisableTPCOnlyTrack", false, "disable TPC-only tracks"}; - Configurable cfgMinNClusterTPC{"cfgMinNClusterTPC", 70, "min ncluster TPC"}; Configurable cfgMinNCrossedRows{"cfgMinNCrossedRows", 70, "min crossed rows"}; Configurable cfgMaxFracSharedClustersTPC{"cfgMaxFracSharedClustersTPC", 999.f, "max fraction of shared TPC clusters"}; Configurable cfgMaxChi2TPC{"cfgMaxChi2TPC", 4.0, "max chi2/NclsTPC"}; Configurable cfgMaxChi2ITS{"cfgMaxChi2ITS", 36.0, "max chi2/NclsITS"}; - Configurable cfgMinTPCNsigmaEl{"cfgMinTPCNsigmaEl", -3.5, "min TPC nsigma electron"}; Configurable cfgMaxTPCNsigmaEl{"cfgMaxTPCNsigmaEl", +3.5, "max TPC nsigma electron"}; } pcmcuts; @@ -286,7 +338,6 @@ struct photonhbt { emh2 = nullptr; mapMixedEventIdToGlobalBC.clear(); usedPhotonIdsPerCol.clear(); - usedPhotonIdsPerCol.shrink_to_fit(); } HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -294,16 +345,18 @@ struct photonhbt { std::mt19937 engine; std::uniform_int_distribution dist01; - int mRunNumber; + int mRunNumber{0}; std::vector ztxBinEdges; std::vector centBinEdges; std::vector epBinEgdes; std::vector occBinEdges; + // ─── Pair-cut helpers ────────────────────────────────────────────────────── + inline bool isInsideEllipse(float deta, float dphi) const { - if (!ggpaircuts.cfgApplyEllipseCut.value) + if (!ggpaircuts.cfgDoEllipseCut.value) // .value needed: operator T() is non-const in O2 return false; const float sE = ggpaircuts.cfgEllipseSigEta.value; const float sP = ggpaircuts.cfgEllipseSigPhi.value; @@ -312,6 +365,27 @@ struct photonhbt { return (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP) < ggpaircuts.cfgEllipseR2.value; } + inline bool passRZCut(float deltaR, float deltaZ) const + { + if (ggpaircuts.cfgDoRCut.value && deltaR < ggpaircuts.cfgMinDeltaR.value) + return false; + if (ggpaircuts.cfgDoZCut.value && std::fabs(deltaZ) < ggpaircuts.cfgMinDeltaZ.value) + return false; + return true; + } + + inline bool passQinvQAGate(float qinv) const + { + const float limit = qaflags.cfgMaxQinvForQA.value; + return (limit <= 0.f) || (qinv < limit); + } + + inline bool passQinvFullRangeGate(float qinv) const + { + const float limit = qaflags.cfgMaxQinvForFullRange.value; + return (limit <= 0.f) || (qinv < limit); + } + static inline float computeCosTheta(const ROOT::Math::PtEtaPhiMVector& v1, const ROOT::Math::PtEtaPhiMVector& v2) { @@ -341,16 +415,48 @@ struct photonhbt { } } - /// Clamp bin index to valid range [0, nmax]. static int clampBin(int b, int nmax) { return std::clamp(b, 0, nmax); } - /// Find the bin index for val in a sorted edge vector. static int binOf(const std::vector& edges, float val) { - const int b = static_cast(std::lower_bound(edges.begin(), edges.end(), val) - edges.begin()) - 1; + const int b = static_cast( + std::lower_bound(edges.begin(), edges.end(), val) - edges.begin()) - + 1; return clampBin(b, static_cast(edges.size()) - 2); } + /// ev_id : 0 = same-event, 1 = mixed-event + /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse + template + static constexpr const char* qaPrefix() + { + if constexpr (ev_id == 0) { + if constexpr (step_id == 0) + return "Pair/same/QA/Before/"; + if constexpr (step_id == 1) + return "Pair/same/QA/AfterDRCosOA/"; + if constexpr (step_id == 2) + return "Pair/same/QA/AfterRZ/"; + return "Pair/same/QA/AfterEllipse/"; + } else { + if constexpr (step_id == 0) + return "Pair/mix/QA/Before/"; + if constexpr (step_id == 1) + return "Pair/mix/QA/AfterDRCosOA/"; + if constexpr (step_id == 2) + return "Pair/mix/QA/AfterRZ/"; + return "Pair/mix/QA/AfterEllipse/"; + } + } + + template + static constexpr const char* fullRangePrefix() + { + if constexpr (ev_id == 0) + return "Pair/same/FullRange/"; + return "Pair/mix/FullRange/"; + } + void init(InitContext& /*context*/) { mRunNumber = 0; @@ -373,7 +479,7 @@ struct photonhbt { dist01 = std::uniform_int_distribution(0, 1); fRegistry.add("Pair/mix/hDiffBC", - "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", + "diff. global BC in mixed event;|BC_{current}-BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); } @@ -384,51 +490,198 @@ struct photonhbt { return; mRunNumber = collision.runNumber(); } + + // ─── PairQAObservables ───────────────────────────────────────────────────── + /// Plain data struct holding all observables computed from a photon pair. + /// Defined early so all histogram-booking and fill functions can use it. + + struct PairQAObservables { + // photon four-vectors and pair kinematics + ROOT::Math::PtEtaPhiMVector v1; + ROOT::Math::PtEtaPhiMVector v2; + ROOT::Math::PtEtaPhiMVector k12; + // conversion-point coordinates + float x1 = 0.f, y1 = 0.f, z1 = 0.f; + float x2 = 0.f, y2 = 0.f, z2 = 0.f; + // conversion-point radii and distances + float r1 = 0.f, r2 = 0.f; + float dx = 0.f, dy = 0.f, dz = 0.f; + float deltaR = 0.f; ///< |R1-R2| + float deltaZ = 0.f; ///< z1-z2 + float deltaRxy = 0.f; ///< sqrt(dx^2+dy^2) + float deltaR3D = 0.f; ///< sqrt(dx^2+dy^2+dz^2) + // opening angle of conversion-point vectors + float opa = 0.f; + float cosOA = 0.f; + float drOverCosOA = 0.f; + float deta = 0.f, dphi = 0.f; + float pairEta = 0.f, pairPhi = 0.f; + float kt = 0.f, qinv = 0.f; + float cosTheta = 0.f; + float openingAngle = 0.f; + // validity flag + bool valid = true; + }; + + void addSinglePhotonQAHistogramsForStep(const std::string& path) + { + fRegistry.add((path + "hPt").c_str(), "p_{T};p_{T} (GeV/c);counts", kTH1D, {axisPt}, true); + fRegistry.add((path + "hEta").c_str(), "#eta;#eta;counts", kTH1D, {axisEta}, true); + fRegistry.add((path + "hPhi").c_str(), "#phi;#phi (rad);counts", kTH1D, {axisPhi}, true); + fRegistry.add((path + "hEtaVsPhi").c_str(), "acceptance;#phi (rad);#eta", kTH2D, {axisPhi, axisEta}, true); + fRegistry.add((path + "hR").c_str(), "R_{conv};R_{conv} (cm);counts", kTH1D, {axisR}, true); + fRegistry.add((path + "hZConv").c_str(), "z_{conv};z_{conv} (cm);counts", kTH1D, {axisZConv}, true); + fRegistry.add((path + "hRVsZConv").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH2D, {axisZConv, axisR}, true); + } + + void addFullRangeHistograms(const std::string& path) + { + fRegistry.add((path + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv} (full range);q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); + fRegistry.add((path + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv} (full range);q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); + fRegistry.add((path + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv} (full range);q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); + fRegistry.add((path + "hQinvVsCent").c_str(), "q_{inv} vs centrality (full range);centrality (%);q_{inv} (GeV/c)", kTH2D, {axisCentQA, axisQinv}, true); + fRegistry.add((path + "hQinvVsOccupancy").c_str(), "q_{inv} vs occupancy (full range);occupancy;q_{inv} (GeV/c)", kTH2D, {axisOccupancy, axisQinv}, true); + fRegistry.add((path + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv} (full range)", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + fRegistry.add((path + "hDeltaRCosOAVsQinv").c_str(), "#Delta r/cos(#theta_{op}/2) vs q_{inv};q_{inv} (GeV/c);#Delta r/cos(#theta_{op}/2) (cm)", kTH2D, {axisQinv, {100, 0, 100}}, true); + } + + /// ev_id : 0 = same-event, 1 = mixed-event + template + inline void fillFullRangeQA(PairQAObservables const& obs, float cent, float occupancy) + { + constexpr auto base = fullRangePrefix(); + fRegistry.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); + fRegistry.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); + fRegistry.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); + fRegistry.fill(HIST(base) + HIST("hQinvVsCent"), cent, obs.qinv); + fRegistry.fill(HIST(base) + HIST("hQinvVsOccupancy"), occupancy, obs.qinv); + fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), + obs.deltaR, obs.deltaZ, obs.qinv); + } + + template + inline void fillFullRangeDeltaRCosOA(float qinv, float drOverCosOA) + { + constexpr auto base = fullRangePrefix(); + fRegistry.fill(HIST(base) + HIST("hDeltaRCosOAVsQinv"), qinv, drOverCosOA); + } + void addQAHistogramsForStep(const std::string& path) { - fRegistry.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1F, {axisDeltaEta}, true); - fRegistry.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1F, {axisDeltaPhi}, true); - fRegistry.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2F, {axisDeltaEta, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2F, {axisEta, axisDeltaEta}, true); - fRegistry.add((path + "hCosTheta").c_str(), "cos(#theta*) in pair rest frame;cos(#theta*);counts", kTH1F, {axisCosTheta}, true); - fRegistry.add((path + "hOpeningAngle").c_str(), "Opening angle between conversion points;#alpha (rad);counts", kTH1F, {axisOpeningAngle}, true); + // ── 1D: photon kinematics ──────────────────────────────────────────────── + fRegistry.add((path + "hPairEta").c_str(), "pair #eta;#eta_{pair};counts", kTH1D, {axisEta}, true); + fRegistry.add((path + "hPairPhi").c_str(), "pair #phi;#phi_{pair} (rad);counts", kTH1D, {axisPhi}, true); + fRegistry.add((path + "hPairKt").c_str(), "pair k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistry.add((path + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + + // ── 1D: angular ───────────────────────────────────────────────────────── + fRegistry.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); + fRegistry.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); + fRegistry.add((path + "hCosTheta").c_str(), "cos(#theta*) in pair rest frame;cos(#theta*);counts", kTH1D, {axisCosTheta}, true); + fRegistry.add((path + "hOpeningAngle").c_str(), "Opening angle;#alpha (rad);counts", kTH1D, {axisOpeningAngle}, true); fRegistry.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma_{#eta})^{2}+(#Delta#phi/#sigma_{#phi})^{2};value;counts", kTH1D, {axisEllipseVal}, true); + + // ── 1D: geometry ──────────────────────────────────────────────────────── + fRegistry.add((path + "hR1").c_str(), "R_{conv,1};R_{1} (cm);counts", kTH1D, {axisR}, true); + fRegistry.add((path + "hR2").c_str(), "R_{conv,2};R_{2} (cm);counts", kTH1D, {axisR}, true); + fRegistry.add((path + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); + fRegistry.add((path + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); + fRegistry.add((path + "hDeltaRxy").c_str(), "#Delta r_{xy};#Delta r_{xy} (cm);counts", kTH1D, {axisDeltaRxy}, true); + fRegistry.add((path + "hDeltaR3D").c_str(), "|#vec{r}_{1}-#vec{r}_{2}|;#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); + + // ── 1D: event-level ───────────────────────────────────────────────────── + fRegistry.add((path + "hCent").c_str(), "centrality;centrality (%);counts", kTH1D, {axisCentQA}, true); + fRegistry.add((path + "hOccupancy").c_str(), "occupancy;occupancy;counts", kTH1D, {axisOccupancy}, true); + + // ── 2D: angular ───────────────────────────────────────────────────────── + fRegistry.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistry.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2D, {axisEta, axisDeltaEta}, true); + + // ── 2D: geometry ──────────────────────────────────────────────────────── + fRegistry.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); + fRegistry.add((path + "hDeltaRVsDeltaZ").c_str(), "|R_{1}-R_{2}| vs #Delta z;|R_{1}-R_{2}| (cm);#Delta z (cm)", kTH2D, {axisDeltaR, axisDeltaZ}, true); + + // ── 2D: geometry vs kT ────────────────────────────────────────────────── + // Note: hDeltaRVsQinv, hDeltaZVsQinv live in FullRange/ (always filled, full q range) + fRegistry.add((path + "hDeltaRVsKt").c_str(), "|R_{1}-R_{2}| vs k_{T};k_{T} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisKt, axisDeltaR}, true); + fRegistry.add((path + "hDeltaZVsKt").c_str(), "#Delta z vs k_{T};k_{T} (GeV/c);#Delta z (cm)", kTH2D, {axisKt, axisDeltaZ}, true); + + // ── 2D: angular vs geometry ───────────────────────────────────────────── + fRegistry.add((path + "hDeltaPhiVsDeltaR").c_str(), "#Delta#phi vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#phi (rad)", kTH2D, {axisDeltaR, axisDeltaPhi}, true); + fRegistry.add((path + "hDeltaEtaVsDeltaR").c_str(), "#Delta#eta vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#eta", kTH2D, {axisDeltaR, axisDeltaEta}, true); + fRegistry.add((path + "hDeltaPhiVsDeltaZ").c_str(), "#Delta#phi vs #Delta z;#Delta z (cm);#Delta#phi (rad)", kTH2D, {axisDeltaZ, axisDeltaPhi}, true); + fRegistry.add((path + "hDeltaEtaVsDeltaZ").c_str(), "#Delta#eta vs #Delta z;#Delta z (cm);#Delta#eta", kTH2D, {axisDeltaZ, axisDeltaEta}, true); + + // ── 2D: vs event properties ───────────────────────────────────────────── + fRegistry.add((path + "hDeltaRVsCent").c_str(), "|R_{1}-R_{2}| vs centrality;centrality (%);|R_{1}-R_{2}| (cm)", kTH2D, {axisCentQA, axisDeltaR}, true); + fRegistry.add((path + "hDeltaRVsOccupancy").c_str(), "|R_{1}-R_{2}| vs occupancy;occupancy;|R_{1}-R_{2}| (cm)", kTH2D, {axisOccupancy, axisDeltaR}, true); + + fRegistry.add((path + "hSparseDEtaDPhiCent").c_str(), + "#Delta#eta,#Delta#phi,centrality", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisCentQA}, true); + fRegistry.add((path + "hSparseDEtaDPhiOcc").c_str(), + "#Delta#eta,#Delta#phi,occupancy", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisOccupancy}, true); + fRegistry.add((path + "hSparseDEtaDPhiKt").c_str(), + "#Delta#eta,#Delta#phi,k_{T}", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add((path + "hSparseDeltaRDeltaZKt").c_str(), + "|R_{1}-R_{2}|,#Delta z,k_{T}", + kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); } void addhistograms() { static constexpr std::string_view det[6] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg"}; - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), kTH2F, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), kTH2F, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); - - // ── Single-photon QA ───────────────────────────────────────────────────── - fRegistry.add("SinglePhoton/hPt", "V0 photon p_{T};p_{T} (GeV/c);counts", kTH1F, {axisPt}, true); - fRegistry.add("SinglePhoton/hEta", "V0 photon #eta;#eta;counts", kTH1F, {axisEta}, true); - fRegistry.add("SinglePhoton/hPhi", "V0 photon #phi;#phi (rad);counts", kTH1F, {axisPhi}, true); - fRegistry.add("SinglePhoton/hEtaVsPhi", "V0 photon acceptance;#phi (rad);#eta", kTH2F, {axisPhi, axisEta}, true); - - // ── HBT physics ────────────────────────────────────────────────────────── + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", + Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), + kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", + Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), + kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); + + addSinglePhotonQAHistogramsForStep("SinglePhoton/Before/"); + addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterDRCosOA/"); + addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterRZ/"); + addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterEllipse/"); + + // ── HBT correlation functions ───────────────────────────────────────────── if (cfgDo3D) { - fRegistry.add("Pair/same/hs_3d", "diphoton correlation 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", + kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) { + fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", + kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + } } else { if (cfgUseLCMS) { - fRegistry.add("Pair/same/hs_1d", "diphoton correlation 1D LCMS", kTHnSparseD, {axisQabsLcms, axisKt}, true); + fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); } else { - fRegistry.add("Pair/same/hs_1d", "diphoton correlation 1D", kTHnSparseD, {axisQinv, axisKt}, true); + fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); } } - fRegistry.add("Pair/same/hDeltaRCosOA", "distance between 2 conversion points;#Deltar/cos(#theta_{op}/2) (cm)", kTH1D, {{100, 0, 100}}, true); + fRegistry.add("Pair/same/hDeltaRCosOA", + "distance between 2 conversion points / cos(#theta_{op}/2);#Delta r / cos(#theta_{op}/2) (cm);counts", + kTH1D, {{100, 0, 100}}, true); + // ── QA steps (same-event; mix-event cloned below) ───────────────────────── addQAHistogramsForStep("Pair/same/QA/Before/"); - addQAHistogramsForStep("Pair/same/QA/After/"); + addQAHistogramsForStep("Pair/same/QA/AfterDRCosOA/"); + addQAHistogramsForStep("Pair/same/QA/AfterRZ/"); + addQAHistogramsForStep("Pair/same/QA/AfterEllipse/"); + + // ── MC truth histograms (same-event; mix-event cloned below) ───────────── + addMCHistograms(); + + // ── Full-range histograms: always filled, qinv as axis ─────────────────── + addFullRangeHistograms("Pair/same/FullRange/"); + // Clone all Pair/same/ histograms to Pair/mix/ fRegistry.addClone("Pair/same/", "Pair/mix/"); } - // --------------------------------------------------------------------------- - // DefineEMEventCut / DefinePCMCut - // --------------------------------------------------------------------------- + // ─── DefineEMEventCut ────────────────────────────────────────────────────── void DefineEMEventCut() { @@ -451,6 +704,8 @@ struct photonhbt { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } + // ─── DefinePCMCut ────────────────────────────────────────────────────────── + void DefinePCMCut() { fV0PhotonCut = V0PhotonCut("fV0PhotonCut", "fV0PhotonCut"); @@ -478,8 +733,37 @@ struct photonhbt { fV0PhotonCut.SetRequireTPConly(pcmcuts.cfgRequireV0WithTPCOnly); } + /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse + template + static constexpr const char* singlePhotonQAPrefix() + { + if constexpr (step_id == 0) + return "SinglePhoton/Before/"; + if constexpr (step_id == 1) + return "SinglePhoton/AfterDRCosOA/"; + if constexpr (step_id == 2) + return "SinglePhoton/AfterRZ/"; + return "SinglePhoton/AfterEllipse/"; + } + + template + inline void fillSinglePhotonQAStep(TPhoton const& g) + { + if (!qaflags.doSinglePhotonQa) + return; + constexpr auto base = singlePhotonQAPrefix(); + const float r = std::sqrt(g.vx() * g.vx() + g.vy() * g.vy()); + fRegistry.fill(HIST(base) + HIST("hPt"), g.pt()); + fRegistry.fill(HIST(base) + HIST("hEta"), g.eta()); + fRegistry.fill(HIST(base) + HIST("hPhi"), g.phi()); + fRegistry.fill(HIST(base) + HIST("hEtaVsPhi"), g.phi(), g.eta()); + fRegistry.fill(HIST(base) + HIST("hR"), r); + fRegistry.fill(HIST(base) + HIST("hZConv"), g.vz()); + fRegistry.fill(HIST(base) + HIST("hRVsZConv"), g.vz(), r); + } + template - void fillPairHistogram(TCollision const&, + void fillPairHistogram(TCollision const& /*collision*/, ROOT::Math::PtEtaPhiMVector v1, ROOT::Math::PtEtaPhiMVector v2, float weight = 1.f) @@ -504,60 +788,497 @@ struct photonhbt { float qlong_lcms = q3_lcms.Dot(uv_long); if (cfgDo3D) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_3d"), + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_3D"), std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); + if (cfgDo2D) { + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_2D"), + std::fabs(qout_lcms), std::fabs(qinv), kt, weight); + } } else { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt, weight); } } - template - inline void fillPairQAStep(float deta, float dphi, float pairEta, - float cosTheta, float openingAngle) + template + void fillPairHistogramMC(TCollision const& /*collision*/, + ROOT::Math::PtEtaPhiMVector v1, + ROOT::Math::PtEtaPhiMVector v2, + float weight = 1.f) + { + + float rndm = std::pow(-1, dist01(engine) % 2); + auto k12 = 0.5 * (v1 + v2); + float kt = k12.Pt(); + float qinv = -(((v1 - v2) * rndm).M()); + + ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); + ROOT::Math::XYZVector uv_long(0, 0, 1); + ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); + + ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); + float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); + ROOT::Math::Boost bst_z(0, 0, -beta_z); + auto q12_lcms = bst_z((v1c - v2c) * rndm); + auto q3_lcms = q12_lcms.Vect(); + float qabs_lcms = q3_lcms.R(); + float qout_lcms = q3_lcms.Dot(uv_out); + float qside_lcms = q3_lcms.Dot(uv_side); + float qlong_lcms = q3_lcms.Dot(uv_long); + + constexpr auto mcDir = []() constexpr -> const char* { + if constexpr (ev_id == 0) { + if constexpr (TruthT == PairTruthType::TrueTrueDistinct) + return "Pair/same/MC/TrueTrueDistinct/"; + if constexpr (TruthT == PairTruthType::TrueTrueSamePhoton) + return "Pair/same/MC/TrueTrueSamePhoton/"; + if constexpr (TruthT == PairTruthType::SharedMcLeg) + return "Pair/same/MC/SharedMcLeg/"; + if constexpr (TruthT == PairTruthType::TrueFake) + return "Pair/same/MC/TrueFake/"; + if constexpr (TruthT == PairTruthType::FakeFake) + return "Pair/same/MC/FakeFake/"; + return "Pair/same/MC/Pi0Daughters/"; + } else { + if constexpr (TruthT == PairTruthType::TrueTrueDistinct) + return "Pair/mix/MC/TrueTrueDistinct/"; + if constexpr (TruthT == PairTruthType::TrueTrueSamePhoton) + return "Pair/mix/MC/TrueTrueSamePhoton/"; + if constexpr (TruthT == PairTruthType::SharedMcLeg) + return "Pair/mix/MC/SharedMcLeg/"; + if constexpr (TruthT == PairTruthType::TrueFake) + return "Pair/mix/MC/TrueFake/"; + if constexpr (TruthT == PairTruthType::FakeFake) + return "Pair/mix/MC/FakeFake/"; + return "Pair/mix/MC/Pi0Daughters/"; + } + }(); + + if (cfgDo3D) { + fRegistry.fill(HIST(mcDir) + HIST("CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); + if (cfgDo2D) { + fRegistry.fill(HIST(mcDir) + HIST("CF_2D"), + std::fabs(qout_lcms), std::fabs(qinv), kt, weight); + } + } else { + fRegistry.fill(HIST(mcDir) + HIST("CF_1D"), + cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + } + } + + template + PairQAObservables buildPairQAObservables(TG1 const& g1, TG2 const& g2) + { + PairQAObservables o{}; + + o.x1 = g1.vx(); + o.y1 = g1.vy(); + o.z1 = g1.vz(); + o.x2 = g2.vx(); + o.y2 = g2.vy(); + o.z2 = g2.vz(); + + o.r1 = std::sqrt(o.x1 * o.x1 + o.y1 * o.y1); + o.r2 = std::sqrt(o.x2 * o.x2 + o.y2 * o.y2); + + o.dx = o.x1 - o.x2; + o.dy = o.y1 - o.y2; + o.dz = o.z1 - o.z2; + + o.deltaR = std::fabs(o.r1 - o.r2); + o.deltaZ = o.dz; + o.deltaRxy = std::sqrt(o.dx * o.dx + o.dy * o.dy); + o.deltaR3D = std::sqrt(o.dx * o.dx + o.dy * o.dy + o.dz * o.dz); + + ROOT::Math::XYZVector cp1(o.x1, o.y1, o.z1); + ROOT::Math::XYZVector cp2(o.x2, o.y2, o.z2); + const float mag1 = std::sqrt(cp1.Mag2()); + const float mag2 = std::sqrt(cp2.Mag2()); + if (mag1 < 1e-12f || mag2 < 1e-12f) { + o.valid = false; + return o; + } + float cosPA = static_cast(cp1.Dot(cp2) / (mag1 * mag2)); + cosPA = std::clamp(cosPA, -1.f, 1.f); + o.opa = std::acos(cosPA); + o2::math_utils::bringTo02Pi(o.opa); + if (o.opa > o2::constants::math::PI) + o.opa -= o2::constants::math::PI; + o.cosOA = std::cos(o.opa / 2.f); + o.drOverCosOA = (std::fabs(o.cosOA) < 1e-12f) ? 1e12f : (o.deltaR3D / o.cosOA); + + o.v1 = ROOT::Math::PtEtaPhiMVector(g1.pt(), g1.eta(), g1.phi(), 0.f); + o.v2 = ROOT::Math::PtEtaPhiMVector(g2.pt(), g2.eta(), g2.phi(), 0.f); + o.k12 = 0.5f * (o.v1 + o.v2); + + o.deta = g1.eta() - g2.eta(); + o.dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); // dphi in [-pi, pi] + o.pairEta = 0.5f * (g1.eta() + g2.eta()); + o.pairPhi = RecoDecay::constrainAngle(o.k12.Phi(), 0.f); // pair phi in [0, 2pi] — matches axisPhi + o.kt = o.k12.Pt(); + o.qinv = std::fabs((o.v1 - o.v2).M()); + o.cosTheta = std::fabs(computeCosTheta(o.v1, o.v2)); + o.openingAngle = o.opa; + + return o; + } + + template + inline void fillPairQAStep(PairQAObservables const& o, float cent, float occupancy) { if (!qaflags.doPairQa) return; + constexpr auto base = qaPrefix(); + + // 1D: kinematics + fRegistry.fill(HIST(base) + HIST("hPairEta"), o.pairEta); + fRegistry.fill(HIST(base) + HIST("hPairPhi"), o.pairPhi); + fRegistry.fill(HIST(base) + HIST("hPairKt"), o.kt); + fRegistry.fill(HIST(base) + HIST("hQinv"), o.qinv); + + // 1D: angular + fRegistry.fill(HIST(base) + HIST("hDeltaEta"), o.deta); + fRegistry.fill(HIST(base) + HIST("hDeltaPhi"), o.dphi); + fRegistry.fill(HIST(base) + HIST("hCosTheta"), o.cosTheta); + fRegistry.fill(HIST(base) + HIST("hOpeningAngle"), o.openingAngle); + + // 1D: geometry + fRegistry.fill(HIST(base) + HIST("hR1"), o.r1); + fRegistry.fill(HIST(base) + HIST("hR2"), o.r2); + fRegistry.fill(HIST(base) + HIST("hDeltaR"), o.deltaR); + fRegistry.fill(HIST(base) + HIST("hDeltaZ"), o.deltaZ); + fRegistry.fill(HIST(base) + HIST("hDeltaRxy"), o.deltaRxy); + fRegistry.fill(HIST(base) + HIST("hDeltaR3D"), o.deltaR3D); + + // 1D: event + fRegistry.fill(HIST(base) + HIST("hCent"), cent); + fRegistry.fill(HIST(base) + HIST("hOccupancy"), occupancy); + + // 1D: ellipse value (diagnostic, conditional on cut being configured) const float sE = ggpaircuts.cfgEllipseSigEta.value; const float sP = ggpaircuts.cfgEllipseSigPhi.value; + if (sE > 1e-9f && sP > 1e-9f) { + const float ellipseVal = (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP); + fRegistry.fill(HIST(base) + HIST("hEllipseVal"), ellipseVal); + } - if constexpr (ev_id == 0 && IsBefore) { - fRegistry.fill(HIST("Pair/same/QA/Before/hDeltaEta"), deta); - fRegistry.fill(HIST("Pair/same/QA/Before/hDeltaPhi"), dphi); - fRegistry.fill(HIST("Pair/same/QA/Before/hDEtaDPhi"), deta, dphi); - fRegistry.fill(HIST("Pair/same/QA/Before/hDeltaEtaVsPairEta"), pairEta, deta); - fRegistry.fill(HIST("Pair/same/QA/Before/hCosTheta"), cosTheta); - fRegistry.fill(HIST("Pair/same/QA/Before/hOpeningAngle"), openingAngle); - if (sE > 1e-9f && sP > 1e-9f) - fRegistry.fill(HIST("Pair/same/QA/Before/hEllipseVal"), (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP)); - } else if constexpr (ev_id == 0 && !IsBefore) { - fRegistry.fill(HIST("Pair/same/QA/After/hDeltaEta"), deta); - fRegistry.fill(HIST("Pair/same/QA/After/hDeltaPhi"), dphi); - fRegistry.fill(HIST("Pair/same/QA/After/hDEtaDPhi"), deta, dphi); - fRegistry.fill(HIST("Pair/same/QA/After/hDeltaEtaVsPairEta"), pairEta, deta); - fRegistry.fill(HIST("Pair/same/QA/After/hCosTheta"), cosTheta); - fRegistry.fill(HIST("Pair/same/QA/After/hOpeningAngle"), openingAngle); - if (sE > 1e-9f && sP > 1e-9f) - fRegistry.fill(HIST("Pair/same/QA/After/hEllipseVal"), (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP)); - } else if constexpr (ev_id == 1 && IsBefore) { - fRegistry.fill(HIST("Pair/mix/QA/Before/hDeltaEta"), deta); - fRegistry.fill(HIST("Pair/mix/QA/Before/hDeltaPhi"), dphi); - fRegistry.fill(HIST("Pair/mix/QA/Before/hDEtaDPhi"), deta, dphi); - fRegistry.fill(HIST("Pair/mix/QA/Before/hDeltaEtaVsPairEta"), pairEta, deta); - fRegistry.fill(HIST("Pair/mix/QA/Before/hCosTheta"), cosTheta); - fRegistry.fill(HIST("Pair/mix/QA/Before/hOpeningAngle"), openingAngle); - if (sE > 1e-9f && sP > 1e-9f) - fRegistry.fill(HIST("Pair/mix/QA/Before/hEllipseVal"), (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP)); - } else { - fRegistry.fill(HIST("Pair/mix/QA/After/hDeltaEta"), deta); - fRegistry.fill(HIST("Pair/mix/QA/After/hDeltaPhi"), dphi); - fRegistry.fill(HIST("Pair/mix/QA/After/hDEtaDPhi"), deta, dphi); - fRegistry.fill(HIST("Pair/mix/QA/After/hDeltaEtaVsPairEta"), pairEta, deta); - fRegistry.fill(HIST("Pair/mix/QA/After/hCosTheta"), cosTheta); - fRegistry.fill(HIST("Pair/mix/QA/After/hOpeningAngle"), openingAngle); - if (sE > 1e-9f && sP > 1e-9f) - fRegistry.fill(HIST("Pair/mix/QA/After/hEllipseVal"), (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP)); + // 2D: angular + fRegistry.fill(HIST(base) + HIST("hDEtaDPhi"), o.deta, o.dphi); + fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsPairEta"), o.pairEta, o.deta); + + // 2D: geometry + fRegistry.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); + fRegistry.fill(HIST(base) + HIST("hDeltaRVsDeltaZ"), o.deltaR, o.deltaZ); + + // 2D: geometry vs kT (qinv variants live in FullRange/) + fRegistry.fill(HIST(base) + HIST("hDeltaRVsKt"), o.kt, o.deltaR); + fRegistry.fill(HIST(base) + HIST("hDeltaZVsKt"), o.kt, o.deltaZ); + + // 2D: angular vs geometry + fRegistry.fill(HIST(base) + HIST("hDeltaPhiVsDeltaR"), o.deltaR, o.dphi); + fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsDeltaR"), o.deltaR, o.deta); + fRegistry.fill(HIST(base) + HIST("hDeltaPhiVsDeltaZ"), o.deltaZ, o.dphi); + fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsDeltaZ"), o.deltaZ, o.deta); + + // 2D: vs event properties (qinv variants live in FullRange/) + fRegistry.fill(HIST(base) + HIST("hDeltaRVsCent"), cent, o.deltaR); + fRegistry.fill(HIST(base) + HIST("hDeltaRVsOccupancy"), occupancy, o.deltaR); + + // THnSparse (hSparseDeltaRDeltaZQinv lives in FullRange/) + fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiCent"), o.deta, o.dphi, cent); + fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiOcc"), o.deta, o.dphi, occupancy); + fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); + fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); + } + + template + static PhotonMCInfo buildPhotonMCInfo(TPhoton const& g, + TMCParticles const& mcParticles) + { + PhotonMCInfo info{}; + + const auto pos = g.template posTrack_as(); + const auto neg = g.template negTrack_as(); + + // PWGEM uses emmcparticle, not the standard mcParticle accessor + if (!pos.has_emmcparticle() || !neg.has_emmcparticle()) + return info; + + info.hasMC = true; + info.mcPosId = pos.emmcparticleId(); + info.mcNegId = neg.emmcparticleId(); + + const auto mcPos = pos.template emmcparticle_as(); + const auto mcNeg = neg.template emmcparticle_as(); + + if (!mcPos.has_mothers() || !mcNeg.has_mothers()) + return info; + + const int mothIdPos = mcPos.mothersIds()[0]; + const int mothIdNeg = mcNeg.mothersIds()[0]; + if (mothIdPos != mothIdNeg) + return info; + + info.sameMother = true; + info.motherId = mothIdPos; + + const auto mother = mcParticles.iteratorAt(mothIdPos); + info.motherPdg = mother.pdgCode(); + info.isTruePhoton = (info.motherPdg == 22); + info.isPhysicalPrimary = mother.isPhysicalPrimary(); + + return info; + } + + static PairTruthType classifyPairTruth(PhotonMCInfo const& m1, + PhotonMCInfo const& m2) + { + const bool t1 = m1.hasMC && m1.sameMother && m1.isTruePhoton; + const bool t2 = m2.hasMC && m2.sameMother && m2.isTruePhoton; + + if (m1.hasMC && m2.hasMC) { + if ((m1.mcPosId >= 0 && (m1.mcPosId == m2.mcPosId || m1.mcPosId == m2.mcNegId)) || + (m1.mcNegId >= 0 && (m1.mcNegId == m2.mcPosId || m1.mcNegId == m2.mcNegId))) + return PairTruthType::SharedMcLeg; + } + + if (!t1 && !t2) + return PairTruthType::FakeFake; + if (t1 != t2) + return PairTruthType::TrueFake; + + // Both are true photons — same or different MC photon? + if (m1.motherId >= 0 && m1.motherId == m2.motherId) + return PairTruthType::TrueTrueSamePhoton; + + return PairTruthType::TrueTrueDistinct; + } + + template + static bool isPi0DaughterPair(PhotonMCInfo const& m1, + PhotonMCInfo const& m2, + TMCParticles const& mcParticles) + { + if (!m1.isTruePhoton || !m2.isTruePhoton) + return false; + if (m1.motherId < 0 || m2.motherId < 0) + return false; + // The photons themselves must have the same grandmother = pi0 + const auto ph1 = mcParticles.iteratorAt(m1.motherId); + const auto ph2 = mcParticles.iteratorAt(m2.motherId); + if (!ph1.has_mothers() || !ph2.has_mothers()) + return false; + const int gm1 = ph1.mothersIds()[0]; + const int gm2 = ph2.mothersIds()[0]; + if (gm1 != gm2) + return false; + return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == 111); + } + + static constexpr std::string_view pairTruthLabel(PairTruthType t) + { + switch (t) { + case PairTruthType::TrueTrueDistinct: + return "TrueTrueDistinct/"; + case PairTruthType::TrueTrueSamePhoton: + return "TrueTrueSamePhoton/"; + case PairTruthType::SharedMcLeg: + return "SharedMcLeg/"; + case PairTruthType::TrueFake: + return "TrueFake/"; + case PairTruthType::FakeFake: + return "FakeFake/"; + case PairTruthType::Pi0Daughters: + return "Pi0Daughters/"; + default: + return "Unknown/"; + } + } + + void addMCHistograms() + { + const AxisSpec axisTruthType{{0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg,4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; + + static constexpr std::array kTypes = { + "TrueTrueDistinct/", + "TrueTrueSamePhoton/", + "SharedMcLeg/", + "TrueFake/", + "FakeFake/", + "Pi0Daughters/"}; + + for (const auto& label : kTypes) { + const std::string base = std::string("Pair/same/MC/") + std::string(label); + + if (cfgDo3D) { + fRegistry.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) { + fRegistry.add((base + "CF_2D").c_str(), "MC CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + } + } else { + if (cfgUseLCMS) { + fRegistry.add((base + "CF_1D").c_str(), "MC CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); + } else { + fRegistry.add((base + "CF_1D").c_str(), "MC CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); + } + } + + fRegistry.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistry.add((base + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); + fRegistry.add((base + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); + fRegistry.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistry.add((base + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); + fRegistry.add((base + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); + fRegistry.add((base + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); + fRegistry.add((base + "hKt").c_str(), "k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistry.add((base + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv};q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); + fRegistry.add((base + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv};q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); + fRegistry.add((base + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv};q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); + fRegistry.add((base + "hDEtaDPhiVsQinv").c_str(), "#Delta#eta vs #Delta#phi vs q_{inv};#Delta#eta;#Delta#phi;q_{inv}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisQinv}, true); + fRegistry.add((base + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv};|R_{1}-R_{2}| (cm);#Delta z (cm);q_{inv} (GeV/c)", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + } + + fRegistry.add("Pair/same/MC/hTruthTypeVsQinv", "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); + fRegistry.add("Pair/same/MC/hTruthTypeVsKt", "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); + } + + template + inline void fillMCPairQATyped(PairQAObservables const& obs) + { + constexpr auto base = []() constexpr -> const char* { + if constexpr (!IsMix) { + if constexpr (TruthT == PairTruthType::TrueTrueDistinct) + return "Pair/same/MC/TrueTrueDistinct/"; + if constexpr (TruthT == PairTruthType::TrueTrueSamePhoton) + return "Pair/same/MC/TrueTrueSamePhoton/"; + if constexpr (TruthT == PairTruthType::SharedMcLeg) + return "Pair/same/MC/SharedMcLeg/"; + if constexpr (TruthT == PairTruthType::TrueFake) + return "Pair/same/MC/TrueFake/"; + if constexpr (TruthT == PairTruthType::FakeFake) + return "Pair/same/MC/FakeFake/"; + return "Pair/same/MC/Pi0Daughters/"; + } else { + if constexpr (TruthT == PairTruthType::TrueTrueDistinct) + return "Pair/mix/MC/TrueTrueDistinct/"; + if constexpr (TruthT == PairTruthType::TrueTrueSamePhoton) + return "Pair/mix/MC/TrueTrueSamePhoton/"; + if constexpr (TruthT == PairTruthType::SharedMcLeg) + return "Pair/mix/MC/SharedMcLeg/"; + if constexpr (TruthT == PairTruthType::TrueFake) + return "Pair/mix/MC/TrueFake/"; + if constexpr (TruthT == PairTruthType::FakeFake) + return "Pair/mix/MC/FakeFake/"; + return "Pair/mix/MC/Pi0Daughters/"; + } + }(); + + fRegistry.fill(HIST(base) + HIST("hQinv"), obs.qinv); + fRegistry.fill(HIST(base) + HIST("hDeltaEta"), obs.deta); + fRegistry.fill(HIST(base) + HIST("hDeltaPhi"), obs.dphi); + fRegistry.fill(HIST(base) + HIST("hDEtaDPhi"), obs.deta, obs.dphi); + fRegistry.fill(HIST(base) + HIST("hDeltaR"), obs.deltaR); + fRegistry.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); + fRegistry.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); + fRegistry.fill(HIST(base) + HIST("hKt"), obs.kt); + + constexpr auto summaryDir = IsMix ? "Pair/mix/MC/" : "Pair/same/MC/"; + const int typeIdx = static_cast(TruthT); + fRegistry.fill(HIST(summaryDir) + HIST("hTruthTypeVsQinv"), obs.qinv, typeIdx); + fRegistry.fill(HIST(summaryDir) + HIST("hTruthTypeVsKt"), obs.kt, typeIdx); + } + + template + inline void fillMCPairQA(PairTruthType truthType, PairQAObservables const& obs) + { + switch (truthType) { + case PairTruthType::TrueTrueDistinct: + fillMCPairQATyped(obs); + break; + case PairTruthType::TrueTrueSamePhoton: + fillMCPairQATyped(obs); + break; + case PairTruthType::SharedMcLeg: + fillMCPairQATyped(obs); + break; + case PairTruthType::TrueFake: + fillMCPairQATyped(obs); + break; + case PairTruthType::FakeFake: + fillMCPairQATyped(obs); + break; + case PairTruthType::Pi0Daughters: + fillMCPairQATyped(obs); + break; + default: + break; + } + } + + template + inline void fillMCPairQAFullRangeTyped(PairQAObservables const& obs) + { + constexpr auto base = []() constexpr -> const char* { + if constexpr (!IsMix) { + if constexpr (TruthT == PairTruthType::TrueTrueDistinct) + return "Pair/same/MC/TrueTrueDistinct/"; + if constexpr (TruthT == PairTruthType::TrueTrueSamePhoton) + return "Pair/same/MC/TrueTrueSamePhoton/"; + if constexpr (TruthT == PairTruthType::SharedMcLeg) + return "Pair/same/MC/SharedMcLeg/"; + if constexpr (TruthT == PairTruthType::TrueFake) + return "Pair/same/MC/TrueFake/"; + if constexpr (TruthT == PairTruthType::FakeFake) + return "Pair/same/MC/FakeFake/"; + return "Pair/same/MC/Pi0Daughters/"; + } else { + if constexpr (TruthT == PairTruthType::TrueTrueDistinct) + return "Pair/mix/MC/TrueTrueDistinct/"; + if constexpr (TruthT == PairTruthType::TrueTrueSamePhoton) + return "Pair/mix/MC/TrueTrueSamePhoton/"; + if constexpr (TruthT == PairTruthType::SharedMcLeg) + return "Pair/mix/MC/SharedMcLeg/"; + if constexpr (TruthT == PairTruthType::TrueFake) + return "Pair/mix/MC/TrueFake/"; + if constexpr (TruthT == PairTruthType::FakeFake) + return "Pair/mix/MC/FakeFake/"; + return "Pair/mix/MC/Pi0Daughters/"; + } + }(); + + fRegistry.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); + fRegistry.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); + fRegistry.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); + fRegistry.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); + fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); + } + + template + inline void fillMCPairQAFullRange(PairTruthType truthType, PairQAObservables const& obs) + { + switch (truthType) { + case PairTruthType::TrueTrueDistinct: + fillMCPairQAFullRangeTyped(obs); + break; + case PairTruthType::TrueTrueSamePhoton: + fillMCPairQAFullRangeTyped(obs); + break; + case PairTruthType::SharedMcLeg: + fillMCPairQAFullRangeTyped(obs); + break; + case PairTruthType::TrueFake: + fillMCPairQAFullRangeTyped(obs); + break; + case PairTruthType::FakeFake: + fillMCPairQAFullRangeTyped(obs); + break; + case PairTruthType::Pi0Daughters: + fillMCPairQAFullRangeTyped(obs); + break; + default: + break; } } @@ -576,127 +1297,167 @@ struct photonhbt { initCCDB(collision); int ndiphoton = 0; + // ── Centrality selection ────────────────────────────────────────────── const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) continue; - const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; - float ep2 = epArr[cfgEP2EstimatorForMix]; + const std::array epArr = { + collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const float ep2 = epArr[cfgEP2EstimatorForMix]; + // ── Event QA and event cut ──────────────────────────────────────────── fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) continue; o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - // Mixing-bin indices — uses static binOf helper: - int zbin = binOf(ztxBinEdges, collision.posZ()); - int centbin = binOf(centBinEdges, cent[cfgCentEstimator]); - int epbin = binOf(epBinEgdes, ep2); - int occbin = binOf(occBinEdges, - cfgOccupancyEstimator == 1 - ? static_cast(collision.trackOccupancyInTimeRange()) - : collision.ft0cOccupancyInTimeRange()); + // ── Event mixing bins ───────────────────────────────────────────────── + const float occupancy = (cfgOccupancyEstimator == 1) + ? static_cast(collision.trackOccupancyInTimeRange()) + : collision.ft0cOccupancyInTimeRange(); + const float centForQA = cent[cfgCentEstimator]; + + const int zbin = binOf(ztxBinEdges, collision.posZ()); + const int centbin = binOf(centBinEdges, centForQA); + const int epbin = binOf(epBinEgdes, ep2); + const int occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); auto keyDFCollision = std::make_pair(ndf, collision.globalIndex()); + // ── Slice photons for this collision ────────────────────────────────── auto photons1Coll = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2Coll = photons2.sliceBy(perCollision2, collision.globalIndex()); - // ── Single-photon QA ───────────────────────────────────────────────── + // ── Single-photon QA if (qaflags.doSinglePhotonQa) { for (const auto& g : photons1Coll) { if (!cut1.template IsSelected(g)) continue; - fRegistry.fill(HIST("SinglePhoton/hPt"), g.pt()); - fRegistry.fill(HIST("SinglePhoton/hEta"), g.eta()); - fRegistry.fill(HIST("SinglePhoton/hPhi"), g.phi()); - fRegistry.fill(HIST("SinglePhoton/hEtaVsPhi"), g.phi(), g.eta()); + fillSinglePhotonQAStep<0>(g); } } + std::unordered_set photonIdsAfterDRCosOA; + std::unordered_set photonIdsAfterRZ; + std::unordered_set photonIdsAfterEllipse; + // ── Same-event pair loop ────────────────────────────────────────────── for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1Coll, photons2Coll))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) continue; - auto pos1 = g1.template posTrack_as(); - auto ele1 = g1.template negTrack_as(); - auto pos2 = g2.template posTrack_as(); - auto ele2 = g2.template negTrack_as(); - if (pos1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) + const auto pos1 = g1.template posTrack_as(); + const auto ele1 = g1.template negTrack_as(); + const auto pos2 = g2.template posTrack_as(); + const auto ele2 = g2.template negTrack_as(); + if (pos1.trackId() == pos2.trackId() || + pos1.trackId() == ele2.trackId() || + ele1.trackId() == pos2.trackId() || + ele1.trackId() == ele2.trackId()) + continue; + + auto obs = buildPairQAObservables(g1, g2); + if (!obs.valid) + continue; + + const bool doQA = passQinvQAGate(obs.qinv); + const bool doFullRange = passQinvFullRangeGate(obs.qinv); + + // ── QA: Before any pair cut ─────────────────────────────────────── + if (doQA) + fillPairQAStep<0, 0>(obs, centForQA, occupancy); + + // ── Cut 1: dr/cosOA ─────────────────────────────────────────────── + if (doFullRange) + fillFullRangeDeltaRCosOA<0>(obs.qinv, obs.drOverCosOA); + fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), obs.drOverCosOA); + if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - ROOT::Math::XYZVector cp1(g1.vx(), g1.vy(), g1.vz()); - ROOT::Math::XYZVector cp2(g2.vx(), g2.vy(), g2.vz()); - float dr = std::sqrt(std::pow(g1.vx() - g2.vx(), 2) + std::pow(g1.vy() - g2.vy(), 2) + std::pow(g1.vz() - g2.vz(), 2)); - float opa = std::acos(std::clamp(static_cast(cp1.Dot(cp2) / (std::sqrt(cp1.Mag2()) * std::sqrt(cp2.Mag2()))), -1.f, 1.f)); - o2::math_utils::bringTo02Pi(opa); - if (opa > o2::constants::math::PI) - opa -= o2::constants::math::PI; - float cosOA = std::cos(opa / 2.f); - if (dr / cosOA < ggpaircuts.cfgMinDR_CosOA) + photonIdsAfterDRCosOA.insert(g1.globalIndex()); + photonIdsAfterDRCosOA.insert(g2.globalIndex()); + + // ── QA: After dr/cosOA cut ──────────────────────────────────────── + if (doQA) + fillPairQAStep<0, 1>(obs, centForQA, occupancy); + + // ── Cut 2: R/Z geometry ─────────────────────────────────────────── + if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), dr / cosOA); - - // Kinematic variables for QA - ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); - ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); - float deta = g1.eta() - g2.eta(); - float dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); - float pairEta = 0.5f * (g1.eta() + g2.eta()); - float cosTheta = std::fabs(computeCosTheta(v1, v2)); - float openingAngle = opa; - - // ── QA: Before ellipse cut ────────────────────────────────────── - fillPairQAStep<0, true>(deta, dphi, pairEta, cosTheta, openingAngle); - - // ── Ellipse cut ───────────────────────────────────────────────── - if (isInsideEllipse(deta, dphi)) + + photonIdsAfterRZ.insert(g1.globalIndex()); + photonIdsAfterRZ.insert(g2.globalIndex()); + + // ── QA: After R/Z cut ───────────────────────────────────────────── + if (doQA) + fillPairQAStep<0, 2>(obs, centForQA, occupancy); + + // ── Cut 3: Ellipse in (DeltaEta, DeltaPhi) ──────────────────────── + if (isInsideEllipse(obs.deta, obs.dphi)) continue; - // ── QA: After ellipse cut ─────────────────────────────────────── - fillPairQAStep<0, false>(deta, dphi, pairEta, cosTheta, openingAngle); + photonIdsAfterEllipse.insert(g1.globalIndex()); + photonIdsAfterEllipse.insert(g2.globalIndex()); + + // ── QA: After ellipse cut = final accepted pairs ────────────────── + if (doQA) + fillPairQAStep<0, 3>(obs, centForQA, occupancy); + + if (doFullRange) + fillFullRangeQA<0>(obs, centForQA, occupancy); - // ── Physics ───────────────────────────────────────────────── - fillPairHistogram<0>(collision, v1, v2, 1.f); + fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); ndiphoton++; auto addToPool = [&](auto const& g) { - if (std::find(usedPhotonIdsPerCol.begin(), usedPhotonIdsPerCol.end(), - g.globalIndex()) == usedPhotonIdsPerCol.end()) { - EMPair gtmp(g.pt(), g.eta(), g.phi(), 0); + if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { + EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); emh1->AddTrackToEventPool(keyDFCollision, gtmp); - usedPhotonIdsPerCol.emplace_back(g.globalIndex()); } }; addToPool(g1); addToPool(g2); + } // end same-event pair loop - // end same-event pair loop + if (qaflags.doSinglePhotonQa) { + for (const auto& g : photons1Coll) { + if (!cut1.template IsSelected(g)) + continue; + const int gid = g.globalIndex(); + if (photonIdsAfterDRCosOA.count(gid)) + fillSinglePhotonQAStep<1>(g); + if (photonIdsAfterRZ.count(gid)) + fillSinglePhotonQAStep<2>(g); + if (photonIdsAfterEllipse.count(gid)) + fillSinglePhotonQAStep<3>(g); + } } usedPhotonIdsPerCol.clear(); - usedPhotonIdsPerCol.shrink_to_fit(); - // ── Mixed-event loop ──────────────────────────────────────────────────── - if (!cfgDoMix || !(ndiphoton > 0)) + if (!cfgDoMix || ndiphoton == 0) continue; auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); for (const auto& mixID : poolIDs) { + // skip same event if (mixID.second == collision.globalIndex() && mixID.first == ndf) continue; - uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; - uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); + const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; + const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - + std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); if (diffBC < ndiffBCMix) continue; @@ -706,40 +1467,53 @@ struct photonhbt { for (const auto& g1 : selectedPhotons) { for (const auto& g2 : poolPhotons) { - ROOT::Math::XYZVector cp1(g1.vx(), g1.vy(), g1.vz()); - ROOT::Math::XYZVector cp2(g2.vx(), g2.vy(), g2.vz()); - float dr = std::sqrt(std::pow(g1.vx() - g2.vx(), 2) + std::pow(g1.vy() - g2.vy(), 2) + std::pow(g1.vz() - g2.vz(), 2)); - float opa = std::acos(std::clamp(static_cast(cp1.Dot(cp2) / (std::sqrt(cp1.Mag2()) * std::sqrt(cp2.Mag2()))), -1.f, 1.f)); - o2::math_utils::bringTo02Pi(opa); - if (opa > o2::constants::math::PI) - opa -= o2::constants::math::PI; - float cosOA = std::cos(opa / 2.f); - if (dr / cosOA < ggpaircuts.cfgMinDR_CosOA) + auto obs = buildPairQAObservables(g1, g2); + if (!obs.valid) continue; - fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), dr / cosOA); - ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); - ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); - float deta = g1.eta() - g2.eta(); - float dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); - float pairEta = 0.5f * (g1.eta() + g2.eta()); - float cosTheta = std::fabs(computeCosTheta(v1, v2)); - float openingAngle = opa; + const bool doQA = passQinvQAGate(obs.qinv); + const bool doFullRange = passQinvFullRangeGate(obs.qinv); + + // ── QA: Before any pair cut ───────────────────────────────── + if (doQA) + fillPairQAStep<1, 0>(obs, centForQA, occupancy); + + // ── Cut 1: dr/cosOA ───────────────────────────────────────── + if (doFullRange) + fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); + fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); + if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) + continue; + + // ── QA: After dr/cosOA cut ────────────────────────────────── + if (doQA) + fillPairQAStep<1, 1>(obs, centForQA, occupancy); + + // ── Cut 2: R/Z geometry ───────────────────────────────────── + if (!passRZCut(obs.deltaR, obs.deltaZ)) + continue; - // QA Before cut — mix/QA/Before/ histograms. - fillPairQAStep<1, true>(deta, dphi, pairEta, cosTheta, openingAngle); + // ── QA: After R/Z cut ─────────────────────────────────────── + if (doQA) + fillPairQAStep<1, 2>(obs, centForQA, occupancy); - // Apply ellipse cut - if (isInsideEllipse(deta, dphi)) + // ── Cut 3: Ellipse ────────────────────────────────────────── + if (isInsideEllipse(obs.deta, obs.dphi)) continue; - // QA After cut - fillPairQAStep<1, false>(deta, dphi, pairEta, cosTheta, openingAngle); + // ── QA: After ellipse cut ─────────────────────────────────── + if (doQA) + fillPairQAStep<1, 3>(obs, centForQA, occupancy); - fillPairHistogram<1>(collision, v1, v2, 1.f); + // ── Full-range fills ──────────────────────────────────────── + if (doFullRange) + fillFullRangeQA<1>(obs, centForQA, occupancy); + + // ── Fill CF histogram — always ────────────────────────────── + fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); } } - } + } // end mixed-event loop if (ndiphoton > 0) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); @@ -749,36 +1523,311 @@ struct photonhbt { } // end collision loop } - using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMPair>; + using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler< + std::tuple, + std::pair, + EMPair>; + MyEMH* emh1 = nullptr; MyEMH* emh2 = nullptr; - std::vector usedPhotonIdsPerCol; + + std::unordered_set usedPhotonIdsPerCol; std::map, uint64_t> mapMixedEventIdToGlobalBC; SliceCache cache; Preslice perCollisionPCM = aod::v0photonkf::pmeventId; - Filter collisionFilterCentrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - Filter collisionFilterOccupancyTrack = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && - o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilterOccupancyFT0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && - o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + Filter collisionFilterCentrality = + (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || + (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || + (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + Filter collisionFilterOccupancyTrack = + eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && + o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + Filter collisionFilterOccupancyFT0c = + eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && + o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = soa::Filtered; int ndf = 0; - void processAnalysis(FilteredMyCollisions const& collisions, MyV0Photons const& v0photons, aod::V0Legs const& v0legs) + + void processAnalysis(FilteredMyCollisions const& collisions, + MyV0Photons const& v0photons, + aod::V0Legs const& v0legs) { - runPairing(collisions, v0photons, v0photons, v0legs, v0legs, - perCollisionPCM, perCollisionPCM, fV0PhotonCut, fV0PhotonCut); + runPairing(collisions, + v0photons, v0photons, + v0legs, v0legs, + perCollisionPCM, perCollisionPCM, + fV0PhotonCut, fV0PhotonCut); ndf++; } + PROCESS_SWITCH(photonhbt, processAnalysis, "pairing for analysis", true); + + template + void runPairingMC(TCollisions const& collisions, + TPhotons const& photons, + TLegs const& /*legs*/, + TMCParticles const& mcParticles, + TPreslice const& perCollision, + TCut const& cut) + { + for (const auto& collision : collisions) { + initCCDB(collision); + int ndiphoton = 0; + + const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; + if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) + continue; + + const std::array epArr = { + collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const float ep2 = epArr[cfgEP2EstimatorForMix]; + + fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); + o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); + if (!fEMEventCut.IsSelected(collision)) + continue; + + o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); + + const float occupancy = (cfgOccupancyEstimator == 1) + ? static_cast(collision.trackOccupancyInTimeRange()) + : collision.ft0cOccupancyInTimeRange(); + const float centForQA = cent[cfgCentEstimator]; + + const int zbin = binOf(ztxBinEdges, collision.posZ()); + const int centbin = binOf(centBinEdges, centForQA); + const int epbin = binOf(epBinEgdes, ep2); + const int occbin = binOf(occBinEdges, occupancy); + + auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); + auto keyDFCollision = std::make_pair(ndf, collision.globalIndex()); + + auto photonsColl = photons.sliceBy(perCollision, collision.globalIndex()); + + if (qaflags.doSinglePhotonQa) { + for (const auto& g : photonsColl) { + if (!cut.template IsSelected(g)) + continue; + fillSinglePhotonQAStep<0>(g); + } + } + + std::unordered_set photonIdsAfterDRCosOA; + std::unordered_set photonIdsAfterRZ; + std::unordered_set photonIdsAfterEllipse; + + // ── Same-event pair loop ────────────────────────────────────────────── + for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photonsColl, photonsColl))) { + if (!cut.template IsSelected(g1) || + !cut.template IsSelected(g2)) + continue; + + const auto pos1 = g1.template posTrack_as(); + const auto ele1 = g1.template negTrack_as(); + const auto pos2 = g2.template posTrack_as(); + const auto ele2 = g2.template negTrack_as(); + if (pos1.trackId() == pos2.trackId() || + pos1.trackId() == ele2.trackId() || + ele1.trackId() == pos2.trackId() || + ele1.trackId() == ele2.trackId()) + continue; + + // ── MC truth classification ─────────────────────────────────────── + const auto mc1 = buildPhotonMCInfo(g1, mcParticles); + const auto mc2 = buildPhotonMCInfo(g2, mcParticles); + auto truthType = classifyPairTruth(mc1, mc2); + if (truthType == PairTruthType::TrueTrueDistinct && + isPi0DaughterPair(mc1, mc2, mcParticles)) + truthType = PairTruthType::Pi0Daughters; + + auto obs = buildPairQAObservables(g1, g2); + if (!obs.valid) + continue; + + const bool doQA = passQinvQAGate(obs.qinv); + const bool doFullRange = passQinvFullRangeGate(obs.qinv); + + // ── Pair QA: Before ─────────────────────────────────────────────── + if (doQA) + fillPairQAStep<0, 0>(obs, centForQA, occupancy); + + // ── Cut 1: dr/cosOA ─────────────────────────────────────────────── + if (doFullRange) + fillFullRangeDeltaRCosOA<0>(obs.qinv, obs.drOverCosOA); + fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), obs.drOverCosOA); + if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) + continue; + + photonIdsAfterDRCosOA.insert(g1.globalIndex()); + photonIdsAfterDRCosOA.insert(g2.globalIndex()); + if (doQA) + fillPairQAStep<0, 1>(obs, centForQA, occupancy); + + // ── Cut 2: R/Z geometry ─────────────────────────────────────────── + if (!passRZCut(obs.deltaR, obs.deltaZ)) + continue; + + photonIdsAfterRZ.insert(g1.globalIndex()); + photonIdsAfterRZ.insert(g2.globalIndex()); + if (doQA) + fillPairQAStep<0, 2>(obs, centForQA, occupancy); + + // ── Cut 3: Ellipse ──────────────────────────────────────────────── + if (isInsideEllipse(obs.deta, obs.dphi)) + continue; + + photonIdsAfterEllipse.insert(g1.globalIndex()); + photonIdsAfterEllipse.insert(g2.globalIndex()); + if (doQA) + fillPairQAStep<0, 3>(obs, centForQA, occupancy); + + // ── Full-range fills ────────────────────────────────────────────── + if (doFullRange) + fillFullRangeQA<0>(obs, centForQA, occupancy); + + // ── Fill inclusive CF — always ──────────────────────────────────── + fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); + ndiphoton++; + + if (doQA) + fillMCPairQA(truthType, obs); + if (doFullRange) + fillMCPairQAFullRange(truthType, obs); + switch (truthType) { + case PairTruthType::TrueTrueDistinct: + fillPairHistogramMC<0, PairTruthType::TrueTrueDistinct>(collision, obs.v1, obs.v2); + break; + case PairTruthType::TrueTrueSamePhoton: + fillPairHistogramMC<0, PairTruthType::TrueTrueSamePhoton>(collision, obs.v1, obs.v2); + break; + case PairTruthType::SharedMcLeg: + fillPairHistogramMC<0, PairTruthType::SharedMcLeg>(collision, obs.v1, obs.v2); + break; + case PairTruthType::TrueFake: + fillPairHistogramMC<0, PairTruthType::TrueFake>(collision, obs.v1, obs.v2); + break; + case PairTruthType::FakeFake: + fillPairHistogramMC<0, PairTruthType::FakeFake>(collision, obs.v1, obs.v2); + break; + case PairTruthType::Pi0Daughters: + fillPairHistogramMC<0, PairTruthType::Pi0Daughters>(collision, obs.v1, obs.v2); + break; + default: + break; + } + + auto addToPool = [&](auto const& g) { + if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { + EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); + gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); + emh1->AddTrackToEventPool(keyDFCollision, gtmp); + } + }; + addToPool(g1); + addToPool(g2); + } // end same-event pair loop + + if (qaflags.doSinglePhotonQa) { + for (const auto& g : photonsColl) { + if (!cut.template IsSelected(g)) + continue; + const int gid = g.globalIndex(); + if (photonIdsAfterDRCosOA.count(gid)) + fillSinglePhotonQAStep<1>(g); + if (photonIdsAfterRZ.count(gid)) + fillSinglePhotonQAStep<2>(g); + if (photonIdsAfterEllipse.count(gid)) + fillSinglePhotonQAStep<3>(g); + } + } + + usedPhotonIdsPerCol.clear(); + + if (!cfgDoMix || ndiphoton == 0) + continue; + + auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); + auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); + + for (const auto& mixID : poolIDs) { + if (mixID.second == collision.globalIndex() && mixID.first == ndf) + continue; + const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; + const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - + std::min(collision.globalBC(), bcMix); + fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); + if (diffBC < ndiffBCMix) + continue; + + auto poolPhotons = emh1->GetTracksPerCollision(mixID); + for (const auto& g1 : selectedPhotons) { + for (const auto& g2 : poolPhotons) { + auto obs = buildPairQAObservables(g1, g2); + if (!obs.valid) + continue; + const bool doQA = passQinvQAGate(obs.qinv); + const bool doFullRange = passQinvFullRangeGate(obs.qinv); + if (doQA) + fillPairQAStep<1, 0>(obs, centForQA, occupancy); + if (doFullRange) + fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); + fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); + if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) + continue; + if (doQA) + fillPairQAStep<1, 1>(obs, centForQA, occupancy); + if (!passRZCut(obs.deltaR, obs.deltaZ)) + continue; + if (doQA) + fillPairQAStep<1, 2>(obs, centForQA, occupancy); + if (isInsideEllipse(obs.deta, obs.dphi)) + continue; + if (doQA) + fillPairQAStep<1, 3>(obs, centForQA, occupancy); + if (doFullRange) + fillFullRangeQA<1>(obs, centForQA, occupancy); + fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); + } + } + } + + if (ndiphoton > 0) { + emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); + emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); + mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); + } + } // end collision loop + } + + void processMC(FilteredMyCollisions const& collisions, + MyV0Photons const& v0photons, + MyMCV0Legs const& v0legs, + aod::EMMCParticles const& mcParticles, + aod::EMMCEvents const& /*mcEvents*/) + { + runPairingMC(collisions, v0photons, v0legs, mcParticles, + perCollisionPCM, fV0PhotonCut); + ndf++; + } + + PROCESS_SWITCH(photonhbt, processMC, "pairing with MC truth classification", false); }; +// ============================================================================ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"photonhbt"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"photonhbt"})}; } From 4dc666a966f5720c5e2dde587c0e4bb4964a2aa4 Mon Sep 17 00:00:00 2001 From: Marta Urioni <78807256+murioni@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:23:49 +0100 Subject: [PATCH 017/282] [PWGLF] heavyionmultiplicity - FT0M multiplicity, split events (#15472) Co-authored-by: ALICE Action Bot --- .../heavyionMultiplicity.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index 5c820ca6676..d6f8a6df09f 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -343,6 +343,10 @@ struct HeavyionMultiplicity { histos.add("hMultEta05vsCentrRec", "multiplicity in eta<0.5 of selected MC events vs centrality", kTH2F, {axisCent, multAxis}); histos.add("hgendndetaVsMultEta05BeforeEvtSel", "hgendndetaBeforeEvtSel vs multiplicity in eta<0.5", kTH2F, {axisEta, multAxis}); histos.add("hgendndetaVsMultEta05AfterEvtSel", "hgendndetaAfterEvtSel vs multiplicity in eta<0.5", kTH2F, {axisEta, multAxis}); + histos.add("hImpactParameterSplit", "Impact parameter of selected and split MC events", kTH1F, {impactParAxis}); + histos.add("hMultEta05Split", "multiplicity in eta<0.5 of selected and split MC events", kTH1F, {multAxis}); + histos.add("hMultSplit", "multiplicity of selected and split MC events", kTH1F, {axisFt0cMult}); + histos.add("hMultvsCentrSplit", "multiplicity of selected and split MC events vs centrality ", kTH2F, {axisCent, axisFt0cMult}); histos.add("hMultGen", "multiplicity of generated MC events", kTH1F, {axisFt0cMult}); histos.add("hMultRec", "multiplicity of selected MC events", kTH1F, {axisFt0cMult}); @@ -462,8 +466,9 @@ struct HeavyionMultiplicity { auto cent = -1; if (isApplyCentFT0C) { cent = col.multMCFT0C(); - } - if (isApplyCentFV0A) { + } else if (isApplyCentFT0M) { + cent = (col.multMCFT0C() + col.multMCFT0A()) / 2.; + } else if (isApplyCentFV0A) { cent = col.multMCFV0A(); } return cent; @@ -990,6 +995,12 @@ struct HeavyionMultiplicity { if (std::abs(RecCol.posZ()) >= vtxRange) { continue; } + + histos.fill(HIST("hImpactParameterSplit"), mcCollision.impactParameter()); + histos.fill(HIST("hMultEta05Split"), mcCollision.multMCNParticlesEta05()); + histos.fill(HIST("hMultSplit"), selColMultMC(mcCollision)); + histos.fill(HIST("hMultvsCentrSplit"), selColCent(RecCol), selColMultMC(mcCollision)); + if (RecCol.numContrib() <= numcontributors) { continue; } else { From 86454aad1e9ec0fa91dd157abad0cf036d046f74 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Sat, 21 Mar 2026 09:15:29 +0100 Subject: [PATCH 018/282] [PWGCF] add resonances (#15470) --- .../Tasks/flowGenericFramework.cxx | 712 ++++++++++++++++-- 1 file changed, 649 insertions(+), 63 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index de8731f61ca..e848d353761 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -22,19 +22,30 @@ #include "GFWWeights.h" #include "GFWWeightsList.h" +#include "PWGLF/DataModel/EPCalibrationTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "Common/Core/RecoDecay.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 "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" #include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/PID.h" +#include "ReconstructionDataFormats/Track.h" #include #include #include @@ -46,6 +57,7 @@ #include #include +#include #include #include #include @@ -85,6 +97,31 @@ std::vector multGlobalV0ACutPars; std::vector multGlobalT0ACutPars; } // namespace o2::analysis::gfw +template +auto projectMatrix(Array2D const& mat, std::array& array1, std::array& array2, std::array& array3) +{ + for (auto j = 0; j < static_cast(mat.cols); ++j) { + array1[j] = mat(0, j); + array2[j] = mat(1, j); + array3[j] = mat(2, j); + } + return; +} +template +auto readMatrix(Array2D const& mat, P& array) +{ + for (auto i = 0; i < static_cast(mat.rows); ++i) { + for (auto j = 0; j < static_cast(mat.cols); ++j) { + array[i][j] = mat(i, j); + } + } + + return; +} + +static constexpr float LongArrayFloat[3][20] = {{1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {2.1, 2.2, 2.3, -2.1, -2.2, -2.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {3.1, 3.2, 3.3, -3.1, -3.2, -3.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}}; +static constexpr int LongArrayInt[3][20] = {{1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}, {2, 2, 2, -2, -2, -2, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}, {3, 3, 3, -3, -3, -3, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}}; + struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") @@ -105,6 +142,7 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgPtmax, float, 10, "maximum pt (GeV/c)"); O2_DEFINE_CONFIGURABLE(cfgEta, float, 0.8, "eta cut"); O2_DEFINE_CONFIGURABLE(cfgEtaPtPt, float, 0.4, "eta cut for pt-pt correlations"); + O2_DEFINE_CONFIGURABLE(cfgUsePIDTotal, bool, false, "use fraction of PID total"); O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10, "vertex cut (cm)"); struct : ConfigurableGroup { O2_DEFINE_CONFIGURABLE(cfgDCAxyNSigma, float, 7, "Cut on number of sigma deviations from expected DCA in the transverse direction"); @@ -151,9 +189,22 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgGlobalT0ALowSigma, float, -3., "Number of sigma deviations below expected value in global vs T0A correlation"); O2_DEFINE_CONFIGURABLE(cfgGlobalT0AHighSigma, float, 4, "Number of sigma deviations above expected value in global vs T0A correlation"); } cfgGlobalAsideCorrCuts; - struct ConfigurableGroup { + struct : ConfigurableGroup { + Configurable> nSigmas{"nSigmas", {LongArrayFloat[0], 3, 6, {"TPC", "TOF", "ITS"}, {"pos_pi", "pos_ka", "pos_pr", "neg_pi", "neg_ka", "neg_pr"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"}; + Configurable> resonanceCuts{"resonanceCuts", {LongArrayFloat[0], 3, 11, {"K0", "Lambda", "Phi"}, {"cos_PAs", "massMin", "massMax", "PosTrackPt", "NegTrackPt", "DCAPosToPVMin", "DCANegToPVMin", "Lifetime", "RadiusMin", "RadiusMax", "Rapidity"}}, "Labeled array (float) for various cuts on resonances"}; + Configurable> resonanceSwitches{"resonanceSwitches", {LongArrayInt[0], 3, 6, {"K0", "Lambda", "Phi"}, {"UseParticle", "UseCosPA", "NMassBins", "DCABetDaug", "UseProperLifetime", "UseV0Radius"}}, "Labeled array (int) for various cuts on resonances"}; + O2_DEFINE_CONFIGURABLE(cfgUseLsPhi, bool, true, "Use LikeSign for Phi v2") + O2_DEFINE_CONFIGURABLE(cfgUseOnlyTPC, bool, true, "Use only TPC PID for daughter selection") + O2_DEFINE_CONFIGURABLE(cfgFakeKaonCut, float, 0.1f, "Maximum difference in measured momentum and TPC inner ring momentum of particle") + O2_DEFINE_CONFIGURABLE(cfgUseAsymmetricPID, bool, false, "Use asymmetric PID cuts") + O2_DEFINE_CONFIGURABLE(cfgTPCNsigmaCut, float, 3.0f, "TPC N-sigma cut for pions, kaons, protons") O2_DEFINE_CONFIGURABLE(cfgUseStrictPID, bool, true, "Use strict PID cuts for TPC") O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5, "pt cut on TOF for PID"); + O2_DEFINE_CONFIGURABLE(cfgUseItsPID, bool, true, "Use ITS PID for particle identification") + O2_DEFINE_CONFIGURABLE(cfgK0SignalMin, float, 0.48, "Minimum cut on K0 mT signal (upper limit of left sideband)"); + O2_DEFINE_CONFIGURABLE(cfgK0SignalMax, float, 0.51, "Minimum cut on K0 mT signal (lower limit of right sideband)"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMin, float, 1.1, "Minimum cut on Lambda mT signal (upper limit of left sideband)"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMax, float, 1.3, "Minimum cut on Lambda mT signal (lower limit of right sideband)"); } cfgPIDCuts; Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; @@ -162,10 +213,14 @@ struct FlowGenericFramework { Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}", "refFull {2 2 -2 -2}"}, {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"}, {0, 0, 0, 0, 0}, {15, 1, 1, 0, 0}}, "Configurations for each correlation to calculate"}; Configurable cfgCorrConfigRadial{"cfgCorrConfigRadial", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; - // #include "PWGCF/TwoParticleCorrelations/TableProducer/Productions/skimmingconf_20221115.cxx" // NOLINT + ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; + ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; + // Connect to ccdb Service ccdb; + o2::aod::ITSResponse itsResponse; + struct Config { TH1D* mEfficiency = nullptr; std::vector mAcceptance; @@ -181,6 +236,12 @@ struct FlowGenericFramework { OutputObj fFCgen{FlowContainer("FlowContainer_gen")}; HistogramRegistry registry{"registry"}; + std::array, 3> resoCutVals; + std::array, 3> resoSwitchVals; + std::array tofNsigmaCut; + std::array itsNsigmaCut; + std::array tpcNsigmaCut; + std::vector fFCpts = {&(*fFCpt_ch), &(*fFCpt_pi), &(*fFCpt_ka), &(*fFCpt_pr)}; // QA outputs @@ -249,6 +310,52 @@ struct FlowGenericFramework { {cfgEventCutFlags.cfgIsVertexITSTPC, kIsVertexITSTPC, o2::aod::evsel::kNoTimeFrameBorder}, {cfgEventCutFlags.cfgIsGoodITSLayersAll, kIsGoodITSLayersAll, o2::aod::evsel::kNoITSROFrameBorder}, }; + enum Particles { + PIONS, + KAONS, + PROTONS + }; + enum OutputSpecies { + K0 = 0, + LAMBDA = 1, + PHI = 2, + ANLAMBDA = 3, + REF = 4, + kCount_OutputSpecies + }; + enum ParticleCuts { + kCosPA = 0, + kMassMin, + kMassMax, + kPosTrackPt, + kNegTrackPt, + kDCAPosToPVMin, + kDCANegToPVMin, + kLifeTime, + kRadiusMin, + kRadiusMax, + kRapidity + }; + enum ParticleSwitches { + kUseParticle = 0, + kUseCosPA, + kMassBins, + kDCABetDaug, + kUseProperLifetime, + kUseV0Radius + }; + enum V0Selection { + kFillCandidate = 0, + kFillDaughterPt, + kFillMassCut, + kFillRapidityCut, + kFillDCAtoPV, + kFillDCAxDaughters, + kFillV0Radius, + kFillCosPA, + kFillProperLifetime, + kFillDaughterTrackSelection + }; // Define global variables // Generic Framework @@ -336,6 +443,11 @@ struct FlowGenericFramework { o2::analysis::gfw::multGlobalV0ACutPars = cfgGlobalAsideCorrCuts.cfgMultGlobalV0ACutPars; o2::analysis::gfw::multGlobalT0ACutPars = cfgGlobalAsideCorrCuts.cfgMultGlobalT0ACutPars; + projectMatrix(cfgPIDCuts.nSigmas->getData(), tpcNsigmaCut, tofNsigmaCut, itsNsigmaCut); + readMatrix(cfgPIDCuts.resonanceCuts->getData(), resoCutVals); + readMatrix(cfgPIDCuts.resonanceSwitches->getData(), resoSwitchVals); + PrintResoCuts(); + AxisSpec phiAxis = {o2::analysis::gfw::phibins, o2::analysis::gfw::philow, o2::analysis::gfw::phiup, "#phi"}; AxisSpec phiModAxis = {100, 0, constants::math::PI / 9, "fmod(#varphi,#pi/9)"}; AxisSpec etaAxis = {o2::analysis::gfw::etabins, -cfgEta, cfgEta, "#eta"}; @@ -359,6 +471,7 @@ struct FlowGenericFramework { : centAxis; AxisSpec dcaZAXis = {200, -2, 2, "DCA_{z} (cm)"}; AxisSpec dcaXYAXis = {200, -1, 1, "DCA_{xy} (cm)"}; + AxisSpec singleCount = {1, 0, 1}; ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -389,6 +502,8 @@ struct FlowGenericFramework { registry.addClone("trackQA/before/", "trackQA/after/"); registry.add("trackQA/after/pt_ref", "", {HistType::kTH1D, {{100, o2::analysis::gfw::ptreflow, o2::analysis::gfw::ptrefup}}}); registry.add("trackQA/after/pt_poi", "", {HistType::kTH1D, {{100, o2::analysis::gfw::ptpoilow, o2::analysis::gfw::ptpoiup}}}); + registry.add("trackQA/after/Nch_corrected", "", {HistType::kTH1D, {nchAxis}}); + registry.add("trackQA/after/Nch_uncorrected", "", {HistType::kTH1D, {nchAxis}}); registry.add("eventQA/before/centrality", "; centrality (%); Counts", {HistType::kTH1D, {centAxis}}); registry.add("eventQA/before/multiplicity", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); @@ -401,23 +516,33 @@ struct FlowGenericFramework { registry.add("eventQA/before/multT0C_centT0C", "; multT0C; FT0C centrality (%)", {HistType::kTH2D, {centAxis, t0cAxis}}); registry.add("eventQA/before/occ_mult_cent", "; occupancy; N_{ch}; centrality (%)", {HistType::kTH3D, {occAxis, nchAxis, centAxis}}); registry.addClone("eventQA/before/", "eventQA/after/"); - registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{11, 0, 11}}}); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(1, "Filtered event"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(2, "sel8"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(3, "occupancy"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(4, "kTVXinTRD"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(9, "kIsGoodITSLayersAll"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(10, "after Mult cuts"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(11, "has track + within cent"); - - registry.add("npt_ch", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTH2D, {ptAxis, centAxis}}); - registry.add("npt_pi", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTH2D, {ptAxis, centAxis}}); - registry.add("npt_ka", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTH2D, {ptAxis, centAxis}}); - registry.add("npt_pr", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTH2D, {ptAxis, centAxis}}); + registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{15, 0.5, 15.5}}}); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kFilteredEvent, "Filtered event"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kSel8, "sel8"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kOccupancy, "occupancy"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTVXinTRD, "kTVXinTRD"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoSameBunchPileup, "kNoSameBunchPileup"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodZvtxFT0vsPV, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInTimeRangeStandard, "kNoCollInTimeRangeStandard"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInRofStandard, "kNoCollInRofStandard"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoHighMultCollInPrevRof, "kNoHighMultCollInPrevRof"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoTimeFrameBorder, "kNoTimeFrameBorder"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoITSROFrameBorder, "kNoITSROFrameBorder"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsVertexITSTPC, "kIsVertexITSTPC"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodITSLayersAll, "kIsGoodITSLayersAll"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kMultCuts, "after Mult cuts"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTrackCent, "has track + within cent"); + + registry.add("npt_ch", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_pi", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_ka", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_pr", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_K0_sig", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_K0_sb1", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_K0_sb2", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_Lambda_sig", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_Lambda_sb1", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("npt_Lambda_sb2", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); if (!cfgRunByRun) { if (cfgUsePID) { @@ -431,8 +556,62 @@ struct FlowGenericFramework { } } - registry.add("trackQA/after/Nch_corrected", "", {HistType::kTH1D, {nchAxis}}); - registry.add("trackQA/after/Nch_uncorrected", "", {HistType::kTH1D, {nchAxis}}); + AxisSpec axisK0Mass = {resoSwitchVals[K0][kMassBins], resoCutVals[K0][kMassMin], resoCutVals[K0][kMassMax]}; + AxisSpec axisLambdaMass = {resoSwitchVals[LAMBDA][kMassBins], resoCutVals[LAMBDA][kMassMin], resoCutVals[LAMBDA][kMassMax]}; + + // QA histograms for V0s + if (resoSwitchVals[K0][kUseParticle]) { + registry.add("K0/PiPlusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registry.add("K0/PiMinusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registry.add("K0/PiPlusTOF_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registry.add("K0/PiMinusTOF_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registry.add("K0/hK0Phi", "", {HistType::kTH1D, {phiAxis}}); + registry.add("K0/hK0Eta", "", {HistType::kTH1D, {etaAxis}}); + registry.add("K0/hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, ptAxis, nchAxis}}}); + registry.add("K0/hK0s", "", {HistType::kTH1D, {singleCount}}); + + registry.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCandidate, "K0 candidates"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDaughterPt, "Daughter pt"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillMassCut, "Mass cut"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillRapidityCut, "Rapidity cut"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDCAtoPV, "DCA to PV"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDCAxDaughters, "DCA between daughters"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillV0Radius, "V0radius"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCosPA, "CosPA"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillProperLifetime, "Proper lifetime"); + registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDaughterTrackSelection, "Daughter track selection"); + } + + if (resoSwitchVals[LAMBDA][kUseParticle]) { + registry.add("Lambda/PrPlusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registry.add("Lambda/PiMinusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registry.add("Lambda/PrPlusTOF_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registry.add("Lambda/PiMinusTOF_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registry.add("Lambda/hLambdaPhi", "", {HistType::kTH1D, {phiAxis}}); + registry.add("Lambda/hLambdaEta", "", {HistType::kTH1D, {etaAxis}}); + registry.add("Lambda/hLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); + registry.add("Lambda/PiPlusTPC_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registry.add("Lambda/PrMinusTPC_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registry.add("Lambda/PiPlusTOF_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registry.add("Lambda/PrMinusTOF_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registry.add("Lambda/hAntiLambdaPhi", "", {HistType::kTH1D, {phiAxis}}); + registry.add("Lambda/hAntiLambdaEta", "", {HistType::kTH1D, {etaAxis}}); + registry.add("Lambda/hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); + registry.add("Lambda/hLambdas", "", {HistType::kTH1D, {singleCount}}); + + registry.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCandidate, "Lambda candidates"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDaughterPt, "Daughter pt"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillMassCut, "Mass cut"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillRapidityCut, "Rapidity cut"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDCAtoPV, "DCA to PV"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDCAxDaughters, "DCA between daughters"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillV0Radius, "V0radius"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCosPA, "CosPA"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillProperLifetime, "Proper lifetime"); + registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDaughterTrackSelection, "Daughter track selection"); + } } if (o2::analysis::gfw::regions.GetSize() < 0) @@ -546,6 +725,70 @@ struct FlowGenericFramework { static constexpr std::string_view FillTimeName[] = {"before/", "after/"}; + void PrintResoCuts() + { + auto printTable = [](const auto& lbl, const auto& valuesMatrix, const std::string& title) { + LOGF(info, "===== %s =====", title.c_str()); + + size_t nRows = lbl.labels_rows.size(); + size_t nCols = lbl.labels_cols.size(); + + // Compute column widths: max of header or value string length + std::vector colWidths(nCols); + for (size_t c = 0; c < nCols; ++c) { + size_t maxValLen = 0; + for (size_t r = 0; r < nRows; ++r) { + std::ostringstream oss; + oss << std::fixed << std::setprecision(2) << valuesMatrix[r][c]; + maxValLen = std::max(maxValLen, oss.str().length()); + } + colWidths[c] = std::max(lbl.labels_cols[c].size(), maxValLen); + } + + // Determine row label width + size_t rowLabelWidth = 0; + for (const auto& rowName : lbl.labels_rows) + rowLabelWidth = std::max(rowLabelWidth, rowName.size()); + rowLabelWidth += 2; // for ": " + + // Print header + std::ostringstream header; + header << std::setw(rowLabelWidth) << " "; + for (size_t c = 0; c < nCols; ++c) + header << std::setw(colWidths[c]) << lbl.labels_cols[c] << " "; + LOGF(info, "%s", header.str().c_str()); + + // Print rows + for (size_t r = 0; r < nRows; ++r) { + std::ostringstream line; + line << std::setw(rowLabelWidth) << (lbl.labels_rows[r] + ":"); + for (size_t c = 0; c < nCols; ++c) { + line << std::setw(colWidths[c]) << std::fixed << std::setprecision(2) << valuesMatrix[r][c] << " "; + } + LOGF(info, "%s", line.str().c_str()); + } + }; + + // ----- nSigma PID ----- + // Map arrays into a 2D vector + std::vector> nSigmaVals = { + std::vector(tpcNsigmaCut.begin(), tpcNsigmaCut.end()), + std::vector(tofNsigmaCut.begin(), tofNsigmaCut.end()), + std::vector(itsNsigmaCut.begin(), itsNsigmaCut.end())}; + printTable(cfgPIDCuts.nSigmas.value, nSigmaVals, "nSigma PID Cuts"); + + // ----- Resonance Cuts ----- + std::vector> resoCutsVals(resoCutVals.size()); + for (size_t r = 0; r < resoCutVals.size(); ++r) + resoCutsVals[r] = std::vector(resoCutVals[r].begin(), resoCutVals[r].end()); + printTable(cfgPIDCuts.resonanceCuts.value, resoCutsVals, "Resonance Cuts"); + + // ----- Resonance Switches ----- + std::vector> resoSwitchValsF(resoSwitchVals.size()); + for (size_t r = 0; r < resoSwitchVals.size(); ++r) + resoSwitchValsF[r] = std::vector(resoSwitchVals[r].begin(), resoSwitchVals[r].end()); + printTable(cfgPIDCuts.resonanceSwitches.value, resoSwitchValsF, "Resonance Switches"); + } enum QAFillTime { kBefore, kAfter @@ -664,6 +907,56 @@ struct FlowGenericFramework { return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton } + template + int getNsigmaPIDAssymmetric(TTrack track) + { + // Computing Nsigma arrays for pion, kaon, and protons + std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + std::array nSigmaTOF = {track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr()}; + std::array nSigmaITS = {itsResponse.nSigmaITS(track), itsResponse.nSigmaITS(track), itsResponse.nSigmaITS(track)}; + int pid = -1; + + std::array nSigmaToUse = cfgPIDCuts.cfgUseItsPID ? nSigmaITS : nSigmaTPC; // Choose which nSigma to use: TPC or ITS + std::array detectorNsigmaCut = cfgPIDCuts.cfgUseItsPID ? itsNsigmaCut : tpcNsigmaCut; // Choose which nSigma to use: TPC or ITS + + bool isPion, isKaon, isProton; + bool isDetectedPion = nSigmaToUse[0] < detectorNsigmaCut[0] && nSigmaToUse[0] > detectorNsigmaCut[0 + 3]; + bool isDetectedKaon = nSigmaToUse[1] < detectorNsigmaCut[1] && nSigmaToUse[1] > detectorNsigmaCut[1 + 3]; + bool isDetectedProton = nSigmaToUse[2] < detectorNsigmaCut[2] && nSigmaToUse[2] > detectorNsigmaCut[2 + 3]; + + bool isTofPion = nSigmaTOF[0] < tofNsigmaCut[0] && nSigmaTOF[0] > tofNsigmaCut[0 + 3]; + bool isTofKaon = nSigmaTOF[1] < tofNsigmaCut[1] && nSigmaTOF[1] > tofNsigmaCut[1 + 3]; + bool isTofProton = nSigmaTOF[2] < tofNsigmaCut[2] && nSigmaTOF[2] > tofNsigmaCut[2 + 3]; + + if (track.pt() > cfgPIDCuts.cfgTofPtCut && !track.hasTOF()) { + return 0; + } else if (track.pt() > cfgPIDCuts.cfgTofPtCut && track.hasTOF()) { + isPion = isTofPion && isDetectedPion; + isKaon = isTofKaon && isDetectedKaon; + isProton = isTofProton && isDetectedProton; + } else { + isPion = isDetectedPion; + isKaon = isDetectedKaon; + isProton = isDetectedProton; + } + + if ((isPion && isKaon) || (isPion && isProton) || (isKaon && isProton)) { + return 0; // more than one particle satisfy the criteria + } + + if (isPion) { + pid = PIONS; + } else if (isKaon) { + pid = KAONS; + } else if (isProton) { + pid = PROTONS; + } else { + return 0; // no particle satisfies the criteria + } + + return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton + } + template bool eventSelected(TCollision collision, const int multTrk, const float& centrality, const int run) { @@ -872,7 +1165,8 @@ struct FlowGenericFramework { struct AcceptedTracks { explicit AcceptedTracks(std::size_t nptbins) - : nch(nptbins, 0.f), + : pidtotal{0, 0, 0}, + nch(nptbins, 0.f), npi(nptbins, 0.f), nka(nptbins, 0.f), npr(nptbins, 0.f) @@ -882,6 +1176,7 @@ struct FlowGenericFramework { float total = 0; unsigned int total_uncorr = 0; + std::vector pidtotal; std::vector nch; std::vector npi; std::vector nka; @@ -898,7 +1193,6 @@ struct FlowGenericFramework { if (!cfgUseGapMethod) container->fillVnPtStdProfiles(centmult, rndm); } - for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { if (!corrconfigs.at(l_ind).pTDif) { auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); @@ -924,35 +1218,39 @@ struct FlowGenericFramework { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, dnx, rndm); } } + float chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; - int total = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; - - if (total == 0) - return; - - for (std::size_t i = 0; i < acceptedtracks.nch.size(); ++i) - registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i + 1), centmult, acceptedtracks.nch[i] / total); - for (std::size_t i = 0; i < acceptedtracks.npi.size(); ++i) - registry.fill(HIST("npt_pi"), fPtAxis->GetBinCenter(i + 1), centmult, acceptedtracks.npi[i] / total); - for (std::size_t i = 0; i < acceptedtracks.nka.size(); ++i) - registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i + 1), centmult, acceptedtracks.nka[i] / total); - for (std::size_t i = 0; i < acceptedtracks.npr.size(); ++i) - registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, acceptedtracks.npr[i] / total); - + // calculate fractions std::vector> inputs = {acceptedtracks.nch, acceptedtracks.npi, acceptedtracks.nka, acceptedtracks.npr}; std::vector> fractions; fractions.reserve(inputs.size()); - + int pidcounter = 0; for (const auto& vec : inputs) { fractions.emplace_back(); fractions.back().reserve(vec.size()); + float total = chtotal; + if (cfgUsePIDTotal) + (pidcounter) ? acceptedtracks.pidtotal[pidcounter] : chtotal; + + if (total == 0.) { + ++pidcounter; + continue; + } std::transform(vec.begin(), vec.end(), std::back_inserter(fractions.back()), [&](double x) { return x / total; }); + ++pidcounter; } - - for (uint l_ind = 0; l_ind < corrconfigsradial.size(); ++l_ind) { + for (std::size_t i = 0; i < fractions[0].size(); ++i) + registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[0][i]); + for (std::size_t i = 0; i < fractions[1].size(); ++i) + registry.fill(HIST("npt_pi"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[1][i]); + for (std::size_t i = 0; i < fractions[2].size(); ++i) + registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[2][i]); + for (std::size_t i = 0; i < fractions[3].size(); ++i) + registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[3][i]); + for (uint l_ind = 0; l_ind < 4; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) @@ -962,21 +1260,20 @@ struct FlowGenericFramework { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm); } } - return; } - template - void processCollision(TCollision collision, TTracks tracks, const float& centrality, const int field, const int run) + template + void processCollision(TCollision collision, TTracks tracks, TV0s v0s, const float& centrality, const int field, const int run) { if (tracks.size() < 1) return; if (dt != kGen && (centrality < o2::analysis::gfw::centbinning.front() || centrality > o2::analysis::gfw::centbinning.back())) return; if (dt != kGen) { - registry.fill(HIST("eventQA/eventSel"), 10.5); + registry.fill(HIST("eventQA/eventSel"), kTrackCent); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(10.5); + th1sList[run][hEventSel]->Fill(kTrackCent); } float vtxz = collision.posZ(); if (dt != kGen && cfgRunByRun) { @@ -989,7 +1286,6 @@ struct FlowGenericFramework { container->clearVector(); float lRandom = fRndm->Rndm(); - // be cautious, this only works for Pb-Pb // esimate the Event plane and vn for this event DensityCorr densitycorrections; @@ -1024,15 +1320,87 @@ struct FlowGenericFramework { densitycorrections.v4 = v4; densitycorrections.density = tracks.size(); } - + // process tracks AcceptedTracks acceptedTracks(o2::analysis::gfw::ptbinning.size() - 1); for (const auto& track : tracks) { processTrack(track, vtxz, field, run, densitycorrections, acceptedTracks); } - registry.fill(HIST("trackQA/after/Nch_corrected"), acceptedTracks.total); registry.fill(HIST("trackQA/after/Nch_uncorrected"), acceptedTracks.total_uncorr); + std::vector> npt_resonances(6, std::vector(o2::analysis::gfw::ptbinning.size())); + // Process V0s + for (const auto& v0 : v0s) { + if (resoSwitchVals[K0][kUseParticle]) { + if (selectK0(collision, v0, centrality)) { + int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + if (v0.mK0Short() < cfgPIDCuts.cfgK0SignalMin) + npt_resonances[0][ptBinIndex] += getEfficiency(v0); + else if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMax) + npt_resonances[2][ptBinIndex] += getEfficiency(v0); + else + npt_resonances[1][ptBinIndex] += getEfficiency(v0); + registry.fill(HIST("K0/hK0s"), 1); + } + } + } + // Add lambdabar + if (resoSwitchVals[LAMBDA][kUseParticle]) { + if (selectLambda(collision, v0, centrality)) { + int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + if (v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMin) + npt_resonances[3][ptBinIndex] += getEfficiency(v0); + else if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMax) + npt_resonances[5][ptBinIndex] += getEfficiency(v0); + else + npt_resonances[4][ptBinIndex] += getEfficiency(v0); + registry.fill(HIST("Lambda/hLambdas"), 1); + } + } + } + } + float chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; + // calculate fractions + std::vector> fractions_resonances = npt_resonances; + int pidcounter = 0; + for (const auto& vec : fractions_resonances) { + float total = chtotal; + if (cfgUsePIDTotal) + (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0) : chtotal; + + if (total == 0.) { + ++pidcounter; + continue; + } + std::transform(vec.begin(), vec.end(), + std::back_inserter(fractions_resonances.back()), + [&](double x) { return x / total; }); + ++pidcounter; + } + for (std::size_t i = 0; i < fractions_resonances[0].size(); ++i) + registry.fill(HIST("npt_K0_sb1"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[0][i]); + for (std::size_t i = 0; i < fractions_resonances[2].size(); ++i) + registry.fill(HIST("npt_K0_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[2][i]); + for (std::size_t i = 0; i < fractions_resonances[1].size(); ++i) + registry.fill(HIST("npt_K0_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[1][i]); + for (std::size_t i = 0; i < fractions_resonances[3].size(); ++i) + registry.fill(HIST("npt_Lambda_sb1"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[3][i]); + for (std::size_t i = 0; i < fractions_resonances[5].size(); ++i) + registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[5][i]); + for (std::size_t i = 0; i < fractions_resonances[4].size(); ++i) + registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[4][i]); + for (uint l_ind = 4; l_ind < corrconfigsradial.size(); ++l_ind) { + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { + auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); + if (dnx == 0) + continue; + auto val = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kFALSE).real() / dnx; + if (std::abs(val) < 1) + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); + } + } int multiplicity = 0; switch (cfgUseNchCorrection) { case 0: @@ -1089,6 +1457,20 @@ struct FlowGenericFramework { pidIndex = 3; } + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); + int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; + + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + if (pidIndex == 1) + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + if (pidIndex == 2) + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + if (pidIndex == 3) + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + } + if (cfgFillWeights) { fillWeights(mcParticle, vtxz, 0, run); } else { @@ -1124,6 +1506,21 @@ struct FlowGenericFramework { } ++acceptedTracks.total; ++acceptedTracks.total_uncorr; + + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += 1; + int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; + + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + acceptedTracks.nch[ptBinIndex] += 1.0; + if (pidIndex == 1) + acceptedTracks.npi[ptBinIndex] += 1.0; + if (pidIndex == 2) + acceptedTracks.nka[ptBinIndex] += 1.0; + if (pidIndex == 3) + acceptedTracks.npr[ptBinIndex] += 1.0; + } + fillPtSums(track, vtxz, pidIndex); fillGFW(track, vtxz, pidIndex, densitycorrections); @@ -1144,15 +1541,24 @@ struct FlowGenericFramework { // if (cfgUsePID) Need PID for v02 int pidIndex = getNsigmaPID(track); - std::size_t ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - if (!(ptBinIndex > o2::analysis::gfw::ptbinning.size())) { + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); + + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); + int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; + + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 1) + if (pidIndex == 1) { acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 2) + } + if (pidIndex == 2) { acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 3) + } + if (pidIndex == 3) { acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + } } if (cfgFillWeights) { @@ -1171,6 +1577,177 @@ struct FlowGenericFramework { } } + template + bool selectionV0Daughter(TTrack const& track, int pid) + { + if (!(track.itsNCls() > cfgTrackCuts.cfgMinNITSCls)) + return 0; + if (!track.hasTPC()) + return false; + if (track.tpcNClsFound() < cfgTrackCuts.cfgNTPCCls) + return false; + if (!(track.tpcNClsCrossedRows() > cfgTrackCuts.cfgNTPCXrows)) + return 0; + + if (cfgPIDCuts.cfgUseOnlyTPC) { + if (pid == PIONS && std::abs(track.tpcNSigmaPi()) > cfgPIDCuts.cfgTPCNsigmaCut) + return false; + if (pid == KAONS && std::abs(track.tpcNSigmaKa()) > cfgPIDCuts.cfgTPCNsigmaCut) + return false; + if (pid == PROTONS && std::abs(track.tpcNSigmaPr()) > cfgPIDCuts.cfgTPCNsigmaCut) + return false; + } else { + int partIndex = cfgPIDCuts.cfgUseAsymmetricPID ? getNsigmaPIDAssymmetric(track) : getNsigmaPID(track); + int pidIndex = partIndex - 1; // 0 = pion, 1 = kaon, 2 = proton + if (pidIndex != pid) + return false; + } + + return true; + } + + template + bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality) + { + + double mass_K0s = v0.mK0Short(); + + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + registry.fill(HIST("K0/hK0Count"), kFillCandidate); + if (postrack.pt() < resoCutVals[K0][kPosTrackPt] || negtrack.pt() < resoCutVals[K0][kNegTrackPt]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillDaughterPt); + if (mass_K0s < resoCutVals[K0][kMassMin] && mass_K0s > resoCutVals[K0][kMassMax]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillMassCut); + // Rapidity correction + if (v0.yK0Short() > resoCutVals[K0][kRapidity]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillRapidityCut); + // DCA cuts for K0short + if (std::abs(v0.dcapostopv()) < resoCutVals[K0][kDCAPosToPVMin] || std::abs(v0.dcanegtopv()) < resoCutVals[K0][kDCANegToPVMin]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillDCAtoPV); + if (std::abs(v0.dcaV0daughters()) > resoSwitchVals[K0][kDCABetDaug]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillDCAxDaughters); + // v0 radius cuts + if (resoSwitchVals[K0][kUseV0Radius] && (v0.v0radius() < resoCutVals[K0][kRadiusMin] || v0.v0radius() > resoCutVals[K0][kRadiusMax])) + return false; + registry.fill(HIST("K0/hK0Count"), kFillV0Radius); + // cosine pointing angle cuts + if (v0.v0cosPA() < resoCutVals[K0][kCosPA]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillCosPA); + // Proper lifetime + if (resoSwitchVals[K0][kUseProperLifetime] && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0Short > resoCutVals[K0][kLifeTime]) + return false; + registry.fill(HIST("K0/hK0Count"), kFillProperLifetime); + if (!selectionV0Daughter(postrack, PIONS) || !selectionV0Daughter(negtrack, PIONS)) + return false; + registry.fill(HIST("K0/hK0Count"), kFillDaughterTrackSelection); + + registry.fill(HIST("K0/hK0Mass_sparse"), mass_K0s, v0.pt(), centrality); + registry.fill(HIST("K0/hK0Phi"), v0.phi()); + registry.fill(HIST("K0/hK0Eta"), v0.eta()); + registry.fill(HIST("K0/PiPlusTPC_K0"), postrack.pt(), postrack.tpcNSigmaKa()); + registry.fill(HIST("K0/PiPlusTOF_K0"), postrack.pt(), postrack.tofNSigmaKa()); + registry.fill(HIST("K0/PiMinusTPC_K0"), negtrack.pt(), negtrack.tpcNSigmaKa()); + registry.fill(HIST("K0/PiMinusTOF_K0"), negtrack.pt(), negtrack.tofNSigmaKa()); + + return true; + } + + template + bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality) + { + bool isL = false; // Is lambda candidate + bool isAL = false; // Is anti-lambda candidate + + double mlambda = v0.mLambda(); + double mantilambda = v0.mAntiLambda(); + + // separate the positive and negative V0 daughters + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + registry.fill(HIST("Lambda/hLambdaCount"), kFillCandidate); + if (postrack.pt() < resoCutVals[LAMBDA][kPosTrackPt] || negtrack.pt() < resoCutVals[LAMBDA][kNegTrackPt]) + return false; + + registry.fill(HIST("Lambda/hLambdaCount"), kFillDaughterPt); + if (mlambda > resoCutVals[LAMBDA][kMassMin] && mlambda < resoCutVals[LAMBDA][kMassMax]) + isL = true; + if (mantilambda > resoCutVals[LAMBDA][kMassMin] && mantilambda < resoCutVals[LAMBDA][kMassMax]) + isAL = true; + + if (!isL && !isAL) { + return false; + } + registry.fill(HIST("Lambda/hLambdaCount"), kFillMassCut); + + // Rapidity correction + if (v0.yLambda() > resoCutVals[LAMBDA][kRapidity]) + return false; + registry.fill(HIST("Lambda/hLambdaCount"), kFillRapidityCut); + // DCA cuts for lambda and antilambda + if (isL) { + if (std::abs(v0.dcapostopv()) < resoCutVals[LAMBDA][kDCAPosToPVMin] || std::abs(v0.dcanegtopv()) < resoCutVals[LAMBDA][kDCANegToPVMin]) + return false; + } + if (isAL) { + if (std::abs(v0.dcapostopv()) < resoCutVals[LAMBDA][kDCANegToPVMin] || std::abs(v0.dcanegtopv()) < resoCutVals[LAMBDA][kDCAPosToPVMin]) + return false; + } + registry.fill(HIST("Lambda/hLambdaCount"), kFillDCAtoPV); + if (std::abs(v0.dcaV0daughters()) > resoSwitchVals[LAMBDA][kDCABetDaug]) + return false; + registry.fill(HIST("Lambda/hLambdaCount"), kFillDCAxDaughters); + // v0 radius cuts + if (resoSwitchVals[LAMBDA][kUseV0Radius] && (v0.v0radius() < resoCutVals[LAMBDA][kRadiusMin] || v0.v0radius() > resoCutVals[LAMBDA][kRadiusMax])) + return false; + registry.fill(HIST("Lambda/hLambdaCount"), kFillV0Radius); + // cosine pointing angle cuts + if (v0.v0cosPA() < resoCutVals[LAMBDA][kCosPA]) + return false; + registry.fill(HIST("Lambda/hLambdaCount"), kFillCosPA); + // Proper lifetime + if (resoSwitchVals[LAMBDA][kUseProperLifetime] && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda > resoCutVals[LAMBDA][kLifeTime]) + return false; + registry.fill(HIST("Lambda/hLambdaCount"), kFillProperLifetime); + if (isL) { + if (!selectionV0Daughter(postrack, PROTONS) || !selectionV0Daughter(negtrack, PIONS)) + return false; + } + if (isAL) { + if (!selectionV0Daughter(postrack, PIONS) || !selectionV0Daughter(negtrack, PROTONS)) + return false; + } + registry.fill(HIST("Lambda/hLambdaCount"), kFillDaughterTrackSelection); + + if (isL) { + registry.fill(HIST("Lambda/hLambdaMass_sparse"), mlambda, v0.pt(), centrality); + registry.fill(HIST("Lambda/hLambdaPhi"), v0.phi()); + registry.fill(HIST("Lambda/hLambdaEta"), v0.eta()); + registry.fill(HIST("Lambda/PrPlusTPC_L"), postrack.pt(), postrack.tpcNSigmaKa()); + registry.fill(HIST("Lambda/PrPlusTOF_L"), postrack.pt(), postrack.tofNSigmaKa()); + registry.fill(HIST("Lambda/PiMinusTPC_L"), negtrack.pt(), negtrack.tpcNSigmaKa()); + registry.fill(HIST("Lambda/PiMinusTOF_L"), negtrack.pt(), negtrack.tofNSigmaKa()); + } + if (isAL) { + registry.fill(HIST("Lambda/hAntiLambdaMass_sparse"), mantilambda, v0.pt(), centrality); + registry.fill(HIST("Lambda/hAntiLambdaPhi"), v0.phi()); + registry.fill(HIST("Lambda/hAntiLambdaEta"), v0.eta()); + registry.fill(HIST("Lambda/PiPlusTPC_AL"), postrack.pt(), postrack.tpcNSigmaKa()); + registry.fill(HIST("Lambda/PiPlusTOF_AL"), postrack.pt(), postrack.tofNSigmaKa()); + registry.fill(HIST("Lambda/PrMinusTPC_AL"), negtrack.pt(), negtrack.tpcNSigmaKa()); + registry.fill(HIST("Lambda/PrMinusTOF_AL"), negtrack.pt(), negtrack.tofNSigmaKa()); + } + return true; + } + template inline void fillPtSums(TTrack track, const double& vtxz, const int pidIndex) { @@ -1311,10 +1888,19 @@ struct FlowGenericFramework { o2::framework::expressions::Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; o2::framework::expressions::Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::itsChi2NCl < cfgTrackCuts.cfgChi2PrITSCls) && (aod::track::tpcChi2NCl < cfgTrackCuts.cfgChi2PrTPCCls) && nabs(aod::track::dcaZ) < cfgTrackCuts.cfgDCAz; + using GFWCollisions = soa::Filtered>; // using GFWTracks = soa::Filtered>; using GFWTracks = soa::Filtered>; - void processData(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) + SliceCache cache; + Partition posTracks = aod::track::signed1Pt > 0.0f; + Partition negTracks = aod::track::signed1Pt < 0.0f; + + double massKaPlus = o2::constants::physics::MassKPlus; + double massLambda = o2::constants::physics::MassLambda; + double massK0Short = o2::constants::physics::MassK0Short; + + void processData(GFWCollisions::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks, aod::V0Datas const& v0s) { auto bc = collision.bc_as(); int run = bc.runNumber(); @@ -1373,11 +1959,11 @@ struct FlowGenericFramework { // Get magnetic field polarity auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; - processCollision(collision, tracks, centrality, field, run); + processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processData, "Process analysis for non-derived data", true); - void processMCReco(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered> const& tracks, aod::McParticles const&) + void processMCReco(GFWCollisions::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered> const& tracks, aod::McParticles const&, aod::V0Datas const& v0s) { auto bc = collision.bc_as(); int run = bc.runNumber(); @@ -1422,12 +2008,12 @@ struct FlowGenericFramework { loadCorrections(bc); auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; - processCollision(collision, tracks, centrality, field, run); + processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processMCReco, "Process analysis for MC reconstructed events", false); o2::framework::expressions::Filter mcCollFilter = nabs(aod::mccollision::posZ) < cfgVtxZ; - void processMCGen(soa::Filtered::iterator const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& particles) + void processMCGen(soa::Filtered::iterator const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& particles, aod::V0Datas const& v0s) { if (collisions.size() != 1) return; @@ -1436,19 +2022,19 @@ struct FlowGenericFramework { centrality = getCentrality(collision); } int run = 0; - processCollision(mcCollision, particles, centrality, -999, run); + processCollision(mcCollision, particles, v0s, centrality, -999, run); } PROCESS_SWITCH(FlowGenericFramework, processMCGen, "Process analysis for MC generated events", false); - void processOnTheFly(soa::Filtered::iterator const& mcCollision, aod::McParticles const& mcParticles) + void processOnTheFly(soa::Filtered::iterator const& mcCollision, aod::McParticles const& mcParticles, aod::V0Datas const& v0s) { int run = 0; registry.fill(HIST("MCGen/impactParameter"), mcCollision.impactParameter(), mcParticles.size()); - processCollision(mcCollision, mcParticles, mcCollision.impactParameter(), -999, run); + processCollision(mcCollision, mcParticles, v0s, mcCollision.impactParameter(), -999, run); } PROCESS_SWITCH(FlowGenericFramework, processOnTheFly, "Process analysis for MC on-the-fly generated events", false); - void processRun2(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) + void processRun2(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks, aod::V0Datas const& v0s) { auto bc = collision.bc_as(); int run = bc.runNumber(); @@ -1464,7 +2050,7 @@ struct FlowGenericFramework { loadCorrections(bc); auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; - processCollision(collision, tracks, centrality, field, run); + processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processRun2, "Process analysis for Run 2 converted data", false); }; From 09779f09cc151ac2cbf041f5abedcb74f6b00b47 Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Sat, 21 Mar 2026 12:25:39 +0300 Subject: [PATCH 019/282] [DPG] Added VCH counter QA (#15474) --- DPG/Tasks/AOTEvent/lumiQa.cxx | 243 ++++++++++++++++++++++++++-------- 1 file changed, 191 insertions(+), 52 deletions(-) diff --git a/DPG/Tasks/AOTEvent/lumiQa.cxx b/DPG/Tasks/AOTEvent/lumiQa.cxx index fa244f31861..35ef282650b 100644 --- a/DPG/Tasks/AOTEvent/lumiQa.cxx +++ b/DPG/Tasks/AOTEvent/lumiQa.cxx @@ -32,6 +32,7 @@ struct LumiQaTask { int lastRunNumber = -1; double maxSec = 1; double minSec = 0; + TH1* hCalibV0A = nullptr; TH1* hCalibT0C = nullptr; static const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; std::bitset bcPatternB; @@ -48,9 +49,11 @@ struct LumiQaTask { const AxisSpec axisMultZNA{2000, 0., 400., "ZNA multiplicity"}; const AxisSpec axisMultZNC{2000, 0., 400., "ZNC multiplicity"}; + const AxisSpec axisMultV0A{1000, 0., 200000., "V0A multiplicity"}; const AxisSpec axisMultT0M{1000, 0., 270000., "T0M multiplicity"}; const AxisSpec axisMultT0A{1000, 0., 200000., "T0A multiplicity"}; const AxisSpec axisMultT0C{1000, 0., 70000., "T0C multiplicity"}; + const AxisSpec axisCentV0A{100, 0., 100., "V0A centrality"}; const AxisSpec axisCentT0C{100, 0., 100., "T0C centrality"}; const AxisSpec axisTime{700, -35., 35., "time (ns)"}; const AxisSpec axisMultChannelT0A{5000, 0., 5000., "T0A channel multiplicity"}; @@ -62,10 +65,24 @@ struct LumiQaTask { histos.add("hMultZNA", "", kTH1F, {axisMultZNA}); histos.add("hMultZNC", "", kTH1F, {axisMultZNC}); + histos.add("hMultV0A", "", kTH1F, {axisMultV0A}); histos.add("hMultT0M", "", kTH1F, {axisMultT0M}); histos.add("hMultT0A", "", kTH1F, {axisMultT0A}); histos.add("hMultT0C", "", kTH1F, {axisMultT0C}); + histos.add("hCentV0A", "", kTH1F, {axisCentV0A}); histos.add("hCentT0C", "", kTH1F, {axisCentT0C}); + + histos.add("hMultV0AselTVXB", "", kTH1F, {axisMultV0A}); + histos.add("hCentV0AselTVXB", "", kTH1F, {axisCentV0A}); + histos.add("hMultVCHselTVXB", "", kTH1F, {axisMultV0A}); + histos.add("hCentVCHselTVXB", "", kTH1F, {axisCentV0A}); + histos.add("hMultV0AselZACTVXB", "", kTH1F, {axisMultV0A}); + histos.add("hCentV0AselZACTVXB", "", kTH1F, {axisCentV0A}); + histos.add("hMultVCHselZACTVXB", "", kTH1F, {axisMultV0A}); + histos.add("hCentVCHselZACTVXB", "", kTH1F, {axisCentV0A}); + + histos.add("hMultT0CselTVXB", "", kTH1F, {axisMultT0C}); + histos.add("hCentT0CselTVXB", "", kTH1F, {axisCentT0C}); histos.add("hMultT0MselTSC", "", kTH1F, {axisMultT0M}); histos.add("hMultT0MselTCE", "", kTH1F, {axisMultT0M}); histos.add("hMultT0CselTCE", "", kTH1F, {axisMultT0C}); @@ -86,15 +103,29 @@ struct LumiQaTask { histos.add("hTimeZNAselC", "", kTH1F, {axisTime}); histos.add("hTimeZNCselC", "", kTH1F, {axisTime}); - histos.add("hCounterTCE", "", kTH1D, {{1, 0., 1.}}); - histos.add("hCounterZNA", "", kTH1D, {{1, 0., 1.}}); - histos.add("hCounterZNC", "", kTH1D, {{1, 0., 1.}}); - histos.add("hCounterZEM", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterTCEselB", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNAselB", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNCselB", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZEMselB", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterVCHselB", "", kTH1D, {{1, 0., 1.}}); + + histos.add("hCounterTCEselA", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNAselA", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNCselA", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZEMselA", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterVCHselA", "", kTH1D, {{1, 0., 1.}}); + + histos.add("hCounterTCEselC", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNAselC", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZNCselC", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterZEMselC", "", kTH1D, {{1, 0., 1.}}); + histos.add("hCounterVCHselC", "", kTH1D, {{1, 0., 1.}}); + histos.add("hMultT0AperChannel", "", kTH2D, {axisMultChannelT0A, axisChannelsT0A}); histos.add("hMultT0CperChannel", "", kTH2D, {axisMultChannelT0C, axisChannelsT0C}); } - void process(BCsRun3 const& bcs, aod::Zdcs const&, aod::FT0s const&) + void process(BCsRun3 const& bcs, aod::Zdcs const&, aod::FT0s const&, aod::FV0As const&) { int runNumber = bcs.iteratorAt(0).runNumber(); const char* srun = Form("%d", runNumber); @@ -117,6 +148,12 @@ struct LumiQaTask { return; } + hCalibV0A = reinterpret_cast(callst->FindObject("hCalibZeqFV0")); + if (hCalibV0A == nullptr) { + LOGF(info, "hCalibZeqFV0 histogram is not available for run=%d at timestamp=%llu", runNumber, ts); + return; + } + hCalibT0C = reinterpret_cast(callst->FindObject("hCalibZeqFT0C")); if (hCalibT0C == nullptr) { LOGF(info, "hCalibZeqFT0C histogram is not available for run=%d at timestamp=%llu", runNumber, ts); @@ -136,71 +173,172 @@ struct LumiQaTask { const AxisSpec axisBCs{nBCsPerOrbit, 0., static_cast(nBCsPerOrbit), ""}; const AxisSpec axisSeconds{nTimeBins, 0, timeInterval, "seconds"}; - histos.add("hSecondsBcsTCE", "", kTH2D, {axisSeconds, axisBCs}); - histos.add("hSecondsBcsZNA", "", kTH2D, {axisSeconds, axisBCs}); - histos.add("hSecondsBcsZNC", "", kTH2D, {axisSeconds, axisBCs}); - histos.add("hSecondsBcsZEM", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsTCEselB", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZNAselB", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZNCselB", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZEMselB", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsVCHselB", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsTCEselA", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZNAselA", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZNCselA", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZEMselA", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsVCHselA", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsTCEselC", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZNAselC", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZNCselC", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsZEMselC", "", kTH2D, {axisSeconds, axisBCs}); + histos.add("hSecondsBcsVCHselC", "", kTH2D, {axisSeconds, axisBCs}); } for (const auto& bc : bcs) { int64_t ts = bc.timestamp(); + auto inputMask = bc.inputMask(); double secFromSOR = ts / 1000. - minSec; - double bcInOrbit = bc.globalBC() % nBCsPerOrbit; + int bcInOrbit = bc.globalBC() % nBCsPerOrbit; + bool maskB = bcPatternB[bcInOrbit]; + bool maskA = bcPatternA[bcInOrbit]; + bool maskC = bcPatternC[bcInOrbit]; + bool tvxCTP = TESTBIT(inputMask, 2); + bool tscCTP = TESTBIT(inputMask, 3); + bool tceCTP = TESTBIT(inputMask, 4); + bool vchCTP = TESTBIT(inputMask, 9); + bool zemCTP = TESTBIT(inputMask, 24); + bool zncCTP = TESTBIT(inputMask, 25); + + LOGP(debug, "CTP: tvx={} tsc={} tce={} vch={} zem={} znc={}", tvxCTP, tscCTP, tceCTP, vchCTP, zemCTP, zncCTP); + + bool tvx = bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex) : 0; + bool tsc = bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitSCen) : 0; + bool tce = bc.has_ft0() ? TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitCen) : 0; + bool vch = bc.has_fv0a() ? TESTBIT(bc.fv0a().triggerMask(), o2::fit::Triggers::bitTrgCharge) : 0; + + float meanTimeZNA = 0.; + float meanTimeZNC = 0.; + bool zna = bc.has_zdc() ? std::fabs(bc.zdc().timeZNA() - meanTimeZNA) < 2 : 0; // ns + bool znc = bc.has_zdc() ? std::fabs(bc.zdc().timeZNC() - meanTimeZNC) < 2 : 0; // ns + bool zem = zna || znc; + bool zac = zna && znc; + + // check if TCE triggers from FT0 mask and CTP are consistent + if (tce != tceCTP) { + LOGP(warning, "TCEfromFT0={} TCEfromCTP={}", tce, tceCTP); + } + if (bc.has_zdc()) { float timeZNA = bc.zdc().timeZNA(); float timeZNC = bc.zdc().timeZNC(); float multZNA = bc.zdc().energyCommonZNA(); float multZNC = bc.zdc().energyCommonZNC(); - histos.fill(HIST("hMultZNA"), multZNA); histos.fill(HIST("hMultZNC"), multZNC); histos.fill(HIST("hTimeZNA"), timeZNA); histos.fill(HIST("hTimeZNC"), timeZNC); - if (bc.has_ft0() && TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex)) { // TVX + if (tvx) { // TVX histos.fill(HIST("hTimeZNAselTVX"), timeZNA); histos.fill(HIST("hTimeZNCselTVX"), timeZNC); } - - if (bcPatternB[bc.globalBC() % nBCsPerOrbit]) { // B-mask + if (maskB) { // B-mask histos.fill(HIST("hTimeZNAselB"), timeZNA); histos.fill(HIST("hTimeZNCselB"), timeZNC); } - if (bcPatternA[bc.globalBC() % nBCsPerOrbit]) { // A-mask + if (maskA) { // A-mask histos.fill(HIST("hTimeZNAselA"), timeZNA); histos.fill(HIST("hTimeZNCselA"), timeZNC); } - if (bcPatternC[bc.globalBC() % nBCsPerOrbit]) { // C-mask + if (maskC) { // C-mask histos.fill(HIST("hTimeZNAselC"), timeZNA); histos.fill(HIST("hTimeZNCselC"), timeZNC); } - double meanTimeZNA = 0; - double meanTimeZNC = 0; - if (runNumber == 544795) { - meanTimeZNA = 0.49; - meanTimeZNC = -5.19; - } else if (runNumber == 544911) { - meanTimeZNA = -1.44; - meanTimeZNC = -11.39; + // B-mask + if (zna && maskB) { + histos.get(HIST("hCounterZNAselB"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZNAselB"), secFromSOR, bcInOrbit); + } + if (znc && maskB) { + histos.get(HIST("hCounterZNCselB"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZNCselB"), secFromSOR, bcInOrbit); + } + if (zem && maskB) { + histos.get(HIST("hCounterZEMselB"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZEMselB"), secFromSOR, bcInOrbit); + } + + // A-mask + if (zna && maskA) { + histos.get(HIST("hCounterZNAselA"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZNAselA"), secFromSOR, bcInOrbit); + } + if (znc && maskA) { + histos.get(HIST("hCounterZNCselA"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZNCselA"), secFromSOR, bcInOrbit); + } + if (zem && maskA) { + histos.get(HIST("hCounterZEMselA"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZEMselA"), secFromSOR, bcInOrbit); + } + + // C-mask + if (zna && maskC) { + histos.get(HIST("hCounterZNAselC"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZNAselC"), secFromSOR, bcInOrbit); + } + if (znc && maskC) { + histos.get(HIST("hCounterZNCselC"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZNCselC"), secFromSOR, bcInOrbit); + } + if (zem && maskC) { + histos.get(HIST("hCounterZEMselC"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsZEMselC"), secFromSOR, bcInOrbit); + } + } + + if (bc.has_fv0a()) { + float multV0A = 0.; + for (auto mult : bc.fv0a().amplitude()) { + multV0A += mult; } + float centV0A = hCalibV0A->GetBinContent(hCalibV0A->FindFixBin(multV0A)); + histos.fill(HIST("hMultV0A"), multV0A); + histos.fill(HIST("hCentV0A"), centV0A); - if (fabs(timeZNA - meanTimeZNA) < 2) { - histos.get(HIST("hCounterZNA"))->Fill(srun, 1); - histos.fill(HIST("hSecondsBcsZNA"), secFromSOR, bcInOrbit); + if (tvx && maskB) { + histos.fill(HIST("hMultV0AselTVXB"), multV0A); + histos.fill(HIST("hCentV0AselTVXB"), centV0A); } - if (fabs(timeZNC - meanTimeZNC) < 2) { - histos.get(HIST("hCounterZNC"))->Fill(srun, 1); - histos.fill(HIST("hSecondsBcsZNC"), secFromSOR, bcInOrbit); + + if (tvx && maskB && vch) { + histos.fill(HIST("hMultVCHselTVXB"), multV0A); + histos.fill(HIST("hCentVCHselTVXB"), centV0A); + histos.get(HIST("hCounterVCHselB"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsVCHselB"), secFromSOR, bcInOrbit); + } + + if (tvx && maskA && vch) { + histos.get(HIST("hCounterVCHselA"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsVCHselA"), secFromSOR, bcInOrbit); } - if (fabs(timeZNA - meanTimeZNA) < 2 || fabs(timeZNC - meanTimeZNC) < 2) { - histos.get(HIST("hCounterZEM"))->Fill(srun, 1); - histos.fill(HIST("hSecondsBcsZEM"), secFromSOR, bcInOrbit); + + if (tvx && maskC && vch) { + histos.get(HIST("hCounterVCHselC"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsVCHselC"), secFromSOR, bcInOrbit); + } + + if (tvx && maskB && zac) { + histos.fill(HIST("hMultV0AselZACTVXB"), multV0A); + histos.fill(HIST("hCentV0AselZACTVXB"), centV0A); + } + + if (tvx && maskB && vch && zac) { + histos.fill(HIST("hMultVCHselZACTVXB"), multV0A); + histos.fill(HIST("hCentVCHselZACTVXB"), centV0A); } } if (!bc.has_ft0()) { continue; } + for (unsigned int ic = 0; ic < bc.ft0().amplitudeA().size(); ic++) { histos.fill(HIST("hMultT0AperChannel"), bc.ft0().amplitudeA()[ic], bc.ft0().channelA()[ic]); } @@ -217,33 +355,34 @@ struct LumiQaTask { histos.fill(HIST("hMultT0C"), multT0C); histos.fill(HIST("hCentT0C"), centT0C); - if (TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitSCen)) { // TSC - histos.fill(HIST("hMultT0MselTSC"), multT0M); + if (tvx && maskB) { + histos.fill(HIST("hMultT0CselTVXB"), multT0C); + histos.fill(HIST("hCentT0CselTVXB"), centT0C); } - if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitCen)) { // TCE - continue; + if (tsc) { + histos.fill(HIST("hMultT0MselTSC"), multT0M); } - histos.fill(HIST("hMultT0MselTCE"), multT0M); - histos.fill(HIST("hMultT0CselTCE"), multT0C); - histos.fill(HIST("hCentT0CselTCE"), centT0C); - if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex)) { // TVX - continue; + if (tce) { + histos.fill(HIST("hMultT0MselTCE"), multT0M); + histos.fill(HIST("hMultT0CselTCE"), multT0C); + histos.fill(HIST("hCentT0CselTCE"), centT0C); } - histos.fill(HIST("hMultT0CselTVXTCE"), multT0C); - histos.fill(HIST("hCentT0CselTVXTCE"), centT0C); - if (!bcPatternB[bc.globalBC() % nBCsPerOrbit]) { // B-mask - continue; + if (tce && tvx) { + histos.fill(HIST("hMultT0CselTVXTCE"), multT0C); + histos.fill(HIST("hCentT0CselTVXTCE"), centT0C); } - histos.fill(HIST("hMultT0CselTVXTCEB"), multT0C); - histos.fill(HIST("hCentT0CselTVXTCEB"), centT0C); - histos.get(HIST("hCounterTCE"))->Fill(srun, 1); - histos.fill(HIST("hSecondsBcsTCE"), secFromSOR, bcInOrbit); - } - } + if (tce && tvx && maskB) { + histos.fill(HIST("hMultT0CselTVXTCEB"), multT0C); + histos.fill(HIST("hCentT0CselTVXTCEB"), centT0C); + histos.get(HIST("hCounterTCEselB"))->Fill(srun, 1); + histos.fill(HIST("hSecondsBcsTCEselB"), secFromSOR, bcInOrbit); + } + } // bc loop + } // process }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 26437ff45acc06c73ab9e869f0eb1bda2fe234a1 Mon Sep 17 00:00:00 2001 From: rolavick Date: Sat, 21 Mar 2026 14:42:27 +0100 Subject: [PATCH 020/282] [PWGUD] new propagation to vertex for global muons (#15475) Co-authored-by: ALICE Action Bot --- .../upcCandProducerGlobalMuon.cxx | 132 ++++++++++++++++-- 1 file changed, 120 insertions(+), 12 deletions(-) diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index e3a54057cc7..cc756d6ea9c 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -17,7 +17,10 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" +#include "Common/Core/fwdtrackUtilities.h" + #include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/GeomConstants.h" #include "CommonConstants/LHCConstants.h" #include "DataFormatsParameters/GRPMagField.h" #include "DetectorsBase/Propagator.h" @@ -71,6 +74,13 @@ struct UpcCandProducerGlobalMuon { Configurable fMaxEtaMFT{"fMaxEtaMFT", -2.5, "Maximum eta for MFT acceptance"}; Configurable fSaveMFTClusters{"fSaveMFTClusters", true, "Save MFT cluster information"}; + // Ambiguous track propagation configurables + Configurable fApplyZShiftFromCCDB{"fApplyZShiftFromCCDB", false, "Apply z-shift from CCDB for global muon propagation"}; + Configurable fZShiftPath{"fZShiftPath", "Users/m/mcoquet/ZShift", "CCDB path for z-shift"}; + Configurable fManualZShift{"fManualZShift", 0.0f, "Manual z-shift for global muon propagation to PV"}; + Configurable fMaxDCAxy{"fMaxDCAxy", 999.f, "Maximum DCAxy for global muon track selection (cm)"}; + Configurable fBcWindowCollision{"fBcWindowCollision", 4, "BC window for collision search for DCA-based vertex assignment"}; + using ForwardTracks = o2::soa::Join; HistogramRegistry histRegistry{"HistRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -80,10 +90,15 @@ struct UpcCandProducerGlobalMuon { o2::ccdb::CcdbApi fCCDBApi; o2::globaltracking::MatchGlobalFwd fMatching; + // Ambiguous track propagation members + float fBz{0}; // Magnetic field at MFT center + static constexpr double fCcenterMFT[3] = {0, 0, -61.4}; // Field evaluation point at center of MFT + float fZShift{0}; // z-vertex shift for forward track propagation + void init(InitContext&) { fUpcCuts = (UPCCutparHolder)fUpcCutsConf; - if (fUpcCuts.getUseFwdCuts()) { + if (fUpcCuts.getUseFwdCuts() || fEnableMFT) { fCCDB->setURL("http://alice-ccdb.cern.ch"); fCCDB->setCaching(true); fCCDB->setLocalObjectValidityChecking(); @@ -110,6 +125,12 @@ struct UpcCandProducerGlobalMuon { const AxisSpec axisEta{100, -4.0, -2.0, "#eta"}; histRegistry.add("hEtaMFT", "MFT track eta", kTH1F, {axisEta}); histRegistry.add("hEtaGlobal", "Global track eta", kTH1F, {axisEta}); + + const AxisSpec axisDCAxy{200, 0., 10., "DCA_{xy} (cm)"}; + const AxisSpec axisDCAz{200, -10., 10., "DCA_{z} (cm)"}; + histRegistry.add("hDCAxyGlobal", "DCAxy of global tracks to best collision", kTH1F, {axisDCAxy}); + histRegistry.add("hDCAzGlobal", "DCAz of global tracks to best collision", kTH1F, {axisDCAz}); + histRegistry.add("hNCompatColls", "Number of compatible collisions per global track", kTH1F, {{21, -0.5, 20.5}}); } } @@ -436,6 +457,19 @@ struct UpcCandProducerGlobalMuon { return (eta > fMinEtaMFT && eta < fMaxEtaMFT); } + // Propagate global muon track to collision vertex using helix propagation + // and compute DCA (adapted from ambiguousTrackPropagation) + // Returns {DCAxy, DCAz, DCAx, DCAy} + std::array propagateGlobalToDCA(ForwardTracks::iterator const& track, + double colX, double colY, double colZ) + { + o2::track::TrackParCovFwd trackPar = o2::aod::fwdtrackutils::getTrackParCovFwdShift(track, fZShift); + std::array dcaOrig; + trackPar.propagateToDCAhelix(fBz, {colX, colY, colZ}, dcaOrig); + double dcaXY = std::sqrt(dcaOrig[0] * dcaOrig[0] + dcaOrig[1] * dcaOrig[1]); + return {dcaXY, dcaOrig[2], dcaOrig[0], dcaOrig[1]}; + } + void createCandidates(ForwardTracks const& fwdTracks, o2::aod::FwdTrkCls const& fwdTrkCls, o2::aod::AmbiguousFwdTracks const& ambFwdTracks, @@ -451,7 +485,7 @@ struct UpcCandProducerGlobalMuon { using o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack; int32_t runNumber = bcs.iteratorAt(0).runNumber(); - if (fUpcCuts.getUseFwdCuts()) { + if (fUpcCuts.getUseFwdCuts() || fEnableMFT) { if (runNumber != fRun) { fRun = runNumber; std::map metadata; @@ -461,7 +495,28 @@ struct UpcCandProducerGlobalMuon { o2::base::Propagator::initFieldFromGRP(grpmag); if (!o2::base::GeometryManager::isGeometryLoaded()) fCCDB->get("GLO/Config/GeometryAligned"); - o2::mch::TrackExtrap::setField(); + if (fUpcCuts.getUseFwdCuts()) { + o2::mch::TrackExtrap::setField(); + } + // Initialize MFT magnetic field and z-shift for ambiguous track propagation + if (fEnableMFT) { + o2::field::MagneticField* field = static_cast(TGeoGlobalMagField::Instance()->GetField()); + fBz = field->getBz(fCcenterMFT); + LOG(info) << "Magnetic field at MFT center: bZ = " << fBz; + if (fApplyZShiftFromCCDB) { + auto* zShift = fCCDB->getForTimeStamp>(fZShiftPath, ts); + if (zShift != nullptr && !zShift->empty()) { + fZShift = (*zShift)[0]; + LOGF(info, "z-shift from CCDB: %f cm", fZShift); + } else { + fZShift = 0; + LOGF(info, "z-shift not found in CCDB path %s, set to 0 cm", fZShiftPath.value); + } + } else { + fZShift = fManualZShift; + LOGF(info, "z-shift manually set to %f cm", fZShift); + } + } } } @@ -533,6 +588,15 @@ struct UpcCandProducerGlobalMuon { } } + // Map global BC to collisions for DCA-based vertex assignment + std::map> mapGlobalBCtoCollisions; + if (fEnableMFT) { + for (const auto& col : collisions) { + uint64_t gbc = vGlobalBCs[col.bcId()]; + mapGlobalBCtoCollisions[gbc].push_back(col.globalIndex()); + } + } + std::vector selTrackIds{}; // NEW: For cluster saving int32_t candId = 0; @@ -552,14 +616,58 @@ struct UpcCandProducerGlobalMuon { continue; } - uint16_t numContrib = 0; auto& vGlobalIds = gbc_globalids.second; - // Check if we have global tracks (with MFT) + // Step 1: Find best collision vertex using DCA-based propagation + // (adapted from ambiguousTrackPropagation processMFTReassoc3D) + float bestVtxX = 0., bestVtxY = 0., bestVtxZ = 0.; + double bestAvgDCA = 999.; + bool hasVertex = false; + int nCompatColls = 0; + + for (int dbc = -static_cast(fBcWindowCollision); dbc <= static_cast(fBcWindowCollision); dbc++) { + uint64_t searchBC = globalBcGlobal + dbc; + auto itCol = mapGlobalBCtoCollisions.find(searchBC); + if (itCol == mapGlobalBCtoCollisions.end()) + continue; + for (auto colIdx : itCol->second) { + nCompatColls++; + const auto& col = collisions.iteratorAt(colIdx); + double sumDCAxy = 0.; + int nTracks = 0; + for (const auto& iglobal : vGlobalIds) { + const auto& trk = fwdTracks.iteratorAt(iglobal); + auto dca = propagateGlobalToDCA(trk, col.posX(), col.posY(), col.posZ()); + sumDCAxy += dca[0]; + nTracks++; + } + double avgDCA = nTracks > 0 ? sumDCAxy / nTracks : 999.; + if (!hasVertex || avgDCA < bestAvgDCA) { + bestAvgDCA = avgDCA; + bestVtxX = col.posX(); + bestVtxY = col.posY(); + bestVtxZ = col.posZ(); + hasVertex = true; + } + } + } + + histRegistry.fill(HIST("hNCompatColls"), nCompatColls); + + // Step 2: Select tracks with DCA quality cut std::vector tracksToSave; for (const auto& iglobal : vGlobalIds) { const auto& trk = fwdTracks.iteratorAt(iglobal); + // Apply DCA cut using best collision vertex + if (hasVertex) { + auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); + histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); + histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); + if (dca[0] > static_cast(fMaxDCAxy)) + continue; + } + // Check MFT acceptance and decide which track to use if (isInMFTAcceptance(trk.eta())) { // Inside MFT acceptance - use global track @@ -567,19 +675,18 @@ struct UpcCandProducerGlobalMuon { histRegistry.fill(HIST("hEtaMFT"), trk.eta()); } else { // Outside MFT acceptance - look for MCH-MID counterpart - // Find the corresponding MCH-MID track at the same BC auto itMid = mapGlobalBcsWithMCHMIDTrackIds.find(globalBcGlobal); if (itMid != mapGlobalBcsWithMCHMIDTrackIds.end()) { - // Use MCH-MID track instead if (!itMid->second.empty()) { tracksToSave.push_back(itMid->second[0]); - itMid->second.erase(itMid->second.begin()); // Remove used track + itMid->second.erase(itMid->second.begin()); } } } } - // Write selected tracks + // Step 3: Write tracks and event candidate with actual vertex position + uint16_t numContrib = 0; for (const auto& trkId : tracksToSave) { if (!addToFwdTable(candId, trkId, globalBcGlobal, 0., fwdTracks, mcFwdTrackLabels)) continue; @@ -590,7 +697,7 @@ struct UpcCandProducerGlobalMuon { if (numContrib < 1) continue; - eventCandidates(globalBcGlobal, runNumber, 0., 0., 0., 0, numContrib, 0, 0); + eventCandidates(globalBcGlobal, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); std::vector amplitudesV0A{}; std::vector relBCsV0A{}; std::vector amplitudesT0A{}; @@ -683,8 +790,9 @@ struct UpcCandProducerGlobalMuon { vAmbFwdTrackIndexBCs.clear(); mapGlobalBcsWithMCHMIDTrackIds.clear(); mapGlobalBcsWithMCHTrackIds.clear(); - mapGlobalBcsWithGlobalTrackIds.clear(); // NEW - selTrackIds.clear(); // NEW + mapGlobalBcsWithGlobalTrackIds.clear(); + mapGlobalBCtoCollisions.clear(); + selTrackIds.clear(); } void processFwd(ForwardTracks const& fwdTracks, From 9122bd981341704a1aea15d512a3f1de27f55d23 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Sat, 21 Mar 2026 18:10:52 +0100 Subject: [PATCH 021/282] [PWGLF] Add histograms to calculate weight for SE to ME ratio (#15476) --- .../Strangeness/lambdaspincorrderived.cxx | 283 +++++++++++------- 1 file changed, 171 insertions(+), 112 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index 014834942f5..01a5bdc73b9 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -297,6 +297,27 @@ struct lambdaspincorrderived { histos.add("hCentPairTypeSE", "SE pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); histos.add("hCentPairTypeME", "ME pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); + // --- target/replacement single-leg occupancy maps for replacement correction + histos.add("TGT_LL_leg1", "Target LL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("TGT_LAL_leg1", "Target LAL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("TGT_ALL_leg1", "Target ALL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("TGT_ALAL_leg1", "Target ALAL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + + histos.add("REP_LL_leg1", "Repl LL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("REP_LAL_leg1", "Repl LAL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("REP_ALL_leg1", "Repl ALL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("REP_ALAL_leg1", "Repl ALAL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + + histos.add("TGT_LL_leg2", "Target LL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("TGT_LAL_leg2", "Target LAL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("TGT_ALL_leg2", "Target ALL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("TGT_ALAL_leg2", "Target ALAL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + + histos.add("REP_LL_leg2", "Repl LL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("REP_LAL_leg2", "Repl LAL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("REP_ALL_leg2", "Repl ALL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + histos.add("REP_ALAL_leg2", "Repl ALAL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); + // --- 3D SE/ME pair-space maps per category (LL, LAL, ALL, ALAL) histos.add("SE_LL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); histos.add("SE_LAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); @@ -432,91 +453,6 @@ struct lambdaspincorrderived { return true; } - template - bool selectionV0Buffer(T const& candidate) - { - auto particle = ROOT::Math::PtEtaPhiMVector(candidate.lambdaPt(), candidate.lambdaEta(), candidate.lambdaPhi(), candidate.lambdaMass()); - - if (std::abs(particle.Rapidity()) > rapidity || std::abs(particle.Eta()) > v0etaMixBuffer) { - return false; - } - if (candidate.lambdaMass() < MassMin || candidate.lambdaMass() > MassMax) { - return false; - } - if (candidate.v0Cospa() < cosPA) { - return false; - } - if (checkDoubleStatus && candidate.doubleStatus()) { - return false; - } - if (candidate.v0Radius() > radiusMax) { - return false; - } - if (candidate.v0Radius() < radiusMin) { - return false; - } - if (candidate.dcaBetweenDaughter() > dcaDaughters) { - return false; - } - if (candidate.v0Status() == 0 && (std::abs(candidate.dcaPositive()) < dcaProton || std::abs(candidate.dcaNegative()) < dcaPion)) { - return false; - } - if (candidate.v0Status() == 1 && (std::abs(candidate.dcaPositive()) < dcaPion || std::abs(candidate.dcaNegative()) < dcaProton)) { - return false; - } - if (candidate.lambdaPt() < ptMinMixBuffer) { - return false; - } - if (candidate.lambdaPt() > ptMaxMixBuffer) { - return false; - } - return true; - } - - template - bool selectionV0BufferMC(T const& candidate) - { - auto particle = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(candidate), - mcacc::lamEta(candidate), - mcacc::lamPhi(candidate), - mcacc::lamMass(candidate)); - - if (std::abs(particle.Rapidity()) > rapidity || std::abs(particle.Eta()) > v0etaMixBuffer) { - return false; - } - if (mcacc::lamMass(candidate) < MassMin || mcacc::lamMass(candidate) > MassMax) { - return false; - } - if (mcacc::v0CosPA(candidate) < cosPA) { - return false; - } - if (checkDoubleStatus && mcacc::doubleStatus(candidate)) { - return false; - } - if (mcacc::v0Radius(candidate) > radiusMax) { - return false; - } - if (mcacc::v0Radius(candidate) < radiusMin) { - return false; - } - if (mcacc::dcaDau(candidate) > dcaDaughters) { - return false; - } - if (mcacc::v0Status(candidate) == 0 && (std::abs(mcacc::dcaPos(candidate)) < dcaProton || std::abs(mcacc::dcaNeg(candidate)) < dcaPion)) { - return false; - } - if (mcacc::v0Status(candidate) == 1 && (std::abs(mcacc::dcaPos(candidate)) < dcaPion || std::abs(mcacc::dcaNeg(candidate)) < dcaProton)) { - return false; - } - if (mcacc::lamPt(candidate) < ptMinMixBuffer) { - return false; - } - if (mcacc::lamPt(candidate) > ptMaxMixBuffer) { - return false; - } - return true; - } - template bool checkKinematics(T1 const& c1, T2 const& c2) { @@ -980,6 +916,66 @@ struct lambdaspincorrderived { } PROCESS_SWITCH(lambdaspincorrderived, processData, "Process data", true); + template + void fillReplacementControlMap(int tag1, int tag2, int leg, bool isTarget, LV const& particle, float weight) + { + const double pt = particle.Pt(); + const double phi = RecoDecay::constrainAngle(particle.Phi(), 0.0F, harmonic); + + double etaOrY = particle.Eta(); + if (userapidity) { + etaOrY = particle.Rapidity(); + } + + if (leg == 1 && isTarget) { + if (tag1 == 0 && tag2 == 0) + histos.fill(HIST("TGT_LL_leg1"), phi, etaOrY, pt, weight); + else if (tag1 == 0 && tag2 == 1) + histos.fill(HIST("TGT_LAL_leg1"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 0) + histos.fill(HIST("TGT_ALL_leg1"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 1) + histos.fill(HIST("TGT_ALAL_leg1"), phi, etaOrY, pt, weight); + return; + } + + if (leg == 1 && !isTarget) { + if (tag1 == 0 && tag2 == 0) + histos.fill(HIST("REP_LL_leg1"), phi, etaOrY, pt, weight); + else if (tag1 == 0 && tag2 == 1) + histos.fill(HIST("REP_LAL_leg1"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 0) + histos.fill(HIST("REP_ALL_leg1"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 1) + histos.fill(HIST("REP_ALAL_leg1"), phi, etaOrY, pt, weight); + return; + } + + if (leg == 2 && isTarget) { + if (tag1 == 0 && tag2 == 0) + histos.fill(HIST("TGT_LL_leg2"), phi, etaOrY, pt, weight); + else if (tag1 == 0 && tag2 == 1) + histos.fill(HIST("TGT_LAL_leg2"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 0) + histos.fill(HIST("TGT_ALL_leg2"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 1) + histos.fill(HIST("TGT_ALAL_leg2"), phi, etaOrY, pt, weight); + return; + } + + if (leg == 2 && !isTarget) { + if (tag1 == 0 && tag2 == 0) + histos.fill(HIST("REP_LL_leg2"), phi, etaOrY, pt, weight); + else if (tag1 == 0 && tag2 == 1) + histos.fill(HIST("REP_LAL_leg2"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 0) + histos.fill(HIST("REP_ALL_leg2"), phi, etaOrY, pt, weight); + else if (tag1 == 1 && tag2 == 1) + histos.fill(HIST("REP_ALAL_leg2"), phi, etaOrY, pt, weight); + return; + } + } + // Processing Event Mixing SliceCache cache; using BinningType = ColumnBinningPolicy; @@ -1028,10 +1024,20 @@ struct lambdaspincorrderived { if (t1.pionIndex() == t2.protonIndex()) { continue; } - const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); + if (doMixLeg1) { + fillReplacementControlMap(t1.v0Status(), t2.v0Status(), 1, true, + ROOT::Math::PtEtaPhiMVector(t1.lambdaPt(), t1.lambdaEta(), t1.lambdaPhi(), t1.lambdaMass()), + 1.0f); + } + if (doMixLeg2) { + fillReplacementControlMap(t1.v0Status(), t2.v0Status(), 2, true, + ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass()), + 1.0f); + } + struct PV { AllTrackCandidates* pool; int nRepl1 = 0; @@ -1094,6 +1100,9 @@ struct lambdaspincorrderived { // -------- leg-1 replacement: (tX, t2) if (doMixLeg1) { if (checkKinematics(t1, tX) && checkPairKinematics(t1, t2, tX)) { + fillReplacementControlMap(tX.v0Status(), t2.v0Status(), 1, false, + ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()), + wBase); auto proton = ROOT::Math::PtEtaPhiMVector(tX.protonPt(), tX.protonEta(), tX.protonPhi(), o2::constants::physics::MassProton); auto lambda = ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), @@ -1118,6 +1127,9 @@ struct lambdaspincorrderived { // -------- leg-2 replacement: (t1, tX) if (doMixLeg2) { if (checkKinematics(t2, tX) && checkPairKinematics(t2, t1, tX)) { + fillReplacementControlMap(t1.v0Status(), tX.v0Status(), 2, false, + ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()), + wBase); auto proton = ROOT::Math::PtEtaPhiMVector(t1.protonPt(), t1.protonEta(), t1.protonPhi(), o2::constants::physics::MassProton); auto lambda = ROOT::Math::PtEtaPhiMVector(t1.lambdaPt(), t1.lambdaEta(), t1.lambdaPhi(), @@ -1204,8 +1216,8 @@ struct lambdaspincorrderived { etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), - phiMin(-static_cast(TMath::Pi())), - phiMax(+static_cast(TMath::Pi())), + phiMin(0.f), + phiMax(static_cast(2.0 * TMath::Pi())), phiStep(phiStep_), mMin(mMin_), mMax(mMax_), @@ -1500,10 +1512,20 @@ struct lambdaspincorrderived { if (mcacc::piIdx(t1) == mcacc::prIdx(t2)) { continue; } - const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); + if (doMixLeg1) { + fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 1, true, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), mcacc::lamMass(t1)), + 1.0f); + } + if (doMixLeg2) { + fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 2, true, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)), + 1.0f); + } + struct PV { AllTrackCandidatesMC* pool; int nRepl1 = 0; @@ -1566,6 +1588,9 @@ struct lambdaspincorrderived { // -------- leg-1 replacement: (tX, t2) if (doMixLeg1) { if (checkKinematicsMC(t1, tX) && checkPairKinematicsMC(t1, t2, tX)) { + fillReplacementControlMap(mcacc::v0Status(tX), mcacc::v0Status(t2), 1, false, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), + wBase); auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), o2::constants::physics::MassProton); auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), @@ -1590,6 +1615,9 @@ struct lambdaspincorrderived { // -------- leg-2 replacement: (t1, tX) if (doMixLeg2) { if (checkKinematicsMC(t2, tX) && checkPairKinematicsMC(t2, t1, tX)) { + fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(tX), 2, false, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), + wBase); auto p1 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t1), mcacc::prEta(t1), mcacc::prPhi(t1), o2::constants::physics::MassProton); auto l1 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), @@ -1681,12 +1709,12 @@ struct lambdaspincorrderived { void processMEV6(EventCandidates const& collisions, AllTrackCandidates const& V0s) { MixBinnerR mb{ - ptMinMixBuffer.value, - ptMaxMixBuffer.value, - static_cast((ptMaxMixBuffer.value - ptMinMixBuffer.value) / cfgKinematicBins.nKinematicPt.value), - v0etaMixBuffer.value, - static_cast((2.0 * v0etaMixBuffer.value) / cfgKinematicBins.nKinematicEta.value), - static_cast((2.0 * TMath::Pi()) / cfgKinematicBins.nKinematicPhi.value), + ptMin.value, + ptMax.value, + ptMix.value, + v0eta.value, + etaMix.value, + phiMix.value, MassMin.value, MassMax.value, cfgV5MassBins.value, @@ -1713,7 +1741,7 @@ struct lambdaspincorrderived { auto slice = V0s.sliceBy(tracksPerCollisionV0, col.index()); for (auto const& t : slice) { - if (!selectionV0Buffer(t)) { + if (!selectionV0(t)) { continue; } @@ -1730,7 +1758,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv.Rapidity()); } - const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), -TMath::Pi(), harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), 0.0, harmonic)); const int mB = mb.massBin(t.lambdaMass()); const int rB = mb.radiusBin(t.v0Radius()); @@ -1778,7 +1806,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv.Rapidity()); } - const int phiB = mb.phiBin(RecoDecay::constrainAngle(tRep.lambdaPhi(), -TMath::Pi(), harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(tRep.lambdaPhi(), 0.0, harmonic)); const int mB = mb.massBin(tRep.lambdaMass()); const int rB = mb.radiusBin(tRep.v0Radius()); @@ -1900,17 +1928,30 @@ struct lambdaspincorrderived { matches2.clear(); } + // --- fill target distributions for the original SE leg that is to be replaced + if (doMixLeg1) { + fillReplacementControlMap(t1.v0Status(), t2.v0Status(), 1, true, + ROOT::Math::PtEtaPhiMVector(t1.lambdaPt(), t1.lambdaEta(), t1.lambdaPhi(), t1.lambdaMass()), + 1.0f); + } + + if (doMixLeg2) { + fillReplacementControlMap(t1.v0Status(), t2.v0Status(), 2, true, + ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass()), + 1.0f); + } const int nReuse = static_cast(matches1.size() + matches2.size()); if (nReuse <= 0) { continue; } - const float wSE = 1.0f / static_cast(nReuse); if (doMixLeg1) { for (auto const& m : matches1) { auto tX = V0s.iteratorAt(static_cast(m.rowIndex)); - + fillReplacementControlMap(tX.v0Status(), t2.v0Status(), 1, false, + ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()), + wSE); auto proton = ROOT::Math::PtEtaPhiMVector(tX.protonPt(), tX.protonEta(), tX.protonPhi(), o2::constants::physics::MassProton); auto lambda = ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()); auto proton2 = ROOT::Math::PtEtaPhiMVector(t2.protonPt(), t2.protonEta(), t2.protonPhi(), o2::constants::physics::MassProton); @@ -1938,7 +1979,9 @@ struct lambdaspincorrderived { if (doMixLeg2) { for (auto const& m : matches2) { auto tY = V0s.iteratorAt(static_cast(m.rowIndex)); - + fillReplacementControlMap(t1.v0Status(), tY.v0Status(), 2, false, + ROOT::Math::PtEtaPhiMVector(tY.lambdaPt(), tY.lambdaEta(), tY.lambdaPhi(), tY.lambdaMass()), + wSE); auto proton = ROOT::Math::PtEtaPhiMVector(t1.protonPt(), t1.protonEta(), t1.protonPhi(), o2::constants::physics::MassProton); auto lambda = ROOT::Math::PtEtaPhiMVector(t1.lambdaPt(), t1.lambdaEta(), t1.lambdaPhi(), t1.lambdaMass()); auto proton2 = ROOT::Math::PtEtaPhiMVector(tY.protonPt(), tY.protonEta(), tY.protonPhi(), o2::constants::physics::MassProton); @@ -1969,12 +2012,12 @@ struct lambdaspincorrderived { void processMCMEV6(EventCandidatesMC const& collisions, AllTrackCandidatesMC const& V0sMC) { MixBinnerR mb{ - ptMinMixBuffer.value, - ptMaxMixBuffer.value, - static_cast((ptMaxMixBuffer.value - ptMinMixBuffer.value) / cfgKinematicBins.nKinematicPt.value), - v0etaMixBuffer.value, - static_cast((2.0 * v0etaMixBuffer.value) / cfgKinematicBins.nKinematicEta.value), - static_cast((2.0 * TMath::Pi()) / cfgKinematicBins.nKinematicPhi.value), + ptMin.value, + ptMax.value, + ptMix.value, + v0eta.value, + etaMix.value, + phiMix.value, MassMin.value, MassMax.value, cfgV5MassBins.value, @@ -2001,7 +2044,7 @@ struct lambdaspincorrderived { auto slice = V0sMC.sliceBy(tracksPerCollisionV0mc, col.index()); for (auto const& t : slice) { - if (!selectionV0BufferMC(t)) { + if (!selectionV0MC(t)) { continue; } @@ -2018,7 +2061,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv.Rapidity()); } - const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), -TMath::Pi(), harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), 0.0, harmonic)); const int mB = mb.massBin(mcacc::lamMass(t)); const int rB = mb.radiusBin(mcacc::v0Radius(t)); @@ -2066,7 +2109,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv.Rapidity()); } - const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(tRep), -TMath::Pi(), harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(tRep), 0.0, harmonic)); const int mB = mb.massBin(mcacc::lamMass(tRep)); const int rB = mb.radiusBin(mcacc::v0Radius(tRep)); @@ -2186,6 +2229,18 @@ struct lambdaspincorrderived { } else { matches2.clear(); } + if (doMixLeg1) { + fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 1, true, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), mcacc::lamMass(t1)), + 1.0f); + } + + if (doMixLeg2) { + fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 2, true, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)), + 1.0f); + } + const int nReuse = static_cast(matches1.size() + matches2.size()); if (nReuse <= 0) { continue; @@ -2196,7 +2251,9 @@ struct lambdaspincorrderived { if (doMixLeg1) { for (auto const& m : matches1) { auto tX = V0sMC.iteratorAt(static_cast(m.rowIndex)); - + fillReplacementControlMap(mcacc::v0Status(tX), mcacc::v0Status(t2), 1, false, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), + wSE); auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), o2::constants::physics::MassProton); auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), @@ -2230,7 +2287,9 @@ struct lambdaspincorrderived { if (doMixLeg2) { for (auto const& m : matches2) { auto tY = V0sMC.iteratorAt(static_cast(m.rowIndex)); - + fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(tY), 2, false, + ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tY), mcacc::lamEta(tY), mcacc::lamPhi(tY), mcacc::lamMass(tY)), + wSE); auto p1 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t1), mcacc::prEta(t1), mcacc::prPhi(t1), o2::constants::physics::MassProton); auto l1 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), From 122280f9dbc2b944987573080ae1d24cad80a666 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Sat, 21 Mar 2026 18:41:34 +0100 Subject: [PATCH 022/282] [PWGHF] Add check for ML score array size in D0 UPC Process function (#15477) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskD0.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 64d228b45d7..e879ba57c9a 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -667,9 +667,12 @@ struct HfTaskD0 { valuesToFill.push_back(static_cast(mass)); valuesToFill.push_back(static_cast(ptCandidate)); if constexpr (FillMl) { - valuesToFill.push_back(candidate.mlProbD0()[0]); - valuesToFill.push_back(candidate.mlProbD0()[1]); - valuesToFill.push_back(candidate.mlProbD0()[2]); + auto const& mlScores = candidate.mlProbD0(); + if (mlScores.size() == 3) { + valuesToFill.push_back(mlScores[0]); + valuesToFill.push_back(mlScores[1]); + valuesToFill.push_back(mlScores[2]); + } } valuesToFill.push_back(static_cast(HfHelper::yD0(candidate))); valuesToFill.push_back(static_cast(d0Type)); From 483d0b570b8035c3d914402f4ec621a2f02e30bc Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Sat, 21 Mar 2026 22:44:46 +0300 Subject: [PATCH 023/282] Update kTVXinHMP alias (#15478) --- Common/CCDB/macros/upload_trigger_aliases_run3.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/CCDB/macros/upload_trigger_aliases_run3.C b/Common/CCDB/macros/upload_trigger_aliases_run3.C index e946d9117d4..4e26ade06cc 100644 --- a/Common/CCDB/macros/upload_trigger_aliases_run3.C +++ b/Common/CCDB/macros/upload_trigger_aliases_run3.C @@ -30,7 +30,7 @@ void createDefaultAliases(map& mAliases) mAliases[kTVXinTRD] = "CMTVX-B-NOPF-TRD,minbias_TVX"; mAliases[kTVXinEMC] = "C0TVX-B-NOPF-EMC,minbias_TVX_L0,CMTVXTSC-B-NOPF-EMC,CMTVXTCE-B-NOPF-EMC"; mAliases[kTVXinPHOS] = "C0TVX-B-NOPF-PHSCPV,minbias_TVX_L0,CMTVXTSC-B-NOPF-PHSCPV,CMTVXTSC-B-NOPF-PHSCPV"; - mAliases[kTVXinHMP] = "C0TVX-B-NOPF-HMP,minbias_TVX_L0,CMTVXTSC-B-NOPF-HMP"; + mAliases[kTVXinHMP] = "C0TVX-B-NOPF-HMP,minbias_TVX_L0,CMTVXTSC-B-NOPF-HMP,CMTVX-B-NOPF-HMP"; mAliases[kPHOS] = "CTVXPH0-B-NOPF-PHSCPV,mb_PH0_TVX,CPH0SC-B-NOPF-PHSCPV,CPH0CE-B-NOPF-PHSCPV"; } From 04a64179cb9e76fd038b03b1dab98ba73edb7e74 Mon Sep 17 00:00:00 2001 From: somabhatta <48771326+somabhatta@users.noreply.github.com> Date: Sat, 21 Mar 2026 22:42:34 +0100 Subject: [PATCH 024/282] [PWGCF] Fixing Collision Matching (#15479) --- .../Tasks/radialFlowDecorr.cxx | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx b/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx index ba43045979e..0a20e7e9ca0 100644 --- a/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx @@ -658,13 +658,17 @@ struct RadialFlowDecorr { return (effidx == 0) ? 1.0f : 0.0f; } TH3F* h = (effidx == 0) ? state.hEff[pidType] : state.hFake[pidType]; - if (!h) { - return (effidx == 0) ? 1.0f : 0.0f; // Safe defaults if map is missing - } + + if (!h) + return -1; + int ibx = h->GetXaxis()->FindBin(mult); int iby = h->GetYaxis()->FindBin(pt); int ibz = h->GetZaxis()->FindBin(eta); float val = h->GetBinContent(ibx, iby, ibz); + + if (effidx == 0) + return (val > 0.f) ? val : 1.0f; return val; } @@ -1302,7 +1306,6 @@ struct RadialFlowDecorr { loadLimits("Hist2D_globalTracks_cent", state.mLimitsNchCent, state.mMinXNchCent, state.mMaxXNchCent); } } - if (!cfgRunGetEff && (cfgFlat)) { if (cfgRunDataMean || cfgRunDataFluc) { LOGF(info, "Data Run: Loading flattening maps from %s", pathDataFlat.c_str()); @@ -1448,6 +1451,9 @@ struct RadialFlowDecorr { histos.fill(HIST("Hist2D_PVTracks_cent"), cent, multPV); for (const auto& track : mcTracks) { + if (track.collisionId() != mcCollision.index()) + continue; + if (!isTrackSelected(track)) continue; fillNSigmaBefCut(track, cent); @@ -1476,6 +1482,9 @@ struct RadialFlowDecorr { histos.fill(HIST("Hist2D_PVTracks_cent"), cent, multPV); for (const auto& particle : mcParticles) { + if (particle.mcCollisionId() != mcCollision.mcCollisionId()) + continue; + if (!isParticleSelected(particle) || !particle.isPhysicalPrimary()) continue; @@ -1520,6 +1529,9 @@ struct RadialFlowDecorr { } for (const auto& track : mcTracks) { + if (track.collisionId() != mcCollision.index()) + continue; + if (!isTrackSelected(track)) continue; @@ -1733,6 +1745,9 @@ struct RadialFlowDecorr { histos.fill(HIST("Hist2D_globalTracks_cent"), cent, mcTracks.size()); histos.fill(HIST("Hist2D_PVTracks_cent"), cent, multPV); for (const auto& track : mcTracks) { + if (track.collisionId() != mcCollision.index()) + continue; + if (!isTrackSelected(track)) continue; @@ -1836,6 +1851,9 @@ struct RadialFlowDecorr { memset(sumWiptiRecoEffCorr, 0, sizeof(sumWiptiRecoEffCorr)); for (const auto& particle : mcParticles) { + if (particle.mcCollisionId() != mcCollision.mcCollisionId()) + continue; + if (!isParticleSelected(particle) || !particle.isPhysicalPrimary()) continue; float pt = particle.pt(), eta = particle.eta(); @@ -1880,6 +1898,9 @@ struct RadialFlowDecorr { } for (const auto& track : mcTracks) { + if (track.collisionId() != mcCollision.index()) + continue; + if (!isTrackSelected(track)) continue; float pt = track.pt(), eta = track.eta(), phi = track.phi(); @@ -2198,6 +2219,9 @@ struct RadialFlowDecorr { double p1kBarFt0A = 0.0, p1kBarFt0C = 0.0; for (const auto& particle : mcParticles) { + if (particle.mcCollisionId() != mcCollision.mcCollisionId()) + continue; + if (!isParticleSelected(particle) || !particle.isPhysicalPrimary()) continue; @@ -2238,6 +2262,9 @@ struct RadialFlowDecorr { } // end truth loop for (const auto& track : mcTracks) { + if (track.collisionId() != mcCollision.index()) + continue; + if (!isTrackSelected(track)) continue; From 1c6cba6bd345306f47720322d1f888bf987f2e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Jos=C3=A9?= <52935244+lucasjsilva@users.noreply.github.com> Date: Sun, 22 Mar 2026 14:43:21 +0100 Subject: [PATCH 025/282] [PWGLF] Treatment for the count of reconstructed tracks (#15473) Co-authored-by: ALICE Action Bot --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index d4ab4f132ac..cab9f30cb9a 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -12,7 +12,7 @@ /// \file studyPnch.cxx /// /// \brief task for analysis of charged-particle multiplicity distributions -/// \author Abhi Modak (abhi.modak@cern.ch) +/// \author Abhi Modak (abhi.modak@cern.ch), Lucas José (lucas.jose.franco.da.silva@cern.ch) /// \since September 10, 2025 #include "PWGLF/DataModel/LFStrangenessTables.h" @@ -42,6 +42,7 @@ #include #include +#include #include using namespace o2; @@ -96,6 +97,7 @@ struct StudyPnch { ConfigurableAxis ft0aMultHistBin{"ft0aMultHistBin", {501, -0.5, 500.5}, ""}; ConfigurableAxis ft0cMultHistBin{"ft0cMultHistBin", {501, -0.5, 500.5}, ""}; ConfigurableAxis ptHistBin{"ptHistBin", {200, 0., 20.}, ""}; + ConfigurableAxis countNumberTracks{"countNumberTracks", {10, -0.5, 9.5}, ""}; Configurable isApplyTFcut{"isApplyTFcut", true, "Enable TimeFrameBorder cut"}; Configurable isApplyITSROcut{"isApplyITSROcut", true, "Enable ITS ReadOutFrameBorder cut"}; @@ -112,6 +114,7 @@ struct StudyPnch { AxisSpec axisFt0aMult = {ft0aMultHistBin, "ft0a", "FT0AMultAxis"}; AxisSpec axisFt0cMult = {ft0cMultHistBin, "ft0c", "FT0CMultAxis"}; AxisSpec axisPt = {ptHistBin, "pT", "pTAxis"}; + AxisSpec axisCountNumberTracks = {countNumberTracks, "Count", "CountAxis"}; histos.add("EventHist", "EventHist", kTH1D, {axisEvent}, false); histos.add("VtxZHist", "VtxZHist", kTH1D, {axisVtxZ}, false); @@ -143,6 +146,7 @@ struct StudyPnch { histos.add("hMultiplicityMCrec", "hMultiplicityMCrec", kTH1F, {axisMult}, true); histos.add("hMultiplicityMCgen", "hMultiplicityMCgen", kTH1F, {axisMult}, true); histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true); + histos.add("hCountNTracks", "hCountNTracks", kTH1F, {axisCountNumberTracks}, true); } if (doprocessEvtLossSigLossMC) { histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); @@ -261,6 +265,7 @@ struct StudyPnch { int countNTracksMcCol(countTrk const& tracks, McColType const& McCol) { auto nTrk = 0; + std::unordered_map recoFrequencies; // Map that stores globalIndex and the times it appears for (const auto& track : tracks) { if (!isTrackSelected(track)) { continue; @@ -271,18 +276,23 @@ struct StudyPnch { if (particle.mcCollisionId() != McCol.mcCollisionId()) { continue; } + auto globalIndex = particle.globalIndex(); + recoFrequencies[globalIndex]++; // Increment the count for this globalIndex } histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); - nTrk++; } + // Once all the frequencies have been counted, a loop can be made to fill the histogram + for (const auto& [globalIndex, frequency] : recoFrequencies) { + histos.fill(HIST("hCountNTracks"), frequency); + // Fill histogram with not cloned tracks + if (frequency == 1) { + nTrk++; + } + } + // return recoFrequencies; return nTrk; } - bool isINELgt0(auto nTrk) - { - return nTrk > 0; - } - Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) && ncheckbit(aod::track::trackCutFlag, TrackSelectionIts); Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC), @@ -296,7 +306,7 @@ struct StudyPnch { return; } auto mult = countNTracks(tracks); - if (isINELgt0(mult)) { + if (mult > 0) { histos.fill(HIST("hMultiplicityData"), mult); } } From 4a6676ac3ff0942954e9b50e4bab31116378b36b Mon Sep 17 00:00:00 2001 From: rolavick Date: Sun, 22 Mar 2026 15:25:31 +0100 Subject: [PATCH 026/282] [PWGUD] UpcCandGlobalMuons fix - adding forgotten propagation function call (#15480) --- .../TableProducer/upcCandProducerGlobalMuon.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index cc756d6ea9c..c97704fe2ce 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -379,7 +379,21 @@ struct UpcCandProducerGlobalMuon { } if (fUpcCuts.getUseFwdCuts()) { - auto pft = propagateToZero(track); + bool isGlobal = track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || + track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack; + o2::dataformats::GlobalFwdTrack pft; + if (isGlobal && fEnableMFT) { + // For global tracks, use MFT helix propagation to vertex instead of + // MCH extrapolation, which fails because the track z is upstream of + // the front absorber (z ~ -60 cm vs absorber at z ~ -90 cm) + o2::track::TrackParCovFwd trackPar = o2::aod::fwdtrackutils::getTrackParCovFwdShift(track, fZShift); + trackPar.propagateToZhelix(0., fBz); + pft.setParameters(trackPar.getParameters()); + pft.setZ(trackPar.getZ()); + pft.setCovariances(trackPar.getCovariances()); + } else { + pft = propagateToZero(track); + } bool pass = cut(pft, track); if (!pass) return false; From c3472351b6035517008f091a9772b5eebc9b363d Mon Sep 17 00:00:00 2001 From: omvazque Date: Sun, 22 Mar 2026 11:08:09 -0600 Subject: [PATCH 027/282] [PWGLF] Allows track-selection variations for systematics (#15482) --- PWGLF/Tasks/Nuspex/piKpRAA.cxx | 496 ++++++++++++++++++--------------- 1 file changed, 264 insertions(+), 232 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index 6dcabaea755..fdddc29f9e1 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -77,30 +77,27 @@ using ColEvSelsMC = soa::Join; using TracksMC = soa::Join; -// using SimTracks = soa::Join; static constexpr int kNEtaHists{8}; std::array, kNEtaHists> dEdxPiV0{}; std::array, kNEtaHists> dEdxPrV0{}; std::array, kNEtaHists> dEdxElV0{}; -std::array, kNEtaHists> dEdxPiTOF{}; +std::array, kNEtaHists> dEdxPiMC{}; +std::array, kNEtaHists> dEdxMuMC{}; +std::array, kNEtaHists> dEdxPiMCLoSel{}; +std::array, kNEtaHists> dEdxMuMCLoSel{}; std::array, kNEtaHists> dEdx{}; -std::array, kNEtaHists> nClVsdEdxPiV0{}; -std::array, kNEtaHists> nClVsdEdxElV0{}; -std::array, kNEtaHists> nClVsdEdxPrV0{}; std::array, kNEtaHists> pTVsP{}; std::array, kNEtaHists> nClVsP{}; std::array, kNEtaHists> nClVsPElV0{}; std::array, kNEtaHists> nClVsPPiV0{}; std::array, kNEtaHists> nClVsPPrV0{}; +std::array, kNEtaHists> nClVsPPiMC{}; std::array, kNEtaHists> nClVsPp{}; std::array, kNEtaHists> nClVsPpElV0{}; std::array, kNEtaHists> nClVsPpPiV0{}; std::array, kNEtaHists> nClVsPpPrV0{}; -std::array, kNEtaHists> nClVsdEdxpPiV0{}; -std::array, kNEtaHists> nClVsdEdxpElV0{}; -std::array, kNEtaHists> nClVsdEdxpPrV0{}; struct PiKpRAA { @@ -130,25 +127,16 @@ struct PiKpRAA { static constexpr float kLowEta[kNEtaHists] = {-0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6}; static constexpr float kHighEta[kNEtaHists] = {-0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8}; - // static constexpr float kLowEta[kNEtaHists] = {0.0, 0.2, 0.4, 0.6}; static constexpr float DefaultLifetimeCuts[1][2] = {{30., 20.}}; Configurable> lifetimecut{"lifetimecut", {DefaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"}; struct : ConfigurableGroup { - Configurable v0TypeSelection{"v0TypeSelection", 1, "select on a certain V0 type (leave negative if no selection desired)"}; - Configurable useOfficialV0sSelOfDaughters{"useOfficialV0sSelOfDaughters", true, "Use the same track selection for daughters as the V0s analysis in OO"}; + Configurable minEta{"minEta", -0.8, "Daughter minimum-eta selection"}; + Configurable maxEta{"maxEta", +0.8, "Daughter maximum-eta selection"}; + Configurable minPt{"minPt", 0.1, "minimum pt of the tracks"}; + Configurable maxPt{"maxPt", 10000000000.0, "maximum pt of the tracks"}; - // Selection criteria: acceptance - Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; - Configurable minEtaDaughter{"minEtaDaughter", -0.8, "Daughter minimum-eta selection"}; - Configurable maxEtaDaughter{"maxEtaDaughter", +0.8, "Daughter maximum-eta selection"}; - Configurable minPt{"minPt", 0.15, "minimum pt of the tracks"}; - Configurable maxPt{"maxPt", 20.0, "maximum pt of the tracks"}; - Configurable minPtDaughter{"minPtDaughter", 0.15, "minimum pt of the tracks"}; - Configurable maxPtDaughter{"maxPtDaughter", 20.0, "maximum pt of the tracks"}; - Configurable useNclsPID{"useNclsPID", true, "Use Ncl for PID?"}; - Configurable minNcl{"minNcl", 135, "minimum found Ncl in TPC"}; Configurable minNCrossedRows{"minNCrossedRows", 70, "minimum number of crossed rows"}; Configurable minNCrossedRowsOverFindableCls{"minNCrossedRowsOverFindableCls", 0.8, "min N crossed rows over findable Cls"}; Configurable maxChi2ClsTPC{"maxChi2ClsTPC", 4.0, "Max chi2 per Cls TPC"}; @@ -158,7 +146,24 @@ struct PiKpRAA { Configurable tpcRefit{"tpcRefit", true, "Require TPC refit"}; Configurable chi2Golden{"chi2Golden", true, "Require Chi2 golde selection"}; Configurable its1HitIB{"its1HitIB", true, "Require one hit in the ITS IB"}; - Configurable requireITShit{"requireITShit", true, "Apply requirement of one hit in the ITS IB?"}; + + // Phi cut + Configurable applyPhiCut{"applyPhiCut", false, "Apply geometrical cut?"}; + Configurable applyEtaCal{"applyEtaCal", false, "Apply eta calibration?"}; + Configurable applyPlateauSel{"applyPlateauSel", false, "Apply eta calibration?"}; + Configurable usePinPhiSelection{"usePinPhiSelection", true, "Uses Phi selection as a function of P or Pt?"}; + Configurable applyNclSel{"applyNclSel", false, "Apply Min. found Ncl in TPC?"}; + } trackSelections; + + struct : ConfigurableGroup { + Configurable v0TypeSelection{"v0TypeSelection", 1, "select on a certain V0 type (leave negative if no selection desired)"}; + Configurable useOfficialV0sSelOfDaughters{"useOfficialV0sSelOfDaughters", true, "Use the same track selection for daughters as the V0s analysis in OO"}; + Configurable useTPCNsigma{"useTPCNsigma", false, "Include TPC Nsigma selection on decay products"}; + + // Selection criteria: acceptance + Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; + Configurable useNclsPID{"useNclsPID", true, "Use Ncl for PID?"}; + Configurable minNcl{"minNcl", 135, "minimum found Ncl in TPC"}; // Standard 5 topological criteria Configurable v0cospa{"v0cospa", 0.995, "min V0 CosPA"}; @@ -188,15 +193,7 @@ struct PiKpRAA { // PID (TPC/TOF) Configurable dEdxPlateauSel{"dEdxPlateauSel", 50, "dEdx selection for electrons"}; - Configurable tpcPidNsigmaCut{"tpcPidNsigmaCut", 5, "tpcPidNsigmaCut"}; - Configurable maxExpTOFPi{"maxExpTOFPi", 0.00005, "Maximum beta TOF selection"}; - - // Phi cut - Configurable applyPhiCut{"applyPhiCut", false, "Apply geometrical cut?"}; - Configurable applyEtaCal{"applyEtaCal", false, "Apply eta calibration?"}; - Configurable applyPlateauSel{"applyPlateauSel", false, "Apply eta calibration?"}; - Configurable usePinPhiSelection{"usePinPhiSelection", true, "Uses Phi selection as a function of P or Pt?"}; - Configurable applyNclSel{"applyNclSel", false, "Apply Min. found Ncl in TPC?"}; + Configurable pidNsigmaCut{"pidNsigmaCut", 3.0, "pidNsigmaCut"}; } v0Selections; // Configurables Event Selection @@ -342,31 +339,48 @@ struct PiKpRAA { } etaCal; TrackSelection trkSelGlobalOpenDCAxy; - // TrackSelection trkSelDaugthers; TrackSelection trkSelGlobal; - // TrackSelection trkSelDaugthersV0s() { - // TrackSelection selectedTracks; - // selectedTracks.SetEtaRange(-0.8f, 0.8f); - // selectedTracks.SetMinNCrossedRowsTPC(70); - // return selectedTracks; - // } TrackSelection trkSelOpenDCAxy() { TrackSelection selectedTracks; - selectedTracks.SetTrackType(o2::aod::track::TrackTypeEnum::Track); // Run 2 track asked by default - selectedTracks.SetPtRange(0.1f, 1e10f); - selectedTracks.SetEtaRange(-0.8f, 0.8f); - selectedTracks.SetRequireITSRefit(true); - selectedTracks.SetRequireTPCRefit(true); - selectedTracks.SetRequireGoldenChi2(true); - selectedTracks.SetMinNCrossedRowsTPC(70); - selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.8f); - selectedTracks.SetMaxChi2PerClusterTPC(4.f); - selectedTracks.SetRequireHitsInITSLayers(1, {0, 1}); // one hit in any SPD layer - selectedTracks.SetMaxChi2PerClusterITS(36.f); - // selectedTracks.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); }); - selectedTracks.SetMaxDcaZ(2.f); + selectedTracks.SetTrackType(o2::aod::track::TrackTypeEnum::Track); // Run 3 track asked by default + selectedTracks.SetPtRange(trackSelections.minPt, trackSelections.maxPt); + selectedTracks.SetEtaRange(trackSelections.minEta, trackSelections.maxEta); + selectedTracks.SetRequireITSRefit(trackSelections.itsRefit); + selectedTracks.SetRequireTPCRefit(trackSelections.tpcRefit); + selectedTracks.SetRequireGoldenChi2(trackSelections.chi2Golden); + selectedTracks.SetMinNCrossedRowsTPC(trackSelections.minNCrossedRows); + selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(trackSelections.minNCrossedRowsOverFindableCls); + selectedTracks.SetMaxChi2PerClusterTPC(trackSelections.maxChi2ClsTPC); + if (trackSelections.its1HitIB) + selectedTracks.SetRequireHitsInITSLayers(1, {0, 1, 2}); // one hit in any layer of the inner barrel + if (!trackSelections.its1HitIB) + selectedTracks.SetRequireHitsInITSLayers(7, {0, 1, 2, 3, 4, 5, 6}); // one hit in every of the seven layers + selectedTracks.SetMaxChi2PerClusterITS(trackSelections.maxChi2ClsITS); + selectedTracks.SetMaxDcaZ(trackSelections.maxDCAZ); + return selectedTracks; + } + + TrackSelection trkSelGlb() + { + TrackSelection selectedTracks; + selectedTracks.SetTrackType(o2::aod::track::TrackTypeEnum::Track); // Run 3 track asked by default + selectedTracks.SetPtRange(trackSelections.minPt, trackSelections.maxPt); + selectedTracks.SetEtaRange(trackSelections.minEta, trackSelections.maxEta); + selectedTracks.SetRequireITSRefit(trackSelections.itsRefit); + selectedTracks.SetRequireTPCRefit(trackSelections.tpcRefit); + selectedTracks.SetRequireGoldenChi2(trackSelections.chi2Golden); + selectedTracks.SetMinNCrossedRowsTPC(trackSelections.minNCrossedRows); + selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(trackSelections.minNCrossedRowsOverFindableCls); + selectedTracks.SetMaxChi2PerClusterTPC(trackSelections.maxChi2ClsTPC); + if (trackSelections.its1HitIB) + selectedTracks.SetRequireHitsInITSLayers(1, {0, 1, 2}); // one hit in any layer of the inner barrel + if (!trackSelections.its1HitIB) + selectedTracks.SetRequireHitsInITSLayers(7, {0, 1, 2, 3, 4, 5, 6}); // one hit in every of the seven layers + selectedTracks.SetMaxChi2PerClusterITS(trackSelections.maxChi2ClsITS); + selectedTracks.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); }); + selectedTracks.SetMaxDcaZ(trackSelections.maxDCAZ); return selectedTracks; } @@ -383,11 +397,10 @@ struct PiKpRAA { currentRunNumberNchSel = -1; currentRunNumberPhiSel = -1; trkSelGlobalOpenDCAxy = trkSelOpenDCAxy(); - // trkSelDaugthers = trkSelDaugthersV0s(); - trkSelGlobal = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default); + trkSelGlobal = trkSelGlb(); // define axes you want to use - const std::string titlePorPt{v0Selections.usePinPhiSelection ? "#it{p} (GeV/#it{c})" : "#it{p}_{T} (GeV/#it{c})"}; + const std::string titlePorPt{trackSelections.usePinPhiSelection ? "#it{p} (GeV/#it{c})" : "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec axisZpos{binsZpos, "Vtx_{z} (cm)"}; const AxisSpec axisEvent{22, 0.5, 22.5, ""}; const AxisSpec axisNcl{161, -0.5, 160.5, "#it{N}_{cl} TPC"}; @@ -410,8 +423,13 @@ struct PiKpRAA { registry.add("NchVsCent", "Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch", kTH2F, {{axisCent, {nBinsNch, minNch, maxNch}}}); registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta}); + registry.add("NclVsEta", ";#eta;Found Ncl TPC", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); + registry.add("NclVsEtap", ";#eta;Found #LTNcl#GT TPC", kTProfile, {axisEta}); + registry.add("NclVsPt", ";#eta;Found Ncl TPC", kTH2F, {{{axisPtNcl}, {161, -0.5, 160.5}}}); + registry.add("NclVsPtPID", ";#eta;PID Ncl", kTH2F, {{{axisPtNcl}, {161, -0.5, 160.5}}}); registry.add("dcaVsPtPi", "Primary pions;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent}); registry.add("dcaVsPtPr", "Primary protons;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent}); + registry.add("TrackDaughterCounter", "itsrefit, and itshit NOT appplied for electrons sel.;Trk Sel.; Entries;", kTH1F, {{14, 0.5, 14.5}}); auto hstat = registry.get(HIST("EventCounter")); auto* x = hstat->GetXaxis(); @@ -452,7 +470,6 @@ struct PiKpRAA { registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}}); registry.add("ExcludedEvtVsNch", ";Nch;Entries;", kTH1F, {{nBinsNch, minNch, maxNch}}); registry.add("ExcludedEvtVsNPV", ";NPV;Entries;", kTH1F, {{nBinsNPV, minNpv, maxNpv}}); - registry.add("TrackDaughterCounter", "itsrefit, and itshit NOT appplied for electrons sel.;Trk Sel.; Entries;", kTH1F, {{14, 0.5, 14.5}}); registry.add("V0sCounter", ";V0 type; Entries;", kTH1F, {{4, 0.5, 4.5}}); registry.add("dcaDauVsPt", ";V0 #it{p}_{T} (GeV/#it{c});DCA_{xy} (cm) daughters;", kTH2F, {axisPt, axisDCAxy}); registry.add("nSigPiFromK0s", ";#it{n#sigma};;", kTH2F, {axisPtV0s, axisNsigmaTPC}); @@ -477,8 +494,6 @@ struct PiKpRAA { registry.add("NclVsPhipBeforeCutPID", Form("#LTNcl#GT used for PID;%s (GeV/#it{c});#varphi", titlePorPt.data()), kTProfile2D, {{{axisXPhiCut}, {350, 0.0, 0.35}}}); registry.add("NclVsPhipAfterCut", Form("Found #LTNcl#GT TPC;%s (GeV/#it{c});#varphi", titlePorPt.data()), kTProfile2D, {{{axisXPhiCut}, {350, 0.0, 0.35}}}); registry.add("NclVsPhipAfterCutPID", Form("#LTNcl#GT used for PID;%s (GeV/#it{c});#varphi", titlePorPt.data()), kTProfile2D, {{{axisXPhiCut}, {350, 0.0, 0.35}}}); - registry.add("NclVsEta", ";#eta;Found Ncl TPC", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); - registry.add("NclVsEtap", ";#eta;Found #LTNcl#GT TPC", kTProfile, {axisEta}); registry.add("NclVsEtaPiMIP", "MIP #pi^{+} + #pi^{-} (0.4 < #it{p} < 0.6 GeV/#it{c}, 40 < dE/dx < 60);#eta;Ncl TPC", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); registry.add("NclVsEtaPiMIPp", "MIP #pi^{+} + #pi^{-} (0.4 < #it{p} < 0.6 GeV/#it{c}, 40 < dE/dx < 60);#eta;#LTNcl#GT TPC", kTProfile, {axisEta}); @@ -497,12 +512,10 @@ struct PiKpRAA { registry.add("EtaVsYPrAL", ";#eta;#it{y};", kTH2F, {axisEta, axisY}); registry.add("EtaVsYG", ";#eta;#it{y};", kTH2F, {axisEta, axisY}); - // registry.add("TOFExpPi2TOF", ";Momentum (GeV/#it{c});t^{#pi}_{Exp}/t_{TOF}", kTH2F, {{{axisPtV0s}, {100, 0.2, 1.2}}}); registry.add("DCAxyPtPiK0s", ";DCA_{xy} (cm); p_{T} (GeV/c)", kTH2F, {axisDCAxy, axisPt}); registry.add("DCAxyPtPrL", ";DCA_{xy} (cm); p_{T} (GeV/c)", kTH2F, {axisDCAxy, axisPt}); registry.add("DCAxyPtPrAL", ";DCA_{xy} (cm); p_{T} (GeV/c)", kTH2F, {axisDCAxy, axisPt}); - // registry.add("betaVsMomentum", ";Momentum (GeV/#it{c}); #beta", kTH2F, {{{axisPtV0s}, {500, 0, 1.2}}}); registry.add("dEdxVsEtaPiMIP", "MIP #pi^{+} + #pi^{-} (0.4 < #it{p} < 0.6 GeV/#it{c});#eta; dE/dx;", kTH2F, {{{axisEta}, {100, 0, 100}}}); registry.add("dEdxVsEtaPiMIPp", "MIP #pi^{+} + #pi^{-} (0.4 < #it{p} < 0.6 GeV/#it{c});#eta; #LTdE/dx#GT", kTProfile, {axisEta}); registry.add("dEdxVsEtaElMIP", "MIP e^{+} + e^{-} (0.3 < #it{p} < 0.45 GeV/#it{c});#eta; dE/dx;", kTH2F, {{{axisEta}, {100, 0, 100}}}); @@ -520,10 +533,6 @@ struct PiKpRAA { dEdxPiV0[i] = registry.add(Form("dEdxPiV0_%s", endingEta[i]), Form("#pi^{+} + #pi^{-}, %s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); dEdxPrV0[i] = registry.add(Form("dEdxPrV0_%s", endingEta[i]), Form("p + #bar{p}, %s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); dEdxElV0[i] = registry.add(Form("dEdxElV0_%s", endingEta[i]), Form("e^{+} + e^{-}, %s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); - dEdxPiTOF[i] = registry.add(Form("dEdxPiTOF_%s", endingEta[i]), Form("#pi^{+} + #pi^{-}, %s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); - nClVsdEdxPiV0[i] = registry.add(Form("NclVsdEdxPiV0_%s", endingEta[i]), Form("%s;#it{N}_{cl} used for PID;dE/dx;", latexEta[i]), kTH2F, {axisNcl, axisdEdx}); - nClVsdEdxElV0[i] = registry.add(Form("NclVsdEdxElV0_%s", endingEta[i]), Form("%s;#it{N}_{cl} used for PID;dE/dx;", latexEta[i]), kTH2F, {axisNcl, axisdEdx}); - nClVsdEdxPrV0[i] = registry.add(Form("NclVsdEdxPrV0_%s", endingEta[i]), Form("%s;#it{N}_{cl} used for PID;dE/dx;", latexEta[i]), kTH2F, {axisNcl, axisdEdx}); nClVsP[i] = registry.add(Form("NclVsPPrimaries_%s", endingEta[i]), Form("%s;;Ncl TPC", latexEta[i]), kTH2F, {axisPtNcl, axisNcl}); nClVsPElV0[i] = registry.add(Form("NclVsPElV0_%s", endingEta[i]), Form("%s;;Ncl TPC", latexEta[i]), kTH2F, {axisPtNcl, axisNcl}); nClVsPPiV0[i] = registry.add(Form("NclVsPPiV0_%s", endingEta[i]), Form("%s;;Ncl TPC", latexEta[i]), kTH2F, {axisPtNcl, axisNcl}); @@ -532,9 +541,6 @@ struct PiKpRAA { nClVsPpElV0[i] = registry.add(Form("NclVsPElV0p_%s", endingEta[i]), Form("%s;;#LT#it{N}_{cl}#GT TPC", latexEta[i]), kTProfile, {axisPtNcl}); nClVsPpPiV0[i] = registry.add(Form("NclVsPPiV0p_%s", endingEta[i]), Form("%s;;#LT#it{N}_{cl}#GT TPC", latexEta[i]), kTProfile, {axisPtNcl}); nClVsPpPrV0[i] = registry.add(Form("NclVsPPrV0p_%s", endingEta[i]), Form("%s;;#LT#it{N}_{cl}#GT TPC", latexEta[i]), kTProfile, {axisPtNcl}); - nClVsdEdxpElV0[i] = registry.add(Form("NclVsdEdxElV0p_%s", endingEta[i]), Form("%s;;#LTd#it{E}/d#it{x}#GT", latexEta[i]), kTProfile, {axisNcl}); - nClVsdEdxpPiV0[i] = registry.add(Form("NclVsdEdxPiV0p_%s", endingEta[i]), Form("%s;;#LTd#it{E}/d#it{x}#GT", latexEta[i]), kTProfile, {axisNcl}); - nClVsdEdxpPrV0[i] = registry.add(Form("NclVsdEdxPrV0p_%s", endingEta[i]), Form("%s;;#LTd#it{E}/d#it{x}#GT", latexEta[i]), kTProfile, {axisNcl}); } auto htrkSel = registry.get(HIST("TrackDaughterCounter")); @@ -619,6 +625,14 @@ struct PiKpRAA { registry.add("MCclosure_PtPiVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch (|#eta|<0.8);", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}}); registry.add("MCclosure_PtKaVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch (|#eta|<0.8);", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}}); registry.add("MCclosure_PtPrVsNchMC", "Gen Evts With at least one Rec. Coll. + Sel. criteria 4 MC closure;;Gen. Nch (|#eta|<0.8);", kTH2F, {{axisPt, {nBinsNch, minNch, maxNch}}}); + + for (int i = 0; i < kNEtaHists; ++i) { + nClVsPPiMC[i] = registry.add(Form("NclVsPPi_%s", endingEta[i]), Form("%s;;Ncl", latexEta[i]), kTH2F, {axisPtNcl, axisNcl}); + dEdxPiMC[i] = registry.add(Form("dEdxPi_%s", endingEta[i]), Form("%s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); + dEdxMuMC[i] = registry.add(Form("dEdxMu_%s", endingEta[i]), Form("%s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); + dEdxPiMCLoSel[i] = registry.add(Form("dEdxPiLooseSel_%s", endingEta[i]), Form("%s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); + dEdxMuMCLoSel[i] = registry.add(Form("dEdxMuLooseSel_%s", endingEta[i]), Form("%s;Momentum (GeV/#it{c});dE/dx;", latexEta[i]), kTH2F, {axisPtV0s, axisdEdx}); + } } LOG(info) << "\trequireGoodRct=" << requireGoodRct.value; @@ -628,17 +642,14 @@ struct PiKpRAA { LOG(info) << "\tv0TypeSelection=" << static_cast(v0Selections.v0TypeSelection); LOG(info) << "\tselElecFromGammas=" << v0Selections.selElecFromGammas; LOG(info) << "\tapplyInvMassSel=" << v0Selections.applyInvMassSel; - LOG(info) << "\trequireITShit=" << v0Selections.requireITShit; - LOG(info) << "\tminPt=" << v0Selections.minPt; - LOG(info) << "\tmaxPt=" << v0Selections.maxPt; - LOG(info) << "\tminPtDaughter=" << v0Selections.minPtDaughter; - LOG(info) << "\tmaxPtDaughter=" << v0Selections.maxPtDaughter; + LOG(info) << "\tminPt=" << trackSelections.minPt; + LOG(info) << "\tmaxPt=" << trackSelections.maxPt; LOG(info) << "\tuseNclsPID=" << v0Selections.useNclsPID; LOG(info) << "\tqTSel=" << v0Selections.qTSel; LOG(info) << "\tarmAlphaSel=" << v0Selections.armAlphaSel; - LOG(info) << "\tapplyNclSel=" << v0Selections.applyNclSel; - LOG(info) << "\tapplyPhiCut=" << v0Selections.applyPhiCut; - LOG(info) << "\tusePinPhiSelection=" << v0Selections.usePinPhiSelection; + LOG(info) << "\tapplyNclSel=" << trackSelections.applyNclSel; + LOG(info) << "\tapplyPhiCut=" << trackSelections.applyPhiCut; + LOG(info) << "\tusePinPhiSelection=" << trackSelections.usePinPhiSelection; LOG(info) << "\ttitlePorPt=" << titlePorPt; LOG(info) << "\tcurrentRunNumberNchSel=" << currentRunNumberNchSel; LOG(info) << "\tcurrentRunNumberPhiSel=" << currentRunNumberPhiSel; @@ -655,27 +666,27 @@ struct PiKpRAA { LOG(info) << "\tpathSigmaNch=" << pathSigmaNch.value; } - if (v0Selections.applyPhiCut) { + if (trackSelections.applyPhiCut) { LOG(info) << "\tLoading Phi cut!"; LOG(info) << "\tpathPhiCutLow=" << pathPhiCutLow.value; LOG(info) << "\tpathPhiCutHigh=" << pathPhiCutHigh.value; } - if (v0Selections.applyEtaCal) { + if (trackSelections.applyEtaCal) { LOG(info) << "\tLoading Eta Cal!"; LOG(info) << "\tpathEtaCal=" << pathEtaCal.value; loadEtaCalibration(); LOG(info) << "\tisMIPCalLoaded=" << etaCal.isMIPCalLoaded; } - if (v0Selections.applyPlateauSel) { + if (trackSelections.applyPlateauSel) { LOG(info) << "\tLoading Eta Plateau Cal!"; LOG(info) << "\tpathEtaCalPlateau=" << pathEtaCalPlateau.value; loadEtaPlateauCalibration(); LOG(info) << "\tisCalPlateauLoaded=" << etaCal.isCalPlateauLoaded; } - if (v0Selections.applyNclSel) + if (trackSelections.applyNclSel) LOG(info) << "\t minNcl=" << v0Selections.minNcl; } @@ -794,7 +805,7 @@ struct PiKpRAA { registry.fill(HIST("zPos"), collision.posZ()); registry.fill(HIST("NchVsCent"), centrality, nch); - if (v0Selections.applyPhiCut) { + if (trackSelections.applyPhiCut) { const int nextRunNumber{foundBC.runNumber()}; if (currentRunNumberPhiSel != nextRunNumber) { loadPhiCutSelections(timeStamp); @@ -814,28 +825,28 @@ struct PiKpRAA { if (!trkSelGlobalOpenDCAxy.IsSelected(track)) continue; - if (track.pt() < v0Selections.minPt || track.pt() > v0Selections.maxPt) + if (track.pt() < trackSelections.minPt || track.pt() > trackSelections.maxPt) continue; - if (track.eta() < v0Selections.minEtaDaughter || track.eta() > v0Selections.maxEtaDaughter) + if (track.eta() < trackSelections.minEta || track.eta() > trackSelections.maxEta) continue; const float momentum{track.p()}; const float pt{track.pt()}; const float phi{track.phi()}; - const float pOrPt{v0Selections.usePinPhiSelection ? momentum : pt}; + const float pOrPt{trackSelections.usePinPhiSelection ? momentum : pt}; const int16_t nclFound{track.tpcNClsFound()}; const int16_t nclPID{track.tpcNClsPID()}; const int16_t ncl{v0Selections.useNclsPID ? nclPID : nclFound}; - if (v0Selections.applyNclSel && ncl < v0Selections.minNcl) + if (trackSelections.applyNclSel && ncl < v0Selections.minNcl) continue; float phiPrime{phi}; const int charge{track.sign()}; phiPrimeFunc(phiPrime, magField, charge); - if (v0Selections.applyPhiCut) { + if (trackSelections.applyPhiCut) { if (!passesPhiSelection(pOrPt, phiPrime)) continue; } @@ -858,10 +869,10 @@ struct PiKpRAA { if (!trkSelGlobal.IsSelected(track)) continue; - if (track.pt() < v0Selections.minPt || track.pt() > v0Selections.maxPt) + if (track.pt() < trackSelections.minPt || track.pt() > trackSelections.maxPt) continue; - if (track.eta() < v0Selections.minEtaDaughter || track.eta() > v0Selections.maxEtaDaughter) + if (track.eta() < trackSelections.minEta || track.eta() > trackSelections.maxEta) continue; const float momentum{track.p()}; @@ -870,12 +881,12 @@ struct PiKpRAA { const float eta{track.eta()}; float dedx{track.tpcSignal()}; const int charge{track.sign()}; - const float pOrPt{v0Selections.usePinPhiSelection ? momentum : pt}; + const float pOrPt{trackSelections.usePinPhiSelection ? momentum : pt}; const int16_t nclFound{track.tpcNClsFound()}; const int16_t nclPID{track.tpcNClsPID()}; const int16_t ncl{v0Selections.useNclsPID ? nclPID : nclFound}; - if (v0Selections.applyNclSel && ncl < v0Selections.minNcl) + if (trackSelections.applyNclSel && ncl < v0Selections.minNcl) continue; float phiPrime{phi}; @@ -883,12 +894,12 @@ struct PiKpRAA { registry.fill(HIST("NclVsPhipBeforeCut"), pOrPt, phiPrime, nclFound); registry.fill(HIST("NclVsPhipBeforeCutPID"), pOrPt, phiPrime, nclPID); - if (v0Selections.applyPhiCut) { + if (trackSelections.applyPhiCut) { if (!passesPhiSelection(pOrPt, phiPrime)) continue; } - if (v0Selections.applyEtaCal && etaCal.isMIPCalLoaded) { + if (trackSelections.applyEtaCal && etaCal.isMIPCalLoaded) { const double dedxCal{etaCal.pEtaCal->GetBinContent(etaCal.pEtaCal->FindBin(eta))}; if (dedxCal > kMindEdxMIP && dedxCal < kMaxdEdxMIP) dedx *= (50.0 / dedxCal); @@ -931,23 +942,8 @@ struct PiKpRAA { registry.fill(HIST("NclVsEtaPIDp"), eta, nclPID); registry.fill(HIST("NclVsPhipAfterCut"), pOrPt, phiPrime, nclFound); registry.fill(HIST("NclVsPhipAfterCutPID"), pOrPt, phiPrime, nclPID); - - if (track.hasTOF() && track.goodTOFMatch()) { - const float tTOF{track.tofSignal()}; - const float trkLength{track.length()}; - const float tExpPiTOF{track.tofExpSignalPi(tTOF)}; - // const float tExpElTOF{track.tofExpSignalEl(tTOF)}; - - if (trkLength > kZero && tTOF > kZero) { - // registry.fill(HIST("betaVsMomentum"), momentum, track.beta()); - // registry.fill(HIST("TOFExpPi2TOF"), momentum, tExpPiTOF / tTOF); - // registry.fill(HIST("TOFExpEl2TOF"), momentum, tExpElTOF / tTOF); - - if (std::abs((tExpPiTOF / tTOF) - kOne) < v0Selections.maxExpTOFPi) { - dEdxPiTOF[indexEta]->Fill(momentum, dedx); - } - } - } + registry.fill(HIST("NclVsPt"), pt, nclFound); + registry.fill(HIST("NclVsPtPID"), pt, nclPID); } for (const auto& v0 : v0s) { @@ -980,15 +976,15 @@ struct PiKpRAA { phiPrimeFunc(posTrackPhiPrime, magField, posTrackCharge); phiPrimeFunc(negTrackPhiPrime, magField, negTrackCharge); - const float posPorPt{v0Selections.usePinPhiSelection ? posTrkP : posTrkPt}; - const float negPorPt{v0Selections.usePinPhiSelection ? negTrkP : negTrkPt}; + const float posPorPt{trackSelections.usePinPhiSelection ? posTrkP : posTrkPt}; + const float negPorPt{trackSelections.usePinPhiSelection ? negTrkP : negTrkPt}; // Skip v0s with like-sig daughters if (posTrack.sign() == negTrack.sign()) continue; // Passes Geometrical (Phi) cut? - if (v0Selections.applyPhiCut) { + if (trackSelections.applyPhiCut) { if (!(passesPhiSelection(posPorPt, posTrackPhiPrime) && passesPhiSelection(negPorPt, negTrackPhiPrime))) continue; } @@ -998,11 +994,11 @@ struct PiKpRAA { continue; // Selection based on Ncl for PID - if (v0Selections.applyNclSel && !(posNcl >= v0Selections.minNcl && negNcl >= v0Selections.minNcl)) + if (trackSelections.applyNclSel && !(posNcl >= v0Selections.minNcl && negNcl >= v0Selections.minNcl)) continue; // Eta calibration positive-charge track - if (v0Selections.applyEtaCal && etaCal.isMIPCalLoaded) { + if (trackSelections.applyEtaCal && etaCal.isMIPCalLoaded) { const double dedxCal{etaCal.pEtaCal->GetBinContent(etaCal.pEtaCal->FindBin(posTrkEta))}; if (dedxCal > kMindEdxMIP && dedxCal < kMaxdEdxMIP) posTrkdEdx *= (50.0 / dedxCal); @@ -1011,7 +1007,7 @@ struct PiKpRAA { } // Eta calibration negative-charge track - if (v0Selections.applyEtaCal && etaCal.isMIPCalLoaded) { + if (trackSelections.applyEtaCal && etaCal.isMIPCalLoaded) { const double dedxCal{etaCal.pEtaCal->GetBinContent(etaCal.pEtaCal->FindBin(negTrkEta))}; if (dedxCal > kMindEdxMIP && dedxCal < kMaxdEdxMIP) negTrkdEdx *= (50.0 / dedxCal); @@ -1075,10 +1071,6 @@ struct PiKpRAA { nClVsPPiV0[posIndexEta]->Fill(posPorPt, posNcl); nClVsPpPiV0[posIndexEta]->Fill(posPorPt, posNcl); nClVsPPiV0[negIndexEta]->Fill(negPorPt, negNcl); - nClVsdEdxPiV0[negIndexEta]->Fill(negNcl, negTrkdEdx); - nClVsdEdxpPiV0[negIndexEta]->Fill(negNcl, negTrkdEdx); - nClVsdEdxPiV0[posIndexEta]->Fill(posNcl, posTrkdEdx); - nClVsdEdxpPiV0[posIndexEta]->Fill(posNcl, posTrkdEdx); nClVsPpPiV0[negIndexEta]->Fill(negPorPt, negNcl); dEdxPiV0[posIndexEta]->Fill(posTrkP, posTrkdEdx); dEdxPiV0[negIndexEta]->Fill(negTrkP, negTrkdEdx); @@ -1104,8 +1096,6 @@ struct PiKpRAA { registry.fill(HIST("NclVsEtaPrV0p"), posTrkEta, posNcl); nClVsPPrV0[posIndexEta]->Fill(posPorPt, posNcl); nClVsPpPrV0[posIndexEta]->Fill(posPorPt, posNcl); - nClVsdEdxPrV0[posIndexEta]->Fill(posNcl, posTrkdEdx); - nClVsdEdxpPrV0[posIndexEta]->Fill(posNcl, posTrkdEdx); dEdxPrV0[posIndexEta]->Fill(posTrkP, posTrkdEdx); } if (negTrackCharge < kZero) { @@ -1114,8 +1104,6 @@ struct PiKpRAA { // registry.fill(HIST("NclVsEtaPiV0p"), negTrkEta, negNcl); // nClVsPPiV0[negIndexEta]->Fill(negPorPt, negNcl); // nClVsPpPiV0[negIndexEta]->Fill(negPorPt, negNcl); - // nClVsdEdxPiV0[negIndexEta]->Fill(negNcl, negTrkdEdx); - // nClVsdEdxpPiV0[negIndexEta]->Fill(negNcl, negTrkdEdx); // dEdxPiV0[negIndexEta]->Fill(negTrkP, negTrkdEdx, centrality); } } @@ -1130,8 +1118,6 @@ struct PiKpRAA { // registry.fill(HIST("NclVsEtaPiV0p"), posTrkEta, posNcl); // nClVsPPiV0[posIndexEta]->Fill(posPorPt, posNcl); // nClVsPpPiV0[posIndexEta]->Fill(posPorPt, posNcl); - // nClVsdEdxPiV0[posIndexEta]->Fill(posNcl, posTrkdEdx); - // nClVsdEdxpPiV0[posIndexEta]->Fill(posNcl, posTrkdEdx); // dEdxPiV0[posIndexEta]->Fill(posTrkP, posTrkdEdx, centrality); } if (negTrackCharge < kZero) { @@ -1140,8 +1126,6 @@ struct PiKpRAA { registry.fill(HIST("NclVsEtaPrV0p"), negTrkEta, negNcl); nClVsPPrV0[negIndexEta]->Fill(negPorPt, negNcl); nClVsPpPrV0[negIndexEta]->Fill(negPorPt, negNcl); - nClVsdEdxPrV0[negIndexEta]->Fill(negNcl, negTrkdEdx); - nClVsdEdxpPrV0[negIndexEta]->Fill(negNcl, negTrkdEdx); dEdxPrV0[negIndexEta]->Fill(negTrkP, negTrkdEdx); } } @@ -1149,7 +1133,7 @@ struct PiKpRAA { if (passesGammaSelection(collision, v0)) { if (std::abs(alpha) < v0Selections.armAlphaSel && qT < v0Selections.qTSel) { - if (v0Selections.applyPlateauSel && etaCal.isCalPlateauLoaded) { + if (trackSelections.applyPlateauSel && etaCal.isCalPlateauLoaded) { const double posDedxCal{etaCal.pEtaCalPlateau->GetBinContent(etaCal.pEtaCalPlateau->FindBin(posTrkEta))}; const double negDedxCal{etaCal.pEtaCalPlateau->GetBinContent(etaCal.pEtaCalPlateau->FindBin(negTrkEta))}; if (!(std::abs(posTrkdEdx - posDedxCal) < v0Selections.dEdxPlateauSel && std::abs(negTrkdEdx - negDedxCal) < v0Selections.dEdxPlateauSel)) @@ -1169,10 +1153,6 @@ struct PiKpRAA { nClVsPpElV0[negIndexEta]->Fill(negPorPt, negNcl); nClVsPElV0[posIndexEta]->Fill(posPorPt, posNcl); nClVsPpElV0[posIndexEta]->Fill(posPorPt, posNcl); - nClVsdEdxElV0[negIndexEta]->Fill(negNcl, negTrkdEdx); - nClVsdEdxpElV0[negIndexEta]->Fill(negNcl, negTrkdEdx); - nClVsdEdxElV0[posIndexEta]->Fill(posNcl, posTrkdEdx); - nClVsdEdxpElV0[posIndexEta]->Fill(posNcl, posTrkdEdx); registry.fill(HIST("dEdxVsEtaElMIPV0"), posTrkEta, posTrkdEdx); registry.fill(HIST("dEdxVsEtaElMIPV0p"), posTrkEta, posTrkdEdx); registry.fill(HIST("dEdxVsEtaElMIPV0"), negTrkEta, negTrkdEdx); @@ -1275,10 +1255,10 @@ struct PiKpRAA { // Also for MC closure: True Pt vs Generated Nch //--------------------------- for (const auto& particle : mcParticles) { - if (particle.eta() < v0Selections.minEtaDaughter || particle.eta() > v0Selections.maxEtaDaughter) + if (particle.eta() < trackSelections.minEta || particle.eta() > trackSelections.maxEta) continue; - if (particle.pt() < v0Selections.minPt || particle.pt() > v0Selections.maxPt) + if (particle.pt() < trackSelections.minPt || particle.pt() > trackSelections.maxPt) continue; auto charge{0.}; @@ -1398,7 +1378,7 @@ struct PiKpRAA { uint64_t timeStamp{foundBC.timestamp()}; const int magField{getMagneticField(timeStamp)}; - if (v0Selections.applyPhiCut) { + if (trackSelections.applyPhiCut) { const int nextRunNumber{foundBC.runNumber()}; if (currentRunNumberPhiSel != nextRunNumber) { loadPhiCutSelections(timeStamp); @@ -1507,10 +1487,10 @@ struct PiKpRAA { // This histograms are used for the denominator of the tracking efficiency //--------------------------- for (const auto& particle : mcParticles) { - if (particle.eta() < v0Selections.minEtaDaughter || particle.eta() > v0Selections.maxEtaDaughter) + if (particle.eta() < trackSelections.minEta || particle.eta() > trackSelections.maxEta) continue; - if (particle.pt() < v0Selections.minPt || particle.pt() > v0Selections.maxPt) + if (particle.pt() < trackSelections.minPt || particle.pt() > trackSelections.maxPt) continue; auto charge{0.}; @@ -1550,10 +1530,10 @@ struct PiKpRAA { // Generated events with FT0 information but not TVX triggered if (selHasFT0 && collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { for (const auto& particle : mcParticles) { - if (particle.eta() < v0Selections.minEtaDaughter || particle.eta() > v0Selections.maxEtaDaughter) + if (particle.eta() < trackSelections.minEta || particle.eta() > trackSelections.maxEta) continue; - if (particle.pt() < v0Selections.minPt || particle.pt() > v0Selections.maxPt) + if (particle.pt() < trackSelections.minPt || particle.pt() > trackSelections.maxPt) continue; auto charge{0.}; @@ -1596,10 +1576,10 @@ struct PiKpRAA { //--------------------------- for (const auto& track : groupedTracks) { // Track Selection - if (track.eta() < v0Selections.minEtaDaughter || track.eta() > v0Selections.maxEtaDaughter) + if (track.eta() < trackSelections.minEta || track.eta() > trackSelections.maxEta) continue; - if (track.pt() < v0Selections.minPt || track.pt() > v0Selections.maxPt) + if (track.pt() < trackSelections.minPt || track.pt() > trackSelections.maxPt) continue; if (!trkSelGlobalOpenDCAxy.IsSelected(track)) @@ -1625,8 +1605,8 @@ struct PiKpRAA { float phiPrime{track.phi()}; phiPrimeFunc(phiPrime, magField, charge); - const float pOrPt{v0Selections.usePinPhiSelection ? track.p() : track.pt()}; - if (v0Selections.applyPhiCut) { + const float pOrPt{trackSelections.usePinPhiSelection ? track.p() : track.pt()}; + if (trackSelections.applyPhiCut) { if (!passesPhiSelection(pOrPt, phiPrime)) continue; } @@ -1634,7 +1614,7 @@ struct PiKpRAA { const int16_t nclFound{track.tpcNClsFound()}; const int16_t nclPID{track.tpcNClsPID()}; const int16_t ncl = v0Selections.useNclsPID ? nclPID : nclFound; - if (v0Selections.applyNclSel && ncl < v0Selections.minNcl) + if (trackSelections.applyNclSel && ncl < v0Selections.minNcl) continue; bool isPrimary{false}; @@ -1687,10 +1667,10 @@ struct PiKpRAA { int nCh{0}; for (const auto& track : groupedTracks) { // Track Selection - if (track.eta() < v0Selections.minEtaDaughter || track.eta() > v0Selections.maxEtaDaughter) + if (track.eta() < trackSelections.minEta || track.eta() > trackSelections.maxEta) continue; - if (track.pt() < v0Selections.minPt || track.pt() > v0Selections.maxPt) + if (track.pt() < trackSelections.minPt || track.pt() > trackSelections.maxPt) continue; if (!trkSelGlobal.IsSelected(track)) @@ -1717,8 +1697,8 @@ struct PiKpRAA { float phiPrime{track.phi()}; phiPrimeFunc(phiPrime, magField, charge); - const float pOrPt{v0Selections.usePinPhiSelection ? track.p() : track.pt()}; - if (v0Selections.applyPhiCut) { + const float pOrPt{trackSelections.usePinPhiSelection ? track.p() : track.pt()}; + if (trackSelections.applyPhiCut) { if (!passesPhiSelection(pOrPt, phiPrime)) continue; } @@ -1726,7 +1706,7 @@ struct PiKpRAA { const int16_t nclFound{track.tpcNClsFound()}; const int16_t nclPID{track.tpcNClsPID()}; const int16_t ncl = v0Selections.useNclsPID ? nclPID : nclFound; - if (v0Selections.applyNclSel && ncl < v0Selections.minNcl) + if (trackSelections.applyNclSel && ncl < v0Selections.minNcl) continue; int indexEta{-999}; @@ -1744,6 +1724,10 @@ struct PiKpRAA { registry.fill(HIST("NclVsPhip"), pOrPt, phiPrime, ncl); registry.fill(HIST("NclVsEtaPID"), eta, ncl); registry.fill(HIST("NclVsEtaPIDp"), eta, ncl); + registry.fill(HIST("NclVsEta"), eta, nclFound); + registry.fill(HIST("NclVsEtap"), eta, nclFound); + registry.fill(HIST("NclVsPt"), pOrPt, nclFound); + registry.fill(HIST("NclVsPtPID"), pOrPt, nclPID); nCh++; bool isPrimary{false}; @@ -1784,6 +1768,98 @@ struct PiKpRAA { } registry.fill(HIST("PtResolution"), particle.pt(), (track.pt() - particle.pt()) / particle.pt()); } // Loop over reconstructed tracks + + //------------------------------ + // Clean Pions and Muons + //------------------------------ + + for (const auto& track : groupedTracks) { + // Track Selection + if (track.eta() < trackSelections.minEta || track.eta() > trackSelections.maxEta) + continue; + + if (track.pt() < trackSelections.minPt || track.pt() > trackSelections.maxPt) + continue; + + // Has MC particle? + if (!track.has_mcParticle()) + continue; + + // Get the MC particle + const auto& particle{track.mcParticle()}; + auto charge{0.}; + auto* pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (pdgParticle != nullptr) { + charge = pdgParticle->Charge(); + } else { + continue; + } + + // Is it a charged particle? + if (std::abs(charge) < kMinCharge) + continue; + + float phiPrime{track.phi()}; + phiPrimeFunc(phiPrime, magField, charge); + + const float pOrPt{trackSelections.usePinPhiSelection ? track.p() : track.pt()}; + if (trackSelections.applyPhiCut) { + if (!passesPhiSelection(pOrPt, phiPrime)) + continue; + } + + const int16_t nclFound{track.tpcNClsFound()}; + const int16_t nclPID{track.tpcNClsPID()}; + const int16_t ncl{v0Selections.useNclsPID ? nclPID : nclFound}; + if (trackSelections.applyNclSel && ncl < v0Selections.minNcl) + continue; + + int indexEta{-999}; + const float eta{track.eta()}; + for (int i = 0; i < kNEtaHists; ++i) { + if (eta >= kLowEta[i] && eta < kHighEta[i]) { + indexEta = i; + break; + } + } + + if (indexEta < kZeroInt || indexEta > kSevenInt) + continue; + + bool isPrimary{false}; + if (particle.isPhysicalPrimary()) + isPrimary = true; + + if (!isPrimary) + continue; + + bool isPi{false}; + bool isMu{false}; + + if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) + isPi = true; + else if (particle.pdgCode() == PDG_t::kMuonPlus || particle.pdgCode() == PDG_t::kMuonMinus) + isMu = true; + else + continue; + + // Passes daughters track-selection? + if (passesTrackSelectionDaughters(track)) { + if (isPi && !isMu) { + nClVsPPiMC[indexEta]->Fill(track.p(), ncl); + dEdxPiMCLoSel[indexEta]->Fill(track.p(), track.tpcSignal()); + } + if (isMu && !isPi) + dEdxMuMCLoSel[indexEta]->Fill(track.p(), track.tpcSignal()); + } + + if (trkSelGlobal.IsSelected(track)) { + if (isPi && !isMu) + dEdxPiMC[indexEta]->Fill(track.p(), track.tpcSignal()); + if (isMu && !isPi) + dEdxMuMC[indexEta]->Fill(track.p(), track.tpcSignal()); + } + } // Loop over reconstructed tracks registry.fill(HIST("NchVsCent"), centrality, nCh); } // Loop over Reco. Collisions: Only the collisions with the largest number of contributors } // If condition: Only simulated evets with at least one reconstrued collision @@ -1825,93 +1901,24 @@ struct PiKpRAA { // https://github.com/AliceO2Group/O2Physics/blob/b178c96d03ede873ee769ef8a4d7c1e21bf78332/Common/Core/TrackSelectionDefaults.cxx // In the V0s analysis only the selection on eta (|eta|<0.8) and the selection on number of crossed rows was used: nCrossedRows >= 70 - const float pt{track.pt()}; const float eta{track.eta()}; const int16_t nCrossedRows{track.tpcNClsCrossedRows()}; - const float nCrossedRowsOverFindableCls{track.tpcCrossedRowsOverFindableCls()}; - const float chi2PerClsTPC{track.tpcChi2NCl()}; - const float chi2PerClsITS{track.itsChi2NCl()}; - const bool refitITS{track.passedITSRefit()}; - const bool refitTPC{track.passedTPCRefit()}; - const bool goldeChi2{track.passedGoldenChi2()}; - const bool oneHitITSib{track.passedITSHitsFB1()}; bool etaSel{false}; - bool ptSel{false}; bool xRows{false}; - bool xRowsToFindCls{false}; - bool chi2TPC{false}; - bool chi2ITS{false}; - bool itsrefit{false}; - bool tpcrefit{false}; - bool golden{false}; - bool itshit{false}; registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::AllTrks); - if (v0Selections.useOfficialV0sSelOfDaughters) { - if (eta > v0Selections.minEtaDaughter && eta < v0Selections.maxEtaDaughter) { - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Eta); - etaSel = true; - } - if (nCrossedRows >= v0Selections.minNCrossedRows) { - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::XRows); - xRows = true; - } - } else { - if (eta > v0Selections.minEtaDaughter && eta < v0Selections.maxEtaDaughter) { - etaSel = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Eta); - } - if (pt > v0Selections.minPtDaughter && pt < v0Selections.maxPtDaughter) { - ptSel = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Pt); - } - if (nCrossedRows >= v0Selections.minNCrossedRows) { - xRows = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::XRows); - } - if (nCrossedRowsOverFindableCls >= v0Selections.minNCrossedRowsOverFindableCls) { - xRowsToFindCls = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::XRowsOverFindableCls); - } - if (chi2PerClsTPC < v0Selections.maxChi2ClsTPC) { - chi2TPC = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Chi2TPC); - } - if (chi2PerClsITS < v0Selections.maxChi2ClsITS) { - chi2ITS = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Chi2ITS); - } - if (refitITS == v0Selections.itsRefit) { - itsrefit = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Itsrefit); - } - if (refitTPC == v0Selections.tpcRefit) { - tpcrefit = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Tpcrefit); - } - if (goldeChi2 == v0Selections.chi2Golden) { - golden = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Golden); - } - if (oneHitITSib == v0Selections.its1HitIB) { - itshit = true; - registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Itshit); - } + if (eta > trackSelections.minEta && eta < trackSelections.maxEta) { + registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::Eta); + etaSel = true; } - - bool isSelected{false}; - if (v0Selections.useOfficialV0sSelOfDaughters) { - isSelected = etaSel && xRows ? true : false; - } else { - if (!v0Selections.selElecFromGammas && v0Selections.requireITShit) - isSelected = etaSel && ptSel && xRows && xRowsToFindCls && chi2TPC && chi2ITS && itsrefit && tpcrefit && golden && itshit ? true : false; - if (!v0Selections.selElecFromGammas && !v0Selections.requireITShit) - isSelected = etaSel && ptSel && xRows && xRowsToFindCls && chi2TPC && chi2ITS && itsrefit && tpcrefit && golden ? true : false; - if (v0Selections.selElecFromGammas) - isSelected = etaSel && ptSel && xRows && xRowsToFindCls && chi2TPC && chi2ITS && tpcrefit && golden ? true : false; + if (nCrossedRows >= trackSelections.minNCrossedRows) { + registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::XRows); + xRows = true; } + const bool isSelected{etaSel && xRows ? true : false}; + if (isSelected == true) registry.fill(HIST("TrackDaughterCounter"), TrkSelLabel::PassedAll); @@ -1941,10 +1948,14 @@ struct PiKpRAA { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); + const bool hasToF{posTrack.hasTOF() && negTrack.hasTOF() ? true : false}; + const bool goodToFmatch{posTrack.goodTOFMatch() && negTrack.goodTOFMatch() ? true : false}; const double dcaPos{std::fabs(v0.dcapostopv())}; const double dcaNeg{std::fabs(v0.dcanegtopv())}; const float posTPCNsigma{std::fabs(posTrack.tpcNSigmaPi())}; const float negTPCNsigma{std::fabs(negTrack.tpcNSigmaPi())}; + const float posTOFNsigma{std::fabs(posTrack.tofNSigmaPi())}; + const float negTOFNsigma{std::fabs(negTrack.tofNSigmaPi())}; const double dMassK0s{std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short)}; const double dMassL{std::abs(v0.mLambda() - o2::constants::physics::MassLambda0)}; const double dMassAL{std::abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0)}; @@ -1964,8 +1975,12 @@ struct PiKpRAA { bool isSelected{false}; if (v0Selections.useOfficialV0sSelOfDaughters) { isSelected = lifeTime < v0Selections.lifeTimeCutK0s && rapidity < v0Selections.rapidityCut && dcaDaugToPV ? true : false; - } else { - isSelected = lifeTime < v0Selections.lifeTimeCutK0s && rapidity < v0Selections.rapidityCut && posTPCNsigma < v0Selections.tpcPidNsigmaCut && negTPCNsigma < v0Selections.tpcPidNsigmaCut && dcaDaugToPV ? true : false; + } + if (!v0Selections.useOfficialV0sSelOfDaughters) { + if (v0Selections.useTPCNsigma) + isSelected = lifeTime < v0Selections.lifeTimeCutK0s && rapidity < v0Selections.rapidityCut && posTPCNsigma < v0Selections.pidNsigmaCut && negTPCNsigma < v0Selections.pidNsigmaCut && dcaDaugToPV ? true : false; + if (!v0Selections.useTPCNsigma) + isSelected = lifeTime < v0Selections.lifeTimeCutK0s && rapidity < v0Selections.rapidityCut && posTOFNsigma < v0Selections.pidNsigmaCut && negTOFNsigma < v0Selections.pidNsigmaCut && hasToF && goodToFmatch && dcaDaugToPV ? true : false; } if (isSelected) { @@ -1988,10 +2003,14 @@ struct PiKpRAA { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); + const bool hasToF{posTrack.hasTOF() && negTrack.hasTOF() ? true : false}; + const bool goodToFmatch{posTrack.goodTOFMatch() && negTrack.goodTOFMatch() ? true : false}; const double dcaPos{std::fabs(v0.dcapostopv())}; const double dcaNeg{std::fabs(v0.dcanegtopv())}; const float posTPCNsigma{std::fabs(posTrack.tpcNSigmaPr())}; const float negTPCNsigma{std::fabs(negTrack.tpcNSigmaPi())}; + const float posTOFNsigma{std::fabs(posTrack.tofNSigmaPr())}; + const float negTOFNsigma{std::fabs(negTrack.tofNSigmaPi())}; const double dMassK0s{std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short)}; const double dMassL{std::abs(v0.mLambda() - o2::constants::physics::MassLambda0)}; const double dMassG{std::abs(v0.mGamma() - o2::constants::physics::MassGamma)}; @@ -2010,8 +2029,12 @@ struct PiKpRAA { bool isSelected{false}; if (v0Selections.useOfficialV0sSelOfDaughters) { isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && dcaDaugToPV ? true : false; - } else { - isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && posTPCNsigma < v0Selections.tpcPidNsigmaCut && negTPCNsigma < v0Selections.tpcPidNsigmaCut && dcaDaugToPV ? true : false; + } + if (!v0Selections.useOfficialV0sSelOfDaughters) { + if (v0Selections.useTPCNsigma) + isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && posTPCNsigma < v0Selections.pidNsigmaCut && negTPCNsigma < v0Selections.pidNsigmaCut && dcaDaugToPV ? true : false; + if (!v0Selections.useTPCNsigma) + isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && posTOFNsigma < v0Selections.pidNsigmaCut && negTOFNsigma < v0Selections.pidNsigmaCut && hasToF && goodToFmatch && dcaDaugToPV ? true : false; } if (isSelected) { @@ -2033,10 +2056,15 @@ struct PiKpRAA { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); + + const bool hasToF{posTrack.hasTOF() && negTrack.hasTOF() ? true : false}; + const bool goodToFmatch{posTrack.goodTOFMatch() && negTrack.goodTOFMatch() ? true : false}; const double dcaPos{std::fabs(v0.dcapostopv())}; const double dcaNeg{std::fabs(v0.dcanegtopv())}; const float posTPCNsigma{std::fabs(posTrack.tpcNSigmaPi())}; const float negTPCNsigma{std::fabs(negTrack.tpcNSigmaPr())}; + const float posTOFNsigma{std::fabs(posTrack.tofNSigmaPi())}; + const float negTOFNsigma{std::fabs(negTrack.tofNSigmaPr())}; const double dMassK0s{std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short)}; const double dMassAL{std::abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0)}; const double dMassG{std::abs(v0.mGamma() - o2::constants::physics::MassGamma)}; @@ -2055,8 +2083,12 @@ struct PiKpRAA { bool isSelected{false}; if (v0Selections.useOfficialV0sSelOfDaughters) { isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && dcaDaugToPV ? true : false; - } else { - isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && posTPCNsigma < v0Selections.tpcPidNsigmaCut && negTPCNsigma < v0Selections.tpcPidNsigmaCut && dcaDaugToPV ? true : false; + } + if (!v0Selections.useOfficialV0sSelOfDaughters) { + if (v0Selections.useTPCNsigma) + isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && posTPCNsigma < v0Selections.pidNsigmaCut && negTPCNsigma < v0Selections.pidNsigmaCut && dcaDaugToPV ? true : false; + if (!v0Selections.useTPCNsigma) + isSelected = lifeTime < v0Selections.lifeTimeCutLambda && rapidity < v0Selections.rapidityCut && posTOFNsigma < v0Selections.pidNsigmaCut && negTOFNsigma < v0Selections.pidNsigmaCut && hasToF && goodToFmatch && dcaDaugToPV ? true : false; } if (isSelected) { @@ -2098,8 +2130,8 @@ struct PiKpRAA { bool isSelected{false}; if (v0Selections.useOfficialV0sSelOfDaughters) isSelected = dcaDaugToPV ? true : false; - else - isSelected = posTPCNsigma < v0Selections.tpcPidNsigmaCut && negTPCNsigma < v0Selections.tpcPidNsigmaCut ? true : false; + if (!v0Selections.useOfficialV0sSelOfDaughters) + isSelected = dcaDaugToPV && posTPCNsigma < v0Selections.pidNsigmaCut && negTPCNsigma < v0Selections.pidNsigmaCut ? true : false; if (isSelected) { registry.fill(HIST("EtaVsYG"), negTrack.eta(), yGamma); From f190735bbf47c155f7ea367732fa27ef3398a054 Mon Sep 17 00:00:00 2001 From: somabhatta <48771326+somabhatta@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:20:09 +0100 Subject: [PATCH 028/282] [PWGCF] Fine tuning efficiency (#15481) --- .../Tasks/radialFlowDecorr.cxx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx b/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx index 0a20e7e9ca0..2de872a6b52 100644 --- a/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx @@ -207,8 +207,8 @@ struct RadialFlowDecorr { Configurable cfgLinPupParam2{"cfgLinPupParam2", 3.0f, "(Lower) Linear Pileup Cut Const"}; Configurable cfgLinPupParam3{"cfgLinPupParam3", 3.0f, "(Lower) Linear Pileup Slope"}; - Configurable cfgNchPbMax{"cfgNchPbMax", 10000, "Max Nch range for PbPb collisions"}; - Configurable cfgNchOMax{"cfgNchOMax", 1000, "Max Nch range for OO collisions"}; + Configurable cfgNchPbMax{"cfgNchPbMax", 4000, "Max Nch range for PbPb collisions"}; + Configurable cfgNchOMax{"cfgNchOMax", 800, "Max Nch range for OO collisions"}; Configurable cfgSys{"cfgSys", 1, "Efficiency to be used for which system? 1-->PbPb, 2-->NeNe, 3-->OO, 4-->pp"}; Configurable cfgFlat{"cfgFlat", false, "Whether to use flattening weights"}; @@ -227,7 +227,7 @@ struct RadialFlowDecorr { const AxisSpec vzAxis{5, -12.5, 12.5, "Vz"}; const AxisSpec chgAxis{3, -1.5, 1.5}; - const AxisSpec pTAxis{{0.0, 0.2, 0.5, 1, 3, 5, 7.5, 10}, "pT Axis"}; + const AxisSpec pTAxis{{0.0, 0.2, 0.4, 0.6, 0.8, 1, 3, 5, 7, 10}, "pT Axis"}; const AxisSpec etaAxis{{-0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}, "Eta"}; const AxisSpec phiAxis{KNbinsPhi, KPhiMin, TwoPI, "#phi"}; const AxisSpec etaBinAxis{KNEta + 1, -0.5, KNEta + 0.5, "#eta bin Number"}; @@ -1100,14 +1100,11 @@ struct RadialFlowDecorr { void init(InitContext&) { if (cfgSys == kPbPb) { - nChAxis = {cfgNchPbMax / 4, KBinOffset, cfgNchPbMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; - nChAxis2 = {cfgNchPbMax / 20, KBinOffset, cfgNchPbMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; - } else if (cfgSys == kNeNe || cfgSys == kOO) { - nChAxis = {cfgNchOMax / 2, KBinOffset, cfgNchOMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; - nChAxis2 = {cfgNchOMax / 5, KBinOffset, cfgNchOMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; + nChAxis = {cfgNchPbMax / 2, KBinOffset, cfgNchPbMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; + nChAxis2 = {cfgNchPbMax / 4, KBinOffset, cfgNchPbMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; } else { - nChAxis = {cfgNchOMax / 2, KBinOffset, cfgNchOMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; - nChAxis2 = {cfgNchOMax / 5, KBinOffset, cfgNchOMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; + nChAxis = {cfgNchOMax, KBinOffset, cfgNchOMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; + nChAxis2 = {cfgNchOMax, KBinOffset, cfgNchOMax + KBinOffset, "Nch", "PV-contributor track multiplicity"}; } ccdb->setURL(cfgCCDBurl.value); @@ -1536,6 +1533,8 @@ struct RadialFlowDecorr { continue; float pt = track.pt(), eta = track.eta(); + histos.fill(HIST("hPt"), pt); + histos.fill(HIST("hEta"), eta); auto sign = track.sign(); fillNSigmaBefCut(track, cent); @@ -1753,6 +1752,9 @@ struct RadialFlowDecorr { float pt = track.pt(), eta = track.eta(), phi = track.phi(); auto sign = track.sign(); + histos.fill(HIST("hPt"), pt); + histos.fill(HIST("hEta"), eta); + histos.fill(HIST("hPhi"), phi); int id = identifyTrack(track, cent); bool isPi = (id == KPidPionOne); bool isKa = (id == KPidKaonTwo); From ef08efa7b82ac9fa8a67d8b844d30a52cc398724 Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Sun, 22 Mar 2026 22:20:43 +0100 Subject: [PATCH 029/282] [PWGLF] Added different running mode + reworked assoc particle selection (#15469) --- .../DataModel/LFPhiStrangeCorrelationTables.h | 22 +- .../Strangeness/phiStrangeCorrelator.cxx | 48 ++- .../Strangeness/phiStrangeCorrelation.cxx | 296 ++++++++++++++++-- 3 files changed, 327 insertions(+), 39 deletions(-) diff --git a/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h b/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h index e72662a92e5..aca738fe6f2 100644 --- a/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h @@ -148,6 +148,18 @@ DECLARE_SOA_COLUMN(NSigmaTOF, nSigmaTOF, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); + +DECLARE_SOA_DYNAMIC_COLUMN(InNSigmaRegion, inNSigmaRegion, + [](float nSigmaTPC, float pt, bool hasTOF, float nSigmaTOF, float pidTPCMax, float tofPIDThreshold, float pidTOFMax) -> bool { + if (std::abs(nSigmaTPC) >= pidTPCMax) { + return false; // TPC check failed + } + if (pt >= tofPIDThreshold && hasTOF && std::abs(nSigmaTOF) >= pidTOFMax) { + return false; // TOF check failed + } + return true; + }); } // namespace lf_selection_pion_track DECLARE_SOA_TABLE(PionTracksData, "AOD", "PITRACKSDATA", @@ -157,7 +169,10 @@ DECLARE_SOA_TABLE(PionTracksData, "AOD", "PITRACKSDATA", lf_selection_pion_track::NSigmaTOF, lf_selection_pion_track::Pt, lf_selection_pion_track::Y, - lf_selection_pion_track::Phi); + lf_selection_pion_track::Phi, + lf_selection_pion_track::HasTOF, + lf_selection_pion_track::InNSigmaRegion); DECLARE_SOA_TABLE(PionTracksMcReco, "AOD", "PITRACKSMCRECO", soa::Index<>, @@ -166,7 +181,10 @@ DECLARE_SOA_TABLE(PionTracksMcReco, "AOD", "PITRACKSMCRECO", lf_selection_pion_track::NSigmaTOF, lf_selection_pion_track::Pt, lf_selection_pion_track::Y, - lf_selection_pion_track::Phi); + lf_selection_pion_track::Phi, + lf_selection_pion_track::HasTOF, + lf_selection_pion_track::InNSigmaRegion); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFPHISTRANGECORRELATIONTABLES_H_ diff --git a/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx b/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx index 211302881a7..b4f266b96b1 100644 --- a/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx +++ b/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx @@ -419,9 +419,9 @@ struct K0sReducedCandProducer { { AxisSpec binnedmultAxis{(std::vector)binsMult, "centFT0M"}; AxisSpec binnedpTK0SAxis{(std::vector)binspTK0S, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec massK0sAxis = {200, 0.4f, 0.6f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec massK0SAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; - histos.add("h3K0sCandidatesMass", "K^{0}_{S} candidate invariant mass", kTH3F, {binnedmultAxis, binnedpTK0SAxis, massK0sAxis}); + histos.add("h3K0sCandidatesMass", "K^{0}_{S} candidate invariant mass", kTH3F, {binnedmultAxis, binnedpTK0SAxis, massK0SAxis}); } // Single track selection for strangeness sector @@ -527,7 +527,7 @@ struct PionTrackProducer { HistogramRegistry histos{"pionTracks", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Configurable for analysis mode - Configurable analysisMode{"analysisMode", 1, "Analysis mode: 0 - old method with online normalization, 1 - new method with correlations"}; + // Configurable analysisMode{"analysisMode", 1, "Analysis mode: 0 - old method with online normalization, 1 - new method with correlations"}; // Configurable on multiplicity bins Configurable> binsMult{"binsMult", {0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 70.0, 100.0}, "Multiplicity bin limits"}; @@ -547,11 +547,11 @@ struct PionTrackProducer { Configurable minTPCnClsFound{"minTPCnClsFound", 70, "min number of found TPC clusters"}; Configurable minITSnCls{"minITSnCls", 4, "min number of ITS clusters"}; - Configurable forceTOF{"forceTOF", false, "force the TOF signal for the PID"}; + // Configurable forceTOF{"forceTOF", false, "force the TOF signal for the PID"}; Configurable tofPIDThreshold{"tofPIDThreshold", 0.5, "minimum pT after which TOF PID is applicable"}; - Configurable> trkPIDspecies{"trkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton}, "Trk sel: Particles species for PID, proton, pion, kaon"}; - Configurable> pidTPCMax{"pidTPCMax", std::vector{2.0f, 2.0f, 2.0f}, "maximum nSigma TPC"}; - Configurable> pidTOFMax{"pidTOFMax", std::vector{2.0f, 2.0f, 2.0f}, "maximum nSigma TOF"}; + Configurable> trkPIDspecies{"trkPIDspecies", std::vector{o2::track::PID::Kaon, o2::track::PID::Proton}, "Trk sel: Particles species for PID rejection, kaon, proton"}; + Configurable> pidTPCMax{"pidTPCMax", std::vector{2.0f, 2.0f}, "maximum nSigma TPC"}; + Configurable> pidTOFMax{"pidTOFMax", std::vector{2.0f, 2.0f}, "maximum nSigma TOF"}; Configurable cfgYAcceptance{"cfgYAcceptance", 0.5f, "Rapidity acceptance"}; } trackConfigs; @@ -590,7 +590,7 @@ struct PionTrackProducer { histos.add("h2RecMCDCAxySecMaterialPi", "Dcaxy distribution vs pt for Secondary Pions from Material", kTH2F, {binnedpTPiAxis, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}}); } - // PID selection for Pions + /*// PID selection for Pions template bool pidSelectionPion(const T& track) { @@ -626,6 +626,29 @@ struct PionTrackProducer { } } + return true; + }*/ + + // PID Hypotheses rejection for Pions + template + bool pidHypothesesRejection(const T& track) + { + for (size_t speciesIndex = 0; speciesIndex < trackConfigs.trkPIDspecies->size(); ++speciesIndex) { + auto const& pid = trackConfigs.trkPIDspecies->at(speciesIndex); + auto nSigmaTPC = aod::pidutils::tpcNSigma(pid, track); + + if (std::abs(nSigmaTPC) < trackConfigs.pidTPCMax->at(speciesIndex)) { // Check TPC nSigma first + if (track.hasTOF()) { + auto nSigmaTOF = aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) < trackConfigs.pidTOFMax->at(speciesIndex)) { + return false; // Reject if both TPC and TOF are within thresholds + } + } else { + return false; // Reject if only TPC is within threshold and TOF is unavailable + } + } + } + return true; } @@ -657,7 +680,10 @@ struct PionTrackProducer { if (trackConfigs.cfgIsTOFChecked && track.pt() >= trackConfigs.tofPIDThreshold && !track.hasTOF()) return false; - if (analysisMode == 1 && !pidSelectionPion(track)) + /*if (analysisMode == 1 && !pidSelectionPion(track)) + return false;*/ + + if (!pidHypothesesRejection(track)) return false; /* @@ -685,7 +711,7 @@ struct PionTrackProducer { histos.fill(HIST("h3PionTPCnSigma"), collision.centFT0M(), track.pt(), track.tpcNSigmaPi()); histos.fill(HIST("h3PionTOFnSigma"), collision.centFT0M(), track.pt(), track.tofNSigmaPi()); - pionTracksData(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi()); + pionTracksData(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi(), track.hasTOF()); } } @@ -715,7 +741,7 @@ struct PionTrackProducer { continue; } - pionTracksMcReco(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi()); + pionTracksMcReco(collision.globalIndex(), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt(), track.rapidity(massPi), track.phi(), track.hasTOF()); } } diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index b427eafa899..30cacfa6002 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -77,7 +77,11 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -static constexpr std::array phiMassRegionLabels{"Signal", "Sideband"}; +enum AnalysisMode { + kOldNormalization = 0, + kMassvsMass, + kDeltaYvsDeltaPhi +}; enum ParticleOfInterest { Phi = 0, @@ -88,8 +92,6 @@ enum ParticleOfInterest { ParticleOfInterestSize }; -static constexpr std::array particleOfInterestLabels{"Phi", "K0S", "Pion" /*"PionTPC", "PionTPCTOF"*/}; - /* #define LIST_OF_PARTICLES_OF_INTEREST \ X(Phi) \ @@ -155,7 +157,7 @@ struct PhiStrangenessCorrelation { Configurable eventSelectionType{"eventSelectionType", 0, "Event selection type: 0 - default selection only, 1 - default + phi meson selection"}; // Configurable for analysis mode - Configurable analysisMode{"analysisMode", 1, "Analysis mode: 0 - old method with online normalization, 1 - new method with correlations"}; + Configurable analysisMode{"analysisMode", kMassvsMass, "Analysis mode: 0 - old method with online normalization, 1 - new method with offline normlization, 2 - deltay vs deltaphi"}; // Configurable for event selection Configurable cutZVertex{"cutZVertex", 10.0f, "Accepted z-vertex range (cm)"}; // TO BE REMOVED @@ -175,6 +177,14 @@ struct PhiStrangenessCorrelation { Configurable> rangeMK0sSignal{"rangeMK0sSignal", {0.47f, 0.53f}, "K0S mass range for signal extraction"}; } k0sConfigs; + // Configurables for Pions selection + struct : ConfigurableGroup { + Configurable selectPionInSigRegion{"selectPionInSigRegion", false, "Select Pion candidates in signal region"}; + Configurable pidTPCMax{"pidTPCMax", 2.0f, "Maximum nSigma TPC"}; + Configurable pidTOFMax{"pidTOFMax", 2.0f, "Maximum nSigma TOF"}; + Configurable tofPIDThreshold{"tofPIDThreshold", 0.5f, "Minimum pT after which TOF PID is applicable"}; + } pionConfigs; + // Configurables on phi pT bins Configurable> binspTPhi{"binspTPhi", {0.4, 0.8, 1.4, 2.0, 2.8, 4.0, 6.0, 10.0}, "pT bin limits for Phi"}; @@ -201,7 +211,7 @@ struct PhiStrangenessCorrelation { // Configurables for CCDB Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository to use"}; - Configurable ccdbEfficiencyPath{"ccdbEfficiencyPath", "Users/s/scannito/Efficiencies", "Correction path to file"}; + Configurable ccdbEfficiencyPath{"ccdbEfficiencyPath", "Users/s/scannito/Efficiencies/h3EffMap", "Correction path to file"}; // Configurables for minimum pt selection in McGen struct : ConfigurableGroup { @@ -224,7 +234,8 @@ struct PhiStrangenessCorrelation { struct : PresliceGroup { Preslice phiCandDataPerCollision = aod::lf_selection_phi_candidate::collisionId; - PresliceUnsorted phiCandMcRecoPerCollision = aod::lf_selection_phi_candidate::collisionId; + // PresliceUnsorted phiCandMcRecoPerCollision = aod::lf_selection_phi_candidate::collisionId; + Preslice phiCandMcRecoPerCollision = aod::lf_selection_phi_candidate::collisionId; Preslice k0sDataPerCollision = aod::v0::collisionId; Preslice k0sMcRecoPerCollision = aod::v0::collisionId; @@ -247,6 +258,9 @@ struct PhiStrangenessCorrelation { using BinningTypeVertexCent = ColumnBinningPolicy; BinningTypeVertexCent binningOnVertexAndCent{{axisVertexMixing, axisCentralityMixing}, true}; + static constexpr std::array phiMassRegionLabels{"Signal", "Sideband"}; + static constexpr std::array particleOfInterestLabels{"Phi", "K0S", "Pion" /*"PionTPC", "PionTPCTOF"*/}; + void init(InitContext&) { AxisSpec vertexZAxis = {100, -cutZVertex, cutZVertex, "vrtx_{Z} [cm]"}; // TO BE REMOVED @@ -258,12 +272,23 @@ struct PhiStrangenessCorrelation { AxisSpec massPhiAxis = {200, 0.9f, 1.2f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec pTPhiAxis = {120, 0.0f, 12.0f, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec binnedpTPhiAxis{(std::vector)binspTPhi, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec massK0SAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec pTK0SAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec binnedpTK0SAxis{(std::vector)binspTK0S, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec nSigmaPiAxis = {100, -10.0f, 10.0f, "N#sigma #pi"}; AxisSpec pTPiAxis = {50, 0.0f, 5.0f, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec binnedpTPiAxis{(std::vector)binspTPi, "#it{p}_{T} (GeV/#it{c})"}; histos.add("phi/h3PhiData", "Invariant mass of Phi in Data", kTH3F, {binnedmultAxis, binnedpTPhiAxis, massPhiAxis}); + + histos.add("phiK0S/h6PhiK0SData", "Invariant mass of Phi vs Invariant mass of K0Short in Data", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTK0SAxis, deltayAxis, massPhiAxis, massK0SAxis}); + histos.add("phiPi/h6PhiPiTPCData", "Invariant mass of Phi vs nSigmaTPC Pion in Data", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, massPhiAxis, nSigmaPiAxis}); + histos.add("phiPi/h6PhiPiTOFData", "Invariant mass of Phi vs nSigmaTOF Pion in Data", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, massPhiAxis, nSigmaPiAxis}); + + histos.add("phiK0S/h6PhiK0SDataME", "Invariant mass of Phi vs Invariant mass of K0Short in Data ME", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTK0SAxis, deltayAxis, massPhiAxis, massK0SAxis}); + histos.add("phiPi/h6PhiPiTPCDataME", "Invariant mass of Phi vs nSigmaTPC Pion in Data ME", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, massPhiAxis, nSigmaPiAxis}); + histos.add("phiPi/h6PhiPiTOFDataME", "Invariant mass of Phi vs nSigmaTOF Pion in Data ME", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, massPhiAxis, nSigmaPiAxis}); + for (const auto& label : phiMassRegionLabels) { histos.add(fmt::format("phiK0S/h5PhiK0SData{}", label).c_str(), "Deltay vs deltaphi for Phi and K0Short in Data", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTK0SAxis, deltayAxis, deltaphiAxis}); histos.add(fmt::format("phiPi/h5PhiPiData{}", label).c_str(), "Deltay vs deltaphi for Phi and Pion in Data", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, deltaphiAxis}); @@ -291,10 +316,6 @@ struct PhiStrangenessCorrelation { histos.add("pi/h3PiMCGen", "Pion in MC Gen", kTH3F, {binnedmultAxis, binnedpTPiAxis, yAxis}); histos.add("pi/h4PiMCGenAssocReco", "Pion in MC Gen Assoc Reco", kTHnSparseF, {vertexZAxis, binnedmultAxis, binnedpTPiAxis, yAxis}); - histos.add("pi/h2RecMCDCAxyPrimPi", "Dcaxy distribution vs pt for Primary Pions", kTH2F, {binnedpTPiAxis, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}}); - histos.add("pi/h2RecMCDCAxySecWeakDecayPi", "Dcaz distribution vs pt for Secondary Pions from Weak Decay", kTH2F, {binnedpTPiAxis, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}}); - histos.add("pi/h2RecMCDCAxySecMaterialPi", "Dcaxy distribution vs pt for Secondary Pions from Material", kTH2F, {binnedpTPiAxis, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}}); - // Load efficiency maps from CCDB if (applyEfficiency) { ccdb->setURL(ccdbUrl); @@ -310,7 +331,7 @@ struct PhiStrangenessCorrelation { void loadEfficiencyMapFromCCDB(ParticleOfInterest poi) { - effMaps[poi] = std::shared_ptr(ccdb->get(fmt::format("{}/h3EffMap{}", ccdbEfficiencyPath.value, particleOfInterestLabels[poi]))); + effMaps[poi] = std::shared_ptr(ccdb->get(fmt::format("{}{}", ccdbEfficiencyPath.value, particleOfInterestLabels[poi]))); if (!effMaps[poi]) LOG(fatal) << "Could not load efficiency map for " << particleOfInterestLabels[poi] << "!"; LOG(info) << "Efficiency map for " << particleOfInterestLabels[poi] << " loaded from CCDB"; @@ -333,18 +354,93 @@ struct PhiStrangenessCorrelation { return RecoDecay::constrainAngle(phiTrigger - phiAssociated, -o2::constants::math::PIHalf); } - void processPhiK0SPionData(SelCollisions::iterator const& collision, aod::PhimesonCandidatesData const& phiCandidates, aod::K0sReducedCandidatesData const& k0sReduced, aod::PionTracksData const& pionTracks) + template + void processPhiK0SPionSE(TCollision const& collision, TPhiCands const& phiCandidates, TK0SCands const& k0sReduced, TPionCands const& pionTracks) { float multiplicity = collision.centFT0M(); const std::array, 2> phiMassRegions = {phiConfigs.rangeMPhiSignal, phiConfigs.rangeMPhiSideband}; + const bool applyK0sMassCut = (analysisMode == kDeltaYvsDeltaPhi) && k0sConfigs.selectK0sInSigRegion; + const auto& [minMassK0s, maxMassK0s] = k0sConfigs.rangeMK0sSignal.value; + auto isK0sValid = [&](const auto& k0s) { + return !applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s); + }; + + const bool applyPionNSigmaCut = (analysisMode == kDeltaYvsDeltaPhi) && pionConfigs.selectPionInSigRegion; + const float& pidTPCMax = pionConfigs.pidTPCMax; + const float& pidTOFMax = pionConfigs.pidTOFMax; + const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; + + auto isPionValid = [&](const auto& pion) { + return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, tofPIDThreshold, pidTOFMax); + }; + for (const auto& phiCand : phiCandidates) { float weightPhi = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y())); histos.fill(HIST("phi/h3PhiData"), multiplicity, phiCand.pt(), phiCand.m(), weightPhi); - static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { + auto processCorrelations = [&](auto fillK0S, auto fillPion) { + // Loop over all reduced K0S candidates + for (const auto& k0s : k0sReduced) { + if (!isK0sValid(k0s)) + continue; + + float weightPhiK0S = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMaps[K0S], multiplicity, k0s.pt(), k0s.y())); + fillK0S(k0s, weightPhiK0S); + } + + // Loop over all primary pion candidates + for (const auto& pionTrack : pionTracks) { + if (!isPionValid(pionTrack)) + continue; + + float weightPhiPion = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMaps[Pion], multiplicity, pionTrack.pt(), pionTrack.y())); + fillPion(pionTrack, weightPhiPion); + } + }; + + if (analysisMode == kMassvsMass) { + auto k0sHistID = HIST("phiK0S/h6PhiK0SData"); + auto piTPCHistID = HIST("phiPi/h6PhiPiTPCData"); + auto piTOFHistID = HIST("phiPi/h6PhiPiTOFData"); + + processCorrelations( + [&](const auto& k0s, float w) { + histos.fill(k0sHistID, multiplicity, phiCand.pt(), k0s.pt(), phiCand.y() - k0s.y(), phiCand.m(), k0s.m(), w); + }, + [&](const auto& pion, float w) { + histos.fill(piTPCHistID, multiplicity, phiCand.pt(), pion.pt(), phiCand.y() - pion.y(), phiCand.m(), pion.nSigmaTPC(), w); + histos.fill(piTOFHistID, multiplicity, phiCand.pt(), pion.pt(), phiCand.y() - pion.y(), phiCand.m(), pion.nSigmaTOF(), w); + }); + } else if (analysisMode == kDeltaYvsDeltaPhi) { + auto k0sHistID = std::make_tuple(HIST("phiK0S/h5PhiK0SDataSignal"), HIST("phiK0S/h5PhiK0SDataSideband")); + auto piHistID = std::make_tuple(HIST("phiPi/h5PhiPiDataSignal"), HIST("phiPi/h5PhiPiDataSideband")); + + static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { + constexpr unsigned int i = i_idx.value; + + const auto& [minMassPhi, maxMassPhi] = phiMassRegions[i]; + if (!phiCand.inMassRegion(minMassPhi, maxMassPhi)) + return; + + // auto k0sHistID = HIST("phiK0S/h5PhiK0SData") + HIST(phiMassRegionLabels[i]); + // auto piHistID = HIST("phiPi/h5PhiPiData") + HIST(phiMassRegionLabels[i]); + + processCorrelations( + [&](const auto& k0s, float w) { + histos.fill(std::get(k0sHistID), multiplicity, phiCand.pt(), k0s.pt(), phiCand.y() - k0s.y(), getDeltaPhi(phiCand.phi(), k0s.phi()), w); + }, + [&](const auto& pion, float w) { + histos.fill(std::get(piHistID), multiplicity, phiCand.pt(), pion.pt(), phiCand.y() - pion.y(), getDeltaPhi(phiCand.phi(), pion.phi()), w); + }); + }); + } + + /*static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { constexpr unsigned int i = i_idx.value; const auto& [minMassPhi, maxMassPhi] = phiMassRegions[i]; @@ -372,25 +468,80 @@ struct PhiStrangenessCorrelation { histos.fill(HIST("phiPi/h5PhiPiData") + HIST(phiMassRegionLabels[i]), multiplicity, phiCand.pt(), pionTrack.pt(), phiCand.y() - pionTrack.y(), getDeltaPhi(phiCand.phi(), pionTrack.phi()), weightPhiPion); } - }); + });*/ } } - PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SPionData, "Process function for Phi-K0S and Phi-Pion Deltay and Deltaphi 2D Correlations in Data", true); + // PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SPionSE, "Process function for Phi-K0S and Phi-Pion Deltay and Deltaphi 2D Correlations in SE", true); + + void processPhiK0SPionSEDataLike(SelCollisions::iterator const& collision, aod::PhimesonCandidatesData const& phiCandidates, aod::K0sReducedCandidatesData const& k0sReduced, aod::PionTracksData const& pionTracks) + { + processPhiK0SPionSE(collision, phiCandidates, k0sReduced, pionTracks); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SPionSEDataLike, "Process function for Phi-K0S and Phi-Pion 2D Correlations in Data or MC w/o PDG SE", true); - void processPhiK0SDataME(SelCollisions const& collisions, aod::PhimesonCandidatesData const& phiCandidates, aod::K0sReducedCandidatesData const& k0sReduced) + void processPhiK0SPionSEMCWithPDG(SimCollisions::iterator const& collision, aod::PhimesonCandidatesMcReco const& phiCandidates, aod::K0sReducedCandidatesMcReco const& k0sReduced, aod::PionTracksMcReco const& pionTracks) + { + processPhiK0SPionSE(collision, phiCandidates, k0sReduced, pionTracks); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SPionSEMCWithPDG, "Process function for Phi-K0S and Phi-Pion 2D Correlations in MC with PDG SE", true); + + template + void processPhiK0SME(TCollisions const& collisions, TPhiCands const& phiCandidates, TK0SCands const& k0sReduced) { const std::array, 2> phiMassRegions = {phiConfigs.rangeMPhiSignal, phiConfigs.rangeMPhiSideband}; + const bool applyK0sMassCut = (analysisMode == kDeltaYvsDeltaPhi) && k0sConfigs.selectK0sInSigRegion; + const auto& [minMassK0s, maxMassK0s] = k0sConfigs.rangeMK0sSignal.value; + + auto isK0sValid = [&](const auto& k0s) { + return !applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s); + }; + auto tuplePhiK0S = std::make_tuple(phiCandidates, k0sReduced); - Pair pairPhiK0S{binningOnVertexAndCent, cfgNoMixedEvents, -1, collisions, tuplePhiK0S, &cache}; + Pair pairPhiK0S{binningOnVertexAndCent, cfgNoMixedEvents, -1, collisions, tuplePhiK0S, &cache}; for (const auto& [c1, phiCands, c2, k0sRed] : pairPhiK0S) { float multiplicity = c1.centFT0M(); for (const auto& [phiCand, k0s] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(phiCands, k0sRed))) { - static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { + if (!isK0sValid(k0s)) + continue; + + auto processCorrelations = [&](auto fillK0S) { + float weightPhiK0S = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMaps[K0S], multiplicity, k0s.pt(), k0s.y())); + fillK0S(k0s, weightPhiK0S); + }; + + if (analysisMode == kMassvsMass) { + auto k0sHistID = HIST("phiK0S/h6PhiK0SDataME"); + + processCorrelations( + [&](const auto& k0s, float w) { + histos.fill(k0sHistID, multiplicity, phiCand.pt(), k0s.pt(), phiCand.y() - k0s.y(), phiCand.m(), k0s.m(), w); + }); + } else if (analysisMode == kDeltaYvsDeltaPhi) { + auto k0sHistID = std::make_tuple(HIST("phiK0S/h5PhiK0SDataMESignal"), HIST("phiK0S/h5PhiK0SDataMESideband")); + + static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { + constexpr unsigned int i = i_idx.value; + + const auto& [minMassPhi, maxMassPhi] = phiMassRegions[i]; + if (!phiCand.inMassRegion(minMassPhi, maxMassPhi)) + return; + + processCorrelations( + [&](const auto& k0s, float w) { + histos.fill(std::get(k0sHistID), multiplicity, phiCand.pt(), k0s.pt(), phiCand.y() - k0s.y(), getDeltaPhi(phiCand.phi(), k0s.phi()), w); + }); + }); + } + + /*static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { constexpr unsigned int i = i_idx.value; const auto& [minMassPhi, maxMassPhi] = phiMassRegions[i]; @@ -407,26 +558,85 @@ struct PhiStrangenessCorrelation { BoundEfficiencyMap(effMaps[K0S], multiplicity, k0s.pt(), k0s.y())); histos.fill(HIST("phiK0S/h5PhiK0SDataME") + HIST(phiMassRegionLabels[i]), multiplicity, phiCand.pt(), k0s.pt(), phiCand.y() - k0s.y(), getDeltaPhi(phiCand.phi(), k0s.phi()), weightPhiK0S); - }); + });*/ } } } - PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SDataME, "Process function for Phi-K0S and Deltay and Deltaphi 2D Correlations in Data ME", false); + // PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SME, "Process function for Phi-K0S and Deltay and Deltaphi 2D Correlations in Data ME", false); + + void processPhiK0SMEDataLike(SelCollisions const& collisions, aod::PhimesonCandidatesData const& phiCandidates, aod::K0sReducedCandidatesData const& k0sReduced) + { + processPhiK0SME(collisions, phiCandidates, k0sReduced); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SMEDataLike, "Process function for Phi-K0S 2D Correlations in Data or MC w/o PDG ME", true); + + void processPhiK0SMEMCWithPDG(SimCollisions const& collisions, aod::PhimesonCandidatesMcReco const& phiCandidates, aod::K0sReducedCandidatesMcReco const& k0sReduced) + { + processPhiK0SME(collisions, phiCandidates, k0sReduced); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SMEMCWithPDG, "Process function for Phi-K0S 2D Correlations in MC with PDG ME", true); - void processPhiPionDataME(SelCollisions const& collisions, aod::PhimesonCandidatesData const& phiCandidates, aod::PionTracksData const& pionTracks) + template + void processPhiPionME(TCollisions const& collisions, TPhiCands const& phiCandidates, TPionCands const& pionTracks) { const std::array, 2> phiMassRegions = {phiConfigs.rangeMPhiSignal, phiConfigs.rangeMPhiSideband}; + const bool applyPionNSigmaCut = (analysisMode == kDeltaYvsDeltaPhi) && pionConfigs.selectPionInSigRegion; + const float& pidTPCMax = pionConfigs.pidTPCMax; + const float& pidTOFMax = pionConfigs.pidTOFMax; + const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; + + auto isPionValid = [&](const auto& pion) { + return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, tofPIDThreshold, pidTOFMax); + }; + auto tuplePhiPion = std::make_tuple(phiCandidates, pionTracks); - Pair pairPhiPion{binningOnVertexAndCent, cfgNoMixedEvents, -1, collisions, tuplePhiPion, &cache}; + Pair pairPhiPion{binningOnVertexAndCent, cfgNoMixedEvents, -1, collisions, tuplePhiPion, &cache}; for (const auto& [c1, phiCands, c2, piTracks] : pairPhiPion) { float multiplicity = c1.centFT0M(); for (const auto& [phiCand, piTrack] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(phiCands, piTracks))) { - static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { + if (!isPionValid(piTrack)) + continue; + + auto processCorrelations = [&](auto fillPion) { + float weightPhiPion = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMaps[Pion], multiplicity, piTrack.pt(), piTrack.y())); + fillPion(piTrack, weightPhiPion); + }; + + if (analysisMode == kMassvsMass) { + auto piTPCHistID = HIST("phiPi/h6PhiPiTPCDataME"); + auto piTOFHistID = HIST("phiPi/h6PhiPiTOFDataME"); + + processCorrelations( + [&](const auto& pion, float w) { + histos.fill(piTPCHistID, multiplicity, phiCand.pt(), pion.pt(), phiCand.y() - pion.y(), phiCand.m(), pion.nSigmaTPC(), w); + histos.fill(piTOFHistID, multiplicity, phiCand.pt(), pion.pt(), phiCand.y() - pion.y(), phiCand.m(), pion.nSigmaTOF(), w); + }); + } else if (analysisMode == kDeltaYvsDeltaPhi) { + auto piHistID = std::make_tuple(HIST("phiPi/h5PhiPiDataMESignal"), HIST("phiPi/h5PhiPiDataMESideband")); + + static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { + constexpr unsigned int i = i_idx.value; + + const auto& [minMassPhi, maxMassPhi] = phiMassRegions[i]; + if (!phiCand.inMassRegion(minMassPhi, maxMassPhi)) + return; + + processCorrelations( + [&](const auto& pion, float w) { + histos.fill(std::get(piHistID), multiplicity, phiCand.pt(), pion.pt(), phiCand.y() - pion.y(), getDeltaPhi(phiCand.phi(), pion.phi()), w); + }); + }); + } + + /*static_for<0, phiMassRegionLabels.size() - 1>([&](auto i_idx) { constexpr unsigned int i = i_idx.value; const auto& [minMassPhi, maxMassPhi] = phiMassRegions[i]; @@ -437,16 +647,44 @@ struct PhiStrangenessCorrelation { BoundEfficiencyMap(effMaps[Pion], multiplicity, piTrack.pt(), piTrack.y())); histos.fill(HIST("phiPi/h5PhiPiDataME") + HIST(phiMassRegionLabels[i]), multiplicity, phiCand.pt(), piTrack.pt(), phiCand.y() - piTrack.y(), getDeltaPhi(phiCand.phi(), piTrack.phi()), weightPhiPion); - }); + });*/ } } } - PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiPionDataME, "Process function for Phi-Pion Deltay and Deltaphi 2D Correlations in Data ME", false); + // PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiPionME, "Process function for Phi-Pion Deltay and Deltaphi 2D Correlations in Data ME", false); + + void processPhiPionMEDataLike(SelCollisions const& collisions, aod::PhimesonCandidatesData const& phiCandidates, aod::PionTracksData const& pionTracks) + { + processPhiPionME(collisions, phiCandidates, pionTracks); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiPionMEDataLike, "Process function for Phi-Pion 2D Correlations in Data or MC w/o PDG ME", true); + + void processPhiPionMEMCWithPDG(SimCollisions const& collisions, aod::PhimesonCandidatesMcReco const& phiCandidates, aod::PionTracksMcReco const& pionTracks) + { + processPhiPionME(collisions, phiCandidates, pionTracks); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiPionMEMCWithPDG, "Process function for Phi-Pion 2D Correlations in MC with PDG ME", true); void processParticleEfficiency(MCCollisions const& mcCollisions, SimCollisions const& collisions, aod::PhimesonCandidatesMcReco const& phiCandidates, aod::K0sReducedCandidatesMcReco const& k0sReduced, aod::PionTracksMcReco const& pionTracks, aod::McParticles const& mcParticles) { - // std::vector> collsGrouped(mcCollisions.size()); + const bool applyK0sMassCut = (analysisMode == kDeltaYvsDeltaPhi) && k0sConfigs.selectK0sInSigRegion; + const auto& [minMassK0s, maxMassK0s] = k0sConfigs.rangeMK0sSignal.value; + auto isK0sValid = [&](const auto& k0s) { + return !applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s); + }; + + const bool applyPionNSigmaCut = (analysisMode == kDeltaYvsDeltaPhi) && pionConfigs.selectPionInSigRegion; + const float& pidTPCMax = pionConfigs.pidTPCMax; + const float& pidTOFMax = pionConfigs.pidTOFMax; + const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; + + auto isPionValid = [&](const auto& pion) { + return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, tofPIDThreshold, pidTOFMax); + }; + std::unordered_map> collsGrouped; collsGrouped.reserve(mcCollisions.size()); @@ -488,10 +726,16 @@ struct PhiStrangenessCorrelation { const auto pionTracksThisColl = pionTracks.sliceBy(preslices.pionTrackMcRecoPerCollision, collision.globalIndex()); for (const auto& k0s : k0sThisColl) { + if (!isK0sValid(k0s)) + continue; + histos.fill(HIST("k0s/h4K0SMCReco"), collision.posZ(), mcCollision.centFT0M(), k0s.pt(), k0s.y()); } for (const auto& pionTrack : pionTracksThisColl) { + if (!isPionValid(pionTrack)) + continue; + histos.fill(HIST("pi/h4PiMCReco"), collision.posZ(), mcCollision.centFT0M(), pionTrack.pt(), pionTrack.y()); } From 8f021b2dc5b5b66b768080ff52644169a6a43999 Mon Sep 17 00:00:00 2001 From: mj525 <99000728+mjkim525@users.noreply.github.com> Date: Sun, 22 Mar 2026 21:54:45 -0700 Subject: [PATCH 030/282] [PWGLF] Update for Reso-Initializer and xi1530Analysis (#15483) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFResonanceTables.h | 2 +- .../Resonances/resonanceInitializer.cxx | 51 ++- PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx | 331 +++++++++++++----- 3 files changed, 281 insertions(+), 103 deletions(-) diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index e5d9662b89e..675b7265d4b 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -874,7 +874,7 @@ using Reso2TracksMC = soa::Join; using Reso2TracksPID = soa::Join; using Reso2TracksPIDExt = soa::Join; // Without Extra -using ResoCollisionCandidates = soa::Join; +using ResoCollisionCandidates = soa::Join; using ResoRun2CollisionCandidates = soa::Join; using ResoCollisionCandidatesMC = soa::Join; using ResoRun2CollisionCandidatesMC = soa::Join; diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index d401153f9b6..03c28a9b701 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -139,7 +139,7 @@ struct ResonanceInitializer { // Pre-selection cuts Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; - Configurable pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 5.0f, "TPC and TOF PID cut (loose, improve performance)"}; + Configurable pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 5.0f, "TPC PID cut (loose, improve performance)"}; Configurable mincrossedrows{"mincrossedrows", 70, "min crossed rows"}; /// DCA Selections for V0 @@ -181,6 +181,8 @@ struct ResonanceInitializer { Configurable cfgFillLambda0{"cfgFillLambda0", false, "Fill Lambda0"}; Configurable cfgFillXi0{"cfgFillXi0", false, "Fill Xi0"}; Configurable cfgFillOmega0{"cfgFillOmega0", false, "Fill Omega0"}; + Configurable cfgBypassNoPairCascades{"cfgBypassNoPairCascades", true, "Bypass track fill if no pair cascade with track"}; + Configurable cfgBypassNoPairV0s{"cfgBypassNoPairV0s", false, "Bypass if no pair V0 with track"}; } FilterForDerivedTables; // Secondary cuts @@ -221,7 +223,8 @@ struct ResonanceInitializer { ConfigurableAxis impactParameterAxis{"impactParameterAxis", {500, 0, 50}, "IP (fm)"}; Configurable isDaughterCheck{"isDaughterCheck", 1, "Check if the mother has the correct daughters when it is considered"}; - Configurable cfgRapidityCutGen{"cfgRapidityCutGen", 0.5, "Rapidity cut for the truth particle"}; + Configurable cfgRapidityCutMinGen{"cfgRapidityCutMinGen", -0.5, "Rapidity cut for the truth particle"}; + Configurable cfgRapidityCutMaxGen{"cfgRapidityCutMaxGen", 0.5, "Rapidity cut for the truth particle"}; Configurable pdgTruthMother{"pdgTruthMother", 3324, "pdgcode for the truth mother e.g. Xi(1530) (3324)"}; Configurable pdgTruthDaughter1{"pdgTruthDaughter1", 3312, "pdgcode for the daughter 1, e.g. Xi- 3312"}; Configurable pdgTruthDaughter2{"pdgTruthDaughter2", 211, "pdgcode for the daughter 2, e.g. pi+ 211"}; @@ -267,8 +270,8 @@ struct ResonanceInitializer { || (nabs(aod::mcparticle::pdgCode) == 123314) // Xi(1820)0 || (nabs(aod::mcparticle::pdgCode) == 123324); // Xi(1820)-0 - using ResoEvents = soa::Join; - using ResoEvents001 = soa::Join; + using ResoEvents = soa::Join; + using ResoEvents001 = soa::Join; using ResoRun2Events = soa::Join; using ResoEventsMC = soa::Join; using ResoRun2EventsMC = soa::Join; @@ -381,7 +384,7 @@ struct ResonanceInitializer { return false; if (v0.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(v0.alpha())) return false; - if (std::fabs(v0.mLambda() - MassLambda0) < SecondaryCuts.cfgSecondaryMassWindow) + if (std::fabs(v0.mLambda() - MassLambda0) > SecondaryCuts.cfgSecondaryMassWindow) return false; if (SecondaryCuts.cfgSecondaryCrossMassHypothesisCut && (std::fabs(v0.mK0Short() - MassK0Short) < SecondaryCuts.cfgSecondaryCrossMassCutWindow)) return false; @@ -592,6 +595,9 @@ struct ResonanceInitializer { case 2: returnValue = ResoEvents.centFT0A(); break; + case 3: + returnValue = ResoEvents.centFV0A(); + break; default: returnValue = ResoEvents.centFT0M(); break; @@ -1192,7 +1198,9 @@ struct ResonanceInitializer { { for (auto const& mcPart : mcParticles) { - if (std::abs(mcPart.pdgCode()) != GenCuts.pdgTruthMother || std::abs(mcPart.y()) >= GenCuts.cfgRapidityCutGen) + if (std::abs(mcPart.pdgCode()) != GenCuts.pdgTruthMother) + continue; + if ((mcPart.y() >= GenCuts.cfgRapidityCutMaxGen) || (mcPart.y() <= GenCuts.cfgRapidityCutMinGen)) continue; std::vector daughterPDGs; if (mcPart.has_daughters()) { @@ -1279,7 +1287,7 @@ struct ResonanceInitializer { { mRunNumber = 0; dBz = 0; - // Multiplicity estimator selection (0: FT0M, 1: FT0C, 2: FT0A, 99: FV0A) + // Multiplicity estimator selection (0: FT0M, 1: FT0C, 2: FT0A, 3: FV0A) if (cfgMultName.value == "FT0M") { multEstimator = 0; } else if (cfgMultName.value == "FT0C") { @@ -1287,7 +1295,7 @@ struct ResonanceInitializer { } else if (cfgMultName.value == "FT0A") { multEstimator = 2; } else if (cfgMultName.value == "FV0A") { - multEstimator = 99; + multEstimator = 3; } else { multEstimator = 0; } @@ -1337,6 +1345,7 @@ struct ResonanceInitializer { AxisSpec idxMCAxis = {26, -0.5, 25.5, "Index"}; qaRegistry.add("Event/hMCEventIndices", "hMCEventIndices", kTH2D, {centAxis, idxMCAxis}); } + qaRegistry.add("Event/CentFV0A", "; FV0A Percentile; Entries", o2::framework::kTH1F, {{110, 0, 110}}); AxisSpec idxAxis = {8, 0, 8, "Index"}; if (cfgFillQA) { qaRegistry.add("hGoodTrackIndices", "hGoodTrackIndices", kTH1F, {idxAxis}); @@ -1513,6 +1522,9 @@ struct ResonanceInitializer { } resoSpheroCollisions(computeSpherocity(tracks, trackSphMin, trackSphDef)); resoEvtPlCollisions(0, 0, 0, 0); + if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) { + return; + } fillTracks(collision, tracks); if (cfgFillMicroTracks) { @@ -1572,6 +1584,14 @@ struct ResonanceInitializer { } resoSpheroCollisions(computeSpherocity(tracks, trackSphMin, trackSphDef)); resoEvtPlCollisions(0, 0, 0, 0); + if (cfgMultName.value == "FV0A") + qaRegistry.fill(HIST("Event/CentFV0A"), centEst(collision)); + if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) { + return; + } + if (FilterForDerivedTables.cfgBypassNoPairCascades && (Cascades.size() < 1)) { + return; + } fillTracks(collision, tracks); if (cfgFillMicroTracks) { fillMicroTracks(collision, tracks); @@ -1718,6 +1738,9 @@ struct ResonanceInitializer { fillMCCollision(collision, mcParticles); // Loop over tracks + if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) { + return; + } fillTracks(collision, tracks); if (cfgFillMicroTracks) { fillMicroTracks(collision, tracks); @@ -1782,6 +1805,8 @@ struct ResonanceInitializer { Cent = mcCollision.centFT0M(); else Cent = centEst(collision); + if (cfgMultName.value == "FV0A") + qaRegistry.fill(HIST("Event/CentFV0A"), centEst(collision)); bool isRecINELgt0 = 0; if (checkIsRecINELgt0) @@ -1802,6 +1827,12 @@ struct ResonanceInitializer { fillMCCollision(collision, mcParticles, impactpar, mult); // Loop over tracks + if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) { + return; + } + if (FilterForDerivedTables.cfgBypassNoPairCascades && (Cascades.size() < 1)) { + return; + } fillTracks(collision, tracks); if (cfgFillMicroTracks) { fillMicroTracks(collision, tracks); @@ -1839,6 +1870,8 @@ struct ResonanceInitializer { return col.centFT0C(); } else if (cfgMultName.value == "FT0A") { return col.centFT0A(); + } else if (cfgMultName.value == "FV0A") { + return col.centFV0A(); } return 100.5f; }; @@ -1875,7 +1908,7 @@ struct ResonanceInitializer { for (const auto& collision : collisions) { if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) continue; - if (!colCuts.isSelected(collision)) // Bug is appeared in colCuts-> double counting in event QA histo, will be fixed later + if (!colCuts.isSelected(collision, false)) // Bug is appeared in colCuts-> double counting in event QA histo, will be fixed later continue; if (biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); diff --git a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx index 25e6a3c1f57..64dd2ed25f9 100644 --- a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx +++ b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx @@ -28,6 +28,7 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" +#include "Math/RotationZ.h" #include "Math/Vector4D.h" #include "TF1.h" #include "TRandom3.h" @@ -40,6 +41,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::constants::physics; using LorentzVectorPtEtaPhiMass = ROOT::Math::PtEtaPhiMVector; +using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; Service pdgDB; enum { @@ -114,7 +116,8 @@ struct Xi1530Analysisqa { Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; - Configurable cfgRapidityCut{"cfgRapidityCut", 0.5, "Rapidity cut for tracks"}; + Configurable cfgRapidityMinCut{"cfgRapidityMinCut", -0.5, "Rapidity cut for tracks"}; + Configurable cfgRapidityMaxCut{"cfgRapidityMaxCut", 0.5, "Rapidity cut for tracks"}; // Primary track DCAxy to PV ConfigurableAxis cDCAtoPVBins{"cDCAtoPVBins", {1500, 0, 0.3}, "Bins for track DCA to PV"}; @@ -141,6 +144,7 @@ struct Xi1530Analysisqa { struct : ConfigurableGroup { // Topological selections for V0s ConfigurableAxis cDCADaughtersBins{"cDCADaughtersBins", {1000, 0, 0.1}, "Bins for DCA to daughters"}; + ConfigurableAxis cTransRadiusBins{"cTransRadiusBins", {500, 0, 100}, "Bins for transverse radius"}; Configurable cDCALambdaDaugtherscut{"cDCALambdaDaugtherscut", 0.7, "Lambda dauthers DCA cut"}; Configurable cDCALambdaToPVcut{"cDCALambdaToPVcut", 0.02, "Lambda DCA cut to PV"}; Configurable cDCAPionToPVcut{"cDCAPionToPVcut", 0.06, "pion DCA cut to PV"}; @@ -157,6 +161,9 @@ struct Xi1530Analysisqa { struct : ConfigurableGroup { // Topological selections for Cascades + ConfigurableAxis cDCASecondaryBins{"cDCASecondaryBins", {1000, 0, 0.1}, "Bins for DCA to Cascade secondary"}; + ConfigurableAxis cProperLifetimeBins{"cProperLifetimeBins", {300, 0, 30}, "Bins for proper lifetime"}; + ConfigurableAxis cDCABachelorToPVBins{"cDCABachelorToPVcutBins", {1000, 0, 0.1}, "Bins for DCA bachelor to PV cut"}; Configurable cDCABachlorToPVcut{"cDCABachlorToPVcut", 0.06, "Bachelor DCA cut to PV"}; Configurable cDCAXiDaugthersCutPtRangeLower{"cDCAXiDaugthersCutPtRangeLower", 1., "Xi- DCA cut to PV as pt range lower"}; Configurable cDCAXiDaugthersCutPtRangeUpper{"cDCAXiDaugthersCutPtRangeUpper", 4., "Xi- DCA cut to PV as pt range upper"}; @@ -173,6 +180,8 @@ struct Xi1530Analysisqa { Configurable cMasswindowCasccut{"cMasswindowCasccut", 0.008, "Cascade Mass window cut"}; Configurable cMassXiminus{"cMassXiminus", 1.32171, "Mass of Xi baryon"}; + Configurable cMaxProperLifetimeCut{"cMaxProperLifetimeCut", 4.7, "Maximum proper lifetime cut for Xi- candidates"}; + } cascadeConfig; //*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*// @@ -183,6 +192,7 @@ struct Xi1530Analysisqa { // Genenral selections Configurable cPIDBound{"cPIDBound", 6.349, "configurable for replacing to .has"}; + ConfigurableAxis cPIDnSigmaBins{"cPIDnSigmaBins", {131, -6.5, 6.5}, "Bins for nSigma PID"}; Configurable tofAtHighPt{"tofAtHighPt", false, "Use TOF at high pT"}; Configurable cMinTOFpt{"cMinTOFpt", 0.5, "Maximum TOF pt cut"}; @@ -250,6 +260,11 @@ struct Xi1530Analysisqa { Configurable cConsiderPairOnly{"cConsiderPairOnly", true, "Consider only existing particle pairs in the event"}; + Configurable cfgFillRotBkg{"cfgFillRotBkg", true, "Fill rotated background"}; + Configurable cfgMinRot{"cfgMinRot", 5.0 * constants::math::PI / 6.0, "Minimum of rotation"}; + Configurable cfgMaxRot{"cfgMaxRot", 7.0 * constants::math::PI / 6.0, "Maximum of rotation"}; + Configurable cfgRotPion{"cfgRotPion", true, "Rotate pion"}; + Configurable cfgNrotBkg{"cfgNrotBkg", 4, "Number of rotated copies (background) per each original candidate"}; } additionalConfig; TRandom* rn = new TRandom(); @@ -268,14 +283,19 @@ struct Xi1530Analysisqa { AxisSpec centAxis = {histoConfig.binsCent, "FT0M (%)"}; AxisSpec dcaxyAxis = {primarytrackConfig.cDCAtoPVBins, "DCA_{#it{xy}} (cm)"}; AxisSpec dcazAxis = {primarytrackConfig.cDCAtoPVBins, "DCA_{#it{z}} (cm)"}; + AxisSpec dcaSecondaryAxis = {cascadeConfig.cDCASecondaryBins, "DCA_{#it{Secondary}} (cm)"}; + AxisSpec dcaBachAxis = {cascadeConfig.cDCABachelorToPVBins, "DCA_{#it{Bach}} (cm)"}; AxisSpec dcaDaugAxis = {v0sConfig.cDCADaughtersBins, "DCA_{#it{Daughter}} (cm)"}; AxisSpec cosPAAxis = {cascadeConfig.cCosPABins, "1-cos(PA)"}; + AxisSpec properLifetimeAxis = {cascadeConfig.cProperLifetimeBins, "Proper lifetime (fm/c)"}; AxisSpec mcLabelAxis = {6, -1.5, 4.5, "MC Label"}; AxisSpec ptAxis = {histoConfig.binsPt, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec ptAxisQA = {histoConfig.binsPtQA, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec invMassAxis = {histoConfig.cInvMassBins, histoConfig.cInvMassStart, histoConfig.cInvMassEnd, "Invariant Mass (GeV/#it{c}^2)"}; - AxisSpec invMassAxisCasc = {800, 1.25, 1.65, "Invariant Mass for Casc. (GeV/#it{c}^2)"}; - AxisSpec pidQAAxis = {65, -6.5, 6.5}; + AxisSpec invMassAxisCasc = {400, 1.121, 1.521, "Invariant Mass for Casc. (GeV/#it{c}^2)"}; + AxisSpec invMassAxisLambda = {400, 0.921, 1.321, "Invariant Mass for Lambda (GeV/#it{c}^2)"}; + AxisSpec transRadiusAxis = {v0sConfig.cTransRadiusBins, "Transverse radius (cm)"}; + AxisSpec pidQAAxis = {pidConfig.cPIDnSigmaBins, "nSigma PID"}; AxisSpec flagAxis = {9, 0, 9, "Flags"}; if (histoConfig.multQA) { @@ -300,6 +320,8 @@ struct Xi1530Analysisqa { histos.add("QAevent/hVertexZMixedE", "Collision Vertex Z position", HistType::kTH1F, {{100, -15., 15.}}); histos.add("QAevent/hMultiplicityPercentMixedE", "Multiplicity percentile of collision", HistType::kTH1F, {centAxis}); + + histos.add("QAevent/hRotBkg", "Rotated angle of rotated background", HistType::kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); } if (histoConfig.invMass1D) { @@ -372,11 +394,13 @@ struct Xi1530Analysisqa { histos.add("h3XiinvmassDS", "Invariant mass of Xi- differnt sign", kTHnSparseF, {centAxis, ptAxis, invMassAxisCasc, flagAxis}); histos.add("h3Xi1530invmassLS", "Invariant mass of Xi(1530)0 same sign", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); + histos.add("h3Xi1530invmassRotDS", "Invariant mass of Xi(1530)0 rotated DS", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); histos.add("h3Xi1530invmassDSAnti", "Invariant mass of Anti-Xi(1530)0 differnt sign", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); histos.add("h3XiinvmassDSAnti", "Invariant mass of Anti-Xi- differnt sign", kTHnSparseF, {centAxis, ptAxis, invMassAxisCasc, flagAxis}); histos.add("h3Xi1530invmassLSAnti", "Invariant mass of Anti-Xi(1530)0 same sign", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); + histos.add("h3Xi1530invmassRotDSAnti", "Invariant mass of Anti-Xi(1530)0 rotated DS", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); if (doprocessMEDF || doprocessMEMicro) { histos.add("h3Xi1530invmassME_DS", "Invariant mass of Xi(1530)0 mixed event DS", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); @@ -425,25 +449,49 @@ struct Xi1530Analysisqa { histos.add("Xi1530RecAnti", "pT distribution of Reconstructed MC Anti-Xi(1530)0", kTH2F, {ptAxis, centAxis}); histos.add("Xi1530Recinvmass", "Inv mass distribution of Reconstructed MC Xi(1530)0", kTH1F, {invMassAxis}); } - + // QA for topological, kinematical cut for cascades if (histoConfig.additionalQAplots) { - histos.add("QAbefore/V0sDCADoughter_aspt", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); - histos.add("QAbefore/CascDCADoughter_aspt", "Casc DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); - histos.add("QAbefore/CascMass_aspt", "Casc DCA Bachlor distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisCasc}); - histos.add("QAbefore/V0sCosPA_aspt", "V0s CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); - histos.add("QAbefore/CascCosPA_aspt", "Casc CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); - - histos.add("QAafter/V0sDCADoughter_aspt", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); - histos.add("QAafter/CascDCADoughter_aspt", "Casc DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); - histos.add("QAafter/CascMass_aspt", "Casc DCA Bachlor distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisCasc}); - histos.add("QAafter/V0sCosPA_aspt", "V0s CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); - histos.add("QAafter/CascCosPA_aspt", "Casc CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); - - histos.add("QAMCTrue/V0sDCADoughter_aspt", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); - histos.add("QAMCTrue/CascDCADoughter_aspt", "Casc DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); - histos.add("QAMCTrue/CascMass_aspt", "Casc DCA Bachlor distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisCasc}); - histos.add("QAMCTrue/V0sCosPA_aspt", "V0s CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); - histos.add("QAMCTrue/CascCosPA_aspt", "Casc CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAbefore/V0DCATopPV", "V0s DCA to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaxyAxis}); + histos.add("QAbefore/V0DCADoughter", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); + histos.add("QAbefore/CascDCADoughter", "Casc DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); + histos.add("QAbefore/CascDCABachPV", "Casc DCA Bachlor to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaBachAxis}); + histos.add("QAbefore/CascDCAPosPV", "Casc DCA Positive to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaSecondaryAxis}); + histos.add("QAbefore/CascDCANegPV", "Casc DCA Negative to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaSecondaryAxis}); + histos.add("QAbefore/V0Mass", "V0 mass distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisLambda}); + histos.add("QAbefore/CascMass", "Casc mass distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisCasc}); + histos.add("QAbefore/V0CosPA", "V0s CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAbefore/CascCosPA", "Casc CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAbefore/V0Radius", "V0 Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); + histos.add("QAbefore/CascRadius", "Casc Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); + histos.add("QAbefore/ProperLifetime", "Proper Lifetime distribution as pt", HistType::kTH2F, {ptAxis, properLifetimeAxis}); + + histos.add("QAafter/V0DCATopPV", "V0s DCA to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaxyAxis}); + histos.add("QAafter/V0DCADoughter", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); + histos.add("QAafter/CascDCADoughter", "Casc DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); + histos.add("QAafter/CascDCABachPV", "Casc DCA Bachlor to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaBachAxis}); + histos.add("QAafter/CascDCAPosPV", "Casc DCA Positive to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaSecondaryAxis}); + histos.add("QAafter/CascDCANegPV", "Casc DCA Negative to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaSecondaryAxis}); + histos.add("QAafter/V0Mass", "V0 mass distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisLambda}); + histos.add("QAafter/CascMass", "Casc mass distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisCasc}); + histos.add("QAafter/V0CosPA", "V0s CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAafter/CascCosPA", "Casc CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAafter/V0Radius", "V0 Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); + histos.add("QAafter/CascRadius", "Casc Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); + histos.add("QAafter/ProperLifetime", "Proper Lifetime distribution as pt", HistType::kTH2F, {ptAxis, properLifetimeAxis}); + + histos.add("QAMCTrue/V0DCATopPV", "V0s DCA to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaxyAxis}); + histos.add("QAMCTrue/V0DCADoughter", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); + histos.add("QAMCTrue/CascDCADoughter", "Casc DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); + histos.add("QAMCTrue/CascDCABachPV", "Casc DCA Bachlor to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaBachAxis}); + histos.add("QAMCTrue/CascDCAPosPV", "Casc DCA Positive to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaSecondaryAxis}); + histos.add("QAMCTrue/CascDCANegPV", "Casc DCA Negative to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaSecondaryAxis}); + histos.add("QAMCTrue/V0Mass", "V0 mass distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisLambda}); + histos.add("QAMCTrue/CascMass", "Casc mass distribution as pt", HistType::kTH2F, {ptAxis, invMassAxisCasc}); + histos.add("QAMCTrue/V0CosPA", "V0s CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAMCTrue/CascCosPA", "Casc CosPA distribution as pt", HistType::kTH2F, {ptAxis, cosPAAxis}); + histos.add("QAMCTrue/V0Radius", "V0 Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); + histos.add("QAMCTrue/CascRadius", "Casc Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); + histos.add("QAMCTrue/ProperLifetime", "Proper Lifetime distribution as pt", HistType::kTH2F, {ptAxis, properLifetimeAxis}); } } @@ -453,33 +501,33 @@ struct Xi1530Analysisqa { template bool primaryTrackCut(const TrackType track) { - if (std::abs(track.eta()) > primarytrackConfig.cMaxetacut) + if (std::abs(track.eta()) >= primarytrackConfig.cMaxetacut) return false; - if (std::abs(track.pt()) < primarytrackConfig.cMinPtcut) + if (std::abs(track.pt()) <= primarytrackConfig.cMinPtcut) return false; if constexpr (IsResoMicrotrack) { - if (std::abs(o2::aod::resomicrodaughter::ResoMicroTrackSelFlag::decodeDCAxy(track.trackSelectionFlags())) > (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) + if (std::abs(o2::aod::resomicrodaughter::ResoMicroTrackSelFlag::decodeDCAxy(track.trackSelectionFlags())) >= (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) return false; if (primarytrackConfig.cDCAzToPVAsPt) { - if (std::abs(o2::aod::resomicrodaughter::ResoMicroTrackSelFlag::decodeDCAz(track.trackSelectionFlags())) > (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) + if (std::abs(o2::aod::resomicrodaughter::ResoMicroTrackSelFlag::decodeDCAz(track.trackSelectionFlags())) >= (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) return false; } else { - if (std::abs(o2::aod::resomicrodaughter::ResoMicroTrackSelFlag::decodeDCAz(track.trackSelectionFlags())) > primarytrackConfig.cMaxDCAzToPVCut) + if (std::abs(o2::aod::resomicrodaughter::ResoMicroTrackSelFlag::decodeDCAz(track.trackSelectionFlags())) >= primarytrackConfig.cMaxDCAzToPVCut) return false; } } else { - if (std::abs(track.dcaXY()) > (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) + if (std::abs(track.dcaXY()) >= (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) return false; if (primarytrackConfig.cDCAzToPVAsPt) { - if (std::abs(track.dcaZ()) > (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) + if (std::abs(track.dcaZ()) >= (primarytrackConfig.cDCAxytoPVByPtPiFirstP0 + primarytrackConfig.cDCAxyToPVByPtPiFirstExp * std::pow(track.pt(), -1.))) return false; } else { - if (std::abs(track.dcaZ()) > primarytrackConfig.cMaxDCAzToPVCut) + if (std::abs(track.dcaZ()) >= primarytrackConfig.cMaxDCAzToPVCut) return false; } - if (track.tpcNClsFound() < primarytrackConfig.cfgTPCcluster) + if (track.tpcNClsFound() <= primarytrackConfig.cfgTPCcluster) return false; - if (track.tpcNClsCrossedRows() < primarytrackConfig.cfgTPCRows) + if (track.tpcNClsCrossedRows() <= primarytrackConfig.cfgTPCRows) return false; } if (primarytrackConfig.cfgHasTOF && !track.hasTOF()) @@ -500,16 +548,16 @@ struct Xi1530Analysisqa { template bool cascprimaryTrackCut(const TracksTypeCasc track) { - if (std::abs(track.eta()) > primarytrackConfig.cMaxetacut) + if (std::abs(track.eta()) >= primarytrackConfig.cMaxetacut) return false; - if (std::abs(track.pt()) < primarytrackConfig.cMinPtcut) + if (std::abs(track.pt()) <= primarytrackConfig.cMinPtcut) return false; if (primarytrackConfig.cDCAxyToPVAsPtForCasc) { - if (std::abs(track.dcaXYCascToPV()) > (primarytrackConfig.cDCAxyToPVByPtCascP0 + primarytrackConfig.cDCAxyToPVByPtCascExp * track.pt())) + if (std::abs(track.dcaXYCascToPV()) >= (primarytrackConfig.cDCAxyToPVByPtCascP0 + primarytrackConfig.cDCAxyToPVByPtCascExp * track.pt())) return false; } if (primarytrackConfig.cDCAzToPVAsPtForCasc) { - if (std::abs(track.dcaZCascToPV()) > (primarytrackConfig.cDCAxyToPVByPtCascP0 + primarytrackConfig.cDCAxyToPVByPtCascExp * std::pow(track.pt(), -1.))) + if (std::abs(track.dcaZCascToPV()) >= (primarytrackConfig.cDCAxyToPVByPtCascP0 + primarytrackConfig.cDCAxyToPVByPtCascExp * std::pow(track.pt(), -1.))) return false; } @@ -523,49 +571,49 @@ struct Xi1530Analysisqa { bool casctopCut(const TracksTypeCasc track) { // Topological cuts for V0s - if (std::abs(track.daughDCA()) > v0sConfig.cDCALambdaDaugtherscut) + if (std::abs(track.daughDCA()) >= v0sConfig.cDCALambdaDaugtherscut) return false; - if (std::abs(track.dcav0topv()) < v0sConfig.cDCALambdaToPVcut) + if (std::abs(track.dcav0topv()) <= v0sConfig.cDCALambdaToPVcut) return false; if (track.sign() < 0) { - if (std::abs(track.dcanegtopv()) < v0sConfig.cDCAPionToPVcut) + if (std::abs(track.dcanegtopv()) <= v0sConfig.cDCAPionToPVcut) return false; - if (std::abs(track.dcapostopv()) < v0sConfig.cDCAProtonToPVcut) + if (std::abs(track.dcapostopv()) <= v0sConfig.cDCAProtonToPVcut) return false; } else { - if (std::abs(track.dcanegtopv()) < v0sConfig.cDCAProtonToPVcut) + if (std::abs(track.dcanegtopv()) <= v0sConfig.cDCAProtonToPVcut) return false; - if (std::abs(track.dcapostopv()) < v0sConfig.cDCAPionToPVcut) + if (std::abs(track.dcapostopv()) <= v0sConfig.cDCAPionToPVcut) return false; } - if (track.v0CosPA() < std::cos(v0sConfig.cV0CosPACutPtDepP0 - v0sConfig.cV0CosPACutPtDepP1 * track.pt())) + if (track.v0CosPA() <= std::cos(v0sConfig.cV0CosPACutPtDepP0 - v0sConfig.cV0CosPACutPtDepP1 * track.pt())) return false; - if (track.transRadius() > v0sConfig.cMaxV0radiuscut || track.transRadius() < v0sConfig.cMinV0radiuscut) + if (track.transRadius() >= v0sConfig.cMaxV0radiuscut || track.transRadius() <= v0sConfig.cMinV0radiuscut) return false; - if (std::abs(track.mLambda() - MassLambda) > v0sConfig.cMasswindowV0cut) + if (std::abs(track.mLambda() - MassLambda) >= v0sConfig.cMasswindowV0cut) return false; // Topological Cuts for Cascades - if (std::abs(track.dcabachtopv()) < cascadeConfig.cDCABachlorToPVcut) + if (std::abs(track.dcabachtopv()) <= cascadeConfig.cDCABachlorToPVcut) return false; - if (track.pt() < cascadeConfig.cDCAXiDaugthersCutPtRangeLower) { - if (track.cascDaughDCA() > cascadeConfig.cDCAXiDaugthersCutPtDepLower) + if (track.pt() <= cascadeConfig.cDCAXiDaugthersCutPtRangeLower) { + if (track.cascDaughDCA() >= cascadeConfig.cDCAXiDaugthersCutPtDepLower) return false; } - if (track.pt() >= cascadeConfig.cDCAXiDaugthersCutPtRangeLower && track.pt() < cascadeConfig.cDCAXiDaugthersCutPtRangeUpper) { - if (track.cascDaughDCA() > cascadeConfig.cDCAXiDaugthersCutPtDepMiddle) + if (track.pt() >= cascadeConfig.cDCAXiDaugthersCutPtRangeLower && track.pt() <= cascadeConfig.cDCAXiDaugthersCutPtRangeUpper) { + if (track.cascDaughDCA() >= cascadeConfig.cDCAXiDaugthersCutPtDepMiddle) return false; } if (track.pt() >= cascadeConfig.cDCAXiDaugthersCutPtRangeUpper) { - if (track.cascDaughDCA() > cascadeConfig.cDCAXiDaugthersCutPtDepUpper) + if (track.cascDaughDCA() >= cascadeConfig.cDCAXiDaugthersCutPtDepUpper) return false; } - if (track.cascCosPA() < std::cos(cascadeConfig.cCosPACascCutPtDepP0 - cascadeConfig.cCosPACascCutPtDepP1 * track.pt())) + if (track.cascCosPA() <= std::cos(cascadeConfig.cCosPACascCutPtDepP0 - cascadeConfig.cCosPACascCutPtDepP1 * track.pt())) return false; - if (track.cascTransRadius() > cascadeConfig.cMaxCascradiuscut || track.cascTransRadius() < cascadeConfig.cMinCascradiuscut) + if (track.cascTransRadius() >= cascadeConfig.cMaxCascradiuscut || track.cascTransRadius() <= cascadeConfig.cMinCascradiuscut) return false; - if (std::abs(track.mXi() - cascadeConfig.cMassXiminus) > cascadeConfig.cMasswindowCasccut) + if (std::abs(track.mXi() - cascadeConfig.cMassXiminus) >= cascadeConfig.cMasswindowCasccut) return false; return true; @@ -687,6 +735,19 @@ struct Xi1530Analysisqa { return lConsistentWithXi && lConsistentWithLambda; } + template + float properLifetime(const CollisionType& collision, const TCascade& candidate) + { + float kSmallMomentumDenominator = 1e-6f; // To avoid division by zero, if momentum is extremely small, we consider it as 1e-6 GeV/c + float dx = candidate.decayVtxX() - collision.posX(); + float dy = candidate.decayVtxY() - collision.posY(); + float dz = candidate.decayVtxZ() - collision.posZ(); + float l = std::sqrt(dx * dx + dy * dy + dz * dz); + float p = std::sqrt(candidate.px() * candidate.px() + candidate.py() * candidate.py() + candidate.pz() * candidate.pz()); + auto properLifetime = (l / (p + kSmallMomentumDenominator)) * candidate.mXi(); + return properLifetime; + } + template void fillHistograms(const CollisionType& collision, const centType& inCent, const TracksType& dTracks1, const TracksTypeCasc& dTracks2) // Order: ResoColl, ResoTrack, ResoCascTrack { @@ -711,7 +772,7 @@ struct Xi1530Analysisqa { if (additionalConfig.cConsiderPairOnly && (dTracks2.size() < 1 || dTracks1.size() < 1)) return; - LorentzVectorPtEtaPhiMass lDecayDaughter1, lDecayDaughter2, lResonance; + LorentzVectorPtEtaPhiMass lDecayDaughter1, lDecayDaughter2, lResonance, lDaughterRot, lResonanceRot; std::vector pionCandateIndicies = {}; std::vector xiCandateIndicies = {}; pionCandateIndicies.reserve(dTracks1.size()); @@ -775,16 +836,26 @@ struct Xi1530Analysisqa { } for (const auto& trk2 : dTracks2) { + // Kinematic variables for cascades auto trk2ptXi = trk2.pt(); - auto trk2InvMass = trk2.mXi(); + auto massLambdaCand = trk2.mLambda(); + auto massXiCand = trk2.mXi(); + auto trk2ProperLifetime = properLifetime(collision, trk2); + + // Topological variables for cascades + auto trk2DCAV0TopPV = trk2.dcav0topv(); auto trk2DCAXY = trk2.dcaXYCascToPV(); auto trk2DCAZ = trk2.dcaZCascToPV(); - - auto trk2DCAV0sDougthers = trk2.daughDCA(); + auto trk2DCAV0sDougthers = trk2.daughDCA(); // V0s daughter DCA auto trk2DCACascDougthers = trk2.cascDaughDCA(); - auto massXiCand = trk2.mXi(); + auto trk2DCABachPV = trk2.dcabachtopv(); + auto trk2DCAPosPV = trk2.dcapostopv(); + auto trk2DCANegPV = trk2.dcanegtopv(); + auto trk2V0CosPA = trk2.v0CosPA(); auto trk2CascCosPA = trk2.cascCosPA(); - auto trk2V0sCosPA = trk2.v0CosPA(); + auto trk2V0Radius = trk2.transRadius(); + auto trk2CascRadius = trk2.cascTransRadius(); + // QA before selections float trk2NSigmaPiBachelorTPC = trk2.daughterTPCNSigmaBachPi(); float trk2NSigmaPiBachelorTOF = trk2.daughterTOFNSigmaBachPi(); @@ -834,13 +905,21 @@ struct Xi1530Analysisqa { } if (histoConfig.additionalQAplots) { + histos.fill(HIST("QAbefore/V0DCATopPV"), trk2ptXi, trk2DCAV0TopPV); histos.fill(HIST("QAbefore/trkDCAxy_Xi"), trk2ptXi, trk2DCAXY); histos.fill(HIST("QAbefore/trkDCAz_Xi"), trk2ptXi, trk2DCAZ); - histos.fill(HIST("QAbefore/V0sDCADoughter_aspt"), trk2ptXi, trk2DCAV0sDougthers); - histos.fill(HIST("QAbefore/CascDCADoughter_aspt"), trk2ptXi, trk2DCACascDougthers); - histos.fill(HIST("QAbefore/CascMass_aspt"), trk2ptXi, massXiCand); - histos.fill(HIST("QAbefore/V0sCosPA_aspt"), trk2ptXi, 1. - trk2V0sCosPA); - histos.fill(HIST("QAbefore/CascCosPA_aspt"), trk2ptXi, 1. - trk2CascCosPA); + histos.fill(HIST("QAbefore/V0DCADoughter"), trk2ptXi, trk2DCAV0sDougthers); + histos.fill(HIST("QAbefore/CascDCADoughter"), trk2ptXi, trk2DCACascDougthers); + histos.fill(HIST("QAbefore/CascDCABachPV"), trk2ptXi, trk2DCABachPV); + histos.fill(HIST("QAbefore/CascDCAPosPV"), trk2ptXi, trk2DCAPosPV); + histos.fill(HIST("QAbefore/CascDCANegPV"), trk2ptXi, trk2DCANegPV); + histos.fill(HIST("QAbefore/V0CosPA"), trk2ptXi, 1. - trk2V0CosPA); + histos.fill(HIST("QAbefore/CascCosPA"), trk2ptXi, 1. - trk2CascCosPA); + histos.fill(HIST("QAbefore/V0Radius"), trk2ptXi, trk2V0Radius); + histos.fill(HIST("QAbefore/CascRadius"), trk2ptXi, trk2CascRadius); + histos.fill(HIST("QAbefore/V0Mass"), trk2ptXi, massLambdaCand); + histos.fill(HIST("QAbefore/CascMass"), trk2ptXi, massXiCand); + histos.fill(HIST("QAbefore/ProperLifetime"), trk2ptXi, trk2ProperLifetime); } } @@ -858,6 +937,8 @@ struct Xi1530Analysisqa { continue; if (!cascprimaryTrackCut(trk2) || !casctopCut(trk2)) // Primary track selections continue; + if (trk2ProperLifetime >= cascadeConfig.cMaxProperLifetimeCut) + continue; // QA after selections if constexpr (!IsMix) { @@ -900,26 +981,34 @@ struct Xi1530Analysisqa { } } if (histoConfig.additionalQAplots) { + histos.fill(HIST("QAafter/V0DCATopPV"), trk2ptXi, trk2DCAV0TopPV); histos.fill(HIST("QAafter/trkDCAxy_Xi"), trk2ptXi, trk2DCAXY); histos.fill(HIST("QAafter/trkDCAz_Xi"), trk2ptXi, trk2DCAZ); - histos.fill(HIST("QAafter/V0sDCADoughter_aspt"), trk2ptXi, trk2DCAV0sDougthers); - histos.fill(HIST("QAafter/CascDCADoughter_aspt"), trk2ptXi, trk2DCACascDougthers); - histos.fill(HIST("QAafter/CascMass_aspt"), trk2ptXi, massXiCand); - histos.fill(HIST("QAafter/V0sCosPA_aspt"), trk2ptXi, 1. - trk2V0sCosPA); - histos.fill(HIST("QAafter/CascCosPA_aspt"), trk2ptXi, 1. - trk2CascCosPA); + histos.fill(HIST("QAafter/V0DCADoughter"), trk2ptXi, trk2DCAV0sDougthers); + histos.fill(HIST("QAafter/CascDCADoughter"), trk2ptXi, trk2DCACascDougthers); + histos.fill(HIST("QAafter/CascDCABachPV"), trk2ptXi, trk2DCABachPV); + histos.fill(HIST("QAafter/CascDCAPosPV"), trk2ptXi, trk2DCAPosPV); + histos.fill(HIST("QAafter/CascDCANegPV"), trk2ptXi, trk2DCANegPV); + histos.fill(HIST("QAafter/V0CosPA"), trk2ptXi, 1. - trk2V0CosPA); + histos.fill(HIST("QAafter/CascCosPA"), trk2ptXi, 1. - trk2CascCosPA); + histos.fill(HIST("QAafter/V0Radius"), trk2ptXi, trk2V0Radius); + histos.fill(HIST("QAafter/CascRadius"), trk2ptXi, trk2CascRadius); + histos.fill(HIST("QAafter/V0Mass"), trk2ptXi, massLambdaCand); + histos.fill(HIST("QAafter/CascMass"), trk2ptXi, massXiCand); + histos.fill(HIST("QAafter/ProperLifetime"), trk2ptXi, trk2ProperLifetime); } if (additionalConfig.studyStableXi) { if (trk2.sign() < 0) { - histos.fill(HIST("h3XiinvmassDS"), Cent, trk2ptXi, trk2InvMass, kData); + histos.fill(HIST("h3XiinvmassDS"), Cent, trk2ptXi, massXiCand, kData); } else if (trk2.sign() > 0) { - histos.fill(HIST("h3XiinvmassDSAnti"), Cent, trk2ptXi, trk2InvMass, kData); + histos.fill(HIST("h3XiinvmassDSAnti"), Cent, trk2ptXi, massXiCand, kData); } if constexpr (IsMC) { if (trk2.motherPDG() > 0) { - histos.fill(HIST("h3RecXiinvmass"), Cent, trk2ptXi, trk2InvMass, kMCReco); + histos.fill(HIST("h3RecXiinvmass"), Cent, trk2ptXi, massXiCand, kMCReco); } else { - histos.fill(HIST("h3RecXiinvmassAnti"), Cent, trk2ptXi, trk2InvMass, kMCReco); + histos.fill(HIST("h3RecXiinvmassAnti"), Cent, trk2ptXi, massXiCand, kMCReco); } } } @@ -945,7 +1034,7 @@ struct Xi1530Analysisqa { auto lResonanceMass = lResonance.M(); auto lResonancePt = lResonance.Pt(); - if (std::abs(lResonance.Rapidity()) >= primarytrackConfig.cfgRapidityCut) + if ((lResonance.Rapidity() <= primarytrackConfig.cfgRapidityMinCut) || (lResonance.Rapidity() >= primarytrackConfig.cfgRapidityMaxCut)) continue; if (additionalConfig.cfgCutsOnMother) { @@ -962,11 +1051,51 @@ struct Xi1530Analysisqa { if (histoConfig.invMass1D) histos.fill(HIST("Xi1530invmassDS"), lResonanceMass); histos.fill(HIST("h3Xi1530invmassDS"), Cent, lResonancePt, lResonanceMass, kData); + if (additionalConfig.cfgFillRotBkg) { + for (int i = 0; i < additionalConfig.cfgNrotBkg; i++) { + auto lRotAngle = additionalConfig.cfgMinRot + i * ((additionalConfig.cfgMaxRot - additionalConfig.cfgMinRot) / (additionalConfig.cfgNrotBkg - 1)); + histos.fill(HIST("QAevent/hRotBkg"), lRotAngle); + if (additionalConfig.cfgRotPion) { + lDaughterRot = lDecayDaughter1; + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + lResonanceRot = lDaughterRot + lDecayDaughter2; + } else { + lDaughterRot = lDecayDaughter2; + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + lResonanceRot = lDecayDaughter1 + lDaughterRot; + } + histos.fill(HIST("h3Xi1530invmassRotDS"), Cent, lResonanceRot.Pt(), lResonanceRot.M(), kData); + } + } + } else if (pionCand.sign() < 0) { if (histoConfig.invMass1D) histos.fill(HIST("Xi1530invmassDSAnti"), lResonanceMass); - histos.fill(HIST("h3Xi1530invmassDSAnti"), Cent, lResonancePt, lResonanceMass, kData); + if (additionalConfig.cfgFillRotBkg) { + for (int i = 0; i < additionalConfig.cfgNrotBkg; i++) { + auto lRotAngle = additionalConfig.cfgMinRot + i * ((additionalConfig.cfgMaxRot - additionalConfig.cfgMinRot) / (additionalConfig.cfgNrotBkg - 1)); + histos.fill(HIST("QAevent/hRotBkg"), lRotAngle); + if (additionalConfig.cfgRotPion) { + lDaughterRot = lDecayDaughter1; + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + lResonanceRot = lDaughterRot + lDecayDaughter2; + } else { + lDaughterRot = lDecayDaughter2; + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + lResonanceRot = lDecayDaughter1 + lDaughterRot; + } + histos.fill(HIST("h3Xi1530invmassRotDSAnti"), Cent, lResonanceRot.Pt(), lResonanceRot.M(), kData); + } + } } } else { if (pionCand.sign() > 0) { @@ -984,7 +1113,9 @@ struct Xi1530Analysisqa { if (pionCand.motherId() != xiCand.motherId()) continue; auto lResonancePtMC = xiCand.motherPt(); - if (additionalConfig.cUseTruthRapidity && std::abs(xiCand.motherRap()) >= primarytrackConfig.cfgRapidityCut) + if (additionalConfig.cUseTruthRapidity) + continue; + if ((xiCand.motherRap() >= primarytrackConfig.cfgRapidityMaxCut) || (xiCand.motherRap() <= primarytrackConfig.cfgRapidityMinCut)) continue; if (histoConfig.truthQA) { float trk1DCAXY = -1.f; @@ -1005,12 +1136,19 @@ struct Xi1530Analysisqa { auto trk2DCAXY = xiCand.dcaXYCascToPV(); auto trk2DCAZ = xiCand.dcaZCascToPV(); + auto trk2ProperLifetime = properLifetime(collision, xiCand); + auto massLambdaCand = xiCand.mLambda(); - auto trk2DCAV0sDougthers = xiCand.daughDCA(); + auto trk2DCAV0TopPV = xiCand.dcav0topv(); + auto trk2DCAV0sDougthers = xiCand.daughDCA(); // V0s daughter DCA auto trk2DCACascDougthers = xiCand.cascDaughDCA(); - auto massXiCand = xiCand.mXi(); + auto trk2DCABachPV = xiCand.dcabachtopv(); + auto trk2DCAPosPV = xiCand.dcapostopv(); + auto trk2DCANegPV = xiCand.dcanegtopv(); + auto trk2V0CosPA = xiCand.v0CosPA(); auto trk2CascCosPA = xiCand.cascCosPA(); - auto trk2V0sCosPA = xiCand.v0CosPA(); + auto trk2V0Radius = xiCand.transRadius(); + auto trk2CascRadius = xiCand.cascTransRadius(); // auto trk2ptPiBachelor = xiCand.pt(); float trk2NSigmaPiBachelorTPC = xiCand.daughterTPCNSigmaBachPi(); @@ -1029,19 +1167,24 @@ struct Xi1530Analysisqa { float trk2NSigmaPiPosTOF = xiCand.daughterTOFNSigmaPosPi(); float trk2NSigmaPiNegTOF = xiCand.daughterTOFNSigmaNegPi(); - if (histoConfig.additionalQAplots) { - histos.fill(HIST("QAMCTrue/V0sDCADoughter_aspt"), xiCandPt, trk2DCAV0sDougthers); - histos.fill(HIST("QAMCTrue/CascDCADoughter_aspt"), xiCandPt, trk2DCACascDougthers); - histos.fill(HIST("QAMCTrue/CascMass_aspt"), xiCandPt, massXiCand); - histos.fill(HIST("QAMCTrue/V0sCosPA_aspt"), xiCandPt, 1. - trk2V0sCosPA); - histos.fill(HIST("QAMCTrue/CascCosPA_aspt"), xiCandPt, 1. - trk2CascCosPA); - - histos.fill(HIST("QAMCTrue/trkDCAxy_pi"), pionCandPt, trk1DCAXY); - histos.fill(HIST("QAMCTrue/trkDCAxy_xi"), xiCandPt, trk2DCAXY); - - histos.fill(HIST("QAMCTrue/trkDCAz_pi"), pionCandPt, trk1DCAZ); - histos.fill(HIST("QAMCTrue/trkDCAz_xi"), xiCandPt, trk2DCAZ); - } + histos.fill(HIST("QAMCTrue/trkDCAxy_pi"), pionCandPt, trk1DCAXY); + histos.fill(HIST("QAMCTrue/trkDCAz_pi"), pionCandPt, trk1DCAZ); + histos.fill(HIST("QAMCTrue/V0DCATopPV"), xiCandPt, trk2DCAV0TopPV); + histos.fill(HIST("QAMCTrue/trkDCAxy_Xi"), xiCandPt, trk2DCAXY); + histos.fill(HIST("QAMCTrue/trkDCAz_Xi"), xiCandPt, trk2DCAZ); + + histos.fill(HIST("QAMCTrue/V0DCADoughter"), xiCandPt, trk2DCAV0sDougthers); + histos.fill(HIST("QAMCTrue/CascDCADoughter"), xiCandPt, trk2DCACascDougthers); + histos.fill(HIST("QAMCTrue/CascDCABachPV"), xiCandPt, trk2DCABachPV); + histos.fill(HIST("QAMCTrue/CascDCAPosPV"), xiCandPt, trk2DCAPosPV); + histos.fill(HIST("QAMCTrue/CascDCANegPV"), xiCandPt, trk2DCANegPV); + histos.fill(HIST("QAMCTrue/V0CosPA"), xiCandPt, 1. - trk2V0CosPA); + histos.fill(HIST("QAMCTrue/CascCosPA"), xiCandPt, 1. - trk2CascCosPA); + histos.fill(HIST("QAMCTrue/V0Radius"), xiCandPt, trk2V0Radius); + histos.fill(HIST("QAMCTrue/CascRadius"), xiCandPt, trk2CascRadius); + histos.fill(HIST("QAMCTrue/V0Mass"), xiCandPt, massLambdaCand); + histos.fill(HIST("QAMCTrue/CascMass"), xiCandPt, massXiCand); + histos.fill(HIST("QAMCTrue/ProperLifetime"), xiCandPt, trk2ProperLifetime); histos.fill(HIST("QAMCTrue/TPC_Nsigma_pi_first_all"), Cent, pionCandPt, trk1NSigmaPiTPC); if (hasSubsystemInfo(trk1NSigmaPiTOF)) { @@ -1163,7 +1306,9 @@ struct Xi1530Analysisqa { } for (const auto& part : resoParents) { // loop over all pre-filtered MC particles - if (std::abs(part.pdgCode()) != kXiStar || std::abs(part.y()) >= primarytrackConfig.cfgRapidityCut) + if (std::abs(part.pdgCode()) != kXiStar) + continue; + if ((part.y() <= primarytrackConfig.cfgRapidityMinCut) || (part.y() >= primarytrackConfig.cfgRapidityMaxCut)) continue; bool pass1 = std::abs(part.daughterPDG1()) == kPiPlus || std::abs(part.daughterPDG2()) == kPiPlus; bool pass2 = std::abs(part.daughterPDG1()) == kXiMinus || std::abs(part.daughterPDG2()) == kXiMinus; From 08b6eb77ceef76b75251b5a1d182593b2effa8da Mon Sep 17 00:00:00 2001 From: Shirajum Monira <38348689+Eloviyo@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:45:43 +0100 Subject: [PATCH 031/282] [PWGCF] FemtoUniverse Producer Task -- fixed mc collision check for V0's (#15485) Co-authored-by: Shirajum Monira --- .../TableProducer/femtoUniverseProducerTask.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index af0370625ca..649e0a6049c 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -2303,7 +2303,7 @@ struct FemtoUniverseProducerTask { template - void fillCollisionsAndTracksAndV0AndPhi(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s) + bool fillCollisionsAndTracksAndV0AndPhi(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s) { const auto colcheck = fillCollisions(col, tracks); if (colcheck) { @@ -2315,6 +2315,7 @@ struct FemtoUniverseProducerTask { fillPhi(col, tracks); } } + return colcheck; } void processFullData(aod::FemtoFullCollision const& col, @@ -2584,8 +2585,10 @@ struct FemtoUniverseProducerTask { fillCascade(col, groupedStrageParts, groupedTracks); } } else { - mcColIds.insert(col.mcCollisionId()); - fillCollisionsAndTracksAndV0AndPhi(col, groupedTracks, groupedStrageParts); + const auto colcheck = fillCollisionsAndTracksAndV0AndPhi(col, groupedTracks, groupedStrageParts); + if (colcheck) { + mcColIds.insert(col.mcCollisionId()); + } } for (const auto& track : groupedTracks) { if (trackCuts.isSelectedMinimal(track)) From 5f496b65377870c93de0f12c43452fd727c63db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Mart=C3=ADnez=20Garc=C3=ADa?= Date: Mon, 23 Mar 2026 03:14:46 -0600 Subject: [PATCH 032/282] [PWGUD] Adding selection criteria on FT0 amplitude (#15484) Co-authored-by: rolavick --- PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx | 39 +++++++++++++--------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index c1ba0124327..68f9c1698e1 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx @@ -161,16 +161,18 @@ struct UpcPhotonuclearAnalysisJMG { Configurable cutGapATimeZNA{"cutGapATimeZNA", 2., {"My collision cut. Gap Side A"}}; Configurable cutGapATimeZNC{"cutGapATimeZNC", 2., {"My collision cut. Gap Side A"}}; Configurable cutGapAMyEnergyZNA{"cutGapAMyEnergyZNA", 0., {"My collision cut. Gap Side A"}}; - // Configurable cutAGapMyAmplitudeFT0AMax{"cutAGapMyAmplitudeFT0AMax", 200., {"My collision cut. A Gap"}}; + Configurable useFT0AGapA{"useFT0AGapA", false, {"My collision cut. Gap Side A"}}; + Configurable cutGapAMyAmplitudeFT0A{"cutGapAMyAmplitudeFT0A", 100., {"My collision cut. A Gap"}}; Configurable cutGapAMyEnergyZNC{"cutGapAMyEnergyZNC", 1., {"My collision cut. Gap Side A"}}; - Configurable useFV0{"useFV0", false, {"My collision cut. Gap Side A"}}; + Configurable useFV0{"useFV0", false, {"My collision cut. Gap Side A"}}; Configurable cutGapAFV0Amplitude{"cutGapAFV0Amplitude", 50, {"My collision cut. Gap Side A"}}; // Configurable cutAGapMyAmplitudeFT0CMin{"cutAGapMyAmplitudeFT0CMin", 0., {"My collision cut. A Gap"}}; // Declare configurables on side C gap Configurable cutGapCTimeZNA{"cutGapCTimeZNA", 2., {"My collision cut. Gap Side C"}}; Configurable cutGapCTimeZNC{"cutGapCTimeZNC", 2., {"My collision cut. Gap Side C"}}; Configurable cutGapCMyEnergyZNA{"cutGapCMyEnergyZNA", 1., {"My collision cut. Gap Side C"}}; - // Configurable cutCGapMyAmplitudeFT0AMin{"cutCGapMyAmplitudeFT0AMin", 0., {"My collision cut. A Gap"}}; + Configurable useFT0CGapC{"useFT0CGapC", false, {"My collision cut. Gap Side A"}}; + Configurable cutGapCMyAmplitudeFT0C{"cutGapCMyAmplitudeFT0C", 50., {"My collision cut. A Gap"}}; Configurable cutGapCMyEnergyZNC{"cutGapCMyEnergyZNC", 0., {"My collision cut. Gap Side C"}}; // Configurable cutCGapMyAmplitudeFT0CMax{"cutCGapMyAmplitudeFT0CMax", 200., {"My collision cut. A Gap"}}; // Declare configurables on tracks @@ -230,7 +232,7 @@ struct UpcPhotonuclearAnalysisJMG { void init(InitContext const&) { const AxisSpec axisCollision{4, -0.5, 3.5}; - const AxisSpec axisCollisionFlow{12, -0.5, 11.5}; + const AxisSpec axisCollisionFlow{13, -0.5, 12.5}; const AxisSpec axisZvtx{20, -10., 10.}; const AxisSpec axisPt{402, -0.05, 20.05}; const AxisSpec axisP{402, -10.05, 10.05}; @@ -411,7 +413,7 @@ struct UpcPhotonuclearAnalysisJMG { if (!(std::abs(collision.timeZNA()) > cutGapATimeZNA && std::abs(collision.timeZNC()) < cutGapATimeZNC)) { return false; } - if (useEnergyZN && ((collision.energyCommonZNA() < cutGapAMyEnergyZNA) && (collision.energyCommonZNC() >= cutGapAMyEnergyZNC))) { + if (useEnergyZN && !((collision.energyCommonZNA() < cutGapAMyEnergyZNA) && (collision.energyCommonZNC() >= cutGapAMyEnergyZNC))) { return false; } // 0n - A side && Xn - C Side if (useGapSideVariable && collision.gapSide() != uint8_t(0)) { @@ -420,23 +422,23 @@ struct UpcPhotonuclearAnalysisJMG { if (useFV0 && collision.totalFV0AmplitudeA() > cutGapAFV0Amplitude) { return false; } - // if ((collision.totalFT0AmplitudeA() < cutAGapMyAmplitudeFT0AMax && collision.totalFT0AmplitudeC() >= cutAGapMyAmplitudeFT0CMin) == false) { - // return false; - // } + if (useFT0AGapA && (collision.totalFT0AmplitudeA() > cutGapAMyAmplitudeFT0A)) { + return false; + } break; case 1: // Gap in C side if (!(std::abs(collision.timeZNA()) < cutGapCTimeZNA && std::abs(collision.timeZNC()) > cutGapCTimeZNC)) { return false; } - if (useEnergyZN && ((collision.energyCommonZNA() >= cutGapCMyEnergyZNA) && (collision.energyCommonZNC() < cutGapCMyEnergyZNC))) { + if (useEnergyZN && !((collision.energyCommonZNA() >= cutGapCMyEnergyZNA) && (collision.energyCommonZNC() < cutGapCMyEnergyZNC))) { return false; } // Xn - A side && 0n - C Side if (useGapSideVariable && collision.gapSide() != uint8_t(1)) { return false; } - // if ((collision.totalFT0AmplitudeA() >= cutCGapMyAmplitudeFT0AMin && collision.totalFT0AmplitudeC() < cutCGapMyAmplitudeFT0CMax) == false) { - // return false; - // } + if (useFT0CGapC && (collision.totalFT0AmplitudeC() > cutGapCMyAmplitudeFT0C)) { + return false; + } break; default: return false; @@ -875,7 +877,8 @@ struct UpcPhotonuclearAnalysisJMG { hEventFlow->GetXaxis()->SetBinLabel(9, "Time ZN"); hEventFlow->GetXaxis()->SetBinLabel(10, "Energy ZN"); hEventFlow->GetXaxis()->SetBinLabel(11, "FV0-A Amplitude"); - hEventFlow->GetXaxis()->SetBinLabel(12, "GapSide Variable"); + hEventFlow->GetXaxis()->SetBinLabel(12, "FT0 Amplitude"); + hEventFlow->GetXaxis()->SetBinLabel(13, "GapSide Variable"); histos.fill(HIST("Events/hCollisionsFlow"), 0); if (std::abs(reconstructedCollision.posZ()) > myZVtxCut) { @@ -915,7 +918,7 @@ struct UpcPhotonuclearAnalysisJMG { bool isGapAMyEnergyZN = useEnergyZN && ((reconstructedCollision.energyCommonZNA() < cutGapAMyEnergyZNA) && (reconstructedCollision.energyCommonZNC() >= cutGapAMyEnergyZNC)); bool isGapCMyEnergyZN = useEnergyZN && ((reconstructedCollision.energyCommonZNA() >= cutGapCMyEnergyZNA) && (reconstructedCollision.energyCommonZNC() < cutGapCMyEnergyZNC)); - if (isGapAMyEnergyZN || isGapCMyEnergyZN) { + if (useEnergyZN && !(isGapAMyEnergyZN || isGapCMyEnergyZN)) { return; } histos.fill(HIST("Events/hCollisionsFlow"), 9); @@ -923,12 +926,18 @@ struct UpcPhotonuclearAnalysisJMG { return; } histos.fill(HIST("Events/hCollisionsFlow"), 10); + bool cutFT0AGapA = useFT0AGapA && reconstructedCollision.totalFT0AmplitudeA() > cutGapAMyAmplitudeFT0A; + bool cutFT0CGapC = useFT0CGapC && reconstructedCollision.totalFT0AmplitudeC() > cutGapCMyAmplitudeFT0C; + if (cutFT0AGapA || cutFT0CGapC) { + return; + } + histos.fill(HIST("Events/hCollisionsFlow"), 11); bool cutGapSideAVariable = useGapSideVariable && reconstructedCollision.gapSide() != uint8_t(0); bool cutGapSideCVariable = useGapSideVariable && reconstructedCollision.gapSide() != uint8_t(1); if (cutGapSideAVariable || cutGapSideCVariable) { return; } - histos.fill(HIST("Events/hCollisionsFlow"), 11); + histos.fill(HIST("Events/hCollisionsFlow"), 12); if (isCollisionCutSG(reconstructedCollision) == false) { return; From 8d1ba66ed6ad433da3570b595dcd22907052c720 Mon Sep 17 00:00:00 2001 From: dyx-11 <1260971129@qq.com> Date: Mon, 23 Mar 2026 17:17:00 +0800 Subject: [PATCH 033/282] [PWGUD] merge two sides (#15488) --- PWGUD/Tasks/flowCorrelationsUpc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index a8138f126e6..b1b70fb5db9 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -165,7 +165,7 @@ struct FlowCorrelationsUpc { // make the filters and cuts. Filter trackFilter = (aod::udtrack::isPVContributor == true); - Filter collisionFilter = (aod::udcollision::gapSide == (uint8_t)cfgGapSide && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && aod::flowcorrupc::truegapside == 1); + Filter collisionFilter = ((aod::udcollision::gapSide == (uint8_t)1 || aod::udcollision::gapSide == (uint8_t)0) && (cfgIfVertex == false || aod::collision::posZ < cfgZVtxCut) && (aod::udcollision::occupancyInTime > 0 && aod::udcollision::occupancyInTime < cfgCutOccupancyHigh) && (aod::flowcorrupc::truegapside == 1 || aod::flowcorrupc::truegapside == 0)); using UdTracks = soa::Filtered>; using UdTracksFull = soa::Filtered>; From 31aed8cbdf3e68b203ebeeb53e43de9e6a5be3dd Mon Sep 17 00:00:00 2001 From: YazhenLin Date: Mon, 23 Mar 2026 17:19:59 +0800 Subject: [PATCH 034/282] [PWGDQ] Add some code in the dqEnergyCorrelator_direct.cxx for the energy correlator (#15489) --- PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx index 50eef8685c5..eae943e6124 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -132,6 +132,7 @@ struct AnalysisEnergyCorrelator { Configurable fConfigMCGenHadronEtaAbs{"cfgMCGenHadronEtaAbs", 0.9f, "eta abs range for the hadron"}; Configurable fConfigMCGenHadronPtMin{"cfgMCGenHadronPtMin", 0.1f, "minimum pt for the hadron"}; Configurable fConfigContainlepton{"cfgContainlepton", false, "If true, require the hadron to contain the lepton in its decay tree for the energy correlator study"}; + Configurable fConfigUsePionMass{"cfgUsePionMass", false, "If true, use pion mass for the hadron in the energy correlator study"}; } fConfigDileptonHadronOptions; // Histogram configurables @@ -451,7 +452,11 @@ struct AnalysisEnergyCorrelator { // Fill dilepton-hadron variables std::vector fTransRange = fConfigDileptonHadronOptions.fConfigTransRange; VarManager::FillEnergyCorrelatorTriple(track1, track2, hadron, VarManager::fgValues, fTransRange[0], fTransRange[1], fConfigDileptonHadronOptions.fConfigApplyMassEC.value); - VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); + if (fConfigDileptonHadronOptions.fConfigUsePionMass.value) { + VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); + } else { + VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); + } int iHadronCut = 0; for (auto hCut = fHadronCuts.begin(); hCut != fHadronCuts.end(); hCut++, iHadronCut++) { From 987092b7d2cbc9d34e355250b337a401d471f7cf Mon Sep 17 00:00:00 2001 From: Fan Si <147278151+fsii@users.noreply.github.com> Date: Mon, 23 Mar 2026 12:12:16 +0100 Subject: [PATCH 035/282] [PWGCF] Add new calculation in MC (#15486) --- PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx | 125 +++++++++++++++---- 1 file changed, 103 insertions(+), 22 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx index d0c34878282..fbb529fbb52 100644 --- a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx @@ -1363,7 +1363,7 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagQaPidPi.value || groupAnalysis.cfgFlagQaPidKa.value || groupAnalysis.cfgFlagQaPidPr.value) { - const HistogramConfigSpec hcsQaPid(HistType::kTHnSparseF, {asCentrality, {40, 0., 2., "#it{p}_{T} (GeV/#it{c})"}, {32, -0.8, 0.8, "#it{#eta}"}, {200, -10., 10.}}); + const HistogramConfigSpec hcsQaPid(HistType::kTHnSparseF, {asCentrality, {40, 0., 2., "#it{p}_{T} (GeV/#it{c})"}, {32, -0.8, 0.8, "#it{#eta}"}, {300, -30., 30.}}); if (groupAnalysis.cfgFlagQaPidPi.value) { LOG(info) << "Enabling pion PID QA."; @@ -1433,9 +1433,9 @@ struct PartNumFluc { const AxisSpec asCentrality(20, 0., 100., "Centrality (%)"); - hrQaMc.add("QaMc/hCentralityVzVzMc", "", {HistType::kTHnSparseF, {asCentrality, {200, -10., 10., "#it{V}_{#it{z}}^{Rec} (cm)"}, {200, -10., 10., "#it{V}_{#it{z}}^{Gen} (cm)"}}}); - hrQaMc.add("QaMc/hCentralityPtEtaDeltaPt", "", {HistType::kTHnSparseF, {asCentrality, {100, 0., 2., "#it{p}_{T}^{Rec} (GeV/#it{c})"}, {120, -1.2, 1.2, "#it{#eta}_{Rec}"}, {100, -1., 1., "#it{p}_{T}^{Rec}#minus#it{p}_{T}^{Gen} (GeV/#it{c})"}}}); - hrQaMc.add("QaMc/hCentralityPtEtaDeltaEta", "", {HistType::kTHnSparseF, {asCentrality, {100, 0., 2., "#it{p}_{T}^{Rec} (GeV/#it{c})"}, {120, -1.2, 1.2, "#it{#eta}_{Rec}"}, {100, -1., 1., "#it{#eta}_{Rec}#minus#it{#eta}_{Gen}"}}}); + hrQaMc.add("QaMc/hCentralityVzDeltaVz", "", {HistType::kTHnSparseF, {asCentrality, {200, -10., 10., "#it{V}_{#it{z}}^{Rec} (cm)"}, {200, -1., 1., "#it{V}_{#it{z}}^{Rec}#minus#it{V}_{#it{z}}^{Gen} (cm)"}}}); + hrQaMc.add("QaMc/hCentralityPtEtaDeltaPt", "", {HistType::kTHnSparseF, {asCentrality, {100, 0., 2., "#it{p}_{T}^{Rec} (GeV/#it{c})"}, {120, -1.2, 1.2, "#it{#eta}_{Rec}"}, {200, -1., 1., "#it{p}_{T}^{Rec}#minus#it{p}_{T}^{Gen} (GeV/#it{c})"}}}); + hrQaMc.add("QaMc/hCentralityPtEtaDeltaEta", "", {HistType::kTHnSparseF, {asCentrality, {100, 0., 2., "#it{p}_{T}^{Rec} (GeV/#it{c})"}, {120, -1.2, 1.2, "#it{#eta}_{Rec}"}, {200, -1., 1., "#it{#eta}_{Rec}#minus#it{#eta}_{Gen}"}}}); } } @@ -1579,7 +1579,7 @@ struct PartNumFluc { static constexpr std::int32_t NDimensionsEfficiency = 4; const AxisSpec asCentrality(groupEvent.cfgAxisCentrality, "Centrality (%)"); - const HistogramConfigSpec hcsCalculationFluctuation(HistType::kTHnSparseD, {asCentrality, {50, -0.5, 49.5}, {50, -0.5, 49.5}}); + const HistogramConfigSpec hcsDistribution(HistType::kTHnSparseD, {asCentrality, {200, -0.5, 199.5}, {200, -0.5, 199.5}}); const HistogramConfigSpec hcsFluctuationCalculator(HistType::kTH3D, {asCentrality, {groupEvent.cfgNSubgroups.value, -0.5, groupEvent.cfgNSubgroups.value - 0.5, "Subgroup Index"}, {fluctuation_calculator_base::NOrderVectors, -0.5, fluctuation_calculator_base::NOrderVectors - 0.5, "Order Vector Index"}}); if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { @@ -1591,9 +1591,13 @@ struct PartNumFluc { fluctuationCalculatorTrackChN = std::make_unique(); if (doprocessMc.value) { - hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNChPNChM_mc", ";;#it{N}(h^{+});#it{N}(h^{#minus});", hcsCalculationFluctuation); + hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNChPNChM_mc", ";;#it{N}(h^{+});#it{N}(h^{#minus});", hcsDistribution); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChP_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChM_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChT_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChN_mc", "", hcsFluctuationCalculator); } - hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNChPNChM", ";;#it{N}(h^{+});#it{N}(h^{#minus});", hcsCalculationFluctuation); + hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNChPNChM", ";;#it{N}(h^{+});#it{N}(h^{#minus});", hcsDistribution); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChP", "", hcsFluctuationCalculator); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChM", "", hcsFluctuationCalculator); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorChT", "", hcsFluctuationCalculator); @@ -1609,9 +1613,13 @@ struct PartNumFluc { fluctuationCalculatorTrackKaN = std::make_unique(); if (doprocessMc.value) { - hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNKaPNKaM_mc", ";;#it{N}(K^{+});#it{N}(K^{#minus});", hcsCalculationFluctuation); + hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNKaPNKaM_mc", ";;#it{N}(K^{+});#it{N}(K^{#minus});", hcsDistribution); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaP_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaM_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaT_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaN_mc", "", hcsFluctuationCalculator); } - hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNKaPNKaM", ";;#it{N}(K^{+});#it{N}(K^{#minus});", hcsCalculationFluctuation); + hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNKaPNKaM", ";;#it{N}(K^{+});#it{N}(K^{#minus});", hcsDistribution); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaP", "", hcsFluctuationCalculator); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaM", "", hcsFluctuationCalculator); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorKaT", "", hcsFluctuationCalculator); @@ -1627,9 +1635,13 @@ struct PartNumFluc { fluctuationCalculatorTrackPrN = std::make_unique(); if (doprocessMc.value) { - hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNPrPNPrM_mc", ";;#it{N}(p);#it{N}(#bar{p});", hcsCalculationFluctuation); + hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNPrPNPrM_mc", ";;#it{N}(p);#it{N}(#bar{p});", hcsDistribution); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrP_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrM_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrT_mc", "", hcsFluctuationCalculator); + hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrN_mc", "", hcsFluctuationCalculator); } - hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNPrPNPrM", ";;#it{N}(p);#it{N}(#bar{p});", hcsCalculationFluctuation); + hrCalculationFluctuation.add("CalculationFluctuation/hCentralityNPrPNPrM", ";;#it{N}(p);#it{N}(#bar{p});", hcsDistribution); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrP", "", hcsFluctuationCalculator); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrM", "", hcsFluctuationCalculator); hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrT", "", hcsFluctuationCalculator); @@ -1967,9 +1979,9 @@ struct PartNumFluc { holderTrack.tofNSigmaPi = holderTrack.tofNSigmaKa = holderTrack.tofNSigmaPr = HolderTrack::truncateNSigmaPid(HolderTrack::TruncationAbsNSigmaPid); } if (holderTrack.hasTpcPid && holderTrack.hasTofPid) { - holderTrack.tpcTofNSigmaPi = HolderTrack::truncateNSigmaPid(std::copysign(std::hypot(holderTrack.tpcNSigmaPi, holderTrack.tofNSigmaPi), std::abs(holderTrack.tpcNSigmaPi) >= std::abs(holderTrack.tofNSigmaPi) ? holderTrack.tpcNSigmaPi : holderTrack.tofNSigmaPi)); - holderTrack.tpcTofNSigmaKa = HolderTrack::truncateNSigmaPid(std::copysign(std::hypot(holderTrack.tpcNSigmaKa, holderTrack.tofNSigmaKa), std::abs(holderTrack.tpcNSigmaKa) >= std::abs(holderTrack.tofNSigmaKa) ? holderTrack.tpcNSigmaKa : holderTrack.tofNSigmaKa)); - holderTrack.tpcTofNSigmaPr = HolderTrack::truncateNSigmaPid(std::copysign(std::hypot(holderTrack.tpcNSigmaPr, holderTrack.tofNSigmaPr), std::abs(holderTrack.tpcNSigmaPr) >= std::abs(holderTrack.tofNSigmaPr) ? holderTrack.tpcNSigmaPr : holderTrack.tofNSigmaPr)); + holderTrack.tpcTofNSigmaPi = HolderTrack::truncateNSigmaPid(std::copysign(std::hypot(holderTrack.tpcNSigmaPi, holderTrack.tofNSigmaPi), holderTrack.tpcNSigmaPi + holderTrack.tofNSigmaPi)); + holderTrack.tpcTofNSigmaKa = HolderTrack::truncateNSigmaPid(std::copysign(std::hypot(holderTrack.tpcNSigmaKa, holderTrack.tofNSigmaKa), holderTrack.tpcNSigmaKa + holderTrack.tofNSigmaKa)); + holderTrack.tpcTofNSigmaPr = HolderTrack::truncateNSigmaPid(std::copysign(std::hypot(holderTrack.tpcNSigmaPr, holderTrack.tofNSigmaPr), holderTrack.tpcNSigmaPr + holderTrack.tofNSigmaPr)); } else { holderTrack.tpcTofNSigmaPi = holderTrack.tpcTofNSigmaKa = holderTrack.tpcTofNSigmaPr = HolderTrack::truncateNSigmaPid(HolderTrack::TruncationAbsNSigmaPid); } @@ -2411,7 +2423,7 @@ struct PartNumFluc { { if (isGoodMomentum() && holderTrack.hasTpcPid) { if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - if (holderTrack.pt < groupTrack.cfgThresholdPtTofPi.value) { + if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPi.value) { switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { case 1: { holderEvent.nChP++; @@ -2454,7 +2466,7 @@ struct PartNumFluc { } break; } } - if (holderTrack.pt < groupTrack.cfgThresholdPtTofKa.value) { + if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofKa.value) { switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { case 1: { holderEvent.nChP++; @@ -2497,7 +2509,7 @@ struct PartNumFluc { } break; } } - if (holderTrack.pt < groupTrack.cfgThresholdPtTofPr.value) { + if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPr.value) { switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { case 1: { holderEvent.nChP++; @@ -2543,7 +2555,7 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - if (holderTrack.pt < groupTrack.cfgThresholdPtTofKa.value) { + if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofKa.value) { switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { case 1: { holderEvent.nKaP++; @@ -2589,7 +2601,7 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - if (holderTrack.pt < groupTrack.cfgThresholdPtTofPr.value) { + if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPr.value) { switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { case 1: { holderEvent.nPrP++; @@ -2992,10 +3004,32 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagQaMc.value) { - hrQaMc.fill(HIST("QaMc/hCentralityVzVzMc"), holderEvent.centrality, holderEvent.vz, holderMcEvent.vz); + hrQaMc.fill(HIST("QaMc/hCentralityVzDeltaVz"), holderEvent.centrality, holderEvent.vz, holderEvent.vz - holderMcEvent.vz); } if ((groupAnalysis.cfgFlagQaPhi.value || groupAnalysis.cfgFlagQaPhiPi.value || groupAnalysis.cfgFlagQaPhiKa.value || groupAnalysis.cfgFlagQaPhiPr.value) || (groupAnalysis.cfgFlagCalculationYieldPi.value || groupAnalysis.cfgFlagCalculationYieldKa.value || groupAnalysis.cfgFlagCalculationYieldPr.value) || (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value)) { + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { + holderEvent.subgroupIndex = gRandom->Integer(groupEvent.cfgNSubgroups.value); + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { + fluctuationCalculatorTrackChP->init(); + fluctuationCalculatorTrackChM->init(); + fluctuationCalculatorTrackChT->init(); + fluctuationCalculatorTrackChN->init(); + } + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { + fluctuationCalculatorTrackKaP->init(); + fluctuationCalculatorTrackKaM->init(); + fluctuationCalculatorTrackKaT->init(); + fluctuationCalculatorTrackKaN->init(); + } + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { + fluctuationCalculatorTrackPrP->init(); + fluctuationCalculatorTrackPrM->init(); + fluctuationCalculatorTrackPrT->init(); + fluctuationCalculatorTrackPrN->init(); + } + } + for (const auto& mcParticle : mcParticles) { if (!initMcParticle(mcParticle)) { continue; @@ -3020,6 +3054,9 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { holderEvent.nChPMc++; + fluctuationCalculatorTrackChP->fill(1., 1.); + fluctuationCalculatorTrackChT->fill(1., 1.); + fluctuationCalculatorTrackChN->fill(1., 1.); } break; case PDG_t::kPiMinus: @@ -3031,6 +3068,9 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { holderEvent.nChMMc++; + fluctuationCalculatorTrackChM->fill(1., 1.); + fluctuationCalculatorTrackChT->fill(1., 1.); + fluctuationCalculatorTrackChN->fill(-1., 1.); } break; case PDG_t::kKPlus: @@ -3042,9 +3082,15 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { holderEvent.nChPMc++; + fluctuationCalculatorTrackChP->fill(1., 1.); + fluctuationCalculatorTrackChT->fill(1., 1.); + fluctuationCalculatorTrackChN->fill(1., 1.); } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { holderEvent.nKaPMc++; + fluctuationCalculatorTrackKaP->fill(1., 1.); + fluctuationCalculatorTrackKaT->fill(1., 1.); + fluctuationCalculatorTrackKaN->fill(1., 1.); } break; case PDG_t::kKMinus: @@ -3056,9 +3102,15 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { holderEvent.nChMMc++; + fluctuationCalculatorTrackChM->fill(1., 1.); + fluctuationCalculatorTrackChT->fill(1., 1.); + fluctuationCalculatorTrackChN->fill(-1., 1.); } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { holderEvent.nKaMMc++; + fluctuationCalculatorTrackKaM->fill(1., 1.); + fluctuationCalculatorTrackKaT->fill(1., 1.); + fluctuationCalculatorTrackKaN->fill(-1., 1.); } break; case PDG_t::kProton: @@ -3070,9 +3122,15 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { holderEvent.nChPMc++; + fluctuationCalculatorTrackChP->fill(1., 1.); + fluctuationCalculatorTrackChT->fill(1., 1.); + fluctuationCalculatorTrackChN->fill(1., 1.); } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { holderEvent.nPrPMc++; + fluctuationCalculatorTrackPrP->fill(1., 1.); + fluctuationCalculatorTrackPrT->fill(1., 1.); + fluctuationCalculatorTrackPrN->fill(1., 1.); } break; case PDG_t::kProtonBar: @@ -3084,9 +3142,15 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { holderEvent.nChMMc++; + fluctuationCalculatorTrackChM->fill(1., 1.); + fluctuationCalculatorTrackChT->fill(1., 1.); + fluctuationCalculatorTrackChN->fill(-1., 1.); } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { holderEvent.nPrMMc++; + fluctuationCalculatorTrackPrM->fill(1., 1.); + fluctuationCalculatorTrackPrT->fill(1., 1.); + fluctuationCalculatorTrackPrN->fill(-1., 1.); } break; } @@ -3095,18 +3159,35 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNChPNChM_mc"), holderEvent.centrality, holderEvent.nChPMc, holderEvent.nChMMc); + for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChP->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChM->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChT_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChT->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChN_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChN->getProductFast(iOrderVector)); + } } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNKaPNKaM_mc"), holderEvent.centrality, holderEvent.nKaPMc, holderEvent.nKaMMc); + for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaP->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaM->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaT_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaT->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaN_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaN->getProductFast(iOrderVector)); + } } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNPrPNPrM_mc"), holderEvent.centrality, holderEvent.nPrPMc, holderEvent.nPrMMc); + for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrP->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrM->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrT_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrT->getProductFast(iOrderVector)); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrN_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrN->getProductFast(iOrderVector)); + } } } if (groupAnalysis.cfgFlagQaTrack.value || groupAnalysis.cfgFlagQaDca.value || (groupAnalysis.cfgFlagQaAcceptance.value || groupAnalysis.cfgFlagQaAcceptancePi.value || groupAnalysis.cfgFlagQaAcceptanceKa.value || groupAnalysis.cfgFlagQaAcceptancePr.value) || (groupAnalysis.cfgFlagQaPhi.value || groupAnalysis.cfgFlagQaPhiPi.value || groupAnalysis.cfgFlagQaPhiKa.value || groupAnalysis.cfgFlagQaPhiPr.value) || (groupAnalysis.cfgFlagQaPid.value || groupAnalysis.cfgFlagQaPidPi.value || groupAnalysis.cfgFlagQaPidKa.value || groupAnalysis.cfgFlagQaPidPr.value) || (groupAnalysis.cfgFlagCalculationYieldPi.value || groupAnalysis.cfgFlagCalculationYieldKa.value || groupAnalysis.cfgFlagCalculationYieldPr.value) || (groupAnalysis.cfgFlagCalculationPurityPi.value || groupAnalysis.cfgFlagCalculationPurityKa.value || groupAnalysis.cfgFlagCalculationPurityPr.value) || (groupAnalysis.cfgFlagCalculationFractionPrimaryPi.value || groupAnalysis.cfgFlagCalculationFractionPrimaryKa.value || groupAnalysis.cfgFlagCalculationFractionPrimaryPr.value) || (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value)) { if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - holderEvent.subgroupIndex = gRandom->Integer(groupEvent.cfgNSubgroups.value); if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { fluctuationCalculatorTrackChP->init(); fluctuationCalculatorTrackChM->init(); @@ -3546,7 +3627,7 @@ struct PartNumFluc { } } - if ((groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value)) { + if ((groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) && (!groupTrack.cfgFlagMcParticlePhysicalPrimary.value || mcParticle.isPhysicalPrimary())) { if (groupTrack.cfgFlagMcParticleMomentum.value) { calculateFluctuation(); } else { From 9f1ece1437ed60c88a136782add06447e04f57ce Mon Sep 17 00:00:00 2001 From: Jinhyun Park <125851562+jinhyunni@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:44:03 +0900 Subject: [PATCH 036/282] [PWGHF] Xic0 update (#15487) --- .../candidateCreatorXic0Omegac0Qa.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx index b67ea5cd15e..5fea587b563 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx @@ -994,6 +994,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { kfCasc.Construct(cascDaughters, 2); } catch (std::runtime_error& e) { LOG(debug) << "Failed to construct Cascade: " << e.what(); + continue; } float massCasc, sigMassCasc, massCascRej, sigMassCascRej; @@ -1002,7 +1003,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { if (sigMassCasc <= 0) { continue; } - if (std::abs(massCasc - massCasc) > configs.massToleranceCascade) { + if (std::abs(massCasc - massOfCascade) > configs.massToleranceCascade) { continue; } if (kfCasc.GetNDF() <= 0 || kfCasc.GetChi2() <= 0) { @@ -1016,6 +1017,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { kfCascRej.Construct(cascDaughtersRej, 2); } catch (std::runtime_error& e) { LOG(debug) << "Failed to construct Cascade_rej: " << e.what(); + continue; } kfCascRej.GetMass(massCascRej, sigMassCascRej); @@ -1041,6 +1043,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { kfCharmBaryon.Construct(charmBaryonDaughters, 2); } catch (std::runtime_error& e) { LOG(debug) << "Failed to construct Charm baryon: " << e.what(); + continue; } float massCharmBaryon, sigMassCharmBaryon; @@ -1071,7 +1074,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { // To Casc KFParticle kfBachToCasc = kfBach; KFParticle kfV0ToCasc = kfV0; - kfBach.SetProductionVertex(kfCasc); + kfBachToCasc.SetProductionVertex(kfCasc); kfV0ToCasc.SetProductionVertex(kfCasc); // To Charm baryon @@ -1099,7 +1102,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { std::array pVecV0 = {kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz()}; std::array pVecBach = {kfBachToCasc.GetPx(), kfBachToCasc.GetPy(), kfBachToCasc.GetPz()}; std::array pVecCharmBachelorAsD = {kfCharmBachToCharmBaryon.GetPx(), kfCharmBachToCharmBaryon.GetPy(), kfCharmBachToCharmBaryon.GetPz()}; - std::array pVecCharmBaryon = {kfCharmBaryon.GetPx(), kfCharmBaryon.GetPy(), kfCharmBaryon.GetPy()}; + std::array pVecCharmBaryon = {kfCharmBaryon.GetPx(), kfCharmBaryon.GetPy(), kfCharmBaryon.GetPz()}; auto* covVtxCharmBaryon = kfCharmBaryon.CovarianceMatrix(); float covMatrixPv[6]; @@ -1146,8 +1149,8 @@ struct HfCandidateCreatorXic0Omegac0Qa { float chi2NdfTopoCharmBaryonToPv = kfCharmBaryonToPv.GetChi2() / kfCharmBaryonToPv.GetNDF(); float chi2NdfTopoBachToCasc = kfBachToCasc.GetChi2() / kfBachToCasc.GetNDF(); float chi2NdfTopoV0ToCasc = kfV0ToCasc.GetChi2() / kfV0ToCasc.GetNDF(); - float chi2NdfTopoCharmBachToCharmBaryon = kfCharmBachToCharmBaryon.GetChi2() / kfCharmBachToCharmBaryon.GetChi2(); - float chi2NdfTopoCascToCharmBaryon = kfCascToCharmBaryon.GetChi2() / kfCascToCharmBaryon.GetChi2(); + float chi2NdfTopoCharmBachToCharmBaryon = kfCharmBachToCharmBaryon.GetChi2() / kfCharmBachToCharmBaryon.GetNDF(); + float chi2NdfTopoCascToCharmBaryon = kfCascToCharmBaryon.GetChi2() / kfCascToCharmBaryon.GetNDF(); // get ldl float ldlV0 = ldlFromKF(kfV0, kfPv); @@ -1177,7 +1180,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { float decayLCharmBaryon = RecoDecay::distance(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{kfCharmBaryon.GetX(), kfCharmBaryon.GetY(), kfCharmBaryon.GetZ()}); double phiCharmBaryon, thetaCharmBaryon; - getPointDirection(std::array{kfV0.GetX(), kfV0.GetY(), kfV0.GetZ()}, std::array{kfCharmBaryon.GetX(), kfCharmBaryon.GetY(), kfCharmBaryon.GetZ()}, phiCharmBaryon, thetaCharmBaryon); + getPointDirection(std::array{primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}, std::array{kfCharmBaryon.GetX(), kfCharmBaryon.GetY(), kfCharmBaryon.GetZ()}, phiCharmBaryon, thetaCharmBaryon); float errDecayLCharmBaryon = std::sqrt(getRotatedCovMatrixXX(covMatrixPv, phiCharmBaryon, thetaCharmBaryon) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon)); // get cosine of pointing angle From 2209841138c6b3567a5b81a24f0faf13899ee265 Mon Sep 17 00:00:00 2001 From: yakparo Date: Mon, 23 Mar 2026 14:30:41 +0100 Subject: [PATCH 037/282] [PWGLF] Add BestCentrality MC events histos (#15492) --- PWGLF/Tasks/Strangeness/strangeCascTrack.cxx | 35 ++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx index ef663426c63..44eb59d507e 100644 --- a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx +++ b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx @@ -855,6 +855,7 @@ struct StrangeCascTrack { histos.add("MC/EvRec/EvCounter", "Event Counter", kTH1D, {{1, 0, 1}}); histos.add("MC/EvRec/Mult", "Event charged multiplicty (gen events with reco>=1)", kTH1D, {{1600, 0, 3200}}); histos.add("MC/EvRec/MultCent", "Gen multiplicity vs reco centrality", kTH2D, {{100, 0, 100}, {1600, 0, 3200}}); + histos.add("MC/EvRec/Cent", "FT0 Centality", kTH1D, {axesConfig.axisMult}); histos.add("MC/EvRec/Xi", "Xi", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated Xis in reco>=1 histos.add("MC/EvRec/PrimaryXi", "Xi primaries", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Xis in reco>=1 histos.add("MC/EvRec/PrimaryXiRapidity", "Xi primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Xis in selected rapidity range in reco>=1 @@ -1048,6 +1049,8 @@ struct StrangeCascTrack { // look at reco>= 1 for corrections auto slicedRecColls = recColls.sliceBy(perMcCollision, genColl.globalIndex()); bool recoCounter = false; + int biggestNContribs = -1; + float bestCentrality = 100.5; for (auto const& recColl : slicedRecColls) { if (!isValidEvent(recColl, false)) continue; // from this point on - only gen events (and cascades from such events) that were reconstructed @@ -1059,42 +1062,48 @@ struct StrangeCascTrack { histos.fill(HIST("MC/EvRec/Mult"), genMult); recoCounter = true; } - // fill multiplicity-centrality distribution - double recoMult = (doProcessIons) ? recColl.centFT0C() : recColl.centFT0M(); - histos.fill(HIST("MC/EvRec/MultCent"), recoMult, genMult); + if (biggestNContribs < recColl.multPVTotalContributors()) { + biggestNContribs = recColl.multPVTotalContributors(); + bestCentrality = (doProcessIons) ? recColl.centFT0C() : recColl.centFT0M(); + } // look at generated cascades within reconstructed events for (auto const& casc : slicedGenCascs) { if (casc.straMCCollisionId() != genCollId) continue; // check for cascades belonging to the correct reco collision double cascPt = casc.ptMC(); if (isValidPDG(casc, "Xi")) - histos.fill(HIST("MC/EvRec/Xi"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/Xi"), cascPt, bestCentrality); if (isValidPDG(casc, "Omega")) - histos.fill(HIST("MC/EvRec/Omega"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/Omega"), cascPt, bestCentrality); if (casc.isPhysicalPrimary()) { if (isValidPDG(casc, "Xi")) { - histos.fill(HIST("MC/EvRec/PrimaryXi"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryXi"), cascPt, bestCentrality); if (std::abs(casc.rapidityMC(0)) < selCuts.cutRapidity) { - histos.fill(HIST("MC/EvRec/PrimaryXiRapidity"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryXiRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kXiMinus) - histos.fill(HIST("MC/EvRec/PrimaryXiMinusRapidity"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryXiMinusRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kXiPlusBar) - histos.fill(HIST("MC/EvRec/PrimaryXiPlusRapidity"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryXiPlusRapidity"), cascPt, bestCentrality); } } if (isValidPDG(casc, "Omega")) { - histos.fill(HIST("MC/EvRec/PrimaryOmega"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryOmega"), cascPt, bestCentrality); if (std::abs(casc.rapidityMC(2)) < selCuts.cutRapidity) { - histos.fill(HIST("MC/EvRec/PrimaryOmegaRapidity"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryOmegaRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kOmegaMinus) - histos.fill(HIST("MC/EvRec/PrimaryOmegaMinusRapidity"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryOmegaMinusRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kOmegaPlusBar) - histos.fill(HIST("MC/EvRec/PrimaryOmegaPlusRapidity"), cascPt, recoMult); + histos.fill(HIST("MC/EvRec/PrimaryOmegaPlusRapidity"), cascPt, bestCentrality); } } } } } + // fill centrality exactly once for each rec gen event + if (biggestNContribs >= 0) { + histos.fill(HIST("MC/EvRec/MultCent"), bestCentrality, genMult); + histos.fill(HIST("MC/EvRec/Cent"), bestCentrality); + } } } From 37ff46a0c63855b80e8a3f1623a1939b9fdf3378 Mon Sep 17 00:00:00 2001 From: Kegang Xiong Date: Mon, 23 Mar 2026 22:24:01 +0800 Subject: [PATCH 038/282] [PWGCF] Add some QA plots (#15494) Co-authored-by: kegangxiong --- PWGCF/Flow/Tasks/flowZdcEnergy.cxx | 108 +++++++++++++++++++---------- 1 file changed, 71 insertions(+), 37 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx index f812b999c33..fb868177af1 100644 --- a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx +++ b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx @@ -14,9 +14,11 @@ /// \since 03/2026 /// \brief Study ZDC energy observables versus centrality for Run 2 / Run 3. +#include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "CCDB/BasicCCDBManager.h" #include "Framework/AnalysisTask.h" @@ -30,18 +32,28 @@ using namespace o2; using namespace o2::framework; +using namespace o2::framework::expressions; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; struct flowZdcEnergy { struct : ConfigurableGroup{ - O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 0.f, "Minimum centrality for selected events") - O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 90.f, "Maximum centrality for selected events") - O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10.f, "Accepted z-vertex range")} evsel; + O2_DEFINE_CONFIGURABLE(cfgUseEvsel, bool, true, "whether to enable event selection") + O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 0.f, "Minimum centrality for selected events") + O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 90.f, "Maximum centrality for selected events") + O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10.f, "Accepted z-vertex range")} evsel; + + O2_DEFINE_CONFIGURABLE(cfgEtaMax, float, 0.8f, "Maximum track #eta") + O2_DEFINE_CONFIGURABLE(cfgPtMin, float, 0.2f, "Minimum track #P_{t}") + O2_DEFINE_CONFIGURABLE(cfgPtMax, float, 10.0f, "Maximum track #P_{t}") + O2_DEFINE_CONFIGURABLE(cfgDcaXYMax, float, 0.2f, "Maximum DCAxy") + O2_DEFINE_CONFIGURABLE(cfgDcaZMax, float, 2.0f, "Maximum DCAz") ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality (%)"}; ConfigurableAxis axisMult{"axisMult", {100, 0, 100000}, "Multiplicity"}; + ConfigurableAxis axisPt{"axisPt", {100, 0, 15}, "#P_{t}"}; + ConfigurableAxis axisEta{"axisEta", {64, -1.6, 1.6}, "#eta"}; ConfigurableAxis axisEnergy{"axisEnergy", {300, 0, 300}, "Energy"}; ConfigurableAxis axisRescaledDiff{"axisRescaledDiff", {400, -1, 1}, "(EA-EC)/(EA+EC)"}; @@ -59,6 +71,8 @@ struct flowZdcEnergy { Service ccdb; HistogramRegistry registry{"registry"}; + Filter trackFilter = nabs(aod::track::eta) < cfgEtaMax && aod::track::pt > cfgPtMin&& aod::track::pt < cfgPtMax&& nabs(aod::track::dcaXY) < cfgDcaXYMax&& nabs(aod::track::dcaZ) < cfgDcaZMax; + using UsedTracks = soa::Filtered>; // Run 3 using CollisionsRun3 = soa::Join; using BCsRun3 = soa::Join; @@ -77,8 +91,8 @@ struct flowZdcEnergy { .count(); ccdb->setCreatedNotAfter(now); - registry.add("hEventCount", "Event counter;Selection;Events", {HistType::kTH1D, {{kNSelections, 0, kNSelections}}}); - auto hCount = registry.get(HIST("hEventCount")); + registry.add("QA/hEventCount", "Event counter;Selection;Events", {HistType::kTH1D, {{kNSelections, 0, kNSelections}}}); + auto hCount = registry.get(HIST("QA/hEventCount")); hCount->GetXaxis()->SetBinLabel(kAllEvents + 1, "All events"); hCount->GetXaxis()->SetBinLabel(kSeln + 1, "Sel7/8"); hCount->GetXaxis()->SetBinLabel(kZvtx + 1, "Zvtx"); @@ -86,8 +100,11 @@ struct flowZdcEnergy { hCount->GetXaxis()->SetBinLabel(kBCHasZDC + 1, "BC has ZDC"); hCount->GetXaxis()->SetBinLabel(kSelectedZDC + 1, "Selected ZDC"); - registry.add("hCentrality", "", {HistType::kTH1D, {axisCent}}); - registry.add("hMultiplicity", "", {HistType::kTH1D, {axisMult}}); + registry.add("QA/hCentrality", "", {HistType::kTH1D, {axisCent}}); + registry.add("QA/hMultiplicity", "", {HistType::kTH1D, {axisMult}}); + registry.add("QA/hMultiplicity_TPC", "", {HistType::kTH1D, {axisMult}}); + registry.add("QA/hPt", "", {HistType::kTH1D, {axisPt}}); + registry.add("QA/hEta", "", {HistType::kTH1D, {axisEta}}); registry.add("hEnergyWithCent_ZNA_Common", "", {HistType::kTH2D, {axisEnergy, axisCent}}); registry.add("hEnergyWithCent_ZNC_Common", "", {HistType::kTH2D, {axisEnergy, axisCent}}); @@ -107,28 +124,31 @@ struct flowZdcEnergy { // Helper: event selection template - bool acceptEvent(TCollision const& collision, float centrality, const int runmode) + bool acceptEvent(TCollision const& collision, bool UseEvsel, float centrality, const int runmode) { - registry.fill(HIST("hEventCount"), kAllEvents); - - if (runmode == 2 && !collision.sel7()) { - return false; - } - if (runmode == 3 && !collision.sel8()) { - return false; - } - registry.fill(HIST("hEventCount"), kSeln); - - if (std::abs(collision.posZ()) > evsel.cfgVtxZ) { - return false; - } - registry.fill(HIST("hEventCount"), kZvtx); - - if (centrality < evsel.cfgCentMin || centrality > evsel.cfgCentMax) { - return false; + if (!UseEvsel) { + registry.fill(HIST("QA/hEventCount"), kAllEvents); + registry.fill(HIST("QA/hEventCount"), kSeln); + registry.fill(HIST("QA/hEventCount"), kZvtx); + registry.fill(HIST("QA/hEventCount"), kCentrality); + } else { + registry.fill(HIST("QA/hEventCount"), kAllEvents); + if (runmode == 2 && !collision.sel7()) { + return false; + } + if (runmode == 3 && !collision.sel8()) { + return false; + } + registry.fill(HIST("QA/hEventCount"), kSeln); + if (std::abs(collision.posZ()) > evsel.cfgVtxZ) { + return false; + } + registry.fill(HIST("QA/hEventCount"), kZvtx); + if (centrality < evsel.cfgCentMin || centrality > evsel.cfgCentMax) { + return false; + } + registry.fill(HIST("QA/hEventCount"), kCentrality); } - registry.fill(HIST("hEventCount"), kCentrality); - return true; } @@ -140,13 +160,13 @@ struct flowZdcEnergy { if (!foundBC.has_zdc()) { return; } - registry.fill(HIST("hEventCount"), kBCHasZDC); + registry.fill(HIST("QA/hEventCount"), kBCHasZDC); const auto& zdc = foundBC.zdc(); if (zdc.energyCommonZNA() <= 1.f || zdc.energyCommonZNC() <= 1.f) { return; } - registry.fill(HIST("hEventCount"), kSelectedZDC); + registry.fill(HIST("QA/hEventCount"), kSelectedZDC); const float energyCommonZNA = zdc.energyCommonZNA(); const float energyCommonZNC = zdc.energyCommonZNC(); @@ -188,36 +208,50 @@ struct flowZdcEnergy { // Run 3 process void processRun3(CollisionsRun3::iterator const& collision, + UsedTracks const& tracks, BCsRun3 const&, aod::Zdcs const&) { const float centrality = collision.centFT0C(); const float multi = collision.multFT0C(); + const float multiTPC = collision.multTPC(); - if (!acceptEvent(collision, centrality, 3)) { + if (!acceptEvent(collision, evsel.cfgUseEvsel, centrality, 3)) { return; } - registry.fill(HIST("hCentrality"), centrality); - registry.fill(HIST("hMultiplicity"), multi); - + registry.fill(HIST("QA/hCentrality"), centrality); + registry.fill(HIST("QA/hMultiplicity"), multi); + registry.fill(HIST("QA/hMultiplicity_TPC"), multiTPC); fillZDCObservables(collision, centrality); + + for (const auto& track : tracks) { + registry.fill(HIST("QA/hPt"), track.pt()); + registry.fill(HIST("QA/hEta"), track.eta()); + } } // Run 2 process void processRun2(CollisionsRun2::iterator const& collision, + UsedTracks const& tracks, BCsRun2 const&, aod::Zdcs const&) { const float centrality = collision.centRun2V0M(); const float multi = collision.multFV0M(); + const float multiTPC = collision.multTPC(); - if (!acceptEvent(collision, centrality, 2)) { + if (!acceptEvent(collision, evsel.cfgUseEvsel, centrality, 2)) { return; } - registry.fill(HIST("hCentrality"), centrality); - registry.fill(HIST("hMultiplicity"), multi); - + registry.fill(HIST("QA/hCentrality"), centrality); + registry.fill(HIST("QA/hMultiplicity"), multi); + registry.fill(HIST("QA/hMultiplicity_TPC"), multiTPC); fillZDCObservables(collision, centrality); + + for (const auto& track : tracks) { + registry.fill(HIST("QA/hPt"), track.pt()); + registry.fill(HIST("QA/hEta"), track.eta()); + } } // Process switches From 6cad4aba93e1cb5279162c4f85c659dae1a8be2e Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Mon, 23 Mar 2026 15:47:22 +0100 Subject: [PATCH 039/282] [PWGCF] add pid efficiency loading (#15495) --- .../Tasks/flowGenericFramework.cxx | 149 +++++++++++------- 1 file changed, 91 insertions(+), 58 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index e848d353761..c540448709a 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -137,11 +137,13 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgUsePID, bool, true, "Enable PID information") O2_DEFINE_CONFIGURABLE(cfgUseGapMethod, bool, false, "Use gap method in vn-pt calculations") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") + O2_DEFINE_CONFIGURABLE(cfgUsePIDEfficiencies, bool, false, "Use species dependent efficiencies") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") O2_DEFINE_CONFIGURABLE(cfgPtmin, float, 0.2, "minimum pt (GeV/c)"); O2_DEFINE_CONFIGURABLE(cfgPtmax, float, 10, "maximum pt (GeV/c)"); O2_DEFINE_CONFIGURABLE(cfgEta, float, 0.8, "eta cut"); O2_DEFINE_CONFIGURABLE(cfgEtaPtPt, float, 0.4, "eta cut for pt-pt correlations"); + O2_DEFINE_CONFIGURABLE(cfgEtaNch, float, 0.4, "eta cut for nch selection"); O2_DEFINE_CONFIGURABLE(cfgUsePIDTotal, bool, false, "use fraction of PID total"); O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10, "vertex cut (cm)"); struct : ConfigurableGroup { @@ -223,6 +225,7 @@ struct FlowGenericFramework { struct Config { TH1D* mEfficiency = nullptr; + std::vector mPIDEfficiencies; std::vector mAcceptance; bool correctionsLoaded = false; } cfg; @@ -845,11 +848,21 @@ struct FlowGenericFramework { } } if (!cfgEfficiency.value.empty()) { - cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); - if (cfg.mEfficiency == nullptr) { - LOGF(fatal, "Could not load efficiency histogram from %s", cfgEfficiency.value.c_str()); + if (!cfgUsePIDEfficiencies) { + cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); + if (cfg.mEfficiency == nullptr) { + LOGF(fatal, "Could not load efficiency histogram from %s", cfgEfficiency.value.c_str()); + } + LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency); + } else { + std::vector species = {"ch", "pi", "ka", "pr", "k0", "lambda"}; + for (const auto& sp : species) { + cfg.mPIDEfficiencies.push_back(ccdb->getForTimeStamp(cfgEfficiency.value + "/" + sp, timestamp)); + if (cfg.mPIDEfficiencies.back() == nullptr) + LOGF(fatal, "Could not load PID efficiency histograms from %s", cfgEfficiency.value + "/" + sp); + LOGF(info, "Loaded PID efficiency histogram from %s", cfgEfficiency.value + "/" + sp); + } } - LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency); } cfg.correctionsLoaded = true; } @@ -864,11 +877,15 @@ struct FlowGenericFramework { } template - double getEfficiency(TTrack track) + double getEfficiency(TTrack track, int pidIndex = 0) { //-1 ref, 0 ch, 1 pi, 2 ka, 3 pr double eff = 1.; - if (cfg.mEfficiency) - eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(track.pt())); + if (!cfgUsePIDEfficiencies) { + if (cfg.mEfficiency) + eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(track.pt())); + } else { + eff = cfg.mPIDEfficiencies[pidIndex]->GetBinContent(cfg.mPIDEfficiencies[pidIndex]->FindBin(track.pt())); + } if (eff == 0) return -1.; else @@ -1441,8 +1458,10 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; - acceptedTracks.total += getEfficiency(track); - ++acceptedTracks.total_uncorr; + if (std::abs(track.eta()) < cfgEtaNch) { + acceptedTracks.total += getEfficiency(track, 0); + ++acceptedTracks.total_uncorr; + } if (!trackSelected(track, field)) return; @@ -1457,18 +1476,20 @@ struct FlowGenericFramework { pidIndex = 3; } - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); - int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 1) - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 2) - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 3) - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + if (std::abs(track.eta()) < cfgEtaNch) { + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track, pidIndex); + + int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; + if (pidIndex == 1) + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (pidIndex == 2) + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (pidIndex == 3) + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + } } if (cfgFillWeights) { @@ -1504,21 +1525,24 @@ struct FlowGenericFramework { if (std::abs(track.pdgCode()) == kProton) pidIndex = 3; } - ++acceptedTracks.total; - ++acceptedTracks.total_uncorr; - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += 1; - int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += 1.0; - if (pidIndex == 1) - acceptedTracks.npi[ptBinIndex] += 1.0; - if (pidIndex == 2) - acceptedTracks.nka[ptBinIndex] += 1.0; - if (pidIndex == 3) - acceptedTracks.npr[ptBinIndex] += 1.0; + if (std::abs(track.eta()) < cfgEtaNch) { + ++acceptedTracks.total; + ++acceptedTracks.total_uncorr; + + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += 1; + int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; + + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + acceptedTracks.nch[ptBinIndex] += 1.0; + if (pidIndex == 1) + acceptedTracks.npi[ptBinIndex] += 1.0; + if (pidIndex == 2) + acceptedTracks.nka[ptBinIndex] += 1.0; + if (pidIndex == 3) + acceptedTracks.npr[ptBinIndex] += 1.0; + } } fillPtSums(track, vtxz, pidIndex); @@ -1532,8 +1556,11 @@ struct FlowGenericFramework { // Select tracks with nominal cuts always if (!nchSelected(track)) return; - acceptedTracks.total += getEfficiency(track); - ++acceptedTracks.total_uncorr; + + if (std::abs(track.eta()) < cfgEtaNch) { + acceptedTracks.total += getEfficiency(track, 0); + ++acceptedTracks.total_uncorr; + } if (!trackSelected(track, field)) return; @@ -1541,23 +1568,25 @@ struct FlowGenericFramework { // if (cfgUsePID) Need PID for v02 int pidIndex = getNsigmaPID(track); - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); + if (std::abs(track.eta()) < cfgEtaNch) { + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track, pidIndex); - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); - int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; + if (pidIndex) + acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); + int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - if (pidIndex == 1) { - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - } - if (pidIndex == 2) { - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; - } - if (pidIndex == 3) { - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track) : 1.0; + if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; + if (pidIndex == 1) { + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + } + if (pidIndex == 2) { + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + } + if (pidIndex == 3) { + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + } } } @@ -1779,27 +1808,31 @@ struct FlowGenericFramework { bool withinPtNch = (track.pt() > ptmins[0] && track.pt() < ptmaxs[0]); if (!withinPtPOI && !withinPtRef) return; + double weff = (dt == kGen) ? 1. : getEfficiency(track, pid_index); + double weffInclusive = (dt == kGen) ? 1. : getEfficiency(track, 0); + if (weff < 0) + return; double waccRef = (dt == kGen) ? 1. : getAcceptance(track, vtxz, 0); double waccPOI = (dt == kGen) ? 1. : withinPtPOI ? getAcceptance(track, vtxz, pid_index + 1) : getAcceptance(track, vtxz, 0); // if (withinPtRef && withinPtPOI && pid_index) waccRef = waccPOI; // if particle is both (then it's overlap), override ref with POI if (withinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccRef, 1); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccRef * weffInclusive, 1); if (withinPtPOI && pid_index) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, (1 << (pid_index + 1))); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff, (1 << (pid_index + 1))); if (withinPtNch) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, 2); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff * weffInclusive, 2); if (withinPtPOI && withinPtRef && pid_index) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, (1 << (pid_index + 5))); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff, (1 << (pid_index + 5))); if (withinPtNch && withinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, 32); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff * weffInclusive, 32); } else { // Analysing only integrated flow bool withinPtRef = (track.pt() > o2::analysis::gfw::ptreflow && track.pt() < o2::analysis::gfw::ptrefup); bool withinPtPOI = (track.pt() > o2::analysis::gfw::ptpoilow && track.pt() < o2::analysis::gfw::ptpoiup); if (!withinPtPOI && !withinPtRef) return; - double weff = (dt == kGen) ? 1. : getEfficiency(track); + double weff = (dt == kGen) ? 1. : getEfficiency(track, 0); if (weff < 0) return; if (cfgUseDensityDependentCorrection && withinPtRef && dt != kGen) { From 3fa6ccdccca693d2f026ce08f9b334d8c8a9bf0a Mon Sep 17 00:00:00 2001 From: amaringarcia Date: Mon, 23 Mar 2026 17:56:07 +0100 Subject: [PATCH 040/282] =?UTF-8?q?[PWGEM]=20Adding=20histograms=20for=20a?= =?UTF-8?q?ccepted=20pi0=20and=20eta=20into=20gamma=20gamma=20decay=20cha?= =?UTF-8?q?=E2=80=A6=20(#15465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TableProducer/associateMCinfoPhoton.cxx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx index 26f83737285..685f5e886fa 100644 --- a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx @@ -65,6 +65,7 @@ struct AssociateMCInfoPhoton { Configurable margin_z_gen{"margin_z_gen", 15.f, "margin for Z of true photon conversion point to store generated information"}; Configurable max_rxy_gen{"max_rxy_gen", 100, "max rxy to store generated information"}; Configurable requireGammaGammaDecay{"requireGammaGammaDecay", false, "require gamma gamma decay for generated pi0 and eta meson"}; + Configurable cfg_max_eta_photon{"cfg_max_eta_gamma", 0.8, "max eta for photons at PV"}; HistogramRegistry registry{"EMMCEvent"}; @@ -98,6 +99,7 @@ struct AssociateMCInfoPhoton { for (uint i = 0; i < NParticleNames; i++) { registry.add(Form("Generated/h2PtY_%s", ParticleNames[i].data()), Form("Generated %s", ParticleNames[i].data()), kTH2F, {axisPt, axisRapidity}, true); + registry.add(Form("Generated/h2PtY_Accepted_%s", ParticleNames[i].data()), Form("Generated %s", ParticleNames[i].data()), kTH2F, {axisPt, axisRapidity}, true); } // reserve space for generated vectors if that process enabled @@ -170,6 +172,15 @@ struct AssociateMCInfoPhoton { for (const auto& mcParticle : groupedMcParticles) { // store necessary information for denominator of efficiency if ((mcParticle.isPhysicalPrimary() || mcParticle.producedByGenerator()) && std::fabs(mcParticle.y()) < 0.9f && mcParticle.pt() < 20.f) { auto binNumber = hBinFinder->FindBin(mcParticle.pt(), std::fabs(mcParticle.y())); // caution: pack + + bool isMesonAccepted = false; + if (mcParticle.has_daughters()) { + auto lDaughters = mcParticle.daughters_as(); + + if (areTwoPhotonDaughtersAccepted(lDaughters, cfg_max_eta_photon)) { + isMesonAccepted = true; + } + } switch (std::abs(mcParticle.pdgCode())) { case PDG_t::kGamma: registry.fill(HIST("Generated/h2PtY_Gamma"), mcParticle.pt(), std::fabs(mcParticle.y())); @@ -180,12 +191,18 @@ struct AssociateMCInfoPhoton { continue; registry.fill(HIST("Generated/h2PtY_Pi0"), mcParticle.pt(), std::fabs(mcParticle.y())); genPi0[binNumber]++; + if (isMesonAccepted) { + registry.fill(HIST("Generated/h2PtY_Accepted_Pi0"), mcParticle.pt(), std::fabs(mcParticle.y())); + } break; case Pdg::kEta: if (requireGammaGammaDecay && !isGammaGammaDecay(mcParticle, mcParticles)) continue; registry.fill(HIST("Generated/h2PtY_Eta"), mcParticle.pt(), std::fabs(mcParticle.y())); genEta[binNumber]++; + if (isMesonAccepted) { + registry.fill(HIST("Generated/h2PtY_Accepted_Eta"), mcParticle.pt(), std::fabs(mcParticle.y())); + } break; default: break; @@ -492,6 +509,21 @@ struct AssociateMCInfoPhoton { fCounters[1] = 0; } // end of skimmingMC + template + inline bool areTwoPhotonDaughtersAccepted(const Daughters& lDaughters, float maxEta) + { + if (lDaughters.size() != 2) { + return false; + } + + auto it0 = lDaughters.begin(); + auto it1 = it0; + ++it1; + + return (std::fabs(it0.eta()) < maxEta && + std::fabs(it1.eta()) < maxEta); + } + void processMC_PCM(MyCollisionsMC const& collisions, aod::BCs const& bcs, aod::McCollisions const& mccollisions, aod::McParticles const& mcParticles, TracksMC const& o2tracks, aod::V0PhotonsKF const& v0photons, aod::V0Legs const& v0legs) { skimmingMC(collisions, bcs, mccollisions, mcParticles, o2tracks, nullptr, v0photons, v0legs, nullptr, nullptr, nullptr); From 779b8a5eab744f8626d0682fddbdde548f76eb70 Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Mon, 23 Mar 2026 19:59:39 +0100 Subject: [PATCH 041/282] [PWGCF] Event and track selection updated (#15493) Co-authored-by: Maxim Virta Co-authored-by: ALICE Action Bot --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 486 ++++++++++++++++++-- 1 file changed, 450 insertions(+), 36 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 304b412696c..a4ec7e0f3af 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -91,12 +91,18 @@ int nBootstrap = 10; std::vector> etagapsPtPt; GFWRegions regions; GFWCorrConfigs configs; +std::vector multGlobalCorrCutPars; +std::vector multPVCorrCutPars; +std::vector multGlobalPVCorrCutPars; } // namespace o2::analysis::gfw struct FlowGfwV02 { O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgMpar, int, 4, "Highest order of pt-pt correlations") O2_DEFINE_CONFIGURABLE(cfgCentEstimator, int, 0, "0:FT0C; 1:FT0CVariant1; 2:FT0M; 3:FT0A") + O2_DEFINE_CONFIGURABLE(cfgCentralityFactor, double, 1., "Correction factor for testing centrality robustness"); + O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms") + O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") O2_DEFINE_CONFIGURABLE(cfgFixedMultMin, int, 1, "Minimum for fixed nch range"); @@ -104,22 +110,67 @@ struct FlowGfwV02 { O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5f, "Minimum pt to use TOF N-sigma") O2_DEFINE_CONFIGURABLE(cfgUseItsPID, bool, true, "Use ITS PID for particle identification") O2_DEFINE_CONFIGURABLE(cfgGetNsigmaQA, bool, true, "Get QA histograms for selection of pions, kaons, and protons") + O2_DEFINE_CONFIGURABLE(cfgGetdEdx, bool, true, "Get dEdx histograms for pions, kaons, and protons") O2_DEFINE_CONFIGURABLE(cfgUseMultiplicityFlowWeights, bool, true, "Enable or disable the use of multiplicity-based event weighting"); O2_DEFINE_CONFIGURABLE(cfgNormalizeByCharged, bool, true, "Enable or disable the normalization by charged particles"); O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 15, "Flag for consistent event selection"); + O2_DEFINE_CONFIGURABLE(cfgMultCut, bool, true, "Use additional event cut on mult correlations"); + // Event selection cuts + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(cfgNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); + O2_DEFINE_CONFIGURABLE(cfgIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); + O2_DEFINE_CONFIGURABLE(cfgIsGoodITSLayersAll, bool, true, "kIsGoodITSLayersAll"); + O2_DEFINE_CONFIGURABLE(cfgNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); + O2_DEFINE_CONFIGURABLE(cfgNoCollInRofStandard, bool, true, "kNoCollInRofStandard"); + O2_DEFINE_CONFIGURABLE(cfgNoHighMultCollInPrevRof, bool, true, "kNoHighMultCollInPrevRof"); + O2_DEFINE_CONFIGURABLE(cfgNoITSROFrameBorder, bool, true, "kNoITSROFrameBorder"); + O2_DEFINE_CONFIGURABLE(cfgNoTimeFrameBorder, bool, true, "kNoTimeFrameBorder"); + O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, true, "kTVXinTRD - Use kTVXinTRD (reject TRD triggered events)"); + O2_DEFINE_CONFIGURABLE(cfgIsVertexITSTPC, bool, true, "kIsVertexITSTPC - Selects collisions with at least one ITS-TPC track"); + } cfgEventCutFlags; + + struct : ConfigurableGroup { + Configurable> cfgMultGlobalCutPars{"cfgMultGlobalCutPars", std::vector{2272.16, -76.6932, 1.01204, -0.00631545, 1.59868e-05, 136.336, -4.97006, 0.121199, -0.0015921, 7.66197e-06}, "Global vs FT0C multiplicity cut parameter values"}; + Configurable> cfgMultPVCutPars{"cfgMultPVCutPars", std::vector{3074.43, -106.192, 1.46176, -0.00968364, 2.61923e-05, 182.128, -7.43492, 0.193901, -0.00256715, 1.22594e-05}, "PV vs FT0C multiplicity cut parameter values"}; + Configurable> cfgMultGlobalPVCutPars{"cfgMultGlobalPVCutPars", std::vector{-0.223013, 0.715849, 0.664242, 0.0829653, -0.000503733, 1.21185e-06}, "Global vs PV multiplicity cut parameter values"}; + O2_DEFINE_CONFIGURABLE(cfgMultCorrHighCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 3.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); + O2_DEFINE_CONFIGURABLE(cfgMultCorrLowCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x - 3.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); + O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCorrCutFunction, std::string, "[0] + [1]*x + 3*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", "Functional for global vs pv multiplicity correlation cut"); + } cfgMultCorrCuts; + + // Track selection cuts + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(cfgDCAxyNSigma, float, 7, "Cut on number of sigma deviations from expected DCA in the transverse direction"); + O2_DEFINE_CONFIGURABLE(cfgDCAxy, std::string, "(0.0026+0.005/(x^1.01))", "Functional form of pt-dependent DCAxy cut"); + O2_DEFINE_CONFIGURABLE(cfgDCAz, float, 2, "Cut on DCA in the longitudinal direction (cm)"); + O2_DEFINE_CONFIGURABLE(cfgNTPCCls, float, 50, "Cut on number of TPC clusters found"); + O2_DEFINE_CONFIGURABLE(cfgNTPCXrows, float, 70, "Cut on number of TPC crossed rows"); + O2_DEFINE_CONFIGURABLE(cfgMinNITSCls, float, 5, "Cut on minimum number of ITS clusters found"); + O2_DEFINE_CONFIGURABLE(cfgChi2PrITSCls, float, 36, "Cut on chi^2 per ITS clusters found"); + O2_DEFINE_CONFIGURABLE(cfgChi2PrTPCCls, float, 2.5, "Cut on chi^2 per TPC clusters found"); + O2_DEFINE_CONFIGURABLE(cfgPtMin, float, 0.2, "minimum pt (GeV/c)"); + O2_DEFINE_CONFIGURABLE(cfgPtMax, float, 10, "maximum pt (GeV/c)"); + O2_DEFINE_CONFIGURABLE(cfgEtaMax, float, 0.8, "eta cut"); + O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10, "vertex cut (cm)"); + O2_DEFINE_CONFIGURABLE(cfgOccupancySelection, int, 2000, "Max occupancy selection, -999 to disable"); + } cfgTrackCuts; + + struct : ConfigurableGroup { + ConfigurableAxis cfgAxisPt{"cfgPIDHistograms_cfgAxisPt", {VARIABLE_WIDTH, 0.2f, 0.5f, 1.f, 1.5f, 2.f, 3.f, 4.f, 6.f, 10.f}, "pt axis for histograms"}; + ConfigurableAxis cfgAxisNsigmaTPC{"cfgPIDHistograms_cfgAxisNsigmaTPC", {80, -5.f, 5.f}, "nsigmaTPC axis"}; + ConfigurableAxis cfgAxisNsigmaTOF{"cfgPIDHistograms_cfgAxisNsigmaTOF", {80, -5.f, 5.f}, "nsigmaTOF axis"}; + ConfigurableAxis cfgAxisNsigmaITS{"cfgPIDHistograms_cfgAxisNsigmaITS", {80, -5.f, 5.f}, "nsigmaITS axis"}; + ConfigurableAxis cfgAxisTpcSignal{"cfgPIDHistograms_cfgAxisTpcSignal", {250, 0.f, 250.f}, "dEdx axis for TPC"}; + } cfgPIDHistograms; + + // GFW binning Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 5.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull", "refMid", "piP", "kaP", "prP"}, {-0.8, 0.5, -0.8, -0.4, 0.5, 0.5, 0.5}, {-0.5, 0.8, 0.8, 0.4, 0.8, 0.8, 0.8}, {0, 0, 0, 0, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}}, "Configurations for GFW regions"}; Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "piP {2} refN {-2}", "kaP {2} refN {-2}", "prP {2} refN {-2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}"}, {"ChGap22", "PiGap22", "KaGap22", "PrGap22", "ChFull22", "nchCh", "nchPi", "nchKa", "nchPr", "v02ptCh", "v02ptPi", "v02ptKa", "v02ptPr"}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, "Configurations for each correlation to calculate"}; Configurable> nSigmas{"nSigmas", {LongArrayFloat[0], 6, 3, {"UpCut_pi", "UpCut_ka", "UpCut_pr", "LowCut_pi", "LowCut_ka", "LowCut_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"}; - struct : ConfigurableGroup { - Configurable cfgPtMin{"cfgPtMin", 0.2f, "Minimum pT used for track selection."}; - Configurable cfgPtMax{"cfgPtMax", 5.0f, "Maximum pT used for track selection."}; - Configurable cfgEtaMax{"cfgEtaMax", 0.8f, "Maximum eta used for track selection."}; - } cfgTrackCuts; - struct : ConfigurableGroup { Configurable cfgZvtxMax{"cfgZvtxMax", 10.0f, "Maximum primary vertex cut applied for the events."}; Configurable cfgMultMin{"cfgMultMin", 10, "Minimum number of particles required for the event to have."}; @@ -129,8 +180,7 @@ struct FlowGfwV02 { // // The analysis assumes the data has been subjected to a QA of its selection, // // and thus only the final distributions of the data for analysis are saved. o2::framework::expressions::Filter collFilter = (nabs(aod::collision::posZ) < cfgEventCuts.cfgZvtxMax); - o2::framework::expressions::Filter trackFilter = (aod::track::pt > cfgTrackCuts.cfgPtMin) && (aod::track::pt < cfgTrackCuts.cfgPtMax) && (nabs(aod::track::eta) < cfgTrackCuts.cfgEtaMax); - o2::framework::expressions::Filter cftrackFilter = (aod::cftrack::pt > cfgTrackCuts.cfgPtMin) && (aod::cftrack::pt < cfgTrackCuts.cfgPtMax); // eta cuts done by jfluc + o2::framework::expressions::Filter trackFilter = (aod::track::pt > cfgTrackCuts.cfgPtMin) && (aod::track::pt < cfgTrackCuts.cfgPtMax) && nabs(aod::track::eta) < cfgTrackCuts.cfgEtaMax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::itsChi2NCl < cfgTrackCuts.cfgChi2PrITSCls) && (aod::track::tpcChi2NCl < cfgTrackCuts.cfgChi2PrTPCCls) && nabs(aod::track::dcaZ) < cfgTrackCuts.cfgDCAz; // Connect to ccdb Service ccdb; @@ -145,6 +195,35 @@ struct FlowGfwV02 { OutputObj fFC{FlowContainer("FlowContainer")}; HistogramRegistry registry{"registry"}; + enum CentEstimators { + kCentFT0C = 0, + kCentFT0CVariant1, + kCentFT0M, + kCentFV0A, + kCentNTPV, + kCentNGlobal, + kCentMFT + }; + std::map centNamesMap = {{kCentFT0C, "FT0C"}, {kCentFT0CVariant1, "FT0C variant1"}, {kCentFT0M, "FT0M"}, {kCentFV0A, "FV0A"}, {kCentNTPV, "NTPV"}, {kCentNGlobal, "NGlobal"}, {kCentMFT, "MFT"}}; + + enum EventSelFlags { + kFilteredEvent = 1, + kSel8, + kOccupancy, + kTVXinTRD, + kNoSameBunchPileup, + kIsGoodZvtxFT0vsPV, + kNoCollInTimeRangeStandard, + kNoCollInRofStandard, + kNoHighMultCollInPrevRof, + kNoTimeFrameBorder, + kNoITSROFrameBorder, + kIsVertexITSTPC, + kIsGoodITSLayersAll, + kMultCuts, + kTrackCent + }; + std::unique_ptr fGFW{std::make_unique()}; std::unique_ptr fRndm{std::make_unique(0)}; std::unique_ptr fSecondAxis{nullptr}; @@ -164,14 +243,22 @@ struct FlowGfwV02 { std::array itsNsigmaCut; std::array tpcNsigmaCut; TH1D* hPtMid[4] = {nullptr, nullptr, nullptr, nullptr}; - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.5, 1, 1.5, 2, 3, 4, 6, 10}, "pt axis for histograms"}; - ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; - ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; - ConfigurableAxis axisNsigmaITS{"axisNsigmaITS", {80, -5, 5}, "nsigmaITS axis"}; - ConfigurableAxis axisTpcSignal{"axisTpcSignal", {250, 0, 250}, "dEdx axis for TPC"}; }; PIDState pidStates; + // Event selection cuts - Alex + TF1* fMultPVCutLow = nullptr; + TF1* fMultPVCutHigh = nullptr; + TF1* fMultCutLow = nullptr; + TF1* fMultCutHigh = nullptr; + TF1* fMultPVGlobalCutHigh = nullptr; + TF1* fMultGlobalV0ACutLow = nullptr; + TF1* fMultGlobalV0ACutHigh = nullptr; + TF1* fMultGlobalT0ACutLow = nullptr; + TF1* fMultGlobalT0ACutHigh = nullptr; + + TF1* fPtDepDCAxy = nullptr; + using GFWTracks = soa::Filtered>; enum PIDIndex { @@ -220,16 +307,16 @@ struct FlowGfwV02 { if (cfgGetNsigmaQA) { if (!cfgUseItsPID) { - registry.add("TofTpcNsigma_before", "", {HistType::kTHnSparseD, {{pidStates.axisNsigmaTPC, pidStates.axisNsigmaTOF, pidStates.axisPt}}}); - registry.add("TofTpcNsigma_after", "", {HistType::kTHnSparseD, {{pidStates.axisNsigmaTPC, pidStates.axisNsigmaTOF, pidStates.axisPt}}}); + registry.add("TofTpcNsigma_before", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); + registry.add("TofTpcNsigma_after", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); } if (cfgUseItsPID) { - registry.add("TofItsNsigma_before", "", {HistType::kTHnSparseD, {{pidStates.axisNsigmaITS, pidStates.axisNsigmaTOF, pidStates.axisPt}}}); - registry.add("TofItsNsigma_after", "", {HistType::kTHnSparseD, {{pidStates.axisNsigmaITS, pidStates.axisNsigmaTOF, pidStates.axisPt}}}); + registry.add("TofItsNsigma_before", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaITS, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); + registry.add("TofItsNsigma_after", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaITS, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); } - registry.add("TpcdEdx_ptwise", "", {HistType::kTH2D, {{pidStates.axisTpcSignal, pidStates.axisPt}}}); - registry.add("TpcdEdx_ptwise_afterCut", "", {HistType::kTH2D, {{pidStates.axisTpcSignal, pidStates.axisPt}}}); + registry.add("TpcdEdx_ptwise", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("TpcdEdx_ptwise_afterCut", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); } o2::analysis::gfw::regions.SetNames(cfgRegions->GetNames()); @@ -260,6 +347,9 @@ struct FlowGfwV02 { o2::analysis::gfw::nchup = cfgGFWBinning->GetNchMax(); o2::analysis::gfw::centbinning = cfgGFWBinning->GetCentBinning(); cfgGFWBinning->Print(); + o2::analysis::gfw::multGlobalCorrCutPars = cfgMultCorrCuts.cfgMultGlobalCutPars; + o2::analysis::gfw::multPVCorrCutPars = cfgMultCorrCuts.cfgMultPVCutPars; + o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars; // Initialise pt spectra histograms for different particles pidStates.hPtMid[PidCharged] = new TH1D("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); @@ -285,6 +375,13 @@ struct FlowGfwV02 { nchbinning.push_back(nchskip * i + o2::analysis::gfw::nchlow + 0.5); } AxisSpec nchAxis = {nchbinning, "N_{ch}"}; + AxisSpec t0cAxis = {1000, 0, 10000, "N_{ch} (T0C)"}; + AxisSpec t0aAxis = {300, 0, 30000, "N_{ch} (T0A)"}; + AxisSpec v0aAxis = {800, 0, 80000, "N_{ch} (V0A)"}; + AxisSpec multpvAxis = {600, 0, 600, "N_{ch} (PV)"}; + AxisSpec dcaZAxis = {200, -2, 2, "DCA_{z} (cm)"}; + AxisSpec dcaXYAxis = {200, -0.5, 0.5, "DCA_{xy} (cm)"}; + registry.add("v02pt", "", {HistType::kTProfile2D, {ptAxis, centAxis}}); registry.add("nchMid", "", {HistType::kTProfile2D, {ptAxis, centAxis}}); @@ -300,15 +397,54 @@ struct FlowGfwV02 { // QA histograms registry.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAxis, dcaZAxis}}); registry.add("trackQA/before/nch_pt", "#it{p}_{T} vs multiplicity; N_{ch}; #it{p}_{T}", {HistType::kTH2D, {nchAxis, ptAxis}}); - registry.addClone("trackQA/before/", "trackQA/after/"); registry.add("trackQA/after/pt_ref", "", {HistType::kTH1D, {{100, o2::analysis::gfw::ptreflow, o2::analysis::gfw::ptrefup}}}); registry.add("trackQA/after/pt_poi", "", {HistType::kTH1D, {{100, o2::analysis::gfw::ptpoilow, o2::analysis::gfw::ptpoiup}}}); + registry.add("trackQA/before/chi2prTPCcls", "#chi^{2}/cluster for the TPC track segment; #chi^{2}/TPC cluster", {HistType::kTH1D, {{100, 0., 5.}}}); + registry.add("trackQA/before/chi2prITScls", "#chi^{2}/cluster for the ITS track; #chi^{2}/ITS cluster", {HistType::kTH1D, {{100, 0., 50.}}}); + registry.add("trackQA/before/nTPCClusters", "Number of found TPC clusters; TPC N_{cls}; Counts", {HistType::kTH1D, {{100, 40, 180}}}); + registry.add("trackQA/before/nITSClusters", "Number of found ITS clusters; ITS N_{cls}; Counts", {HistType::kTH1D, {{100, 0, 20}}}); + registry.add("trackQA/before/nTPCCrossedRows", "Number of crossed TPC Rows; TPC X-rows; Counts", {HistType::kTH1D, {{100, 40, 180}}}); + registry.addClone("trackQA/before/", "trackQA/after/"); + + registry.add("eventQA/before/globalTracks_centT0C", "", {HistType::kTH2D, {centAxis, nchAxis}}); + registry.add("eventQA/before/PVTracks_centT0C", "", {HistType::kTH2D, {centAxis, multpvAxis}}); + registry.add("eventQA/before/multT0C_centT0C", "", {HistType::kTH2D, {centAxis, t0cAxis}}); + + registry.add("eventQA/before/centT0M_centT0C", "", {HistType::kTH2D, {centAxis, centAxis}}); + registry.add("eventQA/before/centV0A_centT0C", "", {HistType::kTH2D, {centAxis, centAxis}}); + registry.add("eventQA/before/centGlobal_centT0C", "", {HistType::kTH2D, {centAxis, centAxis}}); + registry.add("eventQA/before/centNTPV_centT0C", "", {HistType::kTH2D, {centAxis, centAxis}}); + registry.add("eventQA/before/centMFT_centT0C", "", {HistType::kTH2D, {centAxis, centAxis}}); + + registry.add("eventQA/before/globalTracks_PVTracks", "", {HistType::kTH2D, {multpvAxis, nchAxis}}); + registry.add("eventQA/before/globalTracks_multT0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); + registry.add("eventQA/before/globalTracks_multV0A", "", {HistType::kTH2D, {v0aAxis, nchAxis}}); + registry.add("eventQA/before/multV0A_multT0A", "", {HistType::kTH2D, {t0aAxis, v0aAxis}}); registry.add("eventQA/before/multiplicity", "", {HistType::kTH1D, {nchAxis}}); registry.add("eventQA/before/centrality", "", {HistType::kTH1D, {centAxis}}); registry.addClone("eventQA/before/", "eventQA/after/"); + // Event selection histograms + registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{15, 0.5, 15.5}}}); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kFilteredEvent, "Filtered event"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kSel8, "sel8"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kOccupancy, "occupancy"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTVXinTRD, "kTVXinTRD"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoSameBunchPileup, "kNoSameBunchPileup"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodZvtxFT0vsPV, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInTimeRangeStandard, "kNoCollInTimeRangeStandard"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInRofStandard, "kNoCollInRofStandard"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoHighMultCollInPrevRof, "kNoHighMultCollInPrevRof"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoTimeFrameBorder, "kNoTimeFrameBorder"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoITSROFrameBorder, "kNoITSROFrameBorder"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsVertexITSTPC, "kIsVertexITSTPC"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodITSLayersAll, "kIsGoodITSLayersAll"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kMultCuts, "after Mult cuts"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTrackCent, "has track + within cent"); + if (o2::analysis::gfw::regions.GetSize() < 0) LOGF(error, "Configuration contains vectors of different size - check the GFWRegions configurable"); for (auto i(0); i < o2::analysis::gfw::regions.GetSize(); ++i) { @@ -354,6 +490,22 @@ struct FlowGfwV02 { return (it != end) ? std::distance(begin, it) : -1; }(); } + + if (cfgUseAdditionalEventCut) { + fMultPVCutLow = new TF1("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultPVCutLow->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); + fMultPVCutHigh = new TF1("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultPVCutHigh->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); + fMultCutLow = new TF1("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultCutLow->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); + fMultCutHigh = new TF1("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); + fMultPVGlobalCutHigh = new TF1("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); + fMultPVGlobalCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalPVCorrCutPars[0])); + } + // Set DCAxy cut + fPtDepDCAxy = new TF1("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); + fPtDepDCAxy->SetParameter(0, cfgTrackCuts.cfgDCAxyNSigma); } static constexpr std::string_view FillTimeName[] = {"before/", "after/"}; @@ -433,7 +585,7 @@ struct FlowGfwV02 { if (cfg.correctionsLoaded) return; if (!cfgAcceptance.value.empty()) { - cfg.mAcceptance = ccdb->getForRun(cfgAcceptance.value, timestamp); + cfg.mAcceptance = ccdb->getForTimeStamp(cfgAcceptance.value, timestamp); } if (!cfgEfficiency.value.empty()) { cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); @@ -459,7 +611,7 @@ struct FlowGfwV02 { } template - double getAcceptance(TTrack track, const double& /*vtxz*/, const int& /*pidInd*/ = 0) + double getJTrackAcceptance(TTrack track) { double wacc = 1; if constexpr (requires { track.weightNUA(); }) @@ -468,7 +620,7 @@ struct FlowGfwV02 { } template - double getEfficiency(TTrack track, const int& /*pidInd*/ = 0) + double getJTrackEfficiency(TTrack track) { double eff = 1.; if constexpr (requires { track.weightEff(); }) @@ -476,6 +628,186 @@ struct FlowGfwV02 { return eff; } + template + double getAcceptance(TTrack track, const double& vtxz) + { + double wacc = 1; + if (cfg.mAcceptance) + wacc = cfg.mAcceptance->getNUA(track.phi(), track.eta(), vtxz); + return wacc; + } + + template + double getEfficiency(TTrack track) + { + double eff = 1.; + if (cfg.mEfficiency) + eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(track.pt())); + if (eff == 0) + return -1.; + else + return 1. / eff; + } + + template + void fillNsigmaAfterCut(TTrack track1, Int_t pid) // function to fill the QA after Nsigma selection + { + switch (pid) { + case 1: // For Pions + if (!cfgUseItsPID) { + if (cfgGetdEdx) { + double tpcExpSignalPi = track1.tpcSignal() - (track1.tpcNSigmaPi() * track1.tpcExpSigmaPi()); + + registry.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaPi()); + registry.fill(HIST("ExpTpcdEdx_ptwise_afterCut"), track1.pt(), tpcExpSignalPi, track1.tofNSigmaPi()); + registry.fill(HIST("ExpSigma_ptwise_afterCut"), track1.pt(), track1.tpcExpSigmaPi(), track1.tofNSigmaPi()); + } + registry.fill(HIST("TofTpcNsigma_after"), track1.tpcNSigmaPi(), track1.tofNSigmaPi(), track1.pt()); + } + if (cfgUseItsPID) + registry.fill(HIST("TofItsNsigma_after"), pidStates.itsResponse.nSigmaITS(track1), track1.tofNSigmaPi(), track1.pt()); + break; + case 2: // For Kaons + if (!cfgUseItsPID) { + if (cfgGetdEdx) { + double tpcExpSignalKa = track1.tpcSignal() - (track1.tpcNSigmaKa() * track1.tpcExpSigmaKa()); + + registry.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaKa()); + registry.fill(HIST("ExpTpcdEdx_ptwise_afterCut"), track1.pt(), tpcExpSignalKa, track1.tofNSigmaKa()); + registry.fill(HIST("ExpSigma_ptwise_afterCut"), track1.pt(), track1.tpcExpSigmaKa(), track1.tofNSigmaKa()); + } + registry.fill(HIST("TofTpcNsigma_after"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt()); + } + if (cfgUseItsPID) + registry.fill(HIST("TofItsNsigma_after"), pidStates.itsResponse.nSigmaITS(track1), track1.tofNSigmaKa(), track1.pt()); + break; + case 3: // For Protons + if (!cfgUseItsPID) { + if (cfgGetdEdx) { + double tpcExpSignalPr = track1.tpcSignal() - (track1.tpcNSigmaPr() * track1.tpcExpSigmaPr()); + + registry.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaPr()); + registry.fill(HIST("ExpTpcdEdx_ptwise_afterCut"), track1.pt(), tpcExpSignalPr, track1.tofNSigmaPr()); + registry.fill(HIST("ExpSigma_ptwise_afterCut"), track1.pt(), track1.tpcExpSigmaPr(), track1.tofNSigmaPr()); + } + registry.fill(HIST("TofTpcNsigma_after"), track1.tpcNSigmaPr(), track1.tofNSigmaPr(), track1.pt()); + } + if (cfgUseItsPID) + registry.fill(HIST("TofItsNsigma_after"), pidStates.itsResponse.nSigmaITS(track1), track1.tofNSigmaPr(), track1.pt()); + break; + } // end of switch + } + + template + bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) + { + if (cfgEventCutFlags.cfgTVXinTRD) { + if (collision.alias_bit(kTVXinTRD)) { + // TRD triggered + // "CMTVX-B-NOPF-TRD,minbias_TVX" + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kTVXinTRD); + } + if (cfgEventCutFlags.cfgNoSameBunchPileupCut) { + if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + // rejects collisions which are associated with the same "found-by-T0" bunch crossing + // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kNoSameBunchPileup); + } + if (cfgEventCutFlags.cfgIsGoodZvtxFT0vsPV) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference + // use this cut at low multiplicities with caution + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kIsGoodZvtxFT0vsPV); + } + if (cfgEventCutFlags.cfgNoCollInTimeRangeStandard) { + if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + // Rejection of the collisions which have other events nearby + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kNoCollInTimeRangeStandard); + } + + if (cfgEventCutFlags.cfgNoCollInRofStandard) { + if (!collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + // Rejection of the collisions which have other events nearby + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kNoCollInRofStandard); + } + + if (cfgEventCutFlags.cfgNoHighMultCollInPrevRof) { + if (!collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + // Rejection of the collisions which have other events nearby + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kNoHighMultCollInPrevRof); + } + + if (cfgEventCutFlags.cfgIsVertexITSTPC) { + if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kIsVertexITSTPC); + } + + if (cfgEventCutFlags.cfgIsGoodITSLayersAll) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kIsGoodITSLayersAll); + } + + if (cfgEventCutFlags.cfgNoTimeFrameBorder) { + if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kNoTimeFrameBorder); + } + + if (cfgEventCutFlags.cfgNoITSROFrameBorder) { + if (!collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + return 0; + } + registry.fill(HIST("eventQA/eventSel"), kNoITSROFrameBorder); + } + + float vtxz = -999; + if (collision.numContrib() > 1) { + vtxz = collision.posZ(); + float zRes = std::sqrt(collision.covZZ()); + float minZRes = 0.25; + int minNContrib = 20; + if (zRes > minZRes && collision.numContrib() < minNContrib) + vtxz = -999; + } + auto multNTracksPV = collision.multNTracksPV(); + + if (vtxz > o2::analysis::gfw::vtxZup || vtxz < o2::analysis::gfw::vtxZlow) + return 0; + + if (cfgMultCut) { + 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 > fMultPVGlobalCutHigh->Eval(collision.multNTracksPV())) + return 0; + registry.fill(HIST("eventQA/eventSel"), kMultCuts); + } + return 1; + } + // Define the data type enum DataType { kReco, @@ -546,7 +878,6 @@ struct FlowGfwV02 { } } // Fill the profiles for each pT bin - // printf("Config name: %s\n", corrconfigs.at(0).Head.c_str()); auto dnx = fGFW->Calculate(corrconfigs.at(0), 0, kTRUE).real(); if (dnx == 0) return; @@ -557,7 +888,6 @@ struct FlowGfwV02 { ptFraction = pidStates.hPtMid[PidCharged]->GetBinContent(i) / pidStates.hPtMid[PidCharged]->Integral(); if (std::abs(val) < 1) registry.fill(HIST("v02pt"), fSecondAxis->GetBinCenter(i), centmult, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0); - // printf("bincenter hPtMid: %f, fsecondaxis: %f\n", hPtMid->GetBinCenter(i), fSecondAxis->GetBinCenter(i)); registry.fill(HIST("nchMid"), fSecondAxis->GetBinCenter(i), centmult, ptFraction); } } @@ -599,11 +929,12 @@ struct FlowGfwV02 { AcceptedTracks acceptedTracks{0, 0, 0, 0}; for (const auto& track : tracks) { processTrack(track, vtxz, xaxis.multiplicity, run, acceptedTracks); - pidStates.hPtMid[PidCharged]->Fill(track.pt(), getEfficiency(track)); + if (track.eta() > -0.4 && track.eta() < 0.4) + pidStates.hPtMid[PidCharged]->Fill(track.pt(), getEfficiency(track)); // If PID is identified, fill pt spectrum for the corresponding particle int pidInd = getNsigmaPID(track); if (pidInd != -1 && track.eta() > -0.4 && track.eta() < 0.4) { - pidStates.hPtMid[pidInd]->Fill(track.pt(), getEfficiency(track, pidInd)); + pidStates.hPtMid[pidInd]->Fill(track.pt(), getEfficiency(track)); // TODO: Add PID index to the efficiency histogram } } if (cfgConsistentEventFlag & 1) @@ -635,17 +966,54 @@ struct FlowGfwV02 { ++acceptedTracks.nMid; } + template + bool trackSelected(TTrack track) + { + if (cfgTrackCuts.cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > fPtDepDCAxy->Eval(track.pt()))) + return false; + return ((track.tpcNClsCrossedRows() >= cfgTrackCuts.cfgNTPCXrows) && (track.tpcNClsFound() >= cfgTrackCuts.cfgNTPCCls) && (track.itsNCls() >= cfgTrackCuts.cfgMinNITSCls)); + } + + template + float getCentrality(TCollision collision) + { + switch (cfgCentEstimator) { + case kCentFT0C: + return cfgCentralityFactor * collision.centFT0C(); + case kCentFT0CVariant1: + return cfgCentralityFactor * collision.centFT0CVariant1(); + case kCentFT0M: + return cfgCentralityFactor * collision.centFT0M(); + case kCentFV0A: + return cfgCentralityFactor * collision.centFV0A(); + case kCentNTPV: + return cfgCentralityFactor * collision.centNTPV(); + case kCentNGlobal: + return cfgCentralityFactor * collision.centNGlobal(); + case kCentMFT: + return cfgCentralityFactor * collision.centMFT(); + default: + return cfgCentralityFactor * collision.centFT0C(); + } + } + template inline void processTrack(TTrack const& track, const float& vtxz, const int& multiplicity, const int& /*run*/, AcceptedTracks& acceptedTracks) { - // fillPtSums(track); // Fill pT sums - fillTrackQA(track, vtxz); - registry.fill(HIST("trackQA/before/nch_pt"), multiplicity, track.pt()); + + if (cfgFillQA) { + fillTrackQA(track, vtxz); + registry.fill(HIST("trackQA/before/nch_pt"), multiplicity, track.pt()); + } + if (!trackSelected(track)) + return; fillGFW(track, vtxz); // Fill GFW fillAcceptedTracks(track, acceptedTracks); // Fill accepted tracks - fillTrackQA(track, vtxz); - registry.fill(HIST("trackQA/after/nch_pt"), multiplicity, track.pt()); + if (cfgFillQA) { + fillTrackQA(track, vtxz); + registry.fill(HIST("trackQA/after/nch_pt"), multiplicity, track.pt()); + } } template @@ -658,11 +1026,11 @@ struct FlowGfwV02 { if (!withinPtPOI && !withinPtRef) return; - double weff = getEfficiency(track, pidInd); + double weff = getJTrackEfficiency(track); if (weff < 0) return; - double wacc = getAcceptance(track, vtxz, pidInd); + double wacc = getAcceptance(track, vtxz); // Fill cumulants for different particles // ***Need to add proper weights for each particle!*** @@ -682,12 +1050,40 @@ struct FlowGfwV02 { { double wacc = getAcceptance(track, vtxz); registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("phi_eta_vtxZ"), track.phi(), track.eta(), vtxz, (ft == kAfter) ? wacc : 1.0); + + registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_dcaXY_dcaZ"), track.pt(), track.dcaXY(), track.dcaZ()); + + registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("chi2prTPCcls"), track.tpcChi2NCl()); + registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("chi2prITScls"), track.itsChi2NCl()); + registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nTPCClusters"), track.tpcNClsFound()); + registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nITSClusters"), track.itsNCls()); + registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nTPCCrossedRows"), track.tpcNClsCrossedRows()); + if (ft == kAfter) { registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_ref"), track.pt()); registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_poi"), track.pt()); } return; } + template + inline void fillEventQA(TCollision collision, XAxis xaxis) + { + if constexpr (framework::has_type_v) { + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), xaxis.multiplicity); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("centT0M_centT0C"), collision.centFT0C(), collision.centFT0M()); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("centV0A_centT0C"), collision.centFT0C(), collision.centFV0A()); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("centGlobal_centT0C"), collision.centFT0C(), collision.centNGlobal()); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("centNTPV_centT0C"), collision.centFT0C(), collision.centNTPV()); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("centMFT_centT0C"), collision.centFT0C(), collision.centMFT()); + } + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_PVTracks"), collision.multNTracksPV(), xaxis.multiplicity); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multT0A"), collision.multFT0A(), xaxis.multiplicity); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multV0A"), collision.multFV0A(), xaxis.multiplicity); + registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); + return; + } double getTimeSinceStartOfFill(uint64_t, int) { return 0.0; } @@ -699,9 +1095,27 @@ struct FlowGfwV02 { lastRun = run; LOGF(info, "run = %d", run); } - loadCorrections(bc); - const XAxis xaxis{collision.centFT0C(), tracks.size(), -1.0}; + + registry.fill(HIST("eventQA/eventSel"), kFilteredEvent); + if (!collision.sel8()) + return; + registry.fill(HIST("eventQA/eventSel"), kSel8); + registry.fill(HIST("eventQA/eventSel"), kOccupancy); // Add occupancy selection later + + const XAxis xaxis{getCentrality(collision), tracks.size(), -1.0}; + if (cfgFillQA) { + fillEventQA(collision, xaxis); + registry.fill(HIST("eventQA/before/centrality"), xaxis.centrality); + registry.fill(HIST("eventQA/before/multiplicity"), xaxis.multiplicity); + } + if (cfgUseAdditionalEventCut && !eventSelected(collision, xaxis.multiplicity, xaxis.centrality)) + return; + if (cfgFillQA) + fillEventQA(collision, xaxis); + + registry.fill(HIST("eventQA/after/centrality"), xaxis.centrality); + registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); processCollision(collision, tracks, xaxis, run); } PROCESS_SWITCH(FlowGfwV02, processData, "Process analysis for non-derived data", true); From 2b5a02d8bce3c9302640968e74b4daed5f03268c Mon Sep 17 00:00:00 2001 From: Francesco Mazzaschi <43742195+fmazzasc@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:24:03 +0100 Subject: [PATCH 042/282] [PWGLF] Fix h4l w/ custom vertexer in the MC (#15499) Co-authored-by: Francesco Mazzaschi --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 2d922f613a5..25aa3e94e7e 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -272,6 +272,7 @@ struct hyperRecoTask { int mat{static_cast(cfgMaterialCorrection)}; fitter.setMatCorrType(static_cast(mat)); + svCreator.setPDGs(heDauPdg, piDauPdg); svCreator.setTimeMargin(customVertexerTimeMargin); if (skipAmbiTracks) { svCreator.setSkipAmbiTracks(); From 99d55efe081d82862160e969b27d317ee8ba1867 Mon Sep 17 00:00:00 2001 From: Francesco Mazzaschi <43742195+fmazzasc@users.noreply.github.com> Date: Mon, 23 Mar 2026 22:07:38 +0100 Subject: [PATCH 043/282] [PWGLF] sigmahadtask: add min pt cuts + improve efficiency (#15496) Co-authored-by: Francesco Mazzaschi --- .../Strangeness/sigmaHadCorr.cxx | 110 +++++++----------- 1 file changed, 44 insertions(+), 66 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigmaHadCorr.cxx b/PWGLF/TableProducer/Strangeness/sigmaHadCorr.cxx index d31c384addf..bb3f29449b8 100644 --- a/PWGLF/TableProducer/Strangeness/sigmaHadCorr.cxx +++ b/PWGLF/TableProducer/Strangeness/sigmaHadCorr.cxx @@ -87,25 +87,28 @@ struct sigmaHadCorrTask { // Configurable for event selection Configurable cutzvertex{"cutZVertex", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable doSigmaPion{"doSigmaPion", false, "If true, pair Sigma with pions instead of protons"}; + Configurable doSigmaMinus{"doSigmaMinus", true, "If true, pair Sigma- candidates, else Sigma+"}; + Configurable cutMaxKStar{"cutMaxKStar", 1.5, "Maximum k* for Sigma-hadron pairs (GeV/c)"}; + Configurable minPtSigma{"minPtSigma", 1.f, "Minimum pT for Sigma candidates (GeV/c)"}; - Configurable cutEtaDaught{"cutEtaDaughter", 0.8f, "Eta cut for daughter tracks"}; + Configurable useRecalculatedSigmaMomentum{"useRecalculatedSigmaMomentum", true, "If true, compute k* using Sigma momentum recalculated from daughter kinematics"}; Configurable cutDCAtoPVSigma{"cutDCAtoPVSigma", 0.1f, "Max DCA to primary vertex for Sigma candidates (cm)"}; - Configurable doSigmaMinus{"doSigmaMinus", true, "If true, pair Sigma- candidates, else Sigma+"}; Configurable cutSigmaRadius{"cutSigmaRadius", 20.f, "Minimum radius for Sigma candidates (cm)"}; Configurable cutSigmaMass{"cutSigmaMass", 0.3, "Sigma mass window (GeV/c^2)"}; Configurable alphaAPCut{"alphaAPCut", 0., "Alpha AP cut for Sigma candidates"}; Configurable qtAPCutLow{"qtAPCutLow", 0.15, "Lower qT AP cut for Sigma candidates (GeV/c)"}; Configurable qtAPCutHigh{"qtAPCutHigh", 0.2, "Upper qT AP cut for Sigma candidates (GeV/c)"}; + Configurable cutEtaDaught{"cutEtaDaughter", 0.8f, "Eta cut for daughter tracks"}; + Configurable ptMinTOFKinkDau{"ptMinTOFKinkDau", 0.75f, "Minimum pT to require TOF for kink daughter PID (GeV/c)"}; + Configurable applyTOFPIDKinkDaughter{"applyTOFPIDKinkDaughter", false, "If true, apply TOF PID cut to the kink daughter track"}; - Configurable cutNITSClusPr{"cutNITSClusPr", 5, "Minimum number of ITS clusters for hadron track"}; - Configurable cutNTPCClusPr{"cutNTPCClusPr", 90, "Minimum number of TPC clusters for hadron track"}; + Configurable cutNITSClusHad{"cutNITSClusHad", 5, "Minimum number of ITS clusters for hadron track"}; + Configurable cutNTPCClusHad{"cutNTPCClusHad", 90, "Minimum number of TPC clusters for hadron track"}; + Configurable ptMinHad{"ptMinHad", 0.2f, "Minimum pT for hadron track (GeV/c)"}; + Configurable ptMinTOFHad{"ptMinTOFHad", 0.75f, "Minimum pT to require TOF for hadron PID (GeV/c)"}; Configurable cutNSigmaTPC{"cutNSigmaTPC", 3, "TPC nSigma cut for hadron track"}; Configurable cutNSigmaTOF{"cutNSigmaTOF", 3, "TOF nSigma cut for hadron track"}; - Configurable applyTOFPIDKinkDaughter{"applyTOFPIDKinkDaughter", false, "If true, apply TOF PID cut to the kink daughter track"}; - Configurable doSigmaPion{"doSigmaPion", false, "If true, pair Sigma with pions instead of protons"}; - - Configurable cutMaxKStar{"cutMaxKStar", 1.5, "Maximum k* for Sigma-hadron pairs (GeV/c)"}; - Configurable useRecalculatedSigmaMomentum{"useRecalculatedSigmaMomentum", true, "If true, compute k* using Sigma momentum recalculated from daughter kinematics"}; Configurable fillOutputTree{"fillOutputTree", true, "If true, fill the output tree with Sigma-hadron candidates"}; Configurable fillSparseInvMassKstar{"fillSparseInvMassKstar", false, "If true, fill THn with invmass, k*, sigma charge, proton charge, sigma decay radius, cosPA, sigma pt"}; @@ -126,9 +129,9 @@ struct sigmaHadCorrTask { const AxisSpec nSigmaHadAxis{100, -5, 5, "n#sigma_{had}"}; const AxisSpec sigmaMassAxis{50, 1.1, 1.3, "m (GeV/#it{c}^{2})"}; const AxisSpec kStarAxis{200, 0.0, 2., "k* (GeV/#it{c})"}; - const AxisSpec ptHadAxis{100, 0.0, 10.0, "#it{p}_{T,had} (GeV/#it{c})"}; - const AxisSpec sigmaPtAxis{100, 0.0, 10.0, "#it{p}_{T,#Sigma} (GeV/#it{c})"}; - const AxisSpec sigmaPtAxisCoarse{20, 0.0, 10.0, "#it{p}_{T,#Sigma} (GeV/#it{c})"}; + const AxisSpec ptHadAxis{100, 0.0, 6.0, "#it{p}_{T,had} (GeV/#it{c})"}; + const AxisSpec sigmaPtAxis{100, 0.0, 6.0, "#it{p}_{T,#Sigma} (GeV/#it{c})"}; + const AxisSpec sigmaPtAxisCoarse{30, 0.0, 6.0, "#it{p}_{T,#Sigma} (GeV/#it{c})"}; const AxisSpec sigmaChargeAxis{2, -1.5, 1.5, "#Sigma charge"}; const AxisSpec hadronChargeAxis{2, -1.5, 1.5, "Hadron charge"}; const AxisSpec sigmaDecRadiusAxis{25, 14.5, 40.5, "#Sigma decay radius (cm)"}; @@ -191,25 +194,27 @@ struct sigmaHadCorrTask { return dotProduct / (momMotherMag * decayVecMag); } - float getRecalculatedSigmaMomentum(const sigmaHadCand& candidate) + float getRecalculatedSigmaMomentum(float sigmaPx, float sigmaPy, float sigmaPz, float sigmaDauPx, float sigmaDauPy, float sigmaDauPz) { - constexpr float massPion = o2::constants::physics::MassPionCharged; - constexpr float massNeutron = o2::constants::physics::MassNeutron; + // Sigma- -> n + pi- (charged daughter = pion, neutral daughter = neutron) + // Sigma+ -> p + pi0 (charged daughter = proton, neutral daughter = pi0) + float massChargedDau = doSigmaMinus ? o2::constants::physics::MassPionCharged : o2::constants::physics::MassProton; + float massNeutralDau = doSigmaMinus ? o2::constants::physics::MassNeutron : o2::constants::physics::MassPionNeutral; float massSigma = doSigmaMinus ? o2::constants::physics::MassSigmaMinus : o2::constants::physics::MassSigmaPlus; - float pMother = std::sqrt(candidate.sigmaPx * candidate.sigmaPx + candidate.sigmaPy * candidate.sigmaPy + candidate.sigmaPz * candidate.sigmaPz); + float pMother = std::sqrt(sigmaPx * sigmaPx + sigmaPy * sigmaPy + sigmaPz * sigmaPz); if (pMother < 1e-6f) { return -999.f; } - float versorX = candidate.sigmaPx / pMother; - float versorY = candidate.sigmaPy / pMother; - float versorZ = candidate.sigmaPz / pMother; - float ePi = std::sqrt(massPion * massPion + candidate.sigmaDauPx * candidate.sigmaDauPx + candidate.sigmaDauPy * candidate.sigmaDauPy + candidate.sigmaDauPz * candidate.sigmaDauPz); - float a = versorX * candidate.sigmaDauPx + versorY * candidate.sigmaDauPy + versorZ * candidate.sigmaDauPz; - float K = massSigma * massSigma + massPion * massPion - massNeutron * massNeutron; - float A = 4.f * (ePi * ePi - a * a); + float versorX = sigmaPx / pMother; + float versorY = sigmaPy / pMother; + float versorZ = sigmaPz / pMother; + float eChDau = std::sqrt(massChargedDau * massChargedDau + sigmaDauPx * sigmaDauPx + sigmaDauPy * sigmaDauPy + sigmaDauPz * sigmaDauPz); + float a = versorX * sigmaDauPx + versorY * sigmaDauPy + versorZ * sigmaDauPz; + float K = massSigma * massSigma + massChargedDau * massChargedDau - massNeutralDau * massNeutralDau; + float A = 4.f * (eChDau * eChDau - a * a); float B = -4.f * a * K; - float C = 4.f * ePi * ePi * massSigma * massSigma - K * K; + float C = 4.f * eChDau * eChDau * massSigma * massSigma - K * K; if (std::abs(A) < 1e-6f) { return -999.f; } @@ -231,19 +236,19 @@ struct sigmaHadCorrTask { return (p1Diff < p2Diff) ? P1 : P2; } - std::array getSigmaMomentumForKstar(const sigmaHadCand& candidate) + std::array getSigmaMomentumForKstar(float sigmaPx, float sigmaPy, float sigmaPz, float sigmaDauPx, float sigmaDauPy, float sigmaDauPz) { - std::array sigmaMomentum = {candidate.sigmaPx, candidate.sigmaPy, candidate.sigmaPz}; + std::array sigmaMomentum = {sigmaPx, sigmaPy, sigmaPz}; if (!useRecalculatedSigmaMomentum) { return sigmaMomentum; } - float pNew = getRecalculatedSigmaMomentum(candidate); + float pNew = getRecalculatedSigmaMomentum(sigmaPx, sigmaPy, sigmaPz, sigmaDauPx, sigmaDauPy, sigmaDauPz); if (pNew <= 0.f) { return sigmaMomentum; } - float pOld = std::sqrt(candidate.sigmaPx * candidate.sigmaPx + candidate.sigmaPy * candidate.sigmaPy + candidate.sigmaPz * candidate.sigmaPz); + float pOld = std::sqrt(sigmaPx * sigmaPx + sigmaPy * sigmaPy + sigmaPz * sigmaPz); if (pOld <= 0.f) { return sigmaMomentum; } @@ -278,26 +283,6 @@ struct sigmaHadCorrTask { } TLorentzVector trackSum, PartOneCMS, PartTwoCMS, trackRelK; - float getKStar(const sigmaHadCand& candidate) - { - TLorentzVector part1; // Sigma - TLorentzVector part2; // Hadron track (proton/pion) - part1.SetXYZM(candidate.sigmaPx, candidate.sigmaPy, candidate.sigmaPz, getSigmaMassForKstar()); - part2.SetXYZM(candidate.pxHad, candidate.pyHad, candidate.pzHad, getHadTrackMass()); - trackSum = part1 + part2; - const float beta = trackSum.Beta(); - const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta()); - const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta()); - const float betaz = beta * std::cos(trackSum.Theta()); - PartOneCMS.SetXYZM(part1.Px(), part1.Py(), part1.Pz(), part1.M()); - PartTwoCMS.SetXYZM(part2.Px(), part2.Py(), part2.Pz(), part2.M()); - const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz); - PartOneCMS = boostPRF(PartOneCMS); - PartTwoCMS = boostPRF(PartTwoCMS); - trackRelK = PartOneCMS - PartTwoCMS; - return 0.5 * trackRelK.P(); - } - float getKStar(float sigmaPx, float sigmaPy, float sigmaPz, float pxHad, float pyHad, float pzHad) { TLorentzVector part1; // Sigma @@ -321,17 +306,15 @@ struct sigmaHadCorrTask { template bool selectHadTrack(const Ttrack& candidate) { - if (std::abs(getTPCNSigmaHad(candidate)) > cutNSigmaTPC || candidate.tpcNClsFound() < cutNTPCClusPr || std::abs(candidate.eta()) > cutEtaDaught) { + if (candidate.pt() < ptMinHad) { return false; } - - if (candidate.itsNCls() < cutNITSClusPr) { + if (std::abs(getTPCNSigmaHad(candidate)) > cutNSigmaTPC || candidate.tpcNClsFound() < cutNTPCClusHad || std::abs(candidate.eta()) > cutEtaDaught) { return false; } - float ptMinTOF = 0.75f; // Minimum pT to use TOF for hadron-track PID - if (candidate.pt() < ptMinTOF) { - return true; // No TOF cut for low pT + if (candidate.itsNCls() < cutNITSClusHad) { + return false; } if (!candidate.hasTOF()) { @@ -377,8 +360,7 @@ struct sigmaHadCorrTask { } if (applyTOFPIDKinkDaughter) { - constexpr float ptMinTOF = 0.75f; - if (kinkDauTrack.pt() >= ptMinTOF) { + if (kinkDauTrack.pt() >= ptMinTOFKinkDau) { if (!kinkDauTrack.hasTOF()) { return false; } @@ -410,14 +392,8 @@ struct sigmaHadCorrTask { float qtAP = getQtAP(momMothAll, momDaugAll); rSigmaHad.fill(HIST("QA/h2QtAPvsAlphaAP"), alphaAP, qtAP); - sigmaHadCand sigmaForPt; - sigmaForPt.sigmaPx = sigmaCand.pxMoth(); - sigmaForPt.sigmaPy = sigmaCand.pyMoth(); - sigmaForPt.sigmaPz = sigmaCand.pzMoth(); - sigmaForPt.sigmaDauPx = sigmaCand.pxDaug(); - sigmaForPt.sigmaDauPy = sigmaCand.pyDaug(); - sigmaForPt.sigmaDauPz = sigmaCand.pzDaug(); - auto sigmaPRecal = getSigmaMomentumForKstar(sigmaForPt); + auto sigmaPRecal = getSigmaMomentumForKstar(sigmaCand.pxMoth(), sigmaCand.pyMoth(), sigmaCand.pzMoth(), + sigmaCand.pxDaug(), sigmaCand.pyDaug(), sigmaCand.pzDaug()); float sigmaPtRecal = std::hypot(sigmaPRecal[0], sigmaPRecal[1]); float sigmaMassForQa = doSigmaMinus ? sigmaCand.mSigmaMinus() : sigmaCand.mSigmaPlus(); @@ -608,7 +584,8 @@ struct sigmaHadCorrTask { float kStarGen = getKStar(mcPartSigma.px(), mcPartSigma.py(), mcPartSigma.pz(), mcPartHad.px(), mcPartHad.py(), mcPartHad.pz()); if (fillSparseInvMassKstar) { - auto sigmaMomForKstar = getSigmaMomentumForKstar(candidate); + auto sigmaMomForKstar = getSigmaMomentumForKstar(candidate.sigmaPx, candidate.sigmaPy, candidate.sigmaPz, + candidate.sigmaDauPx, candidate.sigmaDauPy, candidate.sigmaDauPz); float kStarRec = getKStar(sigmaMomForKstar[0], sigmaMomForKstar[1], sigmaMomForKstar[2], candidate.pxHad, candidate.pyHad, candidate.pzHad); float sigmaPtUsed = std::hypot(sigmaMomForKstar[0], sigmaMomForKstar[1]); rSigmaHad.fill(HIST("hSparseSigmaHadMC"), @@ -689,7 +666,8 @@ struct sigmaHadCorrTask { float kStarGen = getKStar(mcPartSigma.px(), mcPartSigma.py(), mcPartSigma.pz(), mcPartHad.px(), mcPartHad.py(), mcPartHad.pz()); if (fillSparseInvMassKstar) { - auto sigmaMomForKstar = getSigmaMomentumForKstar(candidate); + auto sigmaMomForKstar = getSigmaMomentumForKstar(candidate.sigmaPx, candidate.sigmaPy, candidate.sigmaPz, + candidate.sigmaDauPx, candidate.sigmaDauPy, candidate.sigmaDauPz); float kStarRec = getKStar(sigmaMomForKstar[0], sigmaMomForKstar[1], sigmaMomForKstar[2], candidate.pxHad, candidate.pyHad, candidate.pzHad); float sigmaPtUsed = std::hypot(sigmaMomForKstar[0], sigmaMomForKstar[1]); rSigmaHad.fill(HIST("hSparseSigmaHadMC"), From 2cb8a679144a4ba9c9685c5701e29e3e13c51f91 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 24 Mar 2026 17:12:24 +0900 Subject: [PATCH 044/282] [PWGEM/Dilepton] update 2PC (#15501) --- PWGEM/Dilepton/Core/DileptonHadronMPC.h | 278 +++++--- PWGEM/Dilepton/Core/EMTrackCut.cxx | 6 - PWGEM/Dilepton/Core/EMTrackCut.h | 15 +- .../TableProducer/skimmerPrimaryMFTTrack.cxx | 23 +- .../TableProducer/skimmerPrimaryMuon.cxx | 625 ++++++++---------- .../TableProducer/skimmerPrimaryTrack.cxx | 32 +- PWGEM/Dilepton/Utils/EMTrackUtilities.h | 61 +- 7 files changed, 543 insertions(+), 497 deletions(-) diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index 56b2c837cc8..e6d7eb0960e 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -35,7 +35,6 @@ #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" #include "DataFormatsParameters/GRPLHCIFData.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" @@ -56,6 +55,7 @@ #include #include #include +#include #include #include @@ -99,15 +99,14 @@ struct DileptonHadronMPC { Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; + Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"}; Configurable ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"}; - Configurable ndepth_hadron{"ndepth_hadron", 1, "depth for event mixing between hadron-hadron"}; + Configurable ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"}; Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; 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, 999.f}, "Mixing bins - centrality"}; ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - Configurable cfg_swt_name{"cfg_swt_name", "fHighTrackMult", "desired software trigger name"}; // 1 trigger name per 1 task. fHighTrackMult, fHighFt0Mult // Configurable cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"}; // Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; @@ -129,9 +128,9 @@ struct DileptonHadronMPC { std::string prefix = "eventcut_group"; Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + 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 cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time 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 cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. @@ -259,8 +258,8 @@ struct DileptonHadronMPC { Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 6, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 8, "min ncluster MCH"}; + Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; @@ -288,9 +287,8 @@ struct DileptonHadronMPC { Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for ref. track"}; // Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.0, "min phi for ref. track"}; // Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for ref. track"}; - // Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.5, "max dca XY for single track in cm"}; - // Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.5, "max dca Z for single track in cm"}; - Configurable cfg_track_bits{"cfg_track_bits", 5765, "required track bits"}; // default:645, loose:0, tight:778 + Configurable cfg_track_bits{"cfg_track_bits", 0, "required track bits"}; + Configurable cfg_reftrack_type{"cfg_reftrack_type", 0, "ref. track type for 2PC. 0:kCB, 1:kMFTsa"}; // this is unique in the derived data. Check which track type you store as aod::EMPrimaryTracks. } trackcuts; struct : ConfigurableGroup { @@ -417,11 +415,11 @@ struct DileptonHadronMPC { } if (doprocessTriggerAnalysis) { - LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value); + LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value); fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); + auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); } @@ -496,6 +494,7 @@ struct DileptonHadronMPC { static constexpr std::string_view qvec_det_names[7] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg", "FV0A"}; // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); + fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; std::string pair_pt_axis_title = "p_{T,ll} (GeV/c)"; @@ -557,7 +556,8 @@ struct DileptonHadronMPC { fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); - // fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); + fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); + fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); // hadron-hadron const AxisSpec axis_dphi_hh{90, -M_PI / 2, 3 * M_PI / 2, "#Delta#varphi = #varphi_{h}^{ref1} - #varphi_{h}^{ref2} (rad.)"}; @@ -701,13 +701,11 @@ struct DileptonHadronMPC { fEMTrackCut.SetTrackPtRange(trackcuts.cfg_min_pt_track, trackcuts.cfg_max_pt_track); fEMTrackCut.SetTrackEtaRange(trackcuts.cfg_min_eta_track, trackcuts.cfg_max_eta_track); // fEMTrackCut.SetTrackPhiRange(trackcuts.cfg_min_phi_track, trackcuts.cfg_max_phi_track); - // fEMTrackCut.SetTrackMaxDcaXY(trackcuts.cfg_max_dcaxy); - // fEMTrackCut.SetTrackMaxDcaZ(trackcuts.cfg_max_dcaz); fEMTrackCut.SetTrackBit(trackcuts.cfg_track_bits); } - template - bool fillDilepton(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks) + template + bool fillDilepton(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut) { if constexpr (ev_id == 0) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -725,12 +723,19 @@ struct DileptonHadronMPC { return false; } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + if (!map_best_match_globalmuon[t1.globalIndex()]) { return false; } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + if (!map_best_match_globalmuon[t2.globalIndex()]) { return false; } + + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + // return false; + // } + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + // return false; + // } } } @@ -826,8 +831,8 @@ struct DileptonHadronMPC { return true; } - template - bool fillDileptonHadron(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks, TRefTrack const& t3) + template + bool fillDileptonHadron(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TRefTrack const& t3) { // this function must be called, if dilepton passes the cut. @@ -850,12 +855,19 @@ struct DileptonHadronMPC { return false; } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + if (!map_best_match_globalmuon[t1.globalIndex()]) { return false; } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + if (!map_best_match_globalmuon[t2.globalIndex()]) { return false; } + + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + // return false; + // } + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + // return false; + // } } if (!fEMTrackCut.IsSelected(t3)) { // for charged track @@ -874,11 +886,10 @@ struct DileptonHadronMPC { } float weight = 1.f; - if (cfgApplyWeightTTCA) { - weight = map_weight[std::make_pair(t1.globalIndex(), t2.globalIndex())]; - } - if (ev_id == 1) { - weight = 1.f; + if constexpr (ev_id == 0) { + if (cfgApplyWeightTTCA) { + weight = map_weight[std::make_pair(t1.globalIndex(), t2.globalIndex())]; + } } ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), leptonM1); @@ -926,7 +937,7 @@ struct DileptonHadronMPC { } template - bool fillHadronHadron(TRefTrack const& t1, TRefTrack const& t2, TLeptons const& posLeptons, TLeptons const& negLeptons, TLeptonCut const& cut) + bool fillHadronHadron(TRefTrack const& t1, TRefTrack const& t2, TLeptons const&, TLeptons const&, TLeptonCut const&) { if constexpr (ev_id == 0) { if (!fEMTrackCut.IsSelected(t1) || !fEMTrackCut.IsSelected(t2)) { // for charged track @@ -935,36 +946,37 @@ struct DileptonHadronMPC { // Leptons should not be in reference track sample. if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - for (const auto& pos : posLeptons) { // leptons per collision - if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { - if (!cut.template IsSelectedTrack(pos)) { - continue; - } - } else { // cut based - if (!cut.template IsSelectedTrack(pos)) { - continue; - } - } - // if (t1.trackId() == pos.trackId() || t2.trackId() == pos.trackId()) { - // return false; - // } - } // end of pos lepton loop - - for (const auto& neg : negLeptons) { // leptons per collision - if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { - if (!cut.template IsSelectedTrack(neg)) { - continue; - } - } else { // cut based - if (!cut.template IsSelectedTrack(neg)) { - continue; - } - } - // if (t1.trackId() == neg.trackId() || t2.trackId() == neg.trackId()) { - // return false; - // } - } // end of neg lepton lopp - + if (trackcuts.cfg_reftrack_type == static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackType::kCB)) { + // for (const auto& pos : posLeptons) { // leptons per collision + // if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { + // if (!cut.template IsSelectedTrack(pos)) { + // continue; + // } + // } else { // cut based + // if (!cut.template IsSelectedTrack(pos)) { + // continue; + // } + // } + // // if (t1.trackId() == pos.trackId() || t2.trackId() == pos.trackId()) { + // // return false; + // // } + // } // end of pos lepton loop + + // for (const auto& neg : negLeptons) { // leptons per collision + // if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { + // if (!cut.template IsSelectedTrack(neg)) { + // continue; + // } + // } else { // cut based + // if (!cut.template IsSelectedTrack(neg)) { + // continue; + // } + // } + // // if (t1.trackId() == neg.trackId() || t2.trackId() == neg.trackId()) { + // // return false; + // // } + // } // end of neg lepton lopp + } } // end of if kDielectron } // end of if same event @@ -1040,8 +1052,8 @@ struct DileptonHadronMPC { std::vector used_trackIds_per_col; int ndf = 0; - template - void run2PC(TCollisions const& collisions, TLeptons const& posTracks, TLeptons const& negTracks, TPresilce const& perCollision, TCut const& cut, TAllTracks const& tracks, TRefTracks const& refTracks) + template + void run2PC(TCollisions const& collisions, TLeptons const& posTracks, TLeptons const& negTracks, TPresilce const& perCollision, TCut const& cut, TRefTracks const& refTracks) { for (const auto& collision : collisions) { initCCDB(collision); @@ -1077,6 +1089,7 @@ struct DileptonHadronMPC { fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); auto refTracks_per_coll = refTracks.sliceBy(perCollision_track, collision.globalIndex()); + fRegistry.fill(HIST("Event/after/hMultNTracksPV_RefTracks"), collision.multNTracksPV(), refTracks_per_coll.size()); auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); @@ -1084,29 +1097,29 @@ struct DileptonHadronMPC { int nuls = 0, nlspp = 0, nlsmm = 0; for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS - bool is_pair_ok = fillDilepton<0>(collision, pos, neg, cut, tracks); + bool is_pair_ok = fillDilepton<0>(collision, pos, neg, cut); if (is_pair_ok) { nuls++; for (const auto& refTrack : refTracks_per_coll) { - fillDileptonHadron<0>(pos, neg, cut, tracks, refTrack); + fillDileptonHadron<0>(pos, neg, cut, refTrack); } } } for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ - bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut, tracks); + bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut); if (is_pair_ok) { nlspp++; for (const auto& refTrack : refTracks_per_coll) { - fillDileptonHadron<0>(pos1, pos2, cut, tracks, refTrack); + fillDileptonHadron<0>(pos1, pos2, cut, refTrack); } } } for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- - bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut, tracks); + bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut); if (is_pair_ok) { nlsmm++; for (const auto& refTrack : refTracks_per_coll) { - fillDileptonHadron<0>(neg1, neg2, cut, tracks, refTrack); + fillDileptonHadron<0>(neg1, neg2, cut, refTrack); } } } @@ -1128,7 +1141,10 @@ struct DileptonHadronMPC { } // store ref tracks } } + // LOGF(info, "collision.globalIndex() = %d, collision.centFT0M() = %f, refTracks_per_coll.size() = %d", collision.globalIndex(), collision.centFT0M(), refTracks_per_coll.size()); + for (const auto& [ref1, ref2] : combinations(CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { + // TODO: remove lepton candidates from reference track sample in case of kCB. fillHadronHadron<0>(ref1, ref2, posTracks_per_coll, negTracks_per_coll, cut); } } @@ -1206,25 +1222,25 @@ struct DileptonHadronMPC { for (const auto& pos : selected_posTracks_in_this_event) { // ULS mix for (const auto& neg : negTracks_from_event_pool) { - fillDilepton<1>(collision, pos, neg, cut, nullptr); + fillDilepton<1>(collision, pos, neg, cut); } } for (const auto& neg : selected_negTracks_in_this_event) { // ULS mix for (const auto& pos : posTracks_from_event_pool) { - fillDilepton<1>(collision, neg, pos, cut, nullptr); + fillDilepton<1>(collision, neg, pos, cut); } } for (const auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix for (const auto& pos2 : posTracks_from_event_pool) { - fillDilepton<1>(collision, pos1, pos2, cut, nullptr); + fillDilepton<1>(collision, pos1, pos2, cut); } } for (const auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix for (const auto& neg2 : negTracks_from_event_pool) { - fillDilepton<1>(collision, neg1, neg2, cut, nullptr); + fillDilepton<1>(collision, neg1, neg2, cut); } } } // end of loop over mixed event pool for lepton-lepton @@ -1233,6 +1249,89 @@ struct DileptonHadronMPC { auto selected_refTracks_in_this_event = emh_ref->GetTracksPerCollision(key_df_collision); auto collisionIds_in_mixing_pool_hadron = emh_ref->GetCollisionIdsFromEventPool(key_bin); + // for ULS and hadron mix + for (const auto& pos : selected_posTracks_in_this_event) { + for (const auto& neg : selected_negTracks_in_this_event) { + + for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { + int mix_dfId = mix_dfId_collisionId.first; + int mix_collisionId = mix_dfId_collisionId.second; + if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. + continue; + } + auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; + uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); + fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); + if (diffBC < ndiff_bc_mix) { + continue; + } + + auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); + for (const auto& ref : refTracks_from_event_pool) { + fillDileptonHadron<1>(pos, neg, cut, ref); + } + + } // end of loop over mixed event pool for dilepton-hadron + } + } + + // for LS++ and hadron mix + for (size_t i1 = 0; i1 < selected_posTracks_in_this_event.size(); i1++) { + auto pos1 = selected_posTracks_in_this_event[i1]; + for (size_t i2 = i1 + 1; i2 < selected_posTracks_in_this_event.size(); i2++) { + auto pos2 = selected_posTracks_in_this_event[i2]; + + for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { + int mix_dfId = mix_dfId_collisionId.first; + int mix_collisionId = mix_dfId_collisionId.second; + if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. + continue; + } + + auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; + uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); + fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); + if (diffBC < ndiff_bc_mix) { + continue; + } + + auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); + for (const auto& ref : refTracks_from_event_pool) { + fillDileptonHadron<1>(pos1, pos2, cut, ref); + } + + } // end of loop over mixed event pool for dilepton-hadron + } + } + + // for LS-- and hadron mix + for (size_t i1 = 0; i1 < selected_negTracks_in_this_event.size(); i1++) { + auto neg1 = selected_negTracks_in_this_event[i1]; + for (size_t i2 = i1 + 1; i2 < selected_negTracks_in_this_event.size(); i2++) { + auto neg2 = selected_negTracks_in_this_event[i2]; + + for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { + int mix_dfId = mix_dfId_collisionId.first; + int mix_collisionId = mix_dfId_collisionId.second; + if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. + continue; + } + auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; + uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); + fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); + if (diffBC < ndiff_bc_mix) { + continue; + } + + auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); + for (const auto& ref : refTracks_from_event_pool) { + fillDileptonHadron<1>(neg1, neg2, cut, ref); + } + + } // end of loop over mixed event pool for dilepton-hadron + } + } + for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { int mix_dfId = mix_dfId_collisionId.first; int mix_collisionId = mix_dfId_collisionId.second; @@ -1269,8 +1368,8 @@ struct DileptonHadronMPC { } // end of DF - template - bool isPairOK(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks) + template + bool isPairOK(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { @@ -1287,12 +1386,19 @@ struct DileptonHadronMPC { return false; } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + if (!map_best_match_globalmuon[t1.globalIndex()]) { return false; } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + if (!map_best_match_globalmuon[t2.globalIndex()]) { return false; } + + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + // return false; + // } + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + // return false; + // } } if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -1332,17 +1438,17 @@ struct DileptonHadronMPC { auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS - if (isPairOK(pos, neg, cut, tracks)) { + if (isPairOK(pos, neg, cut)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ - if (isPairOK(pos1, pos2, cut, tracks)) { + if (isPairOK(pos1, pos2, cut)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- - if (isPairOK(neg1, neg2, cut, tracks)) { + if (isPairOK(neg1, neg2, cut)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } } @@ -1383,6 +1489,8 @@ struct DileptonHadronMPC { passed_pairIds.shrink_to_fit(); } + std::unordered_map map_best_match_globalmuon; + void processAnalysis(FilteredMyCollisions const& collisions, FilteredRefTracks const& refTracks, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -1390,15 +1498,17 @@ struct DileptonHadronMPC { if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } - run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons, refTracks); + run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, refTracks); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } - run2PC(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons, refTracks); + run2PC(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, refTracks); } map_weight.clear(); + map_best_match_globalmuon.clear(); ndf++; } PROCESS_SWITCH(DileptonHadronMPC, processAnalysis, "run dilepton analysis", true); @@ -1410,15 +1520,17 @@ struct DileptonHadronMPC { if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } - run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons, refTracks); + run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, refTracks); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); + map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } - run2PC(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons, refTracks); + run2PC(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, refTracks); } map_weight.clear(); + map_best_match_globalmuon.clear(); ndf++; } PROCESS_SWITCH(DileptonHadronMPC, processTriggerAnalysis, "run dilepton analysis on triggered data", false); diff --git a/PWGEM/Dilepton/Core/EMTrackCut.cxx b/PWGEM/Dilepton/Core/EMTrackCut.cxx index ed9e345a0f9..cd995e08836 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.cxx +++ b/PWGEM/Dilepton/Core/EMTrackCut.cxx @@ -38,12 +38,6 @@ void EMTrackCut::SetTrackPhiRange(float minPhi, float maxPhi) LOG(info) << "EMTrack Cut, set track phi range (rad.): " << mMinTrackPhi << " - " << mMaxTrackPhi; } -// void EMTrackCut::SetTrackMaxDcaXYPtDep(std::function ptDepCut) -// { -// mMaxDcaXYPtDep = ptDepCut; -// LOG(info) << "EMTrack Cut, set max DCA xy pt dep: " << mMaxDcaXYPtDep(1.0); -// } - void EMTrackCut::SetTrackBit(uint16_t bit) { mTrackBit = bit; diff --git a/PWGEM/Dilepton/Core/EMTrackCut.h b/PWGEM/Dilepton/Core/EMTrackCut.h index 2194aabb7cf..118c462cbf7 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.h +++ b/PWGEM/Dilepton/Core/EMTrackCut.h @@ -42,9 +42,11 @@ class EMTrackCut : public TNamed if (!IsSelectedTrack(track, EMTrackCuts::kTrackPtRange)) { return false; } + if (!IsSelectedTrack(track, EMTrackCuts::kTrackEtaRange)) { return false; } + if (!IsSelectedTrack(track, EMTrackCuts::kTrackPhiRange)) { return false; } @@ -69,15 +71,8 @@ class EMTrackCut : public TNamed case EMTrackCuts::kTrackPhiRange: return track.phi() > mMinTrackPhi && track.phi() < mMaxTrackPhi; - case EMTrackCuts::kTrackBit: { - // for (int i = 0; i < 10; i++) { - // if ((mTrackBit & (1 << i)) > 0 && !((track.trackBit() & (1 << i)) > 0)) { - // return false; - // } - // } - // return true; + case EMTrackCuts::kTrackBit: return (track.trackBit() & mTrackBit) >= mTrackBit; - } default: return false; @@ -91,14 +86,10 @@ class EMTrackCut : public TNamed void SetTrackBit(uint16_t bits); private: - // kinematic cuts float mMinTrackPt{0.f}, mMaxTrackPt{1e10f}; // range in pT float mMinTrackEta{-1e10f}, mMaxTrackEta{1e10f}; // range in eta float mMinTrackPhi{0.f}, mMaxTrackPhi{6.3}; // range in phi - - // track quality cuts uint16_t mTrackBit{0}; - // std::function mMaxDcaXYPtDep{}; // max dca in xy plane as function of pT ClassDef(EMTrackCut, 1); }; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx index 83835874d87..ad27348ba7d 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx @@ -15,6 +15,7 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" @@ -183,7 +184,7 @@ struct skimmerPrimaryMFTTrack { float pt = trackPar.getPt(); float eta = trackPar.getEta(); float phi = trackPar.getPhi(); - o2::math_utils::bringTo02Pi(phi); + phi = RecoDecay::constrainAngle(phi, 0, 1U); if (pt < cfgPtMin || cfgPtMax < pt) { return; @@ -205,36 +206,36 @@ struct skimmerPrimaryMFTTrack { } if (mfttrack.nClusters() >= 6) { - trackBit |= static_cast(RefMFTTrackBit::kNclsMFT6); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kNclsMFT6)); } if (mfttrack.nClusters() >= 7) { - trackBit |= static_cast(RefMFTTrackBit::kNclsMFT7); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kNclsMFT7)); } if (mfttrack.nClusters() >= 8) { - trackBit |= static_cast(RefMFTTrackBit::kNclsMFT8); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kNclsMFT8)); } if (mfttrack.chi2() / ndf < 3.f) { - trackBit |= static_cast(RefMFTTrackBit::kChi2MFT3); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kChi2MFT3)); } if (mfttrack.chi2() / ndf < 2.f) { - trackBit |= static_cast(RefMFTTrackBit::kChi2MFT2); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kChi2MFT2)); } if (std::fabs(dcaXY) < 0.05) { - trackBit |= static_cast(RefMFTTrackBit::kDCAxy005cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kDCAxy005cm)); } if (std::fabs(dcaXY) < 0.04) { - trackBit |= static_cast(RefMFTTrackBit::kDCAxy004cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kDCAxy004cm)); } if (std::fabs(dcaXY) < 0.03) { - trackBit |= static_cast(RefMFTTrackBit::kDCAxy003cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kDCAxy003cm)); } if (std::fabs(dcaXY) < 0.02) { - trackBit |= static_cast(RefMFTTrackBit::kDCAxy002cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kDCAxy002cm)); } if (std::fabs(dcaXY) < 0.01) { - trackBit |= static_cast(RefMFTTrackBit::kDCAxy001cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefMFTTrackBit::kDCAxy001cm)); } emprimarytracks(mfttrack.sign() / pt, eta, phi, trackBit); diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx index bba65c5e5d7..a64ae751244 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx @@ -77,18 +77,18 @@ struct skimmerPrimaryMuon { Configurable maxPt{"maxPt", 1e+10, "max pt for muon"}; Configurable minEtaSA{"minEtaSA", -4.0, "min. eta acceptance for MCH-MID"}; Configurable maxEtaSA{"maxEtaSA", -2.5, "max. eta acceptance for MCH-MID"}; - Configurable minEtaGL{"minEtaGL", -3.6, "min. eta acceptance for MFT-MCH-MID"}; - Configurable maxEtaGL{"maxEtaGL", -2.5, "max. eta acceptance for MFT-MCH-MID"}; + Configurable minEtaGL{"minEtaGL", -1e+10, "min. eta acceptance for MFT-MCH-MID"}; + Configurable maxEtaGL{"maxEtaGL", 0, "max. eta acceptance for MFT-MCH-MID"}; Configurable minRabsGL{"minRabsGL", 17.6, "min. R at absorber end for global muon (min. eta = -3.6)"}; // std::tan(2.f * std::atan(std::exp(- -3.6)) ) * -505. Configurable minRabs{"minRabs", 17.6, "min. R at absorber end"}; Configurable midRabs{"midRabs", 26.5, "middle R at absorber end for pDCA cut"}; Configurable maxRabs{"maxRabs", 89.5, "max. R at absorber end"}; - Configurable maxDCAxy{"maxDCAxy", 0.2, "max. DCAxy for global muons"}; + Configurable maxDCAxy{"maxDCAxy", 1e+10, "max. DCAxy for global muons"}; Configurable maxPDCAforLargeR{"maxPDCAforLargeR", 324.f, "max. pDCA for large R at absorber end"}; Configurable maxPDCAforSmallR{"maxPDCAforSmallR", 594.f, "max. pDCA for small R at absorber end"}; - Configurable maxMatchingChi2MCHMFT{"maxMatchingChi2MCHMFT", 50.f, "max. chi2 for MCH-MFT matching"}; + Configurable maxMatchingChi2MCHMFT{"maxMatchingChi2MCHMFT", 1e+10, "max. chi2 for MCH-MFT matching"}; Configurable maxChi2SA{"maxChi2SA", 1e+10, "max. chi2 for standalone muon"}; - Configurable maxChi2GL{"maxChi2GL", 12, "max. chi2 for global muon"}; + Configurable maxChi2GL{"maxChi2GL", 1e+10, "max. chi2 for global muon"}; Configurable refitGlobalMuon{"refitGlobalMuon", true, "flag to refit global muon"}; Configurable matchingZ{"matchingZ", -77.5, "z position where matching is performed"}; Configurable minNmuon{"minNmuon", 0, "min number of muon candidates per collision"}; @@ -182,10 +182,10 @@ struct skimmerPrimaryMuon { fRegistry.add("MFTMCHMID/hNclustersMFT", "NclustersMFT;Nclusters MFT", kTH1F, {{11, -0.5f, 10.5}}, false); fRegistry.add("MFTMCHMID/hRatAbsorberEnd", "R at absorber end;R at absorber end (cm)", kTH1F, {{100, 0.0f, 100}}, false); fRegistry.add("MFTMCHMID/hPDCA_Rabs", "pDCA vs. Rabs;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("MFTMCHMID/hChi2", "chi2;chi2/ndf", kTH1F, {{200, 0.0f, 20}}, false); - fRegistry.add("MFTMCHMID/hChi2MFT", "chi2 MFT;chi2 MFT/ndf", kTH1F, {{200, 0.0f, 20}}, false); - fRegistry.add("MFTMCHMID/hChi2MatchMCHMID", "chi2 match MCH-MID;chi2", kTH1F, {{200, 0.0f, 20}}, false); - fRegistry.add("MFTMCHMID/hChi2MatchMCHMFT", "chi2 match MCH-MFT;chi2", kTH1F, {{200, 0.0f, 100}}, false); + fRegistry.add("MFTMCHMID/hChi2_Pt", "chi2;p_{T} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("MFTMCHMID/hChi2MFT_Pt", "chi2 MFT;p_{T} (GeV/c);chi2 MFT/ndf", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("MFTMCHMID/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T} (GeV/c);matching chi2 MCH-MID", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("MFTMCHMID/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T} (GeV/c);matching chi2 MCH-MFT", kTH2F, {{100, 0, 10}, {200, 0.0f, 100}}, false); fRegistry.add("MFTMCHMID/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -1, 1}, {200, -1, +1}}, false); fRegistry.add("MFTMCHMID/hDCAxy2DinSigma", "DCA x vs. y in sigma;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10, 10}, {200, -10, +10}}, false); fRegistry.add("MFTMCHMID/hDCAxy", "DCAxy;DCA_{xy} (cm);", kTH1F, {{100, 0, 1}}, false); @@ -491,10 +491,10 @@ struct skimmerPrimaryMuon { fRegistry.fill(HIST("MFTMCHMID/hNclustersMFT"), nClustersMFT); fRegistry.fill(HIST("MFTMCHMID/hPDCA_Rabs"), rAtAbsorberEnd, pDCA); fRegistry.fill(HIST("MFTMCHMID/hRatAbsorberEnd"), rAtAbsorberEnd); - fRegistry.fill(HIST("MFTMCHMID/hChi2"), fwdtrack.chi2() / ndf_mchmft); - fRegistry.fill(HIST("MFTMCHMID/hChi2MFT"), chi2mft / ndf_mft); - fRegistry.fill(HIST("MFTMCHMID/hChi2MatchMCHMID"), fwdtrack.chi2MatchMCHMID()); - fRegistry.fill(HIST("MFTMCHMID/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT()); + fRegistry.fill(HIST("MFTMCHMID/hChi2_Pt"), pt, fwdtrack.chi2() / ndf_mchmft); + fRegistry.fill(HIST("MFTMCHMID/hChi2MFT_Pt"), pt, chi2mft / ndf_mft); + fRegistry.fill(HIST("MFTMCHMID/hChi2MatchMCHMID_Pt"), pt, fwdtrack.chi2MatchMCHMID()); + fRegistry.fill(HIST("MFTMCHMID/hChi2MatchMCHMFT_Pt"), pt, fwdtrack.chi2MatchMCHMFT()); fRegistry.fill(HIST("MFTMCHMID/hDCAxy2D"), dcaX, dcaY); fRegistry.fill(HIST("MFTMCHMID/hDCAxy2DinSigma"), dcaX / std::sqrt(cXX), dcaY / std::sqrt(cYY)); fRegistry.fill(HIST("MFTMCHMID/hDCAxy"), dcaXY); @@ -519,10 +519,10 @@ struct skimmerPrimaryMuon { fRegistry.fill(HIST("MCHMID/hNclustersMFT"), nClustersMFT); fRegistry.fill(HIST("MCHMID/hPDCA_Rabs"), rAtAbsorberEnd, pDCA); fRegistry.fill(HIST("MCHMID/hRatAbsorberEnd"), rAtAbsorberEnd); - fRegistry.fill(HIST("MCHMID/hChi2"), fwdtrack.chi2()); - fRegistry.fill(HIST("MCHMID/hChi2MFT"), chi2mft / ndf_mft); - fRegistry.fill(HIST("MCHMID/hChi2MatchMCHMID"), fwdtrack.chi2MatchMCHMID()); - fRegistry.fill(HIST("MCHMID/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT()); + fRegistry.fill(HIST("MCHMID/hChi2_Pt"), pt, fwdtrack.chi2()); + fRegistry.fill(HIST("MCHMID/hChi2MFT_Pt"), pt, chi2mft / ndf_mft); + fRegistry.fill(HIST("MCHMID/hChi2MatchMCHMID_Pt"), pt, fwdtrack.chi2MatchMCHMID()); + fRegistry.fill(HIST("MCHMID/hChi2MatchMCHMFT_Pt"), pt, fwdtrack.chi2MatchMCHMFT()); fRegistry.fill(HIST("MCHMID/hDCAxy2D"), dcaX, dcaY); fRegistry.fill(HIST("MCHMID/hDCAxy2DinSigma"), dcaX / std::sqrt(cXX), dcaY / std::sqrt(cYY)); fRegistry.fill(HIST("MCHMID/hDCAxy"), dcaXY); @@ -622,38 +622,6 @@ struct skimmerPrimaryMuon { // LOGF(info, "min: muon_tmp.globalIndex() = %d, muon_tmp.matchMCHTrackId() = %d, muon_tmp.matchMFTTrackId() = %d, muon_tmp.chi2MatchMCHMFT() = %f", std::get<0>(tupleIds_at_min), std::get<1>(tupleIds_at_min), std::get<2>(tupleIds_at_min), min_chi2MatchMCHMFT); } - // // PresliceUnsorted perMFTTrack = o2::aod::fwdtrack::matchMFTTrackId; - // template - // bool isBestMatch(TFwdTrack const& fwdtrack, TFwdTracks const& fwdtracks, TMFTTracks const&) - // { - // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { - // std::map map_chi2MCHMFT; - // map_chi2MCHMFT[fwdtrack.globalIndex()] = fwdtrack.chi2MatchMCHMFT(); // add myself - // // LOGF(info, "add myself: fwdtrack.globalIndex() = %d, fwdtrack.chi2MatchMCHMFT() = %f", fwdtrack.globalIndex(), fwdtrack.chi2MatchMCHMFT()); - - // auto glMuonsPerMFT = std::views::filter(vec_min_chi2MatchMCHMFT, [&](std::tuple t) { return std::get<2>(t) == fwdtrack.matchMFTTrackId() && std::get<1>(t) != fwdtrack.matchMCHTrackId() && std::get<0>(t) != fwdtrack.globalIndex(); }); - // for (const auto& candidate : glMuonsPerMFT) { - // map_chi2MCHMFT[std::get<0>(candidate)] = fwdtracks.rawIteratorAt(std::get<0>(candidate)).chi2MatchMCHMFT(); - // // LOGF(info, "same MFT found: candidate.globalIndex() = %d, candidate.chi2MatchMCHMFT() = %f", std::get<0>(candidate), fwdtracks.rawIteratorAt(std::get<0>(candidate)).chi2MatchMCHMFT()); - // } - - // auto it = std::min_element(map_chi2MCHMFT.begin(), map_chi2MCHMFT.end(), [](decltype(map_chi2MCHMFT)::value_type& l, decltype(map_chi2MCHMFT)::value_type& r) -> bool { return l.second < r.second; }); - - // // LOGF(info, "min: globalIndex = %d, chi2 = %f", it->first, it->second); - // // LOGF(info, "bool = %d", it->first == fwdtrack.globalIndex()); - - // if (it->first == fwdtrack.globalIndex()) { // search for minimum matching-chi2 - // map_chi2MCHMFT.clear(); - // return true; - // } else { - // map_chi2MCHMFT.clear(); - // return false; - // } - // } else { - // return true; - // } - // } - SliceCache cache; Preslice perCollision = o2::aod::fwdtrack::collisionId; Preslice fwdtrackIndicesPerCollision = aod::track_association::collisionId; @@ -693,10 +661,6 @@ struct skimmerPrimaryMuon { // continue; // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - if (!fillFwdTrackTable(collision, fwdtrack, nullptr, false)) { continue; } @@ -783,10 +747,6 @@ struct skimmerPrimaryMuon { // continue; // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - if (!fillFwdTrackTable(collision, fwdtrack, nullptr, mapAmb[fwdtrack.globalIndex()])) { continue; } @@ -833,98 +793,94 @@ struct skimmerPrimaryMuon { } PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA, "process reconstructed info", false); - void processRec_TTCA_withMFTCov(MyCollisions const& collisions, MyFwdTracks const& fwdtracks, aod::MFTTracks const& mfttracks, aod::BCsWithTimestamps const&, aod::FwdTrackAssoc const& fwdtrackIndices, aod::MFTTracksCov const& mftCovs) - { - for (const auto& mfttrackConv : mftCovs) { - map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); - } - - vec_min_chi2MatchMCHMFT.reserve(fwdtracks.size()); - for (const auto& collision : collisions) { - auto bc = collision.template bc_as(); - initCCDB(bc); - auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); - for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { - auto fwdtrack = fwdtrackId.template fwdtrack_as(); - findBestMatchPerMCHMID(collision, fwdtrack, fwdtracks, mfttracks); - } // end of fwdtrack loop - } // end of collision loop - - std::unordered_map mapAmb; // fwdtrack.globalIndex() -> bool isAmb; - for (const auto& fwdtrack : fwdtracks) { - const auto& fwdtrackIdsPerFwdTrack = fwdtrackIndices.sliceBy(fwdtrackIndicesPerFwdTrack, fwdtrack.globalIndex()); - mapAmb[fwdtrack.globalIndex()] = fwdtrackIdsPerFwdTrack.size() > 1; - // LOGF(info, "fwdtrack.globalIndex() = %d, ntimes = %d, isAmbiguous = %d", fwdtrack.globalIndex(), fwdtrackIdsPerFwdTrack.size(), mapAmb[fwdtrack.globalIndex()]); - } // end of fwdtrack loop - - for (const auto& collision : collisions) { - const auto& bc = collision.template bc_as(); - initCCDB(bc); - - if (!collision.isSelected()) { - continue; - } - - const auto& fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); - for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { - const auto& fwdtrack = fwdtrackId.template fwdtrack_as(); - if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { - continue; - } - - // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { - // continue; - // } - - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - - if (!fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()])) { - continue; - } - - if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { - multiMapGLMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); - } - if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { - multiMapSAMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); - } - - } // end of fwdtrack loop - } // end of collision loop + // void processRec_TTCA_withMFTCov(MyCollisions const& collisions, MyFwdTracks const& fwdtracks, aod::MFTTracks const& mfttracks, aod::BCsWithTimestamps const&, aod::FwdTrackAssoc const& fwdtrackIndices, aod::MFTTracksCov const& mftCovs) + // { + // for (const auto& mfttrackConv : mftCovs) { + // map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); + // } - for (const auto& collision : collisions) { - int count_samuons = multiMapSAMuonsPerCollision.count(collision.globalIndex()); - int count_glmuons = multiMapGLMuonsPerCollision.count(collision.globalIndex()); - if (fillQAHistograms) { - fRegistry.fill(HIST("MCHMID/hNmu"), count_samuons); - fRegistry.fill(HIST("MFTMCHMID/hNmu"), count_glmuons); - } - if (count_samuons >= minNmuon) { - auto range_samuons = multiMapSAMuonsPerCollision.equal_range(collision.globalIndex()); - for (auto it = range_samuons.first; it != range_samuons.second; it++) { - auto fwdtrack = fwdtracks.rawIteratorAt(it->second); - fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); - } - } - if (count_glmuons >= minNmuon) { - auto range_glmuons = multiMapGLMuonsPerCollision.equal_range(collision.globalIndex()); - for (auto it = range_glmuons.first; it != range_glmuons.second; it++) { - auto fwdtrack = fwdtracks.rawIteratorAt(it->second); - fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); - } - } - } // end of collision loop + // vec_min_chi2MatchMCHMFT.reserve(fwdtracks.size()); + // for (const auto& collision : collisions) { + // auto bc = collision.template bc_as(); + // initCCDB(bc); + // auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + // for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { + // auto fwdtrack = fwdtrackId.template fwdtrack_as(); + // findBestMatchPerMCHMID(collision, fwdtrack, fwdtracks, mfttracks); + // } // end of fwdtrack loop + // } // end of collision loop + + // std::unordered_map mapAmb; // fwdtrack.globalIndex() -> bool isAmb; + // for (const auto& fwdtrack : fwdtracks) { + // const auto& fwdtrackIdsPerFwdTrack = fwdtrackIndices.sliceBy(fwdtrackIndicesPerFwdTrack, fwdtrack.globalIndex()); + // mapAmb[fwdtrack.globalIndex()] = fwdtrackIdsPerFwdTrack.size() > 1; + // // LOGF(info, "fwdtrack.globalIndex() = %d, ntimes = %d, isAmbiguous = %d", fwdtrack.globalIndex(), fwdtrackIdsPerFwdTrack.size(), mapAmb[fwdtrack.globalIndex()]); + // } // end of fwdtrack loop + + // for (const auto& collision : collisions) { + // const auto& bc = collision.template bc_as(); + // initCCDB(bc); + + // if (!collision.isSelected()) { + // continue; + // } - multiMapSAMuonsPerCollision.clear(); - multiMapGLMuonsPerCollision.clear(); - mapAmb.clear(); - map_mfttrackcovs.clear(); - vec_min_chi2MatchMCHMFT.clear(); - vec_min_chi2MatchMCHMFT.shrink_to_fit(); - } - PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA_withMFTCov, "process reconstructed info", false); + // const auto& fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + // for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { + // const auto& fwdtrack = fwdtrackId.template fwdtrack_as(); + // if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { + // continue; + // } + + // // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { + // // continue; + // // } + + // if (!fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()])) { + // continue; + // } + + // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { + // multiMapGLMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); + // } + // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { + // multiMapSAMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); + // } + + // } // end of fwdtrack loop + // } // end of collision loop + + // for (const auto& collision : collisions) { + // int count_samuons = multiMapSAMuonsPerCollision.count(collision.globalIndex()); + // int count_glmuons = multiMapGLMuonsPerCollision.count(collision.globalIndex()); + // if (fillQAHistograms) { + // fRegistry.fill(HIST("MCHMID/hNmu"), count_samuons); + // fRegistry.fill(HIST("MFTMCHMID/hNmu"), count_glmuons); + // } + // if (count_samuons >= minNmuon) { + // auto range_samuons = multiMapSAMuonsPerCollision.equal_range(collision.globalIndex()); + // for (auto it = range_samuons.first; it != range_samuons.second; it++) { + // auto fwdtrack = fwdtracks.rawIteratorAt(it->second); + // fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); + // } + // } + // if (count_glmuons >= minNmuon) { + // auto range_glmuons = multiMapGLMuonsPerCollision.equal_range(collision.globalIndex()); + // for (auto it = range_glmuons.first; it != range_glmuons.second; it++) { + // auto fwdtrack = fwdtracks.rawIteratorAt(it->second); + // fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); + // } + // } + // } // end of collision loop + + // multiMapSAMuonsPerCollision.clear(); + // multiMapGLMuonsPerCollision.clear(); + // mapAmb.clear(); + // map_mfttrackcovs.clear(); + // vec_min_chi2MatchMCHMFT.clear(); + // vec_min_chi2MatchMCHMFT.shrink_to_fit(); + // } + // PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA_withMFTCov, "process reconstructed info", false); void processRec_SA_SWT(MyCollisionsWithSWT const& collisions, MyFwdTracks const& fwdtracks, aod::MFTTracks const& mfttracks, aod::BCsWithTimestamps const&) { @@ -959,10 +915,6 @@ struct skimmerPrimaryMuon { // continue; // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - if (!fillFwdTrackTable(collision, fwdtrack, nullptr, false)) { continue; } @@ -1048,10 +1000,6 @@ struct skimmerPrimaryMuon { // continue; // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - if (!fillFwdTrackTable(collision, fwdtrack, nullptr, mapAmb[fwdtrack.globalIndex()])) { continue; } @@ -1098,97 +1046,94 @@ struct skimmerPrimaryMuon { } PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA_SWT, "process reconstructed info", false); - void processRec_TTCA_SWT_withMFTCov(MyCollisionsWithSWT const& collisions, MyFwdTracks const& fwdtracks, aod::MFTTracks const& mfttracks, aod::BCsWithTimestamps const&, aod::FwdTrackAssoc const& fwdtrackIndices, aod::MFTTracksCov const& mftCovs) - { - for (const auto& mfttrackConv : mftCovs) { - map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); - } - vec_min_chi2MatchMCHMFT.reserve(fwdtracks.size()); - for (const auto& collision : collisions) { - auto bc = collision.template bc_as(); - initCCDB(bc); - auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); - for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { - auto fwdtrack = fwdtrackId.template fwdtrack_as(); - findBestMatchPerMCHMID(collision, fwdtrack, fwdtracks, mfttracks); - } // end of fwdtrack loop - } // end of collision loop - - std::unordered_map mapAmb; // fwdtrack.globalIndex() -> bool isAmb; - for (const auto& fwdtrack : fwdtracks) { - auto fwdtrackIdsPerFwdTrack = fwdtrackIndices.sliceBy(fwdtrackIndicesPerFwdTrack, fwdtrack.globalIndex()); - mapAmb[fwdtrack.globalIndex()] = fwdtrackIdsPerFwdTrack.size() > 1; - // LOGF(info, "fwdtrack.globalIndex() = %d, ntimes = %d, isAmbiguous = %d", fwdtrack.globalIndex(), fwdtrackIdsPerFwdTrack.size(), mapAmb[fwdtrack.globalIndex()]); - } // end of fwdtrack loop - - for (const auto& collision : collisions) { - auto bc = collision.template bc_as(); - initCCDB(bc); - if (!collision.isSelected()) { - continue; - } - if (collision.swtaliastmp_raw() == 0) { - continue; - } - - auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); - for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { - auto fwdtrack = fwdtrackId.template fwdtrack_as(); - if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { - continue; - } - // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { - // continue; - // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - - if (!fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()])) { - continue; - } - - if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { - multiMapGLMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); - } - if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { - multiMapSAMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); - } - - } // end of fwdtrack loop - } // end of collision loop - - for (const auto& collision : collisions) { - int count_samuons = multiMapSAMuonsPerCollision.count(collision.globalIndex()); - int count_glmuons = multiMapGLMuonsPerCollision.count(collision.globalIndex()); - if (fillQAHistograms) { - fRegistry.fill(HIST("MCHMID/hNmu"), count_samuons); - fRegistry.fill(HIST("MFTMCHMID/hNmu"), count_glmuons); - } - if (count_samuons >= minNmuon) { - auto range_samuons = multiMapSAMuonsPerCollision.equal_range(collision.globalIndex()); - for (auto it = range_samuons.first; it != range_samuons.second; it++) { - auto fwdtrack = fwdtracks.rawIteratorAt(it->second); - fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); - } - } - if (count_glmuons >= minNmuon) { - auto range_glmuons = multiMapGLMuonsPerCollision.equal_range(collision.globalIndex()); - for (auto it = range_glmuons.first; it != range_glmuons.second; it++) { - auto fwdtrack = fwdtracks.rawIteratorAt(it->second); - fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); - } - } - } // end of collision loop + // void processRec_TTCA_SWT_withMFTCov(MyCollisionsWithSWT const& collisions, MyFwdTracks const& fwdtracks, aod::MFTTracks const& mfttracks, aod::BCsWithTimestamps const&, aod::FwdTrackAssoc const& fwdtrackIndices, aod::MFTTracksCov const& mftCovs) + // { + // for (const auto& mfttrackConv : mftCovs) { + // map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); + // } + // vec_min_chi2MatchMCHMFT.reserve(fwdtracks.size()); + // for (const auto& collision : collisions) { + // auto bc = collision.template bc_as(); + // initCCDB(bc); + // auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + // for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { + // auto fwdtrack = fwdtrackId.template fwdtrack_as(); + // findBestMatchPerMCHMID(collision, fwdtrack, fwdtracks, mfttracks); + // } // end of fwdtrack loop + // } // end of collision loop + + // std::unordered_map mapAmb; // fwdtrack.globalIndex() -> bool isAmb; + // for (const auto& fwdtrack : fwdtracks) { + // auto fwdtrackIdsPerFwdTrack = fwdtrackIndices.sliceBy(fwdtrackIndicesPerFwdTrack, fwdtrack.globalIndex()); + // mapAmb[fwdtrack.globalIndex()] = fwdtrackIdsPerFwdTrack.size() > 1; + // // LOGF(info, "fwdtrack.globalIndex() = %d, ntimes = %d, isAmbiguous = %d", fwdtrack.globalIndex(), fwdtrackIdsPerFwdTrack.size(), mapAmb[fwdtrack.globalIndex()]); + // } // end of fwdtrack loop + + // for (const auto& collision : collisions) { + // auto bc = collision.template bc_as(); + // initCCDB(bc); + // if (!collision.isSelected()) { + // continue; + // } + // if (collision.swtaliastmp_raw() == 0) { + // continue; + // } - multiMapSAMuonsPerCollision.clear(); - multiMapGLMuonsPerCollision.clear(); - mapAmb.clear(); - map_mfttrackcovs.clear(); - vec_min_chi2MatchMCHMFT.clear(); - vec_min_chi2MatchMCHMFT.shrink_to_fit(); - } - PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA_SWT_withMFTCov, "process reconstructed info", false); + // auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + // for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { + // auto fwdtrack = fwdtrackId.template fwdtrack_as(); + // if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { + // continue; + // } + // // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { + // // continue; + // // } + + // if (!fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()])) { + // continue; + // } + + // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { + // multiMapGLMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); + // } + // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { + // multiMapSAMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); + // } + + // } // end of fwdtrack loop + // } // end of collision loop + + // for (const auto& collision : collisions) { + // int count_samuons = multiMapSAMuonsPerCollision.count(collision.globalIndex()); + // int count_glmuons = multiMapGLMuonsPerCollision.count(collision.globalIndex()); + // if (fillQAHistograms) { + // fRegistry.fill(HIST("MCHMID/hNmu"), count_samuons); + // fRegistry.fill(HIST("MFTMCHMID/hNmu"), count_glmuons); + // } + // if (count_samuons >= minNmuon) { + // auto range_samuons = multiMapSAMuonsPerCollision.equal_range(collision.globalIndex()); + // for (auto it = range_samuons.first; it != range_samuons.second; it++) { + // auto fwdtrack = fwdtracks.rawIteratorAt(it->second); + // fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); + // } + // } + // if (count_glmuons >= minNmuon) { + // auto range_glmuons = multiMapGLMuonsPerCollision.equal_range(collision.globalIndex()); + // for (auto it = range_glmuons.first; it != range_glmuons.second; it++) { + // auto fwdtrack = fwdtracks.rawIteratorAt(it->second); + // fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); + // } + // } + // } // end of collision loop + + // multiMapSAMuonsPerCollision.clear(); + // multiMapGLMuonsPerCollision.clear(); + // mapAmb.clear(); + // map_mfttrackcovs.clear(); + // vec_min_chi2MatchMCHMFT.clear(); + // vec_min_chi2MatchMCHMFT.shrink_to_fit(); + // } + // PROCESS_SWITCH(skimmerPrimaryMuon, processRec_TTCA_SWT_withMFTCov, "process reconstructed info", false); void processMC_SA(soa::Join const& collisions, MyFwdTracksMC const& fwdtracks, MFTTracksMC const& mfttracks, aod::BCsWithTimestamps const&, aod::McParticles const&) { @@ -1223,9 +1168,6 @@ struct skimmerPrimaryMuon { // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { // continue; // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } if (!fillFwdTrackTable(collision, fwdtrack, nullptr, false)) { continue; @@ -1314,9 +1256,6 @@ struct skimmerPrimaryMuon { // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { // continue; // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } if (!fillFwdTrackTable(collision, fwdtrack, nullptr, mapAmb[fwdtrack.globalIndex()])) { continue; @@ -1364,104 +1303,102 @@ struct skimmerPrimaryMuon { } PROCESS_SWITCH(skimmerPrimaryMuon, processMC_TTCA, "process reconstructed and MC info", false); - void processMC_TTCA_withMFTCov(soa::Join const& collisions, MyFwdTracksMC const& fwdtracks, MFTTracksMC const& mfttracks, aod::BCsWithTimestamps const&, aod::FwdTrackAssoc const& fwdtrackIndices, aod::MFTTracksCov const& mftCovs, aod::McParticles const&) - { - for (const auto& mfttrackConv : mftCovs) { - map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); - } - vec_min_chi2MatchMCHMFT.reserve(fwdtracks.size()); - for (const auto& collision : collisions) { - auto bc = collision.template bc_as(); - initCCDB(bc); - auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); - for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { - auto fwdtrack = fwdtrackId.template fwdtrack_as(); - findBestMatchPerMCHMID(collision, fwdtrack, fwdtracks, mfttracks); - } // end of fwdtrack loop - } // end of collision loop - - std::unordered_map mapAmb; // fwdtrack.globalIndex() -> bool isAmb; - for (const auto& fwdtrack : fwdtracks) { - auto fwdtrackIdsPerFwdTrack = fwdtrackIndices.sliceBy(fwdtrackIndicesPerFwdTrack, fwdtrack.globalIndex()); - mapAmb[fwdtrack.globalIndex()] = fwdtrackIdsPerFwdTrack.size() > 1; - // LOGF(info, "fwdtrack.globalIndex() = %d, ntimes = %d, isAmbiguous = %d", fwdtrack.globalIndex(), fwdtrackIdsPerFwdTrack.size(), mapAmb[fwdtrack.globalIndex()]); - } // end of fwdtrack loop - - for (const auto& collision : collisions) { - auto bc = collision.template bc_as(); - initCCDB(bc); - if (!collision.isSelected()) { - continue; - } - if (!collision.has_mcCollision()) { - continue; - } - - auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); - for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { - auto fwdtrack = fwdtrackId.template fwdtrack_as(); - if (!fwdtrack.has_mcParticle()) { - continue; - } - if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { - continue; - } - // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { - // continue; - // } - // if (!isBestMatch(fwdtrack, fwdtracks, mfttracks)) { - // continue; - // } - - if (!fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()])) { - continue; - } - - if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { - multiMapGLMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); - } - if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { - multiMapSAMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); - } - - } // end of fwdtrack loop - } // end of collision loop - - for (const auto& collision : collisions) { - int count_samuons = multiMapSAMuonsPerCollision.count(collision.globalIndex()); - int count_glmuons = multiMapGLMuonsPerCollision.count(collision.globalIndex()); - if (fillQAHistograms) { - fRegistry.fill(HIST("MCHMID/hNmu"), count_samuons); - fRegistry.fill(HIST("MFTMCHMID/hNmu"), count_glmuons); - } - if (count_samuons >= minNmuon) { - auto range_samuons = multiMapSAMuonsPerCollision.equal_range(collision.globalIndex()); - for (auto it = range_samuons.first; it != range_samuons.second; it++) { - auto fwdtrack = fwdtracks.rawIteratorAt(it->second); - fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); - } - } - if (count_glmuons >= minNmuon) { - auto range_glmuons = multiMapGLMuonsPerCollision.equal_range(collision.globalIndex()); - for (auto it = range_glmuons.first; it != range_glmuons.second; it++) { - auto fwdtrack = fwdtracks.rawIteratorAt(it->second); - fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); - } - } - } // end of collision loop + // void processMC_TTCA_withMFTCov(soa::Join const& collisions, MyFwdTracksMC const& fwdtracks, MFTTracksMC const& mfttracks, aod::BCsWithTimestamps const&, aod::FwdTrackAssoc const& fwdtrackIndices, aod::MFTTracksCov const& mftCovs, aod::McParticles const&) + // { + // for (const auto& mfttrackConv : mftCovs) { + // map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); + // } + // vec_min_chi2MatchMCHMFT.reserve(fwdtracks.size()); + // for (const auto& collision : collisions) { + // auto bc = collision.template bc_as(); + // initCCDB(bc); + // auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + // for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { + // auto fwdtrack = fwdtrackId.template fwdtrack_as(); + // findBestMatchPerMCHMID(collision, fwdtrack, fwdtracks, mfttracks); + // } // end of fwdtrack loop + // } // end of collision loop + + // std::unordered_map mapAmb; // fwdtrack.globalIndex() -> bool isAmb; + // for (const auto& fwdtrack : fwdtracks) { + // auto fwdtrackIdsPerFwdTrack = fwdtrackIndices.sliceBy(fwdtrackIndicesPerFwdTrack, fwdtrack.globalIndex()); + // mapAmb[fwdtrack.globalIndex()] = fwdtrackIdsPerFwdTrack.size() > 1; + // // LOGF(info, "fwdtrack.globalIndex() = %d, ntimes = %d, isAmbiguous = %d", fwdtrack.globalIndex(), fwdtrackIdsPerFwdTrack.size(), mapAmb[fwdtrack.globalIndex()]); + // } // end of fwdtrack loop + + // for (const auto& collision : collisions) { + // auto bc = collision.template bc_as(); + // initCCDB(bc); + // if (!collision.isSelected()) { + // continue; + // } + // if (!collision.has_mcCollision()) { + // continue; + // } - multiMapSAMuonsPerCollision.clear(); - multiMapGLMuonsPerCollision.clear(); - mapAmb.clear(); - map_mfttrackcovs.clear(); - vec_min_chi2MatchMCHMFT.clear(); - vec_min_chi2MatchMCHMFT.shrink_to_fit(); - } - PROCESS_SWITCH(skimmerPrimaryMuon, processMC_TTCA_withMFTCov, "process reconstructed and MC with MFTCov info", false); + // auto fwdtrackIdsThisCollision = fwdtrackIndices.sliceBy(fwdtrackIndicesPerCollision, collision.globalIndex()); + // for (const auto& fwdtrackId : fwdtrackIdsThisCollision) { + // auto fwdtrack = fwdtrackId.template fwdtrack_as(); + // if (!fwdtrack.has_mcParticle()) { + // continue; + // } + // if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { + // continue; + // } + // // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && std::find(vec_min_chi2MatchMCHMFT.begin(), vec_min_chi2MatchMCHMFT.end(), std::make_tuple(fwdtrack.globalIndex(), fwdtrack.matchMCHTrackId(), fwdtrack.matchMFTTrackId())) == vec_min_chi2MatchMCHMFT.end()) { + // // continue; + // // } + + // if (!fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()])) { + // continue; + // } + + // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { + // multiMapGLMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); + // } + // if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) { + // multiMapSAMuonsPerCollision.insert(std::make_pair(collision.globalIndex(), fwdtrack.globalIndex())); + // } + + // } // end of fwdtrack loop + // } // end of collision loop + + // for (const auto& collision : collisions) { + // int count_samuons = multiMapSAMuonsPerCollision.count(collision.globalIndex()); + // int count_glmuons = multiMapGLMuonsPerCollision.count(collision.globalIndex()); + // if (fillQAHistograms) { + // fRegistry.fill(HIST("MCHMID/hNmu"), count_samuons); + // fRegistry.fill(HIST("MFTMCHMID/hNmu"), count_glmuons); + // } + // if (count_samuons >= minNmuon) { + // auto range_samuons = multiMapSAMuonsPerCollision.equal_range(collision.globalIndex()); + // for (auto it = range_samuons.first; it != range_samuons.second; it++) { + // auto fwdtrack = fwdtracks.rawIteratorAt(it->second); + // fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); + // } + // } + // if (count_glmuons >= minNmuon) { + // auto range_glmuons = multiMapGLMuonsPerCollision.equal_range(collision.globalIndex()); + // for (auto it = range_glmuons.first; it != range_glmuons.second; it++) { + // auto fwdtrack = fwdtracks.rawIteratorAt(it->second); + // fillFwdTrackTable(collision, fwdtrack, mftCovs, mapAmb[fwdtrack.globalIndex()]); + // } + // } + // } // end of collision loop + + // multiMapSAMuonsPerCollision.clear(); + // multiMapGLMuonsPerCollision.clear(); + // mapAmb.clear(); + // map_mfttrackcovs.clear(); + // vec_min_chi2MatchMCHMFT.clear(); + // vec_min_chi2MatchMCHMFT.shrink_to_fit(); + // } + // PROCESS_SWITCH(skimmerPrimaryMuon, processMC_TTCA_withMFTCov, "process reconstructed and MC with MFTCov info", false); void processDummy(aod::Collisions const&) {} PROCESS_SWITCH(skimmerPrimaryMuon, processDummy, "process dummy", true); }; + struct associateAmbiguousMuon { Produces em_amb_muon_ids; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx index bc88fd7fef0..b7c6b98824f 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx @@ -15,6 +15,7 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -260,7 +261,7 @@ struct skimmerPrimaryTrack { float pt = trackParCov.getPt(); float eta = trackParCov.getEta(); float phi = trackParCov.getPhi(); - o2::math_utils::bringTo02Pi(phi); + phi = RecoDecay::constrainAngle(phi, 0, 1U); uint16_t trackBit = 0; // As minimal cuts, following cuts are applied. The cut values are hardcoded on the purpose for consistent bit operation. @@ -273,49 +274,50 @@ struct skimmerPrimaryTrack { // Ncr/Nf ratio in TPC > 0.8 if (track.itsNCls() >= 5) { - trackBit |= static_cast(RefTrackBit::kNclsITS5); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNclsITS5)); } if (track.itsNCls() >= 6) { - trackBit |= static_cast(RefTrackBit::kNclsITS6); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNclsITS6)); } if (track.tpcNClsCrossedRows() >= 70) { - trackBit |= static_cast(RefTrackBit::kNcrTPC70); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNcrTPC70)); } if (track.tpcNClsCrossedRows() >= 90) { - trackBit |= static_cast(RefTrackBit::kNcrTPC90); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNcrTPC90)); } if (track.tpcNClsFound() >= 50) { - trackBit |= static_cast(RefTrackBit::kNclsTPC50); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNclsTPC50)); } if (track.tpcNClsFound() >= 70) { - trackBit |= static_cast(RefTrackBit::kNclsTPC70); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNclsTPC70)); } if (track.tpcNClsFound() >= 90) { - trackBit |= static_cast(RefTrackBit::kNclsTPC90); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kNclsTPC90)); } if (track.tpcChi2NCl() < 4.f) { - trackBit |= static_cast(RefTrackBit::kChi2TPC4); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kChi2TPC4)); } if (track.tpcChi2NCl() < 3.f) { - trackBit |= static_cast(RefTrackBit::kChi2TPC3); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kChi2TPC3)); } + if (track.tpcFractionSharedCls() < 0.7) { - trackBit |= static_cast(RefTrackBit::kFracSharedTPC07); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kFracSharedTPC07)); } if (std::fabs(dcaZ) < 0.5) { - trackBit |= static_cast(RefTrackBit::kDCAz05cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kDCAz05cm)); } if (std::fabs(dcaZ) < 0.3) { - trackBit |= static_cast(RefTrackBit::kDCAz03cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kDCAz03cm)); } if (std::fabs(dcaXY) < 0.5) { - trackBit |= static_cast(RefTrackBit::kDCAxy05cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kDCAxy05cm)); } if (std::fabs(dcaXY) < 0.3) { - trackBit |= static_cast(RefTrackBit::kDCAxy03cm); + SETBIT(trackBit, static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackBit::kDCAxy03cm)); } emprimarytracks(/*collision.globalIndex(),*/ /*track.globalIndex(),*/ track.sign() / pt, eta, phi, trackBit); diff --git a/PWGEM/Dilepton/Utils/EMTrackUtilities.h b/PWGEM/Dilepton/Utils/EMTrackUtilities.h index 88daecccb62..47e73e31f96 100644 --- a/PWGEM/Dilepton/Utils/EMTrackUtilities.h +++ b/PWGEM/Dilepton/Utils/EMTrackUtilities.h @@ -29,34 +29,43 @@ namespace o2::aod::pwgem::dilepton::utils::emtrackutil { -enum class RefTrackBit : uint16_t { // This is not for leptons, but charged tracks for reference flow. - kNclsITS5 = 1, - kNclsITS6 = 2, - kNcrTPC70 = 4, - kNcrTPC90 = 8, - kNclsTPC50 = 16, // (not necessary, if ncr is used.) - kNclsTPC70 = 32, // (not necessary, if ncr is used.) - kNclsTPC90 = 64, // (not necessary, if ncr is used.) - kChi2TPC4 = 128, - kChi2TPC3 = 256, - kFracSharedTPC07 = 512, - kDCAxy05cm = 1024, // default is 1 cm - kDCAxy03cm = 2048, - kDCAz05cm = 4096, // default is 1cm - kDCAz03cm = 8192, +enum class RefTrackType : int { // charged tracks for reference flow. + kCB = 0, + kMFTsa = 1, }; -enum class RefMFTTrackBit : uint16_t { // This is not for leptons, but charged tracks for reference flow. - kNclsMFT6 = 1, // default is 5 - kNclsMFT7 = 2, - kNclsMFT8 = 4, - kChi2MFT3 = 8, // default is 4 - kChi2MFT2 = 16, - kDCAxy005cm = 32, // default is 0.06 cm - kDCAxy004cm = 64, - kDCAxy003cm = 128, - kDCAxy002cm = 256, - kDCAxy001cm = 512, +// This is not for leptons, but charged tracks for reference flow. +enum class RefTrackBit : int { + kNclsITS5 = 0, + kNclsITS6, + kNcrTPC70, + kNcrTPC90, + kNclsTPC50, // (not necessary, if ncr is used.) + kNclsTPC70, // (not necessary, if ncr is used.) + kNclsTPC90, // (not necessary, if ncr is used.) + kChi2TPC4, + kChi2TPC3, + kFracSharedTPC07, + kDCAxy05cm, // default is 1 cm + kDCAxy03cm, + kDCAz05cm, // default is 1cm + kDCAz03cm, + kNCuts, +}; + +// This is not for leptons, but charged tracks for reference flow. +enum class RefMFTTrackBit : int { + kNclsMFT6 = 0, // default is 5 + kNclsMFT7, + kNclsMFT8, + kChi2MFT3, // default is 4 + kChi2MFT2, + kDCAxy005cm, // default is 0.06 cm + kDCAxy004cm, + kDCAxy003cm, + kDCAxy002cm, + kDCAxy001cm, + kNCuts, }; //_______________________________________________________________________ From 479909283beede384dd3d4099016230f266adced Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Tue, 24 Mar 2026 13:44:45 +0100 Subject: [PATCH 045/282] [PWGEM] emcalPi0Qc: Add SM dependend histograms vs time (#15502) --- PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx | 438 +++++++++++++++++++------ 1 file changed, 335 insertions(+), 103 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx index f2aa922ec90..0f1d2103db5 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx @@ -28,6 +28,7 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" +#include #include #include #include @@ -40,8 +41,11 @@ #include #include +#include +#include +#include // IWYU pragma: keep +#include #include -#include #include #include @@ -50,26 +54,23 @@ #include #include #include +#include #include #include #include #include -#include #include using namespace o2::framework; using namespace o2::framework::expressions; -using SelectedClusters = o2::soa::Filtered; using MyCollisions = o2::soa::Join; -using MyBCs = o2::soa::Join; -using SelectedAmbiguousClusters = o2::soa::Filtered; +using MyBCs = o2::soa::Join; struct Photon { - Photon(float eta_tmp, float phi_tmp, float energy_tmp, int clusid = 0) + Photon(float eta_tmp, float phi_tmp, float energy_tmp, int clusid = 0, uint8_t sm_tmp = 0) { eta = eta_tmp; phi = phi_tmp; - onDCal = (phi < 6 && phi > 4); energy = energy_tmp; theta = 2 * std::atan2(std::exp(-eta), 1); px = energy * std::sin(theta) * std::cos(phi); @@ -78,19 +79,22 @@ struct Photon { pt = std::sqrt(px * px + py * py); photon.SetPxPyPzE(px, py, pz, energy); id = clusid; + sm = sm_tmp; + onDCal = (phi < 6 && phi > 4); } - TLorentzVector photon; + ROOT::Math::PxPyPzEVector photon; float pt; float px; float py; float pz; float eta; float phi; - bool onDCal; // Checks whether photon is in phi region of the DCal, otherwise: EMCal float energy; float theta; int id; + uint8_t sm; + bool onDCal; // Checks whether photon is in phi region of the DCal, otherwise: EMCal }; struct Meson { @@ -101,11 +105,17 @@ struct Meson { } Photon pgamma1; Photon pgamma2; - TLorentzVector pMeson; + ROOT::Math::PxPyPzEVector pMeson; float getMass() const { return pMeson.M(); } float getPt() const { return pMeson.Pt(); } - float getOpeningAngle() const { return pgamma1.photon.Angle(pgamma2.photon.Vect()); } + float getOpeningAngle() const + { + float cosAngle = pgamma1.photon.Vect().Dot(pgamma2.photon.Vect()) / (pgamma1.photon.P() * pgamma2.photon.P()); + float angle = std::acos(std::clamp(cosAngle, -1.0f, 1.0f)); + return angle; + } + ROOT::Math::PxPyPzEVector getMathVector() const { return pMeson; } }; struct EventMixVec { @@ -156,8 +166,8 @@ struct EmcalPi0Qc { // define cluster filter. It selects only those clusters which are of the type // specified in the string mClusterDefinition,e.g. kV3Default, which is V3 clusterizer with default // clusterization parameters - o2::aod::EMCALClusterDefinition clusDef = o2::aod::emcalcluster::getClusterDefinitionFromString(mClusterDefinition.value); - Filter clusterDefinitionSelection = o2::aod::emcalcluster::definition == static_cast(clusDef); + // o2::aod::EMCALClusterDefinition clusDef = o2::aod::emcalcluster::getClusterDefinitionFromString(mClusterDefinition.value); + // Filter clusterDefinitionSelection = o2::aod::emcalcluster::definition == static_cast(clusDef); // define container for photons std::vector mPhotons; @@ -165,9 +175,17 @@ struct EmcalPi0Qc { // event mixing class EventMixVec evtMix; + o2::ccdb::CcdbApi ccdbApi; + int lastRunNumber = -1; // get the runnumber to obtain the SOR of the run to get t - SOR in (s) later + int64_t tsSOR = -1; + o2::aod::EMCALClusterDefinition clusDef = o2::aod::emcalcluster::kV3Default; + /// \brief Create output histograms and initialize geometry void init(InitContext const&) { + // init ccdb api + ccdbApi.init("https://alice-ccdb.cern.ch"); + // load geometry just in case we need it mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); @@ -175,20 +193,30 @@ struct EmcalPi0Qc { LOG(info) << "Creating histograms"; const AxisSpec bcAxis{3501, -0.5, 3500.5}; const AxisSpec energyAxis{makeClusterBinning(), "#it{E} (GeV)"}; + const AxisSpec collisionTimeAxis{1440, 0, 1440, "#it{t} - SOR (min)"}; + const AxisSpec clusterTimeAxis{1500, -600, 900, "t_{cl} (ns)"}; + const AxisSpec invmassAxis{invmassBinning, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; + const AxisSpec ptAxis{pTBinning, "#it{p}_{T} (GeV/#it{c})"}; + + if (doprocessCollision) { + mHistManager.add("events", "events;;#it{count}", HistType::kTH1F, {{7, 0.5, 7.5}}); + auto heventType = mHistManager.get(HIST("events")); + heventType->GetXaxis()->SetBinLabel(1, "All events"); + heventType->GetXaxis()->SetBinLabel(2, "sel8"); + heventType->GetXaxis()->SetBinLabel(3, "EMCal readout"); + heventType->GetXaxis()->SetBinLabel(4, "1+ Contributor"); + heventType->GetXaxis()->SetBinLabel(5, "z<10cm"); + heventType->GetXaxis()->SetBinLabel(6, "unique col"); + heventType->GetXaxis()->SetBinLabel(7, "EMCal cell>0"); + mHistManager.add("eventVertexZAll", "z-vertex of event (all events)", HistType::kTH1F, {{200, -20, 20}}); + mHistManager.add("eventVertexZSelected", "z-vertex of event (selected events)", HistType::kTH1F, {{200, -20, 20}}); + mHistManager.add("hEventPerTime", "number of events per time", HistType::kTH1F, {collisionTimeAxis}); + } - mHistManager.add("events", "events;;#it{count}", HistType::kTH1F, {{6, 0.5, 6.5}}); - auto heventType = mHistManager.get(HIST("events")); - heventType->GetXaxis()->SetBinLabel(1, "All events"); - heventType->GetXaxis()->SetBinLabel(2, "sel8 + readout"); - heventType->GetXaxis()->SetBinLabel(3, "1+ Contributor"); - heventType->GetXaxis()->SetBinLabel(4, "z<10cm"); - heventType->GetXaxis()->SetBinLabel(5, "unique col"); - heventType->GetXaxis()->SetBinLabel(6, "EMCAL cell>0"); - mHistManager.add("eventBCAll", "Bunch crossing ID of event (all events)", HistType::kTH1F, {bcAxis}); - mHistManager.add("eventBCSelected", "Bunch crossing ID of event (selected events)", HistType::kTH1F, {bcAxis}); - mHistManager.add("eventVertexZAll", "z-vertex of event (all events)", HistType::kTH1F, {{200, -20, 20}}); - mHistManager.add("eventVertexZSelected", "z-vertex of event (selected events)", HistType::kTH1F, {{200, -20, 20}}); - + if (doprocessAmbiguous) { + mHistManager.add("eventBCAll", "Bunch crossing ID of event (all events)", HistType::kTH1F, {bcAxis}); + mHistManager.add("eventBCSelected", "Bunch crossing ID of event (selected events)", HistType::kTH1F, {bcAxis}); + } // cluster properties for (const bool& iBeforeCuts : {false, true}) { const char* clusterDirectory = iBeforeCuts ? "ClustersBeforeCuts" : "ClustersAfterCuts"; @@ -204,17 +232,25 @@ struct EmcalPi0Qc { } // meson related histograms - mHistManager.add("invMassVsPt", "invariant mass and pT of meson candidates", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPtBackground", "invariant mass and pT of background meson candidates", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPtMixedBackground", "invariant mass and pT of mixed background meson candidates", HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPt", "invariant mass and pT of meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPtBackground", "invariant mass and pT of background meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPtMixedBackground", "invariant mass and pT of mixed background meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}); if (mSplitEMCalDCal) { - mHistManager.add("invMassVsPt_EMCal", "invariant mass and pT of meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPtBackground_EMCal", "invariant mass and pT of background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPtMixedBackground_EMCal", "invariant mass and pT of mixed background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPt_DCal", "invariant mass and pT of meson candidates with both clusters on DCal", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPtBackground_DCal", "invariant mass and pT of background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassBinning, pTBinning}); - mHistManager.add("invMassVsPtMixedBackground_DCal", "invariant mass and pT of mixed background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPt_EMCal", "invariant mass and pT of meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPtBackground_EMCal", "invariant mass and pT of background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPtMixedBackground_EMCal", "invariant mass and pT of mixed background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPt_DCal", "invariant mass and pT of meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPtBackground_DCal", "invariant mass and pT of background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPtMixedBackground_DCal", "invariant mass and pT of mixed background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}); + } + + // add histograms per supermodule + for (int ism = 0; ism < 20; ++ism) { + mHistManager.add(Form("clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM%d", ism), Form("Cluster time vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {clusterTimeAxis, collisionTimeAxis}); + mHistManager.add(Form("clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM%d", ism), Form("Cluster number of cells vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {{50, 0, 50}, collisionTimeAxis}); + mHistManager.add(Form("clusterM02VsTimeStamp/clusterM02VsTimeStampSM%d", ism), Form("Cluster M02 vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {{400, 0, 5}, collisionTimeAxis}); + mHistManager.add(Form("mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM%d", ism), Form("invariant mass vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {invmassAxis, collisionTimeAxis}); } if (mVetoBCID->length()) { @@ -237,69 +273,258 @@ struct EmcalPi0Qc { mSelectBCIDs.push_back(bcid); } } + clusDef = o2::aod::emcalcluster::getClusterDefinitionFromString(mClusterDefinition.value); + LOG(info) << "mDoEventSel = " << mDoEventSel.value; + LOG(info) << "mRequireCaloReadout = " << mRequireCaloReadout.value; + LOG(info) << "mRequireEMCalCells = " << mRequireEMCalCells.value; + LOG(info) << "mSplitEMCalDCal = " << mSplitEMCalDCal.value; + } + + template + void supermoduleHistHelperPhoton(float time, float m02, int NCell, float timeSinceSOR) + { + static constexpr std::string_view ClusterTimeHistSM[20] = {"clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM0", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM1", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM2", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM3", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM4", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM5", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM6", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM7", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM8", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM9", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM10", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM11", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM12", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM13", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM14", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM15", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM16", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM17", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM18", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM19"}; + static constexpr std::string_view ClusterNcellHistSM[20] = {"clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM0", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM1", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM2", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM3", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM4", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM5", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM6", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM7", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM8", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM9", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM10", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM11", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM12", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM13", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM14", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM15", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM16", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM17", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM18", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM19"}; + static constexpr std::string_view ClusterM02HistSM[20] = {"clusterM02VsTimeStamp/clusterM02VsTimeStampSM0", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM1", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM2", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM3", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM4", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM5", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM6", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM7", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM8", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM9", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM10", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM11", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM12", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM13", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM14", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM15", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM16", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM17", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM18", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM19"}; + mHistManager.fill(HIST(ClusterTimeHistSM[supermoduleID]), time, timeSinceSOR); + mHistManager.fill(HIST(ClusterNcellHistSM[supermoduleID]), NCell, timeSinceSOR); + mHistManager.fill(HIST(ClusterM02HistSM[supermoduleID]), m02, timeSinceSOR); + } + + template + void supermoduleHistHelperMeson(float minv, float timeSinceSOR) + { + static constexpr std::string_view MesonInvMassHistSM[20] = {"mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM0", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM1", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM2", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM3", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM4", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM5", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM6", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM7", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM8", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM9", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM10", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM11", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM12", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM13", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM14", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM15", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM16", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM17", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM18", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM19"}; + mHistManager.fill(HIST(MesonInvMassHistSM[supermoduleID]), minv, timeSinceSOR); + } + + void fillSupermoduleHistogramsPhoton(int supermoduleID, float time, float m02, int NCell, float timeSinceSOR) + { + // workaround to have the histogram names per supermodule + // handled as constexpr + switch (supermoduleID) { + case 0: + supermoduleHistHelperPhoton<0>(time, m02, NCell, timeSinceSOR); + break; + case 1: + supermoduleHistHelperPhoton<1>(time, m02, NCell, timeSinceSOR); + break; + case 2: + supermoduleHistHelperPhoton<2>(time, m02, NCell, timeSinceSOR); + break; + case 3: + supermoduleHistHelperPhoton<3>(time, m02, NCell, timeSinceSOR); + break; + case 4: + supermoduleHistHelperPhoton<4>(time, m02, NCell, timeSinceSOR); + break; + case 5: + supermoduleHistHelperPhoton<5>(time, m02, NCell, timeSinceSOR); + break; + case 6: + supermoduleHistHelperPhoton<6>(time, m02, NCell, timeSinceSOR); + break; + case 7: + supermoduleHistHelperPhoton<7>(time, m02, NCell, timeSinceSOR); + break; + case 8: + supermoduleHistHelperPhoton<8>(time, m02, NCell, timeSinceSOR); + break; + case 9: + supermoduleHistHelperPhoton<9>(time, m02, NCell, timeSinceSOR); + break; + case 10: + supermoduleHistHelperPhoton<10>(time, m02, NCell, timeSinceSOR); + break; + case 11: + supermoduleHistHelperPhoton<11>(time, m02, NCell, timeSinceSOR); + break; + case 12: + supermoduleHistHelperPhoton<12>(time, m02, NCell, timeSinceSOR); + break; + case 13: + supermoduleHistHelperPhoton<13>(time, m02, NCell, timeSinceSOR); + break; + case 14: + supermoduleHistHelperPhoton<14>(time, m02, NCell, timeSinceSOR); + break; + case 15: + supermoduleHistHelperPhoton<15>(time, m02, NCell, timeSinceSOR); + break; + case 16: + supermoduleHistHelperPhoton<16>(time, m02, NCell, timeSinceSOR); + break; + case 17: + supermoduleHistHelperPhoton<17>(time, m02, NCell, timeSinceSOR); + break; + case 18: + supermoduleHistHelperPhoton<18>(time, m02, NCell, timeSinceSOR); + break; + case 19: + supermoduleHistHelperPhoton<19>(time, m02, NCell, timeSinceSOR); + break; + default: + break; + } + } + + void fillSupermoduleHistogramsMeson(int supermoduleID, float minv, float timeSinceSOR) + { + // workaround to have the histogram names per supermodule + // handled as constexpr + switch (supermoduleID) { + case 0: + supermoduleHistHelperMeson<0>(minv, timeSinceSOR); + break; + case 1: + supermoduleHistHelperMeson<1>(minv, timeSinceSOR); + break; + case 2: + supermoduleHistHelperMeson<2>(minv, timeSinceSOR); + break; + case 3: + supermoduleHistHelperMeson<3>(minv, timeSinceSOR); + break; + case 4: + supermoduleHistHelperMeson<4>(minv, timeSinceSOR); + break; + case 5: + supermoduleHistHelperMeson<5>(minv, timeSinceSOR); + break; + case 6: + supermoduleHistHelperMeson<6>(minv, timeSinceSOR); + break; + case 7: + supermoduleHistHelperMeson<7>(minv, timeSinceSOR); + break; + case 8: + supermoduleHistHelperMeson<8>(minv, timeSinceSOR); + break; + case 9: + supermoduleHistHelperMeson<9>(minv, timeSinceSOR); + break; + case 10: + supermoduleHistHelperMeson<10>(minv, timeSinceSOR); + break; + case 11: + supermoduleHistHelperMeson<11>(minv, timeSinceSOR); + break; + case 12: + supermoduleHistHelperMeson<12>(minv, timeSinceSOR); + break; + case 13: + supermoduleHistHelperMeson<13>(minv, timeSinceSOR); + break; + case 14: + supermoduleHistHelperMeson<14>(minv, timeSinceSOR); + break; + case 15: + supermoduleHistHelperMeson<15>(minv, timeSinceSOR); + break; + case 16: + supermoduleHistHelperMeson<16>(minv, timeSinceSOR); + break; + case 17: + supermoduleHistHelperMeson<17>(minv, timeSinceSOR); + break; + case 18: + supermoduleHistHelperMeson<18>(minv, timeSinceSOR); + break; + case 19: + supermoduleHistHelperMeson<19>(minv, timeSinceSOR); + break; + default: + break; + } } - PresliceUnsorted perCollision = o2::aod::emcalcluster::collisionId; + PresliceUnsortedOptional perCollision = o2::aod::emcalcluster::collisionId; + PresliceOptional perCluster = o2::aod::emcalclustercell::emcalclusterId; /// \brief Process EMCAL clusters that are matched to a collisions - void processCollision(MyBCs const&, MyCollisions const& collisions, SelectedClusters const& clusters, o2::soa::Filtered const& cells) + void processCollision(MyBCs const& bcs, MyCollisions const& collisions, o2::aod::EMCALClusters const& clusters, o2::soa::Filtered const& cells, o2::aod::EMCALClusterCells const& clusterCells) { + + auto cellIter = cells.begin(); + auto bcIter = bcs.begin(); + int runNumber = bcIter.runNumber(); std::unordered_map cellGlobalBCs; // Build map of number of cells for corrected BCs using global BCs // used later in the determination whether a BC has EMC cell content (for speed reason) for (const auto& cell : cells) { - auto globalbcid = cell.bc_as().globalBC(); - auto found = cellGlobalBCs.find(globalbcid); - if (found != cellGlobalBCs.end()) { - found->second++; - } else { - cellGlobalBCs.insert(std::pair(globalbcid, 1)); - } + cellGlobalBCs[cell.bc_as().globalBC()]++; } for (const auto& collision : collisions) { mHistManager.fill(HIST("events"), 1); // Fill "All events" bin of event histogram - if (mDoEventSel && (!collision.sel8() || (mRequireCaloReadout && !collision.alias_bit(kTVXinEMC)))) { // Check sel8 and whether EMC was read out + if (mDoEventSel.value && (!collision.sel8())) { // Check sel8 + continue; + } + mHistManager.fill(HIST("events"), 2); // Fill sel8 + if (mRequireCaloReadout.value && !collision.alias_bit(kTVXinEMC)) { // Check whether EMC was read out continue; } - mHistManager.fill(HIST("events"), 2); // Fill sel8 + readout + mHistManager.fill(HIST("events"), 3); // Fill readout - if (mDoEventSel && collision.numContrib() < 0.5) { // Skip collisions without contributors + if (mDoEventSel.value && collision.numContrib() < 0.5) { // Skip collisions without contributors continue; } - mHistManager.fill(HIST("events"), 3); // Fill >1 vtx contr. bin of event histogram + mHistManager.fill(HIST("events"), 4); // Fill >1 vtx contr. bin of event histogram mHistManager.fill(HIST("eventVertexZAll"), collision.posZ()); if (mVertexCut > 0 && std::abs(collision.posZ()) > mVertexCut) { continue; } - mHistManager.fill(HIST("events"), 4); // Fill z-Vertex selected bin of event histogram + mHistManager.fill(HIST("events"), 5); // Fill z-Vertex selected bin of event histogram mHistManager.fill(HIST("eventVertexZSelected"), collision.posZ()); - if (mDoEventSel && collision.ambiguous()) { // Skip ambiguous collisions (those that are in BCs including multiple collisions) + if (mDoEventSel.value && collision.ambiguous()) { // Skip ambiguous collisions (those that are in BCs including multiple collisions) continue; } - mHistManager.fill(HIST("events"), 5); // Fill "One collision in BC" bin of event histogram + mHistManager.fill(HIST("events"), 6); // Fill "One collision in BC" bin of event histogram - if (mDoEventSel) { + if (mDoEventSel.value) { auto found = cellGlobalBCs.find(collision.foundBC_as().globalBC()); - if (mRequireEMCalCells && (found == cellGlobalBCs.end() || found->second == 0)) { // Skip collisions without any readout EMCal cells + if (mRequireEMCalCells.value && (found == cellGlobalBCs.end() || found->second == 0)) { // Skip collisions without any readout EMCal cells continue; } } - mHistManager.fill(HIST("events"), 6); // Fill at least one non0 cell in EMCal of event histogram (Selected) + mHistManager.fill(HIST("events"), 7); // Fill at least one non0 cell in EMCal of event histogram (Selected) - auto clustersPerColl = clusters.sliceBy(perCollision, collision.collisionId()); - processClusters(clustersPerColl); - processMesons(); + // Get BC and run number + int64_t foundBCId = collision.foundBCId(); + if (foundBCId >= 0) { + bcIter.setCursor(foundBCId); + } + runNumber = bcIter.runNumber(); + + // Fetch SOR only when run changes + if (runNumber != lastRunNumber) { + std::map headers, metadata; + headers = ccdbApi.retrieveHeaders(Form("RCT/Info/RunInformation/%i", runNumber), metadata, -1); + tsSOR = atol(headers["SOR"].c_str()); + // LOGP(info, "Run {} | SOR = {} ms", runNumber, tsSOR); + lastRunNumber = runNumber; + } + + // Time since SOR in minutes (bc.timestamp() is in ms) + float timeSinceSORMin = (bcIter.timestamp() - tsSOR) / 1000.0f / 60.f; + mHistManager.fill(HIST("hEventPerTime"), timeSinceSORMin); + + auto clustersPerColl = clusters.sliceBy(perCollision, collision.globalIndex()); + if (clustersPerColl.size() == 0) { + continue; + } + processClusters(clustersPerColl, clusterCells, cellIter, timeSinceSORMin); + processMesons(timeSinceSORMin); } } PROCESS_SWITCH(EmcalPi0Qc, processCollision, "Process clusters from collision", false); /// \brief Process EMCAL clusters that are not matched to a collision /// This is not needed for most users - void processAmbiguous(o2::aod::BCs::iterator const& bc, SelectedAmbiguousClusters const& clusters) + void processAmbiguous(o2::aod::BCs::iterator const& bc, o2::aod::EMCALAmbiguousClusters const& clusters) { LOG(debug) << "processAmbiguous"; // TODO: remove this loop and put it in separate process function that only takes care of ambiguous clusters @@ -321,42 +546,39 @@ struct EmcalPi0Qc { PROCESS_SWITCH(EmcalPi0Qc, processAmbiguous, "Process Ambiguous clusters", false); /// \brief Process EMCAL clusters that are matched to a collisions - template - void processClusters(Clusters const& clusters) + template + void processClusters(Clusters const& clusters, o2::aod::EMCALClusterCells const& clusterCells, Cell& cellIter, float timeSinceSOR = 0.f) { LOG(debug) << "processClusters"; // clear photon vector mPhotons.clear(); - int globalCollID = -1000; - - // loop over all clusters from accepted collision - // auto eventClusters = clusters.select(o2::aod::emcalcluster::bcId == theCollision.bc().globalBC()); for (const auto& cluster : clusters) { - - // o2::InteractionRecord eventIR; - auto collID = cluster.collisionId(); - if (globalCollID == -1000) - globalCollID = collID; - - if (globalCollID != collID) { - LOG(info) << "Something went wrong with the collision ID"; + if (static_cast(clusDef) != cluster.definition()) { + continue; } + auto cellsPerCluster = clusterCells.sliceBy(perCluster, cluster.globalIndex()); + auto cellsPerClusterIter = cellsPerCluster.begin(); + cellIter.setCursor(cellsPerClusterIter.caloId()); + auto [supermodule, module, phiInModule, etaInModule] = mGeometry->GetCellIndex(cellIter.cellNumber()); + fillClusterQAHistos(cluster); - if (clusterRejectedByCut(cluster)) + if (clusterRejectedByCut(cluster)) { continue; + } fillClusterQAHistos(cluster); // put clusters in photon vector - mPhotons.push_back(Photon(cluster.eta(), cluster.phi(), cluster.energy(), cluster.id())); + fillSupermoduleHistogramsPhoton(supermodule, cluster.time(), cluster.m02(), cluster.nCells(), timeSinceSOR); + mPhotons.push_back(Photon(cluster.eta(), cluster.phi(), cluster.energy(), cluster.id(), supermodule)); } } /// \brief Process EMCAL clusters that are not matched to a collisions - template + template void processAmbiguousClusters(Clusters const& clusters) { LOG(debug) << "processClusters"; @@ -379,33 +601,33 @@ struct EmcalPi0Qc { } /// \brief Fills the standard QA histograms for a given cluster - template + template void fillClusterQAHistos(Cluster const& cluster) { // In this implementation the cluster properties are directly loaded from the flat table, // in the future one should consider using the AnalysisCluster object to work with after loading. - static constexpr std::string_view kClusterQAHistEnergy[2] = {"ClustersBeforeCuts/clusterE", "ClustersAfterCuts/clusterE"}; - static constexpr std::string_view kClusterQAHistEnergySimpleBinning[2] = {"ClustersBeforeCuts/clusterE_SimpleBinning", "ClustersAfterCuts/clusterE_SimpleBinning"}; - static constexpr std::string_view kClusterQAHistTime[2] = {"ClustersBeforeCuts/clusterTime", "ClustersAfterCuts/clusterTime"}; - static constexpr std::string_view kClusterQAHistEtaPhi[2] = {"ClustersBeforeCuts/clusterEtaPhi", "ClustersAfterCuts/clusterEtaPhi"}; - static constexpr std::string_view kClusterQAHistM02[2] = {"ClustersBeforeCuts/clusterM02", "ClustersAfterCuts/clusterM02"}; - static constexpr std::string_view kClusterQAHistM20[2] = {"ClustersBeforeCuts/clusterM20", "ClustersAfterCuts/clusterM20"}; - static constexpr std::string_view kClusterQAHistNLM[2] = {"ClustersBeforeCuts/clusterNLM", "ClustersAfterCuts/clusterNLM"}; - static constexpr std::string_view kClusterQAHistNCells[2] = {"ClustersBeforeCuts/clusterNCells", "ClustersAfterCuts/clusterNCells"}; - static constexpr std::string_view kClusterQAHistDistanceToBadChannel[2] = {"ClustersBeforeCuts/clusterDistanceToBadChannel", "ClustersAfterCuts/clusterDistanceToBadChannel"}; - mHistManager.fill(HIST(kClusterQAHistEnergy[BeforeCuts]), cluster.energy()); - mHistManager.fill(HIST(kClusterQAHistEnergySimpleBinning[BeforeCuts]), cluster.energy()); - mHistManager.fill(HIST(kClusterQAHistTime[BeforeCuts]), cluster.time()); - mHistManager.fill(HIST(kClusterQAHistEtaPhi[BeforeCuts]), cluster.eta(), cluster.phi()); - mHistManager.fill(HIST(kClusterQAHistM02[BeforeCuts]), cluster.m02()); - mHistManager.fill(HIST(kClusterQAHistM20[BeforeCuts]), cluster.m20()); - mHistManager.fill(HIST(kClusterQAHistNLM[BeforeCuts]), cluster.nlm()); - mHistManager.fill(HIST(kClusterQAHistNCells[BeforeCuts]), cluster.nCells()); - mHistManager.fill(HIST(kClusterQAHistDistanceToBadChannel[BeforeCuts]), cluster.distanceToBadChannel()); + static constexpr std::string_view ClusterQAHistEnergy[2] = {"ClustersBeforeCuts/clusterE", "ClustersAfterCuts/clusterE"}; + static constexpr std::string_view ClusterQAHistEnergySimpleBinning[2] = {"ClustersBeforeCuts/clusterE_SimpleBinning", "ClustersAfterCuts/clusterE_SimpleBinning"}; + static constexpr std::string_view ClusterQAHistTime[2] = {"ClustersBeforeCuts/clusterTime", "ClustersAfterCuts/clusterTime"}; + static constexpr std::string_view ClusterQAHistEtaPhi[2] = {"ClustersBeforeCuts/clusterEtaPhi", "ClustersAfterCuts/clusterEtaPhi"}; + static constexpr std::string_view ClusterQAHistM02[2] = {"ClustersBeforeCuts/clusterM02", "ClustersAfterCuts/clusterM02"}; + static constexpr std::string_view ClusterQAHistM20[2] = {"ClustersBeforeCuts/clusterM20", "ClustersAfterCuts/clusterM20"}; + static constexpr std::string_view ClusterQAHistNLM[2] = {"ClustersBeforeCuts/clusterNLM", "ClustersAfterCuts/clusterNLM"}; + static constexpr std::string_view ClusterQAHistNCells[2] = {"ClustersBeforeCuts/clusterNCells", "ClustersAfterCuts/clusterNCells"}; + static constexpr std::string_view ClusterQAHistDistanceToBadChannel[2] = {"ClustersBeforeCuts/clusterDistanceToBadChannel", "ClustersAfterCuts/clusterDistanceToBadChannel"}; + mHistManager.fill(HIST(ClusterQAHistEnergy[BeforeCuts]), cluster.energy()); + mHistManager.fill(HIST(ClusterQAHistEnergySimpleBinning[BeforeCuts]), cluster.energy()); + mHistManager.fill(HIST(ClusterQAHistTime[BeforeCuts]), cluster.time()); + mHistManager.fill(HIST(ClusterQAHistEtaPhi[BeforeCuts]), cluster.eta(), cluster.phi()); + mHistManager.fill(HIST(ClusterQAHistM02[BeforeCuts]), cluster.m02()); + mHistManager.fill(HIST(ClusterQAHistM20[BeforeCuts]), cluster.m20()); + mHistManager.fill(HIST(ClusterQAHistNLM[BeforeCuts]), cluster.nlm()); + mHistManager.fill(HIST(ClusterQAHistNCells[BeforeCuts]), cluster.nCells()); + mHistManager.fill(HIST(ClusterQAHistDistanceToBadChannel[BeforeCuts]), cluster.distanceToBadChannel()); } /// \brief Return a boolean that states, whether a cluster should be rejected by the applied cluster cuts - template + template bool clusterRejectedByCut(Cluster const& cluster) { // apply basic cluster cuts @@ -432,7 +654,7 @@ struct EmcalPi0Qc { } /// \brief Process meson candidates, calculate invariant mass and pT and fill histograms - void processMesons() + void processMesons(float timeSinceSOR = 0.f) { LOG(debug) << "processMesons " << mPhotons.size(); @@ -449,6 +671,12 @@ struct EmcalPi0Qc { if (meson.getOpeningAngle() > mMinOpenAngleCut) { mHistManager.fill(HIST("invMassVsPt"), meson.getMass(), meson.getPt()); + uint8_t sm1 = mPhotons[ig1].sm; + uint8_t sm2 = mPhotons[ig2].sm; + if (sm1 == sm2) { + fillSupermoduleHistogramsMeson(sm1, meson.getMass(), timeSinceSOR); + } + if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal) { mHistManager.fill(HIST("invMassVsPt_EMCal"), meson.getMass(), meson.getPt()); @@ -476,24 +704,28 @@ struct EmcalPi0Qc { } const double rotationAngle = o2::constants::math::PIHalf; // 0.78539816339; // rotaion angle 90° - TLorentzVector lvRotationPhoton1; // photon candidates which get rotated - TLorentzVector lvRotationPhoton2; // photon candidates which get rotated - TVector3 lvRotationPion; // rotation axis + ROOT::Math::PxPyPzEVector lvRotationPhoton1; // photon candidates which get rotated + ROOT::Math::PxPyPzEVector lvRotationPhoton2; // photon candidates which get rotated + ROOT::Math::PxPyPzEVector lvRotationPion; // rotation axis for (unsigned int ig3 = 0; ig3 < mPhotons.size(); ++ig3) { // continue if photons are identical if (ig3 == ig1 || ig3 == ig2) { continue; } - // calculate rotation axis - lvRotationPion = (meson.pMeson).Vect(); // initialize photons for rotation lvRotationPhoton1.SetPxPyPzE(mPhotons[ig1].px, mPhotons[ig1].py, mPhotons[ig1].pz, mPhotons[ig1].energy); lvRotationPhoton2.SetPxPyPzE(mPhotons[ig2].px, mPhotons[ig2].py, mPhotons[ig2].pz, mPhotons[ig2].energy); + lvRotationPion = meson.getMathVector(); + + // calculate rotation axis and matrix + lvRotationPion = lvRotationPhoton1 + lvRotationPhoton2; + ROOT::Math::AxisAngle rotationAxis(lvRotationPion.Vect(), rotationAngle); + ROOT::Math::Rotation3D rotationMatrix(rotationAxis); // rotate photons around rotation axis - lvRotationPhoton1.Rotate(rotationAngle, lvRotationPion); - lvRotationPhoton2.Rotate(rotationAngle, lvRotationPion); + lvRotationPhoton1 = rotationMatrix * lvRotationPhoton1; + lvRotationPhoton2 = rotationMatrix * lvRotationPhoton2; // initialize Photon objects for rotated photons Photon rotPhoton1(lvRotationPhoton1.Eta(), lvRotationPhoton1.Phi(), lvRotationPhoton1.E(), mPhotons[ig1].id); From ae2f69a0d3e7b8712f84d916e91b8749a3f923db Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Tue, 24 Mar 2026 17:09:18 +0100 Subject: [PATCH 046/282] [PWGCF] PID QA improved & PID efficiency added (#15504) Co-authored-by: Maxim Virta Co-authored-by: ALICE Action Bot --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 178 ++++++++++++-------- 1 file changed, 111 insertions(+), 67 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index a4ec7e0f3af..395cd59148b 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -105,6 +105,7 @@ struct FlowGfwV02 { O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") + O2_DEFINE_CONFIGURABLE(cfgPIDEfficiency, bool, false, "Use PID efficiency for efficiency calculation") O2_DEFINE_CONFIGURABLE(cfgFixedMultMin, int, 1, "Minimum for fixed nch range"); O2_DEFINE_CONFIGURABLE(cfgFixedMultMax, int, 3000, "Maximum for fixed nch range"); O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5f, "Minimum pt to use TOF N-sigma") @@ -186,7 +187,7 @@ struct FlowGfwV02 { Service ccdb; struct Config { - TH1D* mEfficiency = nullptr; + TH1D* mEfficiency[4] = {nullptr, nullptr, nullptr, nullptr}; GFWWeights* mAcceptance; bool correctionsLoaded = false; } cfg; @@ -306,17 +307,24 @@ struct FlowGfwV02 { pidStates.itsNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kITS]; if (cfgGetNsigmaQA) { - if (!cfgUseItsPID) { - registry.add("TofTpcNsigma_before", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); - registry.add("TofTpcNsigma_after", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); - } if (cfgUseItsPID) { - registry.add("TofItsNsigma_before", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaITS, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); - registry.add("TofItsNsigma_after", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaITS, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TofItsNsigma", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaITS, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); + } else { + registry.add("QA_PID/before/TofTpcNsigma_pions", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TofTpcNsigma_kaons", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TofTpcNsigma_protons", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); } - registry.add("TpcdEdx_ptwise", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("TpcdEdx_ptwise_afterCut", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/ExpSigma_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/ExpSigma_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/ExpSigma_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.addClone("QA_PID/before/", "QA_PID/after/"); } o2::analysis::gfw::regions.SetNames(cfgRegions->GetNames()); @@ -588,11 +596,22 @@ struct FlowGfwV02 { cfg.mAcceptance = ccdb->getForTimeStamp(cfgAcceptance.value, timestamp); } if (!cfgEfficiency.value.empty()) { - cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); - if (cfg.mEfficiency == nullptr) { + cfg.mEfficiency[PidCharged] = ccdb->getForTimeStamp(cfgEfficiency, timestamp); + if (cfg.mEfficiency[PidCharged] == nullptr) { LOGF(fatal, "Could not load efficiency histogram from %s", cfgEfficiency.value.c_str()); } - LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency); + LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency[PidCharged]); + } + if (cfgPIDEfficiency) { + const std::array pidStrings = {"ch", "pi", "ka", "pr"}; + for (int i = 1; i < 4; i++) { + + cfg.mEfficiency[i] = ccdb->getForTimeStamp(cfgEfficiency.value + pidStrings[i], timestamp); + if (cfg.mEfficiency[i] == nullptr) { + LOGF(fatal, "Could not load PID efficiency histogram from %s", cfgEfficiency.value + pidStrings[i].c_str()); + } + LOGF(info, "Loaded PID efficiency histogram from %s (%p)", cfgEfficiency.value + pidStrings[i].c_str(), (void*)cfg.mEfficiency[i]); + } } cfg.correctionsLoaded = true; } @@ -605,7 +624,7 @@ struct FlowGfwV02 { cfg.mAcceptance = ccdb->getForRun(cfgAcceptance.value, runnumber); } if (!cfgEfficiency.value.empty()) { - cfg.mEfficiency = ccdb->getForRun(cfgEfficiency.value, runnumber); + cfg.mEfficiency[PidCharged] = ccdb->getForRun(cfgEfficiency.value, runnumber); } cfg.correctionsLoaded = true; } @@ -638,66 +657,17 @@ struct FlowGfwV02 { } template - double getEfficiency(TTrack track) + double getEfficiency(TTrack track, const int& pid = PidCharged) { double eff = 1.; - if (cfg.mEfficiency) - eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(track.pt())); + if (cfg.mEfficiency[pid]) + eff = cfg.mEfficiency[pid]->GetBinContent(cfg.mEfficiency[pid]->FindBin(track.pt())); if (eff == 0) return -1.; else return 1. / eff; } - template - void fillNsigmaAfterCut(TTrack track1, Int_t pid) // function to fill the QA after Nsigma selection - { - switch (pid) { - case 1: // For Pions - if (!cfgUseItsPID) { - if (cfgGetdEdx) { - double tpcExpSignalPi = track1.tpcSignal() - (track1.tpcNSigmaPi() * track1.tpcExpSigmaPi()); - - registry.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaPi()); - registry.fill(HIST("ExpTpcdEdx_ptwise_afterCut"), track1.pt(), tpcExpSignalPi, track1.tofNSigmaPi()); - registry.fill(HIST("ExpSigma_ptwise_afterCut"), track1.pt(), track1.tpcExpSigmaPi(), track1.tofNSigmaPi()); - } - registry.fill(HIST("TofTpcNsigma_after"), track1.tpcNSigmaPi(), track1.tofNSigmaPi(), track1.pt()); - } - if (cfgUseItsPID) - registry.fill(HIST("TofItsNsigma_after"), pidStates.itsResponse.nSigmaITS(track1), track1.tofNSigmaPi(), track1.pt()); - break; - case 2: // For Kaons - if (!cfgUseItsPID) { - if (cfgGetdEdx) { - double tpcExpSignalKa = track1.tpcSignal() - (track1.tpcNSigmaKa() * track1.tpcExpSigmaKa()); - - registry.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaKa()); - registry.fill(HIST("ExpTpcdEdx_ptwise_afterCut"), track1.pt(), tpcExpSignalKa, track1.tofNSigmaKa()); - registry.fill(HIST("ExpSigma_ptwise_afterCut"), track1.pt(), track1.tpcExpSigmaKa(), track1.tofNSigmaKa()); - } - registry.fill(HIST("TofTpcNsigma_after"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt()); - } - if (cfgUseItsPID) - registry.fill(HIST("TofItsNsigma_after"), pidStates.itsResponse.nSigmaITS(track1), track1.tofNSigmaKa(), track1.pt()); - break; - case 3: // For Protons - if (!cfgUseItsPID) { - if (cfgGetdEdx) { - double tpcExpSignalPr = track1.tpcSignal() - (track1.tpcNSigmaPr() * track1.tpcExpSigmaPr()); - - registry.fill(HIST("TpcdEdx_ptwise_afterCut"), track1.pt(), track1.tpcSignal(), track1.tofNSigmaPr()); - registry.fill(HIST("ExpTpcdEdx_ptwise_afterCut"), track1.pt(), tpcExpSignalPr, track1.tofNSigmaPr()); - registry.fill(HIST("ExpSigma_ptwise_afterCut"), track1.pt(), track1.tpcExpSigmaPr(), track1.tofNSigmaPr()); - } - registry.fill(HIST("TofTpcNsigma_after"), track1.tpcNSigmaPr(), track1.tofNSigmaPr(), track1.pt()); - } - if (cfgUseItsPID) - registry.fill(HIST("TofItsNsigma_after"), pidStates.itsResponse.nSigmaITS(track1), track1.tofNSigmaPr(), track1.pt()); - break; - } // end of switch - } - template bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) { @@ -930,11 +900,14 @@ struct FlowGfwV02 { for (const auto& track : tracks) { processTrack(track, vtxz, xaxis.multiplicity, run, acceptedTracks); if (track.eta() > -0.4 && track.eta() < 0.4) - pidStates.hPtMid[PidCharged]->Fill(track.pt(), getEfficiency(track)); + pidStates.hPtMid[PidCharged]->Fill(track.pt(), getEfficiency(track, PidCharged)); // If PID is identified, fill pt spectrum for the corresponding particle int pidInd = getNsigmaPID(track); if (pidInd != -1 && track.eta() > -0.4 && track.eta() < 0.4) { - pidStates.hPtMid[pidInd]->Fill(track.pt(), getEfficiency(track)); // TODO: Add PID index to the efficiency histogram + if (cfgPIDEfficiency) + pidStates.hPtMid[pidInd]->Fill(track.pt(), getEfficiency(track, pidInd)); + else + pidStates.hPtMid[pidInd]->Fill(track.pt(), getEfficiency(track, PidCharged)); // Default to charged particles if PID efficiency is not used } } if (cfgConsistentEventFlag & 1) @@ -1005,6 +978,10 @@ struct FlowGfwV02 { fillTrackQA(track, vtxz); registry.fill(HIST("trackQA/before/nch_pt"), multiplicity, track.pt()); } + + if (cfgGetNsigmaQA) + fillPidQA(track, getNsigmaPID(track)); + if (!trackSelected(track)) return; @@ -1014,6 +991,9 @@ struct FlowGfwV02 { fillTrackQA(track, vtxz); registry.fill(HIST("trackQA/after/nch_pt"), multiplicity, track.pt()); } + + if (cfgGetNsigmaQA) + fillPidQA(track, getNsigmaPID(track)); } template @@ -1045,6 +1025,70 @@ struct FlowGfwV02 { return; } + template + inline void fillPidQA(TTrack track, const int& pid) + { + // Fill Nsigma QA + if (!cfgUseItsPID) { + if (ft == kBefore) { + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TofTpcNsigma_pions"), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt()); + if (cfgGetdEdx) { + double tpcExpSignalPi = track.tpcSignal() - (track.tpcNSigmaPi() * track.tpcExpSigmaPi()); + + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TpcdEdx_ptwise_pions"), track.pt(), track.tpcSignal(), track.tofNSigmaPi()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpTpcdEdx_ptwise_pions"), track.pt(), tpcExpSignalPi, track.tofNSigmaPi()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpSigma_ptwise_pions"), track.pt(), track.tpcExpSigmaPi(), track.tofNSigmaPi()); + } + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TofTpcNsigma_kaons"), track.tpcNSigmaKa(), track.tofNSigmaKa(), track.pt()); + if (cfgGetdEdx) { + double tpcExpSignalKa = track.tpcSignal() - (track.tpcNSigmaKa() * track.tpcExpSigmaKa()); + + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TpcdEdx_ptwise_kaons"), track.pt(), track.tpcSignal(), track.tofNSigmaKa()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpTpcdEdx_ptwise_kaons"), track.pt(), tpcExpSignalKa, track.tofNSigmaKa()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpSigma_ptwise_kaons"), track.pt(), track.tpcExpSigmaKa(), track.tofNSigmaKa()); + } + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TofTpcNsigma_protons"), track.tpcNSigmaPr(), track.tofNSigmaPr(), track.pt()); + if (cfgGetdEdx) { + double tpcExpSignalPr = track.tpcSignal() - (track.tpcNSigmaPr() * track.tpcExpSigmaPr()); + + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TpcdEdx_ptwise_protons"), track.pt(), track.tpcSignal(), track.tofNSigmaPr()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpTpcdEdx_ptwise_protons"), track.pt(), tpcExpSignalPr, track.tofNSigmaPr()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpSigma_ptwise_protons"), track.pt(), track.tpcExpSigmaPr(), track.tofNSigmaPr()); + } + } else if (ft == kAfter) { + if (pid == PidPions) { + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TofTpcNsigma_pions"), track.tpcNSigmaPi(), track.tofNSigmaPi(), track.pt()); + if (cfgGetdEdx) { + double tpcExpSignalPi = track.tpcSignal() - (track.tpcNSigmaPi() * track.tpcExpSigmaPi()); + + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TpcdEdx_ptwise_pions"), track.pt(), track.tpcSignal(), track.tofNSigmaPi()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpTpcdEdx_ptwise_pions"), track.pt(), tpcExpSignalPi, track.tofNSigmaPi()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpSigma_ptwise_pions"), track.pt(), track.tpcExpSigmaPi(), track.tofNSigmaPi()); + } + } + if (pid == PidKaons) { + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TofTpcNsigma_kaons"), track.tpcNSigmaKa(), track.tofNSigmaKa(), track.pt()); + if (cfgGetdEdx) { + double tpcExpSignalKa = track.tpcSignal() - (track.tpcNSigmaKa() * track.tpcExpSigmaKa()); + + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TpcdEdx_ptwise_kaons"), track.pt(), track.tpcSignal(), track.tofNSigmaKa()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpTpcdEdx_ptwise_kaons"), track.pt(), tpcExpSignalKa, track.tofNSigmaKa()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpSigma_ptwise_kaons"), track.pt(), track.tpcExpSigmaKa(), track.tofNSigmaKa()); + } + } + if (pid == PidProtons) { + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TofTpcNsigma_protons"), track.tpcNSigmaPr(), track.tofNSigmaPr(), track.pt()); + if (cfgGetdEdx) { + double tpcExpSignalPr = track.tpcSignal() - (track.tpcNSigmaPr() * track.tpcExpSigmaPr()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("TpcdEdx_ptwise_protons"), track.pt(), track.tpcSignal(), track.tofNSigmaPr()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpTpcdEdx_ptwise_protons"), track.pt(), tpcExpSignalPr, track.tofNSigmaPr()); + registry.fill(HIST("QA_PID/") + HIST(FillTimeName[ft]) + HIST("ExpSigma_ptwise_protons"), track.pt(), track.tpcExpSigmaPr(), track.tofNSigmaPr()); + } + } + } + } + } + template inline void fillTrackQA(TTrack track, const float vtxz) { From 8632fbd40167ccb942649080aa64b43bbc1a46f1 Mon Sep 17 00:00:00 2001 From: alicja-pp <101565842+alicja-pp@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:34:47 +0100 Subject: [PATCH 047/282] [PWGCF] FemtoUniverse: Check process that generated MC particle when processing fractions (#15503) --- .../TableProducer/femtoUniverseProducerTask.cxx | 9 +++++++-- .../femtoUniversePairTaskTrackTrackMultKtExtended.cxx | 6 ++++++ .../Tasks/femtoUniversePairTaskTrackV0Extended.cxx | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 649e0a6049c..c4186b34d83 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -884,6 +884,9 @@ struct FemtoUniverseProducerTask { if (particle.isPhysicalPrimary()) { return 0; } else if (particle.has_mothers()) { + if (particle.getProcess() == 20 || particle.getProcess() == 23) { // treat particles from hadronic scattering (20, 23) as primary + return 0; + } auto motherparticlesMC = particle.template mothers_as(); auto motherparticleMC = motherparticlesMC.front(); return motherparticleMC.pdgCode(); @@ -2142,6 +2145,7 @@ struct FemtoUniverseProducerTask { // instead of the bitmask, the PDG of the particle is stored as uint32_t int32_t variablePDG = confStoreMCmothers ? getMotherPDG(particle) : particle.pdgCode(); + int32_t variableCut = confStoreMCmothers ? particle.getProcess() : 0; // now the table is filled if constexpr (resolveDaughs) { @@ -2156,7 +2160,7 @@ struct FemtoUniverseProducerTask { particle.eta(), particle.phi(), aod::femtouniverseparticle::ParticleType::kMCTruthTrack, - 0, + variableCut, pdgCode, variablePDG, childIDs, @@ -2195,13 +2199,14 @@ struct FemtoUniverseProducerTask { } int32_t variablePDG = confStoreMCmothers ? getMotherPDG(particle) : particle.pdgCode(); + int32_t variableCut = confStoreMCmothers ? particle.getProcess() : 0; outputParts(outputCollision.lastIndex(), particle.pt(), particle.eta(), particle.phi(), aod::femtouniverseparticle::ParticleType::kMCTruthTrack, - 0, + variableCut, static_cast(particle.pdgCode()), variablePDG, childIDs, diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index 2fc0a3543b9..840f66fc56e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -366,6 +366,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { } if (doprocessFractionsMCTruth) { mixedMultRegistryPM.add("MCtruth/motherParticle", "pair fractions; part1 mother PDG; part2 mother PDG", {HistType::kTH2F, {{8001, -4000, 4000}, {8001, -4000, 4000}}}); + mixedMultRegistryPM.add("MCtruth/mcProcess", "pair ; part1 VMC physics code; part2 VMC physics code", {HistType::kTH2F, {{50, 0, 50}, {50, 0, 50}}}); } } @@ -376,6 +377,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { } if (doprocessFractionsMCTruth) { mixedMultRegistryPP.add("MCtruth/motherParticle", "pair fractions; part1 mother PDG; part2 mother PDG", {HistType::kTH2F, {{8001, -4000, 4000}, {8001, -4000, 4000}}}); + mixedMultRegistryPP.add("MCtruth/mcProcess", "pair ; part1 VMC physics code; part2 VMC physics code", {HistType::kTH2F, {{50, 0, 50}, {50, 0, 50}}}); } sameEventContPP.init(&resultRegistryPP, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, twotracksconfigs.confIsMC, twotracksconfigs.confUse3D); mixedEventContPP.init(&resultRegistryPP, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, twotracksconfigs.confIsMC, twotracksconfigs.confUse3D); @@ -395,6 +397,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { } if (doprocessFractionsMCTruth) { mixedMultRegistryMM.add("MCtruth/motherParticle", "pair fractions; part1 mother PDG; part2 mother PDG", {HistType::kTH2F, {{8001, -4000, 4000}, {8001, -4000, 4000}}}); + mixedMultRegistryMM.add("MCtruth/mcProcess", "pair ; part1 VMC physics code; part2 VMC physics code", {HistType::kTH2F, {{50, 0, 50}, {50, 0, 50}}}); } sameEventContMM.init(&resultRegistryMM, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, twotracksconfigs.confIsMC, twotracksconfigs.confUse3D); mixedEventContMM.init(&resultRegistryMM, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, twotracksconfigs.confIsMC, twotracksconfigs.confUse3D); @@ -955,6 +958,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo); if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == trackonefilter.confPDGCodePartOne) && (pdgCodePartTwo == tracktwofilter.confPDGCodePartTwo)) { mixedMultRegistryPM.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar()); + mixedMultRegistryPM.fill(HIST("MCtruth/mcProcess"), p1.cut(), p2.cut()); } } break; @@ -967,6 +971,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo); if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == trackonefilter.confPDGCodePartOne) && (pdgCodePartTwo == trackonefilter.confPDGCodePartOne)) { mixedMultRegistryPP.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar()); + mixedMultRegistryPP.fill(HIST("MCtruth/mcProcess"), p1.cut(), p2.cut()); } } break; @@ -979,6 +984,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { const auto& pdgParticleTwo = pdg->GetParticle(pdgCodePartTwo); if (pdgParticleOne && pdgParticleTwo && (pdgCodePartOne == tracktwofilter.confPDGCodePartTwo) && (pdgCodePartTwo == tracktwofilter.confPDGCodePartTwo)) { mixedMultRegistryMM.fill(HIST("MCtruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar()); + mixedMultRegistryMM.fill(HIST("MCtruth/mcProcess"), p1.cut(), p2.cut()); } } break; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index b49b9b98119..283f9b463d0 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -336,6 +336,7 @@ struct FemtoUniversePairTaskTrackV0Extended { if (doprocessPairFractionsMCTruthV0 || doprocessPairFractionsMCTruth) { registryMCtruth.add("mothersTruth/motherParticle", "pair fractions;part1 mother PDG;part2 mother PDG", {HistType::kTH2F, {confMotherPDGBins, confMotherPDGBins}}); + registryMCtruth.add("mothersTruth/mcProcess", "pair ; part1 VMC physics code; part2 VMC physics code", {HistType::kTH2F, {{50, 0, 50}, {50, 0, 50}}}); } // MC reco @@ -1547,6 +1548,7 @@ struct FemtoUniversePairTaskTrackV0Extended { continue; registryMCtruth.fill(HIST("mothersTruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar()); + registryMCtruth.fill(HIST("mothersTruth/mcProcess"), p1.cut(), p2.cut()); } }; @@ -1580,6 +1582,7 @@ struct FemtoUniversePairTaskTrackV0Extended { continue; registryMCtruth.fill(HIST("mothersTruth/motherParticle"), p1.tempFitVar(), p2.tempFitVar()); + registryMCtruth.fill(HIST("mothersTruth/mcProcess"), p1.cut(), p2.cut()); } }; From aff3c9da0978c5b96f57410cd918bdca0bf8a48d Mon Sep 17 00:00:00 2001 From: mapalhares <165794118+mapalhares@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:22:16 +0000 Subject: [PATCH 048/282] [PWGLF/NuSpEx] Saved tpcNClsCrossedRows inside the LFLnnTable + minor changes (#15507) --- PWGLF/DataModel/LFLnnTables.h | 6 ++-- PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx | 35 ++++++++++++++-------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/PWGLF/DataModel/LFLnnTables.h b/PWGLF/DataModel/LFLnnTables.h index 0865087e4e0..16f8a9fbba5 100644 --- a/PWGLF/DataModel/LFLnnTables.h +++ b/PWGLF/DataModel/LFLnnTables.h @@ -53,6 +53,8 @@ DECLARE_SOA_COLUMN(CosPA, cosPA, double); // Cos DECLARE_SOA_COLUMN(NSigma3H, nSigma3H, float); // Number of sigmas of the 3H daughter DECLARE_SOA_COLUMN(NTPCclus3H, nTPCclus3H, uint8_t); // Number of TPC clusters of the 3H daughter DECLARE_SOA_COLUMN(NTPCclusPi, nTPCclusPi, uint8_t); // Number of TPC clusters of the Pi daughter +DECLARE_SOA_COLUMN(NTPCNClsCrossedRows3H, nTPCclsCrossedRows3H, uint8_t); // Number of TPC clusters crossed rows of the 3H daughter +DECLARE_SOA_COLUMN(NTPCNClsCrossedRowsPi, nTPCclsCrossedRowsPi, uint8_t); // Number of TPC clusters crossed rows of the Pi daughter DECLARE_SOA_COLUMN(TPCsignal3H, tpcSignal3H, uint16_t); // TPC signal of the 3H daughter DECLARE_SOA_COLUMN(TPCsignalPi, tpcSignalPi, uint16_t); // TPC signal of the Pi daughter DECLARE_SOA_COLUMN(Flags, flags, uint8_t); // Flags for PID in tracking (bits [0, 3] for negative daughter, [4,7] for positive daughter) @@ -88,7 +90,7 @@ DECLARE_SOA_TABLE(DataLnnCands, "AOD", "LNNCANDS", lnnrec::PtPi, lnnrec::PhiPi, lnnrec::EtaPi, lnnrec::XDecVtx, lnnrec::YDecVtx, lnnrec::ZDecVtx, lnnrec::DcaV0Daug, lnnrec::Dca3H, lnnrec::DcaPi, - lnnrec::NSigma3H, lnnrec::NTPCclus3H, lnnrec::NTPCclusPi, + lnnrec::NSigma3H, lnnrec::NTPCclus3H, lnnrec::NTPCclusPi, lnnrec::NTPCNClsCrossedRows3H, lnnrec::NTPCNClsCrossedRowsPi, lnnrec::TPCmom3H, lnnrec::TPCmomPi, lnnrec::TPCsignal3H, lnnrec::TPCsignalPi, lnnrec::MassTrTOF, lnnrec::TPCchi3H, lnnrec::ITSclusterSizes3H, lnnrec::ITSclusterSizesPi, @@ -105,7 +107,7 @@ DECLARE_SOA_TABLE(MCLnnCands, "AOD", "MCLNNCANDS", lnnrec::XDecVtx, lnnrec::YDecVtx, lnnrec::ZDecVtx, lnnrec::DcaV0Daug, lnnrec::Dca3H, lnnrec::DcaPi, lnnrec::NSigma3H, lnnrec::NTPCclus3H, lnnrec::NTPCclusPi, - lnnrec::TPCmom3H, lnnrec::TPCmomPi, lnnrec::TPCsignal3H, lnnrec::TPCsignalPi, + lnnrec::TPCmom3H, lnnrec::TPCmomPi, lnnrec::TPCsignal3H, lnnrec::TPCsignalPi, lnnrec::NTPCNClsCrossedRows3H, lnnrec::NTPCNClsCrossedRowsPi, lnnrec::MassTrTOF, lnnrec::TPCchi3H, lnnrec::ITSclusterSizes3H, lnnrec::ITSclusterSizesPi, lnnrec::Flags, diff --git a/PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx b/PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx index 4e8d5fb205e..b932d8ba624 100644 --- a/PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx @@ -168,6 +168,8 @@ struct LnnCandidate { uint16_t tpcSignalPi = 0u; uint8_t nTPCClusters3H = 0u; uint8_t nTPCClustersPi = 0u; + uint8_t nTPCClustersCrossedRows3H = 0u; + uint8_t nTPCClustersCrossedRowsPi = 0u; uint32_t clusterSizeITS3H = 0u; uint32_t clusterSizeITSPi = 0u; bool isMatter = false; @@ -481,6 +483,7 @@ struct lnnRecoTask { auto& h3track = lnnCand.isMatter ? posTrack : negTrack; auto& pitrack = lnnCand.isMatter ? negTrack : posTrack; auto& h3Rigidity = lnnCand.isMatter ? posRigidity : negRigidity; + auto& piRigidity = lnnCand.isMatter ? negRigidity : posRigidity; // fill QA track histogram studies to check track signal before selections h2FT0CnClusTPCtoTrBfSel->Fill(collision.centFT0C(), h3track.tpcNClsFound()); @@ -514,16 +517,20 @@ struct lnnRecoTask { continue; } - lnnCand.tpcChi3H = lnnCand.isMatter ? h3track.tpcChi2NCl() : negTrack.tpcChi2NCl(); + lnnCand.tpcChi3H = h3track.tpcChi2NCl(); lnnCand.nSigma3H = lnnCand.isMatter ? nSigmaTPCpos : nSigmaTPCneg; - lnnCand.nTPCClusters3H = lnnCand.isMatter ? h3track.tpcNClsFound() : negTrack.tpcNClsFound(); - lnnCand.tpcSignal3H = lnnCand.isMatter ? h3track.tpcSignal() : negTrack.tpcSignal(); - lnnCand.clusterSizeITS3H = lnnCand.isMatter ? h3track.itsClusterSizes() : negTrack.itsClusterSizes(); - lnnCand.nTPCClustersPi = !lnnCand.isMatter ? h3track.tpcNClsFound() : negTrack.tpcNClsFound(); - lnnCand.tpcSignalPi = !lnnCand.isMatter ? h3track.tpcSignal() : negTrack.tpcSignal(); - lnnCand.clusterSizeITSPi = !lnnCand.isMatter ? h3track.itsClusterSizes() : negTrack.itsClusterSizes(); - lnnCand.mom3HTPC = lnnCand.isMatter ? posRigidity : negRigidity; - lnnCand.momPiTPC = !lnnCand.isMatter ? posRigidity : negRigidity; + lnnCand.nTPCClusters3H = h3track.tpcNClsFound(); + lnnCand.nTPCClustersCrossedRows3H = h3track.tpcNClsCrossedRows(); + lnnCand.tpcSignal3H = h3track.tpcSignal(); + lnnCand.clusterSizeITS3H = h3track.itsClusterSizes(); + + lnnCand.nTPCClustersPi = pitrack.tpcNClsFound(); + lnnCand.nTPCClustersCrossedRowsPi = pitrack.tpcNClsCrossedRows(); + lnnCand.tpcSignalPi = pitrack.tpcSignal(); + lnnCand.clusterSizeITSPi = pitrack.itsClusterSizes(); + + lnnCand.mom3HTPC = h3Rigidity; + lnnCand.momPiTPC = piRigidity; lnnCand.flags |= lnnCand.isMatter ? static_cast((posTrack.pidForTracking() & 0xF) << 4) : static_cast((negTrack.pidForTracking() & 0xF) << 4); lnnCand.flags |= lnnCand.isMatter ? static_cast(negTrack.pidForTracking() & 0xF) : static_cast(posTrack.pidForTracking() & 0xF); @@ -633,7 +640,9 @@ struct lnnRecoTask { // Fill 2D map after all selections hdEdx3HSel->Fill(chargeFactor * lnnCand.mom3HTPC, h3track.tpcSignal()); hdEdx3HPosTrack->Fill(lnnCand.mom3HTPC, h3track.tpcSignal()); - hdEdx3HNegTrack->Fill(-lnnCand.mom3HTPC, h3track.tpcSignal()); + if (!lnnCand.isMatter) { + hdEdx3HNegTrack->Fill(-lnnCand.mom3HTPC, h3track.tpcSignal()); + } hNsigma3HSel->Fill(chargeFactor * lnnCand.mom3HTPC, lnnCand.nSigma3H); if (h3track.hasTOF()) { h3HSignalPtTOF->Fill(chargeFactor * h3track.pt(), beta); @@ -788,7 +797,7 @@ struct lnnRecoTask { lnnCand.recoPtPi(), lnnCand.recoPhiPi(), lnnCand.recoEtaPi(), lnnCand.decVtx[0], lnnCand.decVtx[1], lnnCand.decVtx[2], lnnCand.dcaV0dau, lnnCand.h3DCAXY, lnnCand.piDCAXY, - lnnCand.nSigma3H, lnnCand.nTPCClusters3H, lnnCand.nTPCClustersPi, + lnnCand.nSigma3H, lnnCand.nTPCClusters3H, lnnCand.nTPCClustersPi, lnnCand.nTPCClustersCrossedRows3H, lnnCand.nTPCClustersCrossedRowsPi, lnnCand.mom3HTPC, lnnCand.momPiTPC, lnnCand.tpcSignal3H, lnnCand.tpcSignalPi, lnnCand.mass2TrTOF, lnnCand.tpcChi3H, lnnCand.clusterSizeITS3H, lnnCand.clusterSizeITSPi, lnnCand.flags); @@ -879,7 +888,7 @@ struct lnnRecoTask { lnnCand.recoPtPi(), lnnCand.recoPhiPi(), lnnCand.recoEtaPi(), lnnCand.decVtx[0], lnnCand.decVtx[1], lnnCand.decVtx[2], lnnCand.dcaV0dau, lnnCand.h3DCAXY, lnnCand.piDCAXY, - lnnCand.nSigma3H, lnnCand.nTPCClusters3H, lnnCand.nTPCClustersPi, + lnnCand.nSigma3H, lnnCand.nTPCClusters3H, lnnCand.nTPCClustersPi, lnnCand.nTPCClustersCrossedRows3H, lnnCand.nTPCClustersCrossedRowsPi, lnnCand.mom3HTPC, lnnCand.momPiTPC, lnnCand.tpcSignal3H, lnnCand.tpcSignalPi, lnnCand.mass2TrTOF, lnnCand.tpcChi3H, lnnCand.clusterSizeITS3H, lnnCand.clusterSizeITSPi, lnnCand.flags, @@ -966,7 +975,7 @@ struct lnnRecoTask { -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, From 9ae227e1859f8a7075021e46223cf7bc8817aabc Mon Sep 17 00:00:00 2001 From: lcernusa Date: Tue, 24 Mar 2026 21:17:42 +0100 Subject: [PATCH 049/282] [PWGCF] Flow-decorrelations ITS layers (#15511) --- .../Tasks/flowDecorrelation.cxx | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx index a2b7422f9f4..89bb63cc0cd 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx @@ -87,6 +87,7 @@ struct FlowDecorrelation { O2_DEFINE_CONFIGURABLE(cfgEvSelkIsGoodZvtxFT0vsPV, bool, false, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference, use this cut at low multiplicities with caution") O2_DEFINE_CONFIGURABLE(cfgEvSelkNoCollInTimeRangeStandard, bool, false, "no collisions in specified time range") O2_DEFINE_CONFIGURABLE(cfgEvSelkIsGoodITSLayersAll, bool, true, "cut time intervals with dead ITS staves") + O2_DEFINE_CONFIGURABLE(cfgEvSelkIsGoodITSLayer0123, bool, false, "cut time intervals with dead ITS staves (layers 0-3 only, for pp)") O2_DEFINE_CONFIGURABLE(cfgEvSelkNoCollInRofStandard, bool, false, "no other collisions in this Readout Frame with per-collision multiplicity above threshold") O2_DEFINE_CONFIGURABLE(cfgEvSelkNoHighMultCollInPrevRof, bool, false, "veto an event if FT0C amplitude in previous ITS ROF is above threshold") O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut") @@ -252,7 +253,7 @@ struct FlowDecorrelation { LOGF(info, "Starting init"); // Event Counter if ((doprocessSameTpcFt0a || doprocessSameTpcFt0c || doprocessSameFt0aFt0c || doprocessSameTpcMft || doprocessSameTpcFv0) && cfgUseAdditionalEventCut) { - registry.add("hEventCountSpecific", "Number of Event;; Count", {HistType::kTH1D, {{12, 0, 12}}}); + registry.add("hEventCountSpecific", "Number of Event;; Count", {HistType::kTH1D, {{13, 0, 13}}}); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(1, "after sel8"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(2, "kNoSameBunchPileup"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(3, "kNoITSROFrameBorder"); @@ -260,11 +261,12 @@ struct FlowDecorrelation { registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(5, "kIsGoodZvtxFT0vsPV"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(6, "kNoCollInTimeRangeStandard"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(7, "kIsGoodITSLayersAll"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(8, "kNoCollInRofStandard"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(9, "kNoHighMultCollInPrevRof"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(10, "occupancy"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(11, "MultCorrelation"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(12, "cfgEvSelV0AT0ACut"); + registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(8, "kIsGoodITSLayer0123"); + registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(9, "kNoCollInRofStandard"); + registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(10, "kNoHighMultCollInPrevRof"); + registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(11, "occupancy"); + registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(12, "MultCorrelation"); + registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(13, "cfgEvSelV0AT0ACut"); } if (cfgEvSelMultCorrelation) { @@ -917,23 +919,29 @@ struct FlowDecorrelation { } if (fillCounter && cfgEvSelkIsGoodITSLayersAll) registry.fill(HIST("hEventCountSpecific"), 6.5); + if (cfgEvSelkIsGoodITSLayer0123 && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer0123)) { + // for pp: cut time intervals with dead ITS staves on layers 0-3 only + return 0; + } + if (fillCounter && cfgEvSelkIsGoodITSLayer0123) + registry.fill(HIST("hEventCountSpecific"), 7.5); if (cfgEvSelkNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { // no other collisions in this Readout Frame with per-collision multiplicity above threshold return 0; } if (fillCounter && cfgEvSelkNoCollInRofStandard) - registry.fill(HIST("hEventCountSpecific"), 7.5); + registry.fill(HIST("hEventCountSpecific"), 8.5); if (cfgEvSelkNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { // veto an event if FT0C amplitude in previous ITS ROF is above threshold return 0; } if (fillCounter && cfgEvSelkNoHighMultCollInPrevRof) - registry.fill(HIST("hEventCountSpecific"), 8.5); + registry.fill(HIST("hEventCountSpecific"), 9.5); auto occupancy = collision.trackOccupancyInTimeRange(); if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) return 0; if (fillCounter && cfgEvSelOccupancy) - registry.fill(HIST("hEventCountSpecific"), 9.5); + registry.fill(HIST("hEventCountSpecific"), 10.5); auto multNTracksPV = collision.multNTracksPV(); if (cfgEvSelMultCorrelation) { @@ -963,14 +971,14 @@ struct FlowDecorrelation { } } if (fillCounter && cfgEvSelMultCorrelation) - registry.fill(HIST("hEventCountSpecific"), 10.5); + registry.fill(HIST("hEventCountSpecific"), 11.5); // V0A T0A 5 sigma cut float sigma = 5.0; if (cfgEvSelV0AT0ACut && (std::fabs(collision.multFV0A() - cfgFuncParas.fT0AV0AMean->Eval(collision.multFT0A())) > sigma * cfgFuncParas.fT0AV0ASigma->Eval(collision.multFT0A()))) return 0; if (fillCounter && cfgEvSelV0AT0ACut) - registry.fill(HIST("hEventCountSpecific"), 11.5); + registry.fill(HIST("hEventCountSpecific"), 12.5); return 1; } From 7814a61f205a45d74a2c4fad180063bd05f94bd1 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:40:05 +0100 Subject: [PATCH 050/282] [PWGLF] Improve event mixing to avoid edge effect (#15512) --- .../Strangeness/lambdaspincorrderived.cxx | 619 +++++++++++------- 1 file changed, 370 insertions(+), 249 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index 01a5bdc73b9..e5f7a59e3d4 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -214,9 +214,7 @@ struct lambdaspincorrderived { Configurable nKinematicEta{"nKinematicEta", 1.0, "Number of eta buffer bins"}; Configurable nKinematicPhi{"nKinematicPhi", 1.0, "Number of phi buffer bins"}; } cfgKinematicBins; - - Configurable ptMinMixBuffer{"ptMinMixBuffer", 0.7, "Minimum V0 pT for mix buffer"}; - Configurable ptMaxMixBuffer{"ptMaxMixBuffer", 4.1, "Maximum V0 pT for mix buffer"}; + Configurable> massMixEdges{"massMixEdges", {1.09f, 1.108f, 1.122f, 1.14f}, "Mass-mixing region edges: [SB low | signal | SB high]"}; Configurable cfgMixLegMode{"cfgMixLegMode", 0, "0=replace leg-1 only, 1=replace leg-2 only, 2=do both one-leg replacements"}; Configurable cfgV5MassBins{"cfgV5MassBins", 5, "Number of fixed mass bins for V5 mixing"}; Configurable cfgV5NeighborPt{"cfgV5NeighborPt", 0, "v5: neighbor bins in pT (use symmetric ±N, edge-safe)"}; @@ -488,88 +486,6 @@ struct lambdaspincorrderived { return true; } - template - bool checkPairKinematics(TA const& A, TB const& B, TC const& C) - { - if (!usePairKineMatch) { - return true; - } - - const auto lA = ROOT::Math::PtEtaPhiMVector(A.lambdaPt(), A.lambdaEta(), A.lambdaPhi(), A.lambdaMass()); - const auto lB = ROOT::Math::PtEtaPhiMVector(B.lambdaPt(), B.lambdaEta(), B.lambdaPhi(), B.lambdaMass()); - const auto lC = ROOT::Math::PtEtaPhiMVector(C.lambdaPt(), C.lambdaEta(), C.lambdaPhi(), C.lambdaMass()); - - // relative pT inside the pair: |pT1 - pT2| - const float dPtAB = std::abs(A.lambdaPt() - B.lambdaPt()); - const float dPtCB = std::abs(C.lambdaPt() - B.lambdaPt()); - if (std::abs(dPtAB - dPtCB) > ptMix) { - return false; - } - - // relative longitudinal kinematics: |Δy| or |Δη| - if (userapidity) { - const float dYAB = std::abs(lA.Rapidity() - lB.Rapidity()); - const float dYCB = std::abs(lC.Rapidity() - lB.Rapidity()); - if (std::abs(dYAB - dYCB) > etaMix) { - return false; - } - } else { - const float dEtaAB = std::abs(A.lambdaEta() - B.lambdaEta()); - const float dEtaCB = std::abs(C.lambdaEta() - B.lambdaEta()); - if (std::abs(dEtaAB - dEtaCB) > etaMix) { - return false; - } - } - - // relative azimuth inside the pair: |Δφ| - const float dPhiAB = std::abs(deltaPhiMinusPiToPi((float)A.lambdaPhi(), (float)B.lambdaPhi())); - const float dPhiCB = std::abs(deltaPhiMinusPiToPi((float)C.lambdaPhi(), (float)B.lambdaPhi())); - if (std::abs(dPhiAB - dPhiCB) > phiMix) { - return false; - } - - return true; - } - template - bool checkPairKinematicsMC(TA const& A, TB const& B, TC const& C) - { - if (!usePairKineMatch) { - return true; - } - - const auto lA = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(A), mcacc::lamEta(A), mcacc::lamPhi(A), mcacc::lamMass(A)); - const auto lB = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(B), mcacc::lamEta(B), mcacc::lamPhi(B), mcacc::lamMass(B)); - const auto lC = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(C), mcacc::lamEta(C), mcacc::lamPhi(C), mcacc::lamMass(C)); - - const float dPtAB = std::abs(mcacc::lamPt(A) - mcacc::lamPt(B)); - const float dPtCB = std::abs(mcacc::lamPt(C) - mcacc::lamPt(B)); - if (std::abs(dPtAB - dPtCB) > ptMix) { - return false; - } - - if (userapidity) { - const float dYAB = std::abs(lA.Rapidity() - lB.Rapidity()); - const float dYCB = std::abs(lC.Rapidity() - lB.Rapidity()); - if (std::abs(dYAB - dYCB) > etaMix) { - return false; - } - } else { - const float dEtaAB = std::abs(mcacc::lamEta(A) - mcacc::lamEta(B)); - const float dEtaCB = std::abs(mcacc::lamEta(C) - mcacc::lamEta(B)); - if (std::abs(dEtaAB - dEtaCB) > etaMix) { - return false; - } - } - - const float dPhiAB = std::abs(deltaPhiMinusPiToPi((float)mcacc::lamPhi(A), (float)mcacc::lamPhi(B))); - const float dPhiCB = std::abs(deltaPhiMinusPiToPi((float)mcacc::lamPhi(C), (float)mcacc::lamPhi(B))); - if (std::abs(dPhiAB - dPhiCB) > phiMix) { - return false; - } - - return true; - } - void fillHistograms(int tag1, int tag2, const ROOT::Math::PtEtaPhiMVector& particle1, const ROOT::Math::PtEtaPhiMVector& particle2, const ROOT::Math::PtEtaPhiMVector& daughpart1, const ROOT::Math::PtEtaPhiMVector& daughpart2, @@ -853,6 +769,24 @@ struct lambdaspincorrderived { } } + template + static inline bool hasSharedDaughters(const A& a, const B& b) + { + return (a.protonIndex() == b.protonIndex()) || + (a.pionIndex() == b.pionIndex()) || + (a.protonIndex() == b.pionIndex()) || + (a.pionIndex() == b.protonIndex()); + } + + template + static inline bool hasSharedDaughtersMC(const A& a, const B& b) + { + return (a.protonIndexmc() == b.protonIndexmc()) || + (a.pionIndexmc() == b.pionIndexmc()) || + (a.protonIndexmc() == b.pionIndexmc()) || + (a.pionIndexmc() == b.protonIndexmc()); + } + ROOT::Math::PtEtaPhiMVector lambda0, proton0; ROOT::Math::PtEtaPhiMVector lambda, proton; ROOT::Math::PtEtaPhiMVector lambda2, proton2; @@ -882,18 +816,8 @@ struct lambdaspincorrderived { if (!selectionV0(v02)) { continue; } - if (v0.protonIndex() == v02.protonIndex()) { - continue; - } - if (v0.pionIndex() == v02.pionIndex()) { - continue; - } - if (v0.protonIndex() == v02.pionIndex()) { - continue; - } - if (v0.pionIndex() == v02.protonIndex()) { + if (hasSharedDaughters(v0, v02)) continue; - } proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton); lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass()); histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi)); @@ -1011,19 +935,8 @@ struct lambdaspincorrderived { if (t2.index() <= t1.index()) { continue; } - - if (t1.protonIndex() == t2.protonIndex()) { - continue; - } - if (t1.pionIndex() == t2.pionIndex()) { - continue; - } - if (t1.protonIndex() == t2.pionIndex()) { - continue; - } - if (t1.pionIndex() == t2.protonIndex()) { + if (hasSharedDaughters(t1, t2)) continue; - } const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); @@ -1065,13 +978,13 @@ struct lambdaspincorrderived { } if (doMixLeg1) { - if (checkKinematics(t1, tX) && checkPairKinematics(t1, t2, tX)) { + if (checkKinematics(t1, tX)) { ++nRepl1; } } if (doMixLeg2) { - if (checkKinematics(t2, tX) && checkPairKinematics(t2, t1, tX)) { + if (checkKinematics(t2, tX)) { ++nRepl2; } } @@ -1099,7 +1012,7 @@ struct lambdaspincorrderived { // -------- leg-1 replacement: (tX, t2) if (doMixLeg1) { - if (checkKinematics(t1, tX) && checkPairKinematics(t1, t2, tX)) { + if (checkKinematics(t1, tX)) { fillReplacementControlMap(tX.v0Status(), t2.v0Status(), 1, false, ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()), wBase); @@ -1126,7 +1039,7 @@ struct lambdaspincorrderived { // -------- leg-2 replacement: (t1, tX) if (doMixLeg2) { - if (checkKinematics(t2, tX) && checkPairKinematics(t2, t1, tX)) { + if (checkKinematics(t2, tX)) { fillReplacementControlMap(t1.v0Status(), tX.v0Status(), 2, false, ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()), wBase); @@ -1175,7 +1088,6 @@ struct lambdaspincorrderived { if (nMixEvents <= 0 || matches.empty()) { return; } - std::vector kept; kept.reserve(matches.size()); @@ -1188,7 +1100,6 @@ struct lambdaspincorrderived { usedEvents.insert(m.collisionIdx); } } - matches.swap(kept); } @@ -1436,21 +1347,8 @@ struct lambdaspincorrderived { if (!selectionV0MC(v02)) { continue; } - - // no shared daughters - if (mcacc::prIdx(v0) == mcacc::prIdx(v02)) { - continue; - } - if (mcacc::piIdx(v0) == mcacc::piIdx(v02)) { - continue; - } - if (mcacc::prIdx(v0) == mcacc::piIdx(v02)) { + if (hasSharedDaughtersMC(v0, v02)) continue; - } - if (mcacc::piIdx(v0) == mcacc::prIdx(v02)) { - continue; - } - proton2 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(v02), mcacc::prEta(v02), mcacc::prPhi(v02), o2::constants::physics::MassProton); lambda2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(v02), mcacc::lamEta(v02), mcacc::lamPhi(v02), @@ -1499,19 +1397,8 @@ struct lambdaspincorrderived { if (t2.index() <= t1.index()) { continue; } - - if (mcacc::prIdx(t1) == mcacc::prIdx(t2)) { - continue; - } - if (mcacc::piIdx(t1) == mcacc::piIdx(t2)) { + if (hasSharedDaughtersMC(t1, t2)) continue; - } - if (mcacc::prIdx(t1) == mcacc::piIdx(t2)) { - continue; - } - if (mcacc::piIdx(t1) == mcacc::prIdx(t2)) { - continue; - } const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); @@ -1553,13 +1440,13 @@ struct lambdaspincorrderived { } if (doMixLeg1) { - if (checkKinematicsMC(t1, tX) && checkPairKinematicsMC(t1, t2, tX)) { + if (checkKinematicsMC(t1, tX)) { ++nRepl1; } } if (doMixLeg2) { - if (checkKinematicsMC(t2, tX) && checkPairKinematicsMC(t2, t1, tX)) { + if (checkKinematicsMC(t2, tX)) { ++nRepl2; } } @@ -1587,7 +1474,7 @@ struct lambdaspincorrderived { // -------- leg-1 replacement: (tX, t2) if (doMixLeg1) { - if (checkKinematicsMC(t1, tX) && checkPairKinematicsMC(t1, t2, tX)) { + if (checkKinematicsMC(t1, tX)) { fillReplacementControlMap(mcacc::v0Status(tX), mcacc::v0Status(t2), 1, false, ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), wBase); @@ -1614,7 +1501,7 @@ struct lambdaspincorrderived { // -------- leg-2 replacement: (t1, tX) if (doMixLeg2) { - if (checkKinematicsMC(t2, tX) && checkPairKinematicsMC(t2, t1, tX)) { + if (checkKinematicsMC(t2, tX)) { fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(tX), 2, false, ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), wBase); @@ -1650,6 +1537,7 @@ struct lambdaspincorrderived { } } PROCESS_SWITCH(lambdaspincorrderived, processMCMEV3, "Process MC ME v3 FIFO", false); + static inline float phi0To2Pi(float phi) { // harmonic=1, min=0 => [0, 2pi) @@ -1684,7 +1572,6 @@ struct lambdaspincorrderived { std::sort(out.begin(), out.end()); out.erase(std::unique(out.begin(), out.end()), out.end()); } - static inline void collectNeighborBinsClamp(int b, int nBins, int nNeighbor, std::vector& out) { out.clear(); @@ -1696,7 +1583,43 @@ struct lambdaspincorrderived { } } } + static inline int getMassRegionFromEdges(float m, const std::vector& edges) + { + if (edges.size() != 4) { + return -1; + } + + if (m >= edges[0] && m < edges[1]) + return 0; // low sideband + if (m >= edges[1] && m < edges[2]) + return 1; // signal + if (m >= edges[2] && m < edges[3]) + return 2; // high sideband + + return -1; + } + static inline int getMassMixClassFromEdges(float m, const std::vector& edges) + { + // no mass separation + if (edges.size() == 2) { + if (m >= edges[0] && m < edges[1]) + return 0; + return -1; + } + + // 3 regions: SB low, signal, SB high + if (edges.size() == 4) { + if (m >= edges[0] && m < edges[1]) + return 0; // low sideband + if (m >= edges[1] && m < edges[2]) + return 1; // signal + if (m >= edges[2] && m < edges[3]) + return 0; // high sideband merged with low sideband + return -1; + } + return -1; + } static inline uint64_t splitmix64(uint64_t x) { // simple deterministic hash for reproducible shuffling @@ -1712,7 +1635,7 @@ struct lambdaspincorrderived { ptMin.value, ptMax.value, ptMix.value, - v0eta.value, + v0etaMixBuffer.value, etaMix.value, phiMix.value, MassMin.value, @@ -1759,7 +1682,7 @@ struct lambdaspincorrderived { } const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), 0.0, harmonic)); - const int mB = mb.massBin(t.lambdaMass()); + const int mB = getMassMixClassFromEdges(t.lambdaMass(), massMixEdges.value); const int rB = mb.radiusBin(t.v0Radius()); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0 || rB < 0) { @@ -1807,48 +1730,103 @@ struct lambdaspincorrderived { } const int phiB = mb.phiBin(RecoDecay::constrainAngle(tRep.lambdaPhi(), 0.0, harmonic)); - const int mB = mb.massBin(tRep.lambdaMass()); + const int mB = getMassMixClassFromEdges(tRep.lambdaMass(), massMixEdges.value); const int rB = mb.radiusBin(tRep.v0Radius()); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0 || rB < 0) { return; } + auto collectFromBins = [&](const std::vector& ptUseBins, + const std::vector& etaUseBins, + const std::vector& phiUseBins) { + for (int ptUse : ptUseBins) { + for (int etaUse : etaUseBins) { + for (int phiUse : phiUseBins) { + const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB, + nStat, nPt, nEta, nPhi, nM, nR)]; + + for (auto const& bc : vec) { + if (bc.collisionIdx == curColIdx) + continue; + + auto tX = V0s.iteratorAt(static_cast(bc.rowIndex)); + + if (!selectionV0(tX)) + continue; + if (!checkKinematics(tRep, tX)) + continue; + + if (tX.globalIndex() == tRep.globalIndex()) + continue; + if (tX.globalIndex() == tKeep.globalIndex()) + continue; + + if (hasSharedDaughters(tX, tKeep)) + continue; + if (hasSharedDaughters(tX, tRep)) + continue; + + matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); + } + } + } + } + }; - collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBins); - collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBins); - collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBins); + matches.clear(); - for (int ptUse : ptBins) { - for (int etaUse : etaBins) { - for (int phiUse : phiBins) { - const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB, - nStat, nPt, nEta, nPhi, nM, nR)]; + // 1) exact bin first + ptBins.clear(); + etaBins.clear(); + phiBins.clear(); - for (auto const& bc : vec) { - if (bc.collisionIdx == curColIdx) { - continue; - } + ptBins.push_back(ptB); + etaBins.push_back(etaB); + phiBins.push_back(phiB); - auto tX = V0s.iteratorAt(static_cast(bc.rowIndex)); + collectFromBins(ptBins, etaBins, phiBins); - if (!selectionV0(tX)) { - continue; - } - if (!checkKinematics(tRep, tX)) { - continue; - } - if (!checkPairKinematics(tRep, tKeep, tX)) { - continue; - } + // 2) if exact bin gives fewer than required matches, also search neighbors + const int targetMatches = (cfgV5MaxMatches.value > 0) ? cfgV5MaxMatches.value : 1; - if (tX.globalIndex() == tRep.globalIndex()) { - continue; - } - if (tX.globalIndex() == tKeep.globalIndex()) { + if ((int)matches.size() < targetMatches) { + std::vector ptBinsN, etaBinsN, phiBinsN; + collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBinsN); + collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBinsN); + collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBinsN); + + for (int ptUse : ptBinsN) { + for (int etaUse : etaBinsN) { + for (int phiUse : phiBinsN) { + if (ptUse == ptB && etaUse == etaB && phiUse == phiB) continue; - } - matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); + const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB, + nStat, nPt, nEta, nPhi, nM, nR)]; + + for (auto const& bc : vec) { + if (bc.collisionIdx == curColIdx) + continue; + + auto tX = V0s.iteratorAt(static_cast(bc.rowIndex)); + + if (!selectionV0(tX)) + continue; + if (!checkKinematics(tRep, tX)) + continue; + + if (tX.globalIndex() == tRep.globalIndex()) + continue; + if (tX.globalIndex() == tKeep.globalIndex()) + continue; + + if (hasSharedDaughters(tX, tKeep)) + continue; + if (hasSharedDaughters(tX, tRep)) + continue; + + matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); + } } } } @@ -1895,20 +1873,8 @@ struct lambdaspincorrderived { if (t2.index() <= t1.index()) { continue; } - - if (t1.protonIndex() == t2.protonIndex()) { - continue; - } - if (t1.pionIndex() == t2.pionIndex()) { - continue; - } - if (t1.protonIndex() == t2.pionIndex()) { + if (hasSharedDaughters(t1, t2)) continue; - } - if (t1.pionIndex() == t2.protonIndex()) { - continue; - } - const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); @@ -1940,15 +1906,70 @@ struct lambdaspincorrderived { ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass()), 1.0f); } - const int nReuse = static_cast(matches1.size() + matches2.size()); - if (nReuse <= 0) { + int nFill1 = 0; + int nFill2 = 0; + // count actual accepted fills for leg-1 replacement + if (doMixLeg1) { + for (auto const& m : matches1) { + auto tX = V0s.iteratorAt(static_cast(m.rowIndex)); + if (!selectionV0(tX)) + continue; + if (!checkKinematics(t1, tX)) + continue; + if (tX.globalIndex() == t1.globalIndex()) + continue; + if (tX.globalIndex() == t2.globalIndex()) + continue; + if (hasSharedDaughters(tX, t2)) + continue; + if (hasSharedDaughters(tX, t1)) + continue; + ++nFill1; + } + } + + // count actual accepted fills for leg-2 replacement + if (doMixLeg2) { + for (auto const& m : matches2) { + auto tY = V0s.iteratorAt(static_cast(m.rowIndex)); + if (!checkKinematics(t2, tY)) + continue; + if (!selectionV0(tY)) + continue; + if (tY.globalIndex() == t2.globalIndex()) + continue; + if (tY.globalIndex() == t1.globalIndex()) + continue; + if (hasSharedDaughters(tY, t2)) + continue; + if (hasSharedDaughters(tY, t1)) + continue; + ++nFill2; + } + } + + if (nFill1 <= 0 && nFill2 <= 0) { continue; } - const float wSE = 1.0f / static_cast(nReuse); + const int nUse = nFill1 + nFill2; + const float wSE = (nUse > 0) ? 1.0f / static_cast(nUse) : 0.0f; - if (doMixLeg1) { + if (doMixLeg1 && nFill1 > 0) { for (auto const& m : matches1) { auto tX = V0s.iteratorAt(static_cast(m.rowIndex)); + if (!selectionV0(tX)) { + continue; + } + if (!checkKinematics(t1, tX)) + continue; + if (tX.globalIndex() == t1.globalIndex()) + continue; + if (tX.globalIndex() == t2.globalIndex()) + continue; + if (hasSharedDaughters(tX, t1)) + continue; + if (hasSharedDaughters(tX, t2)) + continue; fillReplacementControlMap(tX.v0Status(), t2.v0Status(), 1, false, ROOT::Math::PtEtaPhiMVector(tX.lambdaPt(), tX.lambdaEta(), tX.lambdaPhi(), tX.lambdaMass()), wSE); @@ -1976,9 +1997,22 @@ struct lambdaspincorrderived { } } - if (doMixLeg2) { + if (doMixLeg2 && nFill2 > 0) { for (auto const& m : matches2) { auto tY = V0s.iteratorAt(static_cast(m.rowIndex)); + if (!selectionV0(tY)) { + continue; + } + if (!checkKinematics(t2, tY)) + continue; + if (tY.globalIndex() == t2.globalIndex()) + continue; + if (tY.globalIndex() == t1.globalIndex()) + continue; + if (hasSharedDaughters(tY, t1)) + continue; + if (hasSharedDaughters(tY, t2)) + continue; fillReplacementControlMap(t1.v0Status(), tY.v0Status(), 2, false, ROOT::Math::PtEtaPhiMVector(tY.lambdaPt(), tY.lambdaEta(), tY.lambdaPhi(), tY.lambdaMass()), wSE); @@ -2015,7 +2049,7 @@ struct lambdaspincorrderived { ptMin.value, ptMax.value, ptMix.value, - v0eta.value, + v0etaMixBuffer.value, etaMix.value, phiMix.value, MassMin.value, @@ -2062,7 +2096,7 @@ struct lambdaspincorrderived { } const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), 0.0, harmonic)); - const int mB = mb.massBin(mcacc::lamMass(t)); + const int mB = getMassMixClassFromEdges(mcacc::lamMass(t), massMixEdges.value); const int rB = mb.radiusBin(mcacc::v0Radius(t)); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0 || rB < 0) { @@ -2110,51 +2144,79 @@ struct lambdaspincorrderived { } const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(tRep), 0.0, harmonic)); - const int mB = mb.massBin(mcacc::lamMass(tRep)); + const int mB = getMassMixClassFromEdges(mcacc::lamMass(tRep), massMixEdges.value); const int rB = mb.radiusBin(mcacc::v0Radius(tRep)); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0 || rB < 0) { return; } + auto collectFromBins = [&](const std::vector& ptUseBins, + const std::vector& etaUseBins, + const std::vector& phiUseBins) { + for (int ptUse : ptUseBins) { + for (int etaUse : etaUseBins) { + for (int phiUse : phiUseBins) { + const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB, + nStat, nPt, nEta, nPhi, nM, nR)]; + + for (auto const& bc : vec) { + if (bc.collisionIdx == curColIdx) + continue; + + auto tX = V0sMC.iteratorAt(static_cast(bc.rowIndex)); + + if (!selectionV0MC(tX)) + continue; + if (!checkKinematicsMC(tRep, tX)) + continue; + + if (tX.globalIndex() == tRep.globalIndex()) + continue; + if (tX.globalIndex() == tKeep.globalIndex()) + continue; + + if (hasSharedDaughtersMC(tX, tKeep)) + continue; + if (hasSharedDaughtersMC(tX, tRep)) + continue; + + matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); + } + } + } + } + }; - collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBins); - collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBins); - collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBins); + matches.clear(); + // 1) try exact bin only + ptBins.clear(); + etaBins.clear(); + phiBins.clear(); - for (int ptUse : ptBins) { - for (int etaUse : etaBins) { - for (int phiUse : phiBins) { - const auto& vec = buffer[linearKeyR(colBin, status, ptUse, etaUse, phiUse, mB, rB, - nStat, nPt, nEta, nPhi, nM, nR)]; + ptBins.push_back(ptB); + etaBins.push_back(etaB); + phiBins.push_back(phiB); - for (auto const& bc : vec) { - if (bc.collisionIdx == curColIdx) { - continue; - } + collectFromBins(ptBins, etaBins, phiBins); - auto tX = V0sMC.iteratorAt(static_cast(bc.rowIndex)); + // 2) if exact bin does not give enough, top up from neighbors + const int targetMatches = (cfgV5MaxMatches.value > 0) ? cfgV5MaxMatches.value : 1; - if (!selectionV0MC(tX)) { - continue; - } - if (!checkKinematicsMC(tRep, tX)) { - continue; - } - if (!checkPairKinematicsMC(tRep, tKeep, tX)) { - continue; - } + if ((int)matches.size() < targetMatches) { + collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBins); + collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBins); + collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBins); - if (tX.globalIndex() == tRep.globalIndex()) { - continue; - } - if (tX.globalIndex() == tKeep.globalIndex()) { - continue; - } + collectFromBins(ptBins, etaBins, phiBins); + } - matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); - } - } - } + // if nothing found, then try neighboring bins + if (matches.empty()) { + collectNeighborBinsClamp(ptB, nPt, nN_pt, ptBins); + collectNeighborBinsClamp(etaB, nEta, nN_eta, etaBins); + collectNeighborBinsPhi(phiB, nPhi, nN_phi, phiBins); + + collectFromBins(ptBins, etaBins, phiBins); } std::sort(matches.begin(), matches.end(), @@ -2198,20 +2260,8 @@ struct lambdaspincorrderived { if (t2.index() <= t1.index()) { continue; } - - if (mcacc::prIdx(t1) == mcacc::prIdx(t2)) { - continue; - } - if (mcacc::piIdx(t1) == mcacc::piIdx(t2)) { + if (hasSharedDaughtersMC(t1, t2)) continue; - } - if (mcacc::prIdx(t1) == mcacc::piIdx(t2)) { - continue; - } - if (mcacc::piIdx(t1) == mcacc::prIdx(t2)) { - continue; - } - const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); @@ -2241,19 +2291,77 @@ struct lambdaspincorrderived { 1.0f); } - const int nReuse = static_cast(matches1.size() + matches2.size()); - if (nReuse <= 0) { - continue; + int nFill1 = 0; + int nFill2 = 0; + + // count actual accepted fills for leg-1 replacement + if (doMixLeg1) { + for (auto const& m : matches1) { + auto tX = V0sMC.iteratorAt(static_cast(m.rowIndex)); + + if (!selectionV0MC(tX)) + continue; + if (!checkKinematicsMC(t1, tX)) + continue; + if (tX.globalIndex() == t1.globalIndex()) + continue; + if (tX.globalIndex() == t2.globalIndex()) + continue; + if (hasSharedDaughtersMC(tX, t1)) + continue; + if (hasSharedDaughtersMC(tX, t2)) + continue; + ++nFill1; + } } - const float wSE = 1.0f / static_cast(nReuse); + // count actual accepted fills for leg-2 replacement + if (doMixLeg2) { + for (auto const& m : matches2) { + auto tY = V0sMC.iteratorAt(static_cast(m.rowIndex)); - if (doMixLeg1) { + if (!selectionV0MC(tY)) + continue; + if (!checkKinematicsMC(t2, tY)) + continue; + if (tY.globalIndex() == t2.globalIndex()) + continue; + if (tY.globalIndex() == t1.globalIndex()) + continue; + if (hasSharedDaughtersMC(tY, t1)) + continue; + if (hasSharedDaughtersMC(tY, t2)) + continue; + ++nFill2; + } + } + + if (nFill1 <= 0 && nFill2 <= 0) { + continue; + } + const int nUse = nFill1 + nFill2; + const float wSE = (nUse > 0) ? 1.0f / static_cast(nUse) : 0.0f; + + if (doMixLeg1 && nFill1 > 0) { for (auto const& m : matches1) { auto tX = V0sMC.iteratorAt(static_cast(m.rowIndex)); + + if (!selectionV0MC(tX)) + continue; + if (!checkKinematicsMC(t1, tX)) + continue; + if (tX.globalIndex() == t1.globalIndex()) + continue; + if (tX.globalIndex() == t2.globalIndex()) + continue; + if (hasSharedDaughtersMC(tX, t1)) + continue; + if (hasSharedDaughtersMC(tX, t2)) + continue; fillReplacementControlMap(mcacc::v0Status(tX), mcacc::v0Status(t2), 1, false, ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), wSE); + auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), o2::constants::physics::MassProton); auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), @@ -2283,13 +2391,26 @@ struct lambdaspincorrderived { 1, meWeight, 1); } } - - if (doMixLeg2) { + if (doMixLeg2 && nFill2 > 0) { for (auto const& m : matches2) { auto tY = V0sMC.iteratorAt(static_cast(m.rowIndex)); + + if (!selectionV0MC(tY)) + continue; + if (!checkKinematicsMC(t2, tY)) + continue; + if (tY.globalIndex() == t2.globalIndex()) + continue; + if (tY.globalIndex() == t1.globalIndex()) + continue; + if (hasSharedDaughtersMC(tY, t1)) + continue; + if (hasSharedDaughtersMC(tY, t2)) + continue; fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(tY), 2, false, ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tY), mcacc::lamEta(tY), mcacc::lamPhi(tY), mcacc::lamMass(tY)), wSE); + auto p1 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t1), mcacc::prEta(t1), mcacc::prPhi(t1), o2::constants::physics::MassProton); auto l1 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), From 487bdb10f8d2bfdcdb0fae135c0c7006eb22c4d9 Mon Sep 17 00:00:00 2001 From: sandor-lokos <69418976+sandor-lokos@users.noreply.github.com> Date: Tue, 24 Mar 2026 23:40:36 +0100 Subject: [PATCH 051/282] [PWGUD] Fit bit implementation (#15510) Co-authored-by: amatyja --- PWGUD/Core/CMakeLists.txt | 8 ++ PWGUD/Core/FITCutParHolder.cxx | 55 +++++++++ PWGUD/Core/FITCutParHolder.h | 75 ++++++++++++ PWGUD/Core/FITCutParHolderLinkDef.h | 24 ++++ PWGUD/Core/SGCutParHolderLinkDef.h | 1 + PWGUD/Core/UDHelpers.h | 156 +++++++++++++++++++++++++ PWGUD/DataModel/UDTables.h | 25 ++++ PWGUD/TableProducer/CMakeLists.txt | 2 +- PWGUD/TableProducer/SGCandProducer.cxx | 120 ++++++------------- PWGUD/Tasks/CMakeLists.txt | 5 + PWGUD/Tasks/upcTestFITBitMapping.cxx | 113 ++++++++++++++++++ 11 files changed, 499 insertions(+), 85 deletions(-) create mode 100644 PWGUD/Core/FITCutParHolder.cxx create mode 100644 PWGUD/Core/FITCutParHolder.h create mode 100644 PWGUD/Core/FITCutParHolderLinkDef.h create mode 100644 PWGUD/Tasks/upcTestFITBitMapping.cxx diff --git a/PWGUD/Core/CMakeLists.txt b/PWGUD/Core/CMakeLists.txt index 7686edd8eea..3a7fe0950cf 100644 --- a/PWGUD/Core/CMakeLists.txt +++ b/PWGUD/Core/CMakeLists.txt @@ -64,3 +64,11 @@ o2physics_add_library(decayTree o2physics_target_root_dictionary(decayTree HEADERS decayTree.h LINKDEF decayTreeLinkDef.h) + +o2physics_add_library(FITCutParHolder + SOURCES FITCutParHolder.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore) + +o2physics_target_root_dictionary(FITCutParHolder + HEADERS FITCutParHolder.h + LINKDEF FITCutParHolderLinkDef.h) \ No newline at end of file diff --git a/PWGUD/Core/FITCutParHolder.cxx b/PWGUD/Core/FITCutParHolder.cxx new file mode 100644 index 00000000000..d57e2c8e12f --- /dev/null +++ b/PWGUD/Core/FITCutParHolder.cxx @@ -0,0 +1,55 @@ +// 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. +// +// \FIT bit thresholds +// \author Sandor Lokos, sandor.lokos@cern.ch +// \since March 2026 + +#include "FITCutParHolder.h" + +// setter +void FITCutParHolder::SetSaveFITbitsets(bool saveFITbitsets) +{ + mSaveFITbitsets = saveFITbitsets; +} +void FITCutParHolder::SetThr1FV0A(float thr1_FV0A) +{ + mThr1FV0A = thr1_FV0A; +} +void FITCutParHolder::SetThr1FT0A(float thr1_FT0A) +{ + mThr1FT0A = thr1_FT0A; +} +void FITCutParHolder::SetThr1FT0C(float thr1_FT0C) +{ + mThr1FT0C = thr1_FT0C; +} +void FITCutParHolder::SetThr2FV0A(float thr2_FV0A) +{ + mThr2FV0A = thr2_FV0A; +} +void FITCutParHolder::SetThr2FT0A(float thr2_FT0A) +{ + mThr2FT0A = thr2_FT0A; +} +void FITCutParHolder::SetThr2FT0C(float thr2_FT0C) +{ + mThr2FT0C = thr2_FT0C; +} + +// getter +bool FITCutParHolder::saveFITbitsets() const { return mSaveFITbitsets; } +float FITCutParHolder::thr1_FV0A() const { return mThr1FV0A; } +float FITCutParHolder::thr1_FT0A() const { return mThr1FT0A; } +float FITCutParHolder::thr1_FT0C() const { return mThr1FT0C; } +float FITCutParHolder::thr2_FV0A() const { return mThr2FV0A; } +float FITCutParHolder::thr2_FT0A() const { return mThr2FT0A; } +float FITCutParHolder::thr2_FT0C() const { return mThr2FT0C; } diff --git a/PWGUD/Core/FITCutParHolder.h b/PWGUD/Core/FITCutParHolder.h new file mode 100644 index 00000000000..e03c4161c27 --- /dev/null +++ b/PWGUD/Core/FITCutParHolder.h @@ -0,0 +1,75 @@ +// 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. +// +// \FIT bit thresholds +// \author Sandor Lokos, sandor.lokos@cern.ch +// \since March 2026 + +#ifndef PWGUD_CORE_FITCUTPARHOLDER_H_ +#define PWGUD_CORE_FITCUTPARHOLDER_H_ + +#include + +// object to hold customizable FIT bit thresholds +class FITCutParHolder +{ + public: + // constructor + FITCutParHolder(bool saveFITbitsets = true, + float thr1_FV0A = 8., + float thr1_FT0A = 8., + float thr1_FT0C = 8., + float thr2_FV0A = 20., + float thr2_FT0A = 20., + float thr2_FT0C = 20.) + : mSaveFITbitsets{saveFITbitsets}, + mThr1FV0A{thr1_FV0A}, + mThr1FT0A{thr1_FT0A}, + mThr1FT0C{thr1_FT0C}, + mThr2FV0A{thr2_FV0A}, + mThr2FT0A{thr2_FT0A}, + mThr2FT0C{thr2_FT0C} + { + } + + // setters + void SetSaveFITbitsets(bool); + void SetThr1FV0A(float); + void SetThr1FT0A(float); + void SetThr1FT0C(float); + void SetThr2FV0A(float); + void SetThr2FT0A(float); + void SetThr2FT0C(float); + + // getters + bool saveFITbitsets() const; + float thr1_FV0A() const; + float thr1_FT0A() const; + float thr1_FT0C() const; + float thr2_FV0A() const; + float thr2_FT0A() const; + float thr2_FT0C() const; + + private: + bool mSaveFITbitsets; + + float mThr1FV0A; + float mThr1FT0A; + float mThr1FT0C; + + float mThr2FV0A; + float mThr2FT0A; + float mThr2FT0C; + + ClassDefNV(FITCutParHolder, 1); +}; + +#endif // PWGUD_CORE_FITCUTPARHOLDER_H_ diff --git a/PWGUD/Core/FITCutParHolderLinkDef.h b/PWGUD/Core/FITCutParHolderLinkDef.h new file mode 100644 index 00000000000..3194a6754b2 --- /dev/null +++ b/PWGUD/Core/FITCutParHolderLinkDef.h @@ -0,0 +1,24 @@ +// 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. +// +// \FIT bit thresholds +// \author Sandor Lokos, sandor.lokos@cern.ch +// \since March 2026 + +#ifndef PWGUD_CORE_FITCUTPARHOLDERLINKDEF_H_ +#define PWGUD_CORE_FITCUTPARHOLDERLINKDEF_H_ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +#pragma link C++ class FITCutParHolder + ; + +#endif // PWGUD_CORE_FITCUTPARHOLDERLINKDEF_H_ diff --git a/PWGUD/Core/SGCutParHolderLinkDef.h b/PWGUD/Core/SGCutParHolderLinkDef.h index f9216fa0c37..5dcadadc69e 100644 --- a/PWGUD/Core/SGCutParHolderLinkDef.h +++ b/PWGUD/Core/SGCutParHolderLinkDef.h @@ -8,6 +8,7 @@ // 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. + #ifndef PWGUD_CORE_SGCUTPARHOLDERLINKDEF_H_ #define PWGUD_CORE_SGCUTPARHOLDERLINKDEF_H_ diff --git a/PWGUD/Core/UDHelpers.h b/PWGUD/Core/UDHelpers.h index 1248164dd0f..73a3efcd775 100644 --- a/PWGUD/Core/UDHelpers.h +++ b/PWGUD/Core/UDHelpers.h @@ -19,6 +19,7 @@ #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -29,6 +30,7 @@ #include "TLorentzVector.h" +#include #include #include @@ -533,6 +535,160 @@ bool FITveto(T const& bc, DGCutparHolder const& diffCuts) return false; } +inline void setBit(uint64_t w[4], int bit, bool val) +{ + if (!val) { + return; + } + const int word = bit >> 6; + const int offs = bit & 63; + w[word] |= (static_cast(1) << offs); +} + +template +inline void buildFT0FV0Words(TFT0 const& ft0, TFV0A const& fv0a, + uint64_t thr1[4], uint64_t thr2[4], + float thr1_FT0A = 25., float thr1_FT0C = 50., float thr1_FV0A = 50., + float thr2_FT0A = 50., float thr2_FT0C = 100., float thr2_FV0A = 100.) +{ + thr1[0] = thr1[1] = thr1[2] = thr1[3] = 0ull; + thr2[0] = thr2[1] = thr2[2] = thr2[3] = 0ull; + + constexpr int kFT0AOffset = 0; + constexpr int kFT0COffset = 96; + constexpr int kFV0Offset = 208; + + auto ampsA = ft0.amplitudeA(); + const int nA = std::min(ampsA.size(), 96); + for (int i = 0; i < nA; ++i) { + const auto a = ampsA[i]; + setBit(thr1, kFT0AOffset + i, a >= thr1_FT0A); + setBit(thr2, kFT0AOffset + i, a >= thr2_FT0A); + } + + auto ampsC = ft0.amplitudeC(); + const int nC = std::min(ampsC.size(), 112); + for (int i = 0; i < nC; ++i) { + const auto a = ampsC[i]; + setBit(thr1, kFT0COffset + i, a >= thr1_FT0C); + setBit(thr2, kFT0COffset + i, a >= thr2_FT0C); + } + + auto ampsV = fv0a.amplitude(); + const int nV = std::min(ampsV.size(), 48); + for (int i = 0; i < nV; ++i) { + const auto a = ampsV[i]; + setBit(thr1, kFV0Offset + i, a >= thr1_FV0A); + setBit(thr2, kFV0Offset + i, a >= thr2_FV0A); + } +} + +// ----------------------------------------------------------------------------- +// return eta and phi of a given FIT channel based on the bitset +// Bit layout contract: +constexpr int kFT0Bits = 208; // FT0 total channels +constexpr int kFV0Bits = 48; // FV0A channels +constexpr int kTotalBits = 256; // 4*64 + +// FT0 side split +constexpr int kFT0AChannels = 96; // FT0A channels are [0..95] +constexpr int kFT0CChannels = 112; // FT0C channels are [96..207] +static_assert(kFT0AChannels + kFT0CChannels == kFT0Bits); + +using Bits256 = std::array; + +inline Bits256 makeBits256(uint64_t w0, uint64_t w1, uint64_t w2, uint64_t w3) +{ + return {w0, w1, w2, w3}; +} + +inline bool testBit(Bits256 const& w, int bit) +{ + if (bit < 0 || bit >= kTotalBits) { + return false; + } + return (w[bit >> 6] >> (bit & 63)) & 1ULL; +} + +struct FitBitRef { + enum class Det : uint8_t { FT0, + FV0, + Unknown }; + Det det = Det::Unknown; + int ch = -1; // FT0: 0..207, FV0: 0..47 + bool isC = false; // only meaningful for FT0 +}; + +inline FitBitRef decodeFitBit(int bit) +{ + FitBitRef out; + if (bit >= 0 && bit < kFT0Bits) { + out.det = FitBitRef::Det::FT0; + out.ch = bit; // FT0 channel id + out.isC = (bit >= kFT0AChannels); // C side if in upper range + return out; + } + if (bit >= kFT0Bits && bit < kTotalBits) { + out.det = FitBitRef::Det::FV0; + out.ch = bit - kFT0Bits; // FV0A channel id 0..47 + return out; + } + return out; +} + +template +inline double getPhiFT0_fromChannel(FT0DetT& ft0Det, int ft0Ch, OffsetsT const& offsetFT0, int i) +{ + ft0Det.calculateChannelCenter(); + auto chPos = ft0Det.getChannelCenter(ft0Ch); + + const double x = chPos.X() + offsetFT0[i].getX(); + const double y = chPos.Y() + offsetFT0[i].getY(); + + return RecoDecay::phi(x, y); +} + +template +inline double getEtaFT0_fromChannel(FT0DetT& ft0Det, int ft0Ch, OffsetsT const& offsetFT0, int i) +{ + ft0Det.calculateChannelCenter(); + auto chPos = ft0Det.getChannelCenter(ft0Ch); + + double x = chPos.X() + offsetFT0[i].getX(); + double y = chPos.Y() + offsetFT0[i].getY(); + double z = chPos.Z() + offsetFT0[i].getZ(); + + // If this channel belongs to FT0C, flip z (matches your original intent) + const bool isC = (ft0Ch >= kFT0AChannels); + if (isC) { + z = -z; + } + + const double r = std::sqrt(x * x + y * y); + const double theta = std::atan2(r, z); + return -std::log(std::tan(0.5 * theta)); +} + +template +inline bool getPhiEtaFromFitBit(FT0DetT& ft0Det, + int bit, + OffsetsT const& offsetFT0, + int iRunOffset, + double& phi, + double& eta) +{ + auto ref = decodeFitBit(bit); + if (ref.det != FitBitRef::Det::FT0) { + return false; + } + + // FT0A: 0..95, FT0C: 96..207 + const int ft0Ch = bit; + phi = getPhiFT0_fromChannel(ft0Det, ft0Ch, offsetFT0, iRunOffset); + eta = getEtaFT0_fromChannel(ft0Det, ft0Ch, offsetFT0, iRunOffset); + return true; +} + // ----------------------------------------------------------------------------- template diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index 65fdc63eb4b..774bb31751a 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -407,6 +407,31 @@ DECLARE_SOA_TABLE(UDTracksFlags, "AOD", "UDTRACKFLAG", DECLARE_SOA_TABLE(UDTracksLabels, "AOD", "UDTRACKLABEL", udtrack::TrackId); +namespace udcollfitbits +{ +DECLARE_SOA_COLUMN(Thr1W0, thr1W0, uint64_t); /// 1 MIP thresholds for FT0A ch 0 - ch 63 +DECLARE_SOA_COLUMN(Thr1W1, thr1W1, uint64_t); /// 1 MIP thresholds for FT0A ch 64 - ch 96 & FT0C ch 0 - ch 31 +DECLARE_SOA_COLUMN(Thr1W2, thr1W2, uint64_t); /// 1 MIP thresholds for FT0C ch 32 - ch 96 +DECLARE_SOA_COLUMN(Thr1W3, thr1W3, uint64_t); /// 1 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47 + +DECLARE_SOA_COLUMN(Thr2W0, thr2W0, uint64_t); /// 2 MIP thresholds for FT0A ch 0 - ch 63 +DECLARE_SOA_COLUMN(Thr2W1, thr2W1, uint64_t); /// 2 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31 +DECLARE_SOA_COLUMN(Thr2W2, thr2W2, uint64_t); /// 2 MIP thresholds for FT0C ch 32 - ch 96 +DECLARE_SOA_COLUMN(Thr2W3, thr2W3, uint64_t); /// 2 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47 +} // namespace udcollfitbits + +DECLARE_SOA_TABLE(UDCollisionFITBits, "AOD", "UDCOLLFITBITS", + o2::soa::Index<>, + udcollfitbits::Thr1W0, /// 1 MIP thresholds for FT0A ch 0 - ch 63 + udcollfitbits::Thr1W1, /// 1 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31 + udcollfitbits::Thr1W2, /// 1 MIP thresholds for FT0C ch 32 - ch 96 + udcollfitbits::Thr1W3, /// 1 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47 + udcollfitbits::Thr2W0, /// 2 MIP thresholds for FT0A ch 0 - ch 63 + udcollfitbits::Thr2W1, /// 2 MIP thresholds for FT0A ch 63 - ch 96 & FT0C ch 0 - ch 31 + udcollfitbits::Thr2W2, /// 2 MIP thresholds for FT0C ch 32 - ch 96 + udcollfitbits::Thr2W3 /// 2 MIP thresholds for FT0C ch 97 - 112 & FV0 0 - 47 +); + using UDTrack = UDTracks::iterator; using UDTrackCov = UDTracksCov::iterator; using UDTrackExtra = UDTracksExtra::iterator; diff --git a/PWGUD/TableProducer/CMakeLists.txt b/PWGUD/TableProducer/CMakeLists.txt index fb3bd5e2275..c16870f0603 100644 --- a/PWGUD/TableProducer/CMakeLists.txt +++ b/PWGUD/TableProducer/CMakeLists.txt @@ -18,7 +18,7 @@ o2physics_add_dpl_workflow(dg-cand-producer o2physics_add_dpl_workflow(sgcand-producer SOURCES SGCandProducer.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::SGCutParHolder O2Physics::AnalysisCCDB + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::SGCutParHolder O2Physics::AnalysisCCDB O2Physics::FITCutParHolder COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dgbccand-producer diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index 888dbfb608e..b2702b54546 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -12,12 +12,13 @@ /// \file SGCandProducer.cxx /// \brief Produces PWGUD derived table from standard tables /// -/// \author Alexander Bylinkin , Uniersity of Bergen -/// \since 23.11.2023 +/// \author Alexander Bylinkin , University of Bergen +/// \since 23.11.2023 /// \author Adam Matyja , INP PAN Krakow, Poland -/// \since May 2025 +/// \since May 2025 // +#include "PWGUD/Core/FITCutParHolder.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" @@ -41,6 +42,7 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Vertex.h" +#include #include #include #include @@ -75,6 +77,8 @@ struct SGCandProducer { // get an SGCutparHolder SGCutParHolder sameCuts = SGCutParHolder(); // SGCutparHolder Configurable SGCuts{"SGCuts", {}, "SG event cuts"}; + FITCutParHolder fitCuts = FITCutParHolder(); + Configurable FITCuts{"FITCuts", {}, "FIT bitset 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"}; @@ -87,6 +91,8 @@ struct SGCandProducer { Configurable storeSG{"storeSG", true, "Store SG events in the output"}; Configurable storeDG{"storeDG", true, "Store DG events in the output"}; + Configurable saveFITbitsets{"saveFITbitsets", true, "Write FT0 and FV0 bitset tables to output"}; + Configurable isGoodRCTCollision{"isGoodRCTCollision", true, "Check RCT flags for FT0,ITS,TPC and tracking"}; Configurable isGoodRCTZdc{"isGoodRCTZdc", false, "Check RCT flags for ZDC if present in run"}; @@ -94,7 +100,7 @@ struct SGCandProducer { Configurable fillTrackTables{"fillTrackTables", true, "Fill track tables"}; Configurable fillFwdTrackTables{"fillFwdTrackTables", true, "Fill forward track tables"}; - // SG selector + // SG selector SGSelector sgSelector; ctpRateFetcher mRateFetcher; @@ -119,6 +125,7 @@ struct SGCandProducer { Produces outputFwdTracks; Produces outputFwdTracksExtra; Produces outputTracksLabel; + Produces outputFITBits; // initialize histogram registry HistogramRegistry registry{ @@ -205,78 +212,6 @@ struct SGCandProducer { outputTracksLabel(track.globalIndex()); } - // function to process trigger counters, accounting for BC selection bits - void processCountersTrg(BCs const& bcs, aod::FT0s const&, aod::Zdcs const&) - { - const auto& firstBc = bcs.iteratorAt(0); - if (runNumber != firstBc.runNumber()) - runNumber = firstBc.runNumber(); - - auto hCountersTrg = getHist(TH1, "reco/hCountersTrg"); - auto hCountersTrgBcSel = getHist(TH1, "reco/hCountersTrgBcSel"); - auto hLumi = getHist(TH1, "reco/hLumi"); - auto hLumiBcSel = getHist(TH1, "reco/hLumiBcSel"); - - // Cross sections in ub. Using dummy -1 if lumi estimator is not reliable - float csTCE = 10.36e6; - const float csZEM = 415.2e6; // see AN: https://alice-notes.web.cern.ch/node/1515 - const float csZNC = 214.5e6; // see AN: https://alice-notes.web.cern.ch/node/1515 - if (runNumber > 543437 && runNumber < 543514) { - csTCE = 8.3e6; - } - if (runNumber >= 543514) { - csTCE = 4.10e6; // see AN: https://alice-notes.web.cern.ch/node/1515 - } - - for (const auto& bc : bcs) { - bool hasFT0 = bc.has_foundFT0(); - bool hasZDC = bc.has_foundZDC(); - if (!hasFT0 && !hasZDC) - continue; - bool isSelectedBc = true; - if (rejectAtTFBoundary && !bc.selection_bit(aod::evsel::kNoTimeFrameBorder)) - isSelectedBc = false; - if (noITSROFrameBorder && !bc.selection_bit(aod::evsel::kNoITSROFrameBorder)) - isSelectedBc = false; - if (hasFT0) { - auto ft0TrgMask = bc.ft0().triggerMask(); - if (TESTBIT(ft0TrgMask, o2::fit::Triggers::bitVertex)) { - hCountersTrg->Fill("TVX", 1); - if (isSelectedBc) - hCountersTrgBcSel->Fill("TVX", 1); - } - if (TESTBIT(ft0TrgMask, o2::fit::Triggers::bitVertex) && TESTBIT(ft0TrgMask, o2::fit::Triggers::bitCen)) { - hCountersTrg->Fill("TCE", 1); - hLumi->Fill("TCE", 1. / csTCE); - if (isSelectedBc) { - hCountersTrgBcSel->Fill("TCE", 1); - hLumiBcSel->Fill("TCE", 1. / csTCE); - } - } - } - if (hasZDC) { - if (bc.selection_bit(aod::evsel::kIsBBZNA) || bc.selection_bit(aod::evsel::kIsBBZNC)) { - hCountersTrg->Fill("ZEM", 1); - hLumi->Fill("ZEM", 1. / csZEM); - if (isSelectedBc) { - hCountersTrgBcSel->Fill("ZEM", 1); - hLumiBcSel->Fill("ZEM", 1. / csZEM); - } - } - if (bc.selection_bit(aod::evsel::kIsBBZNC)) { - hCountersTrg->Fill("ZNC", 1); - hLumi->Fill("ZNC", 1. / csZNC); - if (isSelectedBc) { - hCountersTrgBcSel->Fill("ZNC", 1); - hLumiBcSel->Fill("ZNC", 1. / csZNC); - } - } - } - } - } - - PROCESS_SWITCH(SGCandProducer, processCountersTrg, "Produce trigger counters and luminosity histograms", true); - // function to process reconstructed data template void processReco(std::string histdir, TCol const& collision, BCs const& bcs, @@ -284,8 +219,7 @@ struct SGCandProducer { aod::FV0As const& fv0as, aod::FT0s const& ft0s, aod::FDDs const& fdds) { if (verboseInfo) - LOGF(debug, " collision %d", collision.globalIndex()); - + LOGF(debug, " collision %d", collision.globalIndex()); getHist(TH1, histdir + "/Stat")->Fill(0., 1.); // reject collisions at TF boundaries if (rejectAtTFBoundary && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { @@ -393,6 +327,23 @@ struct SGCandProducer { if (verboseInfo) LOGF(info, "%s Coll GID %d", histdir, collision.globalIndex()); outputCollsLabels(collision.globalIndex()); + + uint64_t w1[4] = {0ull, 0ull, 0ull, 0ull}; + uint64_t w2[4] = {0ull, 0ull, 0ull, 0ull}; + + if (fitCuts.saveFITbitsets() && newbc.has_foundFT0() && newbc.has_fv0a()) { + udhelpers::buildFT0FV0Words(newbc.ft0(), newbc.fv0a(), w1, w2, + fitCuts.thr1_FT0A(), + fitCuts.thr1_FT0C(), + fitCuts.thr1_FV0A(), + fitCuts.thr2_FT0A(), + fitCuts.thr2_FT0C(), + fitCuts.thr2_FV0A()); + } + + outputFITBits(w1[0], w1[1], w1[2], w1[3], + w2[0], w2[1], w2[2], w2[3]); + if (newbc.has_zdc()) { auto zdc = newbc.zdc(); udZdcsReduced(outputCollisions.lastIndex(), zdc.timeZNA(), zdc.timeZNC(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); @@ -408,7 +359,7 @@ struct SGCandProducer { } else if (saveAllTracks) { if (track.itsClusterSizes() && track.itsChi2NCl() > 0 && ((track.tpcNClsFindable() == 0 && savenonPVCITSOnlyTracks) || track.tpcNClsFindable() > 50)) updateUDTrackTables(outputCollisions.lastIndex(), track, bc.globalBC()); - // if (track.isPVContributor()) updateUDTrackTables(outputCollisions.lastIndex(), track, bc.globalBC()); + // if (track.isPVContributor()) updateUDTrackTables(outputCollisions.lastIndex(), track, bc.globalBC()); } } } @@ -431,6 +382,7 @@ struct SGCandProducer { ccdb->setCaching(true); ccdb->setFatalWhenNull(false); sameCuts = (SGCutParHolder)SGCuts; + fitCuts = (FITCutParHolder)FITCuts; // add histograms for the different process functions histPointers.clear(); @@ -592,7 +544,7 @@ struct McSGCandProducer { for (const auto& oldmid : oldmids) { auto m = McParts.rawIteratorAt(oldmid); if (verboseInfoMC) - LOGF(debug, " m %d", m.globalIndex()); + LOGF(debug, "m %d", m.globalIndex()); if (mcPartIsSaved.find(oldmid) != mcPartIsSaved.end()) { newval = mcPartIsSaved[oldmid]; } else { @@ -741,7 +693,7 @@ struct McSGCandProducer { if (mcsgId >= 0 && mcOfInterest) { if (mcColIsSaved.find(mcsgId) == mcColIsSaved.end()) { if (verboseInfoMC) - LOGF(info, " Saving McCollision %d", mcsgId); + LOGF(info, "Saving McCollision %d", mcsgId); // update UDMcCollisions auto sgcandMcCol = sgcand.collision_as().mcCollision(); updateUDMcCollisions(sgcandMcCol, globBC); @@ -762,7 +714,7 @@ struct McSGCandProducer { // If the sgcand has no associated McCollision then only the McParticles which are associated // with the tracks of the sgcand are saved if (verboseInfoMC) - LOGF(info, " Saving McCollision %d", -1); + LOGF(info, "Saving McCollision %d", -1); // update UDMcColsLabels (for each UDCollision -> UDMcCollisions) outputMcCollsLabels(-1); @@ -804,7 +756,7 @@ struct McSGCandProducer { // but only consider generated events of interest if (mcOfInterest && mcColIsSaved.find(mccolId) == mcColIsSaved.end()) { if (verboseInfoMC) - LOGF(info, " Saving McCollision %d", mccolId); + LOGF(info, "Saving McCollision %d", mccolId); // update UDMcCollisions updateUDMcCollisions(mccol, globBC); mcColIsSaved[mccolId] = outputMcCollisions.lastIndex(); @@ -848,7 +800,7 @@ struct McSGCandProducer { // update UDMcCollisions and UDMcParticles if (mcColIsSaved.find(mccolId) == mcColIsSaved.end()) { if (verboseInfoMC) - LOGF(info, " Saving McCollision %d", mccolId); + LOGF(info, "Saving McCollision %d", mccolId); // update UDMcCollisions updateUDMcCollisions(mccol, globBC); diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index 62c6abc732f..d8aa575b906 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -268,3 +268,8 @@ o2physics_add_dpl_workflow(sg-exclusive-jpsi-midrapidity SOURCES sgExclusiveJpsiMidrapidity.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(fitbit-mapping + SOURCES upcTestFITBitMapping.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGUD/Tasks/upcTestFITBitMapping.cxx b/PWGUD/Tasks/upcTestFITBitMapping.cxx new file mode 100644 index 00000000000..8456c46dc85 --- /dev/null +++ b/PWGUD/Tasks/upcTestFITBitMapping.cxx @@ -0,0 +1,113 @@ +// 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. +// +// \FIT bits to phi, eta mapping +// \author Sandor Lokos, sandor.lokos@cern.ch +// \since March 2026 + +#include "PWGUD/Core/UDHelpers.h" // udhelpers::Bits256, makeBits256, testBit, getPhiEtaFromFitBit +#include "PWGUD/DataModel/UDTables.h" // aod::UDCollisionFITBits + +#include "FT0Base/Geometry.h" // o2::ft0::Geometry +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include +#include + +using namespace o2; +using namespace o2::framework; + +struct UpcTestFITBitMapping { + Configurable whichThr{"whichThr", 1, "Use 1=Thr1 bits or 2=Thr2 bits"}; + Configurable maxEvents{"maxEvents", -1, "Process at most this many rows (-1 = all)"}; + + // Minimal offset container compatible with UDHelpers.h expectations: getX/getY/getZ + struct OffsetXYZ { + double x{0}, y{0}, z{0}; + double getX() const { return x; } + double getY() const { return y; } + double getZ() const { return z; } + }; + + std::array offsetFT0{}; // iRunOffset = 0 for now + int iRunOffset = 0; + + o2::ft0::Geometry ft0Det{}; + + HistogramRegistry registry{ + "registry", + { + {"hPhiA", "FT0A #varphi;#varphi;counts", {HistType::kTH1F, {{18, 0.0, 2. * M_PI}}}}, + {"hEtaA", "FT0A #eta;#eta;counts", {HistType::kTH1F, {{8, 3.5, 5.0}}}}, + {"hEtaPhiA", "FT0A #eta vs #varphi;#eta;#varphi", {HistType::kTH2F, {{8, 3.5, 5.0}, {18, 0.0, 2. * M_PI}}}}, + + {"hPhiC", "FT0C #varphi;#varphi;counts", {HistType::kTH1F, {{18, 0.0, 2. * M_PI}}}}, + {"hEtaC", "FT0C #eta;#eta;counts", {HistType::kTH1F, {{8, -3.5, -2.0}}}}, + {"hEtaPhiC", "FT0C #eta vs #varphi;#eta;#varphi", {HistType::kTH2F, {{8, -3.5, -2.0}, {18, 0.0, 2. * M_PI}}}}, + }}; + + void init(InitContext&) + { + // UDHelpers calls calculateChannelCenter() inside, but doing it once here is fine. + ft0Det.calculateChannelCenter(); + } + + void process(aod::UDCollisionFITBits const& bitsTable) + { + int64_t nProcessed = 0; + + for (auto const& row : bitsTable) { + if (maxEvents >= 0 && nProcessed >= maxEvents) { + break; + } + ++nProcessed; + + // Use udhelpers' canonical packed type + builder + udhelpers::Bits256 w{}; + if (whichThr == 2) { + w = udhelpers::makeBits256(row.thr2W0(), row.thr2W1(), row.thr2W2(), row.thr2W3()); + } else { + w = udhelpers::makeBits256(row.thr1W0(), row.thr1W1(), row.thr1W2(), row.thr1W3()); + } + + // Loop FT0 bits only (0..207). FV0 starts at 208 but ignored here. + for (int bit = 0; bit < udhelpers::kFT0Bits; ++bit) { + if (!udhelpers::testBit(w, bit)) { + continue; + } + + double phi = 0., eta = 0.; + const bool ok = udhelpers::getPhiEtaFromFitBit(ft0Det, bit, offsetFT0, iRunOffset, phi, eta); + if (!ok) { + continue; + } + + if (bit < udhelpers::kFT0AChannels) { + registry.fill(HIST("hPhiA"), phi); + registry.fill(HIST("hEtaA"), eta); + registry.fill(HIST("hEtaPhiA"), eta, phi); + } else { + registry.fill(HIST("hPhiC"), phi); + registry.fill(HIST("hEtaC"), eta); + registry.fill(HIST("hEtaPhiC"), eta, phi); + } + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"fitbit-mapping"})}; +} From 0caeb5a29f7eecea904bbd989e12d7141d2057b1 Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Wed, 25 Mar 2026 06:32:33 +0100 Subject: [PATCH 052/282] [PWGLF] Adjust DCA informations in data and MC (#15505) --- .../GlobalEventProperties/flattenictyPikp.cxx | 286 ++++++++++-------- 1 file changed, 152 insertions(+), 134 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index 32f9cca29d8..e7ddece6c1f 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -72,7 +72,9 @@ using namespace o2::constants::math; using namespace o2::aod::rctsel; auto static constexpr CminCharge = 3.f; +static constexpr float CnullInt = 0; static constexpr float Cnull = 0.0f; +static constexpr float ConeInt = 1; static constexpr float Cone = 1.0f; // FV0 specific constants @@ -104,6 +106,16 @@ static constexpr std::string_view CprefixCleanV0 = "Tracks/CleanV0/"; static constexpr std::string_view CprefixV0qa = "Tracks/V0qa/"; static constexpr std::string_view Cstatus[] = {"preSel/", "postSel/"}; static constexpr std::string_view CstatCalib[] = {"preCalib/", "postCalib/"}; +static constexpr std::string_view CpTvsDCAxy = "/hPtVsDCAxy"; +static constexpr std::string_view CpTvsDCAxyF = "Tracks/{}/hPtVsDCAxy"; +static constexpr std::string_view CpTvsDCAxyAll = "/hPtVsDCAxyAll"; +static constexpr std::string_view CpTvsDCAxyAllF = "Tracks/{}/hPtVsDCAxyAll"; +static constexpr std::string_view CpTvsDCAxyPrimAll = "/hPtVsDCAxyPrimAll"; +static constexpr std::string_view CpTvsDCAxyPrimAllF = "Tracks/{}/hPtVsDCAxyPrimAll"; +static constexpr std::string_view CpTvsDCAxyWeakAll = "/hPtVsDCAxyWeakAll"; +static constexpr std::string_view CpTvsDCAxyWeakAllF = "Tracks/{}/hPtVsDCAxyWeakAll"; +static constexpr std::string_view CpTvsDCAxyMatAll = "/hPtVsDCAxyMatAll"; +static constexpr std::string_view CpTvsDCAxyMatAllF = "Tracks/{}/hPtVsDCAxyMatAll"; static constexpr std::string_view CpTgenPrimSgn = "/hPtGenPrimSgn"; static constexpr std::string_view CpTgenPrimSgnF = "Tracks/{}/hPtGenPrimSgn"; static constexpr std::string_view CpTgenPrimSgnINEL = "/hPtGenPrimSgnINEL"; @@ -208,10 +220,6 @@ std::array, NpartChrg> hPtVsDCAxyMat{}; std::array, NpartChrg> hDCAxyBadCollPrim{}; std::array, NpartChrg> hDCAxyBadCollWeak{}; std::array, NpartChrg> hDCAxyBadCollMat{}; -std::array, NpartChrg> hPtNsigmaTPC{}; -std::array, NpartChrg> hThPtNsigmaTPC{}; -std::array, NpartChrg> hPtNsigmaTOF{}; -std::array, NpartChrg> hPtNsigmaTPCTOF{}; struct FlattenictyPikp { @@ -233,7 +241,7 @@ struct FlattenictyPikp { Configurable cfgFillTrackQaHist{"cfgFillTrackQaHist", false, "fill track QA histograms"}; Configurable cfgFilldEdxCalibHist{"cfgFilldEdxCalibHist", false, "fill dEdx calibration histograms"}; Configurable cfgFilldEdxQaHist{"cfgFilldEdxQaHist", false, "fill dEdx QA histograms"}; - Configurable cfgFillNsigmaQAHist{"cfgFillNsigmaQAHist", false, "fill nsigma QA histograms"}; + Configurable cfgFillDCAxyHist{"cfgFillDCAxyHist", false, "fill nsigma QA histograms"}; Configurable cfgFillV0Hist{"cfgFillV0Hist", false, "fill V0 histograms"}; Configurable cfgFillChrgType{"cfgFillChrgType", false, "fill histograms per charge types"}; Configurable cfgFillChrgTypeV0s{"cfgFillChrgTypeV0s", false, "fill V0s histograms per charge types"}; @@ -279,8 +287,8 @@ struct FlattenictyPikp { ConfigurableAxis axisMultPerc{"axisMultPerc", {20, 0, 100}, "Multiplicity percentiles binning"}; ConfigurableAxis axisVertexZ{"axisVertexZ", {80, -20., 20.}, "Vertex z binning"}; ConfigurableAxis axisMult{"axisMult", {301, -0.5, 300.5}, "Multiplicity binning"}; - ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -5, 5}, "DCAxy binning"}; - ConfigurableAxis axisDCAz{"axisDCAz", {200, -5, 5}, "DCAz binning"}; + ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -5., 5.}, "DCAxy binning"}; + ConfigurableAxis axisDCAz{"axisDCAz", {200, -5., 5.}, "DCAz binning"}; ConfigurableAxis axisPhi = {"axisPhi", {60, 0, constants::math::TwoPI}, "#varphi binning"}; ConfigurableAxis axisPhiMod = {"axisPhiMod", {100, 0, constants::math::PI / 9}, "fmod(#varphi,#pi/9)"}; ConfigurableAxis axisEta = {"axisEta", {50, -1.0, 1.0}, "#eta binning"}; @@ -312,6 +320,7 @@ struct FlattenictyPikp { Configurable cfgDeDxMIPMax{"cfgDeDxMIPMax", 60.0f, "Maximum range of MIP dedx"}; Configurable cfgDeDxMIPMin{"cfgDeDxMIPMin", 40.0f, "Maximum range of MIP dedx"}; Configurable cfgNsigmaMax{"cfgNsigmaMax", 100.0f, "Maximum range of nsgima for tracks"}; + Configurable cfgDcaNsigmaCombinedMax{"cfgDcaNsigmaCombinedMax", 3.0f, "Maximum range of combined nsgima of tracks for DCA"}; Configurable cfgMomSelPiTOF{"cfgMomSelPiTOF", 0.4f, "Minimum momentum cut for TOF pions"}; Configurable cfgNsigSelKaTOF{"cfgNsigSelKaTOF", 3.0f, "Nsigma cut for TOF kaons"}; Configurable cfgBetaPlateuMax{"cfgBetaPlateuMax", 0.1f, "Beta max for Plateau electrons"}; @@ -501,6 +510,7 @@ struct FlattenictyPikp { selTrkGlobal.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); selTrkGlobal.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); selTrkGlobal.SetMinNClustersITS(minITSnClusters.value); + selTrkGlobal.SetRequireHitsInITSLayers(1, {0, 1, 2}); // GlobalTrackRun3ITSMatching::Run3ITSibAny selTrkGlobal.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); selTrkGlobal.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); // // selTrkGlobal.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); }); @@ -588,7 +598,7 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); flatchrg.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); - if (cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillNsigmaQAHist) { + if (cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { if (cfgFillTrackQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); @@ -612,6 +622,8 @@ struct FlattenictyPikp { flatchrg.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); flatchrg.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); @@ -649,16 +661,9 @@ struct FlattenictyPikp { flatchrg.addClone("Tracks/preCalib/all/", "Tracks/preCalib/neg/"); } } - if (cfgFillNsigmaQAHist) { - for (int i = 0; i < NpartChrg; i++) { - const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); - if (cfgStoreThnSparse) { - hThPtNsigmaTPC[i] = flatchrg.add("Tracks/hThPtNsigmaTPC" + strID, " ; p_{T} (GeV/c)", kTHnSparseF, {ptAxis, nSigmaTPCAxis, multAxis, flatAxis}); - } else { - hPtNsigmaTPC[i] = flatchrg.add("Tracks/hPtNsigmaTPC" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, nSigmaTPCAxis}); - } - hPtNsigmaTOF[i] = flatchrg.add("Tracks/hPtNsigmaTOF" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, nSigmaTOFAxis}); - hPtNsigmaTPCTOF[i] = flatchrg.add("Tracks/hPtNsigmaTPCTOF" + strID, PidChrg[i], kTH2F, {nSigmaTPCAxis, nSigmaTOFAxis}); + if (cfgFillDCAxyHist) { + for (int i = 0; i < Npart; i++) { + flatchrg.add({fmt::format(CpTvsDCAxyF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); } } } @@ -730,6 +735,22 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); + if (cfgFillTrackQaHist) { + flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); + if (cfgStoreThnSparse) { + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); + } else { + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); + } + flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); + flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + flatchrg.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + } + flatchrg.addClone("Tracks/postSel/", "Tracks/preSel/"); + for (int i = 0; i < NpartChrg; i++) { const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); @@ -748,14 +769,15 @@ struct FlattenictyPikp { hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); } - flatchrg.add({"hPtOut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"hPtOutPrim", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); + for (int i = 0; i < Npart; i++) { + flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + } + flatchrg.add({"hPtOutNoEtaCut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); flatchrg.add({"PtOutFakes", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add("hPtVsDCAxyPrimAll", "hPtVsDCAxyPrimAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("hPtVsDCAxyWeakAll", "hPtVsDCAxyWeakAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("hPtVsDCAxyMatAll", "hPtVsDCAxyMatAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("hPtVsDCAxyAll", "hPtVsDCAxyAll", kTH2F, {ptAxis, dcaXYAxis}); flatchrg.add({"ResponseGen", " ; N_{part}; F_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); flatchrg.add("h1flatencityFV0MCGen", "", kTH1F, {{102, -0.01, 1.01, "1-flatencityFV0"}}); @@ -903,23 +925,12 @@ struct FlattenictyPikp { template bool isPID(const P& mcParticle) { - static_assert(pidSgn == Cnull || pidSgn == 1); - static_assert(id > Cnull || id < Npart); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); + static_assert(id > CnullInt || id < Npart); constexpr int Cidx = id + pidSgn * Npart; return mcParticle.pdgCode() == PidSgn[Cidx]; } - template - bool selTPCtrack(T const& track) - { - return (track.hasTPC() && - track.passedTPCCrossedRowsOverNCls() && - track.passedTPCChi2NDF() && - track.passedTPCNCls() && - track.passedTPCCrossedRows() && - track.passedTPCRefit()); - } - template bool selTOFPi(T const& track) { @@ -940,13 +951,41 @@ struct FlattenictyPikp { return false; } - template - void fillNsigma(T const& tracks, C const& collision) + template + void fillDCA(T const& tracks, C const& collision, aod::BCsWithTimestamps const& /*bcs*/) { + if (trkSelOpt.cfgRejectTrkAtTPCSector) { + auto bc = collision.template bc_as(); + int currentRun = bc.runNumber(); + if (runNumber != currentRun) { + initCCDB(bc); + runNumber = currentRun; + } + } const float mult = getMult(collision); const float flat = fillFlat(collision); for (const auto& track : tracks) { - checkNsigma(track, mult, flat); + if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (track.pt() < trkSelOpt.cfgTrkPtMin) { + continue; + } + if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { + continue; + } + if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { + continue; + } + if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + continue; + } + if (!isDCAxyWoCut(track)) { + continue; + } + if (track.hasTOF() && (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax))) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[id]) + HIST(CpTvsDCAxy), mult, flat, track.pt(), track.dcaXY()); + } } } @@ -1534,65 +1573,6 @@ struct FlattenictyPikp { return true; } - template - void checkNsigma(const T& track, const float mult, const float flat) - { - if (std::abs(track.rapidity(o2::track::PID::getMass(pid))) > trkSelOpt.cfgRapMax) { - return; - } - - float valTPCnsigma = -999, valTOFnsigma = -999; - switch (pid) { - case o2::track::PID::Pion: - valTPCnsigma = track.tpcNSigmaPi(); - valTOFnsigma = track.tofNSigmaPi(); - break; - case o2::track::PID::Kaon: - valTPCnsigma = track.tpcNSigmaKa(); - valTOFnsigma = track.tofNSigmaKa(); - break; - case o2::track::PID::Proton: - valTPCnsigma = track.tpcNSigmaPr(); - valTOFnsigma = track.tofNSigmaPr(); - break; - case o2::track::PID::Electron: - valTPCnsigma = track.tpcNSigmaEl(); - valTOFnsigma = track.tofNSigmaEl(); - break; - case o2::track::PID::Muon: - valTPCnsigma = track.tpcNSigmaMu(); - valTOFnsigma = track.tofNSigmaMu(); - break; - default: - valTPCnsigma = -999, valTOFnsigma = -999; - break; - } - - if (track.sign() > Cnull) { - if (cfgStoreThnSparse) { - hThPtNsigmaTPC[pid]->Fill(track.pt(), valTPCnsigma, mult, flat); - } else { - hPtNsigmaTPC[pid]->Fill(track.pt(), valTPCnsigma); - } - } else { - if (cfgStoreThnSparse) { - hThPtNsigmaTPC[pid + Npart]->Fill(track.pt(), valTPCnsigma, mult, flat); - } else { - hPtNsigmaTPC[pid + Npart]->Fill(track.pt(), valTPCnsigma); - } - } - if (!track.hasTOF()) { - return; - } - if (track.sign() > Cnull) { - hPtNsigmaTOF[pid]->Fill(track.pt(), valTOFnsigma); - hPtNsigmaTPCTOF[pid]->Fill(valTPCnsigma, valTOFnsigma); - } else { - hPtNsigmaTOF[pid + Npart]->Fill(track.pt(), valTOFnsigma); - hPtNsigmaTPCTOF[pid + Npart]->Fill(valTPCnsigma, valTOFnsigma); - } - } - template inline void fillTrackQA(T const& track) { @@ -1608,6 +1588,8 @@ struct FlattenictyPikp { flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsPt"), track.pt(), track.tpcNClsFound()); flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsPt"), track.pt(), track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsEta"), track.eta(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsEta"), track.eta(), track.tpcNClsPID()); flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCnClsShared"), track.tpcNClsShared()); flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows()); flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); @@ -2011,10 +1993,10 @@ struct FlattenictyPikp { auto v0sPerCollision = v0s.sliceBy(perColV0s, collision.globalIndex()); v0sPerCollision.bindExternalIndices(&tracks); filldEdx(tracksPerCollision, v0sPerCollision, collision, bcs); - if (cfgFillNsigmaQAHist) { - fillNsigma(tracksPerCollision, collision); - fillNsigma(tracksPerCollision, collision); - fillNsigma(tracksPerCollision, collision); + if (cfgFillDCAxyHist) { + static_for<0, 4>([&](auto i) { + fillDCA(tracksPerCollision, collision, bcs); + }); } } } @@ -2099,7 +2081,7 @@ struct FlattenictyPikp { AxisSpec ptAxis{binOpt.axisPt, "#it{p}_{T} (GeV/#it{c})"}; constexpr int ChistIdx = id + pidSgn * Npart; auto idx = static_cast(id); - const std::string strID = Form("/%s/%s", (pidSgn == Cnull && id < Npart) ? "pos" : "neg", Pid[idx]); + const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]); hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); } @@ -2107,8 +2089,8 @@ struct FlattenictyPikp { template void initEfficiency() { - static_assert(pidSgn == Cnull || pidSgn == 1); - static_assert(id > Cnull || id < Npart); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); + static_assert(id > CnullInt || id < Npart); constexpr int Cidx = id + pidSgn * Npart; const TString partName = PidChrg[Cidx]; THashList* lhash = new THashList(); @@ -2130,7 +2112,7 @@ struct FlattenictyPikp { template void fillEfficiency() { - static_assert(pidSgn == Cnull || pidSgn == 1); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; const char* partName = PidChrg[ChistIdx]; THashList* lhash = static_cast(listEfficiency->FindObject(partName)); @@ -2154,8 +2136,10 @@ struct FlattenictyPikp { template void fillMCRecTrack(MyLabeledPIDTracks::iterator const& track, const float mult, const float flat) { - static_assert(pidSgn == Cnull || pidSgn == 1); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; + constexpr int Cidx = id; + LOG(debug) << "fillMCRecTrack for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; const aod::McParticles::iterator& mcParticle = track.mcParticle(); const CollsGen::iterator& collision = track.collision_as(); @@ -2182,36 +2166,34 @@ struct FlattenictyPikp { } } - if (!isDCAxyCut(track)) { - return; - } - flatchrg.fill(HIST("hPtVsDCAxyAll"), track.pt(), track.dcaXY()); - - if (selTPCtrack(track)) { - hPtEffRec[ChistIdx]->Fill(mcParticle.pt()); - } - - if (!mcParticle.isPhysicalPrimary()) { - if (mcParticle.getProcess() == CprocessIdWeak) { - hPtEffRecWeak[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST("hPtVsDCAxyWeakAll"), track.pt(), track.dcaXY()); - } else { - hPtEffRecMat[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST("hPtVsDCAxyMatAll"), track.pt(), track.dcaXY()); + if (collision.has_mcCollision() && (mcParticle.mcCollisionId() == collision.mcCollisionId())) { + if (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax)) { + if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { + if (!mcParticle.isPhysicalPrimary()) { + if (mcParticle.getProcess() == CprocessIdWeak) { + hPtEffRecWeak[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyWeakAll), mult, flat, track.pt(), track.dcaXY()); + } else { + hPtEffRecMat[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyMatAll), mult, flat, track.pt(), track.dcaXY()); + } + } else { + hPtEffRecPrim[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyPrimAll), mult, flat, track.pt(), track.dcaXY()); + } + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyAll), mult, flat, track.pt(), track.dcaXY()); + } } - } else { - hPtEffRecPrim[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST("hPtVsDCAxyPrimAll"), track.pt(), track.dcaXY()); } } template void fillMCGen(aod::McParticles::iterator const& mcParticle, const float mult, const float flat) { - static_assert(pidSgn == Cnull || pidSgn == 1); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; if (!isPID(mcParticle)) { @@ -2417,6 +2399,7 @@ struct FlattenictyPikp { void processMC(MCColls const& mcCollisions, CollsGen const& collisions, + aod::BCsWithTimestamps const& /*bcs*/, MyLabeledPIDTracks const& tracks, aod::McParticles const& mcparticles) { @@ -2428,22 +2411,60 @@ struct FlattenictyPikp { flatchrg.fill(HIST("hEvtGenRec"), 3.f); } flatchrg.fill(HIST("hEvtMcGenColls"), 1); + const auto groupedColls = collisions.sliceBy(perCollMcLabel, mcCollision.globalIndex()); const auto groupedParts = mcparticles.sliceBy(perCollMcPart, mcCollision.globalIndex()); const float flatMC = fillFlatMC(groupedParts); const float multMC = getMultMC(mcCollision); + if (groupedColls.size() < 1) { // if MC events have no rec collisions continue; } + + auto maxNcontributors = -1; + auto bestCollIndex = -1; + for (const auto& collision : groupedColls) { + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + } else { + continue; + } + } + flatchrg.fill(HIST("hEvtMcGenColls"), 2); for (const auto& collision : groupedColls) { flatchrg.fill(HIST("hEvtMcGenColls"), 3); if (!isGoodEvent(collision)) { continue; } + // Select collisions with the largest number of contributors + if (bestCollIndex != collision.globalIndex()) { + continue; + } flatchrg.fill(HIST("hEvtMcGenColls"), 4); const auto groupedTrks = tracks.sliceBy(perCollTrk, collision.globalIndex()); for (const auto& track : groupedTrks) { + if (!track.has_collision()) { + continue; + } + if (trkSelOpt.cfgRejectTrkAtTPCSector) { + auto bc = collision.bc_as(); + int currentRun = bc.runNumber(); + if (runNumber != currentRun) { + initCCDB(bc); + runNumber = currentRun; + } + } + if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { + continue; + } + if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { + continue; + } + if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + continue; + } if (!isDCAxyWoCut(track)) { continue; } @@ -2455,9 +2476,6 @@ struct FlattenictyPikp { if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { continue; } - if (!track.has_collision()) { - continue; - } static_for<0, 1>([&](auto pidSgn) { fillMCRecTrack(track, multMC, flatMC); fillMCRecTrack(track, multMC, flatMC); From 947d1a37f4eadea0f1564e843130ed4f9a7edcfe Mon Sep 17 00:00:00 2001 From: Katarzyna <116073883+kgwizdzi@users.noreply.github.com> Date: Wed, 25 Mar 2026 07:55:15 +0100 Subject: [PATCH 053/282] [PWGCF] FemtoUniverse: PID selection update, corr. bkg histos for D0 (#15508) --- .../Tasks/femtoUniverseEfficiencyBase.cxx | 146 +++++++++++------- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 55 +++++-- 2 files changed, 136 insertions(+), 65 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 638e410df62..2f90a0c4e52 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -42,6 +42,8 @@ struct FemtoUniverseEfficiencyBase { Configurable confIsMCReco{"confIsMCReco", false, "Enable QA histograms for MC Reco"}; Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; + Configurable forceTof{"forceTof", false, "Enable to reject tracks without TOF for PID, set to false for processes with V0"}; + Configurable checkIfTofAvailable{"checkIfTofAvailable", true, "Enable to check if TOF is available for PID, set to false for processes with V0"}; // Collisions Configurable confZVertex{"confZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; @@ -122,7 +124,7 @@ struct FemtoUniverseEfficiencyBase { /// Particle 1 Configurable confPDGCodePartOne{"confPDGCodePartOne", 2212, "Particle 1 - PDG code"}; - Configurable confParticleTypePartOne{"confParticleTypePartOne", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 1 - particle type: 0 - track, 2 - V0, 6 - phi"}; + Configurable confParticleTypePartOne{"confParticleTypePartOne", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 1 - particle type: 0 - track, 2 - V0, 6 - phi"}; Configurable confNoPDGPartOne{"confNoPDGPartOne", false, "0: selecting part one by PDG, 1: no PID selection"}; Configurable confPtLowPart1{"confPtLowPart1", 0.2, "Lower limit for Pt for the first particle"}; Configurable confPtHighPart1{"confPtHighPart1", 2.5, "Higher limit for Pt for the first particle"}; @@ -143,7 +145,7 @@ struct FemtoUniverseEfficiencyBase { /// Particle 2 Configurable confIsSame{"confIsSame", false, "Pairs of the same particle"}; Configurable confPDGCodePartTwo{"confPDGCodePartTwo", 333, "Particle 2 - PDG code"}; - Configurable confParticleTypePartTwo{"confParticleTypePartTwo", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 2 - particle type: 0 - track, 2 - V0, 6 - phi"}; + Configurable confParticleTypePartTwo{"confParticleTypePartTwo", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 2 - particle type: 0 - track, 2 - V0, 6 - phi"}; Configurable confNoPDGPartTwo{"confNoPDGPartTwo", false, "0: selecting part two by PDG, 1: no PID selection"}; Configurable confPtLowPart2{"confPtLowPart2", 0.2, "Lower limit for Pt for the second particle"}; Configurable confPtHighPart2{"confPtHighPart2", 2.5, "Higher limit for Pt for the second particle"}; @@ -211,37 +213,50 @@ struct FemtoUniverseEfficiencyBase { } } - 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(bool partHasTof, float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx { - if (mom < ConfBothTracks.confMomProton) { + if (forceTof && !partHasTof) { + return false; + } + + if (mom <= ConfBothTracks.confMomProton) { if (std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaTPCProton) { return true; } else { return false; } - } else { - if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confNsigmaCombinedProton) { - return true; + } + if (mom > ConfBothTracks.confMomProton) { + if (checkIfTofAvailable && !partHasTof) { + return std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaTPCProton; + } else if (checkIfTofAvailable && partHasTof) { + return std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfBothTracks.confNsigmaCombinedProton; } else { - return false; + return std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfBothTracks.confNsigmaCombinedProton; } } return false; } - bool isProtonNSigmaRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa) + bool isProtonNSigmaRejected(bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa) { - if (mom < ConfBothTracks.confMomProton) { + if (forceTof && !partHasTof) { + return true; + } + + if (mom <= ConfBothTracks.confMomProton || !partHasTof) { if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { return true; } else if (std::abs(nsigmaTPCKa) < ConfBothTracks.confNsigmaPrRejectKaNsigma) { return true; + } else { + return false; } } - if (mom > ConfBothTracks.confMomProton) { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { + if (mom > ConfBothTracks.confMomProton && partHasTof) { + if (std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { return true; - } else if (std::hypot(nsigmaTOFKa, nsigmaTPCKa) < ConfBothTracks.confNsigmaPrRejectKaNsigma) { + } else if (std::sqrt(std::pow(nsigmaTPCKa, 2) + std::pow(nsigmaTOFKa, 2)) < ConfBothTracks.confNsigmaPrRejectKaNsigma) { return true; } else { return false; @@ -304,38 +319,48 @@ struct FemtoUniverseEfficiencyBase { } } - bool isKaonNSigmaLF(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigmaLF(bool partHasTof, float mom, float nsigmaTPCK, float nsigmaTOFK) { - if (mom < ConfKaonSelection.confMomKaonLF) { + if (forceTof && !partHasTof) { + return false; + } + + if (mom <= ConfKaonSelection.confMomKaonLF) { if (std::abs(nsigmaTPCK) < ConfKaonSelection.confNSigmaTPCKaonLF) { return true; } else { return false; } } else if (mom > ConfKaonSelection.confMomKaonLF) { - if (std::hypot(nsigmaTOFK, nsigmaTPCK) < ConfKaonSelection.confNSigmaCombKaonLF) { - return true; + if (checkIfTofAvailable && !partHasTof) { + return std::abs(nsigmaTPCK) < ConfKaonSelection.confNSigmaTPCKaonLF; + } else if (checkIfTofAvailable && partHasTof) { + return std::sqrt(std::pow(nsigmaTPCK, 2) + std::pow(nsigmaTOFK, 2)) < ConfKaonSelection.confNSigmaCombKaonLF; } else { - return false; + return std::sqrt(std::pow(nsigmaTPCK, 2) + std::pow(nsigmaTOFK, 2)) < ConfKaonSelection.confNSigmaCombKaonLF; } } else { return false; } } - bool isKaonNSigmaLFRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCPr, float nsigmaTOFPr) + bool isKaonNSigmaLFRejected(bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCPr, float nsigmaTOFPr) { - if (mom < ConfKaonSelection.confMomKaonLF) { + if (forceTof && !partHasTof) { + return true; + } + + if (mom <= ConfKaonSelection.confMomKaonLF || !partHasTof) { if (std::abs(nsigmaTPCPi) < ConfKaonSelection.confNsigmaKaRejectPiNsigma) { return true; } else if (std::abs(nsigmaTPCPr) < ConfKaonSelection.confNsigmaKaRejectPrNsigma) { return true; } } - if (mom > ConfKaonSelection.confMomKaonLF) { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfKaonSelection.confNsigmaKaRejectPiNsigma) { + if (mom > ConfKaonSelection.confMomKaonLF && partHasTof) { + if (std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfKaonSelection.confNsigmaKaRejectPiNsigma) { return true; - } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfKaonSelection.confNsigmaKaRejectPrNsigma) { + } else if (std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfKaonSelection.confNsigmaKaRejectPrNsigma) { return true; } else { return false; @@ -345,37 +370,48 @@ struct FemtoUniverseEfficiencyBase { } } - bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) + bool isPionNSigma(bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi) { - if (mom < ConfBothTracks.confMomPion) { + if (forceTof && !partHasTof) { + return false; + } + + if (mom <= ConfBothTracks.confMomPion) { if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaTPCPion) { return true; } else { return false; } - } else { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confNsigmaCombinedPion) { - return true; + } else if (mom > ConfBothTracks.confMomPion) { + if (checkIfTofAvailable && !partHasTof) { + return std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaTPCPion; + } else if (checkIfTofAvailable && partHasTof) { + return std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfBothTracks.confNsigmaCombinedPion; } else { - return false; + return std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfBothTracks.confNsigmaCombinedPion; } + } else { + return false; } - return false; } - bool isPionNSigmaRejected(float mom, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) + bool isPionNSigmaRejected(bool partHasTof, float mom, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) { - if (mom < ConfBothTracks.confMomPion) { + if (forceTof && !partHasTof) { + return true; + } + + if (mom <= ConfBothTracks.confMomPion || !partHasTof) { if (std::abs(nsigmaTPCKa) < ConfBothTracks.confNsigmaPiRejectKaNsigma) { return true; } else if (std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaPiRejectPrNsigma) { return true; } } - if (mom > ConfBothTracks.confMomPion) { - if (std::hypot(nsigmaTOFKa, nsigmaTPCKa) < ConfBothTracks.confNsigmaPiRejectKaNsigma) { + if (mom > ConfBothTracks.confMomPion && partHasTof) { + if (std::sqrt(std::pow(nsigmaTPCKa, 2) + std::pow(nsigmaTOFKa, 2)) < ConfBothTracks.confNsigmaPiRejectKaNsigma) { return true; - } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confNsigmaPiRejectPrNsigma) { + } else if (std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfBothTracks.confNsigmaPiRejectPrNsigma) { return true; } else { return false; @@ -398,21 +434,21 @@ struct FemtoUniverseEfficiencyBase { } } - bool isParticleNSigma(int pdgCode, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe) + bool isParticleNSigma(int pdgCode, bool partHasTof, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe) { switch (pdgCode) { case 2212: // Proton case -2212: // anty Proton - return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(partHasTof, mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- - return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(partHasTof, mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- if (isKaonLF) { - return isKaonNSigmaLF(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigmaLF(partHasTof, mom, nsigmaTPCK, nsigmaTOFK); } else { return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); } @@ -426,21 +462,21 @@ struct FemtoUniverseEfficiencyBase { } } - bool isParticleNSigmaRejected(int pdgCode, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) + bool isParticleNSigmaRejected(int pdgCode, bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) { switch (pdgCode) { case 2212: // Proton case -2212: // anty Proton - return isProtonNSigmaRejected(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCKa, nsigmaTOFKa); + return isProtonNSigmaRejected(partHasTof, mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCKa, nsigmaTOFKa); break; case 211: // Pion case -211: // Pion- - return isPionNSigmaRejected(mom, nsigmaTPCKa, nsigmaTOFKa, nsigmaTPCPr, nsigmaTOFPr); + return isPionNSigmaRejected(partHasTof, mom, nsigmaTPCKa, nsigmaTOFKa, nsigmaTPCPr, nsigmaTOFPr); break; case 321: // Kaon+ case -321: // Kaon- if (isKaonLF) { - return isKaonNSigmaLFRejected(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCPr, nsigmaTOFPr); + return isKaonNSigmaLFRejected(partHasTof, mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCPr, nsigmaTOFPr); } else { return false; // in case of non LF kaon selecion } @@ -515,11 +551,11 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 2); - if (!isParticleNSigma(confPDGCodePartOne, 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))) { + if (!isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), 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))) { continue; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartOne, part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { + if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { continue; } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 3); @@ -568,10 +604,10 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 2); - if (!isParticleNSigma(confPDGCodePartTwo, 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))) { + if (!isParticleNSigma(confPDGCodePartTwo, static_cast(part.mLambda()), 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))) { continue; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartTwo, part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { + if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartTwo, static_cast(part.mLambda()), part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { continue; } registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 3); @@ -618,7 +654,7 @@ struct FemtoUniverseEfficiencyBase { { // part1 is track and part2 is Phi for (const auto& part : grouppartsOneMCRec) { - if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, 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))) { + if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), 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))) { continue; } trackHistoPartOneRec.fillQA(part); @@ -672,10 +708,10 @@ struct FemtoUniverseEfficiencyBase { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - if (confPDGCodePartOne > 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartOne > 0 && (!isProtonNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } - if (confPDGCodePartOne < 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartOne < 0 && (!isProtonNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } @@ -706,10 +742,10 @@ struct FemtoUniverseEfficiencyBase { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - if (confPDGCodePartTwo > 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo > 0 && (!isProtonNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } - if (confPDGCodePartTwo < 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo < 0 && (!isProtonNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } @@ -746,7 +782,7 @@ struct FemtoUniverseEfficiencyBase { /// Histogramming same event for (const auto& part : grouppartsOneMCRec) { - if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, 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))) { + if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), 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))) { continue; } @@ -768,10 +804,10 @@ struct FemtoUniverseEfficiencyBase { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - if (confPDGCodePartTwo > 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo > 0 && (!isProtonNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } - if (confPDGCodePartTwo < 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo < 0 && (!isProtonNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 65538ecd6f0..12ea6f27d68 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -109,7 +109,7 @@ struct FemtoUniversePairTaskTrackD0 { // Particle identification Configurable minMomPidTpcTofProton{"minMomPidTpcTofProton", 0.8, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; Configurable minMomPidTpcTofPion{"minMomPidTpcTofPion", 0.7, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; - Configurable minMomPidTpcTofKaonLF{"minMomPidTpcTofKaonLF", 0.5, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; + Configurable minMomPidTpcTofKaon{"minMomPidTpcTofKaon", 0.5, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; // Configurables with nSigma values for particle selection Configurable confNsigmaCombinedProton{"confNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined)"}; Configurable confNsigmaTPCProton{"confNsigmaTPCProton", 3.0, "TPC Proton Sigma"}; @@ -124,6 +124,8 @@ struct FemtoUniversePairTaskTrackD0 { Configurable confNsigmaKaRejectPrNsigma{"confNsigmaKaRejectPrNsigma", 2.0, "Reject if kaon could be a proton within a givien nSigma value"}; Configurable confNsigmaPiRejectKaNsigma{"confNsigmaPiRejectKaNsigma", 2.0, "Reject if pion could be a kaon within a givien nSigma value"}; Configurable confNsigmaPiRejectPrNsigma{"confNsigmaPiRejectPrNsigma", 2.0, "Reject if pion could be a proton within a givien nSigma value"}; + // Configurable to enable particle rejection + Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; } ConfTrack; /// Particle 2 --- D0/D0bar meson @@ -157,11 +159,11 @@ struct FemtoUniversePairTaskTrackD0 { Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; Configurable confChooseD0trackCorr{"confChooseD0trackCorr", 0, "If 0 correlations with D0s, if 1 with D0bars"}; + // Correlated background for D0/D0bar candidates + Configurable fillCorrBkgs{"fillCorrBkgs", false, "Fill histograms with correlated background candidates"}; // Efficiency Configurable doEfficiencyCorr{"doEfficiencyCorr", false, "Apply efficiency corrections"}; - // Particle rejection - Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; /// 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) && (nabs(aod::femtouniverseparticle::eta) < ConfTrack.confTrackEtaMax); @@ -324,13 +326,13 @@ struct FemtoUniversePairTaskTrackD0 { bool isKaonNSigmaLF(float mom, float nsigmaTPCKa, float nsigmaTOFKa) { - if (mom < ConfTrack.minMomPidTpcTofKaonLF) { + if (mom < ConfTrack.minMomPidTpcTofKaon) { if (std::abs(nsigmaTPCKa) < ConfTrack.confNsigmaTPCKaon) { return true; } else { return false; } - } else if (mom > ConfTrack.minMomPidTpcTofKaonLF) { + } else if (mom > ConfTrack.minMomPidTpcTofKaon) { if (std::hypot(nsigmaTOFKa, nsigmaTPCKa) < ConfTrack.confNsigmaCombinedKaon) { return true; } else { @@ -343,14 +345,14 @@ struct FemtoUniversePairTaskTrackD0 { bool isKaonNSigmaLFRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCPr, float nsigmaTOFPr) { - if (mom < ConfTrack.minMomPidTpcTofKaonLF) { + if (mom < ConfTrack.minMomPidTpcTofKaon) { if (std::abs(nsigmaTPCPi) < ConfTrack.confNsigmaKaRejectPiNsigma) { return true; } else if (std::abs(nsigmaTPCPr) < ConfTrack.confNsigmaKaRejectPrNsigma) { return true; } } - if (mom > ConfTrack.minMomPidTpcTofKaonLF) { + if (mom > ConfTrack.minMomPidTpcTofKaon) { if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfTrack.confNsigmaKaRejectPiNsigma) { return true; } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfTrack.confNsigmaKaRejectPrNsigma) { @@ -554,6 +556,17 @@ struct FemtoUniversePairTaskTrackD0 { mcRecoRegistry.add("hMassVsPtD0barBkg", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); mcRecoRegistry.add("hMassVsPtD0barPrompt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); mcRecoRegistry.add("hMassVsPtD0barNonPrompt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // Histograms for D0/D0bar correlated backgrounds + if (fillCorrBkgs) { + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + } // Histograms for identified hadrons mcRecoRegistry.add("hMcRecKpPt", "MC Reco K+;#it{p}_{T} (GeV/c); counts", {HistType::kTH1F, {{500, 0, 5}}}); mcRecoRegistry.add("hMcRecKpPtGenEtaGen", "MC Reco K+;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); @@ -898,7 +911,7 @@ struct FemtoUniversePairTaskTrackD0 { 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; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), 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), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { + if (ConfTrack.confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), 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), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { continue; } } @@ -928,7 +941,7 @@ struct FemtoUniversePairTaskTrackD0 { 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; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), 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), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { + if (ConfTrack.confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), 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), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { continue; } } @@ -1128,7 +1141,7 @@ struct FemtoUniversePairTaskTrackD0 { 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; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), 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), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { + if (ConfTrack.confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), 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), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { continue; } } @@ -1486,6 +1499,17 @@ struct FemtoUniversePairTaskTrackD0 { } else { mcRecoRegistry.fill(HIST("hMassVsPtD0Bkg"), part.mLambda(), part.pt(), weight); } + if (fillCorrBkgs) { + if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0) { // D0 -> pi+K-pi0 + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToPiKaPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPi) { // D0 -> pi+pi- + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPiPi0) { // D0 -> pi+pi-pi0 + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToPiPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToKK) { // D0 -> K+K- + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToKaKa"), part.mLambda(), part.pt(), weight); + } + } if (part.tpcNClsFound() == 0) { // prompt candidates mcRecoRegistry.fill(HIST("hMassVsPtD0Prompt"), part.mLambda(), part.pt(), weight); } else if (part.tpcNClsFound() == 1) { // non-prompt candidates @@ -1499,6 +1523,17 @@ struct FemtoUniversePairTaskTrackD0 { } else { mcRecoRegistry.fill(HIST("hMassVsPtD0barBkg"), part.mAntiLambda(), part.pt(), weight); } + if (fillCorrBkgs) { + if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0) { // D0 -> pi+K-pi0 + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToPiKaPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPi) { // D0 -> pi+pi- + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPiPi0) { // D0 -> pi+pi-pi0 + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToPiPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToKK) { // D0 -> K+K- + mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToKaKa"), part.mLambda(), part.pt(), weight); + } + } if (part.tpcNClsFound() == 0) { // prompt candidates mcRecoRegistry.fill(HIST("hMassVsPtD0barPrompt"), part.mAntiLambda(), part.pt(), weight); } else if (part.tpcNClsFound() == 1) { // non-prompt candidates From 344bfe5faf4c995a67ead73db61e2363174324cc Mon Sep 17 00:00:00 2001 From: Dukhishyam Mallick <160018357+dmallick2@users.noreply.github.com> Date: Wed, 25 Mar 2026 13:45:54 +0100 Subject: [PATCH 054/282] [PWGDQ] Add histograms for MC truth signal for prompt/non-prompt polarization (#15506) --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 9 ++++++++- PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 9fe021663bd..daf203e0b29 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -1711,11 +1711,14 @@ struct AnalysisSameEventPairing { } else if (sig->GetNProngs() == 2) { histNames += Form("MCTruthGenPair_%s;", sig->GetName()); histNames += Form("MCTruthGenPairSel_%s;", sig->GetName()); + histNames += Form("MCTruthGenPseudoPolPair_%s;", sig->GetName()); + histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName()); fHasTwoProngGenMCsignals = true; // for these pair level signals, also add histograms for each MCgenAcc cut if specified if (fUseMCGenAccCut) { for (auto& cut : fMCGenAccCuts) { histNames += Form("MCTruthGenPairSel_%s_%s;", sig->GetName(), cut->GetName()); + histNames += Form("MCTruthGenPseudoPolPairSel_%s_%s;", sig->GetName(), cut->GetName()); } } } @@ -2262,11 +2265,13 @@ struct AnalysisSameEventPairing { VarManager::FillPairMC(t1_raw, t2_raw); // cout << " Filled VarManager for the pair." << endl; fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s", sig->GetName()), VarManager::fgValues); // Fill also acceptance cut histograms if requested if (fUseMCGenAccCut) { for (auto& cut : fMCGenAccCuts) { if (cut->IsSelected(VarManager::fgValues)) { fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues); } } } @@ -4668,7 +4673,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char if (classStr.Contains("MCTruthGenPair")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_pair", histName); } - + if (classStr.Contains("MCTruthGenPseudoPolPair")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-gen", histName); + } if (classStr.Contains("MCTruthGenSelBR")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_triple"); } else if (classStr.Contains("MCTruthGen")) { diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx index 4585a894098..2d36e5dd0db 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx @@ -1458,6 +1458,7 @@ struct AnalysisSameEventPairing { histNames += Form("MCTruthGenSel_%s;", sig->GetName()); } else if (sig->GetNProngs() == 2) { histNames += Form("MCTruthGenPairSel_%s;", sig->GetName()); + histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName()); fHasTwoProngGenMCsignals = true; } } @@ -2070,6 +2071,7 @@ struct AnalysisSameEventPairing { } } fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s", sig->GetName()), VarManager::fgValues); if (fConfigOptions.fConfigMiniTree) { // WARNING! To be checked dileptonMiniTreeGen(mcDecision, -999, t1_raw.pt(), t1_raw.eta(), t1_raw.phi(), t2_raw.pt(), t2_raw.eta(), t2_raw.phi()); @@ -3056,6 +3058,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char if (classStr.Contains("MCTruthGenPair")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_pair", histName); } + if (classStr.Contains("MCTruthGenPseudoPolPair")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-gen", histName); + } if (classStr.Contains("MCTruthGenSelBR")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_triple"); From 39b53ee97244515403dfadb949b647c628b2e320 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:35:13 +0530 Subject: [PATCH 055/282] [PWGHF] Add histograms in Non-HFE analysis (#15491) Co-authored-by: rashi.gupta@cern.ch --- .../electronSelectionWithTpcEmcal.cxx | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 8acebbbe14d..e3a571d3bdd 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -189,14 +189,20 @@ struct HfElectronSelectionWithTpcEmcal { registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); registry.add("hNeventsAfterPassEmcal", "No of events pass the Emcal", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); - registry.add("hLikeMass", "Like mass", {HistType::kTH1D, {{axisMass}}}); - registry.add("hUnLikeMass", "unLike mass", {HistType::kTH1D, {{axisMass}}}); - registry.add("hLikeSignPt", "Like sign Momentum ", {HistType::kTH1D, {{axisPt}}}); - registry.add("hUnLikeSignPt", "UnLike sign Momentum", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_EMCAL", "Like mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_EMCAL", "unLike mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_EMCAL", "Like sign Momentum Emcal ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_EMCAL", "UnLike sign Momentum Emcal", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_NoEMCAL", "Like mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_NoEMCAL", "unLike mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_NoEMCAL", "Like sign Momentum NoEMCAL ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_NoEMCAL", "UnLike sign Momentum NoEMCAL", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenInElectron", "Mc Gen Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecInElectron", "Mc Rec Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecwithoutEMCalInElectron", "Mc Rec Inclusive Electron without Emcal", {HistType::kTH1D, {{axisPt}}}); - + registry.add("hphiElectron", "hphiElectron", {HistType::kTH1D, {axisPhi}}); + registry.add("hphiElectronPassEmcal", "hphiElectron pass Emcal", {HistType::kTH1D, {axisPhi}}); registry.add("hMcgenAllNonHfeElectron", "Mc Gen All NonHf Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcgenNonHfeElectron", "Mc Gen NonHf Electron with mother", {HistType::kTH1D, {{axisPt}}}); registry.add("hPi0eEmbTrkPt", "Mc Gen Pi0 mother NonHf Electron", {HistType::kTH1D, {{axisPt}}}); @@ -353,7 +359,9 @@ struct HfElectronSelectionWithTpcEmcal { vecLSMass.push_back(massLike); isLSElectron = true; if (isEMcal) { - registry.fill(HIST("hLikeMass"), massLike); + registry.fill(HIST("hLikeMass_EMCAL"), massLike); + } else { + registry.fill(HIST("hLikeMass_NoEMCAL"), massLike); } } // for unlike charge @@ -362,7 +370,9 @@ struct HfElectronSelectionWithTpcEmcal { vecULSMass.push_back(massUnLike); isULSElectron = true; if (isEMcal) { - registry.fill(HIST("hUnLikeMass"), massUnLike); + registry.fill(HIST("hUnLikeMass_EMCAL"), massUnLike); + } else { + registry.fill(HIST("hUnLikeMass_NoEMCAL"), massUnLike); } } @@ -371,7 +381,9 @@ struct HfElectronSelectionWithTpcEmcal { massLike = invMassElectron; ++nElPairsLS; if (isEMcal) { - registry.fill(HIST("hLikeSignPt"), electron.pt()); + registry.fill(HIST("hLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hLikeSignPt_NoEMCAL"), electron.pt()); } } // for unlike charge @@ -379,7 +391,9 @@ struct HfElectronSelectionWithTpcEmcal { massUnLike = invMassElectron; ++nElPairsUS; if (isEMcal) { - registry.fill(HIST("hUnLikeSignPt"), electron.pt()); + registry.fill(HIST("hUnLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hUnLikeSignPt_NoEMCAL"), electron.pt()); } } } @@ -445,7 +459,7 @@ struct HfElectronSelectionWithTpcEmcal { } if (fillTrackInfo) { - registry.fill(HIST("hTrackEtaPhi"), etaTrack, phiTrack, passEMCal); // track etaphi infor after filter bit + // track etaphi infor after filter bit registry.fill(HIST("hTrackEnergyLossVsP"), track.tpcSignal(), pTrack, passEMCal); // track etaphi infor after filter bit registry.fill(HIST("hTrackEnergyLossVsPt"), track.tpcSignal(), ptTrack, passEMCal); // track etaphi infor after filter bit registry.fill(HIST("hTracknSigmaVsP"), tpcNsigmaTrack, pTrack, passEMCal); // track etaphi infor after filter bit @@ -530,7 +544,7 @@ struct HfElectronSelectionWithTpcEmcal { if (eop < eopElectronMin || eop > eopElectronMax) { continue; } - + registry.fill(HIST("hphiElectronPassEmcal"), track.phi()); ///////////////// NonHf electron Selection with Emcal //////////////////////// if constexpr (IsMc) { if (matchTrack.has_mcParticle()) { @@ -648,6 +662,7 @@ struct HfElectronSelectionWithTpcEmcal { if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) { continue; } + registry.fill(HIST("hphiElectron"), track.phi()); if constexpr (IsMc) { if (track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); From 1c1aec18a595ec2d2c3fb557a1c8fb010f2259f3 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 26 Mar 2026 01:15:04 +0900 Subject: [PATCH 056/282] [PWGEM/Dilepton] fix in dimuon MC (#15518) --- PWGEM/Dilepton/Core/DileptonMC.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 0c00de8bec5..219645bdb58 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -73,7 +73,7 @@ using MyMCElectron = MyMCElectrons::iterator; using FilteredMyMCElectrons = soa::Filtered; using FilteredMyMCElectron = FilteredMyMCElectrons::iterator; -using MyMCMuons = soa::Join; +using MyMCMuons = soa::Join; using MyMCMuon = MyMCMuons::iterator; using FilteredMyMCMuons = soa::Filtered; using FilteredMyMCMuon = FilteredMyMCMuons::iterator; From 3e935e85b162b4baf772895f34c8e781cf9ae359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Jos=C3=A9?= <52935244+lucasjsilva@users.noreply.github.com> Date: Wed, 25 Mar 2026 18:32:12 +0100 Subject: [PATCH 057/282] [PWGLF] Inclusion of bestCollision to treat outliers (#15519) --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index cab9f30cb9a..30025ca9103 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -129,7 +129,7 @@ struct StudyPnch { x->SetBinLabel(6, "INEL > 0"); x->SetBinLabel(7, "|vz| < 10"); - if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) { + if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessModifiedMonteCarlo) { histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false); } if (doprocessData) { @@ -148,6 +148,12 @@ struct StudyPnch { histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true); histos.add("hCountNTracks", "hCountNTracks", kTH1F, {axisCountNumberTracks}, true); } + if (doprocessModifiedMonteCarlo) { + histos.add("hMultiplicityMCrecMod", "hMultiplicityMCrecMod", kTH1F, {axisMult}, true); + histos.add("hMultiplicityMCgenMod", "hMultiplicityMCgenMod", kTH1F, {axisMult}, true); + histos.add("hResponseMatrixMod", "hResponseMatrixMod", kTH2F, {axisMult, axisMult}, true); + histos.add("hCountNTracksMod", "hCountNTracksMod", kTH1F, {axisCountNumberTracks}, true); + } if (doprocessEvtLossSigLossMC) { histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); auto hstat = histos.get(HIST("MCEventHist")); @@ -163,7 +169,7 @@ struct StudyPnch { bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } histos.fill(HIST("EventHist"), 2); @@ -343,6 +349,28 @@ struct StudyPnch { } } + void processModifiedMonteCarlo(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + { + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); + auto multrec = countNTracksMcCol(recTracksPart, RecCol); + if (multrec > 0) { + histos.fill(HIST("hMultiplicityMCrec"), multrec); + } + auto multgen = countGenTracks(GenParticles, mcCollision); + if (multgen > 0 && multrec > 0) { + histos.fill(HIST("hMultiplicityMCgen"), multgen); + histos.fill(HIST("hResponseMatrix"), multrec, multgen); + } + } + } + void processEvtLossSigLossMC(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles) { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { @@ -387,6 +415,7 @@ struct StudyPnch { PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false); PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false); + PROCESS_SWITCH(StudyPnch, processModifiedMonteCarlo, "process MC CentFT0C", false); PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); }; From 3d15a8928285425901148b7b4337e1227b1952bd Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Wed, 25 Mar 2026 23:15:31 +0100 Subject: [PATCH 058/282] [PWGCF] Fixing histogram axes (#15522) Co-authored-by: Maxim Virta Co-authored-by: MaximVirta --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 395cd59148b..e9d32487a95 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -158,11 +158,12 @@ struct FlowGfwV02 { } cfgTrackCuts; struct : ConfigurableGroup { - ConfigurableAxis cfgAxisPt{"cfgPIDHistograms_cfgAxisPt", {VARIABLE_WIDTH, 0.2f, 0.5f, 1.f, 1.5f, 2.f, 3.f, 4.f, 6.f, 10.f}, "pt axis for histograms"}; - ConfigurableAxis cfgAxisNsigmaTPC{"cfgPIDHistograms_cfgAxisNsigmaTPC", {80, -5.f, 5.f}, "nsigmaTPC axis"}; - ConfigurableAxis cfgAxisNsigmaTOF{"cfgPIDHistograms_cfgAxisNsigmaTOF", {80, -5.f, 5.f}, "nsigmaTOF axis"}; - ConfigurableAxis cfgAxisNsigmaITS{"cfgPIDHistograms_cfgAxisNsigmaITS", {80, -5.f, 5.f}, "nsigmaITS axis"}; - ConfigurableAxis cfgAxisTpcSignal{"cfgPIDHistograms_cfgAxisTpcSignal", {250, 0.f, 250.f}, "dEdx axis for TPC"}; + ConfigurableAxis cfgAxisPt{"cfgAxisPt", {VARIABLE_WIDTH, 0.2f, 0.5f, 1.f, 1.5f, 2.f, 3.f, 4.f, 6.f, 10.f}, "pt axis for histograms"}; + ConfigurableAxis cfgAxisNsigmaTPC{"cfgAxisNsigmaTPC", {80, -5.f, 5.f}, "nsigmaTPC axis"}; + ConfigurableAxis cfgAxisNsigmaTOF{"cfgAxisNsigmaTOF", {80, -5.f, 5.f}, "nsigmaTOF axis"}; + ConfigurableAxis cfgAxisNsigmaITS{"cfgAxisNsigmaITS", {80, -5.f, 5.f}, "nsigmaITS axis"}; + ConfigurableAxis cfgAxisTpcSignal{"cfgAxisTpcSignal", {250, 0.f, 250.f}, "dEdx axis for TPC"}; + ConfigurableAxis cfgAxisSigma{"cfgAxisSigma", {200, 0, 20}, "sigma axis for TPC"}; } cfgPIDHistograms; // GFW binning @@ -315,15 +316,15 @@ struct FlowGfwV02 { registry.add("QA_PID/before/TofTpcNsigma_protons", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); } - registry.add("QA_PID/before/TpcdEdx_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpTpcdEdx_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpSigma_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/TpcdEdx_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpTpcdEdx_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpSigma_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/TpcdEdx_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpTpcdEdx_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpSigma_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_pions", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_pions", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpSigma_ptwise_pions", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisSigma, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_kaons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_kaons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpSigma_ptwise_kaons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisSigma, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_protons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_protons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpSigma_ptwise_protons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisSigma, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); registry.addClone("QA_PID/before/", "QA_PID/after/"); } From 8447267a00c0a679de26d675d2057dad0a51d142 Mon Sep 17 00:00:00 2001 From: Paola Vargas Torres <88360333+PaolaVT@users.noreply.github.com> Date: Wed, 25 Mar 2026 19:08:11 -0600 Subject: [PATCH 059/282] [PWGLF] Rename to multiplicityPt.cxx and update implementation (#15525) Co-authored-by: Paola Vargas Torres Co-authored-by: Paola Vargas Torres --- PWGLF/Tasks/Nuspex/CMakeLists.txt | 12 +- PWGLF/Tasks/Nuspex/MultiplicityPt.cxx | 1481 ------------------------- PWGLF/Tasks/Nuspex/multiplicityPt.cxx | 1134 +++++++++++++++++++ 3 files changed, 1140 insertions(+), 1487 deletions(-) delete mode 100644 PWGLF/Tasks/Nuspex/MultiplicityPt.cxx create mode 100644 PWGLF/Tasks/Nuspex/multiplicityPt.cxx diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 8cc49c394a4..0609b38835e 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -166,9 +166,9 @@ o2physics_add_dpl_workflow(he3-lambda-derived-analysis COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dedx-pid-analysis - SOURCES dedxPidAnalysis.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES dedxPidAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(pikp-raa-analysis SOURCES piKpRAA.cxx @@ -181,9 +181,9 @@ o2physics_add_dpl_workflow(chargedparticle-raa COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(multiplicity-pt - SOURCES MultiplicityPt.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES multiplicityPt.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(deuteron-in-jets-trg-pt SOURCES DeuteronInJetsTrgPt.cxx diff --git a/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx b/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx deleted file mode 100644 index 6d30693af1b..00000000000 --- a/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx +++ /dev/null @@ -1,1481 +0,0 @@ -// 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 "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/spectraTOF.h" -#include "PWGLF/Utils/inelGt.h" - -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "TPDGCode.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -using BCsRun3 = soa::Join; - -struct MultiplicityPt { - - // Service - Service pdg; - - // Add CCDB service for magnetic field - Service ccdb; - - Configurable isRun3{"isRun3", true, "is Run3 dataset"}; - Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; - Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; - Configurable askForCustomTVX{"askForCustomTVX", false, "Ask for custom TVX rather than sel8"}; - Configurable removeITSROFrameBorder{"removeITSROFrameBorder", false, "Remove ITS Read-Out Frame border"}; - Configurable removeNoSameBunchPileup{"removeNoSameBunchPileup", false, "Remove no same bunch pileup"}; - Configurable requireIsGoodZvtxFT0vsPV{"requireIsGoodZvtxFT0vsPV", false, "Require good Z vertex FT0 vs PV"}; - Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "Require vertex ITSTPC"}; - Configurable removeNoTimeFrameBorder{"removeNoTimeFrameBorder", false, "Remove no time frame border"}; - Configurable cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; - Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; - Configurable cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"}; - Configurable cfgCutNsigma{"cfgCutNsigma", 3.0f, "nsigma cut range for tracks"}; - Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to require in TRD"}; - Configurable requireTrdOnly{"requireTrdOnly", false, "Require only tracks from TRD"}; - Configurable requireNoTrd{"requireNoTrd", false, "Require tracks without TRD"}; - Configurable multiplicityEstimator{"multiplicityEstimator", 6, - "Multiplicity estimator: 0=NoMult, 1=MultFV0M, 2=MultFT0M, 3=MultFDDM, 4=MultTracklets, 5=MultTPC, 6=MultNTracksPV, 7=MultNTracksPVeta1, 8=CentFT0C, 9=CentFT0M, 10=CentFV0A"}; - - // Analysis switches - Configurable enableDCAHistograms{"enableDCAHistograms", false, "Enable DCA histograms"}; - Configurable enablePIDHistograms{"enablePIDHistograms", true, "Enable PID histograms"}; - Configurable useCustomTrackCuts{"useCustomTrackCuts", true, "Flag to use custom track cuts"}; - Configurable itsPattern{"itsPattern", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; - Configurable requireITS{"requireITS", true, "Additional cut on the ITS requirement"}; - Configurable requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"}; - Configurable requireGoldenChi2{"requireGoldenChi2", true, "Additional cut on the GoldenChi2"}; - Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.f, "Additional cut on the minimum number of crossed rows in the TPC"}; - Configurable minNCrossedRowsOverFindableClustersTPC{"minNCrossedRowsOverFindableClustersTPC", 0.8f, "Additional cut on the minimum value of the ratio between crossed rows and findable clusters in the TPC"}; - Configurable maxChi2PerClusterTPC{"maxChi2PerClusterTPC", 4.f, "Additional cut on the maximum value of the chi2 per cluster in the TPC"}; - Configurable minChi2PerClusterTPC{"minChi2PerClusterTPC", 0.5f, "Additional cut on the minimum value of the chi2 per cluster in the TPC"}; - Configurable maxChi2PerClusterITS{"maxChi2PerClusterITS", 36.f, "Additional cut on the maximum value of the chi2 per cluster in the ITS"}; - Configurable maxDcaXYFactor{"maxDcaXYFactor", 1.f, "Additional cut on the maximum value of the DCA xy (multiplicative factor)"}; - Configurable maxDcaZ{"maxDcaZ", 0.1f, "Additional cut on the maximum value of the DCA z"}; - Configurable minTPCNClsFound{"minTPCNClsFound", 70.f, "Additional cut on the minimum value of the number of found clusters in the TPC"}; - Configurable min_ITS_nClusters{"min_ITS_nClusters", 5, "minimum number of found ITS clusters"}; - - // Phi cut parameters - Configurable applyPhiCut{"applyPhiCut", true, "Apply phi sector cut to remove problematic TPC regions"}; - Configurable pTthresholdPhiCut{"pTthresholdPhiCut", 2.0f, "pT threshold above which to apply phi cut"}; - Configurable phiCutLowParam1{"phiCutLowParam1", 0.119297, "First parameter for low phi cut"}; - Configurable phiCutLowParam2{"phiCutLowParam2", 0.000379693, "Second parameter for low phi cut"}; - Configurable phiCutHighParam1{"phiCutHighParam1", 0.16685, "First parameter for high phi cut"}; - Configurable phiCutHighParam2{"phiCutHighParam2", 0.00981942, "Second parameter for high phi cut"}; - - // Basic track cuts - Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; - Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; - - // Custom track cuts matching spectraTOF - TrackSelection customTrackCuts; - - // TF1 pointers for phi cuts - TF1* fphiCutLow = nullptr; - TF1* fphiCutHigh = nullptr; - - // Histogram Registry - HistogramRegistry ue; - - // ======================================================================== - // CENTRALITY/MULTIPLICITY CLASSES - Using same bins as before for consistency - // ======================================================================== - static constexpr int kCentralityClasses = 10; - static constexpr double CentClasses[kCentralityClasses + 1] = {0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 70.0, 100.0}; - - // Multiplicity percentile boundaries (computed on first pass) - std::vector multPercentileboundaries; - bool percentilesComputed = false; - - // Storage for multiplicity distribution (for percentile calculation) - std::vector multiplicityValues; - - // Table definitions - NO McCentFT0Ms dependency - using CollisionTableData = soa::Join; - using CollisionTableMC = soa::Join; - - // Track tables - TPC PID only - using TrackTableData = soa::Join; - using TrackTableMC = soa::Join; - - // MC tables - NO McCentFT0Ms - using CollisionTableMCTrue = aod::McCollisions; - using ParticleTableMC = aod::McParticles; - - // Preslice for MC particles - Preslice perMCCol = aod::mcparticle::mcCollisionId; - - // Multiplicity estimator enum - enum MultCodes : int { - kNoMultiplicity = 0, - kMultFV0M = 1, - kMultFT0M = 2, - kMultFDDM = 3, - kMultTracklets = 4, - kMultTPC = 5, - kMultNTracksPV = 6, - kMultNTracksPVeta1 = 7, - kCentralityFT0C = 8, - kCentralityFT0M = 9, - kCentralityFV0A = 10 - }; - - // Particle species enum - enum ParticleSpecies : int { - kPion = 0, - kKaon = 1, - kProton = 2, - kNSpecies = 3 - }; - - // PDG codes - static constexpr int PDGPion = 211; - static constexpr int PDGKaon = 321; - static constexpr int PDGProton = 2212; - - void processData(CollisionTableData::iterator const& collision, - TrackTableData const& tracks, - BCsRun3 const& bcs); - PROCESS_SWITCH(MultiplicityPt, processData, "process data", false); - - // MC processing - First pass to build percentiles - void processPercentileCalibration(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles); - PROCESS_SWITCH(MultiplicityPt, processPercentileCalibration, "Build multiplicity percentile calibration (run first)", false); - - // MC processing - Main analysis - void processMC(TrackTableMC const& tracks, - aod::McParticles const& particles, - CollisionTableMCTrue const& mcCollisions, - CollisionTableMC const& collisions, - BCsRun3 const& bcs); - PROCESS_SWITCH(MultiplicityPt, processMC, "process MC", true); - - // True MC processing - void processTrue(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles); - PROCESS_SWITCH(MultiplicityPt, processTrue, "process true MC", true); - - // ======================================================================== - // MULTIPLICITY GETTER FUNCTIONS - Using raw charged particle count - // ======================================================================== - - // Count charged primaries in |eta| < 1.0 - template - int countChargedPrimaries(const MCCollisionType& mcCollision, const ParticleTableMC& particles) const - { - int nCharged = 0; - auto particlesInColl = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - for (const auto& p : particlesInColl) { - if (!p.isPhysicalPrimary()) - continue; - auto pdgParticle = pdg->GetParticle(p.pdgCode()); - if (!pdgParticle || pdgParticle->Charge() == 0.) - continue; - if (std::abs(p.eta()) < 1.0) - nCharged++; - } - return nCharged; - } - - // For reconstructed collisions - template - float getMultiplicity(const CollisionType& collision) const - { - switch (multiplicityEstimator.value) { - case kNoMultiplicity: - return 50.f; - case kMultFV0M: - return collision.multZeqFV0A(); - case kMultFT0M: - return collision.multZeqFT0A() + collision.multZeqFT0C(); - case kMultFDDM: - return collision.multZeqFDDA() + collision.multZeqFDDC(); - case kMultTracklets: - return 0.f; - case kMultTPC: - return collision.multTPC(); - case kMultNTracksPV: - return collision.multZeqNTracksPV(); - case kMultNTracksPVeta1: - return collision.multNTracksPVeta1(); - case kCentralityFT0C: - case kCentralityFT0M: - case kCentralityFV0A: - return collision.multZeqNTracksPV(); - default: - return 0.f; - } - } - - // For MC collisions - returns RAW multiplicity - template - float getMultiplicityMC(const MCCollisionType& mcCollision, const ParticleTableMC& particles) const - { - return static_cast(countChargedPrimaries(mcCollision, particles)); - } - - // Convert raw multiplicity to percentile - float multiplicityToPercentile(float rawMult) const - { - if (!percentilesComputed || multPercentileboundaries.empty()) { - // If percentiles not computed, return raw multiplicity - return rawMult; - } - - // Find which percentile bin this multiplicity falls into - for (size_t i = 0; i < multPercentileboundaries.size() - 1; ++i) { - if (rawMult >= multPercentileboundaries[i] && rawMult < multPercentileboundaries[i + 1]) { - // Return the CENTER of the percentile bin - return CentClasses[i] + (CentClasses[i + 1] - CentClasses[i]) / 2.0; - } - } - - // Handle edge cases - if (rawMult < multPercentileboundaries[0]) { - return CentClasses[0]; - } - return CentClasses[kCentralityClasses]; - } - - // Get centrality class index from raw multiplicity - int getCentralityClass(float rawMult) const - { - if (!percentilesComputed || multPercentileboundaries.empty()) { - // Fallback: divide into equal bins - float maxMult = 150.0f; // Assumed maximum - int bin = static_cast((rawMult / maxMult) * kCentralityClasses); - return std::min(bin, kCentralityClasses - 1); - } - - // Use computed percentiles - for (int i = 0; i < kCentralityClasses; ++i) { - if (rawMult >= multPercentileboundaries[i] && rawMult < multPercentileboundaries[i + 1]) { - return i; - } - } - - // Outside range - if (rawMult < multPercentileboundaries[0]) - return 0; - return kCentralityClasses - 1; - } - - // ======================================================================== - // COMPUTE PERCENTILE BOUNDARIES - // ======================================================================== - void computePercentileBoundaries() - { - if (multiplicityValues.empty()) { - LOG(warning) << "No multiplicity values to compute percentiles from!"; - return; - } - - // Sort multiplicity values - std::sort(multiplicityValues.begin(), multiplicityValues.end()); - - LOG(info) << "Computing percentile boundaries from " << multiplicityValues.size() << " events"; - - // Compute percentile boundaries - multPercentileboundaries.clear(); - multPercentileboundaries.reserve(kCentralityClasses + 1); - - for (int i = 0; i <= kCentralityClasses; ++i) { - float percentile = CentClasses[i]; - size_t index = static_cast(percentile / 100.0 * multiplicityValues.size()); - if (index >= multiplicityValues.size()) { - index = multiplicityValues.size() - 1; - } - float boundary = multiplicityValues[index]; - multPercentileboundaries.push_back(boundary); - LOG(info) << "Percentile " << percentile << "% -> Multiplicity >= " << boundary; - } - - percentilesComputed = true; - - LOG(info) << "=== Percentile Boundaries Computed ==="; - for (int i = 0; i < kCentralityClasses; ++i) { - LOG(info) << "Class " << i << ": [" << CentClasses[i] << "%-" << CentClasses[i + 1] - << "%] = Mult [" << multPercentileboundaries[i] << "-" << multPercentileboundaries[i + 1] << ")"; - } - } - - // ======================================================================== - // MAGNETIC FIELD FUNCTION - // ======================================================================== - int getMagneticField(uint64_t timestamp) - { - static o2::parameters::GRPMagField* grpo = nullptr; - if (grpo == nullptr) { - grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); - if (grpo == nullptr) { - LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); - return 0; - } - LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field()); - } - return grpo->getNominalL3Field(); - } - - // ======================================================================== - // PHI CUT FUNCTION - // ======================================================================== - template - bool passedPhiCut(const TrackType& track, float magField) const - { - if (!applyPhiCut.value) { - return true; - } - - if (track.pt() < pTthresholdPhiCut.value) { - return true; - } - - float pt = track.pt(); - float phi = track.phi(); - int charge = track.sign(); - - if (magField < 0) { - phi = o2::constants::math::TwoPI - phi; - } - if (charge < 0) { - phi = o2::constants::math::TwoPI - phi; - } - - phi += o2::constants::math::PI / 18.0f; - phi = std::fmod(phi, o2::constants::math::PI / 9.0f); - - if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt)) { - return false; - } - - return true; - } - - float getTransformedPhi(const float phi, const int charge, const float magField) const - { - float transformedPhi = phi; - if (magField < 0) { - transformedPhi = o2::constants::math::TwoPI - transformedPhi; - } - if (charge < 0) { - transformedPhi = o2::constants::math::TwoPI - transformedPhi; - } - transformedPhi += o2::constants::math::PI / 18.0f; - transformedPhi = std::fmod(transformedPhi, o2::constants::math::PI / 9.0f); - return transformedPhi; - } - - // ======================================================================== - // TRACK SELECTION FUNCTIONS - // ======================================================================== - - template - bool passesCutWoDCA(TrackType const& track) const - { - if (useCustomTrackCuts.value) { - for (int i = 0; i < static_cast(TrackSelection::TrackCuts::kNCuts); i++) { - if (i == static_cast(TrackSelection::TrackCuts::kDCAxy) || - i == static_cast(TrackSelection::TrackCuts::kDCAz)) { - continue; - } - if (!customTrackCuts.IsSelected(track, static_cast(i))) { - return false; - } - } - return true; - } - return track.isGlobalTrackWoDCA(); - } - - template - bool passesDCAxyCut(TrackType const& track) const - { - if (useCustomTrackCuts.value) { - if (!passesCutWoDCA(track)) { - return false; - } - constexpr float dcaXYConst = 0.0105f; - constexpr float dcaXYPtScale = 0.0350f; - constexpr float dcaXYPtPower = 1.1f; - const float maxDcaXY = maxDcaXYFactor.value * (dcaXYConst + dcaXYPtScale / std::pow(track.pt(), dcaXYPtPower)); - if (std::abs(track.dcaXY()) > maxDcaXY) { - return false; - } - return true; - } - return track.isGlobalTrack(); - } - - template - bool passesTrackSelection(TrackType const& track, float magField = 0) const - { - if (track.eta() < cfgCutEtaMin.value || track.eta() > cfgCutEtaMax.value) - return false; - - if (track.tpcChi2NCl() < minChi2PerClusterTPC.value || track.tpcChi2NCl() > maxChi2PerClusterTPC.value) - return false; - - if (!passesCutWoDCA(track)) - return false; - - if (applyPhiCut.value && !passedPhiCut(track, magField)) - return false; - - return passesDCAxyCut(track); - } - - // ======================================================================== - // PID SELECTION FUNCTIONS - // ======================================================================== - - template - bool passesPIDSelection(TrackType const& track) const - { - float nsigmaTPC = 0.f; - - if constexpr (species == kPion) { - nsigmaTPC = track.tpcNSigmaPi(); - } else if constexpr (species == kKaon) { - nsigmaTPC = track.tpcNSigmaKa(); - } else if constexpr (species == kProton) { - nsigmaTPC = track.tpcNSigmaPr(); - } - - return (std::abs(nsigmaTPC) < cfgCutNsigma.value); - } - - template - int getBestPIDHypothesis(TrackType const& track) const - { - float nsigmaPi = std::abs(track.tpcNSigmaPi()); - float nsigmaKa = std::abs(track.tpcNSigmaKa()); - float nsigmaPr = std::abs(track.tpcNSigmaPr()); - - constexpr float largeNSigmaValue = 999.0f; - float minNSigma = largeNSigmaValue; - int bestSpecies = -1; - - if (nsigmaPi < cfgCutNsigma.value && nsigmaPi < minNSigma) { - minNSigma = nsigmaPi; - bestSpecies = kPion; - } - if (nsigmaKa < cfgCutNsigma.value && nsigmaKa < minNSigma) { - minNSigma = nsigmaKa; - bestSpecies = kKaon; - } - if (nsigmaPr < cfgCutNsigma.value && nsigmaPr < minNSigma) { - minNSigma = nsigmaPr; - bestSpecies = kProton; - } - - return bestSpecies; - } - - // ======================================================================== - // EVENT SELECTION FUNCTION - // ======================================================================== - - template - bool isEventSelected(CollisionType const& collision) - { - if constexpr (fillHistograms) { - ue.fill(HIST("evsel"), 1.f); - if (collision.isInelGt0()) - ue.fill(HIST("evsel"), 2.f); - if (collision.isInelGt1()) - ue.fill(HIST("evsel"), 3.f); - } - - if (askForCustomTVX.value) { - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) - return false; - } else { - if (!collision.sel8()) - return false; - } - - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 4.f); - - if (removeITSROFrameBorder.value && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 5.f); - - if (removeNoSameBunchPileup.value && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 6.f); - - if (requireIsGoodZvtxFT0vsPV.value && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 7.f); - - if (requireIsVertexITSTPC.value && !collision.selection_bit(aod::evsel::kIsVertexITSTPC)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 8.f); - - if (removeNoTimeFrameBorder.value && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 9.f); - - if (std::abs(collision.posZ()) > cfgCutVertex.value) - return false; - - if constexpr (fillHistograms) { - ue.fill(HIST("evsel"), 13.f); - if (collision.isInelGt0()) - ue.fill(HIST("evsel"), 14.f); - if (collision.isInelGt1()) - ue.fill(HIST("evsel"), 15.f); - } - - if (cfgINELCut.value == 1 && !collision.isInelGt0()) - return false; - if (cfgINELCut.value == 2 && !collision.isInelGt1()) - return false; - - return true; - } - - // ======================================================================== - // PRIMARY SELECTION - // ======================================================================== - - template - bool isGoodPrimary(ParticleType const& particle) const - { - auto pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (!pdgParticle || pdgParticle->Charge() == 0.) - return false; - - if (!particle.isPhysicalPrimary()) - return false; - - if (std::abs(particle.eta()) >= cfgCutEtaMax.value) - return false; - if (particle.pt() < cfgTrkLowPtCut.value) - return false; - - if (std::abs(particle.y()) > cfgCutY.value) - return false; - - return true; - } - - template - bool isGoodPrimarySpecies(ParticleType const& particle) const - { - int pdgCode = std::abs(particle.pdgCode()); - int expectedPDG = 0; - - if constexpr (species == kPion) - expectedPDG = PDGPion; - else if constexpr (species == kKaon) - expectedPDG = PDGKaon; - else if constexpr (species == kProton) - expectedPDG = PDGProton; - - if (pdgCode != expectedPDG) - return false; - - return isGoodPrimary(particle); - } - - void init(InitContext const&); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} - -void MultiplicityPt::init(InitContext const&) -{ - // ======================================================================== - // CUSTOM TRACK CUTS INITIALIZATION - // ======================================================================== - - if (useCustomTrackCuts.value) { - LOG(info) << "Using custom track cuts matching spectraTOF approach"; - customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(itsPattern.value); - - customTrackCuts.SetRequireITSRefit(requireITS.value); - customTrackCuts.SetRequireTPCRefit(requireTPC.value); - customTrackCuts.SetMinNClustersITS(min_ITS_nClusters.value); - customTrackCuts.SetRequireGoldenChi2(requireGoldenChi2.value); - customTrackCuts.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); - customTrackCuts.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); - customTrackCuts.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); - customTrackCuts.SetMinNClustersTPC(minTPCNClsFound.value); - customTrackCuts.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); - customTrackCuts.SetMaxDcaXYPtDep([](float /*pt*/) { return 10000.f; }); - customTrackCuts.SetMaxDcaZ(maxDcaZ.value); - - customTrackCuts.print(); - } - - // ======================================================================== - // PHI CUT INITIALIZATION - // ======================================================================== - - if (applyPhiCut.value) { - fphiCutLow = new TF1("StandardPhiCutLow", - Form("%f/x/x+pi/18.0-%f", - phiCutLowParam1.value, phiCutLowParam2.value), - 0, 50); - fphiCutHigh = new TF1("StandardPhiCutHigh", - Form("%f/x+pi/18.0+%f", - phiCutHighParam1.value, phiCutHighParam2.value), - 0, 50); - - LOGF(info, "=== Phi Cut Parameters ==="); - LOGF(info, "Low cut: %.6f/x² + pi/18 - %.6f", - phiCutLowParam1.value, phiCutLowParam2.value); - LOGF(info, "High cut: %.6f/x + pi/18 + %.6f", - phiCutHighParam1.value, phiCutHighParam2.value); - LOGF(info, "Applied for pT > %.1f GeV/c", pTthresholdPhiCut.value); - } - - // ======================================================================== - // AXIS DEFINITIONS - // ======================================================================== - - ConfigurableAxis ptBinning{ - "ptBinning", - {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}, - "pT bin limits"}; - AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; - - // Multiplicity axis - initially raw multiplicity, will represent percentiles after calibration - std::vector centBins(CentClasses, CentClasses + kCentralityClasses + 1); - AxisSpec multAxis = {centBins, "Centrality/Multiplicity Class (%)"}; - - // Raw multiplicity axis for calibration - AxisSpec rawMultAxis = {150, 0, 150, "N_{ch} (|#eta| < 1.0)"}; - - // ======================================================================== - // HISTOGRAM REGISTRY - // ======================================================================== - - // Multiplicity distribution for percentile calibration - ue.add("Calibration/hRawMultiplicity", "Raw multiplicity distribution;N_{ch};Events", - HistType::kTH1D, {rawMultAxis}); - - // Event counting - ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", HistType::kTH1D, {{10, 0.5, 10.5}}); - auto hColl = ue.get(HIST("MC/GenRecoCollisions")); - hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); - hColl->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); - - // Event loss histograms - ue.add("MC/EventLoss/MultGenerated", "Generated events vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultBadVertex", "Events with bad vertex vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultPhysicsSelected", "Physics-selected events vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultReconstructed", "Reconstructed events vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultRecoSelected", "Reconstructed+selected events vs multiplicity", - HistType::kTH1D, {multAxis}); - - ue.add("hEventLossBreakdown", "Event loss breakdown", HistType::kTH1D, {{4, 0.5, 4.5}}); - auto hLoss = ue.get(HIST("hEventLossBreakdown")); - hLoss->GetXaxis()->SetBinLabel(1, "Physics selected"); - hLoss->GetXaxis()->SetBinLabel(2, "Reconstructed"); - hLoss->GetXaxis()->SetBinLabel(3, "Selected"); - hLoss->GetXaxis()->SetBinLabel(4, "Final efficiency"); - - // ======================================================================== - // INCLUSIVE CHARGED PARTICLE HISTOGRAMS - // ======================================================================== - - ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGenAllVsMult", "All generated primaries vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimBadVertexVsMult", "Generated primaries (bad vertex) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGenVsMult", "Generated primaries (after phys sel) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimRecoEvVsMult", "Generated primaries (reco events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGoodEvVsMult", "Generated primaries (good events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtNumEffVsMult", "Tracking efficiency numerator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtDenEffVsMult", "Tracking efficiency denominator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtAllRecoVsMult", "All reconstructed tracks vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimRecoVsMult", "Reconstructed primaries vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtSecRecoVsMult", "Reconstructed secondaries vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtMeasured", "All measured tracks;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtMeasuredVsMult", "All measured tracks vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - // ======================================================================== - // PARTICLE-SPECIFIC HISTOGRAMS - // ======================================================================== - - const std::array particleNames = {"Pion", "Kaon", "Proton"}; - const std::array particleSymbols = {"#pi^{#pm}", "K^{#pm}", "p+#bar{p}"}; - - for (int iSpecies = 0; iSpecies < kNSpecies; ++iSpecies) { - const auto& name = particleNames[iSpecies]; - const auto& symbol = particleSymbols[iSpecies]; - - // 1D versions - ue.add(Form("%s/hPtPrimGenAll", name.c_str()), - Form("All generated %s (no cuts);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimBadVertex", name.c_str()), - Form("Generated %s (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimGen", name.c_str()), - Form("Generated %s (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimRecoEv", name.c_str()), - Form("Generated %s (reco events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimGoodEv", name.c_str()), - Form("Generated %s (good events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - // 2D versions (vs multiplicity class) - ue.add(Form("%s/hPtPrimGenAllVsMult", name.c_str()), - Form("All generated %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimBadVertexVsMult", name.c_str()), - Form("Generated %s (bad vertex) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimGenVsMult", name.c_str()), - Form("Generated %s (after phys sel) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimRecoEvVsMult", name.c_str()), - Form("Generated %s (reco events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimGoodEvVsMult", name.c_str()), - Form("Generated %s (good events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // Tracking efficiency - ue.add(Form("%s/hPtNumEff", name.c_str()), - Form("%s tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtNumEffVsMult", name.c_str()), - Form("%s tracking eff numerator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtDenEff", name.c_str()), - Form("%s tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtDenEffVsMult", name.c_str()), - Form("%s tracking eff denominator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // Primary fraction - ue.add(Form("%s/hPtAllReco", name.c_str()), - Form("All reconstructed %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtAllRecoVsMult", name.c_str()), - Form("All reconstructed %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimReco", name.c_str()), - Form("Reconstructed primary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimRecoVsMult", name.c_str()), - Form("Reconstructed primary %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtSecReco", name.c_str()), - Form("Reconstructed secondary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtSecRecoVsMult", name.c_str()), - Form("Reconstructed secondary %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // Measured spectra - ue.add(Form("%s/hPtMeasured", name.c_str()), - Form("Measured %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtMeasuredVsMult", name.c_str()), - Form("Measured %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // PID quality - if (enablePIDHistograms) { - ue.add(Form("%s/hNsigmaTPC", name.c_str()), - Form("TPC n#sigma %s;#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", symbol.c_str()), - HistType::kTH2D, {ptAxis, {200, -10, 10}}); - } - } - - // ======================================================================== - // PHI CUT MONITORING - // ======================================================================== - - if (applyPhiCut.value) { - ue.add("PhiCut/hPtVsPhiPrimeBefore", "pT vs φ' before cut;p_{T} (GeV/c);φ'", - HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hPtVsPhiPrimeAfter", "pT vs φ' after cut;p_{T} (GeV/c);φ'", - HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hRejectionRate", "Track rejection rate by phi cut;p_{T} (GeV/c);Rejection Rate", - HistType::kTProfile, {{100, 0, 10}}); - } - - // ======================================================================== - // EVENT SELECTION HISTOGRAM - // ======================================================================== - - constexpr int nEvSelBins = 20; - constexpr float evSelMin = 0.5f; - constexpr float evSelMax = 20.5f; - ue.add("evsel", "Event selection", HistType::kTH1D, {{nEvSelBins, evSelMin, evSelMax}}); - auto h = ue.get(HIST("evsel")); - h->GetXaxis()->SetBinLabel(1, "Events read"); - h->GetXaxis()->SetBinLabel(2, "INEL>0"); - h->GetXaxis()->SetBinLabel(3, "INEL>1"); - h->GetXaxis()->SetBinLabel(4, "Trigger passed"); - h->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); - h->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); - h->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); - h->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); - h->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); - h->GetXaxis()->SetBinLabel(13, "posZ passed"); - h->GetXaxis()->SetBinLabel(14, "INEL>0 (final)"); - h->GetXaxis()->SetBinLabel(15, "INEL>1 (final)"); - - ue.add("hEta", "Track eta;#eta;Counts", HistType::kTH1D, {{20, -0.8, 0.8}}); - ue.add("hPhi", "Track phi;#varphi (rad);Counts", HistType::kTH1D, {{64, 0, 2.0 * M_PI}}); - ue.add("hvtxZ", "Vertex Z (data);Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - ue.add("hvtxZmc", "MC vertex Z;Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - - LOG(info) << "=== Initialized MultiplicityPt task with ON-THE-FLY PERCENTILE COMPUTATION ==="; - LOG(info) << "Centrality classes: " << kCentralityClasses; - LOG(info) << "Multiplicity estimator: " << multiplicityEstimator.value; - LOG(info) << "IMPORTANT: Run processPercentileCalibration FIRST to build percentile boundaries!"; - if (applyPhiCut.value) { - LOG(info) << "Phi cut ENABLED for pT > " << pTthresholdPhiCut.value << " GeV/c"; - } -} - -// ======================================================================== -// PERCENTILE CALIBRATION PASS -// ======================================================================== -void MultiplicityPt::processPercentileCalibration(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles) -{ - LOG(info) << "=== PERCENTILE CALIBRATION PASS ==="; - LOG(info) << "Processing " << mcCollisions.size() << " MC collisions"; - - multiplicityValues.clear(); - multiplicityValues.reserve(mcCollisions.size()); - - for (const auto& mcCollision : mcCollisions) { - // Apply basic cuts - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) - continue; - - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - - // Apply INEL cuts - if (cfgINELCut.value == 1 && !o2::pwglf::isINELgt0mc(particlesInCollision, pdg)) - continue; - if (cfgINELCut.value == 2 && !o2::pwglf::isINELgt1mc(particlesInCollision, pdg)) - continue; - - // Calculate multiplicity - float mcMult = getMultiplicityMC(mcCollision, particles); - multiplicityValues.push_back(mcMult); - - ue.fill(HIST("Calibration/hRawMultiplicity"), mcMult); - } - - // Compute percentile boundaries - computePercentileBoundaries(); - - LOG(info) << "=== PERCENTILE CALIBRATION COMPLETE ==="; - LOG(info) << "Processed " << multiplicityValues.size() << " events"; - LOG(info) << "Now run processMC and processTrue with these percentiles"; -} - -// ======================================================================== -// DATA PROCESSING -// ======================================================================== -void MultiplicityPt::processData(CollisionTableData::iterator const& collision, - TrackTableData const& tracks, - BCsRun3 const& /*bcs*/) -{ - if (!isEventSelected(collision)) { - return; - } - ue.fill(HIST("hvtxZ"), collision.posZ()); - - float magField = 0; - if (applyPhiCut.value) { - const auto& bc = collision.bc_as(); - magField = getMagneticField(bc.timestamp()); - } - - for (const auto& track : tracks) { - if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { - float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); - ue.fill(HIST("PhiCut/hPtVsPhiPrimeBefore"), track.pt(), phiPrime); - } - - if (!passesTrackSelection(track, magField)) { - continue; - } - - if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { - float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); - ue.fill(HIST("PhiCut/hPtVsPhiPrimeAfter"), track.pt(), phiPrime); - } - - ue.fill(HIST("Inclusive/hPtMeasured"), track.pt()); - ue.fill(HIST("hEta"), track.eta()); - ue.fill(HIST("hPhi"), track.phi()); - - int bestSpecies = getBestPIDHypothesis(track); - - if (bestSpecies == kPion) { - ue.fill(HIST("Pion/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } - } else if (bestSpecies == kKaon) { - ue.fill(HIST("Kaon/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } - } else if (bestSpecies == kProton) { - ue.fill(HIST("Proton/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); - } - } - } -} - -// ======================================================================== -// MC PROCESSING - Using computed percentiles -// ======================================================================== -void MultiplicityPt::processMC(TrackTableMC const& tracks, - aod::McParticles const& particles, - CollisionTableMCTrue const& mcCollisions, - CollisionTableMC const& collisions, - BCsRun3 const& /*bcs*/) -{ - if (!percentilesComputed) { - LOG(warning) << "Percentiles not computed yet! Run processPercentileCalibration first!"; - LOG(warning) << "Using fallback linear binning for now..."; - } - - LOG(info) << "=== DEBUG processMC START ==="; - LOG(info) << "MC collisions: " << mcCollisions.size(); - LOG(info) << "Reconstructed collisions: " << collisions.size(); - - ue.fill(HIST("MC/GenRecoCollisions"), 1.f, mcCollisions.size()); - ue.fill(HIST("MC/GenRecoCollisions"), 2.f, collisions.size()); - - std::set physicsSelectedMCCollisions; - std::set reconstructedMCCollisions; - std::set selectedMCCollisions; - - std::map mcCollisionMultiplicity; - std::map mcCollisionPercentile; - - // First pass: classify MC collisions - for (const auto& mcCollision : mcCollisions) { - int64_t mcCollId = mcCollision.globalIndex(); - - float mcMult = getMultiplicityMC(mcCollision, particles); - mcCollisionMultiplicity[mcCollId] = mcMult; - - // Convert to percentile - float percentile = multiplicityToPercentile(mcMult); - mcCollisionPercentile[mcCollId] = percentile; - - ue.fill(HIST("MC/EventLoss/MultGenerated"), percentile); - - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); - - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { - ue.fill(HIST("MC/EventLoss/MultBadVertex"), percentile); - continue; - } - - if (cfgINELCut.value == 1 && !o2::pwglf::isINELgt0mc(particlesInCollision, pdg)) { - continue; - } - if (cfgINELCut.value == 2 && !o2::pwglf::isINELgt1mc(particlesInCollision, pdg)) { - continue; - } - - physicsSelectedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/MultPhysicsSelected"), percentile); - } - - LOG(info) << "Physics-selected MC collisions: " << physicsSelectedMCCollisions.size(); - - // Second pass: track reconstructed events - std::set selectedCollisionIndices; - - for (const auto& collision : collisions) { - if (!collision.has_mcCollision()) { - continue; - } - - const auto& mcCollision = collision.mcCollision_as(); - int64_t mcCollId = mcCollision.globalIndex(); - - if (physicsSelectedMCCollisions.find(mcCollId) == physicsSelectedMCCollisions.end()) { - continue; - } - - float percentile = mcCollisionPercentile[mcCollId]; - - if (reconstructedMCCollisions.find(mcCollId) == reconstructedMCCollisions.end()) { - reconstructedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/MultReconstructed"), percentile); - } - - if (isEventSelected(collision)) { - if (selectedMCCollisions.find(mcCollId) == selectedMCCollisions.end()) { - selectedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/MultRecoSelected"), percentile); - } - selectedCollisionIndices.insert(collision.globalIndex()); - ue.fill(HIST("hvtxZ"), collision.posZ()); - } - } - - LOG(info) << "Reconstructed MC collisions: " << reconstructedMCCollisions.size(); - LOG(info) << "Selected MC collisions: " << selectedMCCollisions.size(); - - int nPhysicsSelected = physicsSelectedMCCollisions.size(); - int nReconstructed = reconstructedMCCollisions.size(); - int nSelected = selectedMCCollisions.size(); - - if (nPhysicsSelected > 0) { - ue.fill(HIST("hEventLossBreakdown"), 1, nPhysicsSelected); - ue.fill(HIST("hEventLossBreakdown"), 2, nReconstructed); - ue.fill(HIST("hEventLossBreakdown"), 3, nSelected); - ue.fill(HIST("hEventLossBreakdown"), 4, (nSelected * 100.0 / nPhysicsSelected)); - } - - // Process tracks - int totalTracksProcessed = 0; - int tracksFromSelectedEvents = 0; - int tracksPassingSelection = 0; - - std::array particleTracksIdentified = {0}; - std::array particleTracksPrimary = {0}; - std::array particleTracksSecondary = {0}; - - for (const auto& track : tracks) { - totalTracksProcessed++; - - if (!track.has_collision()) - continue; - - const auto& collision = track.collision_as(); - - if (selectedCollisionIndices.find(collision.globalIndex()) == selectedCollisionIndices.end()) { - continue; - } - tracksFromSelectedEvents++; - - if (!collision.has_mcCollision()) - continue; - - const auto& mcCollision = collision.mcCollision_as(); - float percentile = mcCollisionPercentile[mcCollision.globalIndex()]; - - float magField = 0; - if (applyPhiCut.value) { - const auto& bc = collision.bc_as(); - magField = getMagneticField(bc.timestamp()); - } - - if (!passesTrackSelection(track, magField)) { - continue; - } - tracksPassingSelection++; - - // Inclusive charged particle - ue.fill(HIST("Inclusive/hPtMeasured"), track.pt()); - ue.fill(HIST("Inclusive/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Inclusive/hPtAllReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtAllRecoVsMult"), track.pt(), percentile); - ue.fill(HIST("hEta"), track.eta()); - ue.fill(HIST("hPhi"), track.phi()); - - // Efficiency numerator - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - int pdgCode = std::abs(particle.pdgCode()); - - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Inclusive/hPtNumEff"), particle.pt()); - ue.fill(HIST("Inclusive/hPtNumEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtPrimRecoVsMult"), track.pt(), percentile); - - if (pdgCode == PDGPion) { - ue.fill(HIST("Pion/hPtNumEff"), particle.pt()); - ue.fill(HIST("Pion/hPtNumEffVsMult"), particle.pt(), percentile); - } - if (pdgCode == PDGKaon) { - ue.fill(HIST("Kaon/hPtNumEff"), particle.pt()); - ue.fill(HIST("Kaon/hPtNumEffVsMult"), particle.pt(), percentile); - } - if (pdgCode == PDGProton) { - ue.fill(HIST("Proton/hPtNumEff"), particle.pt()); - ue.fill(HIST("Proton/hPtNumEffVsMult"), particle.pt(), percentile); - } - } else { - ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtSecRecoVsMult"), track.pt(), percentile); - } - } - - // Identified particle analysis - int bestSpecies = getBestPIDHypothesis(track); - - if (bestSpecies == kPion) { - ue.fill(HIST("Pion/hPtMeasured"), track.pt()); - ue.fill(HIST("Pion/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Pion/hPtAllReco"), track.pt()); - ue.fill(HIST("Pion/hPtAllRecoVsMult"), track.pt(), percentile); - particleTracksIdentified[kPion]++; - - if (enablePIDHistograms) { - ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Pion/hPtPrimReco"), track.pt()); - ue.fill(HIST("Pion/hPtPrimRecoVsMult"), track.pt(), percentile); - particleTracksPrimary[kPion]++; - } else { - ue.fill(HIST("Pion/hPtSecReco"), track.pt()); - ue.fill(HIST("Pion/hPtSecRecoVsMult"), track.pt(), percentile); - particleTracksSecondary[kPion]++; - } - } - - } else if (bestSpecies == kKaon) { - ue.fill(HIST("Kaon/hPtMeasured"), track.pt()); - ue.fill(HIST("Kaon/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Kaon/hPtAllReco"), track.pt()); - ue.fill(HIST("Kaon/hPtAllRecoVsMult"), track.pt(), percentile); - particleTracksIdentified[kKaon]++; - - if (enablePIDHistograms) { - ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Kaon/hPtPrimReco"), track.pt()); - ue.fill(HIST("Kaon/hPtPrimRecoVsMult"), track.pt(), percentile); - particleTracksPrimary[kKaon]++; - } else { - ue.fill(HIST("Kaon/hPtSecReco"), track.pt()); - ue.fill(HIST("Kaon/hPtSecRecoVsMult"), track.pt(), percentile); - particleTracksSecondary[kKaon]++; - } - } - - } else if (bestSpecies == kProton) { - ue.fill(HIST("Proton/hPtMeasured"), track.pt()); - ue.fill(HIST("Proton/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Proton/hPtAllReco"), track.pt()); - ue.fill(HIST("Proton/hPtAllRecoVsMult"), track.pt(), percentile); - particleTracksIdentified[kProton]++; - - if (enablePIDHistograms) { - ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); - } - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Proton/hPtPrimReco"), track.pt()); - ue.fill(HIST("Proton/hPtPrimRecoVsMult"), track.pt(), percentile); - particleTracksPrimary[kProton]++; - } else { - ue.fill(HIST("Proton/hPtSecReco"), track.pt()); - ue.fill(HIST("Proton/hPtSecRecoVsMult"), track.pt(), percentile); - particleTracksSecondary[kProton]++; - } - } - } - } - - LOG(info) << "=== DEBUG TRACK COUNTING ==="; - LOG(info) << "Total tracks processed: " << totalTracksProcessed; - LOG(info) << "Tracks from selected events: " << tracksFromSelectedEvents; - LOG(info) << "Tracks passing selection: " << tracksPassingSelection; - - LOG(info) << "Pions identified: " << particleTracksIdentified[kPion] - << ", primary: " << particleTracksPrimary[kPion] - << ", secondary: " << particleTracksSecondary[kPion]; - LOG(info) << "Kaons identified: " << particleTracksIdentified[kKaon] - << ", primary: " << particleTracksPrimary[kKaon] - << ", secondary: " << particleTracksSecondary[kKaon]; - LOG(info) << "Protons identified: " << particleTracksIdentified[kProton] - << ", primary: " << particleTracksPrimary[kProton] - << ", secondary: " << particleTracksSecondary[kProton]; - - LOG(info) << "=== DEBUG processMC END ==="; -} - -// ======================================================================== -// TRUE MC PROCESSING - Using computed percentiles -// ======================================================================== -void MultiplicityPt::processTrue(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles) -{ - if (!percentilesComputed) { - LOG(warning) << "Percentiles not computed yet! Run processPercentileCalibration first!"; - } - - LOG(info) << "=== DEBUG processTrue START ==="; - LOG(info) << "Number of MC collisions: " << mcCollisions.size(); - - int nAllGenerated = 0; - int nBadVertex = 0; - int nPhysicsSelected = 0; - - std::array particleCountAll = {0}; - std::array particleCountBadVertex = {0}; - std::array particleCountAfterPS = {0}; - - for (const auto& mcCollision : mcCollisions) { - nAllGenerated++; - - float mcMult = getMultiplicityMC(mcCollision, particles); - float percentile = multiplicityToPercentile(mcMult); - - ue.fill(HIST("hvtxZmc"), mcCollision.posZ()); - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - - // Fill ALL generated primaries BEFORE any cuts - for (const auto& particle : particlesInCollision) { - if (isGoodPrimary(particle)) { - ue.fill(HIST("Inclusive/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Inclusive/hPtPrimGenAllVsMult"), particle.pt(), percentile); - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Pion/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Pion/hPtPrimGenAllVsMult"), particle.pt(), percentile); - particleCountAll[kPion]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Kaon/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Kaon/hPtPrimGenAllVsMult"), particle.pt(), percentile); - particleCountAll[kKaon]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Proton/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Proton/hPtPrimGenAllVsMult"), particle.pt(), percentile); - particleCountAll[kProton]++; - } - } - - // Apply vertex cut - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { - nBadVertex++; - - for (const auto& particle : particlesInCollision) { - if (isGoodPrimary(particle)) { - ue.fill(HIST("Inclusive/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Inclusive/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Pion/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Pion/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - particleCountBadVertex[kPion]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Kaon/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Kaon/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - particleCountBadVertex[kKaon]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Proton/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Proton/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - particleCountBadVertex[kProton]++; - } - } - continue; - } - - // Apply INEL cuts - if (cfgINELCut.value == 1 && !o2::pwglf::isINELgt0mc(particlesInCollision, pdg)) - continue; - if (cfgINELCut.value == 2 && !o2::pwglf::isINELgt1mc(particlesInCollision, pdg)) - continue; - - nPhysicsSelected++; - - // Fill primaries AFTER physics selection (denominator for efficiency) - for (const auto& particle : particlesInCollision) { - if (isGoodPrimary(particle)) { - ue.fill(HIST("Inclusive/hPtDenEff"), particle.pt()); - ue.fill(HIST("Inclusive/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Inclusive/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Inclusive/hPtPrimGenVsMult"), particle.pt(), percentile); - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Pion/hPtDenEff"), particle.pt()); - ue.fill(HIST("Pion/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Pion/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Pion/hPtPrimGenVsMult"), particle.pt(), percentile); - particleCountAfterPS[kPion]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Kaon/hPtDenEff"), particle.pt()); - ue.fill(HIST("Kaon/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Kaon/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Kaon/hPtPrimGenVsMult"), particle.pt(), percentile); - particleCountAfterPS[kKaon]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Proton/hPtDenEff"), particle.pt()); - ue.fill(HIST("Proton/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Proton/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Proton/hPtPrimGenVsMult"), particle.pt(), percentile); - particleCountAfterPS[kProton]++; - } - } - } - - LOG(info) << "=== DEBUG processTrue END ==="; - LOG(info) << "All generated events: " << nAllGenerated; - LOG(info) << "Events with bad vertex: " << nBadVertex; - LOG(info) << "Passing physics selection: " << nPhysicsSelected; - - LOG(info) << "=== PARTICLE-SPECIFIC STATISTICS ==="; - LOG(info) << "Pions - All: " << particleCountAll[kPion] - << ", Bad vertex: " << particleCountBadVertex[kPion] - << ", After PS: " << particleCountAfterPS[kPion]; - LOG(info) << "Kaons - All: " << particleCountAll[kKaon] - << ", Bad vertex: " << particleCountBadVertex[kKaon] - << ", After PS: " << particleCountAfterPS[kKaon]; - LOG(info) << "Protons - All: " << particleCountAll[kProton] - << ", Bad vertex: " << particleCountBadVertex[kProton] - << ", After PS: " << particleCountAfterPS[kProton]; -} diff --git a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx new file mode 100644 index 00000000000..59e06791e8f --- /dev/null +++ b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx @@ -0,0 +1,1134 @@ +// 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. + +/// \author Dushmanta Sahu (dushmanta.sahu@cern.ch) +/// \file multiplicityPt.cxx +/// \brief Analysis to do PID with MC + +#include "PWGLF/DataModel/LFParticleIdentification.h" +#include "PWGLF/DataModel/mcCentrality.h" // For McCentFT0Ms +#include "PWGLF/DataModel/spectraTOF.h" +#include "PWGLF/Utils/inelGt.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Logger.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "TPDGCode.h" +#include +#include +#include +#include + +#include +#include +#include +#include // For std::accumulate +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::math; +using namespace constants::physics; + +using BCsRun3 = soa::Join; + +//============================================================================= +// Main Analysis Struct +//============================================================================= +struct MultiplicityPt { + + // Service + Service pdg; + static constexpr int CentBinMax = 100; + static constexpr int MultBinMax = 200; + static constexpr int RecMultBinMax = 100; + static constexpr int DebugCountMax = 20; + static constexpr int CentMultClasses = 10; + + enum INELCutSelection : int { + INEL = 0, + INELgt0 = 1, + INELgt1 = 2 + + }; + + //=========================================================================== + // Configurable Parameters + //=========================================================================== + Configurable isRun3{"isRun3", true, "is Run3 dataset"}; + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; + Configurable askForCustomTVX{"askForCustomTVX", false, "Ask for custom TVX rather than sel8"}; + Configurable removeITSROFrameBorder{"removeITSROFrameBorder", false, "Remove ITS Read-Out Frame border"}; + Configurable removeNoSameBunchPileup{"removeNoSameBunchPileup", false, "Remove no same bunch pileup"}; + Configurable requireIsGoodZvtxFT0vsPV{"requireIsGoodZvtxFT0vsPV", false, "Require good Z vertex FT0 vs PV"}; + Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "Require vertex ITSTPC"}; + Configurable removeNoTimeFrameBorder{"removeNoTimeFrameBorder", false, "Remove no time frame border"}; + Configurable cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; + Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; + Configurable cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"}; + Configurable cfgCutNsigma{"cfgCutNsigma", 3.0f, "nsigma cut range for tracks"}; + Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to require in TRD"}; + Configurable requireTrdOnly{"requireTrdOnly", false, "Require only tracks from TRD"}; + Configurable requireNoTrd{"requireNoTrd", false, "Require tracks without TRD"}; + + // Analysis switches + Configurable enableDCAHistograms{"enableDCAHistograms", false, "Enable DCA histograms"}; + Configurable enablePIDHistograms{"enablePIDHistograms", true, "Enable PID histograms"}; + Configurable useCustomTrackCuts{"useCustomTrackCuts", true, "Flag to use custom track cuts"}; + Configurable itsPattern{"itsPattern", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; + Configurable requireITS{"requireITS", true, "Additional cut on the ITS requirement"}; + Configurable requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"}; + Configurable requireGoldenChi2{"requireGoldenChi2", true, "Additional cut on the GoldenChi2"}; + Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.f, "Additional cut on the minimum number of crossed rows in the TPC"}; + Configurable minNCrossedRowsOverFindableClustersTPC{"minNCrossedRowsOverFindableClustersTPC", 0.8f, "Additional cut on the minimum value of the ratio between crossed rows and findable clusters in the TPC"}; + Configurable maxChi2PerClusterTPC{"maxChi2PerClusterTPC", 4.f, "Additional cut on the maximum value of the chi2 per cluster in the TPC"}; + Configurable minChi2PerClusterTPC{"minChi2PerClusterTPC", 0.5f, "Additional cut on the minimum value of the chi2 per cluster in the TPC"}; + Configurable maxChi2PerClusterITS{"maxChi2PerClusterITS", 36.f, "Additional cut on the maximum value of the chi2 per cluster in the ITS"}; + Configurable maxDcaXYFactor{"maxDcaXYFactor", 1.f, "Additional cut on the maximum value of the DCA xy (multiplicative factor)"}; + Configurable maxDcaZ{"maxDcaZ", 0.1f, "Additional cut on the maximum value of the DCA z"}; + Configurable minTPCNClsFound{"minTPCNClsFound", 70.0f, "min number of found TPC clusters"}; + Configurable minTPCNClsPID{"minTPCNClsPID", 130.0f, "min number of PID TPC clusters"}; + Configurable nClTPCFoundCut{"nClTPCFoundCut", false, "Apply TPC found clusters cut"}; + Configurable nClTPCPIDCut{"nClTPCPIDCut", true, "Apply TPC clusters for PID cut"}; + + // Phi cut parameters + Configurable applyPhiCut{"applyPhiCut", false, "Apply phi sector cut"}; + + // Basic track cuts + Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; + Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; + + // PID selection - make them configurable per particle + Configurable cfgCutNsigmaPi{"cfgCutNsigmaPi", 3.0f, "nsigma cut for pions"}; + Configurable cfgCutNsigmaKa{"cfgCutNsigmaKa", 2.5f, "nsigma cut for kaons"}; + Configurable cfgCutNsigmaPr{"cfgCutNsigmaPr", 2.5f, "nsigma cut for protons"}; + + // Custom track cuts matching spectraTOF + TrackSelection customTrackCuts; + + // Histogram Registry + HistogramRegistry ue; + + //=========================================================================== + // Table Definitions - Using individual tables, not joined for MC + //=========================================================================== + + // Data collisions (not used but kept for completeness) + using CollisionTableData = soa::Join; + + // Track tables + using TrackTableData = soa::Join; + using TrackTableMC = soa::Join; + + // MC particles table + using ParticlesMC = aod::McParticles; + + // MC collisions table + using McCollisions = aod::McCollisions; + + // Reconstructed collisions (without joins that cause size mismatch) + using RecoCollisions = aod::Collisions; + + // Preslice for MC particles + Preslice perMCCol = aod::mcparticle::mcCollisionId; + + //=========================================================================== + // Constants + //=========================================================================== + enum ParticleSpecies : int { + kPion = 0, + kKaon = 1, + kProton = 2, + kNSpecies = 3 + }; + + static constexpr int PDGPion = kPiPlus; + static constexpr int PDGKaon = kKPlus; + static constexpr int PDGProton = kProton; + + //=========================================================================== + // Helper Functions + //=========================================================================== + + template + int countGeneratedChargedPrimaries(const ParticleContainer& particles, float etaMax, float ptMin) const + { + int count = 0; + for (const auto& particle : particles) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + continue; + + if (!particle.isPhysicalPrimary()) + continue; + + if (std::abs(particle.eta()) > etaMax) + continue; + + if (particle.pt() < ptMin) + continue; + + count++; + } + return count; + } + + template + bool passedNClTPCFoundCut(const T& trk) const + { + if (!nClTPCFoundCut.value) + return true; + return trk.tpcNClsFound() >= minTPCNClsFound.value; + } + + template + bool passedNClTPCPIDCut(const T& trk) const + { + if (!nClTPCPIDCut.value) + return true; + return trk.tpcNClsPID() >= minTPCNClsPID.value; + } + + template + bool passesCutWoDCA(TrackType const& track) const + { + if (useCustomTrackCuts.value) { + for (int i = 0; i < static_cast(TrackSelection::TrackCuts::kNCuts); i++) { + if (i == static_cast(TrackSelection::TrackCuts::kDCAxy) || + i == static_cast(TrackSelection::TrackCuts::kDCAz)) { + continue; + } + if (!customTrackCuts.IsSelected(track, static_cast(i))) { + return false; + } + } + return true; + } + return track.isGlobalTrackWoDCA(); + } + + template + bool passesDCAxyCut(TrackType const& track) const + { + if (useCustomTrackCuts.value) { + if (!passesCutWoDCA(track)) { + return false; + } + constexpr float DcaXYConst = 0.0105f; + constexpr float DcaXYPtScale = 0.0350f; + constexpr float DcaXYPtPower = 1.1f; + const float maxDcaXY = maxDcaXYFactor.value * (DcaXYConst + DcaXYPtScale / std::pow(track.pt(), DcaXYPtPower)); + return std::abs(track.dcaXY()) <= maxDcaXY; + } + return track.isGlobalTrack(); + } + + template + bool passesTrackSelection(TrackType const& track) const + { + if (track.eta() < cfgCutEtaMin.value || track.eta() > cfgCutEtaMax.value) + return false; + + if (track.tpcChi2NCl() < minChi2PerClusterTPC.value || track.tpcChi2NCl() > maxChi2PerClusterTPC.value) + return false; + + if (!passesCutWoDCA(track)) + return false; + + if (!passesDCAxyCut(track)) + return false; + + if (!passedNClTPCFoundCut(track)) + return false; + + if (!passedNClTPCPIDCut(track)) + return false; + + return true; + } + + template + bool passesPIDSelection(TrackType const& track) const + { + float nsigmaTPC = 0.f; + + if constexpr (species == kPion) { + nsigmaTPC = track.tpcNSigmaPi(); + } else if constexpr (species == kKaon) { + nsigmaTPC = track.tpcNSigmaKa(); + } else if constexpr (species == kProton) { + nsigmaTPC = track.tpcNSigmaPr(); + } + + float cutValue = cfgCutNsigma.value; + if constexpr (species == kPion) + cutValue = cfgCutNsigmaPi.value; + if constexpr (species == kKaon) + cutValue = cfgCutNsigmaKa.value; + if constexpr (species == kProton) + cutValue = cfgCutNsigmaPr.value; + + return (std::abs(nsigmaTPC) < cutValue); + } + + template + int getBestPIDHypothesis(TrackType const& track) const + { + float nsigmaPi = std::abs(track.tpcNSigmaPi()); + float nsigmaKa = std::abs(track.tpcNSigmaKa()); + float nsigmaPr = std::abs(track.tpcNSigmaPr()); + + float minNSigma = 999.0f; + int bestSpecies = -1; + + if (nsigmaPi < cfgCutNsigmaPi.value && nsigmaPi < minNSigma) { + minNSigma = nsigmaPi; + bestSpecies = kPion; + } + if (nsigmaKa < cfgCutNsigmaKa.value && nsigmaKa < minNSigma) { + minNSigma = nsigmaKa; + bestSpecies = kKaon; + } + if (nsigmaPr < cfgCutNsigmaPr.value && nsigmaPr < minNSigma) { + minNSigma = nsigmaPr; + bestSpecies = kProton; + } + + return bestSpecies; + } + + template + bool isGoodPrimary(ParticleType const& particle) const + { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + return false; + + if (!particle.isPhysicalPrimary()) + return false; + + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + return false; + if (particle.pt() < cfgTrkLowPtCut.value) + return false; + + return true; + } + + //=========================================================================== + // Process Switches + //=========================================================================== + void processData(CollisionTableData::iterator const& collision, + TrackTableData const& tracks, + BCsRun3 const& bcs); + PROCESS_SWITCH(MultiplicityPt, processData, "process data", false); + + void processMC(TrackTableMC const& tracks, + aod::McParticles const& particles, + aod::McCollisions const& mcCollisions, + RecoCollisions const& collisions, + aod::McCollisionLabels const& labels, + aod::McCentFT0Ms const& centTable, + BCsRun3 const& bcs); + PROCESS_SWITCH(MultiplicityPt, processMC, "process MC", true); + + //=========================================================================== + // Standard Framework Functions + //=========================================================================== + void init(InitContext const&); + + void endOfStream(EndOfStreamContext& /*eos*/) + { + LOG(info) << "\n=== END OF STREAM: Writing histograms to output ==="; + auto hGenMult = ue.get(HIST("MC/EventLoss/GenMultVsCent")); + if (hGenMult) { + LOG(info) << "GenMultVsCent: Entries=" << hGenMult->GetEntries() + << ", Integral=" << hGenMult->Integral(); + } + LOG(info) << "=== END OF STREAM COMPLETE ==="; + } +}; + +//============================================================================= +// Workflow Definition +//============================================================================= +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} + +//============================================================================= +// Implementation of Member Functions +//============================================================================= + +void MultiplicityPt::init(InitContext const&) +{ + LOG(info) << "=================================================="; + LOG(info) << "Initializing MultiplicityPt task with full centrality diagnostics"; + LOG(info) << "=================================================="; + + if (useCustomTrackCuts.value) { + LOG(info) << "Using custom track cuts matching spectraTOF approach"; + customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(itsPattern.value); + + customTrackCuts.SetRequireITSRefit(requireITS.value); + customTrackCuts.SetRequireTPCRefit(requireTPC.value); + customTrackCuts.SetRequireGoldenChi2(requireGoldenChi2.value); + customTrackCuts.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); + customTrackCuts.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); + customTrackCuts.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); + customTrackCuts.SetMinNClustersTPC(minTPCNClsFound.value); + customTrackCuts.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); + customTrackCuts.SetMaxDcaXYPtDep([](float /*pt*/) { return 10000.f; }); + customTrackCuts.SetMaxDcaZ(maxDcaZ.value); + + customTrackCuts.print(); + } + + // Axis definitions + ConfigurableAxis ptBinning{"ptBinning", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT bin limits"}; + + AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + + std::vector centBinningStd = {0., 1., 5., 10., 15., 20., 30., 40., 50., 60., 70., 80., 90., 100.}; + + // Fine centrality binning for diagnostics (100 bins, guaranteed increasing) + std::vector centBinningFine; + for (int i = 0; i <= CentBinMax; i++) { + centBinningFine.push_back(static_cast(i)); + } + + AxisSpec centAxis = {centBinningStd, "FT0M Centrality (%)"}; + AxisSpec centFineAxis = {centBinningFine, "FT0M Centrality (%)"}; + + // Multiplicity axes - properly defined + std::vector multBins; + for (int i = 0; i <= MultBinMax; i++) { + multBins.push_back(static_cast(i)); + } + AxisSpec multAxis = {multBins, "N_{ch}^{gen} (|#eta|<0.8)"}; + + // Reconstructed multiplicity axis - properly defined with explicit bin edges + std::vector recoMultBins; + for (int i = 0; i <= RecMultBinMax; i++) { + recoMultBins.push_back(static_cast(i)); + } + AxisSpec recoMultAxis = {recoMultBins, "N_{ch}^{reco}"}; + + //=========================================================================== + // Comprehensive Histogram Registration + //=========================================================================== + + // Centrality diagnostic histograms - USE FINE BINNING + ue.add("Centrality/hCentRaw", "Raw FT0M Centrality (no cuts);Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterVtx", "Centrality after vertex cut;Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterINEL", "Centrality after INEL cut;Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterAll", "Centrality after all cuts;Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + + // 2D correlations - USE FINE BINNING FOR DIAGNOSTICS + ue.add("Centrality/hCentVsMult", "Centrality vs Generated Multiplicity;Centrality (%);N_{ch}^{gen}", + HistType::kTH2D, {centFineAxis, multAxis}); + ue.add("Centrality/hMultVsCent", "Generated Multiplicity vs Centrality;N_{ch}^{gen};Centrality (%)", + HistType::kTH2D, {multAxis, centFineAxis}); + ue.add("Centrality/hCentVsVz", "Centrality vs Vertex Z;Centrality (%);V_{z} (cm)", + HistType::kTH2D, {centFineAxis, {40, -20, 20}}); + ue.add("Centrality/hRecoMultVsCent", "Reconstructed Track Multiplicity vs Centrality;Centrality (%);N_{tracks}^{reco}", + HistType::kTH2D, {centFineAxis, recoMultAxis}); + ue.add("Centrality/hGenMultPerCent", "Generated Multiplicity Distribution per Centrality Bin;Centrality (%);", + HistType::kTH2D, {centFineAxis, multAxis}); + + // Vertex resolution vs centrality + ue.add("Centrality/hVertexResVsCent", "Vertex Resolution vs Centrality;Centrality (%);V_{z} resolution (cm)", + HistType::kTH2D, {centFineAxis, {100, -1, 1}}); + + // INEL class distributions + ue.add("INEL/hINELClass", "INEL Class for MC Collisions;INEL Class;Counts", + HistType::kTH1D, {{3, 0.5, 3.5}}); + auto hINEL = ue.get(HIST("INEL/hINELClass")); + hINEL->GetXaxis()->SetBinLabel(1, "INEL0"); + hINEL->GetXaxis()->SetBinLabel(2, "INEL>0"); + hINEL->GetXaxis()->SetBinLabel(3, "INEL>1"); + + ue.add("INEL/hINELVsCent", "INEL Class vs Centrality;Centrality (%);INEL Class", + HistType::kTH2D, {centFineAxis, {3, 0.5, 3.5}}); + + // Cut flow + ue.add("CutFlow/hCutStats", "Cut Statistics;Cut Stage;Counts", + HistType::kTH1D, {{6, 0.5, 6.5}}); + auto hCut = ue.get(HIST("CutFlow/hCutStats")); + hCut->GetXaxis()->SetBinLabel(1, "All reco events"); + hCut->GetXaxis()->SetBinLabel(2, "Has MC match"); + hCut->GetXaxis()->SetBinLabel(3, "Has centrality"); + hCut->GetXaxis()->SetBinLabel(4, "Pass vertex"); + hCut->GetXaxis()->SetBinLabel(5, "Pass INEL"); + hCut->GetXaxis()->SetBinLabel(6, "Selected"); + + ue.add("CutFlow/hCentPerCut", "Centrality Distribution at Each Cut;Cut Stage;Centrality (%)", + HistType::kTH2D, {{6, 0.5, 6.5}, centFineAxis}); + + ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", + HistType::kTH1D, {{10, 0.5, 10.5}}); + auto hColl = ue.get(HIST("MC/GenRecoCollisions")); + hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); + hColl->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); + hColl->GetXaxis()->SetBinLabel(3, "INEL>0"); + hColl->GetXaxis()->SetBinLabel(4, "INEL>1"); + + ue.add("hEventLossBreakdown", "Event loss breakdown", + HistType::kTH1D, {{4, 0.5, 4.5}}); + auto hLoss = ue.get(HIST("hEventLossBreakdown")); + hLoss->GetXaxis()->SetBinLabel(1, "Physics selected"); + hLoss->GetXaxis()->SetBinLabel(2, "Reconstructed"); + hLoss->GetXaxis()->SetBinLabel(3, "Selected"); + hLoss->GetXaxis()->SetBinLabel(4, "Final efficiency"); + + // Multiplicity histograms + ue.add("MC/EventLoss/NchGenerated", "Generated charged multiplicity;N_{ch}^{gen} (|#eta|<0.8);Counts", + HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/NchGenerated_PhysicsSelected", "Generated charged multiplicity (physics selected);N_{ch}^{gen} (|#eta|<0.8);Counts", + HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/NchGenerated_Reconstructed", "Generated charged multiplicity (reconstructed);N_{ch}^{gen} (|#eta|<0.8);Counts", + HistType::kTH1D, {{200, 0, 200}}); + + // pT vs Multiplicity + ue.add("MC/GenPtVsNch", "Generated pT vs Multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", + HistType::kTH2D, {ptAxis, {200, 0, 200}}); + ue.add("MC/GenPtVsNch_PhysicsSelected", "Generated pT vs Multiplicity (physics selected);#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", + HistType::kTH2D, {ptAxis, {200, 0, 200}}); + + // Centrality vs Multiplicity correlations - USE STANDARD BINNING FOR THESE + ue.add("MC/EventLoss/GenMultVsCent", "Generated charged particles vs FT0M centrality;FT0M Centrality (%);N_{ch}^{gen} (|#eta|<0.8)", + HistType::kTH2D, {centAxis, multAxis}); + ue.add("MC/EventLoss/GenMultVsCent_Selected", "Generated vs FT0M centrality (selected events);FT0M Centrality (%);N_{ch}^{gen}", + HistType::kTH2D, {centAxis, multAxis}); + ue.add("MC/EventLoss/GenMultVsCent_Rejected", "Generated vs FT0M centrality (rejected events);FT0M Centrality (%);N_{ch}^{gen}", + HistType::kTH2D, {centAxis, multAxis}); + + // TPC cluster histograms + ue.add("hNclFoundTPC", "Number of TPC found clusters", + HistType::kTH1D, {{200, 0, 200, "N_{cl, found}"}}); + ue.add("hNclPIDTPC", "Number of TPC PID clusters", + HistType::kTH1D, {{200, 0, 200, "N_{cl, PID}"}}); + ue.add("hNclFoundTPCvsPt", "TPC found clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,found}", + HistType::kTH2D, {ptAxis, {200, 0., 200.}}); + ue.add("hNclPIDTPCvsPt", "TPC PID clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,PID}", + HistType::kTH2D, {ptAxis, {200, 0., 200.}}); + + // Inclusive histograms + ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + + ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + + ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + + ue.add("Inclusive/hPtMeasuredVsCent", "All measured tracks (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", + HistType::kTH2D, {ptAxis, centAxis}); + + // Particle-specific histograms + const std::array particleNames = {"Pion", "Kaon", "Proton"}; + const std::array particleSymbols = {"#pi^{#pm}", "K^{#pm}", "p+#bar{p}"}; + + for (int iSpecies = 0; iSpecies < kNSpecies; ++iSpecies) { + const auto& name = particleNames[iSpecies]; + const auto& symbol = particleSymbols[iSpecies]; + + ue.add(Form("%s/hPtPrimGenAll", name.c_str()), + Form("All generated %s (no cuts);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimBadVertex", name.c_str()), + Form("Generated %s (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimGen", name.c_str()), + Form("Generated %s (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimRecoEv", name.c_str()), + Form("Generated %s (reco events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimGoodEv", name.c_str()), + Form("Generated %s (good events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + + ue.add(Form("%s/hPtNumEff", name.c_str()), + Form("%s tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtDenEff", name.c_str()), + Form("%s tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + + ue.add(Form("%s/hPtAllReco", name.c_str()), + Form("All reconstructed %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimReco", name.c_str()), + Form("Reconstructed primary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtSecReco", name.c_str()), + Form("Reconstructed secondary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + + ue.add(Form("%s/hPtMeasuredVsCent", name.c_str()), + Form("Measured %s (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%%)", symbol.c_str()), + HistType::kTH2D, {ptAxis, centAxis}); + + if (enablePIDHistograms) { + ue.add(Form("%s/hNsigmaTPC", name.c_str()), + Form("TPC n#sigma %s;#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", symbol.c_str()), + HistType::kTH2D, {ptAxis, {200, -10, 10}}); + } + } + + // Event selection histogram + constexpr int NEvSelBins = 20; + constexpr float EvSelMin = 0.5f; + constexpr float EvSelMax = 20.5f; + ue.add("evsel", "Event selection", HistType::kTH1D, {{NEvSelBins, EvSelMin, EvSelMax}}); + auto h = ue.get(HIST("evsel")); + h->GetXaxis()->SetBinLabel(1, "Events read"); + h->GetXaxis()->SetBinLabel(4, "Trigger passed"); + h->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); + h->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); + h->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); + h->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); + h->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); + h->GetXaxis()->SetBinLabel(13, "posZ passed"); + + // Basic tracking histograms + ue.add("hEta", "Track eta;#eta;Counts", HistType::kTH1D, {{20, -0.8, 0.8}}); + ue.add("hPhi", "Track phi;#varphi (rad);Counts", HistType::kTH1D, {{64, 0, TwoPI}}); + ue.add("hvtxZ", "Vertex Z (data);Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); + ue.add("hvtxZmc", "MC vertex Z;Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); + + LOG(info) << "=== Initialized MultiplicityPt task with full centrality diagnostics ==="; + LOG(info) << "Standard centrality binning: " << centBinningStd.size() - 1 << " bins (0-100%)"; + LOG(info) << "Fine centrality binning: " << centBinningFine.size() - 1 << " bins (0-100%)"; +} + +//============================================================================= +// Process Functions +//============================================================================= + +void MultiplicityPt::processData(CollisionTableData::iterator const& /*collision*/, + TrackTableData const& /*tracks*/, + BCsRun3 const& /*bcs*/) +{ + // Intentionally empty - data processing disabled +} + +void MultiplicityPt::processMC(TrackTableMC const& tracks, + aod::McParticles const& particles, + aod::McCollisions const& mcCollisions, + RecoCollisions const& collisions, + aod::McCollisionLabels const& labels, + aod::McCentFT0Ms const& centTable, + BCsRun3 const& /*bcs*/) +{ + LOG(info) << "\n=== processMC START ==="; + LOG(info) << "Total MC collisions (generated): " << mcCollisions.size(); + LOG(info) << "Total reconstructed collisions: " << collisions.size(); + LOG(info) << "Total collision labels: " << labels.size(); + LOG(info) << "Total centrality entries: " << centTable.size(); + + //=========================================================================== + // DEBUG: Print raw centrality information first + //=========================================================================== + LOG(info) << "\n=== CENTRALITY DEBUG - RAW DATA ==="; + LOG(info) << "First 20 centrality values from centTable:"; + int debugCount = 0; + float minCent = 999.0f, maxCent = -999.0f; + std::map centDistribution; + + for (const auto& cent : centTable) { + float c = cent.centFT0M(); + if (debugCount < DebugCountMax) { + LOG(info) << " Cent entry " << debugCount << ": " << c; + } + minCent = std::min(minCent, c); + maxCent = std::max(maxCent, c); + + int bin10 = static_cast(c / 10) * 10; + centDistribution[bin10]++; + debugCount++; + } + + LOG(info) << "Centrality range: [" << minCent << ", " << maxCent << "]"; + LOG(info) << "Distribution by 10% bins:"; + for (int i = 0; i < CentBinMax; i += 10) { + LOG(info) << " " << i << "-" << i + 10 << "%: " << centDistribution[i]; + } + + // Check if centrality is inverted (0 = peripheral, 100 = central) + // If minCent is near 0 and maxCent near 100, check correlation with multiplicity + LOG(info) << "Checking if centrality might be inverted..."; + LOG(info) << "Will check correlation with multiplicity in the next step."; + + //=========================================================================== + // FIRST PASS: Build maps of MC collision ID to generated particle counts + //=========================================================================== + std::map mcCollisionToNch; + std::map mcCollisionVz; + std::set physicsSelectedMCCollisions; + std::map mcCollisionToINELClass; // 0=INEL0, 1=INEL>0, 2=INEL>1 + + ue.fill(HIST("MC/GenRecoCollisions"), 1.f, mcCollisions.size()); + ue.fill(HIST("MC/GenRecoCollisions"), 2.f, collisions.size()); + + LOG(info) << "\n--- FIRST PASS: Building MC collision maps ---"; + + int mcWithParticles = 0; + int mcINELgt0 = 0, mcINELgt1 = 0; + + for (const auto& mcCollision : mcCollisions) { + int64_t mcCollId = mcCollision.globalIndex(); + auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); + + int nGenCharged = countGeneratedChargedPrimaries(particlesInCollision, cfgCutEtaMax.value, cfgTrkLowPtCut.value); + + mcCollisionToNch[mcCollId] = nGenCharged; + mcCollisionVz[mcCollId] = mcCollision.posZ(); + + // Determine INEL class + bool inel0 = o2::pwglf::isINELgt0mc(particlesInCollision, pdg); + bool inel1 = o2::pwglf::isINELgt1mc(particlesInCollision, pdg); + + int inelClass = 0; + if (inel1) + inelClass = 2; + else if (inel0) + inelClass = 1; + mcCollisionToINELClass[mcCollId] = inelClass; + + ue.fill(HIST("INEL/hINELClass"), inelClass); + + if (inel0) + mcINELgt0++; + if (inel1) + mcINELgt1++; + if (nGenCharged > 0) + mcWithParticles++; + + ue.fill(HIST("MC/EventLoss/NchGenerated"), nGenCharged); + + // Physics selection based on vertex and INEL cuts + bool physicsSelected = true; + + if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { + physicsSelected = false; + } + + // Apply INEL cut based on configuration + if (cfgINELCut.value == INELgt0 && !inel0) { + physicsSelected = false; + } + if (cfgINELCut.value == INELgt1 && !inel1) { + physicsSelected = false; + } + + if (physicsSelected) { + physicsSelectedMCCollisions.insert(mcCollId); + ue.fill(HIST("MC/EventLoss/NchGenerated_PhysicsSelected"), nGenCharged); + + if (inel0) { + ue.fill(HIST("MC/GenRecoCollisions"), 3.f); + } + if (inel1) { + ue.fill(HIST("MC/GenRecoCollisions"), 4.f); + } + } + } + + LOG(info) << "\n--- FIRST PASS SUMMARY ---"; + LOG(info) << "Total MC collisions processed: " << mcCollisions.size(); + LOG(info) << "MC collisions with particles: " << mcWithParticles; + LOG(info) << "INEL0: " << (mcCollisions.size() - mcINELgt0); + LOG(info) << "INEL>0: " << mcINELgt0; + LOG(info) << "INEL>1: " << mcINELgt1; + LOG(info) << "Physics-selected MC collisions: " << physicsSelectedMCCollisions.size(); + + //=========================================================================== + // Build maps for labels and centrality + //=========================================================================== + std::map recoToMcMap; + std::map recoToCentMap; + + size_t nCollisions = collisions.size(); + + // Associate labels with collisions by index + size_t iLabel = 0; + for (const auto& label : labels) { + if (iLabel < nCollisions) { + const auto& collision = collisions.iteratorAt(iLabel); + int64_t recoCollId = collision.globalIndex(); + int64_t mcCollId = label.mcCollisionId(); + recoToMcMap[recoCollId] = mcCollId; + } + iLabel++; + } + + // Associate centrality with collisions by index + size_t iCent = 0; + for (const auto& cent : centTable) { + if (iCent < nCollisions) { + const auto& collision = collisions.iteratorAt(iCent); + int64_t recoCollId = collision.globalIndex(); + float centValue = cent.centFT0M(); + + // Fill raw centrality histogram + ue.fill(HIST("Centrality/hCentRaw"), centValue); + + recoToCentMap[recoCollId] = centValue; + } + iCent++; + } + + LOG(info) << "\n--- MAP SIZES ---"; + LOG(info) << "recoToMcMap size: " << recoToMcMap.size(); + LOG(info) << "recoToCentMap size: " << recoToCentMap.size(); + + //=========================================================================== + // DEBUG: Check correlation between centrality and multiplicity + //=========================================================================== + LOG(info) << "\n=== CENTRALITY VS MULTIPLICITY DEBUG ==="; + + // Create temporary vectors to check correlation + std::vector> centMultPairs; + for (const auto& collision : collisions) { + int64_t collId = collision.globalIndex(); + + auto mcIt = recoToMcMap.find(collId); + if (mcIt == recoToMcMap.end()) + continue; + + auto centIt = recoToCentMap.find(collId); + if (centIt == recoToCentMap.end()) + continue; + + auto nchIt = mcCollisionToNch.find(mcIt->second); + if (nchIt == mcCollisionToNch.end()) + continue; + + centMultPairs.push_back({centIt->second, nchIt->second}); + } + + // Sort by centrality + std::sort(centMultPairs.begin(), centMultPairs.end()); + + LOG(info) << "Correlation between centrality and multiplicity:"; + LOG(info) << " If centrality is normal (0=central, 100=peripheral), multiplicity should decrease with centrality"; + LOG(info) << " If inverted (0=peripheral, 100=central), multiplicity should increase with centrality"; + + // Print a few samples across the range + if (centMultPairs.size() > CentMultClasses) { + for (size_t i = 0; i < centMultPairs.size(); i += centMultPairs.size() / 10) { + LOG(info) << " Cent: " << centMultPairs[i].first + << "%, Mult: " << centMultPairs[i].second; + } + } + + //=========================================================================== + // SECOND PASS: Process reconstructed collisions with detailed cut accounting + //=========================================================================== + + LOG(info) << "\n--- SECOND PASS: Processing reconstructed collisions ---"; + + std::set reconstructedMCCollisions; + std::set selectedMCCollisions; + + int nRecoCollisions = 0; + int nSelectedEvents = 0; + int nRejectedEvents = 0; + int nNoMCMatch = 0; + int nNoCent = 0; + int nInvalidCent = 0; + + // Cut counters + int nPassVertex = 0; + int nPassINEL = 0; + int nPassAll = 0; + + // For mean calculations + std::vector centAll, centVertex, centINEL, centSelected; + + for (const auto& collision : collisions) { + nRecoCollisions++; + + int64_t collId = collision.globalIndex(); + + // Fill cut flow + ue.fill(HIST("CutFlow/hCutStats"), 1); + + // Get MC collision ID from labels map + auto mcIt = recoToMcMap.find(collId); + if (mcIt == recoToMcMap.end()) { + nNoMCMatch++; + continue; + } + ue.fill(HIST("CutFlow/hCutStats"), 2); + + int64_t mcCollId = mcIt->second; + + // Get generated multiplicity for this MC collision + auto nchIt = mcCollisionToNch.find(mcCollId); + if (nchIt == mcCollisionToNch.end()) { + continue; + } + + int nGenCharged = nchIt->second; + + // Get INEL class + auto inelIt = mcCollisionToINELClass.find(mcCollId); + int inelClass = (inelIt != mcCollisionToINELClass.end()) ? inelIt->second : 0; + + // Get centrality from cent map + auto centIt = recoToCentMap.find(collId); + if (centIt == recoToCentMap.end()) { + nNoCent++; + continue; + } + ue.fill(HIST("CutFlow/hCutStats"), 3); + + float cent = centIt->second; + if (cent < 0 || cent > CentBinMax) { + nInvalidCent++; + continue; + } + + // Store all events with valid info + centAll.push_back(cent); + ue.fill(HIST("Centrality/hCentVsMult"), cent, nGenCharged); + ue.fill(HIST("Centrality/hMultVsCent"), nGenCharged, cent); + ue.fill(HIST("Centrality/hCentVsVz"), cent, collision.posZ()); + ue.fill(HIST("INEL/hINELVsCent"), cent, inelClass); + + // Track cuts progressively + bool passVertex = std::abs(collision.posZ()) <= cfgCutVertex.value; + if (passVertex) { + centVertex.push_back(cent); + ue.fill(HIST("Centrality/hCentAfterVtx"), cent); + ue.fill(HIST("CutFlow/hCutStats"), 4); + ue.fill(HIST("CutFlow/hCentPerCut"), 4, cent); + nPassVertex++; + } + + // Check INEL selection at generator level + bool passINEL = true; + if (cfgINELCut.value == INELgt0 && inelClass < INELgt0) + passINEL = false; + if (cfgINELCut.value == INELgt1 && inelClass < INELgt1) + passINEL = false; + + if (passINEL) { + centINEL.push_back(cent); + ue.fill(HIST("Centrality/hCentAfterINEL"), cent); + ue.fill(HIST("CutFlow/hCutStats"), 5); + ue.fill(HIST("CutFlow/hCentPerCut"), 5, cent); + nPassINEL++; + } + + // Fill GenMultVsCent for all reconstructed events + ue.fill(HIST("MC/EventLoss/GenMultVsCent"), cent, nGenCharged); + ue.fill(HIST("MC/EventLoss/NchGenerated_Reconstructed"), nGenCharged); + + reconstructedMCCollisions.insert(mcCollId); + + // Apply all cuts + bool passedAll = passVertex && passINEL; + + if (!passedAll) { + ue.fill(HIST("MC/EventLoss/GenMultVsCent_Rejected"), cent, nGenCharged); + nRejectedEvents++; + continue; + } + + // Event passed all selections + centSelected.push_back(cent); + ue.fill(HIST("Centrality/hCentAfterAll"), cent); + ue.fill(HIST("CutFlow/hCutStats"), 6); + ue.fill(HIST("CutFlow/hCentPerCut"), 6, cent); + ue.fill(HIST("MC/EventLoss/GenMultVsCent_Selected"), cent, nGenCharged); + ue.fill(HIST("hvtxZ"), collision.posZ()); + selectedMCCollisions.insert(mcCollId); + nSelectedEvents++; + nPassAll++; + + // Process tracks in selected events + int nTracksInEvent = 0; + for (const auto& track : tracks) { + if (!track.has_collision()) + continue; + if (track.collisionId() != collId) + continue; + + if (!passesTrackSelection(track)) { + continue; + } + nTracksInEvent++; + + // Fill TPC cluster histograms + ue.fill(HIST("hNclFoundTPC"), track.tpcNClsFound()); + ue.fill(HIST("hNclPIDTPC"), track.tpcNClsPID()); + ue.fill(HIST("hNclFoundTPCvsPt"), track.pt(), track.tpcNClsFound()); + ue.fill(HIST("hNclPIDTPCvsPt"), track.pt(), track.tpcNClsPID()); + + ue.fill(HIST("Inclusive/hPtAllReco"), track.pt()); + ue.fill(HIST("Inclusive/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("hEta"), track.eta()); + ue.fill(HIST("hPhi"), track.phi()); + + if (track.has_mcParticle()) { + const auto& particle = track.mcParticle(); + int pdgCode = std::abs(particle.pdgCode()); + + if (particle.isPhysicalPrimary()) { + ue.fill(HIST("Inclusive/hPtNumEff"), particle.pt()); + ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); + + if (pdgCode == PDGPion) { + ue.fill(HIST("Pion/hPtNumEff"), particle.pt()); + ue.fill(HIST("Pion/hPtPrimReco"), track.pt()); + } else if (pdgCode == PDGKaon) { + ue.fill(HIST("Kaon/hPtNumEff"), particle.pt()); + ue.fill(HIST("Kaon/hPtPrimReco"), track.pt()); + } else if (pdgCode == PDGProton) { + ue.fill(HIST("Proton/hPtNumEff"), particle.pt()); + ue.fill(HIST("Proton/hPtPrimReco"), track.pt()); + } + } else { + ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); + + if (pdgCode == PDGPion) { + ue.fill(HIST("Pion/hPtSecReco"), track.pt()); + } else if (pdgCode == PDGKaon) { + ue.fill(HIST("Kaon/hPtSecReco"), track.pt()); + } else if (pdgCode == PDGProton) { + ue.fill(HIST("Proton/hPtSecReco"), track.pt()); + } + } + } + + int bestSpecies = getBestPIDHypothesis(track); + + if (bestSpecies == kPion) { + ue.fill(HIST("Pion/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("Pion/hPtAllReco"), track.pt()); + + if (enablePIDHistograms) { + ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); + } + } else if (bestSpecies == kKaon) { + ue.fill(HIST("Kaon/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("Kaon/hPtAllReco"), track.pt()); + + if (enablePIDHistograms) { + ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); + } + } else if (bestSpecies == kProton) { + ue.fill(HIST("Proton/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("Proton/hPtAllReco"), track.pt()); + + if (enablePIDHistograms) { + ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); + } + } + } + + // Fill event-level track multiplicity + ue.fill(HIST("Centrality/hRecoMultVsCent"), cent, nTracksInEvent); + } + + // Calculate and display cut statistics + LOG(info) << "\n=== CUT STATISTICS ==="; + LOG(info) << "Total collisions with valid info: " << centAll.size(); + LOG(info) << "Pass vertex cut: " << nPassVertex << " (" + << (centAll.size() > 0 ? 100.0 * nPassVertex / centAll.size() : 0.0) << "%)"; + LOG(info) << "Pass INEL cut: " << nPassINEL << " (" + << (centAll.size() > 0 ? 100.0 * nPassINEL / centAll.size() : 0.0) << "%)"; + LOG(info) << "Pass all cuts: " << nPassAll << " (" + << (centAll.size() > 0 ? 100.0 * nPassAll / centAll.size() : 0.0) << "%)"; + LOG(info) << "Reco collisions: " << nRecoCollisions; + LOG(info) << "Selected Events: " << nSelectedEvents; + LOG(info) << "Rejected Events: " << nRejectedEvents; + LOG(info) << "No Match: " << nNoMCMatch; + LOG(info) << "No Cent: " << nNoCent; + LOG(info) << "Invalid Cent: " << nInvalidCent; + + // Calculate mean centrality at each stage + if (!centAll.empty()) { + float meanAll = std::accumulate(centAll.begin(), centAll.end(), 0.0) / centAll.size(); + float meanVertex = centVertex.empty() ? 0 : std::accumulate(centVertex.begin(), centVertex.end(), 0.0) / centVertex.size(); + float meanINEL = centINEL.empty() ? 0 : std::accumulate(centINEL.begin(), centINEL.end(), 0.0) / centINEL.size(); + float meanSelected = centSelected.empty() ? 0 : std::accumulate(centSelected.begin(), centSelected.end(), 0.0) / centSelected.size(); + + LOG(info) << "\n=== CENTRALITY MEANS ==="; + LOG(info) << "Mean centrality (all): " << meanAll; + LOG(info) << "Mean centrality (after vertex): " << meanVertex; + LOG(info) << "Mean centrality (after INEL): " << meanINEL; + LOG(info) << "Mean centrality (selected): " << meanSelected; + } + + ue.fill(HIST("hEventLossBreakdown"), 1.f, physicsSelectedMCCollisions.size()); + ue.fill(HIST("hEventLossBreakdown"), 2.f, reconstructedMCCollisions.size()); + ue.fill(HIST("hEventLossBreakdown"), 3.f, selectedMCCollisions.size()); + + float efficiency = physicsSelectedMCCollisions.size() > 0 ? 100.f * selectedMCCollisions.size() / physicsSelectedMCCollisions.size() : 0; + ue.fill(HIST("hEventLossBreakdown"), 4.f, efficiency); + + LOG(info) << "\n=== FINAL EFFICIENCY ==="; + LOG(info) << "Physics selected: " << physicsSelectedMCCollisions.size(); + LOG(info) << "Reconstructed: " << reconstructedMCCollisions.size(); + LOG(info) << "Selected: " << selectedMCCollisions.size(); + LOG(info) << "Efficiency: " << efficiency << "%"; + LOG(info) << "=== processMC END ==="; +} From 58d02bd4c546cae54c96fdd03621783af171b0fe Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:06:57 +0100 Subject: [PATCH 060/282] [PWGCF] add long range cumulant (#15516) Co-authored-by: ALICE Action Bot --- .../Tasks/longRangeDihadronCor.cxx | 233 ++++++++++++++++++ 1 file changed, 233 insertions(+) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index b95075d694e..93210a7968b 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -17,6 +17,7 @@ #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" #include "PWGCF/DataModel/CorrelationsDerived.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" #include "PWGCF/GenericFramework/Core/GFWCumulant.h" #include "PWGCF/GenericFramework/Core/GFWPowerArray.h" @@ -156,6 +157,19 @@ struct LongRangeDihadronCor { O2_DEFINE_CONFIGURABLE(cfgMirrorFT0CDeadChannels, bool, false, "If true, mirror FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115") O2_DEFINE_CONFIGURABLE(cfgRunbyRunAmplitudeFT0, bool, false, "Produce run-by-run FT0 amplitude distribution"); } cfgFwdConfig; + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(gfwOutput, bool, false, "produce cumulant results, off by default"); + O2_DEFINE_CONFIGURABLE(gfwNbootstrap, int, 30, "Number of subsamples") + O2_DEFINE_CONFIGURABLE(gfwAcceptance, std::string, "", "CCDB path to acceptance object") + O2_DEFINE_CONFIGURABLE(gfwUseNch, bool, false, "use multiplicity as x axis"); + ConfigurableAxis gfwAxisIndependent{"gfwAxisIndependent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "X axis for histograms"}; + Configurable> gfwCorr{"gfwCorr", std::vector{"TPC {2} FT0A {-2}"}, "User defined GFW CorrelatorConfig"}; + Configurable> gfwName{"gfwName", std::vector{"TpcFt0A22"}, "User defined GFW Name"}; + GFW* fGFW = new GFW(); + std::vector corrconfigs; + TAxis* fPtAxis; + TRandom3* fRndm = new TRandom3(0); + } cfgCumulantConfig; SliceCache cache; @@ -198,6 +212,7 @@ struct LongRangeDihadronCor { // Corrections TH3D* mEfficiency = nullptr; TH1D* mCentralityWeight = nullptr; + GFWWeights* mAcceptance = nullptr; bool correctionsLoaded = false; // Define the outputs @@ -208,6 +223,8 @@ struct LongRangeDihadronCor { OutputObj sameFt0aFt0c{"sameEvent_FT0A_FT0C"}; OutputObj mixedFt0aFt0c{"mixedEvent_FT0A_FT0C"}; HistogramRegistry registry{"registry"}; + OutputObj fFC{FlowContainer("FlowContainer")}; + OutputObj fFCgen{FlowContainer("FlowContainer_gen")}; // define global variables TRandom3* gRandom = new TRandom3(); @@ -266,6 +283,10 @@ struct LongRangeDihadronCor { kFT0CMirrorChannelEnd = 147, kFT0CMirrorChannelInnerRing = 115 }; + enum DataType { + kReco, + kGen + }; std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; @@ -442,6 +463,69 @@ struct LongRangeDihadronCor { mixedFt0aFt0c.setObject(new CorrelationContainer("mixedEvent_FT0A_FT0C", "mixedEvent_FT0A_FT0C", corrAxisFt0aFt0c, effAxis, userAxis)); } + if (cfgCumulantConfig.gfwOutput && doprocessSameTpcFt0a && doprocessSameTpcFt0c) { + LOGF(fatal, "If you enable gfwOutput, you can only enable processSameTpcFt0a or processSameTpcFt0c, NOT both."); + } + if (cfgCumulantConfig.gfwOutput) { + o2::framework::AxisSpec axis = axisPt; + int nPtBins = axis.binEdges.size() - 1; + double* ptBins = &(axis.binEdges)[0]; + cfgCumulantConfig.fPtAxis = new TAxis(nPtBins, ptBins); + + std::vector userDefineGFWCorr = cfgCumulantConfig.gfwCorr; + std::vector userDefineGFWName = cfgCumulantConfig.gfwName; + TObjArray* oba = new TObjArray(); + if (userDefineGFWName.size() != userDefineGFWCorr.size()) { + LOGF(fatal, "The GFWConfig names you provided are NOT matching with configurations. userDefineGFWName.size(): %d, userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); + } + LOGF(info, "User adding FlowContainer Array:"); + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { + for (uint i = 0; i < userDefineGFWName.size(); i++) { + if (userDefineGFWCorr.at(i).find("poi") != std::string::npos) { + LOGF(info, "%d: pT-diff array %s", i, userDefineGFWName.at(i).c_str()); + for (auto iPt = 0; iPt < cfgCumulantConfig.fPtAxis->GetNbins(); iPt++) + oba->Add(new TNamed(Form("%s_pt_%i", userDefineGFWName.at(i).c_str(), iPt + 1), Form("%s_pTDiff", userDefineGFWName.at(i).c_str()))); + } else { + LOGF(info, "%d: %s", i, userDefineGFWName.at(i).c_str()); + oba->Add(new TNamed(userDefineGFWName.at(i).c_str(), userDefineGFWName.at(i).c_str())); + } + } + } + fFC->SetName("FlowContainer"); + fFC->SetXAxis(cfgCumulantConfig.fPtAxis); + fFC->Initialize(oba, cfgCumulantConfig.gfwAxisIndependent, cfgCumulantConfig.gfwNbootstrap); + fFCgen->SetName("FlowContainer_gen"); + fFCgen->SetXAxis(cfgCumulantConfig.fPtAxis); + fFCgen->Initialize(oba, cfgCumulantConfig.gfwAxisIndependent, cfgCumulantConfig.gfwNbootstrap); + + cfgCumulantConfig.fGFW->AddRegion("TPC", -0.8, 0.8, 1, 1); + cfgCumulantConfig.fGFW->AddRegion("TPCpoi", -0.8, 0.8, 1 + cfgCumulantConfig.fPtAxis->GetNbins(), 2); + cfgCumulantConfig.fGFW->AddRegion("TPCol", -0.8, 0.8, 1 + cfgCumulantConfig.fPtAxis->GetNbins(), 4); + cfgCumulantConfig.fGFW->AddRegion("FT0A", 3.5, 4.9, 1, 1); + cfgCumulantConfig.fGFW->AddRegion("FT0C", -3.3, -2.1, 1, 1); + cfgCumulantConfig.fGFW->AddRegion("FV0", 2.2, 5.1, 1, 1); + + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { + LOGF(info, "User adding GFW CorrelatorConfig:"); + // attentaion: here we follow the index of cfgUserDefineGFWCorr + for (uint i = 0; i < userDefineGFWCorr.size(); i++) { + if (i >= userDefineGFWName.size()) { + LOGF(fatal, "The names you provided are more than configurations. userDefineGFWName.size(): %d > userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); + break; + } + if (userDefineGFWCorr.at(i).find("poi") != std::string::npos) { + cfgCumulantConfig.corrconfigs.push_back(cfgCumulantConfig.fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kTRUE)); + LOGF(info, "corrconfigs.at(%d): enable pt-Diff for %s %s", cfgCumulantConfig.corrconfigs.size() - 1, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + } else { + cfgCumulantConfig.corrconfigs.push_back(cfgCumulantConfig.fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kFALSE)); + LOGF(info, "corrconfigs.at(%d): %s %s", cfgCumulantConfig.corrconfigs.size() - 1, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + } + } + } + + cfgCumulantConfig.fGFW->CreateRegions(); + } + LOGF(info, "End of init"); } @@ -627,6 +711,13 @@ struct LongRangeDihadronCor { } LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgCentralityWeight.value.c_str(), (void*)mCentralityWeight); } + if (cfgCumulantConfig.gfwOutput && cfgCumulantConfig.gfwAcceptance.value.empty() == false) { + mAcceptance = ccdb->getForTimeStamp(cfgCumulantConfig.gfwAcceptance, timestamp); + if (mAcceptance) + LOGF(info, "Loaded acceptance weights from %s (%p)", cfgCumulantConfig.gfwAcceptance.value.c_str(), (void*)mAcceptance); + else + LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgCumulantConfig.gfwAcceptance.value.c_str(), (void*)mAcceptance); + } correctionsLoaded = true; } @@ -660,6 +751,80 @@ struct LongRangeDihadronCor { return true; } + bool getAcceptanceWeight(float& weight_nua, float phi, float eta, float vtxz) + { + if (mAcceptance) + weight_nua = mAcceptance->getNUA(phi, eta, vtxz); + else + weight_nua = 1; + return true; + } + + template + void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + { + double dnx, val; + dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (std::fabs(val) < 1) + registry.fill(tarName, cent, val, dnx); + return; + } + return; + } + + template + void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + { + double dnx, val; + dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (!corrconf.pTDif) { + if (dnx == 0) + return; + val = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (std::fabs(val) < 1) { + (dt == kGen) ? fFCgen->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm) : fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); + } + return; + } + for (auto i = 1; i <= cfgCumulantConfig.fPtAxis->GetNbins(); i++) { + dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, i - 1, kTRUE).real(); + if (dnx == 0) + continue; + val = cfgCumulantConfig.fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; + if (std::fabs(val) < 1) { + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); + } + } + return; + } + + template + void fillGFWFT0(TFT0s const& ft0, int corType) + { + std::size_t channelSize = 0; + if (corType == kFT0C) { + channelSize = ft0.channelC().size(); + } else if (corType == kFT0A) { + channelSize = ft0.channelA().size(); + } else { + LOGF(fatal, "Cor Index %d out of range", corType); + } + for (std::size_t iCh = 0; iCh < channelSize; iCh++) { + int chanelid = 0; + float ampl = 0.; + getChannel(ft0, iCh, chanelid, ampl, corType, MixedEvent + 1); + auto phi = getPhiFT0(chanelid, corType); + auto eta = getEtaFT0(chanelid, corType); + for (float ihit = 0; ihit < ampl; ihit++) { + cfgCumulantConfig.fGFW->Fill(eta, 1, phi, 1., 1); + } + } + } + // fill multiple histograms template void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. @@ -1021,6 +1186,40 @@ struct LongRangeDihadronCor { registry.fill(HIST("Nch"), tracks.size()); registry.fill(HIST("zVtx"), collision.posZ()); + if (cfgCumulantConfig.gfwOutput) { + cfgCumulantConfig.fGFW->Clear(); + float lRandom = cfgCumulantConfig.fRndm->Rndm(); + float weff = 1, wacc = 1; + float independent = cent; + if (cfgCumulantConfig.gfwUseNch) + independent = static_cast(tracks.size()); + + // fill TPC Q-vector + for (const auto& track : tracks) { + if (!trackSelected(track)) + continue; + bool withinPtPOI = (0.2 < track.pt()) && (track.pt() < 10.0); // o2-linter: disable=magic-number (within POI pT range) + bool withinPtRef = (0.2 < track.pt()) && (track.pt() < 3.0); // o2-linter: disable=magic-number (within RF pT range) + getAcceptanceWeight(wacc, track.phi(), track.eta(), collision.posZ()); + if (!getEfficiencyCorrection(weff, track.eta(), track.pt(), collision.posZ())) + continue; + if (withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1); + if (withinPtPOI) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 2); + if (withinPtPOI && withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 4); + } + // fill FT0 Q-vector + const auto& ft0 = collision.foundFT0(); + fillGFWFT0(ft0, kFT0A); + + // Filling Flow Container + for (uint l_ind = 0; l_ind < cfgCumulantConfig.corrconfigs.size(); l_ind++) { + fillFC(cfgCumulantConfig.corrconfigs.at(l_ind), independent, lRandom); + } + } + if (cfgSelCollByNch && (tracks.size() < cfgCutMultMin || tracks.size() >= cfgCutMultMax)) { return; } @@ -1141,6 +1340,40 @@ struct LongRangeDihadronCor { registry.fill(HIST("Nch"), tracks.size()); registry.fill(HIST("zVtx"), collision.posZ()); + if (cfgCumulantConfig.gfwOutput) { + cfgCumulantConfig.fGFW->Clear(); + float lRandom = cfgCumulantConfig.fRndm->Rndm(); + float weff = 1, wacc = 1; + float independent = cent; + if (cfgCumulantConfig.gfwUseNch) + independent = static_cast(tracks.size()); + + // fill TPC Q-vector + for (const auto& track : tracks) { + if (!trackSelected(track)) + continue; + bool withinPtPOI = (0.2 < track.pt()) && (track.pt() < 10.0); // o2-linter: disable=magic-number (within POI pT range) + bool withinPtRef = (0.2 < track.pt()) && (track.pt() < 3.0); // o2-linter: disable=magic-number (within RF pT range) + getAcceptanceWeight(wacc, track.phi(), track.eta(), collision.posZ()); + if (!getEfficiencyCorrection(weff, track.eta(), track.pt(), collision.posZ())) + continue; + if (withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1); + if (withinPtPOI) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 2); + if (withinPtPOI && withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 4); + } + // fill FT0 Q-vector + const auto& ft0 = collision.foundFT0(); + fillGFWFT0(ft0, kFT0C); + + // Filling Flow Container + for (uint l_ind = 0; l_ind < cfgCumulantConfig.corrconfigs.size(); l_ind++) { + fillFC(cfgCumulantConfig.corrconfigs.at(l_ind), independent, lRandom); + } + } + if (cfgSelCollByNch && (tracks.size() < cfgCutMultMin || tracks.size() >= cfgCutMultMax)) { return; } From f0078b6f8b0d76f50dd3c3c1eaf1c5c63383b665 Mon Sep 17 00:00:00 2001 From: Joachim Carlo Kristian Bjerg Hansen <50103987+joachimckh@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:08:08 +0100 Subject: [PATCH 061/282] [PWGJE] tracking efficiency (#15520) --- PWGJE/Tasks/jetSpectraEseTask.cxx | 215 ++++++++++++++++++++++++++++-- 1 file changed, 205 insertions(+), 10 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index 54dbc47901a..faff2f096fc 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct JetSpectraEseTask { + Configurable cfgEfficiency{"cfgEfficiency", "", "CCDB path to efficiency"}; Configurable jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; Configurable jetR{"jetR", 0.2, "jet resolution parameter"}; Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; @@ -133,6 +135,12 @@ struct JetSpectraEseTask { static constexpr float Acceptance = 0.9f; static constexpr float LowFT0Cut = 1e-8; + Service ccdb; + struct Efficiency { + TH1D* hEff = nullptr; + bool isLoaded = false; + } cfg; + Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); Filter jetCuts = aod::jet::pt > jetPtMin&& aod::jet::r == nround(jetR.node() * Scaler) && nabs(aod::jet::eta) < Acceptance - jetR; Filter colFilter = nabs(aod::jcollision::posZ) < vertexZCut; @@ -140,10 +148,13 @@ struct JetSpectraEseTask { using ChargedMCDJets = soa::Filtered>; Preslice mcdjetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; + Preslice mcdTracksPerJCollision = o2::aod::jtrack::collisionId; + Preslice particlesPerJMcCollision = o2::aod::jmcparticle::mcCollisionId; SliceCache cache; using BinningType = ColumnBinningPolicy; BinningType corrBinning{{binsZVtx, binsCentrality}, true}; + Service pdg; enum class DetID { FT0C, FT0A, @@ -389,6 +400,47 @@ struct JetSpectraEseTask { registry.add("hOccupancy", "Occupancy;Occupancy;entries", {HistType::kTH1F, {{occAxis}}}); registry.add("hPsiOccupancy", "Occupancy;#Psi_{2};entries", {HistType::kTH3F, {{centAxis}, {150, -2.5, 2.5}, {occAxis}}}); } + if (doprocessMCGenTrack) { + LOGF(info, "JetSpectraEseTask::init() - MCGen track"); + registry.add("hTrackPtGen", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("hTrackEtaGen", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("hTrackPhiGen", "", {HistType::kTH1F, {{phiAxis}}}); + } + if (doprocessMCRecoTrack) { + LOGF(info, "JetSpectraEseTask::init() - MCRec track"); + registry.add("hTrackPtReco", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("hTrackEtaReco", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("hTrackPhiReco", "", {HistType::kTH1F, {{phiAxis}}}); + } + } + + void loadEfficiency(aod::BCsWithTimestamps::iterator const& bc) + { + uint64_t timestamp = bc.timestamp(); + if (cfg.isLoaded) { + return; + } + if (!cfgEfficiency.value.empty()) { + cfg.hEff = ccdb->getForTimeStamp(cfgEfficiency, timestamp); + if (cfg.hEff == nullptr) { + LOGF(fatal, "Could not load track efficiency from %s", cfgEfficiency.value.c_str()); + } + LOGF(info, "Loaded tracking efficiency from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.hEff); + } + cfg.isLoaded = true; + return; + } + + template + double getEfficiency(TTrack track) + { + double eff{1.0}; + if (cfg.hEff) + eff = cfg.hEff->GetBinContent(cfg.hEff->FindBin(track.pt())); + if (eff == 0) + return -1.; + else + return 1. / eff; } template @@ -463,19 +515,25 @@ struct JetSpectraEseTask { for (const auto& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; + double weff = getEfficiency(track); + if (weff < 0) + continue; auto deta = track.eta() - jet.eta(); auto dphi = RecoDecay::constrainAngle(track.phi() - jet.phi(), -o2::constants::math::PIHalf); - registry.fill(HIST("thn_jethad_corr_same"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0]); - hSameSub[lRndInd]->Fill(centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0]); + registry.fill(HIST("thn_jethad_corr_same"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); + hSameSub[lRndInd]->Fill(centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); } } for (const auto& track : tracks) { - registry.fill(HIST("trackQA/before/hTrackPt"), centrality, track.pt()); + double weff = getEfficiency(track); + if (weff < 0) + continue; + registry.fill(HIST("trackQA/before/hTrackPt"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/before/hTrackEta"), centrality, track.eta()); registry.fill(HIST("trackQA/before/hTrackPhi"), centrality, track.phi()); if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; - registry.fill(HIST("trackQA/after/hTrackPt"), centrality, track.pt()); + registry.fill(HIST("trackQA/after/hTrackPt"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/after/hTrackEta"), centrality, track.eta()); registry.fill(HIST("trackQA/after/hTrackPhi"), centrality, track.phi()); registry.fill(HIST("h3CenttrPhiPsi2"), centrality, RecoDecay::constrainAngle(track.phi() - psi.psi2, -o2::constants::math::PI), qPerc[0]); @@ -489,7 +547,10 @@ struct JetSpectraEseTask { { auto tracksTuple = std::make_tuple(jets, tracks); Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + for (const auto& [c1, jets1, c2, tracks2] : pairData) { + auto bc = c2.template bc_as(); + loadEfficiency(bc); auto c1Tracks = tracks.sliceBy(tracksPerJCollision, c1.globalIndex()); registry.fill(HIST("eventQA/before/hVtxZMixed"), c1.posZ()); registry.fill(HIST("eventQA/before/hVtxZMixed2"), c2.posZ()); @@ -548,23 +609,29 @@ struct JetSpectraEseTask { auto vCorrL = cfgrhoPhi ? corrL(jet) : vCorr; float dPhi{RecoDecay::constrainAngle(jet.phi() - psi.psi2, -o2::constants::math::PI)}; + registry.fill(HIST("hNtrigMixed"), centrality, vCorrL, dPhi, qPerc[0]); for (const auto& track : tracks2) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; + double weff = getEfficiency(track); + if (weff < 0) + continue; auto deta = track.eta() - jet.eta(); auto dphi = RecoDecay::constrainAngle(track.phi() - jet.phi(), -o2::constants::math::PIHalf); - registry.fill(HIST("hNtrigMixed"), centrality, vCorrL, dPhi, qPerc[0]); - registry.fill(HIST("thn_jethad_corr_mixed"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0]); + registry.fill(HIST("thn_jethad_corr_mixed"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); } } for (const auto& track : tracks2) { - registry.fill(HIST("trackQA/before/hTrackPtMixed"), centrality, track.pt()); + double weff = getEfficiency(track); + if (weff < 0) + continue; + registry.fill(HIST("trackQA/before/hTrackPtMixed"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/before/hTrackEtaMixed"), centrality, track.eta()); registry.fill(HIST("trackQA/before/hTrackPhiMixed"), centrality, track.phi()); if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; - registry.fill(HIST("trackQA/after/hTrackPtMixed"), centrality, track.pt()); + registry.fill(HIST("trackQA/after/hTrackPtMixed"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/after/hTrackEtaMixed"), centrality, track.eta()); registry.fill(HIST("trackQA/after/hTrackPhiMixed"), centrality, track.phi()); } @@ -573,7 +640,7 @@ struct JetSpectraEseTask { void processESEDataCharged(soa::Join::iterator const& collision, soa::Filtered> const& jets, - aod::JetTracks const& tracks) + aod::JetTracks const& tracks, aod::BCsWithTimestamps const&) { registry.fill(HIST("eventQA/hEventCounter"), kFilteredInputEv); registry.fill(HIST("eventQA/before/hVtxZ"), collision.posZ()); @@ -585,13 +652,15 @@ struct JetSpectraEseTask { return; registry.fill(HIST("eventQA/hEventCounter"), kOccupancyCut); + auto bc = collision.bc_as(); + loadEfficiency(bc); jetSpectra(collision, jets, tracks); } PROCESS_SWITCH(JetSpectraEseTask, processESEDataCharged, "process ese collisions", true); void processESEDataChargedMixed(soa::Join const& collisions, soa::Filtered> const& jets, - aod::JetTracks const& tracks) + aod::JetTracks const& tracks, aod::BCsWithTimestamps const&) { jetMixed(collisions, jets, tracks); } @@ -768,6 +837,132 @@ struct JetSpectraEseTask { } PROCESS_SWITCH(JetSpectraEseTask, processMCChargedMatched, "jet MC process: geometrically matched MCP and MCD for response matrix and efficiency", false); + // process for gen/reco tracks for pT efficiency + bool isChargedParticle(int pdgCode) + { + auto pdgParticle = pdg->GetParticle(pdgCode); + return pdgParticle && pdgParticle->Charge() != 0.0; + } + + void processMCGenTrack(soa::Filtered>::iterator const& mcCollision, + soa::SmallGroups const& collisions, + aod::JetTracksMCD const&, + aod::JetParticles const& particles) + { + if (mcCollision.size() < 1) { + return; + } + if (collisions.size() != 1) { + return; + } + if (!(std::abs(mcCollision.posZ()) < vertexZCut)) { + return; + } + + auto collision = collisions.begin(); + if (!(std::abs(collision.posZ()) < vertexZCut)) { + return; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { + return; + } + if (cfgEvSelOccupancy && !isOccupancyAccepted(collision)) { + return; + } + + auto centrality = cfgisPbPb ? collision.centFT0M() : -1.0f; + if (cfgSelCentrality && cfgisPbPb && !isCentralitySelected(centrality)) { + return; + } + + auto particlesInCollision = particles.sliceBy(particlesPerJMcCollision, mcCollision.globalIndex()); + for (const auto& particle : particlesInCollision) { + if (!isChargedParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (particle.pt() < trackPtMin || particle.pt() >= trackPtMax) { + continue; + } + if (particle.eta() <= trackEtaMin || particle.eta() >= trackEtaMax) { + continue; + } + + registry.fill(HIST("hTrackPtGen"), particle.pt()); + registry.fill(HIST("hTrackEtaGen"), particle.eta()); + registry.fill(HIST("hTrackPhiGen"), particle.phi()); + } + } + PROCESS_SWITCH(JetSpectraEseTask, processMCGenTrack, "jet MC process: Generated track", false); + void processMCRecoTrack(soa::Filtered>::iterator const& mcCollision, + soa::SmallGroups const& collisions, + aod::JetTracksMCD const& tracks, + aod::JetParticles const&) + { + if (mcCollision.size() < 1) { + return; + } + if (collisions.size() < 1) { + return; + } + if (!(std::abs(mcCollision.posZ()) < vertexZCut)) { + return; + } + + std::vector seenMcParticles; + for (const auto& collision : collisions) { + if (!(std::abs(collision.posZ()) < vertexZCut)) { + continue; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { + continue; + } + if (cfgEvSelOccupancy && !isOccupancyAccepted(collision)) { + continue; + } + + auto centrality = cfgisPbPb ? collision.centFT0M() : -1.0f; + if (cfgSelCentrality && cfgisPbPb && !isCentralitySelected(centrality)) { + continue; + } + + auto tracksInCollision = tracks.sliceBy(mcdTracksPerJCollision, collision.globalIndex()); + for (const auto& track : tracksInCollision) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + if (!track.has_mcParticle()) { + continue; + } + + auto particle = track.mcParticle_as(); + if (!isChargedParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (particle.pt() < trackPtMin || particle.pt() >= trackPtMax) { + continue; + } + if (particle.eta() <= trackEtaMin || particle.eta() >= trackEtaMax) { + continue; + } + if (std::find(seenMcParticles.begin(), seenMcParticles.end(), particle.globalIndex()) != seenMcParticles.end()) { + continue; + } + seenMcParticles.push_back(particle.globalIndex()); + + registry.fill(HIST("hTrackPtReco"), track.pt()); + registry.fill(HIST("hTrackEtaReco"), track.eta()); + registry.fill(HIST("hTrackPhiReco"), track.phi()); + } + } + } + PROCESS_SWITCH(JetSpectraEseTask, processMCRecoTrack, "jet MC process: Reconstructed track", false); + static constexpr float InvalidValue = 999.; // template From 480fb422484fb29d1f8f5ebcbeb2ffa8c21b8cbd Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Thu, 26 Mar 2026 13:41:56 +0100 Subject: [PATCH 062/282] [Trigger,PWGHF] Add inv mass parametrisation for charm hadrons for 2026 pp + small fix (#15526) Co-authored-by: ALICE Action Bot --- EventFiltering/PWGHF/HFFilter.cxx | 5 +++-- EventFiltering/PWGHF/HFFilterHelpers.h | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index f13d9b685ff..beb55ae8fd9 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -481,6 +481,9 @@ struct HfFilter { // Main struct for HF triggers { for (const auto& collision : collisions) { + // all processed collisions + hProcessedEvents->Fill(0); + bool keepEvent[kNtriggersHF]{false}; bool isSelectedTVX = evSel.applyTVX ? collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) : true; bool isSelectedTFBorder = evSel.applyTFBorderCut ? collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) : true; @@ -527,8 +530,6 @@ struct HfFilter { // Main struct for HF triggers currentRun = bc.runNumber(); } - hProcessedEvents->Fill(0); - std::vector> indicesDau2Prong{}, indicesDau2ProngPrompt{}; auto cand2ProngsThisColl = cand2Prongs.sliceBy(hf2ProngPerCollision, thisCollId); diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index fa577f33d6f..639f4c2619e 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -640,6 +640,15 @@ class HfFilterHelper mSigmaPars3Prongs[1] = 0.00176f; mDeltaMassPars3Prongs[0] = -0.013f; mDeltaMassPars3Prongs[1] = 0.00029f; + } else if (recoPass == "2026_pass1") { + mSigmaPars2Prongs[0] = 0.01424f; + mSigmaPars2Prongs[1] = 0.00178f; + mDeltaMassPars2Prongs[0] = 0.004f; + mDeltaMassPars2Prongs[1] = 0.0001f; + mSigmaPars3Prongs[0] = 0.00796f; + mSigmaPars3Prongs[1] = 0.00176f; + mDeltaMassPars3Prongs[0] = 0.004f; + mDeltaMassPars3Prongs[1] = 0.0001f; } else { LOGP(fatal, "Mass resolution parametrisation {} not supported! Please set 2023_pass3", recoPass.data()); } From cd781e662c8366311e4eb1c8ef034bad1041815f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 26 Mar 2026 15:45:02 +0100 Subject: [PATCH 063/282] [PWGHF] Fix includes and using statements (#15386) --- .../TableProducer/candidateCreatorChic.cxx | 12 ++--- .../TableProducer/candidateCreatorX.cxx | 12 ++--- .../candidateSelectorChicToJpsiGamma.cxx | 6 +-- .../candidateSelectorD0Alice3Barrel.cxx | 6 +-- .../candidateSelectorD0Alice3Forward.cxx | 6 +-- .../candidateSelectorD0ParametrizedPid.cxx | 6 +-- .../TableProducer/candidateSelectorJpsi.cxx | 6 +-- .../candidateSelectorLcAlice3.cxx | 6 +-- .../candidateSelectorLcParametrizedPid.cxx | 6 +-- .../candidateSelectorXToJpsiPiPi.cxx | 6 +-- .../treeCreatorChicToJpsiGamma.cxx | 6 +-- .../TableProducer/treeCreatorXToJpsiPiPi.cxx | 4 +- PWGHF/ALICE3/Tasks/taskChic.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskJpsi.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskLcAlice3.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx | 8 ++-- PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx | 2 +- PWGHF/ALICE3/Tasks/taskX.cxx | 8 ++-- PWGHF/Core/HfMlResponseB0ToDPi.h | 2 + PWGHF/Core/HfMlResponseOmegacToOmegaPi.h | 1 - PWGHF/D2H/Core/DataCreationCharmReso.h | 11 +++-- PWGHF/DataModel/DerivedTables.h | 2 + .../derivedDataCreatorCorrelationsReduced.cxx | 1 + .../producerCharmHadronsTrackFemtoDream.cxx | 1 + .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 4 ++ PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 1 + PWGHF/HFL/Tasks/taskSingleElectron.cxx | 1 - .../candidateCreatorXic0Omegac0Qa.cxx | 47 ++++++++++++------- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 12 ++--- .../candidateSelectorToXiPiQa.cxx | 2 + .../derivedDataCreatorLcToK0sP.cxx | 1 - PWGHF/TableProducer/mcPidTof.cxx | 1 + PWGHF/TableProducer/pidCreator.cxx | 2 +- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 1 - .../treeCreatorSigmacCorrBkg.cxx | 1 + 38 files changed, 133 insertions(+), 106 deletions(-) diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx index 117fc633098..b03c9bf6952 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx @@ -22,11 +22,11 @@ #include "ALICE3/DataModel/ECAL.h" #include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/V0.h" +#include +#include +#include +#include +#include #include #include @@ -44,7 +44,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// Reconstruction of Chic candidates struct HfCandidateCreatorChic { diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx index ee6317aaa27..f0dfb8d761c 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx @@ -22,11 +22,11 @@ #include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/V0.h" +#include +#include +#include +#include +#include #include #include @@ -44,7 +44,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// Reconstruction of X candidates struct HfCandidateCreatorX { diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx index fab70fd5eb5..0c4b37e21c4 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx @@ -20,9 +20,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx index 0de3e010c44..5fb93e341f5 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx index 00ef9b7d673..ab2e05c16e8 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx index 7a8d6111ee0..474d0eda059 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx index 5ca50181673..40f8aee3e01 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx @@ -24,8 +24,8 @@ #include "ALICE3/DataModel/RICH.h" #include "Common/Core/TrackSelectorPID.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" +#include +#include #include @@ -59,7 +59,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(isAlice3); } -#include "Framework/runDataProcessing.h" +#include /// Struct for applying J/ψ → e+ e−, μ+ μ− selection cuts struct HfCandidateSelectorJpsi { diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx index 509ba9bb813..1844f315f28 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx @@ -22,9 +22,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx index 6bcc7fc438c..5fbde221894 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx @@ -22,9 +22,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx index 222d8261259..69ef001ab57 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx @@ -21,9 +21,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx index 33af9544284..589d889fdcb 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx @@ -22,9 +22,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx index b4ebf84eac2..2a9c9c49faf 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx @@ -21,8 +21,8 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGHF/ALICE3/Tasks/taskChic.cxx b/PWGHF/ALICE3/Tasks/taskChic.cxx index f7331b7d417..f6ed3fbabe0 100644 --- a/PWGHF/ALICE3/Tasks/taskChic.cxx +++ b/PWGHF/ALICE3/Tasks/taskChic.cxx @@ -20,9 +20,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include @@ -38,7 +38,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// chi_c1(1P) analysis task struct HfTaskChic { diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx index 546d7946394..a6a79fa2e23 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx index a43dc94d436..ac528208830 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx index 46387f053a6..23d160348d8 100644 --- a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskJpsi.cxx b/PWGHF/ALICE3/Tasks/taskJpsi.cxx index 9a20f6f42e9..9390751b7ee 100644 --- a/PWGHF/ALICE3/Tasks/taskJpsi.cxx +++ b/PWGHF/ALICE3/Tasks/taskJpsi.cxx @@ -20,9 +20,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include @@ -37,7 +37,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// jpsitoee analysis task struct HfTaskJpsi { diff --git a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx index ec32c52976c..703ba304092 100644 --- a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx index b22c531e621..ff8e2aad4a4 100644 --- a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx b/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx index 1f3cfb9d345..fe8c1a066f8 100644 --- a/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx +++ b/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx @@ -74,7 +74,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include /// Task to QA the efficiency of a particular particle defined by particlePDG template diff --git a/PWGHF/ALICE3/Tasks/taskX.cxx b/PWGHF/ALICE3/Tasks/taskX.cxx index 2be307e0f92..2391634f8ce 100644 --- a/PWGHF/ALICE3/Tasks/taskX.cxx +++ b/PWGHF/ALICE3/Tasks/taskX.cxx @@ -21,9 +21,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include @@ -39,7 +39,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// X(3872) analysis task struct HfTaskX { diff --git a/PWGHF/Core/HfMlResponseB0ToDPi.h b/PWGHF/Core/HfMlResponseB0ToDPi.h index 4874b56543b..354d295f7a6 100644 --- a/PWGHF/Core/HfMlResponseB0ToDPi.h +++ b/PWGHF/Core/HfMlResponseB0ToDPi.h @@ -22,6 +22,8 @@ #include "Tools/ML/MlResponse.h" +#include + #include #include diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h index ed78d100b07..d3afc762d83 100644 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h @@ -16,7 +16,6 @@ #ifndef PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPI_H_ #define PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPI_H_ -#include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/HfMlResponse.h" #include "Tools/ML/MlResponse.h" diff --git a/PWGHF/D2H/Core/DataCreationCharmReso.h b/PWGHF/D2H/Core/DataCreationCharmReso.h index fb44dce3b42..1ee7249b5ce 100644 --- a/PWGHF/D2H/Core/DataCreationCharmReso.h +++ b/PWGHF/D2H/Core/DataCreationCharmReso.h @@ -22,15 +22,16 @@ #define HomogeneousField // needed for KFParticle::SetField(magneticField); #endif -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" -#include "PWGEM/PhotonMeson/Utils/TrackSelection.h" #include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Utils/utilsEvSelHf.h" #include "PWGHF/Utils/utilsMcMatching.h" +// +#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" +#include "PWGEM/PhotonMeson/Utils/TrackSelection.h" + #include "Common/Core/RecoDecay.h" #include "Common/Core/TPCVDriftManager.h" #include "Common/Core/trackUtilities.h" @@ -43,7 +44,9 @@ #include #include #include +#include #include +#include #include #include @@ -60,8 +63,6 @@ #include #include #include -#include -#include #include namespace o2::analysis diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 3d15683b218..0a1c8a5efaf 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -18,6 +18,8 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" +// +#include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index 9ffe580fcf5..5636a0b8fa6 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -46,6 +46,7 @@ #include #include +#include #include #include #include diff --git a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx index 9884ff920e3..eb197529980 100644 --- a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx +++ b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx @@ -60,6 +60,7 @@ #include #include +#include #include #include diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index d870eb6731d..9b15c6f7233 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -18,6 +18,7 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/Utils/utilsAnalysis.h" +#include #include #include #include @@ -27,8 +28,11 @@ #include #include +#include +#include #include +#include #include #include #include diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index a8f03743e4c..a172f752afc 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -52,6 +52,7 @@ #include #include +#include #include #include #include diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index b7bb9d7c4be..c519765e688 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx index 5fea587b563..0be6fe96bc5 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx @@ -19,44 +19,59 @@ #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) #endif +#include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannelsLegacy.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" -#include "PWGHF/Utils/utilsTrkCandHf.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" // -> Added to test removal of strangeness builder workflow +#include "Common/Core/RecoDecay.h" #include "Common/Core/ZorroSummary.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Tools/KFparticle/KFUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include #include #include -#include -#include -#include +#include + +#include +#include +#include #include +#include +#include #include -#include #include using namespace o2; diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index e1e32120543..b00b7001a31 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -14,6 +14,12 @@ /// \author Federica Zanone , Heidelberg University /// \author Ruiqi Yin , Fudan University +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/AliasTables.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelectorPID.h" @@ -38,12 +44,6 @@ #include #include #include -// #include "PWGHF/Core/HfMlResponseOmegaKaToOmegaKa.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/AliasTables.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Utils/utilsAnalysis.h" using namespace o2; using namespace o2::aod; diff --git a/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx b/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx index 55f5e2adae3..b6b40705557 100644 --- a/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx @@ -26,11 +26,13 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelectorPID.h" +#include #include #include #include #include #include +#include #include #include #include diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx index 0386d6afba6..371b9ab9c4c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx @@ -16,7 +16,6 @@ /// \author Luigi Dello Stritto , Marietta-Blau Institute /// \author Vít Kučera , Inha University -#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index 89dfc8530f9..c0c6217607c 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -65,6 +65,7 @@ using namespace o2::framework; using namespace o2::pid; using namespace o2::framework::expressions; using namespace o2::track; +using namespace o2::common::core; o2::common::core::MetadataHelper metadataInfo; diff --git a/PWGHF/TableProducer/pidCreator.cxx b/PWGHF/TableProducer/pidCreator.cxx index d108a443539..f483d10d001 100644 --- a/PWGHF/TableProducer/pidCreator.cxx +++ b/PWGHF/TableProducer/pidCreator.cxx @@ -61,7 +61,7 @@ struct HfPidCreator { template void checkTableSwitch(InitContext& initContext, const std::string& table, TFlag& doprocess) { - auto isNeeded = isTableRequiredInWorkflow(initContext, table); + auto isNeeded = o2::common::core::isTableRequiredInWorkflow(initContext, table); if (isNeeded && !doprocess.value) { LOGF(fatal, "Table %s is needed but not requested. Enable the corresponding process function!", table); } diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 5fb90429589..8a952cbea49 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -16,7 +16,6 @@ /// \author Tiantian Cheng #include "PWGHF/Core/DecayChannelsLegacy.h" -#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "PWGHF/Utils/utilsTrkCandHf.h" #include "PWGLF/DataModel/LFStrangenessTables.h" diff --git a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx index 98fbc5f13c3..0b92effcdba 100644 --- a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx +++ b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx @@ -41,6 +41,7 @@ #include #include +#include using namespace o2; using namespace o2::framework; // for Produces, Configuable From 670add12903bf9712cdfe116791ffffcddf50421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 26 Mar 2026 18:49:43 +0100 Subject: [PATCH 064/282] [PWGJE] Fix includes and using statements (#15387) --- PWGJE/Core/FastJetUtilities.h | 2 +- PWGJE/Core/JetBkgSubUtils.cxx | 3 +- PWGJE/Core/JetFindingUtilities.h | 11 ++- PWGJE/Core/JetMatchingUtilities.h | 2 + PWGJE/Core/JetUtilities.h | 7 +- PWGJE/Core/MlResponseHfTagging.h | 1 + PWGJE/Core/emcalCrossTalkEmulation.cxx | 12 ++-- PWGJE/Core/emcalCrossTalkEmulation.h | 3 +- PWGJE/DataModel/GammaJetAnalysisTree.h | 9 +-- PWGJE/DataModel/JetReducedData.h | 2 + PWGJE/DataModel/JetReducedDataDQ.h | 2 + PWGJE/DataModel/JetReducedDataV0.h | 2 + .../PhotonChargedTriggerCorrelation.h | 5 +- PWGJE/JetFinders/jetFinder.h | 5 +- PWGJE/JetFinders/jetFinderHF.h | 3 +- PWGJE/JetFinders/jetFinderHFHFBar.h | 3 +- PWGJE/JetFinders/jetFinderV0.h | 3 +- PWGJE/TableProducer/Matching/jetMatchingMC.h | 1 + PWGJE/TableProducer/derivedDataProducer.cxx | 23 ++++--- PWGJE/TableProducer/derivedDataSelector.cxx | 4 +- .../derivedDataTriggerProducer.cxx | 6 +- PWGJE/TableProducer/derivedDataWriter.cxx | 4 +- .../emcalClusterHadronicCorrectionTask.cxx | 9 +-- PWGJE/TableProducer/emcalCorrectionTask.cxx | 3 +- .../TableProducer/emcalMatchedTracksTask.cxx | 12 ++-- .../eventwiseConstituentSubtractor.cxx | 9 +-- .../TableProducer/heavyFlavourDefinition.cxx | 4 +- PWGJE/TableProducer/jetEventWeightMCD.cxx | 4 +- PWGJE/TableProducer/jetEventWeightMCP.cxx | 2 +- PWGJE/TableProducer/jetTaggerHF.cxx | 10 +-- PWGJE/TableProducer/jetTrackDerived.cxx | 7 +- PWGJE/TableProducer/luminosityCalculator.cxx | 6 +- PWGJE/TableProducer/luminosityProducer.cxx | 6 +- PWGJE/TableProducer/mcOutlierRejector.cxx | 12 ++-- PWGJE/TableProducer/rhoEstimator.cxx | 8 +-- .../secondaryVertexReconstruction.cxx | 12 ++-- PWGJE/Tasks/bjetCentMult.cxx | 12 ++-- PWGJE/Tasks/bjetTaggingGnn.cxx | 25 ++++--- PWGJE/Tasks/bjetTaggingML.cxx | 6 +- PWGJE/Tasks/bjetTreeCreator.cxx | 10 +-- PWGJE/Tasks/chargedJetHadron.cxx | 8 +-- PWGJE/Tasks/dijetFinderQA.cxx | 6 +- PWGJE/Tasks/emcCellMonitor.cxx | 16 ++--- PWGJE/Tasks/emcClusterMonitor.cxx | 12 ++-- PWGJE/Tasks/emcEventSelectionQA.cxx | 8 +-- PWGJE/Tasks/emcVertexSelectionQA.cxx | 8 +-- PWGJE/Tasks/emcalGammaGammaBcWise.cxx | 10 +-- PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx | 14 ++-- PWGJE/Tasks/fullJetSpectra.cxx | 16 +++-- PWGJE/Tasks/fullJetTriggerQATask.cxx | 7 +- PWGJE/Tasks/gammaJetTreeProducer.cxx | 69 ++++++++++--------- PWGJE/Tasks/hadronPhotonCorrelation.cxx | 32 ++++----- PWGJE/Tasks/hfDebug.cxx | 32 +++++---- PWGJE/Tasks/hfFragmentationFunction.cxx | 10 +-- PWGJE/Tasks/jetBackgroundAnalysis.cxx | 2 +- PWGJE/Tasks/jetChCorr.cxx | 26 +++---- PWGJE/Tasks/jetChargedV2.cxx | 45 ++++++------ PWGJE/Tasks/jetCorrelationD0.cxx | 25 ++++--- PWGJE/Tasks/jetCrossSectionEfficiency.cxx | 13 +++- PWGJE/Tasks/jetD0AngSubstructure.cxx | 17 ++--- PWGJE/Tasks/jetDebug.cxx | 26 ++++--- PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx | 15 ++-- PWGJE/Tasks/jetFinderFullQA.cxx | 6 +- PWGJE/Tasks/jetFinderV0QA.cxx | 6 +- PWGJE/Tasks/jetFormationTimeReclustering.cxx | 18 ++--- PWGJE/Tasks/jetFragmentation.cxx | 1 - PWGJE/Tasks/jetHadronRecoil.cxx | 13 ++-- PWGJE/Tasks/jetLundReclustering.cxx | 10 +-- PWGJE/Tasks/jetMatchingQA.cxx | 4 +- PWGJE/Tasks/jetOutlierQA.cxx | 11 +-- PWGJE/Tasks/jetPlanarFlow.cxx | 9 ++- PWGJE/Tasks/jetShape.cxx | 25 ++++--- PWGJE/Tasks/jetSpectraCharged.cxx | 7 +- PWGJE/Tasks/jetSpectraEseTask.cxx | 12 +++- PWGJE/Tasks/jetSubstructure.cxx | 1 + PWGJE/Tasks/jetSubstructureHF.h | 2 - PWGJE/Tasks/jetSubstructureHFOutput.h | 2 - PWGJE/Tasks/jetSubstructureOutput.cxx | 6 +- PWGJE/Tasks/jetTaggerHFQA.cxx | 8 +-- PWGJE/Tasks/jetTriggerChargedQa.cxx | 13 ++-- PWGJE/Tasks/jetTutorial.cxx | 8 +-- PWGJE/Tasks/jetTutorialSkeleton.cxx | 6 +- PWGJE/Tasks/jetValidationQA.cxx | 8 +-- PWGJE/Tasks/mcGeneratorStudies.cxx | 12 ++-- PWGJE/Tasks/nsubjettiness.cxx | 8 +-- PWGJE/Tasks/nucleiInJets.cxx | 21 +++--- PWGJE/Tasks/phiInJets.cxx | 12 ++-- .../Tasks/photonChargedTriggerCorrelation.cxx | 46 ++++++++----- PWGJE/Tasks/photonChargedTriggerProducer.cxx | 35 ++++------ PWGJE/Tasks/photonIsolationQA.cxx | 12 ++-- PWGJE/Tasks/recoilJets.cxx | 19 +++-- PWGJE/Tasks/statPromptPhoton.cxx | 36 ++++------ PWGJE/Tasks/substructureDebug.cxx | 22 +++--- PWGJE/Tasks/trackEfficiency.cxx | 28 ++++---- PWGJE/Tasks/trackJetQA.cxx | 8 +-- PWGJE/Tasks/triggerCorrelations.cxx | 6 +- PWGJE/Tasks/v0JetSpectra.cxx | 4 +- PWGJE/Tasks/v0QA.cxx | 7 +- 98 files changed, 576 insertions(+), 563 deletions(-) diff --git a/PWGJE/Core/FastJetUtilities.h b/PWGJE/Core/FastJetUtilities.h index 2f54f92122b..506036c222f 100644 --- a/PWGJE/Core/FastJetUtilities.h +++ b/PWGJE/Core/FastJetUtilities.h @@ -40,7 +40,7 @@ namespace fastjetutilities class fastjet_user_info : public fastjet::PseudoJet::UserInfoBase { JetConstituentStatus status; // the status of each particle (Options are: TrueParticle (final state particles in generator event which arent special), HFParticle (heavy-flavour particle of interest in generator event), ThermalParticle (particles belonging to the thermal backgound), DecaySisterParticle (other particles poduced in the decay resulting in a non-prompt heavy-flavour particle of interest)) - int index; // a number unique to each particle in the event + int index; // a number unique to each particle in the event public: fastjet_user_info() diff --git a/PWGJE/Core/JetBkgSubUtils.cxx b/PWGJE/Core/JetBkgSubUtils.cxx index 45f79a9fe97..91254ddf7a8 100644 --- a/PWGJE/Core/JetBkgSubUtils.cxx +++ b/PWGJE/Core/JetBkgSubUtils.cxx @@ -15,8 +15,6 @@ #include "PWGJE/Core/JetBkgSubUtils.h" -#include "Common/Core/RecoDecay.h" - #include #include @@ -29,6 +27,7 @@ #include #include +#include #include #include diff --git a/PWGJE/Core/JetFindingUtilities.h b/PWGJE/Core/JetFindingUtilities.h index 26f00e0e38c..37ca4eddaa5 100644 --- a/PWGJE/Core/JetFindingUtilities.h +++ b/PWGJE/Core/JetFindingUtilities.h @@ -30,7 +30,6 @@ #include #include -#include #include #include @@ -97,12 +96,12 @@ bool isTrackSelected(T const& track, int trackSelection, const U* candidate = nu if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { return false; } - if (candidate != nullptr) { - if (jetcandidateutilities::isDaughterTrack(track, *candidate)) { - return false; - } + if (candidate != nullptr) { + if (jetcandidateutilities::isDaughterTrack(track, *candidate)) { + return false; } - return true; + } + return true; } /** diff --git a/PWGJE/Core/JetMatchingUtilities.h b/PWGJE/Core/JetMatchingUtilities.h index 38c5bc29774..2285d40b53b 100644 --- a/PWGJE/Core/JetMatchingUtilities.h +++ b/PWGJE/Core/JetMatchingUtilities.h @@ -24,6 +24,8 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "Common/Core/RecoDecay.h" + #include #include diff --git a/PWGJE/Core/JetUtilities.h b/PWGJE/Core/JetUtilities.h index eeb18938dba..c2f555689ce 100644 --- a/PWGJE/Core/JetUtilities.h +++ b/PWGJE/Core/JetUtilities.h @@ -20,15 +20,10 @@ #include "Common/Core/RecoDecay.h" -#include +#include -#include #include -#include -#include -#include #include -#include #include diff --git a/PWGJE/Core/MlResponseHfTagging.h b/PWGJE/Core/MlResponseHfTagging.h index be16b0cd450..4740a087a79 100644 --- a/PWGJE/Core/MlResponseHfTagging.h +++ b/PWGJE/Core/MlResponseHfTagging.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/PWGJE/Core/emcalCrossTalkEmulation.cxx b/PWGJE/Core/emcalCrossTalkEmulation.cxx index 32b08cd13dc..ebd6fa0922a 100644 --- a/PWGJE/Core/emcalCrossTalkEmulation.cxx +++ b/PWGJE/Core/emcalCrossTalkEmulation.cxx @@ -20,12 +20,15 @@ #include #include #include -#include #include +#include + +#include #include // std::find_if #include #include // size_t +#include #include // std::abs #include // setw #include // left and right @@ -34,13 +37,6 @@ #include #include #include -// #include "Framework/OutputObjHeader.h" - -// #include "Common/CCDB/EventSelectionParams.h" -#include -#include - -#include using namespace o2; using namespace o2::emccrosstalk; diff --git a/PWGJE/Core/emcalCrossTalkEmulation.h b/PWGJE/Core/emcalCrossTalkEmulation.h index fb84ec7c1ad..e597ebba4b0 100644 --- a/PWGJE/Core/emcalCrossTalkEmulation.h +++ b/PWGJE/Core/emcalCrossTalkEmulation.h @@ -21,9 +21,8 @@ #include #include #include -#include +#include -#include #include #include diff --git a/PWGJE/DataModel/GammaJetAnalysisTree.h b/PWGJE/DataModel/GammaJetAnalysisTree.h index 8b679097c4f..1f527ff8137 100644 --- a/PWGJE/DataModel/GammaJetAnalysisTree.h +++ b/PWGJE/DataModel/GammaJetAnalysisTree.h @@ -17,11 +17,12 @@ #ifndef PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ #define PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ -#include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/DataModel/Jet.h" +#include -#include "Framework/AnalysisDataModel.h" +#include + +#include +#include namespace o2::aod::gjanalysis { diff --git a/PWGJE/DataModel/JetReducedData.h b/PWGJE/DataModel/JetReducedData.h index 039a1ec46de..1cd94a96d03 100644 --- a/PWGJE/DataModel/JetReducedData.h +++ b/PWGJE/DataModel/JetReducedData.h @@ -22,6 +22,8 @@ #include #include // IWYU pragma: keep +#include +#include #include #include diff --git a/PWGJE/DataModel/JetReducedDataDQ.h b/PWGJE/DataModel/JetReducedDataDQ.h index d8e633cf036..1249263a71f 100644 --- a/PWGJE/DataModel/JetReducedDataDQ.h +++ b/PWGJE/DataModel/JetReducedDataDQ.h @@ -22,6 +22,8 @@ #include #include // IWYU pragma: keep +#include +#include #include #include diff --git a/PWGJE/DataModel/JetReducedDataV0.h b/PWGJE/DataModel/JetReducedDataV0.h index ec460d5b186..e9d4e4040c2 100644 --- a/PWGJE/DataModel/JetReducedDataV0.h +++ b/PWGJE/DataModel/JetReducedDataV0.h @@ -21,6 +21,8 @@ #include #include // IWYU pragma: keep +#include +#include #include #include diff --git a/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h b/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h index 8cd65eedcb5..9b3eef803a8 100644 --- a/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h +++ b/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h @@ -19,11 +19,10 @@ #define PWGJE_DATAMODEL_PHOTONCHARGEDTRIGGERCORRELATION_H_ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" -#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/PWGJE/JetFinders/jetFinder.h b/PWGJE/JetFinders/jetFinder.h index d664e5781da..d45cfa15506 100644 --- a/PWGJE/JetFinders/jetFinder.h +++ b/PWGJE/JetFinders/jetFinder.h @@ -21,8 +21,6 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetFinder.h" #include "PWGJE/Core/JetFindingUtilities.h" -#include "PWGJE/DataModel/EMCALClusterDefinition.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" @@ -32,7 +30,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -46,6 +43,8 @@ #include #include +#include + template struct JetFinderTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderHF.h b/PWGJE/JetFinders/jetFinderHF.h index b5e9a531ff3..3016cdb5265 100644 --- a/PWGJE/JetFinders/jetFinderHF.h +++ b/PWGJE/JetFinders/jetFinderHF.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -45,6 +44,8 @@ #include #include +#include + template struct JetFinderHFTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderHFHFBar.h b/PWGJE/JetFinders/jetFinderHFHFBar.h index 77635798346..ec4cfa9d94c 100644 --- a/PWGJE/JetFinders/jetFinderHFHFBar.h +++ b/PWGJE/JetFinders/jetFinderHFHFBar.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -45,6 +44,8 @@ #include #include +#include + template struct JetFinderHFHFBarTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderV0.h b/PWGJE/JetFinders/jetFinderV0.h index 2b9b1d76dbd..14c2f977ada 100644 --- a/PWGJE/JetFinders/jetFinderV0.h +++ b/PWGJE/JetFinders/jetFinderV0.h @@ -28,7 +28,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -41,6 +40,8 @@ #include #include +#include + template struct JetFinderV0Task { diff --git a/PWGJE/TableProducer/Matching/jetMatchingMC.h b/PWGJE/TableProducer/Matching/jetMatchingMC.h index a78c48a2800..95aceb4f6ed 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMC.h +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.h @@ -28,6 +28,7 @@ #include #include #include +#include #include diff --git a/PWGJE/TableProducer/derivedDataProducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx index 7182fbcec05..6a482f981df 100644 --- a/PWGJE/TableProducer/derivedDataProducer.cxx +++ b/PWGJE/TableProducer/derivedDataProducer.cxx @@ -13,9 +13,6 @@ // /// \author Nima Zardoshti -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGHF/DataModel/DerivedTables.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGJE/Core/JetDQUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetV0Utilities.h" @@ -25,10 +22,15 @@ #include "PWGJE/DataModel/JetReducedDataDQ.h" #include "PWGJE/DataModel/JetReducedDataHF.h" #include "PWGJE/DataModel/JetReducedDataV0.h" +// +#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.h" #include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" @@ -40,25 +42,26 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "ReconstructionDataFormats/Vertex.h" +#include #include #include +#include +#include +#include #include +#include #include #include +#include #include #include +#include #include #include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataSelector.cxx b/PWGJE/TableProducer/derivedDataSelector.cxx index 371dbc73f34..c9a0ca6ca32 100644 --- a/PWGJE/TableProducer/derivedDataSelector.cxx +++ b/PWGJE/TableProducer/derivedDataSelector.cxx @@ -22,9 +22,9 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetReducedDataSelector.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataTriggerProducer.cxx b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx index b90495d0bb6..2c80e811464 100644 --- a/PWGJE/TableProducer/derivedDataTriggerProducer.cxx +++ b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx @@ -18,10 +18,10 @@ #include "EventFiltering/filterTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataWriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx index e5676af0d58..41f4d80d227 100644 --- a/PWGJE/TableProducer/derivedDataWriter.cxx +++ b/PWGJE/TableProducer/derivedDataWriter.cxx @@ -28,9 +28,9 @@ #include "PWGJE/DataModel/JetReducedDataHF.h" #include "PWGJE/DataModel/JetReducedDataSelector.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx b/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx index 8de689c2ee7..7f9e9dfe7dc 100644 --- a/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx @@ -12,21 +12,18 @@ // **Hadronic Correction in the EMCAL framework: to avoid the double counting of the charged particles' contribution in jets** /// \author Archita Rani Dash -#include "PWGJE/DataModel/EMCALClusterDefinition.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include #include +#include #include #include #include -#include "TVector2.h" #include #include diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 3b7c919b7e2..037f793a0d1 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -50,13 +50,12 @@ #include #include #include +#include #include #include #include -#include - #include #include diff --git a/PWGJE/TableProducer/emcalMatchedTracksTask.cxx b/PWGJE/TableProducer/emcalMatchedTracksTask.cxx index 55781eb6bc4..14f8cc8b92a 100644 --- a/PWGJE/TableProducer/emcalMatchedTracksTask.cxx +++ b/PWGJE/TableProducer/emcalMatchedTracksTask.cxx @@ -18,14 +18,14 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index 33cafe0db0c..d60275c6fac 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -20,18 +20,19 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include #include #include -#include +#include #include +#include #include +#include #include #include diff --git a/PWGJE/TableProducer/heavyFlavourDefinition.cxx b/PWGJE/TableProducer/heavyFlavourDefinition.cxx index a9f52f96a35..57027ad8b13 100644 --- a/PWGJE/TableProducer/heavyFlavourDefinition.cxx +++ b/PWGJE/TableProducer/heavyFlavourDefinition.cxx @@ -18,9 +18,9 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/jetEventWeightMCD.cxx b/PWGJE/TableProducer/jetEventWeightMCD.cxx index ddb518e1bba..f294adc0511 100644 --- a/PWGJE/TableProducer/jetEventWeightMCD.cxx +++ b/PWGJE/TableProducer/jetEventWeightMCD.cxx @@ -16,9 +16,9 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/jetEventWeightMCP.cxx b/PWGJE/TableProducer/jetEventWeightMCP.cxx index 7f262e998ea..0bc5728a0e0 100644 --- a/PWGJE/TableProducer/jetEventWeightMCP.cxx +++ b/PWGJE/TableProducer/jetEventWeightMCP.cxx @@ -15,8 +15,8 @@ #include "PWGJE/DataModel/Jet.h" -#include "Framework/AnalysisTask.h" #include +#include #include #include #include diff --git a/PWGJE/TableProducer/jetTaggerHF.cxx b/PWGJE/TableProducer/jetTaggerHF.cxx index 6878544163a..10cbcef6286 100644 --- a/PWGJE/TableProducer/jetTaggerHF.cxx +++ b/PWGJE/TableProducer/jetTaggerHF.cxx @@ -16,8 +16,6 @@ /// \author Hanseo Park /// \author Hadi Hassan , University of Jyväskylä -#include "MlResponse.h" - #include "PWGJE/Core/JetTaggingUtilities.h" #include "PWGJE/Core/MlResponseHfTagging.h" #include "PWGJE/DataModel/Jet.h" @@ -25,12 +23,13 @@ #include "PWGJE/DataModel/JetTagging.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Tools/ML/MlResponse.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include #include +#include #include #include #include @@ -42,6 +41,7 @@ #include #include +#include #include diff --git a/PWGJE/TableProducer/jetTrackDerived.cxx b/PWGJE/TableProducer/jetTrackDerived.cxx index 9111ae36c3c..db9a7f5325b 100644 --- a/PWGJE/TableProducer/jetTrackDerived.cxx +++ b/PWGJE/TableProducer/jetTrackDerived.cxx @@ -16,7 +16,6 @@ /// \brief Header for the trackJetQa task for the analysis of the tracks for jets.. /// -// O2 includes #include "PWGJE/DataModel/TrackJetQa.h" #include "Common/Core/TrackSelection.h" @@ -26,12 +25,12 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include #include +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/luminosityCalculator.cxx b/PWGJE/TableProducer/luminosityCalculator.cxx index 93a97aea92d..c4e9faafc94 100644 --- a/PWGJE/TableProducer/luminosityCalculator.cxx +++ b/PWGJE/TableProducer/luminosityCalculator.cxx @@ -16,11 +16,11 @@ #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/luminosityProducer.cxx b/PWGJE/TableProducer/luminosityProducer.cxx index cafac8d6d2a..31823c7ebb7 100644 --- a/PWGJE/TableProducer/luminosityProducer.cxx +++ b/PWGJE/TableProducer/luminosityProducer.cxx @@ -21,17 +21,15 @@ #include "Common/CCDB/EventSelectionParams.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include #include -#include #include -#include #include #include diff --git a/PWGJE/TableProducer/mcOutlierRejector.cxx b/PWGJE/TableProducer/mcOutlierRejector.cxx index 3cdb38aa1c6..32fed7ebbb3 100644 --- a/PWGJE/TableProducer/mcOutlierRejector.cxx +++ b/PWGJE/TableProducer/mcOutlierRejector.cxx @@ -13,17 +13,21 @@ // /// \author Nima Zardoshti +#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include -#include #include +#include +#include +#include +#include +#include #include using namespace o2; diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index 71c183e9e83..c7f11e99b0c 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -20,15 +20,15 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include #include -#include +#include #include +#include #include #include diff --git a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx index 8bab0ea0c05..e2f2246b21b 100644 --- a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx +++ b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx @@ -22,22 +22,22 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/DCA.h" #include +#include +#include #include #include +#include +#include #include +#include #include #include #include #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/bjetCentMult.cxx b/PWGJE/Tasks/bjetCentMult.cxx index d2a17c4708b..576afeb4ac0 100644 --- a/PWGJE/Tasks/bjetCentMult.cxx +++ b/PWGJE/Tasks/bjetCentMult.cxx @@ -19,14 +19,13 @@ #include "PWGJE/Core/JetTaggingUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Common/DataModel/Multiplicity.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include #include #include #include @@ -35,9 +34,8 @@ #include #include -#include -#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/bjetTaggingGnn.cxx b/PWGJE/Tasks/bjetTaggingGnn.cxx index be7ec455b65..8a48eab4af5 100644 --- a/PWGJE/Tasks/bjetTaggingGnn.cxx +++ b/PWGJE/Tasks/bjetTaggingGnn.cxx @@ -15,35 +15,40 @@ /// \author Changhwan Choi , Pusan National University #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/Core/JetTaggingUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" #include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include #include +#include #include #include +#include #include -#include +#include + #include #include #include -#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index 6e1b135b745..002f3b4bf02 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -23,10 +23,10 @@ #include "Common/Core/RecoDecay.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index 4065a6cf334..a5c85560f26 100644 --- a/PWGJE/Tasks/bjetTreeCreator.cxx +++ b/PWGJE/Tasks/bjetTreeCreator.cxx @@ -25,13 +25,13 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include #include +#include #include +#include #include #include #include @@ -49,6 +49,8 @@ #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGJE/Tasks/chargedJetHadron.cxx b/PWGJE/Tasks/chargedJetHadron.cxx index e938a5d8bff..fd4b5831977 100644 --- a/PWGJE/Tasks/chargedJetHadron.cxx +++ b/PWGJE/Tasks/chargedJetHadron.cxx @@ -21,14 +21,14 @@ #include "Common/Core/RecoDecay.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include +#include #include #include #include diff --git a/PWGJE/Tasks/dijetFinderQA.cxx b/PWGJE/Tasks/dijetFinderQA.cxx index 5c9f39f1a84..defb8a6c926 100644 --- a/PWGJE/Tasks/dijetFinderQA.cxx +++ b/PWGJE/Tasks/dijetFinderQA.cxx @@ -18,10 +18,10 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcCellMonitor.cxx b/PWGJE/Tasks/emcCellMonitor.cxx index 880ce14e490..0df39215cb2 100644 --- a/PWGJE/Tasks/emcCellMonitor.cxx +++ b/PWGJE/Tasks/emcCellMonitor.cxx @@ -9,15 +9,15 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/Constants.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcClusterMonitor.cxx b/PWGJE/Tasks/emcClusterMonitor.cxx index fbb8885c5be..b014ffae8fb 100644 --- a/PWGJE/Tasks/emcClusterMonitor.cxx +++ b/PWGJE/Tasks/emcClusterMonitor.cxx @@ -14,14 +14,14 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcEventSelectionQA.cxx b/PWGJE/Tasks/emcEventSelectionQA.cxx index 8ba3f5168c8..ff39021dce6 100644 --- a/PWGJE/Tasks/emcEventSelectionQA.cxx +++ b/PWGJE/Tasks/emcEventSelectionQA.cxx @@ -19,10 +19,10 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include #include #include diff --git a/PWGJE/Tasks/emcVertexSelectionQA.cxx b/PWGJE/Tasks/emcVertexSelectionQA.cxx index eb579326966..da45a313015 100644 --- a/PWGJE/Tasks/emcVertexSelectionQA.cxx +++ b/PWGJE/Tasks/emcVertexSelectionQA.cxx @@ -18,11 +18,11 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcalGammaGammaBcWise.cxx b/PWGJE/Tasks/emcalGammaGammaBcWise.cxx index d9674888aed..aa5e99fb70b 100644 --- a/PWGJE/Tasks/emcalGammaGammaBcWise.cxx +++ b/PWGJE/Tasks/emcalGammaGammaBcWise.cxx @@ -22,20 +22,20 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "EMCALBase/Geometry.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include #include #include #include +#include #include +#include #include #include #include -#include "TLorentzVector.h" -#include "TVector3.h" +#include +#include #include #include diff --git a/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx b/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx index 273907b8056..61bff6d13e1 100644 --- a/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx +++ b/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx @@ -15,22 +15,22 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include +#include #include #include #include #include -#include "TLorentzVector.h" -#include "TVector3.h" #include #include +#include #include +#include #include #include diff --git a/PWGJE/Tasks/fullJetSpectra.cxx b/PWGJE/Tasks/fullJetSpectra.cxx index 2c999e26100..0af05f60cac 100644 --- a/PWGJE/Tasks/fullJetSpectra.cxx +++ b/PWGJE/Tasks/fullJetSpectra.cxx @@ -23,20 +23,22 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" +#include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include +#include +#include +#include #include +#include #include +#include #include #include +#include #include #include @@ -1298,7 +1300,7 @@ struct FullJetSpectra { registry.fill(HIST("hDetTrigcollisionCounter"), 2.5); // DetTrigCollWithVertexZ if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || !jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) { // applyRCTSelections doesn't work here - registry.fill(HIST("hDetTrigcollisionCounter"), 3.5); // EventsNotSatisfyingEvent+TriggerSelection + registry.fill(HIST("hDetTrigcollisionCounter"), 3.5); // EventsNotSatisfyingEvent+TriggerSelection return; } //- should this kTVX HW trigger be still in place? - Removing it for now; probably not needed if we are only interested in SW triggers diff --git a/PWGJE/Tasks/fullJetTriggerQATask.cxx b/PWGJE/Tasks/fullJetTriggerQATask.cxx index 88255a2dda7..4aff2f9ec2e 100644 --- a/PWGJE/Tasks/fullJetTriggerQATask.cxx +++ b/PWGJE/Tasks/fullJetTriggerQATask.cxx @@ -22,23 +22,22 @@ #include "Common/CCDB/TriggerAliases.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" #include +#include +#include #include #include #include #include #include -#include "TTree.h" #include #include #include #include +#include #include -#include #include #include diff --git a/PWGJE/Tasks/gammaJetTreeProducer.cxx b/PWGJE/Tasks/gammaJetTreeProducer.cxx index 656f8233b8d..de043149abe 100644 --- a/PWGJE/Tasks/gammaJetTreeProducer.cxx +++ b/PWGJE/Tasks/gammaJetTreeProducer.cxx @@ -14,44 +14,49 @@ /// \author Florian Jonas , UC Berkeley/LBNL /// \since 02.08.2024 -// C++ system headers first -#include - -#include -#include -#include - -// Framework and other headers after #include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/JetFindingUtilities.h" -#include "PWGJE/Core/JetSubstructureUtilities.h" -#include "PWGJE/Core/JetUtilities.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/GammaJetAnalysisTree.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "EventFiltering/filterTables.h" - -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/AnalysisCluster.h" -#include "DataFormatsEMCAL/Cell.h" -#include "DataFormatsEMCAL/Constants.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" - -#include "TVector2.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include // \struct GammaJetTreeProducer /// \brief Task to produce a tree for gamma-jet analysis, including photons (and information of isolation) and charged and full jets @@ -65,8 +70,6 @@ using namespace o2::framework::expressions; using emcClusters = o2::soa::Join; using emcMCClusters = o2::soa::Join; -#include "Framework/runDataProcessing.h" - struct GammaJetTreeProducer { // analysis tree // charged jets diff --git a/PWGJE/Tasks/hadronPhotonCorrelation.cxx b/PWGJE/Tasks/hadronPhotonCorrelation.cxx index f84d69d621e..7040898d6d1 100644 --- a/PWGJE/Tasks/hadronPhotonCorrelation.cxx +++ b/PWGJE/Tasks/hadronPhotonCorrelation.cxx @@ -26,24 +26,22 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/InitContext.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include -// #include // o2-linter: disable= root/lorentz-vector (TLorentzVector is needed for TPythia8Decayer) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -// #include -// #include #include #include diff --git a/PWGJE/Tasks/hfDebug.cxx b/PWGJE/Tasks/hfDebug.cxx index 4efaf6ce7c9..f5c96c13337 100644 --- a/PWGJE/Tasks/hfDebug.cxx +++ b/PWGJE/Tasks/hfDebug.cxx @@ -14,28 +14,32 @@ /// \author Nima Zardoshti // -#include "PWGHF/Utils/utilsMcGen.h" -#include "PWGJE/Core/FastJetUtilities.h" -#include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetSubtraction.h" +// +#include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/DataModel/DerivedTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct HFDebugTask { HistogramRegistry registry{"registry", {{"h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, diff --git a/PWGJE/Tasks/hfFragmentationFunction.cxx b/PWGJE/Tasks/hfFragmentationFunction.cxx index e07dca07775..bff035d67bb 100644 --- a/PWGJE/Tasks/hfFragmentationFunction.cxx +++ b/PWGJE/Tasks/hfFragmentationFunction.cxx @@ -26,20 +26,20 @@ #include "Common/Core/RecoDecay.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include #include +#include #include +#include #include #include #include #include -#include "TVector3.h" #include +#include #include diff --git a/PWGJE/Tasks/jetBackgroundAnalysis.cxx b/PWGJE/Tasks/jetBackgroundAnalysis.cxx index 84925d2dafe..f7a0c56c7ac 100644 --- a/PWGJE/Tasks/jetBackgroundAnalysis.cxx +++ b/PWGJE/Tasks/jetBackgroundAnalysis.cxx @@ -22,6 +22,7 @@ #include "Common/Core/RecoDecay.h" +#include #include #include #include @@ -30,7 +31,6 @@ #include #include -#include #include #include diff --git a/PWGJE/Tasks/jetChCorr.cxx b/PWGJE/Tasks/jetChCorr.cxx index 070d4194223..be4fcf59b0b 100644 --- a/PWGJE/Tasks/jetChCorr.cxx +++ b/PWGJE/Tasks/jetChCorr.cxx @@ -19,36 +19,32 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include "fastjet/ClusterSequenceArea.hh" -#include "fastjet/PseudoJet.hh" +#include #include +#include #include #include #include -// #include "PWGLF/DataModel/LFResonanceTables.h" - -#include -#include -#include -#include -#include - using namespace std; using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; int trackSelection = -1; int trackL = -1; diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index f33874ca55d..2dbdb7e5206 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -13,44 +13,39 @@ /// \file jetChargedV2.cxx /// \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetFinder.h" #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/EventPlaneHelper.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/Qvectors.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "EventFiltering/filterTables.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include #include #include -#include +#include + +#include #include -#include #include #include +#include #include using namespace o2; diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 22c08b9b272..44a912e7221 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -13,24 +13,31 @@ /// \brief Task for analysing D0 triggered jet events. /// \author Matthew Ockleton matthew.ockleton@cern.ch, University of Liverpool -#include "PWGHF/Core/DecayChannels.h" -#include "PWGHF/DataModel/AliasTables.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include +#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx index 8f1c9858a5b..240fb3e7a20 100644 --- a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx +++ b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx @@ -17,17 +17,24 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include +#include +#include + #include #include +#include #include +#include +#include #include using namespace o2; diff --git a/PWGJE/Tasks/jetD0AngSubstructure.cxx b/PWGJE/Tasks/jetD0AngSubstructure.cxx index 05c1923dd96..9650d7ea4bb 100644 --- a/PWGJE/Tasks/jetD0AngSubstructure.cxx +++ b/PWGJE/Tasks/jetD0AngSubstructure.cxx @@ -16,29 +16,22 @@ // \inherited from D0 fragmentation and Ds // \P. Dhankher -#include "PWGHF/Core/DecayChannels.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" -#include "Common/Core/RecoDecay.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include +#include +#include +#include #include #include #include -#include +#include #include #include #include -#include "TVector3.h" +#include #include #include diff --git a/PWGJE/Tasks/jetDebug.cxx b/PWGJE/Tasks/jetDebug.cxx index be4a84f1a38..53b440e8ea8 100644 --- a/PWGJE/Tasks/jetDebug.cxx +++ b/PWGJE/Tasks/jetDebug.cxx @@ -14,27 +14,35 @@ /// \author Nima Zardoshti // -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct JetDebugTask { HistogramRegistry registry{"registry", {{"h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, diff --git a/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx b/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx index 3e2e12d378a..629ba2f75f3 100644 --- a/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx +++ b/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx @@ -17,28 +17,23 @@ /// \author Monalisa Melo // -#include "PWGHF/Core/DecayChannels.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" -#include "Common/Core/RecoDecay.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include #include #include -#include +#include #include #include #include -#include "TVector3.h" +#include #include #include diff --git a/PWGJE/Tasks/jetFinderFullQA.cxx b/PWGJE/Tasks/jetFinderFullQA.cxx index 6dc665fe07d..69b18b6e4af 100644 --- a/PWGJE/Tasks/jetFinderFullQA.cxx +++ b/PWGJE/Tasks/jetFinderFullQA.cxx @@ -20,12 +20,12 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include #include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetFinderV0QA.cxx b/PWGJE/Tasks/jetFinderV0QA.cxx index a80ee0eea25..55036241730 100644 --- a/PWGJE/Tasks/jetFinderV0QA.cxx +++ b/PWGJE/Tasks/jetFinderV0QA.cxx @@ -18,11 +18,11 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetFormationTimeReclustering.cxx b/PWGJE/Tasks/jetFormationTimeReclustering.cxx index 3040175b9bc..b411fdddbe9 100644 --- a/PWGJE/Tasks/jetFormationTimeReclustering.cxx +++ b/PWGJE/Tasks/jetFormationTimeReclustering.cxx @@ -23,12 +23,10 @@ #ifndef PWGJE_TASKS_JETFORMATIONTIMERECLUSTERING_H_ #define PWGJE_TASKS_JETFORMATIONTIMERECLUSTERING_H_ -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGHF/DataModel/DerivedTables.h" #include "PWGJE/DataModel/Jet.h" // IWYU pragma: keep #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetReducedDataDQ.h" #include "PWGJE/DataModel/JetSubstructure.h" // new +#include "PWGJE/DataModel/JetSubtraction.h" #include @@ -77,24 +75,22 @@ DECLARE_SOA_TABLE(CEWSJetTFSSs, "AOD", "CEWSJETTFSS", jetTFsubstructure::JetPt, #include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/JetSubstructureUtilities.h" -#include "PWGJE/Core/JetUtilities.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include +#include #include #include +#include #include #include -#include "fastjet/ClusterSequenceArea.hh" -#include "fastjet/PseudoJet.hh" +#include #include +#include #include #include diff --git a/PWGJE/Tasks/jetFragmentation.cxx b/PWGJE/Tasks/jetFragmentation.cxx index 0d3fe2965ed..f919d1f3ec3 100644 --- a/PWGJE/Tasks/jetFragmentation.cxx +++ b/PWGJE/Tasks/jetFragmentation.cxx @@ -23,7 +23,6 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/TrackSelectionTables.h" #include #include diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index a16770e19f1..39fc652ae82 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -23,19 +23,18 @@ #include "Common/Core/RecoDecay.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include #include +#include #include +#include #include #include -#include +#include #include -#include "TRandom3.h" +#include #include #include diff --git a/PWGJE/Tasks/jetLundReclustering.cxx b/PWGJE/Tasks/jetLundReclustering.cxx index b78c6f2b6ef..95b5b027931 100644 --- a/PWGJE/Tasks/jetLundReclustering.cxx +++ b/PWGJE/Tasks/jetLundReclustering.cxx @@ -23,17 +23,17 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include -#include "fastjet/ClusterSequenceArea.hh" -#include "fastjet/PseudoJet.hh" +#include #include +#include #include #include diff --git a/PWGJE/Tasks/jetMatchingQA.cxx b/PWGJE/Tasks/jetMatchingQA.cxx index 6770d42e47e..eac3b3cf4bf 100644 --- a/PWGJE/Tasks/jetMatchingQA.cxx +++ b/PWGJE/Tasks/jetMatchingQA.cxx @@ -17,8 +17,8 @@ #include "PWGJE/DataModel/Jet.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include +#include #include #include #include diff --git a/PWGJE/Tasks/jetOutlierQA.cxx b/PWGJE/Tasks/jetOutlierQA.cxx index 89daf7111ce..d0d802a95a8 100644 --- a/PWGJE/Tasks/jetOutlierQA.cxx +++ b/PWGJE/Tasks/jetOutlierQA.cxx @@ -17,11 +17,9 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" - -#include "Common/Core/RecoDecay.h" #include +#include #include #include #include @@ -29,17 +27,14 @@ #include #include -#include #include -#include -#include #include -#include +#include +#include #include #include #include -#include #include #include diff --git a/PWGJE/Tasks/jetPlanarFlow.cxx b/PWGJE/Tasks/jetPlanarFlow.cxx index 2b93d9b1255..480dcc69a53 100644 --- a/PWGJE/Tasks/jetPlanarFlow.cxx +++ b/PWGJE/Tasks/jetPlanarFlow.cxx @@ -24,18 +24,21 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include +#include +#include #include #include #include #include -#include "fastjet/contrib/AxesDefinition.hh" +#include +#include #include #include #include diff --git a/PWGJE/Tasks/jetShape.cxx b/PWGJE/Tasks/jetShape.cxx index a02940bd9a2..c48fad2f35c 100644 --- a/PWGJE/Tasks/jetShape.cxx +++ b/PWGJE/Tasks/jetShape.cxx @@ -13,27 +13,30 @@ /// \author Yuto Nishida /// \brief Task for measuring the dependence of the jet shape function rho(r) on the distance r from the jet axis. -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGLF/DataModel/mcCentrality.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 09e02d67d4e..0d2644ef287 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -19,15 +19,16 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include #include +#include #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index faff2f096fc..b0b2b638fb4 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -24,11 +24,13 @@ #include "Common/DataModel/EseTable.h" #include "Common/DataModel/Qvectors.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include +#include #include +#include +#include #include #include #include @@ -38,9 +40,12 @@ #include #include +#include #include #include +#include + #include #include #include @@ -49,6 +54,7 @@ #include #include #include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGJE/Tasks/jetSubstructure.cxx b/PWGJE/Tasks/jetSubstructure.cxx index 65e2953a8c3..fe568b6c2a6 100644 --- a/PWGJE/Tasks/jetSubstructure.cxx +++ b/PWGJE/Tasks/jetSubstructure.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSubstructureHF.h b/PWGJE/Tasks/jetSubstructureHF.h index d0734e071ea..0dbe9aa6e3f 100644 --- a/PWGJE/Tasks/jetSubstructureHF.h +++ b/PWGJE/Tasks/jetSubstructureHF.h @@ -52,8 +52,6 @@ #include -// NB: runDataProcessing.h must be included after customize! - template struct JetSubstructureHFTask { o2::framework::Produces jetSubstructureDataTable; diff --git a/PWGJE/Tasks/jetSubstructureHFOutput.h b/PWGJE/Tasks/jetSubstructureHFOutput.h index afabd8b1d65..2eb799a6708 100644 --- a/PWGJE/Tasks/jetSubstructureHFOutput.h +++ b/PWGJE/Tasks/jetSubstructureHFOutput.h @@ -36,8 +36,6 @@ #include #include -// NB: runDataProcessing.h must be included after customize! - template struct JetSubstructureHFOutputTask { diff --git a/PWGJE/Tasks/jetSubstructureOutput.cxx b/PWGJE/Tasks/jetSubstructureOutput.cxx index cb849700592..954214c7226 100644 --- a/PWGJE/Tasks/jetSubstructureOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureOutput.cxx @@ -19,9 +19,9 @@ #include "PWGJE/DataModel/JetSubstructure.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include @@ -38,8 +38,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// NB: runDataProcessing.h must be included after customize! - struct JetSubstructureOutputTask { Produces collisionOutputTableData; diff --git a/PWGJE/Tasks/jetTaggerHFQA.cxx b/PWGJE/Tasks/jetTaggerHFQA.cxx index d64b664b98b..1dd147c0ff7 100644 --- a/PWGJE/Tasks/jetTaggerHFQA.cxx +++ b/PWGJE/Tasks/jetTaggerHFQA.cxx @@ -21,10 +21,10 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include #include #include #include @@ -34,8 +34,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetTriggerChargedQa.cxx b/PWGJE/Tasks/jetTriggerChargedQa.cxx index d8b795aa1d6..22ee5b8306d 100644 --- a/PWGJE/Tasks/jetTriggerChargedQa.cxx +++ b/PWGJE/Tasks/jetTriggerChargedQa.cxx @@ -18,15 +18,12 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" - -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetTutorial.cxx b/PWGJE/Tasks/jetTutorial.cxx index 48742399bf7..828a23a86ce 100644 --- a/PWGJE/Tasks/jetTutorial.cxx +++ b/PWGJE/Tasks/jetTutorial.cxx @@ -23,12 +23,12 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetTutorialSkeleton.cxx b/PWGJE/Tasks/jetTutorialSkeleton.cxx index eeccd409d26..763f2dc4c0e 100644 --- a/PWGJE/Tasks/jetTutorialSkeleton.cxx +++ b/PWGJE/Tasks/jetTutorialSkeleton.cxx @@ -18,10 +18,10 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetValidationQA.cxx b/PWGJE/Tasks/jetValidationQA.cxx index 4ccd260f47e..999a1feeaef 100644 --- a/PWGJE/Tasks/jetValidationQA.cxx +++ b/PWGJE/Tasks/jetValidationQA.cxx @@ -18,11 +18,11 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/mcGeneratorStudies.cxx b/PWGJE/Tasks/mcGeneratorStudies.cxx index 8310b03c25a..1fd61f64bfc 100644 --- a/PWGJE/Tasks/mcGeneratorStudies.cxx +++ b/PWGJE/Tasks/mcGeneratorStudies.cxx @@ -19,18 +19,18 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include +#include +#include #include +#include #include #include #include -#include "TDatabasePDG.h" +#include #include #include diff --git a/PWGJE/Tasks/nsubjettiness.cxx b/PWGJE/Tasks/nsubjettiness.cxx index 133e1e6323b..e09bff37b17 100644 --- a/PWGJE/Tasks/nsubjettiness.cxx +++ b/PWGJE/Tasks/nsubjettiness.cxx @@ -20,11 +20,11 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include #include +#include #include #include #include @@ -32,8 +32,8 @@ #include #include -#include "fastjet/contrib/AxesDefinition.hh" #include +#include #include diff --git a/PWGJE/Tasks/nucleiInJets.cxx b/PWGJE/Tasks/nucleiInJets.cxx index 0953cb87500..f6a419992b8 100644 --- a/PWGJE/Tasks/nucleiInJets.cxx +++ b/PWGJE/Tasks/nucleiInJets.cxx @@ -14,36 +14,39 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" +// #include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/Utils/inelGt.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include #include +#include #include +#include #include #include #include +#include #include #include -#include "TDatabasePDG.h" #include #include #include -#include +#include +#include #include #include diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 8571b76b880..085da029904 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -25,22 +25,22 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include +#include #include +#include #include #include #include #include -#include "TRandom.h" #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx b/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx index 0f4dbf82e41..81cd439194e 100644 --- a/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx +++ b/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx @@ -20,31 +20,43 @@ #include "PWGJE/DataModel/PhotonChargedTriggerCorrelation.h" -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +// +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/TableHelper.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "Math/Vector4D.h" -#include "TMath.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include #include #include #include +#include +#include #include -#include +#include +#include #include #include #include @@ -716,7 +728,7 @@ struct PhotonChargedTriggerCorrelation { // init analysis variables // get variables from other tasks - getTaskOptionValue(initContext, "photon-charged-trigger-producer", "etaMax", etaMax, false); + o2::common::core::getTaskOptionValue(initContext, "photon-charged-trigger-producer", "etaMax", etaMax, false); // histograms from ccdb initCcdbHistograms(); diff --git a/PWGJE/Tasks/photonChargedTriggerProducer.cxx b/PWGJE/Tasks/photonChargedTriggerProducer.cxx index d600ca43c03..4ffc372ad67 100644 --- a/PWGJE/Tasks/photonChargedTriggerProducer.cxx +++ b/PWGJE/Tasks/photonChargedTriggerProducer.cxx @@ -15,35 +15,30 @@ /// /// Table producer for photon-jet angular correlation analysis (see photonChargedTriggerCorrelation.cxx) -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" +#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/PhotonChargedTriggerCorrelation.h" +// +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Common/Core/TableHelper.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "Math/Vector4D.h" -#include "TMath.h" +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include -#include -#include #include -#include -#include -#include #include #include diff --git a/PWGJE/Tasks/photonIsolationQA.cxx b/PWGJE/Tasks/photonIsolationQA.cxx index 1738fef952f..4f31995b218 100644 --- a/PWGJE/Tasks/photonIsolationQA.cxx +++ b/PWGJE/Tasks/photonIsolationQA.cxx @@ -15,13 +15,13 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/recoilJets.cxx b/PWGJE/Tasks/recoilJets.cxx index 08271300538..bb141c84a86 100644 --- a/PWGJE/Tasks/recoilJets.cxx +++ b/PWGJE/Tasks/recoilJets.cxx @@ -18,32 +18,37 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include #include +#include #include +#include #include #include #include +#include #include -#include "TRandom3.h" #include +#include +#include +#include #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/PWGJE/Tasks/statPromptPhoton.cxx b/PWGJE/Tasks/statPromptPhoton.cxx index 4e13332dcfe..b7d6fce2dff 100644 --- a/PWGJE/Tasks/statPromptPhoton.cxx +++ b/PWGJE/Tasks/statPromptPhoton.cxx @@ -15,40 +15,30 @@ /// /// \author Adrian Fereydon Nassirpour -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/AnalysisCluster.h" -#include "DataFormatsEMCAL/Cell.h" -#include "DataFormatsEMCAL/Constants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/Propagator.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/substructureDebug.cxx b/PWGJE/Tasks/substructureDebug.cxx index c6830c3a038..0243cce3c1a 100644 --- a/PWGJE/Tasks/substructureDebug.cxx +++ b/PWGJE/Tasks/substructureDebug.cxx @@ -14,28 +14,26 @@ /// \author Nima Zardoshti // -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetSubstructure.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct SubstructureDebugTask { HistogramRegistry registry{"registry", {{"h_collisions_posZ", "event posZ;posZ;entries", {HistType::kTH1F, {{20, -10.0, 10.0}}}}, diff --git a/PWGJE/Tasks/trackEfficiency.cxx b/PWGJE/Tasks/trackEfficiency.cxx index 1228de53867..6c3fb2460f3 100644 --- a/PWGJE/Tasks/trackEfficiency.cxx +++ b/PWGJE/Tasks/trackEfficiency.cxx @@ -19,16 +19,18 @@ #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include #include +#include #include +#include #include #include #include +#include #include #include @@ -435,7 +437,7 @@ struct TrackEfficiency { bool hasSel8Coll = false; bool centralityCheck = false; bool occupancyCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -621,7 +623,7 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -683,7 +685,7 @@ struct TrackEfficiency { registry.fill(HIST("h3_particle_pt_high_particle_eta_particle_phi_mcpartofinterest"), jMcParticle.pt(), jMcParticle.eta(), jMcParticle.phi(), mcCollEventWeight); - if ((std::abs(jMcParticle.eta()) < trackEtaAcceptanceCountQA)) { // removed from actual cuts for now because all the histograms have an eta axis + if ((std::abs(jMcParticle.eta()) < trackEtaAcceptanceCountQA)) { // removed from actual cuts for now because all the histograms have an eta axis registry.fill(HIST("hMcPartCutsCounts"), 3.5, mcCollision.weight()); // etaAccept // not actually applied here but it will give an idea of what will be done in the post processing } } @@ -879,7 +881,7 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -942,7 +944,7 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -1086,8 +1088,8 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -1159,8 +1161,8 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } diff --git a/PWGJE/Tasks/trackJetQA.cxx b/PWGJE/Tasks/trackJetQA.cxx index 60c099bf7a3..3b7eafded61 100644 --- a/PWGJE/Tasks/trackJetQA.cxx +++ b/PWGJE/Tasks/trackJetQA.cxx @@ -24,11 +24,11 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/triggerCorrelations.cxx b/PWGJE/Tasks/triggerCorrelations.cxx index c0c272d39c7..2a32add9252 100644 --- a/PWGJE/Tasks/triggerCorrelations.cxx +++ b/PWGJE/Tasks/triggerCorrelations.cxx @@ -16,10 +16,10 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/v0JetSpectra.cxx b/PWGJE/Tasks/v0JetSpectra.cxx index 95081bad725..d17078958f9 100644 --- a/PWGJE/Tasks/v0JetSpectra.cxx +++ b/PWGJE/Tasks/v0JetSpectra.cxx @@ -19,8 +19,8 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include +#include #include #include #include diff --git a/PWGJE/Tasks/v0QA.cxx b/PWGJE/Tasks/v0QA.cxx index 353869e4644..e32d56bc590 100644 --- a/PWGJE/Tasks/v0QA.cxx +++ b/PWGJE/Tasks/v0QA.cxx @@ -24,10 +24,10 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include #include #include #include @@ -35,6 +35,7 @@ #include #include +#include #include #include From 7834b62443fc0e3e760a4204d72e6cc247e645a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 27 Mar 2026 05:25:44 +0100 Subject: [PATCH 065/282] [ALICE3] Fix includes and using statements (#15379) --- ALICE3/Core/Decayer.h | 10 ++-- ALICE3/Core/DelphesO2LutWriter.cxx | 27 +++++++--- ALICE3/Core/DelphesO2LutWriter.h | 7 ++- ALICE3/Core/DelphesO2TrackSmearer.cxx | 12 ++--- ALICE3/Core/DelphesO2TrackSmearer.h | 26 ++-------- ALICE3/Core/DetLayer.cxx | 4 +- ALICE3/Core/DetLayer.h | 1 + ALICE3/Core/FastTracker.cxx | 35 +++++++++---- ALICE3/Core/FastTracker.h | 9 ++-- ALICE3/Core/GeometryContainer.cxx | 7 +++ ALICE3/Core/GeometryContainer.h | 2 - ALICE3/Core/TOFResoALICE3.cxx | 4 ++ ALICE3/Core/TOFResoALICE3.h | 20 +++++--- ALICE3/Core/TrackUtilities.cxx | 7 +++ ALICE3/Core/TrackUtilities.h | 4 +- ALICE3/DataModel/A3DecayFinderTables.h | 7 +-- ALICE3/DataModel/ECAL.h | 9 ++-- ALICE3/DataModel/FTOF.h | 9 ++-- ALICE3/DataModel/MID.h | 11 ++-- ALICE3/DataModel/OTFCollision.h | 3 +- ALICE3/DataModel/OTFMCParticle.h | 3 +- ALICE3/DataModel/OTFMulticharm.h | 3 +- ALICE3/DataModel/OTFPIDTrk.h | 6 ++- ALICE3/DataModel/OTFRICH.h | 6 ++- ALICE3/DataModel/OTFStrangeness.h | 7 ++- ALICE3/DataModel/OTFTOF.h | 6 ++- ALICE3/DataModel/RICH.h | 11 ++-- ALICE3/DataModel/collisionAlice3.h | 3 +- ALICE3/DataModel/tracksAlice3.h | 3 +- ALICE3/ML/HfMlResponse3Prong.h | 2 - ALICE3/Macros/testFastTracker.C | 3 +- ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx | 15 +++++- .../OTF/onTheFlyDetectorGeometryProvider.cxx | 13 ++++- ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx | 25 +++++----- ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx | 32 +++++++----- ALICE3/TableProducer/OTF/onTheFlyTracker.cxx | 40 ++++++++++++++- .../TableProducer/OTF/onTheFlyTrackerPid.cxx | 32 ++++++------ ALICE3/TableProducer/alice3-centrality.cxx | 23 +++++++-- .../TableProducer/alice3-correlatorDDbar.cxx | 25 ++++++---- ALICE3/TableProducer/alice3-decayfinder.cxx | 38 +++++++------- .../TableProducer/alice3-decaypreselector.cxx | 33 ++++-------- .../TableProducer/alice3-dq-table-maker.cxx | 33 ++++++------ .../TableProducer/alice3-trackextension.cxx | 13 +++-- .../TableProducer/alice3-trackselection.cxx | 20 ++++++-- .../TableProducer/alice3HfSelector3Prong.cxx | 11 ++-- .../alice3HfTreeCreator3Prong.cxx | 8 +-- .../TableProducer/alice3MulticharmFinder.cxx | 50 ++++++++++--------- .../alice3TrackingTranslator.cxx | 15 ++++-- .../TableProducer/alice3strangenessFinder.cxx | 22 ++++++-- ALICE3/Tasks/ECALqa.cxx | 20 +++++--- ALICE3/Tasks/alice3-cdeuteron.cxx | 30 +++++++---- ALICE3/Tasks/alice3-dilepton.cxx | 12 ++++- ALICE3/Tasks/alice3-dq-efficiency.cxx | 24 ++++----- ALICE3/Tasks/alice3-lutmaker.cxx | 22 +++++++- ALICE3/Tasks/alice3-qa-multiplicity.cxx | 18 +++++-- ALICE3/Tasks/alice3-qa-singleparticle.cxx | 15 ++++++ ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx | 27 ++++++---- ALICE3/Tasks/alice3DecayerQa.cxx | 14 +++--- ALICE3/Tasks/alice3Efficiency.cxx | 22 +++++--- ALICE3/Tasks/alice3HfTask3Prong.cxx | 9 +--- ALICE3/Tasks/alice3Multicharm.cxx | 45 ++++++----------- ALICE3/Tasks/alice3PidEvaluation.cxx | 31 ++++++------ ALICE3/Tasks/alice3SeparationPower.cxx | 12 +++-- ALICE3/Tasks/alice3Strangeness.cxx | 30 ++++------- ALICE3/Tasks/alice3TrackingPerformance.cxx | 18 +++++-- ALICE3/Tasks/pidFTOFqa.cxx | 19 ++++--- ALICE3/Tasks/pidRICHqa.cxx | 24 +++++++-- ALICE3/Utils/utilsHfAlice3.h | 5 ++ 68 files changed, 677 insertions(+), 435 deletions(-) diff --git a/ALICE3/Core/Decayer.h b/ALICE3/Core/Decayer.h index 33696b19683..bec6b9506d9 100644 --- a/ALICE3/Core/Decayer.h +++ b/ALICE3/Core/Decayer.h @@ -21,18 +21,18 @@ #include "ALICE3/Core/TrackUtilities.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include -#include -#include +#include // IWYU pragma: keep #include #include -#include #include #include #include -#include +#include #include namespace o2 diff --git a/ALICE3/Core/DelphesO2LutWriter.cxx b/ALICE3/Core/DelphesO2LutWriter.cxx index 987383092ec..c2df9431ef4 100644 --- a/ALICE3/Core/DelphesO2LutWriter.cxx +++ b/ALICE3/Core/DelphesO2LutWriter.cxx @@ -25,14 +25,27 @@ #include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.h" -#include "TAxis.h" -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "TMatrixD.h" -#include "TMatrixDSymEigen.h" -#include "TVectorD.h" - +#include +#include + +#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include +#include +#include +#include +#include +#include + +#include + +#include #include +#include +#include #include // #define USE_FWD_PARAM diff --git a/ALICE3/Core/DelphesO2LutWriter.h b/ALICE3/Core/DelphesO2LutWriter.h index 1528ab80bac..e234efd3bdb 100644 --- a/ALICE3/Core/DelphesO2LutWriter.h +++ b/ALICE3/Core/DelphesO2LutWriter.h @@ -23,10 +23,13 @@ #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/FastTracker.h" -#include "ReconstructionDataFormats/PID.h" +#include -#include "TGraph.h" +#include +#include + +#include #include namespace o2::fastsim diff --git a/ALICE3/Core/DelphesO2TrackSmearer.cxx b/ALICE3/Core/DelphesO2TrackSmearer.cxx index 7fca0dc19be..7d7f6fc6077 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.cxx +++ b/ALICE3/Core/DelphesO2TrackSmearer.cxx @@ -28,12 +28,6 @@ /// @author: Roberto Preghenella /// @email: preghenella@bo.infn.it -// #include "TrackSmearer.hh" -// #include "TrackUtils.hh" -// #include "TRandom.h" -// #include -// #include - #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/GeometryContainer.h" @@ -41,7 +35,11 @@ #include #include -#include +#include + +#include +#include +#include #include namespace o2 diff --git a/ALICE3/Core/DelphesO2TrackSmearer.h b/ALICE3/Core/DelphesO2TrackSmearer.h index afb0c7690cf..6d941f336ca 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.h +++ b/ALICE3/Core/DelphesO2TrackSmearer.h @@ -27,22 +27,14 @@ #include #include -#include - +#include #include -#include -#include -#include -#include +#include /////////////////////////////// /// DelphesO2/src/lutCovm.hh // /////////////////////////////// -/// @author: Roberto Preghenella -/// @email: preghenella@bo.infn.it - -// #pragma // once #define LUTCOVM_VERSION 20210801 struct map_t { @@ -154,17 +146,6 @@ struct lutEntry_t { /// DelphesO2/src/TrackSmearer.hh // //////////////////////////////////// -/// @author: Roberto Preghenella -/// @email: preghenella@bo.infn.it - -// #ifndef _DelphesO2_TrackSmearer_h_ -// #define _DelphesO2_TrackSmearer_h_ - -// #include "ReconstructionDataFormats/Track.h" -// #include "classes/DelphesClasses.h" -// #include "lutCovm.hh" -// #include - using O2Track = o2::track::TrackParCov; namespace o2 @@ -269,10 +250,9 @@ class TrackSmearer } // namespace delphes } // namespace o2 -// #endif /** _DelphesO2_TrackSmearer_h_ **/ - namespace o2::delphes { using DelphesO2TrackSmearer = TrackSmearer; } + #endif // ALICE3_CORE_DELPHESO2TRACKSMEARER_H_ diff --git a/ALICE3/Core/DetLayer.cxx b/ALICE3/Core/DetLayer.cxx index 2e72d641a2b..d93fd77373f 100644 --- a/ALICE3/Core/DetLayer.cxx +++ b/ALICE3/Core/DetLayer.cxx @@ -21,8 +21,10 @@ #include #include +#include +#include + #include -#include namespace o2::fastsim { diff --git a/ALICE3/Core/DetLayer.h b/ALICE3/Core/DetLayer.h index 32c5a839684..b3ed3ed6b34 100644 --- a/ALICE3/Core/DetLayer.h +++ b/ALICE3/Core/DetLayer.h @@ -22,6 +22,7 @@ #include #include +#include #include namespace o2::fastsim diff --git a/ALICE3/Core/FastTracker.cxx b/ALICE3/Core/FastTracker.cxx index be4ef7d2a12..254ab8d6643 100644 --- a/ALICE3/Core/FastTracker.cxx +++ b/ALICE3/Core/FastTracker.cxx @@ -11,24 +11,37 @@ #include "FastTracker.h" -#include "Common/Core/TableHelper.h" - +#include "DetLayer.h" +#include "GeometryContainer.h" + +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) #include +#include +#include #include #include -#include +#include +#include + +#include +#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include #include namespace o2 diff --git a/ALICE3/Core/FastTracker.h b/ALICE3/Core/FastTracker.h index d361e261603..d593c568fb9 100644 --- a/ALICE3/Core/FastTracker.h +++ b/ALICE3/Core/FastTracker.h @@ -16,11 +16,14 @@ #include "GeometryContainer.h" #include -#include -#include #include -#include +#include + +#include + +#include +#include #include #include diff --git a/ALICE3/Core/GeometryContainer.cxx b/ALICE3/Core/GeometryContainer.cxx index f58c9b80926..aee8e36ebd8 100644 --- a/ALICE3/Core/GeometryContainer.cxx +++ b/ALICE3/Core/GeometryContainer.cxx @@ -19,13 +19,19 @@ #include "Common/Core/TableHelper.h" +#include +#include +#include + #include #include +#include #include #include #include +#include #include #include #include @@ -35,6 +41,7 @@ #include #include +#include #include namespace o2::fastsim diff --git a/ALICE3/Core/GeometryContainer.h b/ALICE3/Core/GeometryContainer.h index b3e9e23a538..d5892b5b97b 100644 --- a/ALICE3/Core/GeometryContainer.h +++ b/ALICE3/Core/GeometryContainer.h @@ -18,8 +18,6 @@ #ifndef ALICE3_CORE_GEOMETRYCONTAINER_H_ #define ALICE3_CORE_GEOMETRYCONTAINER_H_ -#include "DetLayer.h" - #include #include #include diff --git a/ALICE3/Core/TOFResoALICE3.cxx b/ALICE3/Core/TOFResoALICE3.cxx index ebd5247230b..6d3bdd40383 100644 --- a/ALICE3/Core/TOFResoALICE3.cxx +++ b/ALICE3/Core/TOFResoALICE3.cxx @@ -18,6 +18,10 @@ #include "ALICE3/Core/TOFResoALICE3.h" +#include + +#include + namespace o2::pid::tof { diff --git a/ALICE3/Core/TOFResoALICE3.h b/ALICE3/Core/TOFResoALICE3.h index b102091f756..e392d120ecf 100644 --- a/ALICE3/Core/TOFResoALICE3.h +++ b/ALICE3/Core/TOFResoALICE3.h @@ -16,14 +16,18 @@ /// \brief Implementation for the TOF PID response of the expected times resolution /// -#ifndef O2_ANALYSIS_PID_TOFRESOALICE3_H_ -#define O2_ANALYSIS_PID_TOFRESOALICE3_H_ +#ifndef ALICE3_CORE_TOFRESOALICE3_H_ +#define ALICE3_CORE_TOFRESOALICE3_H_ -// O2 includes -#include "PID/ParamBase.h" -#include "PID/DetectorResponse.h" -#include "PID/PIDTOF.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include + +#include + +#include +#include + +#include namespace o2::pid::tof { @@ -72,4 +76,4 @@ float TOFResoALICE3ParamTrack(const T& track, const Parameters& parameters) } // namespace o2::pid::tof -#endif +#endif // ALICE3_CORE_TOFRESOALICE3_H_ diff --git a/ALICE3/Core/TrackUtilities.cxx b/ALICE3/Core/TrackUtilities.cxx index c07fe145ccf..739e1df28ae 100644 --- a/ALICE3/Core/TrackUtilities.cxx +++ b/ALICE3/Core/TrackUtilities.cxx @@ -17,6 +17,13 @@ #include "TrackUtilities.h" +#include +#include + +#include + +#include +#include #include void o2::upgrade::convertTLorentzVectorToO2Track(const int charge, diff --git a/ALICE3/Core/TrackUtilities.h b/ALICE3/Core/TrackUtilities.h index edf92224edb..d883a0d2dc8 100644 --- a/ALICE3/Core/TrackUtilities.h +++ b/ALICE3/Core/TrackUtilities.h @@ -18,9 +18,9 @@ #ifndef ALICE3_CORE_TRACKUTILITIES_H_ #define ALICE3_CORE_TRACKUTILITIES_H_ -#include "ReconstructionDataFormats/Track.h" +#include -#include "TLorentzVector.h" +#include #include diff --git a/ALICE3/DataModel/A3DecayFinderTables.h b/ALICE3/DataModel/A3DecayFinderTables.h index f6e3eba8cc6..bd9aa5592b3 100644 --- a/ALICE3/DataModel/A3DecayFinderTables.h +++ b/ALICE3/DataModel/A3DecayFinderTables.h @@ -18,11 +18,12 @@ #ifndef ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_ #define ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_ -// O2 includes #include "Common/Core/RecoDecay.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" +#include + +#include +#include enum a3selectionBit : uint32_t { kDCAxy = 0, kInnerTOFPion, diff --git a/ALICE3/DataModel/ECAL.h b/ALICE3/DataModel/ECAL.h index 1e029d24174..9ef1e8a3391 100644 --- a/ALICE3/DataModel/ECAL.h +++ b/ALICE3/DataModel/ECAL.h @@ -16,11 +16,10 @@ /// \brief Set of tables for the ALICE3 ECAL information /// -#ifndef O2_ANALYSIS_ALICE3_ECAL_H_ -#define O2_ANALYSIS_ALICE3_ECAL_H_ +#ifndef ALICE3_DATAMODEL_ECAL_H_ +#define ALICE3_DATAMODEL_ECAL_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { @@ -53,4 +52,4 @@ using ECAL = ECALs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_ECAL_H_ +#endif // ALICE3_DATAMODEL_ECAL_H_ diff --git a/ALICE3/DataModel/FTOF.h b/ALICE3/DataModel/FTOF.h index e24c1c0585d..3d047c21fd5 100644 --- a/ALICE3/DataModel/FTOF.h +++ b/ALICE3/DataModel/FTOF.h @@ -16,11 +16,10 @@ /// \brief Set of tables for the ALICE3 FTOF information /// -#ifndef O2_ANALYSIS_ALICE3_FTOF_H_ -#define O2_ANALYSIS_ALICE3_FTOF_H_ +#ifndef ALICE3_DATAMODEL_FTOF_H_ +#define ALICE3_DATAMODEL_FTOF_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { @@ -61,4 +60,4 @@ using FTOF = FTOFs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_FTOF_H_ +#endif // ALICE3_DATAMODEL_FTOF_H_ diff --git a/ALICE3/DataModel/MID.h b/ALICE3/DataModel/MID.h index 7d932b90802..7357e689eda 100644 --- a/ALICE3/DataModel/MID.h +++ b/ALICE3/DataModel/MID.h @@ -16,11 +16,12 @@ /// \brief Set of tables for the ALICE3 MID information /// -#ifndef O2_ANALYSIS_ALICE3_MID_H_ -#define O2_ANALYSIS_ALICE3_MID_H_ +#ifndef ALICE3_DATAMODEL_MID_H_ +#define ALICE3_DATAMODEL_MID_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { @@ -41,4 +42,4 @@ using MID = MIDs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_MID_H_ +#endif // ALICE3_DATAMODEL_MID_H_ diff --git a/ALICE3/DataModel/OTFCollision.h b/ALICE3/DataModel/OTFCollision.h index 933bceab62c..e146515f89b 100644 --- a/ALICE3/DataModel/OTFCollision.h +++ b/ALICE3/DataModel/OTFCollision.h @@ -19,8 +19,7 @@ #ifndef ALICE3_DATAMODEL_OTFCOLLISION_H_ #define ALICE3_DATAMODEL_OTFCOLLISION_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFMCParticle.h b/ALICE3/DataModel/OTFMCParticle.h index 987ed28b858..403bf6deada 100644 --- a/ALICE3/DataModel/OTFMCParticle.h +++ b/ALICE3/DataModel/OTFMCParticle.h @@ -19,8 +19,7 @@ #ifndef ALICE3_DATAMODEL_OTFMCPARTICLE_H_ #define ALICE3_DATAMODEL_OTFMCPARTICLE_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFMulticharm.h b/ALICE3/DataModel/OTFMulticharm.h index 5c4224bdce5..643d36c0adb 100644 --- a/ALICE3/DataModel/OTFMulticharm.h +++ b/ALICE3/DataModel/OTFMulticharm.h @@ -20,10 +20,9 @@ #ifndef ALICE3_DATAMODEL_OTFMULTICHARM_H_ #define ALICE3_DATAMODEL_OTFMULTICHARM_H_ -// O2 includes #include "ALICE3/DataModel/OTFStrangeness.h" -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFPIDTrk.h b/ALICE3/DataModel/OTFPIDTrk.h index ce8a5d07a4f..c07a0d6579c 100644 --- a/ALICE3/DataModel/OTFPIDTrk.h +++ b/ALICE3/DataModel/OTFPIDTrk.h @@ -20,8 +20,10 @@ #ifndef ALICE3_DATAMODEL_OTFPIDTRK_H_ #define ALICE3_DATAMODEL_OTFPIDTRK_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFRICH.h b/ALICE3/DataModel/OTFRICH.h index 05771dda57b..bcd42d585ed 100644 --- a/ALICE3/DataModel/OTFRICH.h +++ b/ALICE3/DataModel/OTFRICH.h @@ -19,8 +19,10 @@ #ifndef ALICE3_DATAMODEL_OTFRICH_H_ #define ALICE3_DATAMODEL_OTFRICH_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFStrangeness.h b/ALICE3/DataModel/OTFStrangeness.h index 7ee5c862313..395f1ab8681 100644 --- a/ALICE3/DataModel/OTFStrangeness.h +++ b/ALICE3/DataModel/OTFStrangeness.h @@ -19,10 +19,13 @@ #ifndef ALICE3_DATAMODEL_OTFSTRANGENESS_H_ #define ALICE3_DATAMODEL_OTFSTRANGENESS_H_ -// O2 includes #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFTOF.h b/ALICE3/DataModel/OTFTOF.h index 150efc91f5e..b4bf1f26670 100644 --- a/ALICE3/DataModel/OTFTOF.h +++ b/ALICE3/DataModel/OTFTOF.h @@ -20,8 +20,10 @@ #ifndef ALICE3_DATAMODEL_OTFTOF_H_ #define ALICE3_DATAMODEL_OTFTOF_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { diff --git a/ALICE3/DataModel/RICH.h b/ALICE3/DataModel/RICH.h index ab670002078..a1fc7c7c692 100644 --- a/ALICE3/DataModel/RICH.h +++ b/ALICE3/DataModel/RICH.h @@ -16,12 +16,11 @@ /// \brief Set of tables for the ALICE3 RICH information /// -#ifndef O2_ANALYSIS_ALICE3_RICH_H_ -#define O2_ANALYSIS_ALICE3_RICH_H_ +#ifndef ALICE3_DATAMODEL_RICH_H_ +#define ALICE3_DATAMODEL_RICH_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include namespace o2::aod { @@ -176,4 +175,4 @@ using FRICH = FRICHs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_RICH_H_ +#endif // ALICE3_DATAMODEL_RICH_H_ diff --git a/ALICE3/DataModel/collisionAlice3.h b/ALICE3/DataModel/collisionAlice3.h index ddb10ca9f1d..a1238e9e1d9 100644 --- a/ALICE3/DataModel/collisionAlice3.h +++ b/ALICE3/DataModel/collisionAlice3.h @@ -19,8 +19,7 @@ #ifndef ALICE3_DATAMODEL_COLLISIONALICE3_H_ #define ALICE3_DATAMODEL_COLLISIONALICE3_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/tracksAlice3.h b/ALICE3/DataModel/tracksAlice3.h index 6e03e5e68ba..04cb2d1a9d4 100644 --- a/ALICE3/DataModel/tracksAlice3.h +++ b/ALICE3/DataModel/tracksAlice3.h @@ -19,9 +19,8 @@ #ifndef ALICE3_DATAMODEL_TRACKSALICE3_H_ #define ALICE3_DATAMODEL_TRACKSALICE3_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" #include +#include namespace o2::aod { diff --git a/ALICE3/ML/HfMlResponse3Prong.h b/ALICE3/ML/HfMlResponse3Prong.h index 24c7b479213..7c360634d37 100644 --- a/ALICE3/ML/HfMlResponse3Prong.h +++ b/ALICE3/ML/HfMlResponse3Prong.h @@ -19,8 +19,6 @@ #include "Tools/ML/MlResponse.h" #include -#include -#include #include // Fill the map of available input features diff --git a/ALICE3/Macros/testFastTracker.C b/ALICE3/Macros/testFastTracker.C index f9ec72e0765..c07b7e3ac98 100644 --- a/ALICE3/Macros/testFastTracker.C +++ b/ALICE3/Macros/testFastTracker.C @@ -17,8 +17,7 @@ #include #include - -#include +#include void testFastTracker(std::string geometryFile = "a3geo.ini") { diff --git a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx index 366ffb6a290..c4a028f9445 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx @@ -20,17 +20,30 @@ #include "ALICE3/DataModel/OTFMCParticle.h" #include -#include #include +#include #include +#include +#include #include +#include +#include #include +#include #include +#include +#include #include +#include + +#include +#include +#include #include #include +#include #include #include #include diff --git a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx index 293745458c9..c4caf97f17a 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx @@ -16,14 +16,23 @@ /// \author Nicolò Jacazio , Universita del Piemonte Orientale (IT) /// -#include "ALICE3/Core/FastTracker.h" +#include "GeometryContainer.h" #include +#include +#include #include +#include #include +#include +#include +#include #include -#include +#include +#include + +#include #include #include diff --git a/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx index c11327e9f03..42c9a022fe6 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx @@ -30,42 +30,41 @@ /// \since May 22, 2024 /// +#include "GeometryContainer.h" + #include "ALICE3/Core/DelphesO2TrackSmearer.h" -#include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.h" #include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFRICH.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.h" #include -#include -#include #include #include -#include -#include -#include -#include #include -#include #include +#include #include +#include #include +#include +#include #include -#include +#include #include -#include -#include +#include #include +#include #include #include -#include #include +#include +#include #include #include +#include #include #include #include diff --git a/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx index 75e9d41d5c2..731bc940b5b 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx @@ -24,44 +24,50 @@ /// \since May 22, 2024 /// +#include "GeometryContainer.h" + #include "ALICE3/Core/DelphesO2TrackSmearer.h" -#include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.h" #include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFTOF.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.h" #include -#include -#include -#include #include -#include -#include -#include -#include #include -#include #include +#include #include +#include #include +#include +#include #include -#include +#include #include -#include -#include +#include +#include +#include +#include #include +#include #include #include #include +#include +#include +#include +#include #include +#include #include #include #include +#include + using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index 5989f9d3965..10aaa8aa030 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -23,6 +23,8 @@ /// \author Roberto Preghenella preghenella@bo.infn.it /// +#include "GeometryContainer.h" + #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/DetLayer.h" #include "ALICE3/Core/FastTracker.h" @@ -35,37 +37,73 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" +#include #include #include +#include +#include +#include #include #include +#include #include #include #include #include #include #include +#include #include +#include +#include #include +#include +#include #include -#include +#include #include +#include +#include #include +#include #include +#include +#include +#include #include +#include +#include #include #include +#include +#include #include +#include +#include #include #include +#include + +#include +#include + +#include #include +#include +#include +#include +#include #include +#include #include +#include #include #include +#include + using namespace o2; using namespace o2::framework; using std::array; diff --git a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx index 78db04bba62..fdb0e72afe2 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx @@ -20,43 +20,39 @@ /// \since May 22, 2025 /// -#include "ALICE3/Core/DelphesO2TrackSmearer.h" -#include "ALICE3/Core/FastTracker.h" +#include "GeometryContainer.h" + #include "ALICE3/Core/TrackUtilities.h" -#include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFPIDTrk.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.h" #include #include -#include -#include -#include -#include -#include -#include #include -#include #include +#include #include +#include #include +#include +#include #include -#include +#include #include -#include -#include +#include +#include +#include #include #include -#include -#include +#include +#include #include -#include #include #include #include +#include +#include #include #include #include diff --git a/ALICE3/TableProducer/alice3-centrality.cxx b/ALICE3/TableProducer/alice3-centrality.cxx index 48c7ae617bf..bc06a838697 100644 --- a/ALICE3/TableProducer/alice3-centrality.cxx +++ b/ALICE3/TableProducer/alice3-centrality.cxx @@ -11,13 +11,26 @@ /// \author Nicolo' Jacazio , CERN /// \author David Dobrigkeit Chinellato , UNICAMP/CERN -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" + #include -#include "Common/DataModel/Centrality.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3-correlatorDDbar.cxx b/ALICE3/TableProducer/alice3-correlatorDDbar.cxx index b17216e9b76..0e27bec4476 100644 --- a/ALICE3/TableProducer/alice3-correlatorDDbar.cxx +++ b/ALICE3/TableProducer/alice3-correlatorDDbar.cxx @@ -14,19 +14,26 @@ /// /// \author Fabio Colamaria , INFN Bari -#include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include using namespace o2; diff --git a/ALICE3/TableProducer/alice3-decayfinder.cxx b/ALICE3/TableProducer/alice3-decayfinder.cxx index a78a2ce252c..588f5b6aaa6 100644 --- a/ALICE3/TableProducer/alice3-decayfinder.cxx +++ b/ALICE3/TableProducer/alice3-decayfinder.cxx @@ -21,34 +21,36 @@ #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include #include +#include #include -#include -#include -#include +#include #include using namespace o2; diff --git a/ALICE3/TableProducer/alice3-decaypreselector.cxx b/ALICE3/TableProducer/alice3-decaypreselector.cxx index 7c28a51d118..3b138ad03b7 100644 --- a/ALICE3/TableProducer/alice3-decaypreselector.cxx +++ b/ALICE3/TableProducer/alice3-decaypreselector.cxx @@ -17,43 +17,30 @@ // HF decays. Work in progress: use at your own risk! // -#include "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" - #include "ALICE3/DataModel/A3DecayFinderTables.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include -#include -#include -#include -#include -#include -#include -#include + #include +#include #include -#include +#include +#include +#include +#include +#include #include -#include -#include +#include + #include +#include #include -#include -#include -#include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; // simple checkers // #define biton(var, nbit) ((var) |= (static_cast(1) << (nbit))) diff --git a/ALICE3/TableProducer/alice3-dq-table-maker.cxx b/ALICE3/TableProducer/alice3-dq-table-maker.cxx index 9fdc1cd2953..a6f36151732 100644 --- a/ALICE3/TableProducer/alice3-dq-table-maker.cxx +++ b/ALICE3/TableProducer/alice3-dq-table-maker.cxx @@ -22,34 +22,35 @@ #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/DataModel/ReducedTablesAlice3.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" #include "ALICE3/DataModel/collisionAlice3.h" #include "ALICE3/DataModel/tracksAlice3.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "THashList.h" -#include "TList.h" - +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include #include #include #include -#include #include #include diff --git a/ALICE3/TableProducer/alice3-trackextension.cxx b/ALICE3/TableProducer/alice3-trackextension.cxx index 578d1979310..384810ffdeb 100644 --- a/ALICE3/TableProducer/alice3-trackextension.cxx +++ b/ALICE3/TableProducer/alice3-trackextension.cxx @@ -13,11 +13,16 @@ // Task performing basic track selection for the ALICE3. // -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/Core/trackUtilities.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3-trackselection.cxx b/ALICE3/TableProducer/alice3-trackselection.cxx index 58f3a4f33ce..1a621f81df7 100644 --- a/ALICE3/TableProducer/alice3-trackselection.cxx +++ b/ALICE3/TableProducer/alice3-trackselection.cxx @@ -14,11 +14,23 @@ /// \brief Track selection for the ALICE3 studies /// -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/trackUtilities.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3HfSelector3Prong.cxx b/ALICE3/TableProducer/alice3HfSelector3Prong.cxx index d075b56b0c9..89c34ff1cf3 100644 --- a/ALICE3/TableProducer/alice3HfSelector3Prong.cxx +++ b/ALICE3/TableProducer/alice3HfSelector3Prong.cxx @@ -16,12 +16,9 @@ #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "ALICE3/DataModel/OTFPIDTrk.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/ML/HfMlResponse3Prong.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "ALICE3/Utils/utilsSelectionsAlice3.h" @@ -36,14 +33,14 @@ #include #include #include -#include #include +#include #include -#include +#include + #include -#include #include #include diff --git a/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx b/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx index b74a75ad29b..7a97f1420ff 100644 --- a/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx +++ b/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx @@ -16,14 +16,9 @@ /// \author Marcello Di Costanzo , Turin Polytechnic University and INFN Turin #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "ALICE3/DataModel/OTFPIDTrk.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "Common/Core/RecoDecay.h" -#include #include #include #include @@ -32,8 +27,9 @@ #include #include +#include #include -#include +#include using namespace o2; using namespace o2::analysis; diff --git a/ALICE3/TableProducer/alice3MulticharmFinder.cxx b/ALICE3/TableProducer/alice3MulticharmFinder.cxx index 16e0e9571c7..fd4a7a47881 100644 --- a/ALICE3/TableProducer/alice3MulticharmFinder.cxx +++ b/ALICE3/TableProducer/alice3MulticharmFinder.cxx @@ -23,40 +23,44 @@ #include "ALICE3/DataModel/A3DecayFinderTables.h" #include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFMulticharm.h" -#include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFStrangeness.h" -#include "ALICE3/DataModel/OTFTOF.h" #include "ALICE3/DataModel/tracksAlice3.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexer.h" -#include "DetectorsVertexing/PVertexerHelpers.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include #include #include +#include #include -#include #include +#include #include -#include #include using namespace o2; diff --git a/ALICE3/TableProducer/alice3TrackingTranslator.cxx b/ALICE3/TableProducer/alice3TrackingTranslator.cxx index 706d5cba462..c68cb2adbe3 100644 --- a/ALICE3/TableProducer/alice3TrackingTranslator.cxx +++ b/ALICE3/TableProducer/alice3TrackingTranslator.cxx @@ -24,20 +24,29 @@ #include #include #include +#include +#include #include -#include +#include #include #include -#include +#include #include #include +#include #include #include #include #include +#include + +#include +#include #include +#include +#include #include #include #include @@ -313,7 +322,7 @@ struct Alice3TrackingTranslator { float collisionY = 0.0f; float collisionZ = 0.0f; - tableOTFLUTConfigId(0); // dummy for the moment + tableOTFLUTConfigId(0); // dummy for the moment // Determine the collision ID for the new entry. // If the table is empty, lastIndex() returns -1, so we start at 0. diff --git a/ALICE3/TableProducer/alice3strangenessFinder.cxx b/ALICE3/TableProducer/alice3strangenessFinder.cxx index f2a60b5ab8c..3d79ff057a4 100644 --- a/ALICE3/TableProducer/alice3strangenessFinder.cxx +++ b/ALICE3/TableProducer/alice3strangenessFinder.cxx @@ -31,18 +31,30 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include #include +#include #include #include +#include +#include #include +#include +#include +#include +#include +#include #include +#include +#include + +#include +#include #include #include diff --git a/ALICE3/Tasks/ECALqa.cxx b/ALICE3/Tasks/ECALqa.cxx index 5e337cefdbd..73a73ca32a3 100644 --- a/ALICE3/Tasks/ECALqa.cxx +++ b/ALICE3/Tasks/ECALqa.cxx @@ -16,16 +16,24 @@ /// \brief Task to use the ALICE3 ECAL table /// -// O2 includes #include "ALICE3/DataModel/ECAL.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; -using namespace o2::track; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/ALICE3/Tasks/alice3-cdeuteron.cxx b/ALICE3/Tasks/alice3-cdeuteron.cxx index c3c67e2efdb..6dc574189f2 100644 --- a/ALICE3/Tasks/alice3-cdeuteron.cxx +++ b/ALICE3/Tasks/alice3-cdeuteron.cxx @@ -12,18 +12,30 @@ /// \author Nicolo' Jacazio , CERN /// \author Alexander Kalweit , CERN -// O2 includes -#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/PIDResponseTOF.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/PID.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index 4ed9ee35a87..099e6205262 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -23,13 +23,23 @@ #include #include #include +#include #include +#include #include +#include +#include #include +#include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3-dq-efficiency.cxx b/ALICE3/Tasks/alice3-dq-efficiency.cxx index 87b782e62cb..99dcd281727 100644 --- a/ALICE3/Tasks/alice3-dq-efficiency.cxx +++ b/ALICE3/Tasks/alice3-dq-efficiency.cxx @@ -26,26 +26,23 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/DataModel/ReducedTablesAlice3.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/collisionAlice3.h" -#include "ALICE3/DataModel/tracksAlice3.h" #include "Common/Core/TableHelper.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include #include -#include -#include #include #include +#include +#include #include #include #include @@ -58,6 +55,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod diff --git a/ALICE3/Tasks/alice3-lutmaker.cxx b/ALICE3/Tasks/alice3-lutmaker.cxx index 8b1fddb95df..de28c90583c 100644 --- a/ALICE3/Tasks/alice3-lutmaker.cxx +++ b/ALICE3/Tasks/alice3-lutmaker.cxx @@ -13,10 +13,28 @@ /// \brief Task to extract LUTs for the fast simulation from full simulation /// \since 27/04/2021 +#include +#include #include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include struct Alice3LutMaker { static constexpr int nSpecies = 8; diff --git a/ALICE3/Tasks/alice3-qa-multiplicity.cxx b/ALICE3/Tasks/alice3-qa-multiplicity.cxx index b798209dfde..a5440ff8d53 100644 --- a/ALICE3/Tasks/alice3-qa-multiplicity.cxx +++ b/ALICE3/Tasks/alice3-qa-multiplicity.cxx @@ -10,12 +10,22 @@ // or submit itself to any jurisdiction. /// \author Nicolo' Jacazio , CERN -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/ALICE3/Tasks/alice3-qa-singleparticle.cxx b/ALICE3/Tasks/alice3-qa-singleparticle.cxx index 70559fdd33c..fcd3f92bbc9 100644 --- a/ALICE3/Tasks/alice3-qa-singleparticle.cxx +++ b/ALICE3/Tasks/alice3-qa-singleparticle.cxx @@ -15,14 +15,29 @@ /// \brief Task to monitor the single particle QA, at the particle and track level, showing the tracked and the origin of particles /// +#include +#include +#include #include +#include #include +#include +#include #include +#include #include #include +#include +#include #include +#include +#include + +#include +#include +#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx b/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx index b6c8058f747..67ada10b571 100644 --- a/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx +++ b/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx @@ -14,17 +14,26 @@ /// /// \author Fabio Colamaria , INFN Bari -#include - -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - #include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/Utils/utilsAnalysis.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" -// #include "PWGHF/DataModel/CandidateReconstructionTables.h" -// #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/alice3DecayerQa.cxx b/ALICE3/Tasks/alice3DecayerQa.cxx index ea02c5cb29e..b84d33af111 100644 --- a/ALICE3/Tasks/alice3DecayerQa.cxx +++ b/ALICE3/Tasks/alice3DecayerQa.cxx @@ -19,16 +19,18 @@ #include "ALICE3/DataModel/OTFMCParticle.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamRegistry.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" #include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3Efficiency.cxx b/ALICE3/Tasks/alice3Efficiency.cxx index 7741ea24696..bb44f33a6e2 100644 --- a/ALICE3/Tasks/alice3Efficiency.cxx +++ b/ALICE3/Tasks/alice3Efficiency.cxx @@ -17,16 +17,24 @@ /// \since May 27, 2025 /// +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include #include +#include #include -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/ConfigParamRegistry.h" -#include "TEfficiency.h" -#include "THashList.h" - using namespace o2; using namespace o2::framework; std::map effVsPt; diff --git a/ALICE3/Tasks/alice3HfTask3Prong.cxx b/ALICE3/Tasks/alice3HfTask3Prong.cxx index b962c368932..4f21bada994 100644 --- a/ALICE3/Tasks/alice3HfTask3Prong.cxx +++ b/ALICE3/Tasks/alice3HfTask3Prong.cxx @@ -14,16 +14,11 @@ /// \author Marcello Di Costanzo , Polytechnic University of Turin and INFN Turin #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "ALICE3/DataModel/OTFPIDTrk.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "ALICE3/Utils/utilsSelectionsAlice3.h" #include "Common/Core/RecoDecay.h" #include -#include #include #include #include @@ -33,12 +28,12 @@ #include #include #include -#include #include #include +#include #include -#include +#include #include #include diff --git a/ALICE3/Tasks/alice3Multicharm.cxx b/ALICE3/Tasks/alice3Multicharm.cxx index 41ff2f2b38a..56689b48530 100644 --- a/ALICE3/Tasks/alice3Multicharm.cxx +++ b/ALICE3/Tasks/alice3Multicharm.cxx @@ -20,43 +20,28 @@ // Uses specific ALICE 3 PID and performance for studying // HF decays. Work in progress: use at your own risk! -#include "ALICE3/DataModel/A3DecayFinderTables.h" #include "ALICE3/DataModel/OTFMulticharm.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFStrangeness.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/tracksAlice3.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Tools/ML/MlResponse.h" #include "Tools/ML/model.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexer.h" -#include "DetectorsVertexing/PVertexerHelpers.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include +#include #include -#include #include #include -#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3PidEvaluation.cxx b/ALICE3/Tasks/alice3PidEvaluation.cxx index 2ee64ea7623..888b7a27dde 100644 --- a/ALICE3/Tasks/alice3PidEvaluation.cxx +++ b/ALICE3/Tasks/alice3PidEvaluation.cxx @@ -23,23 +23,24 @@ #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CommonUtils/NameConf.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TProfile.h" -#include "TVector3.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include +#include +#include #include #include #include diff --git a/ALICE3/Tasks/alice3SeparationPower.cxx b/ALICE3/Tasks/alice3SeparationPower.cxx index 2c7a829f5bb..77f425d36d4 100644 --- a/ALICE3/Tasks/alice3SeparationPower.cxx +++ b/ALICE3/Tasks/alice3SeparationPower.cxx @@ -17,21 +17,25 @@ /// \since May 13, 2025 /// -#include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" #include +#include #include +#include #include -#include +#include +#include #include #include #include +#include -#include +#include +#include +#include #include -#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3Strangeness.cxx b/ALICE3/Tasks/alice3Strangeness.cxx index 3b539616fab..499624cd6bf 100644 --- a/ALICE3/Tasks/alice3Strangeness.cxx +++ b/ALICE3/Tasks/alice3Strangeness.cxx @@ -24,33 +24,25 @@ #include "ALICE3/DataModel/tracksAlice3.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include #include -#include -#include -#include -#include -#include -#include #include +#include +#include #include #include -#include +#include +#include +#include #include -#include -#include +#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include #include +#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3TrackingPerformance.cxx b/ALICE3/Tasks/alice3TrackingPerformance.cxx index a5958bab772..fe903bf6176 100644 --- a/ALICE3/Tasks/alice3TrackingPerformance.cxx +++ b/ALICE3/Tasks/alice3TrackingPerformance.cxx @@ -19,14 +19,24 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamRegistry.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include #include +#include #include using namespace o2; diff --git a/ALICE3/Tasks/pidFTOFqa.cxx b/ALICE3/Tasks/pidFTOFqa.cxx index 52dbaf8dcfa..ba899e4dc85 100644 --- a/ALICE3/Tasks/pidFTOFqa.cxx +++ b/ALICE3/Tasks/pidFTOFqa.cxx @@ -9,14 +9,19 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// O2 includes -#include "ReconstructionDataFormats/Track.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" #include "ALICE3/DataModel/FTOF.h" -#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/pidRICHqa.cxx b/ALICE3/Tasks/pidRICHqa.cxx index 3a8a960b4ed..4a420ffe34f 100644 --- a/ALICE3/Tasks/pidRICHqa.cxx +++ b/ALICE3/Tasks/pidRICHqa.cxx @@ -15,12 +15,28 @@ /// \brief Task to produce QA output of the PID with ALICE3 RICH running on the MC. /// -// O2 includes #include "ALICE3/DataModel/RICH.h" #include "Common/DataModel/PIDResponseTOF.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::track; @@ -36,7 +52,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include namespace o2::aod { diff --git a/ALICE3/Utils/utilsHfAlice3.h b/ALICE3/Utils/utilsHfAlice3.h index b0106f739e4..04d089f8a58 100644 --- a/ALICE3/Utils/utilsHfAlice3.h +++ b/ALICE3/Utils/utilsHfAlice3.h @@ -19,6 +19,11 @@ #include "PWGHF/Core/HfHelper.h" +#include "Common/Core/RecoDecay.h" + +#include +#include + namespace o2::analysis { From 75d6966d8df2e3c6127236891ac508cde5f76fe6 Mon Sep 17 00:00:00 2001 From: Thorkj <154221526+Thorkj@users.noreply.github.com> Date: Fri, 27 Mar 2026 06:34:35 +0100 Subject: [PATCH 066/282] [PWGCF] added the possibility of ft0-A and ft0-C correlations, but removed mftreassociated3D (#15500) --- .../Tasks/corrSparse.cxx | 173 +++++++++++++++--- 1 file changed, 152 insertions(+), 21 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 6c6e7464216..1497bf7520e 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -100,7 +100,7 @@ struct CorrSparse { O2_DEFINE_CONFIGURABLE(processFT0A, bool, true, "Process FT0A correlations") O2_DEFINE_CONFIGURABLE(processFT0C, bool, true, "Process FT0C correlations") O2_DEFINE_CONFIGURABLE(processMFT, bool, true, "Process MFT correlations") - O2_DEFINE_CONFIGURABLE(withGain, bool, true, "Use gain for FT0A and FT0C") + O2_DEFINE_CONFIGURABLE(withGain, bool, false, "Use gain for FT0A and FT0C") } cfgDetectorConfig; @@ -216,6 +216,7 @@ struct CorrSparse { ConfigurableAxis axisDeltaEtaMftFt0c{"axisDeltaEtaMFTFT0C", {48, -2.0, 0.6}, "delta eta axis for MFT-FT0C histograms"}; ConfigurableAxis axisDeltaEtaMftFt0a{"axisDeltaEtaMFTFT0A", {48, -8.5, -5.9}, "delta eta axis for MFT-FT0A histograms"}; ConfigurableAxis axisDeltaEtaMftFv0{"axisDeltaEtaMFTFV0", {48, -8.6, -4.7}, "delta eta axis for MFT-FV0 histograms"}; + ConfigurableAxis axisDeltaEtaFt0s{"axisDeltaEtaFT0S", {48, -8.6, 5.0}, "delta eta axis for FT0S 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"}; @@ -343,7 +344,7 @@ struct CorrSparse { LOGF(info, "Starting init"); // Event Counter - if ((doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) && cfgUseAdditionalEventCut) { + if ((doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) && cfgUseAdditionalEventCut) { registry.add("hEventCountSpecific", "Number of Event;; Count", {HistType::kTH1D, {{13, 0, 13}}}); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(1, "after sel8"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(2, "kNoSameBunchPileup"); @@ -360,7 +361,7 @@ struct CorrSparse { registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(13, "cfgEvSelV0AT0ACut"); } - if (doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT) { registry.add("hEventCountMftReassoc", "Number of Events;; Count", {HistType::kTH1D, {{4, 0, 4}}}); registry.get(HIST("hEventCountMftReassoc"))->GetXaxis()->SetBinLabel(1, "all MFT tracks"); registry.get(HIST("hEventCountMftReassoc"))->GetXaxis()->SetBinLabel(2, "MFT tracks after selection"); @@ -373,12 +374,12 @@ struct CorrSparse { } // Make histograms to check the distributions after cuts - if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) { registry.add("Phi", "Phi", {HistType::kTH1D, {axisPhi}}); if (doprocessSameMFTFIT) { registry.add("Eta", "EtaMFT", {HistType::kTH1D, {axisEtaMft}}); } - if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D) { + if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameTpcMftReassociated2D) { registry.add("Eta", "Eta", {HistType::kTH1D, {axisEta}}); } registry.add("EtaCorrected", "EtaCorrected", {HistType::kTH1D, {axisEta}}); @@ -389,7 +390,7 @@ struct CorrSparse { registry.add("zVtx", "zVtx", {HistType::kTH1D, {axisVertex}}); registry.add("zVtx_used", "zVtx_used", {HistType::kTH1D, {axisVertex}}); - if (doprocessSameTpcFIT || doprocessSameMFTFIT || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcFIT || doprocessSameMFTFIT || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) { registry.add("FT0Amp", "", {HistType::kTH2F, {axisChID, axisFit}}); registry.add("FV0Amp", "", {HistType::kTH2F, {axisChID, axisFit}}); registry.add("FT0AmpCorrect", "", {HistType::kTH2F, {axisChID, axisFit}}); @@ -446,7 +447,7 @@ struct CorrSparse { } } - if (doprocessSameTpcMft || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D) { + if (doprocessSameTpcMft || doprocessSameTpcMftReassociated2D) { registry.add("deltaEta_deltaPhi_same_TPC_MFT", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcMft}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed_TPC_MFT", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcMft}}); registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); @@ -458,6 +459,12 @@ struct CorrSparse { registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); } + if (doprocessSameFT0s) { + registry.add("deltaEta_deltaPhi_same_FT0A_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaFt0s}}); // check to see the delta eta and delta phi distribution + registry.add("deltaEta_deltaPhi_mixed_FT0A_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaFt0s}}); + registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); + } + registry.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event LOGF(info, "Initializing correlation container"); @@ -528,6 +535,13 @@ struct CorrSparse { {axisDeltaPhi, "#Delta#varphi (rad)"}, {axisDeltaEtaMftFv0, "#Delta#eta"}}; + std::vector corrAxisFT0s = {{axisSample, "Sample"}, + {axisVertex, "z-vtx (cm)"}, + {axisPtTrigger, "p_{T} (GeV/c)"}, + {axisPtAssoc, "p_{T} (GeV/c)"}, + {axisDeltaPhi, "#Delta#varphi (rad)"}, + {axisDeltaEtaFt0s, "#Delta#eta"}}; + if (doprocessSameTpcFIT) { if (cfgDetectorConfig.processFT0A) { same.setObject(new CorrelationContainer("sameEvent_TPC_FT0A", "sameEvent_TPC_FT0A", corrAxisTpcFt0a, effAxis, userAxis)); @@ -588,9 +602,9 @@ struct CorrSparse { mixed.setObject(new CorrelationContainer("mixedEvent_TPC_MFT_Reassociated2D", "mixedEvent_TPC_MFT_Reassociated2D", corrAxisTpcMft, effAxis, userAxis)); } - if (doprocessSameTpcMftReassociated3D) { - same.setObject(new CorrelationContainer("sameEvent_TPC_MFT_Reassociated3D", "sameEvent_TPC_MFT_Reassociated3D", corrAxisTpcMft, effAxis, userAxis)); - mixed.setObject(new CorrelationContainer("mixedEvent_TPC_MFT_Reassociated3D", "mixedEvent_TPC_MFT_Reassociated3D", corrAxisTpcMft, effAxis, userAxis)); + if (doprocessSameFT0s) { + same.setObject(new CorrelationContainer("sameEvent_FT0A_FT0C", "sameEvent_FT0A_FT0C", corrAxisTpcFt0c, effAxis, userAxis)); + mixed.setObject(new CorrelationContainer("mixedEvent_FT0A_FT0C", "mixedEvent_FT0A_FT0C", corrAxisTpcFt0c, effAxis, userAxis)); } LOGF(info, "End of init"); } @@ -771,7 +785,7 @@ struct CorrSparse { auto theta = std::atan2(r, z); return -std::log(std::tan(0.5 * theta)); } - // checks if it is an accepted mft track + template bool isAcceptedMftTrack(TTrack const& mftTrack) { @@ -1493,6 +1507,64 @@ struct CorrSparse { } } + template + void fillCorrelationsFT0s(TFT0s const& ft01, TFT0s const& ft02, float posZ, int multiplicity, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + { + int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); + + if (cfgQaCheck) { + if (system == SameEvent) { + registry.fill(HIST("zVtx_used"), posZ); + registry.fill(HIST("Nch"), multiplicity); + registry.fill(HIST("Nch_used_ft0c"), ft02.channelC().size()); + registry.fill(HIST("Nch_used_ft0a"), ft01.channelA().size()); + } + } + + float triggerWeight = 1.0f; + std::size_t channelASize = ft01.channelA().size(); + std::size_t channelCSize = ft02.channelC().size(); + // loop over all tracks + for (std::size_t iChA = 0; iChA < channelASize; iChA++) { + + int chanelAid = 0; + float amplA = 0.; + if (cfgDetectorConfig.withGain) { + getChannelWithGain(ft01, iChA, chanelAid, amplA, kFT0A); + } else { + getChannelFT0(ft01, iChA, chanelAid, amplA, kFT0A); + } + auto phiA = getPhiFT0(chanelAid, kFT0A); + auto etaA = getEtaFT0(chanelAid, kFT0A); + + if (system == SameEvent) { + registry.fill(HIST("Trig_hist"), fSampleIndex, posZ, 0.5, eventWeight * amplA); + } + + for (std::size_t iChC = 0; iChC < channelCSize; iChC++) { + int chanelCid = 0; + float amplC = 0.; + if (cfgDetectorConfig.withGain) { + getChannelWithGain(ft02, iChC, chanelCid, amplC, kFT0C); + } else { + getChannelFT0(ft02, iChC, chanelCid, amplC, kFT0C); + } + auto phiC = getPhiFT0(chanelCid, kFT0C); + auto etaC = getEtaFT0(chanelCid, kFT0C); + float deltaPhi = RecoDecay::constrainAngle(phiA - phiC, -PIHalf); + float deltaEta = etaA - etaC; + + // fill the right sparse and histograms + if (system == SameEvent) { + registry.fill(HIST("deltaEta_deltaPhi_same_FT0A_FT0C"), deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + same->getPairHist()->Fill(step, fSampleIndex, posZ, 0.5, 0.5, deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + } else if (system == MixedEvent) { + registry.fill(HIST("deltaEta_deltaPhi_mixed_FT0A_FT0C"), deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + mixed->getPairHist()->Fill(step, fSampleIndex, posZ, 0.5, 0.5, deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + } + } + } + } ////////////////////////////////////// ////// Same event processing ///////// ////////////////////////////////////// @@ -1740,29 +1812,37 @@ struct CorrSparse { } PROCESS_SWITCH(CorrSparse, processSameTpcMftReassociated2D, "Process same event for TPC-MFT correlation with reassociated tracks", false); - void processSameTpcMftReassociated3D(AodCollisions::iterator const& collision, AodTracks const& tracks, - soa::SmallGroups const& reassociatedMftTracks, - aod::BCsWithTimestamps const&) + void processSameFT0s(AodCollisions::iterator const& collision, AodTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) { if (!collision.sel8()) return; + auto bc = collision.bc_as(); - if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), true)) + if (cfgUseAdditionalEventCut && !eventSelected(collision, 0, true)) return; - registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin + if (!collision.has_foundFT0()) + return; + + loadAlignParam(bc.timestamp()); + if (cfgDetectorConfig.withGain) { + loadGain(bc); + } loadCorrection(bc.timestamp()); - fillYield(collision, tracks); - if (tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult) { + if ((tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult)) { return; } - fillCorrelationsMftReassociatedTracks(tracks, reassociatedMftTracks, tracks.size(), collision.posZ(), SameEvent, getMagneticField(bc.timestamp()), false); - } - PROCESS_SWITCH(CorrSparse, processSameTpcMftReassociated3D, "Process same event for TPC-MFT correlation with reassociated tracks", false); + registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin + + const auto& ft0s = collision.foundFT0(); + auto multiplicity = tracks.size(); + fillCorrelationsFT0s(ft0s, ft0s, collision.posZ(), multiplicity, SameEvent, 1.0f); + } + PROCESS_SWITCH(CorrSparse, processSameFT0s, "Process same event for FT0 correlation", false); //////////////////////////////////// ////// Mixed event processing ////// //////////////////////////////////// @@ -1983,6 +2063,57 @@ struct CorrSparse { } } PROCESS_SWITCH(CorrSparse, processMixedTpcMFT, "Process mixed events for TPC-MFT correlation", false); + + void processMixedFT0s(AodCollisions const& collisions, AodTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) + { + + auto getTracksSize = [&tracks, this](AodCollisions::iterator const& collision) { + auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), this->cache); + auto mult = associatedTracks.size(); + return mult; + }; + + using MixedBinning = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getTracksSize)>; + + MixedBinning binningOnVtxAndMult{{getTracksSize}, {vtxMix, multMix}, true}; + + auto tracksTuple = std::make_tuple(tracks, tracks); + Pair pair{binningOnVtxAndMult, cfgMinMixEventNum, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + + for (auto it = pair.begin(); it != pair.end(); it++) { + auto& [collision1, tracks1, collision2, tracks2] = *it; + + if (!collision1.sel8() || !collision2.sel8()) + continue; + + if (collision1.globalIndex() == collision2.globalIndex()) { + continue; + } + + if ((tracks1.size() < cfgEventSelection.cfgMinMult || tracks1.size() >= cfgEventSelection.cfgMaxMult)) + continue; + + if (cfgUseAdditionalEventCut && !eventSelected(collision1, tracks1.size(), false)) + continue; + if (cfgUseAdditionalEventCut && !eventSelected(collision2, tracks2.size(), false)) + continue; + + if (!(collision1.has_foundFT0() && collision2.has_foundFT0())) + continue; + + registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin + auto bc = collision1.bc_as(); + loadAlignParam(bc.timestamp()); + loadCorrection(bc.timestamp()); + + auto multiplicity = tracks1.size(); + + const auto& ft0_1 = collision1.foundFT0(); + const auto& ft0_2 = collision2.foundFT0(); + fillCorrelationsFT0s(ft0_1, ft0_2, collision1.posZ(), multiplicity, MixedEvent, 1.0f); + } + } + PROCESS_SWITCH(CorrSparse, processMixedFT0s, "Process mixed events for FT0 correlation", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 77d68f559fedf5d25027b6ae204f0d7c1c77300a Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Fri, 27 Mar 2026 06:35:01 +0100 Subject: [PATCH 067/282] [PWGCF] fix pid efficiency logic, counting logic (#15514) --- PWGCF/GenericFramework/Core/FlowContainer.cxx | 2 +- .../Tasks/flowGenericFramework.cxx | 157 +++++++++++------- 2 files changed, 98 insertions(+), 61 deletions(-) diff --git a/PWGCF/GenericFramework/Core/FlowContainer.cxx b/PWGCF/GenericFramework/Core/FlowContainer.cxx index 532eb35c80c..338c6de9cf1 100644 --- a/PWGCF/GenericFramework/Core/FlowContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowContainer.cxx @@ -422,7 +422,7 @@ TH1D* FlowContainer::GetCorrXXVsPt(const char* order, double lminmulti, double l TProfile* profY = rhProfSub->ProfileY("profY", minm, maxm); TH1D* histY = ProfToHist(profY); TH1D* hist = new TH1D("temphist", "temphist", fNbinsPt, fbinsPt); - for (int ibin = 1; ibin < hist->GetNbinsX(); ibin++) { + for (int ibin = 1; ibin <= hist->GetNbinsX(); ibin++) { TString bLabel = rhProfSub->GetYaxis()->GetBinLabel(ibin + ybn1 - 1); hist->GetXaxis()->SetBinLabel(ibin, bLabel.Data()); hist->SetBinContent(ibin, histY->GetBinContent(ibin + ybn1 - 1)); diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index c540448709a..854fa50e9ca 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -572,6 +572,7 @@ struct FlowGenericFramework { registry.add("K0/hK0Eta", "", {HistType::kTH1D, {etaAxis}}); registry.add("K0/hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, ptAxis, nchAxis}}}); registry.add("K0/hK0s", "", {HistType::kTH1D, {singleCount}}); + registry.add("K0/hK0s_corrected", "", {HistType::kTH1D, {singleCount}}); registry.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCandidate, "K0 candidates"); @@ -602,6 +603,7 @@ struct FlowGenericFramework { registry.add("Lambda/hAntiLambdaEta", "", {HistType::kTH1D, {etaAxis}}); registry.add("Lambda/hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); registry.add("Lambda/hLambdas", "", {HistType::kTH1D, {singleCount}}); + registry.add("Lambda/hLambdas_corrected", "", {HistType::kTH1D, {singleCount}}); registry.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCandidate, "Lambda candidates"); @@ -855,7 +857,7 @@ struct FlowGenericFramework { } LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency); } else { - std::vector species = {"ch", "pi", "ka", "pr", "k0", "lambda"}; + std::vector species = {"ch", "pi", "ka", "pr"}; for (const auto& sp : species) { cfg.mPIDEfficiencies.push_back(ccdb->getForTimeStamp(cfgEfficiency.value + "/" + sp, timestamp)); if (cfg.mPIDEfficiencies.back() == nullptr) @@ -1203,13 +1205,14 @@ struct FlowGenericFramework { template void fillOutputContainers(const float& centmult, const double& rndm, AcceptedTracks acceptedtracks) { - for (auto container : fFCpts) { + for (auto& container : fFCpts) { container->calculateCorrelations(); container->fillPtProfiles(centmult, rndm); container->fillCMProfiles(centmult, rndm); - if (!cfgUseGapMethod) - container->fillVnPtStdProfiles(centmult, rndm); } + if (!cfgUseGapMethod) + fFCpts[0]->fillVnPtStdProfiles(centmult, rndm); + for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { if (!corrconfigs.at(l_ind).pTDif) { auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); @@ -1219,9 +1222,7 @@ struct FlowGenericFramework { if (std::abs(val) < 1) { (dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm) : fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm); if (cfgUseGapMethod) { - for (auto container : fFCpts) { - container->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); - } + fFCpts[0]->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); } } continue; @@ -1235,8 +1236,8 @@ struct FlowGenericFramework { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, dnx, rndm); } } - float chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; + double chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; // calculate fractions std::vector> inputs = {acceptedtracks.nch, acceptedtracks.npi, acceptedtracks.nka, acceptedtracks.npr}; std::vector> fractions; @@ -1246,9 +1247,9 @@ struct FlowGenericFramework { fractions.emplace_back(); fractions.back().reserve(vec.size()); - float total = chtotal; + double total = chtotal; if (cfgUsePIDTotal) - (pidcounter) ? acceptedtracks.pidtotal[pidcounter] : chtotal; + total = (pidcounter) ? acceptedtracks.pidtotal[pidcounter - 1] : chtotal; if (total == 0.) { ++pidcounter; @@ -1259,6 +1260,7 @@ struct FlowGenericFramework { [&](double x) { return x / total; }); ++pidcounter; } + for (std::size_t i = 0; i < fractions[0].size(); ++i) registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[0][i]); for (std::size_t i = 0; i < fractions[1].size(); ++i) @@ -1267,6 +1269,10 @@ struct FlowGenericFramework { registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[2][i]); for (std::size_t i = 0; i < fractions[3].size(); ++i) registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[3][i]); + + if (corrconfigsradial.size() < 4) + return; + for (uint l_ind = 0; l_ind < 4; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); @@ -1349,51 +1355,50 @@ struct FlowGenericFramework { // Process V0s for (const auto& v0 : v0s) { if (resoSwitchVals[K0][kUseParticle]) { - if (selectK0(collision, v0, centrality)) { + double weff = 1; + if (selectK0(collision, v0, centrality, weff)) { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (v0.mK0Short() < cfgPIDCuts.cfgK0SignalMin) - npt_resonances[0][ptBinIndex] += getEfficiency(v0); + npt_resonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMax) - npt_resonances[2][ptBinIndex] += getEfficiency(v0); + npt_resonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else - npt_resonances[1][ptBinIndex] += getEfficiency(v0); - registry.fill(HIST("K0/hK0s"), 1); + npt_resonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } // Add lambdabar if (resoSwitchVals[LAMBDA][kUseParticle]) { - if (selectLambda(collision, v0, centrality)) { + double weff = 1.; + if (selectLambda(collision, v0, centrality, weff)) { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMin) - npt_resonances[3][ptBinIndex] += getEfficiency(v0); + npt_resonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMax) - npt_resonances[5][ptBinIndex] += getEfficiency(v0); + npt_resonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else - npt_resonances[4][ptBinIndex] += getEfficiency(v0); - registry.fill(HIST("Lambda/hLambdas"), 1); + npt_resonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } } - float chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; + double chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; // calculate fractions std::vector> fractions_resonances = npt_resonances; int pidcounter = 0; - for (const auto& vec : fractions_resonances) { - float total = chtotal; + for (auto& vec : fractions_resonances) { + double total = chtotal; if (cfgUsePIDTotal) - (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0) : chtotal; + total = (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0.f) : chtotal; if (total == 0.) { ++pidcounter; continue; } - std::transform(vec.begin(), vec.end(), - std::back_inserter(fractions_resonances.back()), - [&](double x) { return x / total; }); + std::transform(vec.begin(), vec.end(), vec.begin(), + [&](float x) { return x / total; }); ++pidcounter; } for (std::size_t i = 0; i < fractions_resonances[0].size(); ++i) @@ -1408,6 +1413,7 @@ struct FlowGenericFramework { registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[5][i]); for (std::size_t i = 0; i < fractions_resonances[4].size(); ++i) registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[4][i]); + for (uint l_ind = 4; l_ind < corrconfigsradial.size(); ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); @@ -1458,8 +1464,10 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; + double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { - acceptedTracks.total += getEfficiency(track, 0); + if (weffCh > 0) + acceptedTracks.total += weffCh; ++acceptedTracks.total_uncorr; } @@ -1477,18 +1485,21 @@ struct FlowGenericFramework { } if (std::abs(track.eta()) < cfgEtaNch) { - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track, pidIndex); + double weff = getEfficiency(track, pidIndex); + + if (pidIndex && weff > 0) + acceptedTracks.pidtotal[pidIndex - 1] += weff; int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; - if (pidIndex == 1) - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; - if (pidIndex == 2) - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; - if (pidIndex == 3) - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (weffCh > 0) + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; + if (pidIndex == 1 && weff > 0) + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (pidIndex == 2 && weff > 0) + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (pidIndex == 3 && weff > 0) + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } @@ -1557,8 +1568,10 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; + double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { - acceptedTracks.total += getEfficiency(track, 0); + if (weffCh > 0) + acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; ++acceptedTracks.total_uncorr; } @@ -1569,23 +1582,23 @@ struct FlowGenericFramework { int pidIndex = getNsigmaPID(track); if (std::abs(track.eta()) < cfgEtaNch) { - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track, pidIndex); + double weff = getEfficiency(track, pidIndex); + if (pidIndex && weff > 0) + acceptedTracks.pidtotal[pidIndex - 1] += weff; - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; - if (pidIndex == 1) { - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (weffCh > 0) + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; + if (pidIndex == 1 && weff > 0) { + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } - if (pidIndex == 2) { - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (pidIndex == 2 && weff > 0) { + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } - if (pidIndex == 3) { - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (pidIndex == 3 && weff > 0) { + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } @@ -1636,7 +1649,7 @@ struct FlowGenericFramework { } template - bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality) + bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) { double mass_K0s = v0.mK0Short(); @@ -1686,11 +1699,20 @@ struct FlowGenericFramework { registry.fill(HIST("K0/PiMinusTPC_K0"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("K0/PiMinusTOF_K0"), negtrack.pt(), negtrack.tofNSigmaKa()); + registry.fill(HIST("K0/hK0s"), 1); + if (cfgUsePIDEfficiencies) { + double weff_d1 = getEfficiency(postrack, 1); + double weff_d2 = getEfficiency(negtrack, 1); + weff = weff_d1 * weff_d2; + if (weff > 0) + registry.fill(HIST("K0/hK0s_corrected"), weff); + } + return true; } template - bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality) + bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) { bool isL = false; // Is lambda candidate bool isAL = false; // Is anti-lambda candidate @@ -1764,6 +1786,15 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/PrPlusTOF_L"), postrack.pt(), postrack.tofNSigmaKa()); registry.fill(HIST("Lambda/PiMinusTPC_L"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("Lambda/PiMinusTOF_L"), negtrack.pt(), negtrack.tofNSigmaKa()); + + registry.fill(HIST("Lambda/hLambdas"), 1); + if (cfgUsePIDEfficiencies) { + double weff_d1 = getEfficiency(postrack, 3); + double weff_d2 = getEfficiency(negtrack, 1); + weff = weff_d1 * weff_d2; + if (weff > 0) + registry.fill(HIST("Lambda/hLambdas_corrected"), weff); + } } if (isAL) { registry.fill(HIST("Lambda/hAntiLambdaMass_sparse"), mantilambda, v0.pt(), centrality); @@ -1773,6 +1804,15 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/PiPlusTOF_AL"), postrack.pt(), postrack.tofNSigmaKa()); registry.fill(HIST("Lambda/PrMinusTPC_AL"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("Lambda/PrMinusTOF_AL"), negtrack.pt(), negtrack.tofNSigmaKa()); + + registry.fill(HIST("Lambda/hLambdas"), 1); + if (cfgUsePIDEfficiencies) { + double weff_d1 = getEfficiency(postrack, 1); + double weff_d2 = getEfficiency(negtrack, 3); + weff = weff_d1 * weff_d2; + if (weff > 0) + registry.fill(HIST("Lambda/hLambdas_corrected"), weff); + } } return true; } @@ -1808,25 +1848,22 @@ struct FlowGenericFramework { bool withinPtNch = (track.pt() > ptmins[0] && track.pt() < ptmaxs[0]); if (!withinPtPOI && !withinPtRef) return; - double weff = (dt == kGen) ? 1. : getEfficiency(track, pid_index); - double weffInclusive = (dt == kGen) ? 1. : getEfficiency(track, 0); - if (weff < 0) - return; + double waccRef = (dt == kGen) ? 1. : getAcceptance(track, vtxz, 0); double waccPOI = (dt == kGen) ? 1. : withinPtPOI ? getAcceptance(track, vtxz, pid_index + 1) : getAcceptance(track, vtxz, 0); // if (withinPtRef && withinPtPOI && pid_index) waccRef = waccPOI; // if particle is both (then it's overlap), override ref with POI if (withinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccRef * weffInclusive, 1); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccRef, 1); if (withinPtPOI && pid_index) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff, (1 << (pid_index + 1))); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, (1 << (pid_index + 1))); if (withinPtNch) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff * weffInclusive, 2); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, 2); if (withinPtPOI && withinPtRef && pid_index) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff, (1 << (pid_index + 5))); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, (1 << (pid_index + 5))); if (withinPtNch && withinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff * weffInclusive, 32); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, 32); } else { // Analysing only integrated flow bool withinPtRef = (track.pt() > o2::analysis::gfw::ptreflow && track.pt() < o2::analysis::gfw::ptrefup); bool withinPtPOI = (track.pt() > o2::analysis::gfw::ptpoilow && track.pt() < o2::analysis::gfw::ptpoiup); From fdb0af0c0fe903965856ebd26daa42d134a6a05d Mon Sep 17 00:00:00 2001 From: navneetkumar231295 <71565461+navneetkumar231295@users.noreply.github.com> Date: Fri, 27 Mar 2026 12:20:23 +0530 Subject: [PATCH 068/282] [PWGLF] Fix Kshort selection (#15527) Co-authored-by: Navneet --- .../Tasks/Resonances/chargedkstaranalysis.cxx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index 770ea3a38a7..71eaafc4209 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -185,6 +185,7 @@ struct Chargedkstaranalysis { Configurable confincludeCentralityMC{"confincludeCentralityMC", false, "Include centrality in MC"}; Configurable confEvtCollInTimeRangeStandard{"confEvtCollInTimeRangeStandard", true, "Evt sel: apply NoCollInTimeRangeStandard"}; Configurable confEvtCollInTimeRangeNarrow{"confEvtCollInTimeRangeNarrow", false, "Evt sel: apply NoCollInTimeRangeNarrow"}; + Configurable confEvtCollInTimeRangeStrict{"confEvtCollInTimeRangeStrict", false, "Evt sel: apply NoCollInTimeRangeStrict"}; Configurable confEvtNoCollInRofStandard{"confEvtNoCollInRofStandard", false, "Evt sel: apply NoCollInRofStandard"}; Configurable confEvtNoCollInRofStrict{"confEvtNoCollInRofStrict", false, "Evt sel: apply NoCollInRofStrict"}; @@ -295,9 +296,7 @@ struct Chargedkstaranalysis { { centrality = -999; - rctCut.rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); - - colCuts.setCuts(eventCutCfgs.confEvtZvtx, eventCutCfgs.confEvtTriggerCheck, eventCutCfgs.confEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, eventCutCfgs.confEvtOccupancyInTimeRangeMax, eventCutCfgs.confEvtOccupancyInTimeRangeMin); + colCuts.setCuts(eventCutCfgs.confEvtZvtx, eventCutCfgs.confEvtTriggerCheck, eventCutCfgs.confEvtOfflineCheck, /*checkRun3*/ true, eventCutCfgs.confEvtTriggerTVXSel, eventCutCfgs.confEvtOccupancyInTimeRangeMax, eventCutCfgs.confEvtOccupancyInTimeRangeMin); colCuts.init(&histos); colCuts.setTriggerTVX(eventCutCfgs.confEvtTriggerTVXSel); colCuts.setApplyTFBorderCut(eventCutCfgs.confEvtTFBorderCut); @@ -318,6 +317,8 @@ struct Chargedkstaranalysis { colCuts.setApplyBBT0A(eventCutCfgs.confEvtBBT0A); colCuts.setApplyBBT0C(eventCutCfgs.confEvtBBT0C); + rctCut.rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); + AxisSpec centAxis = {axisCfgs.cfgBinsCent, "T0M (%)"}; AxisSpec vtxzAxis = {axisCfgs.cfgBinsVtxZ, "Z Vertex (cm)"}; AxisSpec ptAxis = {axisCfgs.cfgBinsPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -329,7 +330,7 @@ struct Chargedkstaranalysis { AxisSpec dcaxyAxis = {200, 0, 2, "DCA_{#it{xy}} (cm)"}; AxisSpec dcazAxis = {200, 0, 2, "DCA_{#it{z}} (cm)"}; AxisSpec yAxis = {100, -1, 1, "Rapidity"}; - AxisSpec invMassAxisK0s = {400 / cNbinsDiv, 0.3, 0.7, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisK0s = {800 / cNbinsDiv, 0.46, 0.54, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 AxisSpec invMassAxisReso = {900 / cNbinsDiv, 0.5f, 1.4f, "Invariant Mass (GeV/#it{c}^2)"}; // chK(892) ~892 AxisSpec invMassAxisScan = {150, 0, 1.5, "Invariant Mass (GeV/#it{c}^2)"}; // For selection AxisSpec pidQAAxis = {130, -6.5, 6.5}; @@ -702,13 +703,13 @@ struct Chargedkstaranalysis { bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { int ibin = 1; - auto dauDCA = candidate.dcaV0daughters(); - auto dauPosDCAtoPV = candidate.dcapostopv(); - auto dauNegDCAtoPV = candidate.dcanegtopv(); + auto dauDCA = std::fabs(candidate.dcaV0daughters()); + auto dauPosDCAtoPV = std::fabs(candidate.dcapostopv()); + auto dauNegDCAtoPV = std::fabs(candidate.dcanegtopv()); auto pT = candidate.pt(); auto rapidity = candidate.yK0Short(); auto v0Radius = candidate.v0radius(); - auto dcaToPV = candidate.dcav0topv(); + auto dcaToPV = std::fabs(candidate.dcav0topv()); auto cosPA = candidate.v0cosPA(); auto propTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0s; auto mK0s = candidate.mK0Short(); @@ -717,20 +718,20 @@ struct Chargedkstaranalysis { bool returnFlag = true; histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauDCA > secondaryCutsCfgs.cSecondaryDauDCAMax) { + if (std::fabs(dauDCA) > secondaryCutsCfgs.cSecondaryDauDCAMax) { returnFlag = false; } ibin++; if (returnFlag == true) histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauPosDCAtoPV < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { + if (std::fabs(dauPosDCAtoPV) < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { returnFlag = false; } ibin++; if (returnFlag == true) histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauNegDCAtoPV < secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin) { + if (std::fabs(dauNegDCAtoPV) < secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin) { returnFlag = false; } ibin++; From a3c63b5d93bf0f08cdca23a3b6f67171954bbff9 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Fri, 27 Mar 2026 10:00:31 +0100 Subject: [PATCH 069/282] =?UTF-8?q?[PWGJE]=20EMCal:=20Add=20cluster=20defi?= =?UTF-8?q?nition=20for=20low=20energy=20clusters=20for=20sig=E2=80=A6=20(?= =?UTF-8?q?#15528)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGJE/DataModel/EMCALClusters.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGJE/DataModel/EMCALClusters.h b/PWGJE/DataModel/EMCALClusters.h index e28931982b5..9384ef1a9b6 100644 --- a/PWGJE/DataModel/EMCALClusters.h +++ b/PWGJE/DataModel/EMCALClusters.h @@ -49,11 +49,12 @@ const EMCALClusterDefinition kV3SmallestTimeDiff(ClusterAlgorithm_t::kV3, 42, 1, const EMCALClusterDefinition kV3MostSplitSmallTimeDiff(ClusterAlgorithm_t::kV3, 43, 1, "kV3MostSplitSmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0., false); const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff(ClusterAlgorithm_t::kV3, 44, 1, "kV3MostSplitSmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0., false); const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff(ClusterAlgorithm_t::kV3, 45, 1, "kV3MostSplitSmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0., false); +const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowestSeed(ClusterAlgorithm_t::kV3, 50, 1, "kV3MostSplitSmallestTimeDiffLowestSeed", 0.1, 0.1, -10000, 10000, 50, true, 0., false); /// \brief function returns EMCALClusterDefinition for the given name /// \param name name of the cluster definition /// \return EMCALClusterDefinition for the given name -const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& clusterDefinitionName) +inline const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& clusterDefinitionName) { if (clusterDefinitionName == "kV3NoSplit") { return kV3NoSplit; @@ -89,6 +90,8 @@ const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& c return kV3MostSplitSmallerTimeDiff; } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiff") { return kV3MostSplitSmallestTimeDiff; + } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiffLowestSeed") { + return kV3MostSplitSmallestTimeDiffLowestSeed; } else { throw std::invalid_argument("Cluster definition name not recognized"); } From e78252d17c42444da9cc5398c8c755c55e6648bb Mon Sep 17 00:00:00 2001 From: Marta Urioni <78807256+murioni@users.noreply.github.com> Date: Fri, 27 Mar 2026 12:00:36 +0100 Subject: [PATCH 070/282] [PWGLF] Update heavyionMultiplicity.cxx - FT0M mult calculation (#15529) --- PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index d6f8a6df09f..f24f2a28763 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -467,7 +467,7 @@ struct HeavyionMultiplicity { if (isApplyCentFT0C) { cent = col.multMCFT0C(); } else if (isApplyCentFT0M) { - cent = (col.multMCFT0C() + col.multMCFT0A()) / 2.; + cent = col.multMCFT0C() + col.multMCFT0A(); } else if (isApplyCentFV0A) { cent = col.multMCFV0A(); } From 6ff615aad070e2f5b9cc7a4b25625e74cb02784f Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Fri, 27 Mar 2026 12:16:41 +0100 Subject: [PATCH 071/282] [PWGLF] Updated signal loss calculation (#15530) --- .../GlobalEventProperties/flattenictyPikp.cxx | 396 +++++++++--------- 1 file changed, 202 insertions(+), 194 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index e7ddece6c1f..d3af036e6d2 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -94,7 +94,6 @@ static constexpr int PDGs[] = {11, 13, 211, 321, 2212}; static constexpr int PidSgn[NpartChrg] = {11, 13, 211, 321, 2212, -11, -13, -211, -321, -2212}; static constexpr const char* Pid[Npart] = {"el", "mu", "pi", "ka", "pr"}; static constexpr const char* PidChrg[NpartChrg] = {"e^{-}", "#mu^{-}", "#pi^{+}", "K^{+}", "p", "e^{+}", "#mu^{+}", "#pi^{-}", "K^{-}", "#bar{p}"}; -static constexpr std::string_view Cspecies[NpartChrg] = {"Elminus", "Muplus", "PiPlus", "KaPlus", "Pr", "ElPlus", "MuMinus", "PiMinus", "KaMinus", "PrBar"}; static constexpr std::string_view CspeciesAll[Npart] = {"El", "Mu", "Pi", "Ka", "Pr"}; // histogram naming static constexpr std::string_view PidDir[] = {"el/", "pi/", "pr/"}; @@ -106,6 +105,8 @@ static constexpr std::string_view CprefixCleanV0 = "Tracks/CleanV0/"; static constexpr std::string_view CprefixV0qa = "Tracks/V0qa/"; static constexpr std::string_view Cstatus[] = {"preSel/", "postSel/"}; static constexpr std::string_view CstatCalib[] = {"preCalib/", "postCalib/"}; +static constexpr std::string_view CdEdxMcRecPrim = "/CdEdxMcRecPrim"; +static constexpr std::string_view CdEdxMcRecPrimF = "Tracks/{}/CdEdxMcRecPrim"; static constexpr std::string_view CpTvsDCAxy = "/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyF = "Tracks/{}/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyAll = "/hPtVsDCAxyAll"; @@ -122,12 +123,6 @@ static constexpr std::string_view CpTgenPrimSgnINEL = "/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTgenPrimSgnINELF = "Tracks/{}/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTrecCollPrimSgn = "/hPtRecCollPrimSgn"; static constexpr std::string_view CpTrecCollPrimSgnF = "Tracks/{}/hPtRecCollPrimSgn"; -static constexpr std::string_view CpTrecCollPrimSgnINEL = "/hPtRecCollPrimSgnINEL"; -static constexpr std::string_view CpTrecCollPrimSgnINELF = "Tracks/{}/hPtRecCollPrimSgnINEL"; -static constexpr std::string_view CpTGenRecCollPrimSgn = "/hPtGenRecCollPrimSgn"; -static constexpr std::string_view CpTGenRecCollPrimSgnF = "Tracks/{}/hPtGenRecCollPrimSgn"; -static constexpr std::string_view CpTGenRecCollPrimSgnINEL = "/hPtGenRecCollPrimSgnINEL"; -static constexpr std::string_view CpTGenRecCollPrimSgnINELF = "Tracks/{}/hPtGenRecCollPrimSgnINEL"; static constexpr std::string_view CpTmcClosurePrim = "/hPtMCclosurePrim"; static constexpr std::string_view CpTmcClosurePrimF = "Tracks/{}/hPtMCclosurePrim"; @@ -209,8 +204,8 @@ std::array, NpartChrg> hPtEffRecWeak{}; std::array, NpartChrg> hPtEffRecMat{}; std::array, NpartChrg> hPtEffRec{}; std::array, NpartChrg> hPtEffGen{}; -std::array, NpartChrg> hPtGenRecEvt{}; -std::array, NpartChrg> hPtGenPrimRecEvt{}; +std::array, NpartChrg> hPtGenRecEvt{}; +std::array, NpartChrg> hPtGenPrimRecEvt{}; std::array, NpartChrg> hPtEffGenPrim{}; std::array, NpartChrg> hPtEffGenWeak{}; std::array, NpartChrg> hPtEffGenMat{}; @@ -239,6 +234,7 @@ struct FlattenictyPikp { Configurable applyCalibDeDx{"applyCalibDeDx", false, "calibration of dedx signal"}; Configurable applyCalibDeDxFromCCDB{"applyCalibDeDxFromCCDB", false, "use CCDB-based calibration of dedx signal"}; Configurable cfgFillTrackQaHist{"cfgFillTrackQaHist", false, "fill track QA histograms"}; + Configurable cfgFillNclVsPhiCutQaHist{"cfgFillNclVsPhiCutQaHist", false, "fill TPC cluster vs geometrical cut QA histograms"}; Configurable cfgFilldEdxCalibHist{"cfgFilldEdxCalibHist", false, "fill dEdx calibration histograms"}; Configurable cfgFilldEdxQaHist{"cfgFilldEdxQaHist", false, "fill dEdx QA histograms"}; Configurable cfgFillDCAxyHist{"cfgFillDCAxyHist", false, "fill nsigma QA histograms"}; @@ -284,7 +280,7 @@ struct FlattenictyPikp { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT binning"}; ConfigurableAxis axisPtV0s{"axisPtV0s", {VARIABLE_WIDTH, 0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.5, 3.0, 3.5, 4, 5, 7, 9, 12, 15, 20}, "pT V0s binning"}; ConfigurableAxis axisFlatPerc{"axisFlatPerc", {102, -0.01, 1.01}, "Flattenicity percentiles binning"}; - ConfigurableAxis axisMultPerc{"axisMultPerc", {20, 0, 100}, "Multiplicity percentiles binning"}; + ConfigurableAxis axisMultPerc{"axisMultPerc", {VARIABLE_WIDTH, 0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0 percentiles binning"}; ConfigurableAxis axisVertexZ{"axisVertexZ", {80, -20., 20.}, "Vertex z binning"}; ConfigurableAxis axisMult{"axisMult", {301, -0.5, 300.5}, "Multiplicity binning"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -5., 5.}, "DCAxy binning"}; @@ -523,6 +519,7 @@ struct FlattenictyPikp { const AxisSpec dEdxAxis{binOpt.axisDedx, "TPC dEdx (a.u.)"}; const AxisSpec vtxzAxis{binOpt.axisVertexZ, "Z_{vtx} (cm)"}; const AxisSpec flatAxis{binOpt.axisFlatPerc, "Flat FV0"}; + const AxisSpec nChAxis{binOpt.axisMult, "Nch, |eta|<0.8"}; const AxisSpec etaAxis{binOpt.axisEta, "#eta"}; const AxisSpec rapidityAxis{binOpt.axisRapidity, "#it{y}"}; const AxisSpec phiAxis{binOpt.axisPhi, "#varphi"}; @@ -598,33 +595,30 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); flatchrg.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); - if (cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { - if (cfgFillTrackQaHist) { + if (cfgFillNclVsPhiCutQaHist || cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { + if (cfgFillNclVsPhiCutQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); - flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); - flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); - flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); - // tpc - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - } else { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - } + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + } + if (cfgFillTrackQaHist) { flatchrg.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); + flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); + flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); + flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); + flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); + // tpc flatchrg.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); @@ -633,11 +627,7 @@ struct FlattenictyPikp { flatchrg.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", kTH1F, {{100, -0.5, 99.5}}); // tof flatchrg.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {kTH2F, {pAxis, {120, 0.0, 1.2}}}); - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); - } else { - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}); - } + flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); } if (cfgFilldEdxQaHist) { if (cfgStoreThnSparse) { @@ -735,15 +725,10 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); - if (cfgFillTrackQaHist) { + if (cfgFillNclVsPhiCutQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - } else { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - } + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); @@ -753,31 +738,32 @@ struct FlattenictyPikp { for (int i = 0; i < NpartChrg; i++) { const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); - hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); + hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); } for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CdEdxMcRecPrimF.data(), CspeciesAll[i]).c_str(), "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); } - flatchrg.add({"hPtOutNoEtaCut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"PtOutFakes", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); + flatchrg.add({"hPtOutNoEtaCut", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); + flatchrg.add({"PtOutFakes", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); flatchrg.add({"ResponseGen", " ; N_{part}; F_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); flatchrg.add("h1flatencityFV0MCGen", "", kTH1F, {{102, -0.01, 1.01, "1-flatencityFV0"}}); @@ -795,7 +781,7 @@ struct FlattenictyPikp { if (doprocessMCclosure) { for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); } } @@ -811,19 +797,20 @@ struct FlattenictyPikp { flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(1, "all"); flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(2, "evt sel"); flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(3, "INELgt0"); - flatchrg.add("hEvtMcGenRecColl", "hEvtMcGenRecColl", {kTH1F, {{2, 0.f, 2.f}}}); - flatchrg.get(HIST("hEvtMcGenRecColl"))->GetXaxis()->SetBinLabel(1, "INEL"); - flatchrg.get(HIST("hEvtMcGenRecColl"))->GetXaxis()->SetBinLabel(2, "INELgt0"); - - flatchrg.add("hFlatGenINELgt0", "hFlatGenINELgt0", {kTH1F, {flatAxis}}); - for (int i = 0; i < NpartChrg; ++i) { - flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTGenRecCollPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTGenRecCollPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); + flatchrg.add("hNchVsCent", "Gen Nch vs Cent;;Gen Nch (|#eta|<0.8)", {kTH2F, {multAxis, nChAxis}}); + // Event loss + flatchrg.add("hNchVsFlatGenINELgt0", "Gen Nch w/o Evt sel;;", {kTH2F, {nChAxis, flatAxis}}); + flatchrg.add("hNchVsFlatRecGt0INELgt0", "Gen Nch w/ Nrec > 0 + Evt. sel;;", {kTH2F, {nChAxis, flatAxis}}); + // Event split + flatchrg.add("hCentVsFlatRecINELgt0", "Gen evt w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); + flatchrg.add("hCentVsFlatRecGt0INELgt0", "Gen evt w/ Nrec > 0 + Evt. sel;;", {kTH2F, {multAxis, flatAxis}}); + flatchrg.add("hCentVsFlatRecGt0", "Gen evt w/ Nrec > 0 w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); + // Signal loss + for (int i = 0; i < Npart; ++i) { + flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), CspeciesAll[i]).c_str(), "Gen evt w INELgt0 sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), CspeciesAll[i]).c_str(), " ;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); } } @@ -977,7 +964,9 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + float phiModn = track.phi(); + phiMod(phiModn, magField, track.sign()); + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phiModn < fPhiCutHigh->Eval(track.pt()) && phiModn > fPhiCutLow->Eval(track.pt()))) { continue; } if (!isDCAxyWoCut(track)) { @@ -1291,63 +1280,54 @@ struct FlattenictyPikp { return std::abs(charge) >= CminCharge; } - template - bool phiCut(T const& track, float mag, TF1* fphiCutLow, TF1* fphiCutHigh) + template + int countPart(P const& particles) + { + auto nCharged = 0; + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + nCharged++; + } + return nCharged; + } + + void phiMod(float& phimodn, const int& mag, const int& charge) { - if (track.pt() < trkSelOpt.cfgPhiCutPtMin) - return true; - // cut to remove tracks at TPC boundaries - double phimodn = track.phi(); if (mag < Cnull) // for negative polarity field phimodn = o2::constants::math::TwoPI - phimodn; - if (track.sign() < Cnull) // for negative charge + if (charge < Cnull) // for negative charge phimodn = o2::constants::math::TwoPI - phimodn; if (phimodn < Cnull) LOGF(warning, "phi < Cnull: %g", phimodn); phimodn += o2::constants::math::PI / 18.0f; // to center gap in the middle phimodn = std::fmod(phimodn, o2::constants::math::PI / 9.0f); + } - if (cfgFillTrackQaHist) { - flatchrg.fill(HIST("Tracks/preSel/hPtPhi"), track.pt(), phimodn); - if (track.hasTPC() && track.hasITS()) { - if (cfgStoreThnSparse) { - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - } else { - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/preSel/hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/preSel/pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - } - } - } - if (phimodn < fphiCutHigh->Eval(track.pt()) && phimodn > fphiCutLow->Eval(track.pt())) { - return false; - } - if (cfgFillTrackQaHist) { - flatchrg.fill(HIST("Tracks/postSel/hPtPhi"), track.pt(), phimodn); - if (track.hasTPC() && track.hasITS()) { - if (cfgStoreThnSparse) { - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - } else { - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/postSel/hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/postSel/pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - } - } + template + inline void fillNclVsPhiCutQaHist(T const& track, const float phimodn) + { + if (cfgFillNclVsPhiCutQaHist) { + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhi"), track.pt(), phimodn); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclPIDTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclTPC"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclTPC"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); } - return true; } template - bool isGoodTrack(T const& track, int const magfield) + bool isGoodTrack(T const& track, const int magfield) { flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelAll); if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { @@ -1375,9 +1355,18 @@ struct FlattenictyPikp { return false; } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magfield, fPhiCutLow, fPhiCutHigh)) { + + float phimodn = track.phi(); + phiMod(phimodn, magfield, track.sign()); + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt()))) { return false; } + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); return true; } @@ -1485,7 +1474,7 @@ struct FlattenictyPikp { } template - bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, int const magfield) + bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, const int magfield) { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); @@ -1495,8 +1484,13 @@ struct FlattenictyPikp { return false; } flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); + + float posTrackPhiModn = posTrack.phi(); + float negTrackPhiModn = negTrack.phi(); + phiMod(posTrackPhiModn, magfield, posTrack.sign()); + phiMod(negTrackPhiModn, magfield, negTrack.sign()); if (v0SelOpt.cfgRejectV0sAtTPCSector) { - if (!(phiCut(posTrack, magfield, fPhiCutLow, fPhiCutHigh) && phiCut(negTrack, magfield, fPhiCutLow, fPhiCutHigh))) { + if ((posTrack.pt() >= trkSelOpt.cfgPhiCutPtMin && posTrackPhiModn < fPhiCutHigh->Eval(posTrack.pt()) && posTrackPhiModn > fPhiCutLow->Eval(posTrack.pt())) && (negTrack.pt() >= trkSelOpt.cfgPhiCutPtMin && negTrackPhiModn < fPhiCutHigh->Eval(negTrack.pt()) && negTrackPhiModn > fPhiCutLow->Eval(negTrack.pt()))) { return false; } } @@ -2020,8 +2014,8 @@ struct FlattenictyPikp { float maxPhi = 0; float dPhi = 0; - double etaMinFV0bins[CmaxRingsFV0] = {0.0}; - double etaMaxFV0bins[CmaxRingsFV0] = {0.0}; + float etaMinFV0bins[CmaxRingsFV0] = {0.0}; + float etaMaxFV0bins[CmaxRingsFV0] = {0.0}; for (int i = 0; i < CmaxRingsFV0; ++i) { etaMaxFV0bins[i] = CmaxEtaFV0 - i * CdEtaFV0; if (i < CmaxRingsFV0 - 1) { @@ -2082,8 +2076,8 @@ struct FlattenictyPikp { constexpr int ChistIdx = id + pidSgn * Npart; auto idx = static_cast(id); const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]); - hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); + hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); } template @@ -2188,6 +2182,15 @@ struct FlattenictyPikp { } } } + + if (!isDCAxyCut(track)) { + return; + } + if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { + if (mcParticle.isPhysicalPrimary()) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CdEdxMcRecPrim), track.eta(), mult, flat, track.p(), track.tpcSignal()); + } + } } template @@ -2201,9 +2204,9 @@ struct FlattenictyPikp { } if constexpr (recoEvt) { - hPtGenRecEvt[ChistIdx]->Fill(mcParticle.pt()); + hPtGenRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); if (mcParticle.isPhysicalPrimary()) { - hPtGenPrimRecEvt[ChistIdx]->Fill(mcParticle.pt()); + hPtGenPrimRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); } return; } @@ -2225,27 +2228,22 @@ struct FlattenictyPikp { aod::FV0As const& /*fv0s*/, aod::McParticles const& particles) { - float flat; - float mult; + float flat = 999.0; if (flatSelOpt.useFlatData) { float flatRec = 999.0; - float multRec = 999.0; for (const auto& collision : collisions) { - multRec = getMult(collision); flatRec = fillFlat(collision); } flat = flatRec; - mult = multRec; flatchrg.fill(HIST("hFlatMCGenRecColl"), flatRec); } else { float flatGen = fillFlatMC(particles); flat = flatGen; flatchrg.fill(HIST("hFlatMCGen"), flatGen); - float multGen = getMultMC(mcCollision); - mult = multGen; } - // Evt loss den + const float nCh08 = countPart(particles); // use generated Nch in ∣eta∣ < 0.8 + flatchrg.fill(HIST("hEvtMcGen"), 0.5); if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { return; @@ -2256,90 +2254,98 @@ struct FlattenictyPikp { if (pwglf::isINELgtNmc(particles, 0, pdg)) { isINELgt0mc = true; flatchrg.fill(HIST("hEvtMcGen"), 2.5); - flatchrg.fill(HIST("hFlatGenINELgt0"), flat); + flatchrg.fill(HIST("hNchVsFlatGenINELgt0"), nCh08, flat); // Evt loss den } - // Sgn loss den for (const auto& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } if (!particle.isPhysicalPrimary()) { continue; } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { continue; } - static_for<0, 5>([&](auto i) { + static_for<0, 4>([&](auto i) { constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgn), mult, flat, particle.pt()); + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgn), nCh08, flat, particle.pt()); if (isINELgt0mc) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgnINEL), mult, flat, particle.pt()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgnINEL), nCh08, flat, particle.pt()); // Sgn loss den } } }); } - int nRecCollINEL = 0; - int nRecCollINELgt0 = 0; - for (const auto& collision : collisions) { - // Evt split num - flatchrg.fill(HIST("hEvtMCRec"), 0.5); - if (!isGoodEvent(collision)) { - continue; + const auto& nRecoColls = collisions.size(); + // Generated evets with >= 1 reco collisions + if (nRecoColls > CnullInt) { + auto maxNcontributors = -1; + auto bestCollIndex = -1; + auto multRecGt1 = -1; + for (auto const& collision : collisions) { + flatchrg.fill(HIST("hEvtMCRec"), 0.5); + if (!isGoodEvent(collision)) { + continue; + } + flatchrg.fill(HIST("hEvtMCRec"), 1.5); + if (collision.isInelGt0() && isINELgt0mc) { + flatchrg.fill(HIST("hEvtMCRec"), 2.5); + } + if (!collision.has_mcCollision()) { + continue; + } + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + multRecGt1 = getMultMC(mcCollision); // using McCentFT0Ms + } + flatchrg.fill(HIST("hCentVsFlatRecINELgt0"), multRecGt1, flat); // Evt split den } - flatchrg.fill(HIST("hEvtMCRec"), 1.5); - - nRecCollINEL++; - if (collision.isInelGt0() && isINELgt0mc) { - flatchrg.fill(HIST("hEvtMCRec"), 2.5); - nRecCollINELgt0++; - } - // Sgn split num - for (const auto& particle : particles) { - if (!particle.isPhysicalPrimary()) { + for (const auto& collision : collisions) { + // Select collisions with the largest number of contributors + if (bestCollIndex != collision.globalIndex()) { continue; } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (!collision.has_mcCollision()) { continue; } - static_for<0, 5>([&](auto i) { - constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgnINEL), mult, flat, particle.pt()); - } - } - }); - } - } + const float multNpvMax = getMultMC(mcCollision); // using McCentFT0Ms - if (nRecCollINEL < 1) { - return; - } - // Evt loss num - flatchrg.fill(HIST("hEvtMcGenRecColl"), 0.5); - if (nRecCollINELgt0 > Cnull) { - flatchrg.fill(HIST("hEvtMcGenRecColl"), 1.5); - } + flatchrg.fill(HIST("hCentVsFlatRecGt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + if (!isGoodEvent(collision)) { + continue; + } + flatchrg.fill(HIST("hCentVsFlatRecGt0INELgt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + Evt. sel + flatchrg.fill(HIST("hNchVsCent"), multNpvMax, nCh08); + flatchrg.fill(HIST("hNchVsFlatRecGt0INELgt0"), nCh08, flat); // Evt loss num, w/ Nrec > 0 + Evt. sel - // Sgn loss num - for (const auto& particle : particles) { - if (!particle.isPhysicalPrimary()) { - continue; - } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { - continue; - } - static_for<0, 5>([&](auto i) { - constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTGenRecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTGenRecCollPrimSgnINEL), mult, flat, particle.pt()); + for (const auto& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { + continue; + } + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTrecCollPrimSgn), nCh08, flat, particle.pt()); // Sgn loss num + } + }); } - }); + } } } PROCESS_SWITCH(FlattenictyPikp, processSgnLoss, "process to calcuate signal/event lossses", false); @@ -2435,7 +2441,7 @@ struct FlattenictyPikp { flatchrg.fill(HIST("hEvtMcGenColls"), 2); for (const auto& collision : groupedColls) { flatchrg.fill(HIST("hEvtMcGenColls"), 3); - if (!isGoodEvent(collision)) { + if (!isGoodEvent(collision)) { continue; } // Select collisions with the largest number of contributors @@ -2462,7 +2468,9 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + float phiModn = track.phi(); + phiMod(phiModn, magField, track.sign()); + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phiModn < fPhiCutHigh->Eval(track.pt()) && phiModn > fPhiCutLow->Eval(track.pt()))) { continue; } if (!isDCAxyWoCut(track)) { From 3b1d5d16cd9eb46ea2b42a614978e3caf2ec70a1 Mon Sep 17 00:00:00 2001 From: YashParakh007 Date: Fri, 27 Mar 2026 16:56:00 +0530 Subject: [PATCH 072/282] [PWGCF] Update netprotcumulants (#15537) --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 5 + .../Tasks/netprotcumulants.cxx | 2988 +++++++++++++++++ 2 files changed, 2993 insertions(+) create mode 100644 PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index b10c105e3c0..a10cc46db09 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -78,3 +78,8 @@ o2physics_add_dpl_workflow(radial-flow-decorr SOURCES radialFlowDecorr.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(net-prot-cumulants + SOURCES netprotcumulants.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx new file mode 100644 index 00000000000..66eadcf5369 --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx @@ -0,0 +1,2988 @@ +// 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. + +/// \file NetProtCumulants.cxx +/// \brief Task for analyzing efficiency of proton, and net-proton distributions in MC reconstructed and generated, and calculating net-proton cumulants +/// \author Yash Parakh + +#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 "Common/DataModel/PIDResponseITS.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CommonConstants/PhysicsConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct NetProtCumulants { + // events + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + // MC + Configurable cfgIsMC{"cfgIsMC", true, "Run MC"}; + // tracks + Configurable cfgCutPtLower{"cfgCutPtLower", 0.2f, "Lower pT cut"}; + Configurable cfgCutPtUpper{"cfgCutPtUpper", 3.0f, "Higher pT cut"}; + Configurable cfgCutEta{"cfgCutEta", 0.8f, "absolute Eta cut"}; + Configurable cfgPIDchoice{"cfgPIDchoice", 1, "PID selection fucntion choice"}; + Configurable cfgCutPtUpperTPC{"cfgCutPtUpperTPC", 0.6f, "Upper pT cut for PID using TPC only"}; + Configurable cfgnSigmaCutTPC{"cfgnSigmaCutTPC", 2.0f, "PID nSigma cut for TPC"}; + Configurable cfgnSigmaCutTOF{"cfgnSigmaCutTOF", 2.0f, "PID nSigma cut for TOF"}; + Configurable cfgnSigmaCutCombTPCTOF{"cfgnSigmaCutCombTPCTOF", 2.0f, "PID nSigma combined cut for TPC and TOF"}; + Configurable cfgCutTpcChi2NCl{"cfgCutTpcChi2NCl", 2.5f, "Maximum TPCchi2NCl"}; + Configurable cfgCutItsChi2NCl{"cfgCutItsChi2NCl", 36.0f, "Maximum ITSchi2NCl"}; + Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; + Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; + Configurable cfgITScluster{"cfgITScluster", 1, "Minimum Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 80, "Minimum Number of TPC cluster"}; + Configurable cfgTPCnCrossedRows{"cfgTPCnCrossedRows", 70, "Minimum Number of TPC crossed-rows"}; + Configurable cfgUseItsPid{"cfgUseItsPid", true, "Use ITS nSigma Cut"}; + + // Calculation of cumulants central/error + Configurable cfgNSubsample{"cfgNSubsample", 10, "Number of subsamples for ERR"}; + Configurable cfgIsCalculateCentral{"cfgIsCalculateCentral", true, "Calculate Central value"}; + Configurable cfgIsCalculateError{"cfgIsCalculateError", false, "Calculate Error"}; + + // Efficiencies + Configurable> cfgPtBins{"cfgPtBins", {0.4, 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}, "Pt Bins for Efficiency of protons"}; + Configurable> cfgProtonEff{"cfgProtonEff", {0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "Efficiency of protons"}; + Configurable> cfgAntiprotonEff{"cfgAntiprotonEff", {0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "Efficiency of anti-protons"}; + + Configurable cfgLoadEff{"cfgLoadEff", true, "Load efficiency from file"}; + Configurable cfgEvSelkNoSameBunchPileup{"cfgEvSelkNoSameBunchPileup", true, "Pileup removal"}; + Configurable cfgUseGoodITSLayerAllCut{"cfgUseGoodITSLayerAllCut", true, "Remove time interval with dead ITS zone"}; + Configurable cfgIfRejectElectron{"cfgIfRejectElectron", true, "Remove electrons"}; + Configurable cfgIfMandatoryTOF{"cfgIfMandatoryTOF", true, "Mandatory TOF requirement to remove pileup"}; + Configurable cfgEvSelkIsVertexTOFmatched{"cfgEvSelkIsVertexTOFmatched", true, "If matched with TOF, for pileup"}; + ConfigurableAxis cfgCentralityBins{"cfgCentralityBins", {90, 0., 90.}, "Centrality/Multiplicity percentile bining"}; + + // Connect to ccdb + Service 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 ccdbUrl{"ccdbUrl", "https://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbPath{"ccdbPath", "Users/s/swati/EtavsPtEfficiency_LHC24f3b_PIDchoice0", "CCDB path to ccdb object containing eff(pt, eta) in 2D hist"}; + + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + TRandom3* fRndm = new TRandom3(0); + + // Eff histograms 2d: eff(pT, eta) + TH2F* hRatio2DEtaVsPtProton = nullptr; + TH2F* hRatio2DEtaVsPtAntiproton = nullptr; + + // Filter command for rec (data)*********** + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::dcaXY) < cfgCutDCAxy); + + // filtering collisions and tracks for real data*********** + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; + + // filtering collisions and tracks for MC rec data*********** + using MyMCRecCollisions = soa::Filtered>; + using MyMCRecCollision = MyMCRecCollisions::iterator; + using MyMCTracks = soa::Filtered>; + using EventCandidatesMC = soa::Join; + + // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) + { + // Loading efficiency histograms from ccdb + if (cfgLoadEff) { + + // Accessing eff histograms + ccdb->setURL(ccdbUrl.value); + // Enabling object caching, otherwise each call goes to the CCDB server + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + // Not later than now, will be replaced by the value of the train creation + // This avoids that users can replace objects **while** a train is running + ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + LOGF(info, "Getting object %s", ccdbPath.value.data()); + TList* lst = ccdb->getForTimeStamp(ccdbPath.value, ccdbNoLaterThan.value); + hRatio2DEtaVsPtProton = reinterpret_cast(lst->FindObject("hRatio2DEtaVsPtProton")); + hRatio2DEtaVsPtAntiproton = reinterpret_cast(lst->FindObject("hRatio2DEtaVsPtAntiproton")); + if (!hRatio2DEtaVsPtProton || !hRatio2DEtaVsPtAntiproton) + LOGF(info, "FATAL!! could not get efficiency---------> check"); + } + + // Define your axes + // Constant bin width axis + AxisSpec vtxZAxis = {100, -20, 20}; + // Variable bin width axis + std::vector ptBinning = {0.2, 0.3, 0.4, 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.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; + AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + std::vector etaBinning = {-0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8}; + AxisSpec etaAxis = {etaBinning, "#it{#eta}"}; + // std::vector centBining = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90}; + // AxisSpec centAxis = {centBining, "Multiplicity percentile from FT0C (%)"}; + const AxisSpec centAxis{cfgCentralityBins, "Multiplicity percentile from FT0C (%)"}; + AxisSpec netprotonAxis = {41, -20.5, 20.5, "net-proton number"}; + AxisSpec protonAxis = {21, -0.5, 20.5, "proton number"}; + AxisSpec antiprotonAxis = {21, -0.5, 20.5, "antiproton number"}; + AxisSpec nSigmaAxis = {200, -5.0, 5.0, "nSigma(Proton)"}; + + auto noSubsample = static_cast(cfgNSubsample); + float maxSubsample = 1.0 * noSubsample; + AxisSpec subsampleAxis = {noSubsample, 0.0, maxSubsample, "subsample no."}; + + // For purity (data) + AxisSpec nSigmaWideAxis = {400, -10.0, 10.0, "nSigma"}; + + histos.add("h2_nSigmaTPC_p", "nSigmaTPC vs pT (proton candidates);pT; nSigmaTPC", + kTH2F, {ptAxis, nSigmaWideAxis}); + + histos.add("h2_nSigmaTPC_ap", "nSigmaTPC vs pT (antiproton candidates);pT; nSigmaTPC", + kTH2F, {ptAxis, nSigmaWideAxis}); + + histos.add("h2_nSigmaTOF_p", "nSigmaTOF vs pT (proton candidates);pT; nSigmaTOF", + kTH2F, {ptAxis, nSigmaWideAxis}); + + histos.add("h2_nSigmaTOF_ap", "nSigmaTOF vs pT (antiproton candidates);pT; nSigmaTOF", + kTH2F, {ptAxis, nSigmaWideAxis}); + + // histograms for events + histos.add("hZvtx_after", "Vertex dist. after event selection;Z (cm)", kTH1F, {vtxZAxis}); + histos.add("hCentrec", "MCRec Multiplicity percentile from FT0C (%)", kTH1F, {{100, 0.0, 100.0}}); + // tracks Rec level histograms + histos.add("hrecPtAll", "Reconstructed All particles;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPtProton", "Reconstructed Protons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPtAntiproton", "Reconstructed Antiprotons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPhiAll", "Reconstructed All particles;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hrecPhiProton", "Reconstructed Protons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hrecPhiAntiproton", "Reconstructed Antiprotons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hrecEtaAll", "Reconstructed All particles;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hrecEtaProton", "Reconstructed Proton;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hrecEtaAntiproton", "Reconstructed Antiprotons;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hrecDcaXYAll", "Reconstructed All particles;DCA_{xy} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaXYProton", "Reconstructed Proton;DCA_{xy} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaXYAntiproton", "Reconstructed Antiprotons;DCA_{xy} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaZAll", "Reconstructed All particles;DCA_{z} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaZProton", "Reconstructed Proton;DCA_{z} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaZAntiproton", "Reconstructed Antiprotons;DCA_{z} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecPtDistProtonVsCentrality", "Reconstructed proton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hrecPtDistAntiprotonVsCentrality", "Reconstructed antiproton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hrecNetProtonVsCentrality", "Reconstructed net-proton number vs centrality in 2D", kTH2F, {netprotonAxis, centAxis}); + histos.add("hrecProtonVsCentrality", "Reconstructed proton number vs centrality in 2D", kTH2F, {protonAxis, centAxis}); + histos.add("hrecAntiprotonVsCentrality", "Reconstructed antiproton number vs centrality in 2D", kTH2F, {antiprotonAxis, centAxis}); + histos.add("hrecProfileTotalProton", "Reconstructed total proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hrecProfileProton", "Reconstructed proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hrecProfileAntiproton", "Reconstructed antiproton number vs. centrality", kTProfile, {centAxis}); + histos.add("hCorrProfileTotalProton", "Eff. Corrected total proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hCorrProfileProton", "Eff. Corrected proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hCorrProfileAntiproton", "Eff. Corrected antiproton number vs. centrality", kTProfile, {centAxis}); + histos.add("hrec2DEtaVsPtProton", "2D hist of Reconstructed Proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + histos.add("hrec2DEtaVsPtAntiproton", "2D hist of Reconstructed Anti-proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + histos.add("hgen2DEtaVsPtProton", "2D hist of Generated Proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + histos.add("hgen2DEtaVsPtAntiproton", "2D hist of Generated Anti-proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + + // 2D histograms of nSigma + histos.add("h2DnsigmaTpcVsPt", "2D hist of nSigmaTPC vs. pT", kTH2F, {ptAxis, nSigmaAxis}); + histos.add("h2DnsigmaTofVsPt", "2D hist of nSigmaTOF vs. pT", kTH2F, {ptAxis, nSigmaAxis}); + histos.add("h2DnsigmaItsVsPt", "2D hist of nSigmaITS vs. pT", kTH2F, {ptAxis, nSigmaAxis}); + + if (cfgIsCalculateCentral) { + // uncorrected + histos.add("Prof_mu1_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu2_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu3_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu4_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu5_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu6_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu7_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu8_netproton", "", {HistType::kTProfile, {centAxis}}); + + // eff. corrected + histos.add("Prof_Q11_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_3", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_4", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q21_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q22_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q31_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q32_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q33_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q41_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q42_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q43_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q44_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q21_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q22_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3132_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3132_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3132_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3133_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3133_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3133_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3233_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3233_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3233_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2241_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2241_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2241_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2242_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2242_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2242_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2243_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2243_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2243_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2244_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2244_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2244_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2141_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2141_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2141_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2142_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2142_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2142_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2143_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2143_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2143_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2144_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2144_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2144_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1151_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1151_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1151_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1152_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1152_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1152_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1153_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1153_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1153_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1154_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1154_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1154_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1155_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1155_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1155_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_02", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_12", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_22", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_02", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_12", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_22", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_200", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_201", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_210", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_211", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_5", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_6", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_40", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_41", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_40", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_41", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2131_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2131_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2131_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2132_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2132_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2132_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2133_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2133_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2133_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2231_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2231_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2231_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2232_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2232_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2232_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2233_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2233_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2233_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q51_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q52_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q53_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q54_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q55_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q21_3", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q22_3", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q31_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q32_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q33_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q61_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q62_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q63_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q64_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q65_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q66_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_111", "", {HistType::kTProfile, {centAxis}}); + } + + if (cfgIsCalculateError) { + // uncorrected + histos.add("Prof2D_mu1_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu2_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu3_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu4_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu5_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu6_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu7_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu8_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + + // eff. corrected + histos.add("Prof2D_Q11_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_3", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_4", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q21_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q22_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q31_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q32_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q33_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q41_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q42_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q43_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q44_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q21_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q22_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3132_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3132_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3132_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3133_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3133_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3133_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3233_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3233_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3233_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2241_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2241_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2241_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2242_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2242_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2242_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2243_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2243_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2243_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2244_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2244_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2244_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2141_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2141_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2141_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2142_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2142_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2142_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2143_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2143_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2143_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2144_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2144_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2144_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1151_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1151_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1151_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1152_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1152_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1152_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1153_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1153_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1153_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1154_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1154_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1154_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1155_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1155_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1155_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_02", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_12", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_22", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_02", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_12", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_22", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_200", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_201", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_210", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_211", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_5", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_6", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_40", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_41", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_40", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_41", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2131_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2131_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2131_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2132_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2132_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2132_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2133_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2133_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2133_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2231_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2231_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2231_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2232_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2232_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2232_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2233_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2233_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2233_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q51_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q52_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q53_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q54_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q55_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q21_3", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q22_3", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q31_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q32_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q33_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q61_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q62_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q63_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q64_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q65_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q66_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + } + + if (cfgIsMC) { + // MC event counts + histos.add("hMC", "MC Event statistics", kTH1F, {{10, 0.0f, 10.0f}}); + histos.add("hCentgen", "MCGen Multiplicity percentile from FT0C (%)", kTH1F, {{100, 0.0, 100.0}}); + // tracks Gen level histograms + histos.add("hgenPtAll", "Generated All particles;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenPtProton", "Generated Protons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenPtAntiproton", "Generated Antiprotons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPartPtAll", "Reconstructed All particles filled mcparticle pt;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPartPtProton", "Reconstructed Protons filled mcparticle pt;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPartPtAntiproton", "Reconstructed Antiprotons filled mcparticle pt;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenPhiAll", "Generated All particles;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hgenPhiProton", "Generated Protons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hgenPhiAntiproton", "Generated Antiprotons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hgenEtaAll", "Generated All particles;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hgenEtaProton", "Generated Proton;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hgenEtaAntiproton", "Generated Antiprotons;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hgenPtDistProtonVsCentrality", "Generated proton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hgenPtDistAntiprotonVsCentrality", "Generated antiproton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hrecTruePtProton", "Reconstructed pdgcode verified protons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecTruePtAntiproton", "Reconstructed pdgcode verified Antiprotons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenNetProtonVsCentrality", "Generated net-proton number vs centrality in 2D", kTH2F, {netprotonAxis, centAxis}); + histos.add("hgenProtonVsCentrality", "Generated proton number vs centrality in 2D", kTH2F, {protonAxis, centAxis}); + histos.add("hgenAntiprotonVsCentrality", "Generated antiproton number vs centrality in 2D", kTH2F, {antiprotonAxis, centAxis}); + histos.add("hgenProfileTotalProton", "Generated total proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hgenProfileProton", "Generated proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hgenProfileAntiproton", "Generated antiproton number vs. centrality", kTProfile, {centAxis}); + + if (cfgIsCalculateCentral) { + histos.add("GenProf_mu1_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu2_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu3_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu4_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu5_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu6_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu7_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu8_netproton", "", {HistType::kTProfile, {centAxis}}); + } + + if (cfgIsCalculateError) { + histos.add("GenProf2D_mu1_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu2_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu3_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu4_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu5_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu6_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu7_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu8_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + } + } + } // end init() + + template + bool selectionPIDold(const T& candidate) + { + if (!candidate.hasTPC()) + return false; + + //! PID checking as done in Run2 my analysis + //! ---------------------------------------------------------------------- + int flag = 0; //! pid check main flag + + if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) { + if (std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) { + flag = 1; + } + } + if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) { + const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0)); + const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0)); + const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0)); + + int flag2 = 0; + if (combNSigmaPr < 3.0) + flag2 += 1; + if (combNSigmaPi < 3.0) + flag2 += 1; + if (combNSigmaKa < 3.0) + flag2 += 1; + if (!(flag2 > 1) && !(combNSigmaPr > combNSigmaPi) && !(combNSigmaPr > combNSigmaKa)) { + if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) { + flag = 1; + } + } + } + if (flag == 1) + return true; + else + return false; + } + + template + bool selectionPIDoldTOFveto(const T& candidate) + { + if (!candidate.hasTPC()) + return false; + + //! PID checking as done in Run2 my analysis + //! ---------------------------------------------------------------------- + int flag = 0; //! pid check main flag + + if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) { + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) { + flag = 1; + } + if (candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF) { + flag = 1; + } + } + if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) { + const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0)); + const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0)); + const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0)); + + int flag2 = 0; + if (combNSigmaPr < 3.0) + flag2 += 1; + if (combNSigmaPi < 3.0) + flag2 += 1; + if (combNSigmaKa < 3.0) + flag2 += 1; + if (!(flag2 > 1) && !(combNSigmaPr > combNSigmaPi) && !(combNSigmaPr > combNSigmaKa)) { + if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) { + flag = 1; + } + } + } + if (flag == 1) + return true; + else + return false; + } + + // electron rejection function + template + bool isElectron(const T& candidate) // Victor's BF analysis + { + if (candidate.tpcNSigmaEl() > -3.0f && candidate.tpcNSigmaEl() < 5.0f && std::abs(candidate.tpcNSigmaPi()) > 3.0f && std::abs(candidate.tpcNSigmaKa()) > 3.0f && std::abs(candidate.tpcNSigmaPr()) > 3.0f) { + return true; + } + return false; + } + + template + bool selectionPIDnew(const T& candidate) // Victor's BF analysis + { + // electron rejection + if (candidate.tpcNSigmaEl() > -3.0f && candidate.tpcNSigmaEl() < 5.0f && std::abs(candidate.tpcNSigmaPi()) > 3.0f && std::abs(candidate.tpcNSigmaKa()) > 3.0f && std::abs(candidate.tpcNSigmaPr()) > 3.0f) { + return false; + } + + //! if pt < threshold + if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) { + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaPi()) > cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaKa()) > cfgnSigmaCutTPC) { + return true; + } + if (candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaPi()) > cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaKa()) > cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaPi()) > cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaKa()) > cfgnSigmaCutTOF) { + return true; + } + } + + //! if pt > threshold + if (candidate.pt() > cfgCutPtUpperTPC) { + if (candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaPi()) > cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaKa()) > cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaPi()) > cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaKa()) > cfgnSigmaCutTOF) { + return true; + } + } + return false; + } + + // Function to check which pt bin the track lies in and assign the corresponding efficiency + + template + float getEfficiency(const T& candidate) + { + // Load eff from histograms in CCDB + if (cfgLoadEff) { + if (candidate.sign() > 0) { + float effmeanval = hRatio2DEtaVsPtProton->GetBinContent(hRatio2DEtaVsPtProton->FindBin(candidate.pt(), candidate.eta())); + return effmeanval; + } + if (candidate.sign() < 0) { + float effmeanval = hRatio2DEtaVsPtAntiproton->GetBinContent(hRatio2DEtaVsPtAntiproton->FindBin(candidate.pt(), candidate.eta())); + return effmeanval; + } + return 0.0; + } else { + // Find the pt bin index based on the track's pt value + int binIndex = -1; + + for (int i = 0; i < 16; ++i) { + if (candidate.pt() >= cfgPtBins.value[i] && candidate.pt() < cfgPtBins.value[i + 1]) { + binIndex = i; + break; + } + } + // If the pt is outside the defined bins, return a default efficiency or handle it differently + if (binIndex == -1) { + return 0.0; // Default efficiency (0% if outside bins) + } + if (candidate.sign() > 0) + return cfgProtonEff.value[binIndex]; + if (candidate.sign() < 0) + return cfgAntiprotonEff.value[binIndex]; + return 0.0; + } + } + + void processMCGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + { + histos.fill(HIST("hMC"), 0.5); + if (std::abs(mcCollision.posZ()) < cfgCutVertex) { + histos.fill(HIST("hMC"), 1.5); + } + auto cent = 0; + + int nchInel = 0; + for (const auto& mcParticle : mcParticles) { + auto pdgcode = std::abs(mcParticle.pdgCode()); + if (mcParticle.isPhysicalPrimary() && (pdgcode == PDG_t::kPiPlus || pdgcode == PDG_t::kKPlus || pdgcode == PDG_t::kProton || pdgcode == PDG_t::kElectron || pdgcode == PDG_t::kMuonMinus)) { + if (std::abs(mcParticle.eta()) < 1.0) { + nchInel = nchInel + 1; + } + } + } + if (nchInel > 0 && std::abs(mcCollision.posZ()) < cfgCutVertex) + histos.fill(HIST("hMC"), 2.5); + std::vector selectedEvents(collisions.size()); + int nevts = 0; + + for (const auto& collision : collisions) { + if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cfgCutVertex) { + continue; + } + if (cfgUseGoodITSLayerAllCut && !(collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { + continue; + } + if (cfgEvSelkNoSameBunchPileup && !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + continue; + } + if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { + continue; + } + + cent = collision.centFT0C(); + + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + } + selectedEvents.resize(nevts); + const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); + histos.fill(HIST("hMC"), 3.5); + if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + return; + } + histos.fill(HIST("hMC"), 4.5); + histos.fill(HIST("hCentgen"), cent); + + // creating phi, pt, eta dstribution of generted MC particles + + float nProt = 0.0; + float nAntiprot = 0.0; + + for (const auto& mcParticle : mcParticles) { + if (!mcParticle.has_mcCollision()) + continue; + + if (mcParticle.isPhysicalPrimary()) { + if ((mcParticle.pt() > cfgCutPtLower) && (mcParticle.pt() < 5.0f) && (std::abs(mcParticle.eta()) < cfgCutEta)) { + histos.fill(HIST("hgenPtAll"), mcParticle.pt()); + histos.fill(HIST("hgenEtaAll"), mcParticle.eta()); + histos.fill(HIST("hgenPhiAll"), mcParticle.phi()); + + if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton /*&& std::abs(mcParticle.y()) < 0.5*/) { + if (mcParticle.pdgCode() == PDG_t::kProton) { + histos.fill(HIST("hgenPtProton"), mcParticle.pt()); //! hist for p gen + histos.fill(HIST("hgenPtDistProtonVsCentrality"), mcParticle.pt(), cent); + histos.fill(HIST("hgen2DEtaVsPtProton"), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hgenEtaProton"), mcParticle.eta()); + histos.fill(HIST("hgenPhiProton"), mcParticle.phi()); + if (mcParticle.pt() < cfgCutPtUpper) + nProt = nProt + 1.0; + } + if (mcParticle.pdgCode() == PDG_t::kProtonBar) { + histos.fill(HIST("hgenPtAntiproton"), mcParticle.pt()); //! hist for anti-p gen + histos.fill(HIST("hgenPtDistAntiprotonVsCentrality"), mcParticle.pt(), cent); + histos.fill(HIST("hgen2DEtaVsPtAntiproton"), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hgenEtaAntiproton"), mcParticle.eta()); + histos.fill(HIST("hgenPhiAntiproton"), mcParticle.phi()); + if (mcParticle.pt() < cfgCutPtUpper) + nAntiprot = nAntiprot + 1.0; + } + } + } + } + } //! end particle loop + + float netProt = nProt - nAntiprot; + histos.fill(HIST("hgenNetProtonVsCentrality"), netProt, cent); + histos.fill(HIST("hgenProtonVsCentrality"), nProt, cent); + histos.fill(HIST("hgenAntiprotonVsCentrality"), nAntiprot, cent); + histos.fill(HIST("hgenProfileTotalProton"), cent, (nProt + nAntiprot)); + histos.fill(HIST("hgenProfileProton"), cent, nProt); + histos.fill(HIST("hgenProfileAntiproton"), cent, nAntiprot); + + // Profiles for generated level cumulants + //------------------------------------------------------------------------------------------- + + if (cfgIsCalculateCentral) { + histos.get(HIST("GenProf_mu1_netproton"))->Fill(cent, std::pow(netProt, 1.0)); + histos.get(HIST("GenProf_mu2_netproton"))->Fill(cent, std::pow(netProt, 2.0)); + histos.get(HIST("GenProf_mu3_netproton"))->Fill(cent, std::pow(netProt, 3.0)); + histos.get(HIST("GenProf_mu4_netproton"))->Fill(cent, std::pow(netProt, 4.0)); + histos.get(HIST("GenProf_mu5_netproton"))->Fill(cent, std::pow(netProt, 5.0)); + histos.get(HIST("GenProf_mu6_netproton"))->Fill(cent, std::pow(netProt, 6.0)); + histos.get(HIST("GenProf_mu7_netproton"))->Fill(cent, std::pow(netProt, 7.0)); + histos.get(HIST("GenProf_mu8_netproton"))->Fill(cent, std::pow(netProt, 8.0)); + } + + if (cfgIsCalculateError) { + + float lRandom = fRndm->Rndm(); + int sampleIndex = static_cast(cfgNSubsample * lRandom); + + histos.get(HIST("GenProf2D_mu1_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 1.0)); + histos.get(HIST("GenProf2D_mu2_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 2.0)); + histos.get(HIST("GenProf2D_mu3_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 3.0)); + histos.get(HIST("GenProf2D_mu4_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 4.0)); + histos.get(HIST("GenProf2D_mu5_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 5.0)); + histos.get(HIST("GenProf2D_mu6_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 6.0)); + histos.get(HIST("GenProf2D_mu7_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 7.0)); + histos.get(HIST("GenProf2D_mu8_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 8.0)); + } + //------------------------------------------------------------------------------------------- + } + PROCESS_SWITCH(NetProtCumulants, processMCGen, "Process Generated", false); + + void processMCRec(MyMCRecCollision const& collision, MyMCTracks const& tracks, aod::McCollisions const&, aod::McParticles const&) + { + if (!collision.has_mcCollision()) { + return; + } + + if (!collision.sel8()) { + return; + } + if (cfgUseGoodITSLayerAllCut && !(collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { + return; + } + if (cfgEvSelkNoSameBunchPileup && !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + return; + } + if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { + return; + ; + } + + auto cent = collision.centFT0C(); + histos.fill(HIST("hCentrec"), cent); + histos.fill(HIST("hMC"), 5.5); + histos.fill(HIST("hZvtx_after"), collision.posZ()); + + float nProt = 0.0; + float nAntiprot = 0.0; + std::array powerEffProt = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array powerEffAntiprot = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP0 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP1 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + + o2::aod::ITSResponse itsResponse; + + // Start of the Monte-Carlo reconstructed tracks + for (const auto& track : tracks) { + if (!track.has_collision()) { + continue; + } + + if (!track.has_mcParticle()) //! check if track has corresponding MC particle + { + continue; + } + if (!track.isPVContributor()) //! track check as used in data + { + continue; + } + + auto particle = track.mcParticle(); + if (!particle.has_mcCollision()) + continue; + if ((particle.pt() < cfgCutPtLower) || (particle.pt() > 5.0f) || (std::abs(particle.eta()) > cfgCutEta)) { + continue; + } + if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) { + continue; + } + + if (particle.isPhysicalPrimary()) { + histos.fill(HIST("hrecPartPtAll"), particle.pt()); + histos.fill(HIST("hrecPtAll"), track.pt()); + histos.fill(HIST("hrecEtaAll"), particle.eta()); + histos.fill(HIST("hrecPhiAll"), particle.phi()); + histos.fill(HIST("hrecDcaXYAll"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAll"), track.dcaZ()); + + // rejecting electron + if (cfgIfRejectElectron && isElectron(track)) { + continue; + } + // use ITS pid as well + if (cfgUseItsPid && (std::abs(itsResponse.nSigmaITS(track)) > 3.0)) { + continue; + } + // required tracks with TOF mandatory to avoid pileup + if (cfgIfMandatoryTOF && !track.hasTOF()) { + continue; + } + + bool trackSelected = false; + if (cfgPIDchoice == 0) + trackSelected = selectionPIDoldTOFveto(track); + if (cfgPIDchoice == 1) + trackSelected = selectionPIDnew(track); + if (cfgPIDchoice == 2) + trackSelected = selectionPIDold(track); + + if (trackSelected) { + // filling nSigma distribution + histos.fill(HIST("h2DnsigmaTpcVsPt"), track.pt(), track.tpcNSigmaPr()); + histos.fill(HIST("h2DnsigmaTofVsPt"), track.pt(), track.tofNSigmaPr()); + histos.fill(HIST("h2DnsigmaItsVsPt"), track.pt(), itsResponse.nSigmaITS(track)); + + if (track.sign() > 0) { + histos.fill(HIST("hrecPartPtProton"), particle.pt()); //! hist for p rec + histos.fill(HIST("hrecPtProton"), track.pt()); //! hist for p rec + histos.fill(HIST("hrecPtDistProtonVsCentrality"), particle.pt(), cent); + histos.fill(HIST("hrec2DEtaVsPtProton"), particle.pt(), particle.eta()); + histos.fill(HIST("hrecEtaProton"), particle.eta()); + histos.fill(HIST("hrecPhiProton"), particle.phi()); + histos.fill(HIST("hrecDcaXYProton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZProton"), track.dcaZ()); + if (particle.pt() < cfgCutPtUpper) { + nProt = nProt + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffProt[i] += std::pow(1.0 / pEff, i); + } + } + } + if (particle.pdgCode() == PDG_t::kProton) { + histos.fill(HIST("hrecTruePtProton"), particle.pt()); //! hist for p purity + } + } + if (track.sign() < 0) { + histos.fill(HIST("hrecPartPtAntiproton"), particle.pt()); //! hist for anti-p rec + histos.fill(HIST("hrecPtAntiproton"), track.pt()); //! hist for anti-p rec + histos.fill(HIST("hrecPtDistAntiprotonVsCentrality"), particle.pt(), cent); + histos.fill(HIST("hrec2DEtaVsPtAntiproton"), particle.pt(), particle.eta()); + histos.fill(HIST("hrecEtaAntiproton"), particle.eta()); + histos.fill(HIST("hrecPhiAntiproton"), particle.phi()); + histos.fill(HIST("hrecDcaXYAntiproton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAntiproton"), track.dcaZ()); + if (particle.pt() < cfgCutPtUpper) { + nAntiprot = nAntiprot + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffAntiprot[i] += std::pow(1.0 / pEff, i); + } + } + } + if (particle.pdgCode() == PDG_t::kProtonBar) { + histos.fill(HIST("hrecTruePtAntiproton"), particle.pt()); //! hist for anti-p purity + } + } + } //! checking PID + } //! checking if primary + } //! end track loop + + float netProt = nProt - nAntiprot; + histos.fill(HIST("hrecNetProtonVsCentrality"), netProt, cent); + histos.fill(HIST("hrecProtonVsCentrality"), nProt, cent); + histos.fill(HIST("hrecAntiprotonVsCentrality"), nAntiprot, cent); + histos.fill(HIST("hrecProfileTotalProton"), cent, (nProt + nAntiprot)); + histos.fill(HIST("hrecProfileProton"), cent, nProt); + histos.fill(HIST("hrecProfileAntiproton"), cent, nAntiprot); + histos.fill(HIST("hCorrProfileTotalProton"), cent, (powerEffProt[1] + powerEffAntiprot[1])); + histos.fill(HIST("hCorrProfileProton"), cent, powerEffProt[1]); + histos.fill(HIST("hCorrProfileAntiproton"), cent, powerEffAntiprot[1]); + + // Calculating q_{r,s} as required + for (int i = 1; i < 7; i++) { + fTCP0[i] = powerEffProt[i] + powerEffAntiprot[i]; + fTCP1[i] = powerEffProt[i] - powerEffAntiprot[i]; + } + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + float fQ11_1 = fTCP1[1]; + float fQ11_2 = std::pow(fTCP1[1], 2); + float fQ11_3 = std::pow(fTCP1[1], 3); + float fQ11_4 = std::pow(fTCP1[1], 4); + float fQ11_5 = std::pow(fTCP1[1], 5); + float fQ11_6 = std::pow(fTCP1[1], 6); + + float fQ21_3 = std::pow(fTCP0[1], 3); + float fQ22_3 = std::pow(fTCP0[2], 3); + float fQ31_2 = std::pow(fTCP1[1], 2); + float fQ32_2 = std::pow(fTCP1[2], 2); + float fQ33_2 = std::pow(fTCP1[3], 2); + + float fQ61_1 = fTCP0[1]; + float fQ62_1 = fTCP0[2]; + float fQ63_1 = fTCP0[3]; + float fQ64_1 = fTCP0[4]; + float fQ65_1 = fTCP0[5]; + float fQ66_1 = fTCP0[6]; + + float fQ112122_111 = fTCP1[1] * fTCP0[1] * fTCP0[2]; + float fQ112131_111 = fTCP1[1] * fTCP0[1] * fTCP1[1]; + float fQ112132_111 = fTCP1[1] * fTCP0[1] * fTCP1[2]; + float fQ112133_111 = fTCP1[1] * fTCP0[1] * fTCP1[3]; + float fQ112231_111 = fTCP1[1] * fTCP0[2] * fTCP1[1]; + float fQ112232_111 = fTCP1[1] * fTCP0[2] * fTCP1[2]; + float fQ112233_111 = fTCP1[1] * fTCP0[2] * fTCP1[3]; + float fQ112221_111 = fTCP1[1] * fTCP0[2] * fTCP0[1]; + + float fQ21_1 = fTCP0[1]; + float fQ22_1 = fTCP0[2]; + float fQ31_1 = fTCP1[1]; + float fQ32_1 = fTCP1[2]; + float fQ33_1 = fTCP1[3]; + float fQ41_1 = fTCP0[1]; + float fQ42_1 = fTCP0[2]; + float fQ43_1 = fTCP0[3]; + float fQ44_1 = fTCP0[4]; + float fQ21_2 = std::pow(fTCP0[1], 2); + float fQ22_2 = std::pow(fTCP0[2], 2); + float fQ1121_11 = fTCP1[1] * fTCP0[1]; + float fQ1121_01 = fTCP0[1]; + float fQ1121_10 = fTCP1[1]; + float fQ1121_20 = std::pow(fTCP1[1], 2); + float fQ1121_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1122_11 = fTCP1[1] * fTCP0[2]; + float fQ1122_01 = fTCP0[2]; + float fQ1122_10 = fTCP1[1]; + float fQ1122_20 = std::pow(fTCP1[1], 2); + float fQ1122_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ1131_11 = fTCP1[1] * fTCP1[1]; + float fQ1131_01 = fTCP1[1]; + float fQ1131_10 = fTCP1[1]; + float fQ1132_11 = fTCP1[1] * fTCP1[2]; + float fQ1132_01 = fTCP1[2]; + float fQ1132_10 = fTCP1[1]; + float fQ1133_11 = fTCP1[1] * fTCP1[3]; + float fQ1133_01 = fTCP1[3]; + float fQ1133_10 = fTCP1[1]; + float fQ2122_11 = fTCP0[1] * fTCP0[2]; + float fQ2122_01 = fTCP0[2]; + float fQ2122_10 = fTCP0[1]; + + ///////////////---------------------> + float fQ3132_11 = fTCP1[1] * fTCP1[2]; + float fQ3132_01 = fTCP1[2]; + float fQ3132_10 = fTCP1[1]; + float fQ3133_11 = fTCP1[1] * fTCP1[3]; + float fQ3133_01 = fTCP1[3]; + float fQ3133_10 = fTCP1[1]; + float fQ3233_11 = fTCP1[2] * fTCP1[3]; + float fQ3233_01 = fTCP1[3]; + float fQ3233_10 = fTCP1[2]; + float fQ2241_11 = fTCP0[2] * fTCP0[1]; + float fQ2241_01 = fTCP0[1]; + float fQ2241_10 = fTCP0[2]; + float fQ2242_11 = fTCP0[2] * fTCP0[2]; + float fQ2242_01 = fTCP0[2]; + float fQ2242_10 = fTCP0[2]; + float fQ2243_11 = fTCP0[2] * fTCP0[3]; + float fQ2243_01 = fTCP0[3]; + float fQ2243_10 = fTCP0[2]; + float fQ2244_11 = fTCP0[2] * fTCP0[4]; + float fQ2244_01 = fTCP0[4]; + float fQ2244_10 = fTCP0[2]; + float fQ2141_11 = fTCP0[1] * fTCP0[1]; + float fQ2141_01 = fTCP0[1]; + float fQ2141_10 = fTCP0[1]; + float fQ2142_11 = fTCP0[1] * fTCP0[2]; + float fQ2142_01 = fTCP0[2]; + float fQ2142_10 = fTCP0[1]; + float fQ2143_11 = fTCP0[1] * fTCP0[3]; + float fQ2143_01 = fTCP0[3]; + float fQ2143_10 = fTCP0[1]; + float fQ2144_11 = fTCP0[1] * fTCP0[4]; + float fQ2144_01 = fTCP0[4]; + float fQ2144_10 = fTCP0[1]; + float fQ1151_11 = fTCP1[1] * fTCP1[1]; + float fQ1151_01 = fTCP1[1]; + float fQ1151_10 = fTCP1[1]; + float fQ1152_11 = fTCP1[1] * fTCP1[2]; + float fQ1152_01 = fTCP1[2]; + float fQ1152_10 = fTCP1[1]; + float fQ1153_11 = fTCP1[1] * fTCP1[3]; + float fQ1153_01 = fTCP1[3]; + float fQ1153_10 = fTCP1[1]; + float fQ1154_11 = fTCP1[1] * fTCP1[4]; + float fQ1154_01 = fTCP1[4]; + float fQ1154_10 = fTCP1[1]; + float fQ1155_11 = fTCP1[1] * fTCP1[5]; + float fQ1155_01 = fTCP1[5]; + float fQ1155_10 = fTCP1[1]; + + float fQ112233_001 = fTCP1[3]; + float fQ112233_010 = fTCP0[2]; + float fQ112233_100 = fTCP1[1]; + float fQ112233_011 = fTCP0[2] * fTCP1[3]; + float fQ112233_101 = fTCP1[1] * fTCP1[3]; + float fQ112233_110 = fTCP1[1] * fTCP0[2]; + float fQ112232_001 = fTCP1[2]; + float fQ112232_010 = fTCP0[2]; + float fQ112232_100 = fTCP1[1]; + float fQ112232_011 = fTCP0[2] * fTCP1[2]; + float fQ112232_101 = fTCP1[1] * fTCP1[2]; + float fQ112232_110 = fTCP1[1] * fTCP0[2]; + // + float fQ112231_001 = fTCP1[1]; + float fQ112231_010 = fTCP0[2]; + float fQ112231_100 = fTCP1[1]; + float fQ112231_011 = fTCP0[2] * fTCP1[1]; + float fQ112231_101 = fTCP1[1] * fTCP1[1]; + float fQ112231_110 = fTCP1[1] * fTCP0[2]; + float fQ112133_001 = fTCP1[3]; + float fQ112133_010 = fTCP0[1]; + float fQ112133_100 = fTCP1[1]; + float fQ112133_011 = fTCP0[1] * fTCP1[3]; + float fQ112133_101 = fTCP1[1] * fTCP1[3]; + float fQ112133_110 = fTCP1[1] * fTCP0[1]; + + float fQ112132_001 = fTCP1[2]; + float fQ112132_010 = fTCP0[1]; + float fQ112132_100 = fTCP1[1]; + float fQ112132_011 = fTCP0[1] * fTCP1[2]; + float fQ112132_101 = fTCP1[1] * fTCP1[2]; + float fQ112132_110 = fTCP1[1] * fTCP0[1]; + float fQ112131_001 = fTCP1[1]; + float fQ112131_010 = fTCP0[1]; + float fQ112131_100 = fTCP1[1]; + float fQ112131_011 = fTCP0[1] * fTCP1[1]; + float fQ112131_101 = fTCP1[1] * fTCP1[1]; + float fQ112131_110 = fTCP1[1] * fTCP0[1]; + + float fQ2221_11 = fTCP0[2] * fTCP0[1]; + float fQ2221_01 = fTCP0[1]; + float fQ2221_10 = fTCP0[2]; + float fQ2221_21 = std::pow(fTCP0[2], 2) * fTCP0[1]; + float fQ2221_20 = std::pow(fTCP0[2], 2); + + float fQ2122_21 = std::pow(fTCP0[1], 2) * fTCP0[2]; + float fQ2122_20 = std::pow(fTCP0[1], 2); + float fQ1121_02 = std::pow(fTCP0[1], 2); + float fQ1121_12 = fTCP1[1] * std::pow(fTCP0[1], 2); + float fQ1121_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[1], 2); + float fQ1122_02 = std::pow(fTCP0[2], 2); + float fQ1122_12 = fTCP1[1] * std::pow(fTCP0[2], 2); + float fQ1122_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[2], 2); + + float fQ112221_001 = fTCP0[1]; + float fQ112221_010 = fTCP0[2]; + float fQ112221_100 = fTCP1[1]; + float fQ112221_011 = fTCP0[2] * fTCP0[1]; + float fQ112221_101 = fTCP1[1] * fTCP0[1]; + float fQ112221_110 = fTCP1[1] * fTCP0[2]; + float fQ112221_200 = std::pow(fTCP1[1], 2); + float fQ112221_201 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ112221_210 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ112221_211 = std::pow(fTCP1[1], 2) * fTCP0[2] * fTCP0[1]; + float fQ1131_21 = std::pow(fTCP1[1], 2) * fTCP1[1]; + float fQ1131_20 = std::pow(fTCP1[1], 2); + float fQ1131_31 = std::pow(fTCP1[1], 3) * fTCP1[1]; + float fQ1131_30 = std::pow(fTCP1[1], 3); + + float fQ1132_21 = std::pow(fTCP1[1], 2) * fTCP1[2]; + float fQ1132_20 = std::pow(fTCP1[1], 2); + float fQ1132_31 = std::pow(fTCP1[1], 3) * fTCP1[2]; + float fQ1132_30 = std::pow(fTCP1[1], 3); + float fQ1133_21 = std::pow(fTCP1[1], 2) * fTCP1[3]; + float fQ1133_20 = std::pow(fTCP1[1], 2); + float fQ1133_31 = std::pow(fTCP1[1], 3) * fTCP1[3]; + float fQ1133_30 = std::pow(fTCP1[1], 3); + float fQ1121_30 = std::pow(fTCP1[1], 3); + float fQ1121_31 = std::pow(fTCP1[1], 3) * fTCP0[1]; + float fQ1121_40 = std::pow(fTCP1[1], 4); + float fQ1121_41 = std::pow(fTCP1[1], 4) * fTCP0[1]; + float fQ1122_30 = std::pow(fTCP1[1], 3); + float fQ1122_31 = std::pow(fTCP1[1], 3) * fTCP0[2]; + float fQ1122_40 = std::pow(fTCP1[1], 4); + float fQ1122_41 = std::pow(fTCP1[1], 4) * fTCP0[2]; + + float fQ2211_11 = fTCP0[2] * fTCP1[1]; + float fQ2211_01 = fTCP1[1]; + float fQ2211_10 = fTCP0[2]; + float fQ2211_20 = std::pow(fTCP0[2], 2); + float fQ2211_21 = std::pow(fTCP0[2], 2) * fTCP1[1]; + float fQ2111_11 = fTCP0[1] * fTCP1[1]; + float fQ2111_01 = fTCP1[1]; + float fQ2111_10 = fTCP0[1]; + float fQ2111_20 = std::pow(fTCP0[1], 2); + float fQ2111_21 = std::pow(fTCP0[1], 2) * fTCP1[1]; + + float fQ112122_001 = fTCP0[2]; + float fQ112122_010 = fTCP0[1]; + float fQ112122_100 = fTCP1[1]; + float fQ112122_011 = fTCP0[1] * fTCP0[2]; + float fQ112122_101 = fTCP1[1] * fTCP0[2]; + float fQ112122_110 = fTCP1[1] * fTCP0[1]; + + float fQ1141_11 = fTCP1[1] * fTCP0[1]; + float fQ1141_01 = fTCP0[1]; + float fQ1141_10 = fTCP1[1]; + float fQ1141_20 = std::pow(fTCP1[1], 2); + float fQ1141_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1142_11 = fTCP1[1] * fTCP0[2]; + float fQ1142_01 = fTCP0[2]; + float fQ1142_10 = fTCP1[1]; + float fQ1142_20 = std::pow(fTCP1[1], 2); + float fQ1142_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + + float fQ1143_11 = fTCP1[1] * fTCP0[3]; + float fQ1143_01 = fTCP0[3]; + float fQ1143_10 = fTCP1[1]; + float fQ1143_20 = std::pow(fTCP1[1], 2); + float fQ1143_21 = std::pow(fTCP1[1], 2) * fTCP0[3]; + float fQ1144_11 = fTCP1[1] * fTCP0[4]; + float fQ1144_01 = fTCP0[4]; + float fQ1144_10 = fTCP1[1]; + float fQ1144_20 = std::pow(fTCP1[1], 2); + float fQ1144_21 = std::pow(fTCP1[1], 2) * fTCP0[4]; + float fQ2131_11 = fTCP0[1] * fTCP1[1]; + float fQ2131_01 = fTCP1[1]; + float fQ2131_10 = fTCP0[1]; + + float fQ2132_11 = fTCP0[1] * fTCP1[2]; + float fQ2132_01 = fTCP1[2]; + float fQ2132_10 = fTCP0[1]; + float fQ2133_11 = fTCP0[1] * fTCP1[3]; + float fQ2133_01 = fTCP1[3]; + float fQ2133_10 = fTCP0[1]; + float fQ2231_11 = fTCP0[2] * fTCP1[1]; + float fQ2231_01 = fTCP1[1]; + float fQ2231_10 = fTCP0[2]; + float fQ2232_11 = fTCP0[2] * fTCP1[2]; + float fQ2232_01 = fTCP1[2]; + float fQ2232_10 = fTCP0[2]; + float fQ2233_11 = fTCP0[2] * fTCP1[3]; + float fQ2233_01 = fTCP1[3]; + float fQ2233_10 = fTCP0[2]; + + float fQ51_1 = fTCP1[1]; + float fQ52_1 = fTCP1[2]; + float fQ53_1 = fTCP1[3]; + float fQ54_1 = fTCP1[4]; + float fQ55_1 = fTCP1[5]; + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + if (cfgIsCalculateCentral) { + + // uncorrected + histos.get(HIST("Prof_mu1_netproton"))->Fill(cent, std::pow(netProt, 1.0)); + histos.get(HIST("Prof_mu2_netproton"))->Fill(cent, std::pow(netProt, 2.0)); + histos.get(HIST("Prof_mu3_netproton"))->Fill(cent, std::pow(netProt, 3.0)); + histos.get(HIST("Prof_mu4_netproton"))->Fill(cent, std::pow(netProt, 4.0)); + histos.get(HIST("Prof_mu5_netproton"))->Fill(cent, std::pow(netProt, 5.0)); + histos.get(HIST("Prof_mu6_netproton"))->Fill(cent, std::pow(netProt, 6.0)); + histos.get(HIST("Prof_mu7_netproton"))->Fill(cent, std::pow(netProt, 7.0)); + histos.get(HIST("Prof_mu8_netproton"))->Fill(cent, std::pow(netProt, 8.0)); + + // eff. corrected + histos.get(HIST("Prof_Q11_1"))->Fill(cent, fQ11_1); + histos.get(HIST("Prof_Q11_2"))->Fill(cent, fQ11_2); + histos.get(HIST("Prof_Q11_3"))->Fill(cent, fQ11_3); + histos.get(HIST("Prof_Q11_4"))->Fill(cent, fQ11_4); + histos.get(HIST("Prof_Q21_1"))->Fill(cent, fQ21_1); + histos.get(HIST("Prof_Q22_1"))->Fill(cent, fQ22_1); + histos.get(HIST("Prof_Q31_1"))->Fill(cent, fQ31_1); + histos.get(HIST("Prof_Q32_1"))->Fill(cent, fQ32_1); + histos.get(HIST("Prof_Q33_1"))->Fill(cent, fQ33_1); + histos.get(HIST("Prof_Q41_1"))->Fill(cent, fQ41_1); + histos.get(HIST("Prof_Q42_1"))->Fill(cent, fQ42_1); + histos.get(HIST("Prof_Q43_1"))->Fill(cent, fQ43_1); + histos.get(HIST("Prof_Q44_1"))->Fill(cent, fQ44_1); + histos.get(HIST("Prof_Q21_2"))->Fill(cent, fQ21_2); + histos.get(HIST("Prof_Q22_2"))->Fill(cent, fQ22_2); + histos.get(HIST("Prof_Q1121_11"))->Fill(cent, fQ1121_11); + histos.get(HIST("Prof_Q1121_01"))->Fill(cent, fQ1121_01); + histos.get(HIST("Prof_Q1121_10"))->Fill(cent, fQ1121_10); + histos.get(HIST("Prof_Q1121_20"))->Fill(cent, fQ1121_20); + histos.get(HIST("Prof_Q1121_21"))->Fill(cent, fQ1121_21); + histos.get(HIST("Prof_Q1122_11"))->Fill(cent, fQ1122_11); + histos.get(HIST("Prof_Q1122_01"))->Fill(cent, fQ1122_01); + histos.get(HIST("Prof_Q1122_10"))->Fill(cent, fQ1122_10); + histos.get(HIST("Prof_Q1122_20"))->Fill(cent, fQ1122_20); + histos.get(HIST("Prof_Q1122_21"))->Fill(cent, fQ1122_21); + histos.get(HIST("Prof_Q1131_11"))->Fill(cent, fQ1131_11); + histos.get(HIST("Prof_Q1131_01"))->Fill(cent, fQ1131_01); + histos.get(HIST("Prof_Q1131_10"))->Fill(cent, fQ1131_10); + histos.get(HIST("Prof_Q1132_11"))->Fill(cent, fQ1132_11); + histos.get(HIST("Prof_Q1132_01"))->Fill(cent, fQ1132_01); + histos.get(HIST("Prof_Q1132_10"))->Fill(cent, fQ1132_10); + histos.get(HIST("Prof_Q1133_11"))->Fill(cent, fQ1133_11); + histos.get(HIST("Prof_Q1133_01"))->Fill(cent, fQ1133_01); + histos.get(HIST("Prof_Q1133_10"))->Fill(cent, fQ1133_10); + histos.get(HIST("Prof_Q2122_11"))->Fill(cent, fQ2122_11); + histos.get(HIST("Prof_Q2122_01"))->Fill(cent, fQ2122_01); + histos.get(HIST("Prof_Q2122_10"))->Fill(cent, fQ2122_10); + histos.get(HIST("Prof_Q3132_11"))->Fill(cent, fQ3132_11); + histos.get(HIST("Prof_Q3132_01"))->Fill(cent, fQ3132_01); + histos.get(HIST("Prof_Q3132_10"))->Fill(cent, fQ3132_10); + histos.get(HIST("Prof_Q3133_11"))->Fill(cent, fQ3133_11); + histos.get(HIST("Prof_Q3133_01"))->Fill(cent, fQ3133_01); + histos.get(HIST("Prof_Q3133_10"))->Fill(cent, fQ3133_10); + histos.get(HIST("Prof_Q3233_11"))->Fill(cent, fQ3233_11); + histos.get(HIST("Prof_Q3233_01"))->Fill(cent, fQ3233_01); + histos.get(HIST("Prof_Q3233_10"))->Fill(cent, fQ3233_10); + histos.get(HIST("Prof_Q2241_11"))->Fill(cent, fQ2241_11); + histos.get(HIST("Prof_Q2241_01"))->Fill(cent, fQ2241_01); + histos.get(HIST("Prof_Q2241_10"))->Fill(cent, fQ2241_10); + histos.get(HIST("Prof_Q2242_11"))->Fill(cent, fQ2242_11); + histos.get(HIST("Prof_Q2242_01"))->Fill(cent, fQ2242_01); + histos.get(HIST("Prof_Q2242_10"))->Fill(cent, fQ2242_10); + histos.get(HIST("Prof_Q2243_11"))->Fill(cent, fQ2243_11); + histos.get(HIST("Prof_Q2243_01"))->Fill(cent, fQ2243_01); + histos.get(HIST("Prof_Q2243_10"))->Fill(cent, fQ2243_10); + histos.get(HIST("Prof_Q2244_11"))->Fill(cent, fQ2244_11); + histos.get(HIST("Prof_Q2244_01"))->Fill(cent, fQ2244_01); + histos.get(HIST("Prof_Q2244_10"))->Fill(cent, fQ2244_10); + histos.get(HIST("Prof_Q2141_11"))->Fill(cent, fQ2141_11); + histos.get(HIST("Prof_Q2141_01"))->Fill(cent, fQ2141_01); + histos.get(HIST("Prof_Q2141_10"))->Fill(cent, fQ2141_10); + histos.get(HIST("Prof_Q2142_11"))->Fill(cent, fQ2142_11); + histos.get(HIST("Prof_Q2142_01"))->Fill(cent, fQ2142_01); + histos.get(HIST("Prof_Q2142_10"))->Fill(cent, fQ2142_10); + histos.get(HIST("Prof_Q2143_11"))->Fill(cent, fQ2143_11); + histos.get(HIST("Prof_Q2143_01"))->Fill(cent, fQ2143_01); + histos.get(HIST("Prof_Q2143_10"))->Fill(cent, fQ2143_10); + histos.get(HIST("Prof_Q2144_11"))->Fill(cent, fQ2144_11); + histos.get(HIST("Prof_Q2144_01"))->Fill(cent, fQ2144_01); + histos.get(HIST("Prof_Q2144_10"))->Fill(cent, fQ2144_10); + histos.get(HIST("Prof_Q1151_11"))->Fill(cent, fQ1151_11); + histos.get(HIST("Prof_Q1151_01"))->Fill(cent, fQ1151_01); + histos.get(HIST("Prof_Q1151_10"))->Fill(cent, fQ1151_10); + histos.get(HIST("Prof_Q1152_11"))->Fill(cent, fQ1152_11); + histos.get(HIST("Prof_Q1152_01"))->Fill(cent, fQ1152_01); + histos.get(HIST("Prof_Q1152_10"))->Fill(cent, fQ1152_10); + histos.get(HIST("Prof_Q1153_11"))->Fill(cent, fQ1153_11); + histos.get(HIST("Prof_Q1153_01"))->Fill(cent, fQ1153_01); + histos.get(HIST("Prof_Q1153_10"))->Fill(cent, fQ1153_10); + histos.get(HIST("Prof_Q1154_11"))->Fill(cent, fQ1154_11); + histos.get(HIST("Prof_Q1154_01"))->Fill(cent, fQ1154_01); + histos.get(HIST("Prof_Q1154_10"))->Fill(cent, fQ1154_10); + histos.get(HIST("Prof_Q1155_11"))->Fill(cent, fQ1155_11); + histos.get(HIST("Prof_Q1155_01"))->Fill(cent, fQ1155_01); + histos.get(HIST("Prof_Q1155_10"))->Fill(cent, fQ1155_10); + histos.get(HIST("Prof_Q112233_001"))->Fill(cent, fQ112233_001); + histos.get(HIST("Prof_Q112233_010"))->Fill(cent, fQ112233_010); + histos.get(HIST("Prof_Q112233_100"))->Fill(cent, fQ112233_100); + histos.get(HIST("Prof_Q112233_011"))->Fill(cent, fQ112233_011); + histos.get(HIST("Prof_Q112233_101"))->Fill(cent, fQ112233_101); + histos.get(HIST("Prof_Q112233_110"))->Fill(cent, fQ112233_110); + histos.get(HIST("Prof_Q112232_001"))->Fill(cent, fQ112232_001); + histos.get(HIST("Prof_Q112232_010"))->Fill(cent, fQ112232_010); + histos.get(HIST("Prof_Q112232_100"))->Fill(cent, fQ112232_100); + histos.get(HIST("Prof_Q112232_011"))->Fill(cent, fQ112232_011); + histos.get(HIST("Prof_Q112232_101"))->Fill(cent, fQ112232_101); + histos.get(HIST("Prof_Q112232_110"))->Fill(cent, fQ112232_110); + histos.get(HIST("Prof_Q112231_001"))->Fill(cent, fQ112231_001); + histos.get(HIST("Prof_Q112231_010"))->Fill(cent, fQ112231_010); + histos.get(HIST("Prof_Q112231_100"))->Fill(cent, fQ112231_100); + histos.get(HIST("Prof_Q112231_011"))->Fill(cent, fQ112231_011); + histos.get(HIST("Prof_Q112231_101"))->Fill(cent, fQ112231_101); + histos.get(HIST("Prof_Q112231_110"))->Fill(cent, fQ112231_110); + histos.get(HIST("Prof_Q112133_001"))->Fill(cent, fQ112133_001); + histos.get(HIST("Prof_Q112133_010"))->Fill(cent, fQ112133_010); + histos.get(HIST("Prof_Q112133_100"))->Fill(cent, fQ112133_100); + histos.get(HIST("Prof_Q112133_011"))->Fill(cent, fQ112133_011); + histos.get(HIST("Prof_Q112133_101"))->Fill(cent, fQ112133_101); + histos.get(HIST("Prof_Q112133_110"))->Fill(cent, fQ112133_110); + histos.get(HIST("Prof_Q112132_001"))->Fill(cent, fQ112132_001); + histos.get(HIST("Prof_Q112132_010"))->Fill(cent, fQ112132_010); + histos.get(HIST("Prof_Q112132_100"))->Fill(cent, fQ112132_100); + histos.get(HIST("Prof_Q112132_011"))->Fill(cent, fQ112132_011); + histos.get(HIST("Prof_Q112132_101"))->Fill(cent, fQ112132_101); + histos.get(HIST("Prof_Q112132_110"))->Fill(cent, fQ112132_110); + histos.get(HIST("Prof_Q112131_001"))->Fill(cent, fQ112131_001); + histos.get(HIST("Prof_Q112131_010"))->Fill(cent, fQ112131_010); + histos.get(HIST("Prof_Q112131_100"))->Fill(cent, fQ112131_100); + histos.get(HIST("Prof_Q112131_011"))->Fill(cent, fQ112131_011); + histos.get(HIST("Prof_Q112131_101"))->Fill(cent, fQ112131_101); + histos.get(HIST("Prof_Q112131_110"))->Fill(cent, fQ112131_110); + histos.get(HIST("Prof_Q2221_11"))->Fill(cent, fQ2221_11); + histos.get(HIST("Prof_Q2221_01"))->Fill(cent, fQ2221_01); + histos.get(HIST("Prof_Q2221_10"))->Fill(cent, fQ2221_10); + histos.get(HIST("Prof_Q2221_21"))->Fill(cent, fQ2221_21); + histos.get(HIST("Prof_Q2221_20"))->Fill(cent, fQ2221_20); + histos.get(HIST("Prof_Q2122_21"))->Fill(cent, fQ2122_21); + histos.get(HIST("Prof_Q2122_20"))->Fill(cent, fQ2122_20); + histos.get(HIST("Prof_Q1121_02"))->Fill(cent, fQ1121_02); + histos.get(HIST("Prof_Q1121_12"))->Fill(cent, fQ1121_12); + histos.get(HIST("Prof_Q1121_22"))->Fill(cent, fQ1121_22); + histos.get(HIST("Prof_Q1122_02"))->Fill(cent, fQ1122_02); + histos.get(HIST("Prof_Q1122_12"))->Fill(cent, fQ1122_12); + histos.get(HIST("Prof_Q1122_22"))->Fill(cent, fQ1122_22); + histos.get(HIST("Prof_Q112221_001"))->Fill(cent, fQ112221_001); + histos.get(HIST("Prof_Q112221_010"))->Fill(cent, fQ112221_010); + histos.get(HIST("Prof_Q112221_100"))->Fill(cent, fQ112221_100); + histos.get(HIST("Prof_Q112221_011"))->Fill(cent, fQ112221_011); + histos.get(HIST("Prof_Q112221_101"))->Fill(cent, fQ112221_101); + histos.get(HIST("Prof_Q112221_110"))->Fill(cent, fQ112221_110); + histos.get(HIST("Prof_Q112221_200"))->Fill(cent, fQ112221_200); + histos.get(HIST("Prof_Q112221_201"))->Fill(cent, fQ112221_201); + histos.get(HIST("Prof_Q112221_210"))->Fill(cent, fQ112221_210); + histos.get(HIST("Prof_Q112221_211"))->Fill(cent, fQ112221_211); + histos.get(HIST("Prof_Q1131_21"))->Fill(cent, fQ1131_21); + histos.get(HIST("Prof_Q1131_20"))->Fill(cent, fQ1131_20); + histos.get(HIST("Prof_Q1131_31"))->Fill(cent, fQ1131_31); + histos.get(HIST("Prof_Q1131_30"))->Fill(cent, fQ1131_30); + histos.get(HIST("Prof_Q1132_21"))->Fill(cent, fQ1132_21); + histos.get(HIST("Prof_Q1132_20"))->Fill(cent, fQ1132_20); + histos.get(HIST("Prof_Q1132_31"))->Fill(cent, fQ1132_31); + histos.get(HIST("Prof_Q1132_30"))->Fill(cent, fQ1132_30); + histos.get(HIST("Prof_Q1133_21"))->Fill(cent, fQ1133_21); + histos.get(HIST("Prof_Q1133_20"))->Fill(cent, fQ1133_20); + histos.get(HIST("Prof_Q1133_31"))->Fill(cent, fQ1133_31); + histos.get(HIST("Prof_Q1133_30"))->Fill(cent, fQ1133_30); + histos.get(HIST("Prof_Q11_5"))->Fill(cent, fQ11_5); + histos.get(HIST("Prof_Q11_6"))->Fill(cent, fQ11_6); + histos.get(HIST("Prof_Q1121_30"))->Fill(cent, fQ1121_30); + histos.get(HIST("Prof_Q1121_31"))->Fill(cent, fQ1121_31); + histos.get(HIST("Prof_Q1121_40"))->Fill(cent, fQ1121_40); + histos.get(HIST("Prof_Q1121_41"))->Fill(cent, fQ1121_41); + histos.get(HIST("Prof_Q1122_30"))->Fill(cent, fQ1122_30); + histos.get(HIST("Prof_Q1122_31"))->Fill(cent, fQ1122_31); + histos.get(HIST("Prof_Q1122_40"))->Fill(cent, fQ1122_40); + histos.get(HIST("Prof_Q1122_41"))->Fill(cent, fQ1122_41); + histos.get(HIST("Prof_Q2211_11"))->Fill(cent, fQ2211_11); + histos.get(HIST("Prof_Q2211_01"))->Fill(cent, fQ2211_01); + histos.get(HIST("Prof_Q2211_10"))->Fill(cent, fQ2211_10); + histos.get(HIST("Prof_Q2211_20"))->Fill(cent, fQ2211_20); + histos.get(HIST("Prof_Q2211_21"))->Fill(cent, fQ2211_21); + histos.get(HIST("Prof_Q2111_11"))->Fill(cent, fQ2111_11); + histos.get(HIST("Prof_Q2111_01"))->Fill(cent, fQ2111_01); + histos.get(HIST("Prof_Q2111_10"))->Fill(cent, fQ2111_10); + histos.get(HIST("Prof_Q2111_20"))->Fill(cent, fQ2111_20); + histos.get(HIST("Prof_Q2111_21"))->Fill(cent, fQ2111_21); + histos.get(HIST("Prof_Q112122_001"))->Fill(cent, fQ112122_001); + histos.get(HIST("Prof_Q112122_010"))->Fill(cent, fQ112122_010); + histos.get(HIST("Prof_Q112122_100"))->Fill(cent, fQ112122_100); + histos.get(HIST("Prof_Q112122_011"))->Fill(cent, fQ112122_011); + histos.get(HIST("Prof_Q112122_101"))->Fill(cent, fQ112122_101); + histos.get(HIST("Prof_Q112122_110"))->Fill(cent, fQ112122_110); + histos.get(HIST("Prof_Q1141_11"))->Fill(cent, fQ1141_11); + histos.get(HIST("Prof_Q1141_01"))->Fill(cent, fQ1141_01); + histos.get(HIST("Prof_Q1141_10"))->Fill(cent, fQ1141_10); + histos.get(HIST("Prof_Q1141_20"))->Fill(cent, fQ1141_20); + histos.get(HIST("Prof_Q1141_21"))->Fill(cent, fQ1141_21); + histos.get(HIST("Prof_Q1142_11"))->Fill(cent, fQ1142_11); + histos.get(HIST("Prof_Q1142_01"))->Fill(cent, fQ1142_01); + histos.get(HIST("Prof_Q1142_10"))->Fill(cent, fQ1142_10); + histos.get(HIST("Prof_Q1142_20"))->Fill(cent, fQ1142_20); + histos.get(HIST("Prof_Q1142_21"))->Fill(cent, fQ1142_21); + histos.get(HIST("Prof_Q1143_11"))->Fill(cent, fQ1143_11); + histos.get(HIST("Prof_Q1143_01"))->Fill(cent, fQ1143_01); + histos.get(HIST("Prof_Q1143_10"))->Fill(cent, fQ1143_10); + histos.get(HIST("Prof_Q1143_20"))->Fill(cent, fQ1143_20); + histos.get(HIST("Prof_Q1143_21"))->Fill(cent, fQ1143_21); + histos.get(HIST("Prof_Q1144_11"))->Fill(cent, fQ1144_11); + histos.get(HIST("Prof_Q1144_01"))->Fill(cent, fQ1144_01); + histos.get(HIST("Prof_Q1144_10"))->Fill(cent, fQ1144_10); + histos.get(HIST("Prof_Q1144_20"))->Fill(cent, fQ1144_20); + histos.get(HIST("Prof_Q1144_21"))->Fill(cent, fQ1144_21); + histos.get(HIST("Prof_Q2131_11"))->Fill(cent, fQ2131_11); + histos.get(HIST("Prof_Q2131_01"))->Fill(cent, fQ2131_01); + histos.get(HIST("Prof_Q2131_10"))->Fill(cent, fQ2131_10); + histos.get(HIST("Prof_Q2132_11"))->Fill(cent, fQ2132_11); + histos.get(HIST("Prof_Q2132_01"))->Fill(cent, fQ2132_01); + histos.get(HIST("Prof_Q2132_10"))->Fill(cent, fQ2132_10); + histos.get(HIST("Prof_Q2133_11"))->Fill(cent, fQ2133_11); + histos.get(HIST("Prof_Q2133_01"))->Fill(cent, fQ2133_01); + histos.get(HIST("Prof_Q2133_10"))->Fill(cent, fQ2133_10); + histos.get(HIST("Prof_Q2231_11"))->Fill(cent, fQ2231_11); + histos.get(HIST("Prof_Q2231_01"))->Fill(cent, fQ2231_01); + histos.get(HIST("Prof_Q2231_10"))->Fill(cent, fQ2231_10); + histos.get(HIST("Prof_Q2232_11"))->Fill(cent, fQ2232_11); + histos.get(HIST("Prof_Q2232_01"))->Fill(cent, fQ2232_01); + histos.get(HIST("Prof_Q2232_10"))->Fill(cent, fQ2232_10); + histos.get(HIST("Prof_Q2233_11"))->Fill(cent, fQ2233_11); + histos.get(HIST("Prof_Q2233_01"))->Fill(cent, fQ2233_01); + histos.get(HIST("Prof_Q2233_10"))->Fill(cent, fQ2233_10); + histos.get(HIST("Prof_Q51_1"))->Fill(cent, fQ51_1); + histos.get(HIST("Prof_Q52_1"))->Fill(cent, fQ52_1); + histos.get(HIST("Prof_Q53_1"))->Fill(cent, fQ53_1); + histos.get(HIST("Prof_Q54_1"))->Fill(cent, fQ54_1); + histos.get(HIST("Prof_Q55_1"))->Fill(cent, fQ55_1); + histos.get(HIST("Prof_Q21_3"))->Fill(cent, fQ21_3); + histos.get(HIST("Prof_Q22_3"))->Fill(cent, fQ22_3); + histos.get(HIST("Prof_Q31_2"))->Fill(cent, fQ31_2); + histos.get(HIST("Prof_Q32_2"))->Fill(cent, fQ32_2); + histos.get(HIST("Prof_Q33_2"))->Fill(cent, fQ33_2); + histos.get(HIST("Prof_Q61_1"))->Fill(cent, fQ61_1); + histos.get(HIST("Prof_Q62_1"))->Fill(cent, fQ62_1); + histos.get(HIST("Prof_Q63_1"))->Fill(cent, fQ63_1); + histos.get(HIST("Prof_Q64_1"))->Fill(cent, fQ64_1); + histos.get(HIST("Prof_Q65_1"))->Fill(cent, fQ65_1); + histos.get(HIST("Prof_Q66_1"))->Fill(cent, fQ66_1); + histos.get(HIST("Prof_Q112122_111"))->Fill(cent, fQ112122_111); + histos.get(HIST("Prof_Q112131_111"))->Fill(cent, fQ112131_111); + histos.get(HIST("Prof_Q112132_111"))->Fill(cent, fQ112132_111); + histos.get(HIST("Prof_Q112133_111"))->Fill(cent, fQ112133_111); + histos.get(HIST("Prof_Q112231_111"))->Fill(cent, fQ112231_111); + histos.get(HIST("Prof_Q112232_111"))->Fill(cent, fQ112232_111); + histos.get(HIST("Prof_Q112233_111"))->Fill(cent, fQ112233_111); + histos.get(HIST("Prof_Q112221_111"))->Fill(cent, fQ112221_111); + } + + if (cfgIsCalculateError) { + // selecting subsample and filling profiles + float lRandom = fRndm->Rndm(); + int sampleIndex = static_cast(cfgNSubsample * lRandom); + + histos.get(HIST("Prof2D_mu1_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 1.0)); + histos.get(HIST("Prof2D_mu2_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 2.0)); + histos.get(HIST("Prof2D_mu3_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 3.0)); + histos.get(HIST("Prof2D_mu4_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 4.0)); + histos.get(HIST("Prof2D_mu5_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 5.0)); + histos.get(HIST("Prof2D_mu6_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 6.0)); + histos.get(HIST("Prof2D_mu7_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 7.0)); + histos.get(HIST("Prof2D_mu8_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 8.0)); + + histos.get(HIST("Prof2D_Q11_1"))->Fill(cent, sampleIndex, fQ11_1); + histos.get(HIST("Prof2D_Q11_2"))->Fill(cent, sampleIndex, fQ11_2); + histos.get(HIST("Prof2D_Q11_3"))->Fill(cent, sampleIndex, fQ11_3); + histos.get(HIST("Prof2D_Q11_4"))->Fill(cent, sampleIndex, fQ11_4); + histos.get(HIST("Prof2D_Q21_1"))->Fill(cent, sampleIndex, fQ21_1); + histos.get(HIST("Prof2D_Q22_1"))->Fill(cent, sampleIndex, fQ22_1); + histos.get(HIST("Prof2D_Q31_1"))->Fill(cent, sampleIndex, fQ31_1); + histos.get(HIST("Prof2D_Q32_1"))->Fill(cent, sampleIndex, fQ32_1); + histos.get(HIST("Prof2D_Q33_1"))->Fill(cent, sampleIndex, fQ33_1); + histos.get(HIST("Prof2D_Q41_1"))->Fill(cent, sampleIndex, fQ41_1); + histos.get(HIST("Prof2D_Q42_1"))->Fill(cent, sampleIndex, fQ42_1); + histos.get(HIST("Prof2D_Q43_1"))->Fill(cent, sampleIndex, fQ43_1); + histos.get(HIST("Prof2D_Q44_1"))->Fill(cent, sampleIndex, fQ44_1); + histos.get(HIST("Prof2D_Q21_2"))->Fill(cent, sampleIndex, fQ21_2); + histos.get(HIST("Prof2D_Q22_2"))->Fill(cent, sampleIndex, fQ22_2); + histos.get(HIST("Prof2D_Q1121_11"))->Fill(cent, sampleIndex, fQ1121_11); + histos.get(HIST("Prof2D_Q1121_01"))->Fill(cent, sampleIndex, fQ1121_01); + histos.get(HIST("Prof2D_Q1121_10"))->Fill(cent, sampleIndex, fQ1121_10); + histos.get(HIST("Prof2D_Q1121_20"))->Fill(cent, sampleIndex, fQ1121_20); + histos.get(HIST("Prof2D_Q1121_21"))->Fill(cent, sampleIndex, fQ1121_21); + histos.get(HIST("Prof2D_Q1122_11"))->Fill(cent, sampleIndex, fQ1122_11); + histos.get(HIST("Prof2D_Q1122_01"))->Fill(cent, sampleIndex, fQ1122_01); + histos.get(HIST("Prof2D_Q1122_10"))->Fill(cent, sampleIndex, fQ1122_10); + histos.get(HIST("Prof2D_Q1122_20"))->Fill(cent, sampleIndex, fQ1122_20); + histos.get(HIST("Prof2D_Q1122_21"))->Fill(cent, sampleIndex, fQ1122_21); + histos.get(HIST("Prof2D_Q1131_11"))->Fill(cent, sampleIndex, fQ1131_11); + histos.get(HIST("Prof2D_Q1131_01"))->Fill(cent, sampleIndex, fQ1131_01); + histos.get(HIST("Prof2D_Q1131_10"))->Fill(cent, sampleIndex, fQ1131_10); + histos.get(HIST("Prof2D_Q1132_11"))->Fill(cent, sampleIndex, fQ1132_11); + histos.get(HIST("Prof2D_Q1132_01"))->Fill(cent, sampleIndex, fQ1132_01); + histos.get(HIST("Prof2D_Q1132_10"))->Fill(cent, sampleIndex, fQ1132_10); + histos.get(HIST("Prof2D_Q1133_11"))->Fill(cent, sampleIndex, fQ1133_11); + histos.get(HIST("Prof2D_Q1133_01"))->Fill(cent, sampleIndex, fQ1133_01); + histos.get(HIST("Prof2D_Q1133_10"))->Fill(cent, sampleIndex, fQ1133_10); + histos.get(HIST("Prof2D_Q2122_11"))->Fill(cent, sampleIndex, fQ2122_11); + histos.get(HIST("Prof2D_Q2122_01"))->Fill(cent, sampleIndex, fQ2122_01); + histos.get(HIST("Prof2D_Q2122_10"))->Fill(cent, sampleIndex, fQ2122_10); + histos.get(HIST("Prof2D_Q3132_11"))->Fill(cent, sampleIndex, fQ3132_11); + histos.get(HIST("Prof2D_Q3132_01"))->Fill(cent, sampleIndex, fQ3132_01); + histos.get(HIST("Prof2D_Q3132_10"))->Fill(cent, sampleIndex, fQ3132_10); + histos.get(HIST("Prof2D_Q3133_11"))->Fill(cent, sampleIndex, fQ3133_11); + histos.get(HIST("Prof2D_Q3133_01"))->Fill(cent, sampleIndex, fQ3133_01); + histos.get(HIST("Prof2D_Q3133_10"))->Fill(cent, sampleIndex, fQ3133_10); + histos.get(HIST("Prof2D_Q3233_11"))->Fill(cent, sampleIndex, fQ3233_11); + histos.get(HIST("Prof2D_Q3233_01"))->Fill(cent, sampleIndex, fQ3233_01); + histos.get(HIST("Prof2D_Q3233_10"))->Fill(cent, sampleIndex, fQ3233_10); + histos.get(HIST("Prof2D_Q2241_11"))->Fill(cent, sampleIndex, fQ2241_11); + histos.get(HIST("Prof2D_Q2241_01"))->Fill(cent, sampleIndex, fQ2241_01); + histos.get(HIST("Prof2D_Q2241_10"))->Fill(cent, sampleIndex, fQ2241_10); + histos.get(HIST("Prof2D_Q2242_11"))->Fill(cent, sampleIndex, fQ2242_11); + histos.get(HIST("Prof2D_Q2242_01"))->Fill(cent, sampleIndex, fQ2242_01); + histos.get(HIST("Prof2D_Q2242_10"))->Fill(cent, sampleIndex, fQ2242_10); + histos.get(HIST("Prof2D_Q2243_11"))->Fill(cent, sampleIndex, fQ2243_11); + histos.get(HIST("Prof2D_Q2243_01"))->Fill(cent, sampleIndex, fQ2243_01); + histos.get(HIST("Prof2D_Q2243_10"))->Fill(cent, sampleIndex, fQ2243_10); + histos.get(HIST("Prof2D_Q2244_11"))->Fill(cent, sampleIndex, fQ2244_11); + histos.get(HIST("Prof2D_Q2244_01"))->Fill(cent, sampleIndex, fQ2244_01); + histos.get(HIST("Prof2D_Q2244_10"))->Fill(cent, sampleIndex, fQ2244_10); + histos.get(HIST("Prof2D_Q2141_11"))->Fill(cent, sampleIndex, fQ2141_11); + histos.get(HIST("Prof2D_Q2141_01"))->Fill(cent, sampleIndex, fQ2141_01); + histos.get(HIST("Prof2D_Q2141_10"))->Fill(cent, sampleIndex, fQ2141_10); + histos.get(HIST("Prof2D_Q2142_11"))->Fill(cent, sampleIndex, fQ2142_11); + histos.get(HIST("Prof2D_Q2142_01"))->Fill(cent, sampleIndex, fQ2142_01); + histos.get(HIST("Prof2D_Q2142_10"))->Fill(cent, sampleIndex, fQ2142_10); + histos.get(HIST("Prof2D_Q2143_11"))->Fill(cent, sampleIndex, fQ2143_11); + histos.get(HIST("Prof2D_Q2143_01"))->Fill(cent, sampleIndex, fQ2143_01); + histos.get(HIST("Prof2D_Q2143_10"))->Fill(cent, sampleIndex, fQ2143_10); + histos.get(HIST("Prof2D_Q2144_11"))->Fill(cent, sampleIndex, fQ2144_11); + histos.get(HIST("Prof2D_Q2144_01"))->Fill(cent, sampleIndex, fQ2144_01); + histos.get(HIST("Prof2D_Q2144_10"))->Fill(cent, sampleIndex, fQ2144_10); + histos.get(HIST("Prof2D_Q1151_11"))->Fill(cent, sampleIndex, fQ1151_11); + histos.get(HIST("Prof2D_Q1151_01"))->Fill(cent, sampleIndex, fQ1151_01); + histos.get(HIST("Prof2D_Q1151_10"))->Fill(cent, sampleIndex, fQ1151_10); + histos.get(HIST("Prof2D_Q1152_11"))->Fill(cent, sampleIndex, fQ1152_11); + histos.get(HIST("Prof2D_Q1152_01"))->Fill(cent, sampleIndex, fQ1152_01); + histos.get(HIST("Prof2D_Q1152_10"))->Fill(cent, sampleIndex, fQ1152_10); + histos.get(HIST("Prof2D_Q1153_11"))->Fill(cent, sampleIndex, fQ1153_11); + histos.get(HIST("Prof2D_Q1153_01"))->Fill(cent, sampleIndex, fQ1153_01); + histos.get(HIST("Prof2D_Q1153_10"))->Fill(cent, sampleIndex, fQ1153_10); + histos.get(HIST("Prof2D_Q1154_11"))->Fill(cent, sampleIndex, fQ1154_11); + histos.get(HIST("Prof2D_Q1154_01"))->Fill(cent, sampleIndex, fQ1154_01); + histos.get(HIST("Prof2D_Q1154_10"))->Fill(cent, sampleIndex, fQ1154_10); + histos.get(HIST("Prof2D_Q1155_11"))->Fill(cent, sampleIndex, fQ1155_11); + histos.get(HIST("Prof2D_Q1155_01"))->Fill(cent, sampleIndex, fQ1155_01); + histos.get(HIST("Prof2D_Q1155_10"))->Fill(cent, sampleIndex, fQ1155_10); + histos.get(HIST("Prof2D_Q112233_001"))->Fill(cent, sampleIndex, fQ112233_001); + histos.get(HIST("Prof2D_Q112233_010"))->Fill(cent, sampleIndex, fQ112233_010); + histos.get(HIST("Prof2D_Q112233_100"))->Fill(cent, sampleIndex, fQ112233_100); + histos.get(HIST("Prof2D_Q112233_011"))->Fill(cent, sampleIndex, fQ112233_011); + histos.get(HIST("Prof2D_Q112233_101"))->Fill(cent, sampleIndex, fQ112233_101); + histos.get(HIST("Prof2D_Q112233_110"))->Fill(cent, sampleIndex, fQ112233_110); + histos.get(HIST("Prof2D_Q112232_001"))->Fill(cent, sampleIndex, fQ112232_001); + histos.get(HIST("Prof2D_Q112232_010"))->Fill(cent, sampleIndex, fQ112232_010); + histos.get(HIST("Prof2D_Q112232_100"))->Fill(cent, sampleIndex, fQ112232_100); + histos.get(HIST("Prof2D_Q112232_011"))->Fill(cent, sampleIndex, fQ112232_011); + histos.get(HIST("Prof2D_Q112232_101"))->Fill(cent, sampleIndex, fQ112232_101); + histos.get(HIST("Prof2D_Q112232_110"))->Fill(cent, sampleIndex, fQ112232_110); + histos.get(HIST("Prof2D_Q112231_001"))->Fill(cent, sampleIndex, fQ112231_001); + histos.get(HIST("Prof2D_Q112231_010"))->Fill(cent, sampleIndex, fQ112231_010); + histos.get(HIST("Prof2D_Q112231_100"))->Fill(cent, sampleIndex, fQ112231_100); + histos.get(HIST("Prof2D_Q112231_011"))->Fill(cent, sampleIndex, fQ112231_011); + histos.get(HIST("Prof2D_Q112231_101"))->Fill(cent, sampleIndex, fQ112231_101); + histos.get(HIST("Prof2D_Q112231_110"))->Fill(cent, sampleIndex, fQ112231_110); + histos.get(HIST("Prof2D_Q112133_001"))->Fill(cent, sampleIndex, fQ112133_001); + histos.get(HIST("Prof2D_Q112133_010"))->Fill(cent, sampleIndex, fQ112133_010); + histos.get(HIST("Prof2D_Q112133_100"))->Fill(cent, sampleIndex, fQ112133_100); + histos.get(HIST("Prof2D_Q112133_011"))->Fill(cent, sampleIndex, fQ112133_011); + histos.get(HIST("Prof2D_Q112133_101"))->Fill(cent, sampleIndex, fQ112133_101); + histos.get(HIST("Prof2D_Q112133_110"))->Fill(cent, sampleIndex, fQ112133_110); + histos.get(HIST("Prof2D_Q112132_001"))->Fill(cent, sampleIndex, fQ112132_001); + histos.get(HIST("Prof2D_Q112132_010"))->Fill(cent, sampleIndex, fQ112132_010); + histos.get(HIST("Prof2D_Q112132_100"))->Fill(cent, sampleIndex, fQ112132_100); + histos.get(HIST("Prof2D_Q112132_011"))->Fill(cent, sampleIndex, fQ112132_011); + histos.get(HIST("Prof2D_Q112132_101"))->Fill(cent, sampleIndex, fQ112132_101); + histos.get(HIST("Prof2D_Q112132_110"))->Fill(cent, sampleIndex, fQ112132_110); + histos.get(HIST("Prof2D_Q112131_001"))->Fill(cent, sampleIndex, fQ112131_001); + histos.get(HIST("Prof2D_Q112131_010"))->Fill(cent, sampleIndex, fQ112131_010); + histos.get(HIST("Prof2D_Q112131_100"))->Fill(cent, sampleIndex, fQ112131_100); + histos.get(HIST("Prof2D_Q112131_011"))->Fill(cent, sampleIndex, fQ112131_011); + histos.get(HIST("Prof2D_Q112131_101"))->Fill(cent, sampleIndex, fQ112131_101); + histos.get(HIST("Prof2D_Q112131_110"))->Fill(cent, sampleIndex, fQ112131_110); + histos.get(HIST("Prof2D_Q2221_11"))->Fill(cent, sampleIndex, fQ2221_11); + histos.get(HIST("Prof2D_Q2221_01"))->Fill(cent, sampleIndex, fQ2221_01); + histos.get(HIST("Prof2D_Q2221_10"))->Fill(cent, sampleIndex, fQ2221_10); + histos.get(HIST("Prof2D_Q2221_21"))->Fill(cent, sampleIndex, fQ2221_21); + histos.get(HIST("Prof2D_Q2221_20"))->Fill(cent, sampleIndex, fQ2221_20); + histos.get(HIST("Prof2D_Q2122_21"))->Fill(cent, sampleIndex, fQ2122_21); + histos.get(HIST("Prof2D_Q2122_20"))->Fill(cent, sampleIndex, fQ2122_20); + histos.get(HIST("Prof2D_Q1121_02"))->Fill(cent, sampleIndex, fQ1121_02); + histos.get(HIST("Prof2D_Q1121_12"))->Fill(cent, sampleIndex, fQ1121_12); + histos.get(HIST("Prof2D_Q1121_22"))->Fill(cent, sampleIndex, fQ1121_22); + histos.get(HIST("Prof2D_Q1122_02"))->Fill(cent, sampleIndex, fQ1122_02); + histos.get(HIST("Prof2D_Q1122_12"))->Fill(cent, sampleIndex, fQ1122_12); + histos.get(HIST("Prof2D_Q1122_22"))->Fill(cent, sampleIndex, fQ1122_22); + histos.get(HIST("Prof2D_Q112221_001"))->Fill(cent, sampleIndex, fQ112221_001); + histos.get(HIST("Prof2D_Q112221_010"))->Fill(cent, sampleIndex, fQ112221_010); + histos.get(HIST("Prof2D_Q112221_100"))->Fill(cent, sampleIndex, fQ112221_100); + histos.get(HIST("Prof2D_Q112221_011"))->Fill(cent, sampleIndex, fQ112221_011); + histos.get(HIST("Prof2D_Q112221_101"))->Fill(cent, sampleIndex, fQ112221_101); + histos.get(HIST("Prof2D_Q112221_110"))->Fill(cent, sampleIndex, fQ112221_110); + histos.get(HIST("Prof2D_Q112221_200"))->Fill(cent, sampleIndex, fQ112221_200); + histos.get(HIST("Prof2D_Q112221_201"))->Fill(cent, sampleIndex, fQ112221_201); + histos.get(HIST("Prof2D_Q112221_210"))->Fill(cent, sampleIndex, fQ112221_210); + histos.get(HIST("Prof2D_Q112221_211"))->Fill(cent, sampleIndex, fQ112221_211); + histos.get(HIST("Prof2D_Q1131_21"))->Fill(cent, sampleIndex, fQ1131_21); + histos.get(HIST("Prof2D_Q1131_20"))->Fill(cent, sampleIndex, fQ1131_20); + histos.get(HIST("Prof2D_Q1131_31"))->Fill(cent, sampleIndex, fQ1131_31); + histos.get(HIST("Prof2D_Q1131_30"))->Fill(cent, sampleIndex, fQ1131_30); + histos.get(HIST("Prof2D_Q1132_21"))->Fill(cent, sampleIndex, fQ1132_21); + histos.get(HIST("Prof2D_Q1132_20"))->Fill(cent, sampleIndex, fQ1132_20); + histos.get(HIST("Prof2D_Q1132_31"))->Fill(cent, sampleIndex, fQ1132_31); + histos.get(HIST("Prof2D_Q1132_30"))->Fill(cent, sampleIndex, fQ1132_30); + histos.get(HIST("Prof2D_Q1133_21"))->Fill(cent, sampleIndex, fQ1133_21); + histos.get(HIST("Prof2D_Q1133_20"))->Fill(cent, sampleIndex, fQ1133_20); + histos.get(HIST("Prof2D_Q1133_31"))->Fill(cent, sampleIndex, fQ1133_31); + histos.get(HIST("Prof2D_Q1133_30"))->Fill(cent, sampleIndex, fQ1133_30); + histos.get(HIST("Prof2D_Q11_5"))->Fill(cent, sampleIndex, fQ11_5); + histos.get(HIST("Prof2D_Q11_6"))->Fill(cent, sampleIndex, fQ11_6); + histos.get(HIST("Prof2D_Q1121_30"))->Fill(cent, sampleIndex, fQ1121_30); + histos.get(HIST("Prof2D_Q1121_31"))->Fill(cent, sampleIndex, fQ1121_31); + histos.get(HIST("Prof2D_Q1121_40"))->Fill(cent, sampleIndex, fQ1121_40); + histos.get(HIST("Prof2D_Q1121_41"))->Fill(cent, sampleIndex, fQ1121_41); + histos.get(HIST("Prof2D_Q1122_30"))->Fill(cent, sampleIndex, fQ1122_30); + histos.get(HIST("Prof2D_Q1122_31"))->Fill(cent, sampleIndex, fQ1122_31); + histos.get(HIST("Prof2D_Q1122_40"))->Fill(cent, sampleIndex, fQ1122_40); + histos.get(HIST("Prof2D_Q1122_41"))->Fill(cent, sampleIndex, fQ1122_41); + histos.get(HIST("Prof2D_Q2211_11"))->Fill(cent, sampleIndex, fQ2211_11); + histos.get(HIST("Prof2D_Q2211_01"))->Fill(cent, sampleIndex, fQ2211_01); + histos.get(HIST("Prof2D_Q2211_10"))->Fill(cent, sampleIndex, fQ2211_10); + histos.get(HIST("Prof2D_Q2211_20"))->Fill(cent, sampleIndex, fQ2211_20); + histos.get(HIST("Prof2D_Q2211_21"))->Fill(cent, sampleIndex, fQ2211_21); + histos.get(HIST("Prof2D_Q2111_11"))->Fill(cent, sampleIndex, fQ2111_11); + histos.get(HIST("Prof2D_Q2111_01"))->Fill(cent, sampleIndex, fQ2111_01); + histos.get(HIST("Prof2D_Q2111_10"))->Fill(cent, sampleIndex, fQ2111_10); + histos.get(HIST("Prof2D_Q2111_20"))->Fill(cent, sampleIndex, fQ2111_20); + histos.get(HIST("Prof2D_Q2111_21"))->Fill(cent, sampleIndex, fQ2111_21); + histos.get(HIST("Prof2D_Q112122_001"))->Fill(cent, sampleIndex, fQ112122_001); + histos.get(HIST("Prof2D_Q112122_010"))->Fill(cent, sampleIndex, fQ112122_010); + histos.get(HIST("Prof2D_Q112122_100"))->Fill(cent, sampleIndex, fQ112122_100); + histos.get(HIST("Prof2D_Q112122_011"))->Fill(cent, sampleIndex, fQ112122_011); + histos.get(HIST("Prof2D_Q112122_101"))->Fill(cent, sampleIndex, fQ112122_101); + histos.get(HIST("Prof2D_Q112122_110"))->Fill(cent, sampleIndex, fQ112122_110); + histos.get(HIST("Prof2D_Q1141_11"))->Fill(cent, sampleIndex, fQ1141_11); + histos.get(HIST("Prof2D_Q1141_01"))->Fill(cent, sampleIndex, fQ1141_01); + histos.get(HIST("Prof2D_Q1141_10"))->Fill(cent, sampleIndex, fQ1141_10); + histos.get(HIST("Prof2D_Q1141_20"))->Fill(cent, sampleIndex, fQ1141_20); + histos.get(HIST("Prof2D_Q1141_21"))->Fill(cent, sampleIndex, fQ1141_21); + histos.get(HIST("Prof2D_Q1142_11"))->Fill(cent, sampleIndex, fQ1142_11); + histos.get(HIST("Prof2D_Q1142_01"))->Fill(cent, sampleIndex, fQ1142_01); + histos.get(HIST("Prof2D_Q1142_10"))->Fill(cent, sampleIndex, fQ1142_10); + histos.get(HIST("Prof2D_Q1142_20"))->Fill(cent, sampleIndex, fQ1142_20); + histos.get(HIST("Prof2D_Q1142_21"))->Fill(cent, sampleIndex, fQ1142_21); + histos.get(HIST("Prof2D_Q1143_11"))->Fill(cent, sampleIndex, fQ1143_11); + histos.get(HIST("Prof2D_Q1143_01"))->Fill(cent, sampleIndex, fQ1143_01); + histos.get(HIST("Prof2D_Q1143_10"))->Fill(cent, sampleIndex, fQ1143_10); + histos.get(HIST("Prof2D_Q1143_20"))->Fill(cent, sampleIndex, fQ1143_20); + histos.get(HIST("Prof2D_Q1143_21"))->Fill(cent, sampleIndex, fQ1143_21); + histos.get(HIST("Prof2D_Q1144_11"))->Fill(cent, sampleIndex, fQ1144_11); + histos.get(HIST("Prof2D_Q1144_01"))->Fill(cent, sampleIndex, fQ1144_01); + histos.get(HIST("Prof2D_Q1144_10"))->Fill(cent, sampleIndex, fQ1144_10); + histos.get(HIST("Prof2D_Q1144_20"))->Fill(cent, sampleIndex, fQ1144_20); + histos.get(HIST("Prof2D_Q1144_21"))->Fill(cent, sampleIndex, fQ1144_21); + histos.get(HIST("Prof2D_Q2131_11"))->Fill(cent, sampleIndex, fQ2131_11); + histos.get(HIST("Prof2D_Q2131_01"))->Fill(cent, sampleIndex, fQ2131_01); + histos.get(HIST("Prof2D_Q2131_10"))->Fill(cent, sampleIndex, fQ2131_10); + histos.get(HIST("Prof2D_Q2132_11"))->Fill(cent, sampleIndex, fQ2132_11); + histos.get(HIST("Prof2D_Q2132_01"))->Fill(cent, sampleIndex, fQ2132_01); + histos.get(HIST("Prof2D_Q2132_10"))->Fill(cent, sampleIndex, fQ2132_10); + histos.get(HIST("Prof2D_Q2133_11"))->Fill(cent, sampleIndex, fQ2133_11); + histos.get(HIST("Prof2D_Q2133_01"))->Fill(cent, sampleIndex, fQ2133_01); + histos.get(HIST("Prof2D_Q2133_10"))->Fill(cent, sampleIndex, fQ2133_10); + histos.get(HIST("Prof2D_Q2231_11"))->Fill(cent, sampleIndex, fQ2231_11); + histos.get(HIST("Prof2D_Q2231_01"))->Fill(cent, sampleIndex, fQ2231_01); + histos.get(HIST("Prof2D_Q2231_10"))->Fill(cent, sampleIndex, fQ2231_10); + histos.get(HIST("Prof2D_Q2232_11"))->Fill(cent, sampleIndex, fQ2232_11); + histos.get(HIST("Prof2D_Q2232_01"))->Fill(cent, sampleIndex, fQ2232_01); + histos.get(HIST("Prof2D_Q2232_10"))->Fill(cent, sampleIndex, fQ2232_10); + histos.get(HIST("Prof2D_Q2233_11"))->Fill(cent, sampleIndex, fQ2233_11); + histos.get(HIST("Prof2D_Q2233_01"))->Fill(cent, sampleIndex, fQ2233_01); + histos.get(HIST("Prof2D_Q2233_10"))->Fill(cent, sampleIndex, fQ2233_10); + histos.get(HIST("Prof2D_Q51_1"))->Fill(cent, sampleIndex, fQ51_1); + histos.get(HIST("Prof2D_Q52_1"))->Fill(cent, sampleIndex, fQ52_1); + histos.get(HIST("Prof2D_Q53_1"))->Fill(cent, sampleIndex, fQ53_1); + histos.get(HIST("Prof2D_Q54_1"))->Fill(cent, sampleIndex, fQ54_1); + histos.get(HIST("Prof2D_Q55_1"))->Fill(cent, sampleIndex, fQ55_1); + histos.get(HIST("Prof2D_Q21_3"))->Fill(cent, sampleIndex, fQ21_3); + histos.get(HIST("Prof2D_Q22_3"))->Fill(cent, sampleIndex, fQ22_3); + histos.get(HIST("Prof2D_Q31_2"))->Fill(cent, sampleIndex, fQ31_2); + histos.get(HIST("Prof2D_Q32_2"))->Fill(cent, sampleIndex, fQ32_2); + histos.get(HIST("Prof2D_Q33_2"))->Fill(cent, sampleIndex, fQ33_2); + histos.get(HIST("Prof2D_Q61_1"))->Fill(cent, sampleIndex, fQ61_1); + histos.get(HIST("Prof2D_Q62_1"))->Fill(cent, sampleIndex, fQ62_1); + histos.get(HIST("Prof2D_Q63_1"))->Fill(cent, sampleIndex, fQ63_1); + histos.get(HIST("Prof2D_Q64_1"))->Fill(cent, sampleIndex, fQ64_1); + histos.get(HIST("Prof2D_Q65_1"))->Fill(cent, sampleIndex, fQ65_1); + histos.get(HIST("Prof2D_Q66_1"))->Fill(cent, sampleIndex, fQ66_1); + histos.get(HIST("Prof2D_Q112122_111"))->Fill(cent, sampleIndex, fQ112122_111); + histos.get(HIST("Prof2D_Q112131_111"))->Fill(cent, sampleIndex, fQ112131_111); + histos.get(HIST("Prof2D_Q112132_111"))->Fill(cent, sampleIndex, fQ112132_111); + histos.get(HIST("Prof2D_Q112133_111"))->Fill(cent, sampleIndex, fQ112133_111); + histos.get(HIST("Prof2D_Q112231_111"))->Fill(cent, sampleIndex, fQ112231_111); + histos.get(HIST("Prof2D_Q112232_111"))->Fill(cent, sampleIndex, fQ112232_111); + histos.get(HIST("Prof2D_Q112233_111"))->Fill(cent, sampleIndex, fQ112233_111); + histos.get(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111); + } + } + PROCESS_SWITCH(NetProtCumulants, processMCRec, "Process Generated", false); + + void processDataRec(AodCollisions::iterator const& coll, aod::BCsWithTimestamps const&, AodTracks const& inputTracks) + { + if (!coll.sel8()) { + return; + } + if (cfgUseGoodITSLayerAllCut && !(coll.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { + return; + } + if (cfgEvSelkNoSameBunchPileup && !(coll.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + // rejects collisions which are associated with the same "found-by-T0" bunch crossing + // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof + return; + } + + if (cfgEvSelkIsVertexTOFmatched && !(coll.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { + return; + ; + } + + histos.fill(HIST("hZvtx_after"), coll.posZ()); + // variables + auto cent = coll.centFT0C(); + histos.fill(HIST("hCentrec"), cent); + + float nProt = 0.0; + float nAntiprot = 0.0; + std::array powerEffProt = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array powerEffAntiprot = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP0 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP1 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + + o2::aod::ITSResponse itsResponse; + + // Start of the Monte-Carlo reconstructed tracks + for (const auto& track : inputTracks) { + if (!track.has_collision()) { + continue; + } + + if (!track.isPVContributor()) //! track check as used in data + { + continue; + } + if ((track.pt() < cfgCutPtLower) || (track.pt() > 5.0f) || (std::abs(track.eta()) > cfgCutEta)) { + continue; + } + if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) { + continue; + } + // for purity calculation + float nsTPC = track.tpcNSigmaPr(); + float nsTOF = track.tofNSigmaPr(); + + if (track.sign() > 0) { + + histos.fill(HIST("h2_nSigmaTPC_p"), track.pt(), nsTPC); + + if (track.hasTOF()) { + histos.fill(HIST("h2_nSigmaTOF_p"), track.pt(), nsTOF); + } + } + + if (track.sign() < 0) { + + histos.fill(HIST("h2_nSigmaTPC_ap"), track.pt(), nsTPC); + + if (track.hasTOF()) { + histos.fill(HIST("h2_nSigmaTOF_ap"), track.pt(), nsTOF); + } + } + + histos.fill(HIST("hrecPtAll"), track.pt()); + histos.fill(HIST("hrecEtaAll"), track.eta()); + histos.fill(HIST("hrecPhiAll"), track.phi()); + histos.fill(HIST("hrecDcaXYAll"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAll"), track.dcaZ()); + + // rejecting electron + if (cfgIfRejectElectron && isElectron(track)) { + continue; + } + // use ITS pid as well + if (cfgUseItsPid && (std::abs(itsResponse.nSigmaITS(track)) > 3.0)) { + continue; + } + // required tracks with TOF mandatory to avoid pileup + if (cfgIfMandatoryTOF && !track.hasTOF()) { + continue; + } + + bool trackSelected = false; + if (cfgPIDchoice == 0) + trackSelected = selectionPIDoldTOFveto(track); + if (cfgPIDchoice == 1) + trackSelected = selectionPIDnew(track); + if (cfgPIDchoice == 2) + trackSelected = selectionPIDold(track); + + if (trackSelected) { + + // filling nSigma distribution + histos.fill(HIST("h2DnsigmaTpcVsPt"), track.pt(), track.tpcNSigmaPr()); + histos.fill(HIST("h2DnsigmaTofVsPt"), track.pt(), track.tofNSigmaPr()); + histos.fill(HIST("h2DnsigmaItsVsPt"), track.pt(), itsResponse.nSigmaITS(track)); + + // for protons + if (track.sign() > 0) { + histos.fill(HIST("hrecPtProton"), track.pt()); //! hist for p rec + histos.fill(HIST("hrecPtDistProtonVsCentrality"), track.pt(), cent); + histos.fill(HIST("hrecEtaProton"), track.eta()); + histos.fill(HIST("hrecPhiProton"), track.phi()); + histos.fill(HIST("hrecDcaXYProton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZProton"), track.dcaZ()); + + if (track.pt() < cfgCutPtUpper) { + nProt = nProt + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffProt[i] += std::pow(1.0 / pEff, i); + } + } + } + } + // for anti-protons + if (track.sign() < 0) { + histos.fill(HIST("hrecPtAntiproton"), track.pt()); //! hist for anti-p rec + histos.fill(HIST("hrecPtDistAntiprotonVsCentrality"), track.pt(), cent); + histos.fill(HIST("hrecEtaAntiproton"), track.eta()); + histos.fill(HIST("hrecPhiAntiproton"), track.phi()); + histos.fill(HIST("hrecDcaXYAntiproton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAntiproton"), track.dcaZ()); + if (track.pt() < cfgCutPtUpper) { + nAntiprot = nAntiprot + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffAntiprot[i] += std::pow(1.0 / pEff, i); + } + } + } + } + + } //! checking PID + } //! end track loop + + float netProt = nProt - nAntiprot; + histos.fill(HIST("hrecNetProtonVsCentrality"), netProt, cent); + histos.fill(HIST("hrecProtonVsCentrality"), nProt, cent); + histos.fill(HIST("hrecAntiprotonVsCentrality"), nAntiprot, cent); + histos.fill(HIST("hrecProfileTotalProton"), cent, (nProt + nAntiprot)); + histos.fill(HIST("hrecProfileProton"), cent, nProt); + histos.fill(HIST("hrecProfileAntiproton"), cent, nAntiprot); + histos.fill(HIST("hCorrProfileTotalProton"), cent, (powerEffProt[1] + powerEffAntiprot[1])); + histos.fill(HIST("hCorrProfileProton"), cent, powerEffProt[1]); + histos.fill(HIST("hCorrProfileAntiproton"), cent, powerEffAntiprot[1]); + + // Calculating q_{r,s} as required + for (int i = 1; i < 7; i++) { + fTCP0[i] = powerEffProt[i] + powerEffAntiprot[i]; + fTCP1[i] = powerEffProt[i] - powerEffAntiprot[i]; + } + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + float fQ11_1 = fTCP1[1]; + float fQ11_2 = std::pow(fTCP1[1], 2); + float fQ11_3 = std::pow(fTCP1[1], 3); + float fQ11_4 = std::pow(fTCP1[1], 4); + float fQ11_5 = std::pow(fTCP1[1], 5); + float fQ11_6 = std::pow(fTCP1[1], 6); + + float fQ21_3 = std::pow(fTCP0[1], 3); + float fQ22_3 = std::pow(fTCP0[2], 3); + float fQ31_2 = std::pow(fTCP1[1], 2); + float fQ32_2 = std::pow(fTCP1[2], 2); + float fQ33_2 = std::pow(fTCP1[3], 2); + + float fQ61_1 = fTCP0[1]; + float fQ62_1 = fTCP0[2]; + float fQ63_1 = fTCP0[3]; + float fQ64_1 = fTCP0[4]; + float fQ65_1 = fTCP0[5]; + float fQ66_1 = fTCP0[6]; + + float fQ112122_111 = fTCP1[1] * fTCP0[1] * fTCP0[2]; + float fQ112131_111 = fTCP1[1] * fTCP0[1] * fTCP1[1]; + float fQ112132_111 = fTCP1[1] * fTCP0[1] * fTCP1[2]; + float fQ112133_111 = fTCP1[1] * fTCP0[1] * fTCP1[3]; + float fQ112231_111 = fTCP1[1] * fTCP0[2] * fTCP1[1]; + float fQ112232_111 = fTCP1[1] * fTCP0[2] * fTCP1[2]; + float fQ112233_111 = fTCP1[1] * fTCP0[2] * fTCP1[3]; + float fQ112221_111 = fTCP1[1] * fTCP0[2] * fTCP0[1]; + + float fQ21_1 = fTCP0[1]; + float fQ22_1 = fTCP0[2]; + float fQ31_1 = fTCP1[1]; + float fQ32_1 = fTCP1[2]; + float fQ33_1 = fTCP1[3]; + float fQ41_1 = fTCP0[1]; + float fQ42_1 = fTCP0[2]; + float fQ43_1 = fTCP0[3]; + float fQ44_1 = fTCP0[4]; + float fQ21_2 = std::pow(fTCP0[1], 2); + float fQ22_2 = std::pow(fTCP0[2], 2); + float fQ1121_11 = fTCP1[1] * fTCP0[1]; + float fQ1121_01 = fTCP0[1]; + float fQ1121_10 = fTCP1[1]; + float fQ1121_20 = std::pow(fTCP1[1], 2); + float fQ1121_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1122_11 = fTCP1[1] * fTCP0[2]; + float fQ1122_01 = fTCP0[2]; + float fQ1122_10 = fTCP1[1]; + float fQ1122_20 = std::pow(fTCP1[1], 2); + float fQ1122_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ1131_11 = fTCP1[1] * fTCP1[1]; + float fQ1131_01 = fTCP1[1]; + float fQ1131_10 = fTCP1[1]; + float fQ1132_11 = fTCP1[1] * fTCP1[2]; + float fQ1132_01 = fTCP1[2]; + float fQ1132_10 = fTCP1[1]; + float fQ1133_11 = fTCP1[1] * fTCP1[3]; + float fQ1133_01 = fTCP1[3]; + float fQ1133_10 = fTCP1[1]; + float fQ2122_11 = fTCP0[1] * fTCP0[2]; + float fQ2122_01 = fTCP0[2]; + float fQ2122_10 = fTCP0[1]; + + ///////////////---------------------> + float fQ3132_11 = fTCP1[1] * fTCP1[2]; + float fQ3132_01 = fTCP1[2]; + float fQ3132_10 = fTCP1[1]; + float fQ3133_11 = fTCP1[1] * fTCP1[3]; + float fQ3133_01 = fTCP1[3]; + float fQ3133_10 = fTCP1[1]; + float fQ3233_11 = fTCP1[2] * fTCP1[3]; + float fQ3233_01 = fTCP1[3]; + float fQ3233_10 = fTCP1[2]; + float fQ2241_11 = fTCP0[2] * fTCP0[1]; + float fQ2241_01 = fTCP0[1]; + float fQ2241_10 = fTCP0[2]; + float fQ2242_11 = fTCP0[2] * fTCP0[2]; + float fQ2242_01 = fTCP0[2]; + float fQ2242_10 = fTCP0[2]; + float fQ2243_11 = fTCP0[2] * fTCP0[3]; + float fQ2243_01 = fTCP0[3]; + float fQ2243_10 = fTCP0[2]; + float fQ2244_11 = fTCP0[2] * fTCP0[4]; + float fQ2244_01 = fTCP0[4]; + float fQ2244_10 = fTCP0[2]; + float fQ2141_11 = fTCP0[1] * fTCP0[1]; + float fQ2141_01 = fTCP0[1]; + float fQ2141_10 = fTCP0[1]; + float fQ2142_11 = fTCP0[1] * fTCP0[2]; + float fQ2142_01 = fTCP0[2]; + float fQ2142_10 = fTCP0[1]; + float fQ2143_11 = fTCP0[1] * fTCP0[3]; + float fQ2143_01 = fTCP0[3]; + float fQ2143_10 = fTCP0[1]; + float fQ2144_11 = fTCP0[1] * fTCP0[4]; + float fQ2144_01 = fTCP0[4]; + float fQ2144_10 = fTCP0[1]; + float fQ1151_11 = fTCP1[1] * fTCP1[1]; + float fQ1151_01 = fTCP1[1]; + float fQ1151_10 = fTCP1[1]; + float fQ1152_11 = fTCP1[1] * fTCP1[2]; + float fQ1152_01 = fTCP1[2]; + float fQ1152_10 = fTCP1[1]; + float fQ1153_11 = fTCP1[1] * fTCP1[3]; + float fQ1153_01 = fTCP1[3]; + float fQ1153_10 = fTCP1[1]; + float fQ1154_11 = fTCP1[1] * fTCP1[4]; + float fQ1154_01 = fTCP1[4]; + float fQ1154_10 = fTCP1[1]; + float fQ1155_11 = fTCP1[1] * fTCP1[5]; + float fQ1155_01 = fTCP1[5]; + float fQ1155_10 = fTCP1[1]; + + float fQ112233_001 = fTCP1[3]; + float fQ112233_010 = fTCP0[2]; + float fQ112233_100 = fTCP1[1]; + float fQ112233_011 = fTCP0[2] * fTCP1[3]; + float fQ112233_101 = fTCP1[1] * fTCP1[3]; + float fQ112233_110 = fTCP1[1] * fTCP0[2]; + float fQ112232_001 = fTCP1[2]; + float fQ112232_010 = fTCP0[2]; + float fQ112232_100 = fTCP1[1]; + float fQ112232_011 = fTCP0[2] * fTCP1[2]; + float fQ112232_101 = fTCP1[1] * fTCP1[2]; + float fQ112232_110 = fTCP1[1] * fTCP0[2]; + // + float fQ112231_001 = fTCP1[1]; + float fQ112231_010 = fTCP0[2]; + float fQ112231_100 = fTCP1[1]; + float fQ112231_011 = fTCP0[2] * fTCP1[1]; + float fQ112231_101 = fTCP1[1] * fTCP1[1]; + float fQ112231_110 = fTCP1[1] * fTCP0[2]; + float fQ112133_001 = fTCP1[3]; + float fQ112133_010 = fTCP0[1]; + float fQ112133_100 = fTCP1[1]; + float fQ112133_011 = fTCP0[1] * fTCP1[3]; + float fQ112133_101 = fTCP1[1] * fTCP1[3]; + float fQ112133_110 = fTCP1[1] * fTCP0[1]; + + float fQ112132_001 = fTCP1[2]; + float fQ112132_010 = fTCP0[1]; + float fQ112132_100 = fTCP1[1]; + float fQ112132_011 = fTCP0[1] * fTCP1[2]; + float fQ112132_101 = fTCP1[1] * fTCP1[2]; + float fQ112132_110 = fTCP1[1] * fTCP0[1]; + float fQ112131_001 = fTCP1[1]; + float fQ112131_010 = fTCP0[1]; + float fQ112131_100 = fTCP1[1]; + float fQ112131_011 = fTCP0[1] * fTCP1[1]; + float fQ112131_101 = fTCP1[1] * fTCP1[1]; + float fQ112131_110 = fTCP1[1] * fTCP0[1]; + + float fQ2221_11 = fTCP0[2] * fTCP0[1]; + float fQ2221_01 = fTCP0[1]; + float fQ2221_10 = fTCP0[2]; + float fQ2221_21 = std::pow(fTCP0[2], 2) * fTCP0[1]; + float fQ2221_20 = std::pow(fTCP0[2], 2); + + float fQ2122_21 = std::pow(fTCP0[1], 2) * fTCP0[2]; + float fQ2122_20 = std::pow(fTCP0[1], 2); + float fQ1121_02 = std::pow(fTCP0[1], 2); + float fQ1121_12 = fTCP1[1] * std::pow(fTCP0[1], 2); + float fQ1121_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[1], 2); + float fQ1122_02 = std::pow(fTCP0[2], 2); + float fQ1122_12 = fTCP1[1] * std::pow(fTCP0[2], 2); + float fQ1122_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[2], 2); + + float fQ112221_001 = fTCP0[1]; + float fQ112221_010 = fTCP0[2]; + float fQ112221_100 = fTCP1[1]; + float fQ112221_011 = fTCP0[2] * fTCP0[1]; + float fQ112221_101 = fTCP1[1] * fTCP0[1]; + float fQ112221_110 = fTCP1[1] * fTCP0[2]; + float fQ112221_200 = std::pow(fTCP1[1], 2); + float fQ112221_201 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ112221_210 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ112221_211 = std::pow(fTCP1[1], 2) * fTCP0[2] * fTCP0[1]; + float fQ1131_21 = std::pow(fTCP1[1], 2) * fTCP1[1]; + float fQ1131_20 = std::pow(fTCP1[1], 2); + float fQ1131_31 = std::pow(fTCP1[1], 3) * fTCP1[1]; + float fQ1131_30 = std::pow(fTCP1[1], 3); + + float fQ1132_21 = std::pow(fTCP1[1], 2) * fTCP1[2]; + float fQ1132_20 = std::pow(fTCP1[1], 2); + float fQ1132_31 = std::pow(fTCP1[1], 3) * fTCP1[2]; + float fQ1132_30 = std::pow(fTCP1[1], 3); + float fQ1133_21 = std::pow(fTCP1[1], 2) * fTCP1[3]; + float fQ1133_20 = std::pow(fTCP1[1], 2); + float fQ1133_31 = std::pow(fTCP1[1], 3) * fTCP1[3]; + float fQ1133_30 = std::pow(fTCP1[1], 3); + float fQ1121_30 = std::pow(fTCP1[1], 3); + float fQ1121_31 = std::pow(fTCP1[1], 3) * fTCP0[1]; + float fQ1121_40 = std::pow(fTCP1[1], 4); + float fQ1121_41 = std::pow(fTCP1[1], 4) * fTCP0[1]; + float fQ1122_30 = std::pow(fTCP1[1], 3); + float fQ1122_31 = std::pow(fTCP1[1], 3) * fTCP0[2]; + float fQ1122_40 = std::pow(fTCP1[1], 4); + float fQ1122_41 = std::pow(fTCP1[1], 4) * fTCP0[2]; + + float fQ2211_11 = fTCP0[2] * fTCP1[1]; + float fQ2211_01 = fTCP1[1]; + float fQ2211_10 = fTCP0[2]; + float fQ2211_20 = std::pow(fTCP0[2], 2); + float fQ2211_21 = std::pow(fTCP0[2], 2) * fTCP1[1]; + float fQ2111_11 = fTCP0[1] * fTCP1[1]; + float fQ2111_01 = fTCP1[1]; + float fQ2111_10 = fTCP0[1]; + float fQ2111_20 = std::pow(fTCP0[1], 2); + float fQ2111_21 = std::pow(fTCP0[1], 2) * fTCP1[1]; + + float fQ112122_001 = fTCP0[2]; + float fQ112122_010 = fTCP0[1]; + float fQ112122_100 = fTCP1[1]; + float fQ112122_011 = fTCP0[1] * fTCP0[2]; + float fQ112122_101 = fTCP1[1] * fTCP0[2]; + float fQ112122_110 = fTCP1[1] * fTCP0[1]; + + float fQ1141_11 = fTCP1[1] * fTCP0[1]; + float fQ1141_01 = fTCP0[1]; + float fQ1141_10 = fTCP1[1]; + float fQ1141_20 = std::pow(fTCP1[1], 2); + float fQ1141_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1142_11 = fTCP1[1] * fTCP0[2]; + float fQ1142_01 = fTCP0[2]; + float fQ1142_10 = fTCP1[1]; + float fQ1142_20 = std::pow(fTCP1[1], 2); + float fQ1142_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + + float fQ1143_11 = fTCP1[1] * fTCP0[3]; + float fQ1143_01 = fTCP0[3]; + float fQ1143_10 = fTCP1[1]; + float fQ1143_20 = std::pow(fTCP1[1], 2); + float fQ1143_21 = std::pow(fTCP1[1], 2) * fTCP0[3]; + float fQ1144_11 = fTCP1[1] * fTCP0[4]; + float fQ1144_01 = fTCP0[4]; + float fQ1144_10 = fTCP1[1]; + float fQ1144_20 = std::pow(fTCP1[1], 2); + float fQ1144_21 = std::pow(fTCP1[1], 2) * fTCP0[4]; + float fQ2131_11 = fTCP0[1] * fTCP1[1]; + float fQ2131_01 = fTCP1[1]; + float fQ2131_10 = fTCP0[1]; + + float fQ2132_11 = fTCP0[1] * fTCP1[2]; + float fQ2132_01 = fTCP1[2]; + float fQ2132_10 = fTCP0[1]; + float fQ2133_11 = fTCP0[1] * fTCP1[3]; + float fQ2133_01 = fTCP1[3]; + float fQ2133_10 = fTCP0[1]; + float fQ2231_11 = fTCP0[2] * fTCP1[1]; + float fQ2231_01 = fTCP1[1]; + float fQ2231_10 = fTCP0[2]; + float fQ2232_11 = fTCP0[2] * fTCP1[2]; + float fQ2232_01 = fTCP1[2]; + float fQ2232_10 = fTCP0[2]; + float fQ2233_11 = fTCP0[2] * fTCP1[3]; + float fQ2233_01 = fTCP1[3]; + float fQ2233_10 = fTCP0[2]; + + float fQ51_1 = fTCP1[1]; + float fQ52_1 = fTCP1[2]; + float fQ53_1 = fTCP1[3]; + float fQ54_1 = fTCP1[4]; + float fQ55_1 = fTCP1[5]; + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + if (cfgIsCalculateCentral) { + + // uncorrected + histos.get(HIST("Prof_mu1_netproton"))->Fill(cent, std::pow(netProt, 1.0)); + histos.get(HIST("Prof_mu2_netproton"))->Fill(cent, std::pow(netProt, 2.0)); + histos.get(HIST("Prof_mu3_netproton"))->Fill(cent, std::pow(netProt, 3.0)); + histos.get(HIST("Prof_mu4_netproton"))->Fill(cent, std::pow(netProt, 4.0)); + histos.get(HIST("Prof_mu5_netproton"))->Fill(cent, std::pow(netProt, 5.0)); + histos.get(HIST("Prof_mu6_netproton"))->Fill(cent, std::pow(netProt, 6.0)); + histos.get(HIST("Prof_mu7_netproton"))->Fill(cent, std::pow(netProt, 7.0)); + histos.get(HIST("Prof_mu8_netproton"))->Fill(cent, std::pow(netProt, 8.0)); + + // eff. corrected + histos.get(HIST("Prof_Q11_1"))->Fill(cent, fQ11_1); + histos.get(HIST("Prof_Q11_2"))->Fill(cent, fQ11_2); + histos.get(HIST("Prof_Q11_3"))->Fill(cent, fQ11_3); + histos.get(HIST("Prof_Q11_4"))->Fill(cent, fQ11_4); + histos.get(HIST("Prof_Q21_1"))->Fill(cent, fQ21_1); + histos.get(HIST("Prof_Q22_1"))->Fill(cent, fQ22_1); + histos.get(HIST("Prof_Q31_1"))->Fill(cent, fQ31_1); + histos.get(HIST("Prof_Q32_1"))->Fill(cent, fQ32_1); + histos.get(HIST("Prof_Q33_1"))->Fill(cent, fQ33_1); + histos.get(HIST("Prof_Q41_1"))->Fill(cent, fQ41_1); + histos.get(HIST("Prof_Q42_1"))->Fill(cent, fQ42_1); + histos.get(HIST("Prof_Q43_1"))->Fill(cent, fQ43_1); + histos.get(HIST("Prof_Q44_1"))->Fill(cent, fQ44_1); + histos.get(HIST("Prof_Q21_2"))->Fill(cent, fQ21_2); + histos.get(HIST("Prof_Q22_2"))->Fill(cent, fQ22_2); + histos.get(HIST("Prof_Q1121_11"))->Fill(cent, fQ1121_11); + histos.get(HIST("Prof_Q1121_01"))->Fill(cent, fQ1121_01); + histos.get(HIST("Prof_Q1121_10"))->Fill(cent, fQ1121_10); + histos.get(HIST("Prof_Q1121_20"))->Fill(cent, fQ1121_20); + histos.get(HIST("Prof_Q1121_21"))->Fill(cent, fQ1121_21); + histos.get(HIST("Prof_Q1122_11"))->Fill(cent, fQ1122_11); + histos.get(HIST("Prof_Q1122_01"))->Fill(cent, fQ1122_01); + histos.get(HIST("Prof_Q1122_10"))->Fill(cent, fQ1122_10); + histos.get(HIST("Prof_Q1122_20"))->Fill(cent, fQ1122_20); + histos.get(HIST("Prof_Q1122_21"))->Fill(cent, fQ1122_21); + histos.get(HIST("Prof_Q1131_11"))->Fill(cent, fQ1131_11); + histos.get(HIST("Prof_Q1131_01"))->Fill(cent, fQ1131_01); + histos.get(HIST("Prof_Q1131_10"))->Fill(cent, fQ1131_10); + histos.get(HIST("Prof_Q1132_11"))->Fill(cent, fQ1132_11); + histos.get(HIST("Prof_Q1132_01"))->Fill(cent, fQ1132_01); + histos.get(HIST("Prof_Q1132_10"))->Fill(cent, fQ1132_10); + histos.get(HIST("Prof_Q1133_11"))->Fill(cent, fQ1133_11); + histos.get(HIST("Prof_Q1133_01"))->Fill(cent, fQ1133_01); + histos.get(HIST("Prof_Q1133_10"))->Fill(cent, fQ1133_10); + histos.get(HIST("Prof_Q2122_11"))->Fill(cent, fQ2122_11); + histos.get(HIST("Prof_Q2122_01"))->Fill(cent, fQ2122_01); + histos.get(HIST("Prof_Q2122_10"))->Fill(cent, fQ2122_10); + histos.get(HIST("Prof_Q3132_11"))->Fill(cent, fQ3132_11); + histos.get(HIST("Prof_Q3132_01"))->Fill(cent, fQ3132_01); + histos.get(HIST("Prof_Q3132_10"))->Fill(cent, fQ3132_10); + histos.get(HIST("Prof_Q3133_11"))->Fill(cent, fQ3133_11); + histos.get(HIST("Prof_Q3133_01"))->Fill(cent, fQ3133_01); + histos.get(HIST("Prof_Q3133_10"))->Fill(cent, fQ3133_10); + histos.get(HIST("Prof_Q3233_11"))->Fill(cent, fQ3233_11); + histos.get(HIST("Prof_Q3233_01"))->Fill(cent, fQ3233_01); + histos.get(HIST("Prof_Q3233_10"))->Fill(cent, fQ3233_10); + histos.get(HIST("Prof_Q2241_11"))->Fill(cent, fQ2241_11); + histos.get(HIST("Prof_Q2241_01"))->Fill(cent, fQ2241_01); + histos.get(HIST("Prof_Q2241_10"))->Fill(cent, fQ2241_10); + histos.get(HIST("Prof_Q2242_11"))->Fill(cent, fQ2242_11); + histos.get(HIST("Prof_Q2242_01"))->Fill(cent, fQ2242_01); + histos.get(HIST("Prof_Q2242_10"))->Fill(cent, fQ2242_10); + histos.get(HIST("Prof_Q2243_11"))->Fill(cent, fQ2243_11); + histos.get(HIST("Prof_Q2243_01"))->Fill(cent, fQ2243_01); + histos.get(HIST("Prof_Q2243_10"))->Fill(cent, fQ2243_10); + histos.get(HIST("Prof_Q2244_11"))->Fill(cent, fQ2244_11); + histos.get(HIST("Prof_Q2244_01"))->Fill(cent, fQ2244_01); + histos.get(HIST("Prof_Q2244_10"))->Fill(cent, fQ2244_10); + histos.get(HIST("Prof_Q2141_11"))->Fill(cent, fQ2141_11); + histos.get(HIST("Prof_Q2141_01"))->Fill(cent, fQ2141_01); + histos.get(HIST("Prof_Q2141_10"))->Fill(cent, fQ2141_10); + histos.get(HIST("Prof_Q2142_11"))->Fill(cent, fQ2142_11); + histos.get(HIST("Prof_Q2142_01"))->Fill(cent, fQ2142_01); + histos.get(HIST("Prof_Q2142_10"))->Fill(cent, fQ2142_10); + histos.get(HIST("Prof_Q2143_11"))->Fill(cent, fQ2143_11); + histos.get(HIST("Prof_Q2143_01"))->Fill(cent, fQ2143_01); + histos.get(HIST("Prof_Q2143_10"))->Fill(cent, fQ2143_10); + histos.get(HIST("Prof_Q2144_11"))->Fill(cent, fQ2144_11); + histos.get(HIST("Prof_Q2144_01"))->Fill(cent, fQ2144_01); + histos.get(HIST("Prof_Q2144_10"))->Fill(cent, fQ2144_10); + histos.get(HIST("Prof_Q1151_11"))->Fill(cent, fQ1151_11); + histos.get(HIST("Prof_Q1151_01"))->Fill(cent, fQ1151_01); + histos.get(HIST("Prof_Q1151_10"))->Fill(cent, fQ1151_10); + histos.get(HIST("Prof_Q1152_11"))->Fill(cent, fQ1152_11); + histos.get(HIST("Prof_Q1152_01"))->Fill(cent, fQ1152_01); + histos.get(HIST("Prof_Q1152_10"))->Fill(cent, fQ1152_10); + histos.get(HIST("Prof_Q1153_11"))->Fill(cent, fQ1153_11); + histos.get(HIST("Prof_Q1153_01"))->Fill(cent, fQ1153_01); + histos.get(HIST("Prof_Q1153_10"))->Fill(cent, fQ1153_10); + histos.get(HIST("Prof_Q1154_11"))->Fill(cent, fQ1154_11); + histos.get(HIST("Prof_Q1154_01"))->Fill(cent, fQ1154_01); + histos.get(HIST("Prof_Q1154_10"))->Fill(cent, fQ1154_10); + histos.get(HIST("Prof_Q1155_11"))->Fill(cent, fQ1155_11); + histos.get(HIST("Prof_Q1155_01"))->Fill(cent, fQ1155_01); + histos.get(HIST("Prof_Q1155_10"))->Fill(cent, fQ1155_10); + histos.get(HIST("Prof_Q112233_001"))->Fill(cent, fQ112233_001); + histos.get(HIST("Prof_Q112233_010"))->Fill(cent, fQ112233_010); + histos.get(HIST("Prof_Q112233_100"))->Fill(cent, fQ112233_100); + histos.get(HIST("Prof_Q112233_011"))->Fill(cent, fQ112233_011); + histos.get(HIST("Prof_Q112233_101"))->Fill(cent, fQ112233_101); + histos.get(HIST("Prof_Q112233_110"))->Fill(cent, fQ112233_110); + histos.get(HIST("Prof_Q112232_001"))->Fill(cent, fQ112232_001); + histos.get(HIST("Prof_Q112232_010"))->Fill(cent, fQ112232_010); + histos.get(HIST("Prof_Q112232_100"))->Fill(cent, fQ112232_100); + histos.get(HIST("Prof_Q112232_011"))->Fill(cent, fQ112232_011); + histos.get(HIST("Prof_Q112232_101"))->Fill(cent, fQ112232_101); + histos.get(HIST("Prof_Q112232_110"))->Fill(cent, fQ112232_110); + histos.get(HIST("Prof_Q112231_001"))->Fill(cent, fQ112231_001); + histos.get(HIST("Prof_Q112231_010"))->Fill(cent, fQ112231_010); + histos.get(HIST("Prof_Q112231_100"))->Fill(cent, fQ112231_100); + histos.get(HIST("Prof_Q112231_011"))->Fill(cent, fQ112231_011); + histos.get(HIST("Prof_Q112231_101"))->Fill(cent, fQ112231_101); + histos.get(HIST("Prof_Q112231_110"))->Fill(cent, fQ112231_110); + histos.get(HIST("Prof_Q112133_001"))->Fill(cent, fQ112133_001); + histos.get(HIST("Prof_Q112133_010"))->Fill(cent, fQ112133_010); + histos.get(HIST("Prof_Q112133_100"))->Fill(cent, fQ112133_100); + histos.get(HIST("Prof_Q112133_011"))->Fill(cent, fQ112133_011); + histos.get(HIST("Prof_Q112133_101"))->Fill(cent, fQ112133_101); + histos.get(HIST("Prof_Q112133_110"))->Fill(cent, fQ112133_110); + histos.get(HIST("Prof_Q112132_001"))->Fill(cent, fQ112132_001); + histos.get(HIST("Prof_Q112132_010"))->Fill(cent, fQ112132_010); + histos.get(HIST("Prof_Q112132_100"))->Fill(cent, fQ112132_100); + histos.get(HIST("Prof_Q112132_011"))->Fill(cent, fQ112132_011); + histos.get(HIST("Prof_Q112132_101"))->Fill(cent, fQ112132_101); + histos.get(HIST("Prof_Q112132_110"))->Fill(cent, fQ112132_110); + histos.get(HIST("Prof_Q112131_001"))->Fill(cent, fQ112131_001); + histos.get(HIST("Prof_Q112131_010"))->Fill(cent, fQ112131_010); + histos.get(HIST("Prof_Q112131_100"))->Fill(cent, fQ112131_100); + histos.get(HIST("Prof_Q112131_011"))->Fill(cent, fQ112131_011); + histos.get(HIST("Prof_Q112131_101"))->Fill(cent, fQ112131_101); + histos.get(HIST("Prof_Q112131_110"))->Fill(cent, fQ112131_110); + histos.get(HIST("Prof_Q2221_11"))->Fill(cent, fQ2221_11); + histos.get(HIST("Prof_Q2221_01"))->Fill(cent, fQ2221_01); + histos.get(HIST("Prof_Q2221_10"))->Fill(cent, fQ2221_10); + histos.get(HIST("Prof_Q2221_21"))->Fill(cent, fQ2221_21); + histos.get(HIST("Prof_Q2221_20"))->Fill(cent, fQ2221_20); + histos.get(HIST("Prof_Q2122_21"))->Fill(cent, fQ2122_21); + histos.get(HIST("Prof_Q2122_20"))->Fill(cent, fQ2122_20); + histos.get(HIST("Prof_Q1121_02"))->Fill(cent, fQ1121_02); + histos.get(HIST("Prof_Q1121_12"))->Fill(cent, fQ1121_12); + histos.get(HIST("Prof_Q1121_22"))->Fill(cent, fQ1121_22); + histos.get(HIST("Prof_Q1122_02"))->Fill(cent, fQ1122_02); + histos.get(HIST("Prof_Q1122_12"))->Fill(cent, fQ1122_12); + histos.get(HIST("Prof_Q1122_22"))->Fill(cent, fQ1122_22); + histos.get(HIST("Prof_Q112221_001"))->Fill(cent, fQ112221_001); + histos.get(HIST("Prof_Q112221_010"))->Fill(cent, fQ112221_010); + histos.get(HIST("Prof_Q112221_100"))->Fill(cent, fQ112221_100); + histos.get(HIST("Prof_Q112221_011"))->Fill(cent, fQ112221_011); + histos.get(HIST("Prof_Q112221_101"))->Fill(cent, fQ112221_101); + histos.get(HIST("Prof_Q112221_110"))->Fill(cent, fQ112221_110); + histos.get(HIST("Prof_Q112221_200"))->Fill(cent, fQ112221_200); + histos.get(HIST("Prof_Q112221_201"))->Fill(cent, fQ112221_201); + histos.get(HIST("Prof_Q112221_210"))->Fill(cent, fQ112221_210); + histos.get(HIST("Prof_Q112221_211"))->Fill(cent, fQ112221_211); + histos.get(HIST("Prof_Q1131_21"))->Fill(cent, fQ1131_21); + histos.get(HIST("Prof_Q1131_20"))->Fill(cent, fQ1131_20); + histos.get(HIST("Prof_Q1131_31"))->Fill(cent, fQ1131_31); + histos.get(HIST("Prof_Q1131_30"))->Fill(cent, fQ1131_30); + histos.get(HIST("Prof_Q1132_21"))->Fill(cent, fQ1132_21); + histos.get(HIST("Prof_Q1132_20"))->Fill(cent, fQ1132_20); + histos.get(HIST("Prof_Q1132_31"))->Fill(cent, fQ1132_31); + histos.get(HIST("Prof_Q1132_30"))->Fill(cent, fQ1132_30); + histos.get(HIST("Prof_Q1133_21"))->Fill(cent, fQ1133_21); + histos.get(HIST("Prof_Q1133_20"))->Fill(cent, fQ1133_20); + histos.get(HIST("Prof_Q1133_31"))->Fill(cent, fQ1133_31); + histos.get(HIST("Prof_Q1133_30"))->Fill(cent, fQ1133_30); + histos.get(HIST("Prof_Q11_5"))->Fill(cent, fQ11_5); + histos.get(HIST("Prof_Q11_6"))->Fill(cent, fQ11_6); + histos.get(HIST("Prof_Q1121_30"))->Fill(cent, fQ1121_30); + histos.get(HIST("Prof_Q1121_31"))->Fill(cent, fQ1121_31); + histos.get(HIST("Prof_Q1121_40"))->Fill(cent, fQ1121_40); + histos.get(HIST("Prof_Q1121_41"))->Fill(cent, fQ1121_41); + histos.get(HIST("Prof_Q1122_30"))->Fill(cent, fQ1122_30); + histos.get(HIST("Prof_Q1122_31"))->Fill(cent, fQ1122_31); + histos.get(HIST("Prof_Q1122_40"))->Fill(cent, fQ1122_40); + histos.get(HIST("Prof_Q1122_41"))->Fill(cent, fQ1122_41); + histos.get(HIST("Prof_Q2211_11"))->Fill(cent, fQ2211_11); + histos.get(HIST("Prof_Q2211_01"))->Fill(cent, fQ2211_01); + histos.get(HIST("Prof_Q2211_10"))->Fill(cent, fQ2211_10); + histos.get(HIST("Prof_Q2211_20"))->Fill(cent, fQ2211_20); + histos.get(HIST("Prof_Q2211_21"))->Fill(cent, fQ2211_21); + histos.get(HIST("Prof_Q2111_11"))->Fill(cent, fQ2111_11); + histos.get(HIST("Prof_Q2111_01"))->Fill(cent, fQ2111_01); + histos.get(HIST("Prof_Q2111_10"))->Fill(cent, fQ2111_10); + histos.get(HIST("Prof_Q2111_20"))->Fill(cent, fQ2111_20); + histos.get(HIST("Prof_Q2111_21"))->Fill(cent, fQ2111_21); + histos.get(HIST("Prof_Q112122_001"))->Fill(cent, fQ112122_001); + histos.get(HIST("Prof_Q112122_010"))->Fill(cent, fQ112122_010); + histos.get(HIST("Prof_Q112122_100"))->Fill(cent, fQ112122_100); + histos.get(HIST("Prof_Q112122_011"))->Fill(cent, fQ112122_011); + histos.get(HIST("Prof_Q112122_101"))->Fill(cent, fQ112122_101); + histos.get(HIST("Prof_Q112122_110"))->Fill(cent, fQ112122_110); + histos.get(HIST("Prof_Q1141_11"))->Fill(cent, fQ1141_11); + histos.get(HIST("Prof_Q1141_01"))->Fill(cent, fQ1141_01); + histos.get(HIST("Prof_Q1141_10"))->Fill(cent, fQ1141_10); + histos.get(HIST("Prof_Q1141_20"))->Fill(cent, fQ1141_20); + histos.get(HIST("Prof_Q1141_21"))->Fill(cent, fQ1141_21); + histos.get(HIST("Prof_Q1142_11"))->Fill(cent, fQ1142_11); + histos.get(HIST("Prof_Q1142_01"))->Fill(cent, fQ1142_01); + histos.get(HIST("Prof_Q1142_10"))->Fill(cent, fQ1142_10); + histos.get(HIST("Prof_Q1142_20"))->Fill(cent, fQ1142_20); + histos.get(HIST("Prof_Q1142_21"))->Fill(cent, fQ1142_21); + histos.get(HIST("Prof_Q1143_11"))->Fill(cent, fQ1143_11); + histos.get(HIST("Prof_Q1143_01"))->Fill(cent, fQ1143_01); + histos.get(HIST("Prof_Q1143_10"))->Fill(cent, fQ1143_10); + histos.get(HIST("Prof_Q1143_20"))->Fill(cent, fQ1143_20); + histos.get(HIST("Prof_Q1143_21"))->Fill(cent, fQ1143_21); + histos.get(HIST("Prof_Q1144_11"))->Fill(cent, fQ1144_11); + histos.get(HIST("Prof_Q1144_01"))->Fill(cent, fQ1144_01); + histos.get(HIST("Prof_Q1144_10"))->Fill(cent, fQ1144_10); + histos.get(HIST("Prof_Q1144_20"))->Fill(cent, fQ1144_20); + histos.get(HIST("Prof_Q1144_21"))->Fill(cent, fQ1144_21); + histos.get(HIST("Prof_Q2131_11"))->Fill(cent, fQ2131_11); + histos.get(HIST("Prof_Q2131_01"))->Fill(cent, fQ2131_01); + histos.get(HIST("Prof_Q2131_10"))->Fill(cent, fQ2131_10); + histos.get(HIST("Prof_Q2132_11"))->Fill(cent, fQ2132_11); + histos.get(HIST("Prof_Q2132_01"))->Fill(cent, fQ2132_01); + histos.get(HIST("Prof_Q2132_10"))->Fill(cent, fQ2132_10); + histos.get(HIST("Prof_Q2133_11"))->Fill(cent, fQ2133_11); + histos.get(HIST("Prof_Q2133_01"))->Fill(cent, fQ2133_01); + histos.get(HIST("Prof_Q2133_10"))->Fill(cent, fQ2133_10); + histos.get(HIST("Prof_Q2231_11"))->Fill(cent, fQ2231_11); + histos.get(HIST("Prof_Q2231_01"))->Fill(cent, fQ2231_01); + histos.get(HIST("Prof_Q2231_10"))->Fill(cent, fQ2231_10); + histos.get(HIST("Prof_Q2232_11"))->Fill(cent, fQ2232_11); + histos.get(HIST("Prof_Q2232_01"))->Fill(cent, fQ2232_01); + histos.get(HIST("Prof_Q2232_10"))->Fill(cent, fQ2232_10); + histos.get(HIST("Prof_Q2233_11"))->Fill(cent, fQ2233_11); + histos.get(HIST("Prof_Q2233_01"))->Fill(cent, fQ2233_01); + histos.get(HIST("Prof_Q2233_10"))->Fill(cent, fQ2233_10); + histos.get(HIST("Prof_Q51_1"))->Fill(cent, fQ51_1); + histos.get(HIST("Prof_Q52_1"))->Fill(cent, fQ52_1); + histos.get(HIST("Prof_Q53_1"))->Fill(cent, fQ53_1); + histos.get(HIST("Prof_Q54_1"))->Fill(cent, fQ54_1); + histos.get(HIST("Prof_Q55_1"))->Fill(cent, fQ55_1); + histos.get(HIST("Prof_Q21_3"))->Fill(cent, fQ21_3); + histos.get(HIST("Prof_Q22_3"))->Fill(cent, fQ22_3); + histos.get(HIST("Prof_Q31_2"))->Fill(cent, fQ31_2); + histos.get(HIST("Prof_Q32_2"))->Fill(cent, fQ32_2); + histos.get(HIST("Prof_Q33_2"))->Fill(cent, fQ33_2); + histos.get(HIST("Prof_Q61_1"))->Fill(cent, fQ61_1); + histos.get(HIST("Prof_Q62_1"))->Fill(cent, fQ62_1); + histos.get(HIST("Prof_Q63_1"))->Fill(cent, fQ63_1); + histos.get(HIST("Prof_Q64_1"))->Fill(cent, fQ64_1); + histos.get(HIST("Prof_Q65_1"))->Fill(cent, fQ65_1); + histos.get(HIST("Prof_Q66_1"))->Fill(cent, fQ66_1); + histos.get(HIST("Prof_Q112122_111"))->Fill(cent, fQ112122_111); + histos.get(HIST("Prof_Q112131_111"))->Fill(cent, fQ112131_111); + histos.get(HIST("Prof_Q112132_111"))->Fill(cent, fQ112132_111); + histos.get(HIST("Prof_Q112133_111"))->Fill(cent, fQ112133_111); + histos.get(HIST("Prof_Q112231_111"))->Fill(cent, fQ112231_111); + histos.get(HIST("Prof_Q112232_111"))->Fill(cent, fQ112232_111); + histos.get(HIST("Prof_Q112233_111"))->Fill(cent, fQ112233_111); + histos.get(HIST("Prof_Q112221_111"))->Fill(cent, fQ112221_111); + } + + if (cfgIsCalculateError) { + // selecting subsample and filling profiles + float lRandom = fRndm->Rndm(); + int sampleIndex = static_cast(cfgNSubsample * lRandom); + + histos.get(HIST("Prof2D_mu1_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 1.0)); + histos.get(HIST("Prof2D_mu2_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 2.0)); + histos.get(HIST("Prof2D_mu3_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 3.0)); + histos.get(HIST("Prof2D_mu4_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 4.0)); + histos.get(HIST("Prof2D_mu5_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 5.0)); + histos.get(HIST("Prof2D_mu6_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 6.0)); + histos.get(HIST("Prof2D_mu7_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 7.0)); + histos.get(HIST("Prof2D_mu8_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 8.0)); + + histos.get(HIST("Prof2D_Q11_1"))->Fill(cent, sampleIndex, fQ11_1); + histos.get(HIST("Prof2D_Q11_2"))->Fill(cent, sampleIndex, fQ11_2); + histos.get(HIST("Prof2D_Q11_3"))->Fill(cent, sampleIndex, fQ11_3); + histos.get(HIST("Prof2D_Q11_4"))->Fill(cent, sampleIndex, fQ11_4); + histos.get(HIST("Prof2D_Q21_1"))->Fill(cent, sampleIndex, fQ21_1); + histos.get(HIST("Prof2D_Q22_1"))->Fill(cent, sampleIndex, fQ22_1); + histos.get(HIST("Prof2D_Q31_1"))->Fill(cent, sampleIndex, fQ31_1); + histos.get(HIST("Prof2D_Q32_1"))->Fill(cent, sampleIndex, fQ32_1); + histos.get(HIST("Prof2D_Q33_1"))->Fill(cent, sampleIndex, fQ33_1); + histos.get(HIST("Prof2D_Q41_1"))->Fill(cent, sampleIndex, fQ41_1); + histos.get(HIST("Prof2D_Q42_1"))->Fill(cent, sampleIndex, fQ42_1); + histos.get(HIST("Prof2D_Q43_1"))->Fill(cent, sampleIndex, fQ43_1); + histos.get(HIST("Prof2D_Q44_1"))->Fill(cent, sampleIndex, fQ44_1); + histos.get(HIST("Prof2D_Q21_2"))->Fill(cent, sampleIndex, fQ21_2); + histos.get(HIST("Prof2D_Q22_2"))->Fill(cent, sampleIndex, fQ22_2); + histos.get(HIST("Prof2D_Q1121_11"))->Fill(cent, sampleIndex, fQ1121_11); + histos.get(HIST("Prof2D_Q1121_01"))->Fill(cent, sampleIndex, fQ1121_01); + histos.get(HIST("Prof2D_Q1121_10"))->Fill(cent, sampleIndex, fQ1121_10); + histos.get(HIST("Prof2D_Q1121_20"))->Fill(cent, sampleIndex, fQ1121_20); + histos.get(HIST("Prof2D_Q1121_21"))->Fill(cent, sampleIndex, fQ1121_21); + histos.get(HIST("Prof2D_Q1122_11"))->Fill(cent, sampleIndex, fQ1122_11); + histos.get(HIST("Prof2D_Q1122_01"))->Fill(cent, sampleIndex, fQ1122_01); + histos.get(HIST("Prof2D_Q1122_10"))->Fill(cent, sampleIndex, fQ1122_10); + histos.get(HIST("Prof2D_Q1122_20"))->Fill(cent, sampleIndex, fQ1122_20); + histos.get(HIST("Prof2D_Q1122_21"))->Fill(cent, sampleIndex, fQ1122_21); + histos.get(HIST("Prof2D_Q1131_11"))->Fill(cent, sampleIndex, fQ1131_11); + histos.get(HIST("Prof2D_Q1131_01"))->Fill(cent, sampleIndex, fQ1131_01); + histos.get(HIST("Prof2D_Q1131_10"))->Fill(cent, sampleIndex, fQ1131_10); + histos.get(HIST("Prof2D_Q1132_11"))->Fill(cent, sampleIndex, fQ1132_11); + histos.get(HIST("Prof2D_Q1132_01"))->Fill(cent, sampleIndex, fQ1132_01); + histos.get(HIST("Prof2D_Q1132_10"))->Fill(cent, sampleIndex, fQ1132_10); + histos.get(HIST("Prof2D_Q1133_11"))->Fill(cent, sampleIndex, fQ1133_11); + histos.get(HIST("Prof2D_Q1133_01"))->Fill(cent, sampleIndex, fQ1133_01); + histos.get(HIST("Prof2D_Q1133_10"))->Fill(cent, sampleIndex, fQ1133_10); + histos.get(HIST("Prof2D_Q2122_11"))->Fill(cent, sampleIndex, fQ2122_11); + histos.get(HIST("Prof2D_Q2122_01"))->Fill(cent, sampleIndex, fQ2122_01); + histos.get(HIST("Prof2D_Q2122_10"))->Fill(cent, sampleIndex, fQ2122_10); + histos.get(HIST("Prof2D_Q3132_11"))->Fill(cent, sampleIndex, fQ3132_11); + histos.get(HIST("Prof2D_Q3132_01"))->Fill(cent, sampleIndex, fQ3132_01); + histos.get(HIST("Prof2D_Q3132_10"))->Fill(cent, sampleIndex, fQ3132_10); + histos.get(HIST("Prof2D_Q3133_11"))->Fill(cent, sampleIndex, fQ3133_11); + histos.get(HIST("Prof2D_Q3133_01"))->Fill(cent, sampleIndex, fQ3133_01); + histos.get(HIST("Prof2D_Q3133_10"))->Fill(cent, sampleIndex, fQ3133_10); + histos.get(HIST("Prof2D_Q3233_11"))->Fill(cent, sampleIndex, fQ3233_11); + histos.get(HIST("Prof2D_Q3233_01"))->Fill(cent, sampleIndex, fQ3233_01); + histos.get(HIST("Prof2D_Q3233_10"))->Fill(cent, sampleIndex, fQ3233_10); + histos.get(HIST("Prof2D_Q2241_11"))->Fill(cent, sampleIndex, fQ2241_11); + histos.get(HIST("Prof2D_Q2241_01"))->Fill(cent, sampleIndex, fQ2241_01); + histos.get(HIST("Prof2D_Q2241_10"))->Fill(cent, sampleIndex, fQ2241_10); + histos.get(HIST("Prof2D_Q2242_11"))->Fill(cent, sampleIndex, fQ2242_11); + histos.get(HIST("Prof2D_Q2242_01"))->Fill(cent, sampleIndex, fQ2242_01); + histos.get(HIST("Prof2D_Q2242_10"))->Fill(cent, sampleIndex, fQ2242_10); + histos.get(HIST("Prof2D_Q2243_11"))->Fill(cent, sampleIndex, fQ2243_11); + histos.get(HIST("Prof2D_Q2243_01"))->Fill(cent, sampleIndex, fQ2243_01); + histos.get(HIST("Prof2D_Q2243_10"))->Fill(cent, sampleIndex, fQ2243_10); + histos.get(HIST("Prof2D_Q2244_11"))->Fill(cent, sampleIndex, fQ2244_11); + histos.get(HIST("Prof2D_Q2244_01"))->Fill(cent, sampleIndex, fQ2244_01); + histos.get(HIST("Prof2D_Q2244_10"))->Fill(cent, sampleIndex, fQ2244_10); + histos.get(HIST("Prof2D_Q2141_11"))->Fill(cent, sampleIndex, fQ2141_11); + histos.get(HIST("Prof2D_Q2141_01"))->Fill(cent, sampleIndex, fQ2141_01); + histos.get(HIST("Prof2D_Q2141_10"))->Fill(cent, sampleIndex, fQ2141_10); + histos.get(HIST("Prof2D_Q2142_11"))->Fill(cent, sampleIndex, fQ2142_11); + histos.get(HIST("Prof2D_Q2142_01"))->Fill(cent, sampleIndex, fQ2142_01); + histos.get(HIST("Prof2D_Q2142_10"))->Fill(cent, sampleIndex, fQ2142_10); + histos.get(HIST("Prof2D_Q2143_11"))->Fill(cent, sampleIndex, fQ2143_11); + histos.get(HIST("Prof2D_Q2143_01"))->Fill(cent, sampleIndex, fQ2143_01); + histos.get(HIST("Prof2D_Q2143_10"))->Fill(cent, sampleIndex, fQ2143_10); + histos.get(HIST("Prof2D_Q2144_11"))->Fill(cent, sampleIndex, fQ2144_11); + histos.get(HIST("Prof2D_Q2144_01"))->Fill(cent, sampleIndex, fQ2144_01); + histos.get(HIST("Prof2D_Q2144_10"))->Fill(cent, sampleIndex, fQ2144_10); + histos.get(HIST("Prof2D_Q1151_11"))->Fill(cent, sampleIndex, fQ1151_11); + histos.get(HIST("Prof2D_Q1151_01"))->Fill(cent, sampleIndex, fQ1151_01); + histos.get(HIST("Prof2D_Q1151_10"))->Fill(cent, sampleIndex, fQ1151_10); + histos.get(HIST("Prof2D_Q1152_11"))->Fill(cent, sampleIndex, fQ1152_11); + histos.get(HIST("Prof2D_Q1152_01"))->Fill(cent, sampleIndex, fQ1152_01); + histos.get(HIST("Prof2D_Q1152_10"))->Fill(cent, sampleIndex, fQ1152_10); + histos.get(HIST("Prof2D_Q1153_11"))->Fill(cent, sampleIndex, fQ1153_11); + histos.get(HIST("Prof2D_Q1153_01"))->Fill(cent, sampleIndex, fQ1153_01); + histos.get(HIST("Prof2D_Q1153_10"))->Fill(cent, sampleIndex, fQ1153_10); + histos.get(HIST("Prof2D_Q1154_11"))->Fill(cent, sampleIndex, fQ1154_11); + histos.get(HIST("Prof2D_Q1154_01"))->Fill(cent, sampleIndex, fQ1154_01); + histos.get(HIST("Prof2D_Q1154_10"))->Fill(cent, sampleIndex, fQ1154_10); + histos.get(HIST("Prof2D_Q1155_11"))->Fill(cent, sampleIndex, fQ1155_11); + histos.get(HIST("Prof2D_Q1155_01"))->Fill(cent, sampleIndex, fQ1155_01); + histos.get(HIST("Prof2D_Q1155_10"))->Fill(cent, sampleIndex, fQ1155_10); + histos.get(HIST("Prof2D_Q112233_001"))->Fill(cent, sampleIndex, fQ112233_001); + histos.get(HIST("Prof2D_Q112233_010"))->Fill(cent, sampleIndex, fQ112233_010); + histos.get(HIST("Prof2D_Q112233_100"))->Fill(cent, sampleIndex, fQ112233_100); + histos.get(HIST("Prof2D_Q112233_011"))->Fill(cent, sampleIndex, fQ112233_011); + histos.get(HIST("Prof2D_Q112233_101"))->Fill(cent, sampleIndex, fQ112233_101); + histos.get(HIST("Prof2D_Q112233_110"))->Fill(cent, sampleIndex, fQ112233_110); + histos.get(HIST("Prof2D_Q112232_001"))->Fill(cent, sampleIndex, fQ112232_001); + histos.get(HIST("Prof2D_Q112232_010"))->Fill(cent, sampleIndex, fQ112232_010); + histos.get(HIST("Prof2D_Q112232_100"))->Fill(cent, sampleIndex, fQ112232_100); + histos.get(HIST("Prof2D_Q112232_011"))->Fill(cent, sampleIndex, fQ112232_011); + histos.get(HIST("Prof2D_Q112232_101"))->Fill(cent, sampleIndex, fQ112232_101); + histos.get(HIST("Prof2D_Q112232_110"))->Fill(cent, sampleIndex, fQ112232_110); + histos.get(HIST("Prof2D_Q112231_001"))->Fill(cent, sampleIndex, fQ112231_001); + histos.get(HIST("Prof2D_Q112231_010"))->Fill(cent, sampleIndex, fQ112231_010); + histos.get(HIST("Prof2D_Q112231_100"))->Fill(cent, sampleIndex, fQ112231_100); + histos.get(HIST("Prof2D_Q112231_011"))->Fill(cent, sampleIndex, fQ112231_011); + histos.get(HIST("Prof2D_Q112231_101"))->Fill(cent, sampleIndex, fQ112231_101); + histos.get(HIST("Prof2D_Q112231_110"))->Fill(cent, sampleIndex, fQ112231_110); + histos.get(HIST("Prof2D_Q112133_001"))->Fill(cent, sampleIndex, fQ112133_001); + histos.get(HIST("Prof2D_Q112133_010"))->Fill(cent, sampleIndex, fQ112133_010); + histos.get(HIST("Prof2D_Q112133_100"))->Fill(cent, sampleIndex, fQ112133_100); + histos.get(HIST("Prof2D_Q112133_011"))->Fill(cent, sampleIndex, fQ112133_011); + histos.get(HIST("Prof2D_Q112133_101"))->Fill(cent, sampleIndex, fQ112133_101); + histos.get(HIST("Prof2D_Q112133_110"))->Fill(cent, sampleIndex, fQ112133_110); + histos.get(HIST("Prof2D_Q112132_001"))->Fill(cent, sampleIndex, fQ112132_001); + histos.get(HIST("Prof2D_Q112132_010"))->Fill(cent, sampleIndex, fQ112132_010); + histos.get(HIST("Prof2D_Q112132_100"))->Fill(cent, sampleIndex, fQ112132_100); + histos.get(HIST("Prof2D_Q112132_011"))->Fill(cent, sampleIndex, fQ112132_011); + histos.get(HIST("Prof2D_Q112132_101"))->Fill(cent, sampleIndex, fQ112132_101); + histos.get(HIST("Prof2D_Q112132_110"))->Fill(cent, sampleIndex, fQ112132_110); + histos.get(HIST("Prof2D_Q112131_001"))->Fill(cent, sampleIndex, fQ112131_001); + histos.get(HIST("Prof2D_Q112131_010"))->Fill(cent, sampleIndex, fQ112131_010); + histos.get(HIST("Prof2D_Q112131_100"))->Fill(cent, sampleIndex, fQ112131_100); + histos.get(HIST("Prof2D_Q112131_011"))->Fill(cent, sampleIndex, fQ112131_011); + histos.get(HIST("Prof2D_Q112131_101"))->Fill(cent, sampleIndex, fQ112131_101); + histos.get(HIST("Prof2D_Q112131_110"))->Fill(cent, sampleIndex, fQ112131_110); + histos.get(HIST("Prof2D_Q2221_11"))->Fill(cent, sampleIndex, fQ2221_11); + histos.get(HIST("Prof2D_Q2221_01"))->Fill(cent, sampleIndex, fQ2221_01); + histos.get(HIST("Prof2D_Q2221_10"))->Fill(cent, sampleIndex, fQ2221_10); + histos.get(HIST("Prof2D_Q2221_21"))->Fill(cent, sampleIndex, fQ2221_21); + histos.get(HIST("Prof2D_Q2221_20"))->Fill(cent, sampleIndex, fQ2221_20); + histos.get(HIST("Prof2D_Q2122_21"))->Fill(cent, sampleIndex, fQ2122_21); + histos.get(HIST("Prof2D_Q2122_20"))->Fill(cent, sampleIndex, fQ2122_20); + histos.get(HIST("Prof2D_Q1121_02"))->Fill(cent, sampleIndex, fQ1121_02); + histos.get(HIST("Prof2D_Q1121_12"))->Fill(cent, sampleIndex, fQ1121_12); + histos.get(HIST("Prof2D_Q1121_22"))->Fill(cent, sampleIndex, fQ1121_22); + histos.get(HIST("Prof2D_Q1122_02"))->Fill(cent, sampleIndex, fQ1122_02); + histos.get(HIST("Prof2D_Q1122_12"))->Fill(cent, sampleIndex, fQ1122_12); + histos.get(HIST("Prof2D_Q1122_22"))->Fill(cent, sampleIndex, fQ1122_22); + histos.get(HIST("Prof2D_Q112221_001"))->Fill(cent, sampleIndex, fQ112221_001); + histos.get(HIST("Prof2D_Q112221_010"))->Fill(cent, sampleIndex, fQ112221_010); + histos.get(HIST("Prof2D_Q112221_100"))->Fill(cent, sampleIndex, fQ112221_100); + histos.get(HIST("Prof2D_Q112221_011"))->Fill(cent, sampleIndex, fQ112221_011); + histos.get(HIST("Prof2D_Q112221_101"))->Fill(cent, sampleIndex, fQ112221_101); + histos.get(HIST("Prof2D_Q112221_110"))->Fill(cent, sampleIndex, fQ112221_110); + histos.get(HIST("Prof2D_Q112221_200"))->Fill(cent, sampleIndex, fQ112221_200); + histos.get(HIST("Prof2D_Q112221_201"))->Fill(cent, sampleIndex, fQ112221_201); + histos.get(HIST("Prof2D_Q112221_210"))->Fill(cent, sampleIndex, fQ112221_210); + histos.get(HIST("Prof2D_Q112221_211"))->Fill(cent, sampleIndex, fQ112221_211); + histos.get(HIST("Prof2D_Q1131_21"))->Fill(cent, sampleIndex, fQ1131_21); + histos.get(HIST("Prof2D_Q1131_20"))->Fill(cent, sampleIndex, fQ1131_20); + histos.get(HIST("Prof2D_Q1131_31"))->Fill(cent, sampleIndex, fQ1131_31); + histos.get(HIST("Prof2D_Q1131_30"))->Fill(cent, sampleIndex, fQ1131_30); + histos.get(HIST("Prof2D_Q1132_21"))->Fill(cent, sampleIndex, fQ1132_21); + histos.get(HIST("Prof2D_Q1132_20"))->Fill(cent, sampleIndex, fQ1132_20); + histos.get(HIST("Prof2D_Q1132_31"))->Fill(cent, sampleIndex, fQ1132_31); + histos.get(HIST("Prof2D_Q1132_30"))->Fill(cent, sampleIndex, fQ1132_30); + histos.get(HIST("Prof2D_Q1133_21"))->Fill(cent, sampleIndex, fQ1133_21); + histos.get(HIST("Prof2D_Q1133_20"))->Fill(cent, sampleIndex, fQ1133_20); + histos.get(HIST("Prof2D_Q1133_31"))->Fill(cent, sampleIndex, fQ1133_31); + histos.get(HIST("Prof2D_Q1133_30"))->Fill(cent, sampleIndex, fQ1133_30); + histos.get(HIST("Prof2D_Q11_5"))->Fill(cent, sampleIndex, fQ11_5); + histos.get(HIST("Prof2D_Q11_6"))->Fill(cent, sampleIndex, fQ11_6); + histos.get(HIST("Prof2D_Q1121_30"))->Fill(cent, sampleIndex, fQ1121_30); + histos.get(HIST("Prof2D_Q1121_31"))->Fill(cent, sampleIndex, fQ1121_31); + histos.get(HIST("Prof2D_Q1121_40"))->Fill(cent, sampleIndex, fQ1121_40); + histos.get(HIST("Prof2D_Q1121_41"))->Fill(cent, sampleIndex, fQ1121_41); + histos.get(HIST("Prof2D_Q1122_30"))->Fill(cent, sampleIndex, fQ1122_30); + histos.get(HIST("Prof2D_Q1122_31"))->Fill(cent, sampleIndex, fQ1122_31); + histos.get(HIST("Prof2D_Q1122_40"))->Fill(cent, sampleIndex, fQ1122_40); + histos.get(HIST("Prof2D_Q1122_41"))->Fill(cent, sampleIndex, fQ1122_41); + histos.get(HIST("Prof2D_Q2211_11"))->Fill(cent, sampleIndex, fQ2211_11); + histos.get(HIST("Prof2D_Q2211_01"))->Fill(cent, sampleIndex, fQ2211_01); + histos.get(HIST("Prof2D_Q2211_10"))->Fill(cent, sampleIndex, fQ2211_10); + histos.get(HIST("Prof2D_Q2211_20"))->Fill(cent, sampleIndex, fQ2211_20); + histos.get(HIST("Prof2D_Q2211_21"))->Fill(cent, sampleIndex, fQ2211_21); + histos.get(HIST("Prof2D_Q2111_11"))->Fill(cent, sampleIndex, fQ2111_11); + histos.get(HIST("Prof2D_Q2111_01"))->Fill(cent, sampleIndex, fQ2111_01); + histos.get(HIST("Prof2D_Q2111_10"))->Fill(cent, sampleIndex, fQ2111_10); + histos.get(HIST("Prof2D_Q2111_20"))->Fill(cent, sampleIndex, fQ2111_20); + histos.get(HIST("Prof2D_Q2111_21"))->Fill(cent, sampleIndex, fQ2111_21); + histos.get(HIST("Prof2D_Q112122_001"))->Fill(cent, sampleIndex, fQ112122_001); + histos.get(HIST("Prof2D_Q112122_010"))->Fill(cent, sampleIndex, fQ112122_010); + histos.get(HIST("Prof2D_Q112122_100"))->Fill(cent, sampleIndex, fQ112122_100); + histos.get(HIST("Prof2D_Q112122_011"))->Fill(cent, sampleIndex, fQ112122_011); + histos.get(HIST("Prof2D_Q112122_101"))->Fill(cent, sampleIndex, fQ112122_101); + histos.get(HIST("Prof2D_Q112122_110"))->Fill(cent, sampleIndex, fQ112122_110); + histos.get(HIST("Prof2D_Q1141_11"))->Fill(cent, sampleIndex, fQ1141_11); + histos.get(HIST("Prof2D_Q1141_01"))->Fill(cent, sampleIndex, fQ1141_01); + histos.get(HIST("Prof2D_Q1141_10"))->Fill(cent, sampleIndex, fQ1141_10); + histos.get(HIST("Prof2D_Q1141_20"))->Fill(cent, sampleIndex, fQ1141_20); + histos.get(HIST("Prof2D_Q1141_21"))->Fill(cent, sampleIndex, fQ1141_21); + histos.get(HIST("Prof2D_Q1142_11"))->Fill(cent, sampleIndex, fQ1142_11); + histos.get(HIST("Prof2D_Q1142_01"))->Fill(cent, sampleIndex, fQ1142_01); + histos.get(HIST("Prof2D_Q1142_10"))->Fill(cent, sampleIndex, fQ1142_10); + histos.get(HIST("Prof2D_Q1142_20"))->Fill(cent, sampleIndex, fQ1142_20); + histos.get(HIST("Prof2D_Q1142_21"))->Fill(cent, sampleIndex, fQ1142_21); + histos.get(HIST("Prof2D_Q1143_11"))->Fill(cent, sampleIndex, fQ1143_11); + histos.get(HIST("Prof2D_Q1143_01"))->Fill(cent, sampleIndex, fQ1143_01); + histos.get(HIST("Prof2D_Q1143_10"))->Fill(cent, sampleIndex, fQ1143_10); + histos.get(HIST("Prof2D_Q1143_20"))->Fill(cent, sampleIndex, fQ1143_20); + histos.get(HIST("Prof2D_Q1143_21"))->Fill(cent, sampleIndex, fQ1143_21); + histos.get(HIST("Prof2D_Q1144_11"))->Fill(cent, sampleIndex, fQ1144_11); + histos.get(HIST("Prof2D_Q1144_01"))->Fill(cent, sampleIndex, fQ1144_01); + histos.get(HIST("Prof2D_Q1144_10"))->Fill(cent, sampleIndex, fQ1144_10); + histos.get(HIST("Prof2D_Q1144_20"))->Fill(cent, sampleIndex, fQ1144_20); + histos.get(HIST("Prof2D_Q1144_21"))->Fill(cent, sampleIndex, fQ1144_21); + histos.get(HIST("Prof2D_Q2131_11"))->Fill(cent, sampleIndex, fQ2131_11); + histos.get(HIST("Prof2D_Q2131_01"))->Fill(cent, sampleIndex, fQ2131_01); + histos.get(HIST("Prof2D_Q2131_10"))->Fill(cent, sampleIndex, fQ2131_10); + histos.get(HIST("Prof2D_Q2132_11"))->Fill(cent, sampleIndex, fQ2132_11); + histos.get(HIST("Prof2D_Q2132_01"))->Fill(cent, sampleIndex, fQ2132_01); + histos.get(HIST("Prof2D_Q2132_10"))->Fill(cent, sampleIndex, fQ2132_10); + histos.get(HIST("Prof2D_Q2133_11"))->Fill(cent, sampleIndex, fQ2133_11); + histos.get(HIST("Prof2D_Q2133_01"))->Fill(cent, sampleIndex, fQ2133_01); + histos.get(HIST("Prof2D_Q2133_10"))->Fill(cent, sampleIndex, fQ2133_10); + histos.get(HIST("Prof2D_Q2231_11"))->Fill(cent, sampleIndex, fQ2231_11); + histos.get(HIST("Prof2D_Q2231_01"))->Fill(cent, sampleIndex, fQ2231_01); + histos.get(HIST("Prof2D_Q2231_10"))->Fill(cent, sampleIndex, fQ2231_10); + histos.get(HIST("Prof2D_Q2232_11"))->Fill(cent, sampleIndex, fQ2232_11); + histos.get(HIST("Prof2D_Q2232_01"))->Fill(cent, sampleIndex, fQ2232_01); + histos.get(HIST("Prof2D_Q2232_10"))->Fill(cent, sampleIndex, fQ2232_10); + histos.get(HIST("Prof2D_Q2233_11"))->Fill(cent, sampleIndex, fQ2233_11); + histos.get(HIST("Prof2D_Q2233_01"))->Fill(cent, sampleIndex, fQ2233_01); + histos.get(HIST("Prof2D_Q2233_10"))->Fill(cent, sampleIndex, fQ2233_10); + histos.get(HIST("Prof2D_Q51_1"))->Fill(cent, sampleIndex, fQ51_1); + histos.get(HIST("Prof2D_Q52_1"))->Fill(cent, sampleIndex, fQ52_1); + histos.get(HIST("Prof2D_Q53_1"))->Fill(cent, sampleIndex, fQ53_1); + histos.get(HIST("Prof2D_Q54_1"))->Fill(cent, sampleIndex, fQ54_1); + histos.get(HIST("Prof2D_Q55_1"))->Fill(cent, sampleIndex, fQ55_1); + histos.get(HIST("Prof2D_Q21_3"))->Fill(cent, sampleIndex, fQ21_3); + histos.get(HIST("Prof2D_Q22_3"))->Fill(cent, sampleIndex, fQ22_3); + histos.get(HIST("Prof2D_Q31_2"))->Fill(cent, sampleIndex, fQ31_2); + histos.get(HIST("Prof2D_Q32_2"))->Fill(cent, sampleIndex, fQ32_2); + histos.get(HIST("Prof2D_Q33_2"))->Fill(cent, sampleIndex, fQ33_2); + histos.get(HIST("Prof2D_Q61_1"))->Fill(cent, sampleIndex, fQ61_1); + histos.get(HIST("Prof2D_Q62_1"))->Fill(cent, sampleIndex, fQ62_1); + histos.get(HIST("Prof2D_Q63_1"))->Fill(cent, sampleIndex, fQ63_1); + histos.get(HIST("Prof2D_Q64_1"))->Fill(cent, sampleIndex, fQ64_1); + histos.get(HIST("Prof2D_Q65_1"))->Fill(cent, sampleIndex, fQ65_1); + histos.get(HIST("Prof2D_Q66_1"))->Fill(cent, sampleIndex, fQ66_1); + histos.get(HIST("Prof2D_Q112122_111"))->Fill(cent, sampleIndex, fQ112122_111); + histos.get(HIST("Prof2D_Q112131_111"))->Fill(cent, sampleIndex, fQ112131_111); + histos.get(HIST("Prof2D_Q112132_111"))->Fill(cent, sampleIndex, fQ112132_111); + histos.get(HIST("Prof2D_Q112133_111"))->Fill(cent, sampleIndex, fQ112133_111); + histos.get(HIST("Prof2D_Q112231_111"))->Fill(cent, sampleIndex, fQ112231_111); + histos.get(HIST("Prof2D_Q112232_111"))->Fill(cent, sampleIndex, fQ112232_111); + histos.get(HIST("Prof2D_Q112233_111"))->Fill(cent, sampleIndex, fQ112233_111); + histos.get(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111); + } + } + PROCESS_SWITCH(NetProtCumulants, processDataRec, "Process real data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} From ec95efad093d085454bf36d12f080e1b86f72f29 Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Fri, 27 Mar 2026 13:16:38 +0100 Subject: [PATCH 073/282] [PWGCF] FemtoUniverse: Add mother QA to helicity bins. (#15532) --- .../femtoUniversePairTaskTrackV0Helicity.cxx | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index afee000d7d6..fd24e2b8227 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx @@ -111,6 +111,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { Configurable confPDGCodeV0{"confPDGCodeV0", 3122, "V0 -- PDG code"}; Configurable confPDGCodePosChild{"confPDGCodePosChild", 2212, "Positive Child -- PDG code"}; Configurable confPDGCodeNegChild{"confPDGCodeNegChild", 211, "Negative Child -- PDG code"}; + Configurable confSeparateInvMassCheck{"confSeparateInvMassCheck", false, "Apply additional cut separate for mLambda and mAntiLambda"}; } V0configs; /// Partitioning for particle 2 @@ -159,12 +160,13 @@ struct FemtoUniversePairTaskTrackV0Helicity { 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 3D 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 3D plot: k* vs multiplicity vs mT (set to true in order to use)"}; - /// Helicity ranges (approximate) + /// Helicity ranges and configurables Configurable cfgProcessHel{"cfgProcessHel", true, "Process particle pairs from all helicity ranges"}; - Configurable cfgProcessHel1{"cfgProcessHel1", false, "Process particle pairs from the helicity range 1"}; // 1.0 > cosineTheta >= 0.1 + Configurable cfgProcessHel1{"cfgProcessHel1", false, "Process particle pairs from the helicity range 1"}; // 1.0 >= cosineTheta >= 0.1 Configurable cfgProcessHel2{"cfgProcessHel2", false, "Process particle pairs from the helicity range 2"}; // 0.1 > cosineTheta >= -0.1 Configurable cfgProcessHel3{"cfgProcessHel3", false, "Process particle pairs from the helicity range 3"}; // -0.1 > cosineTheta >= -0.5 Configurable cfgProcessHel4{"cfgProcessHel4", false, "Process particle pairs from the helicity range 4"}; // -0.5 > cosineTheta >= -1.0 + ConfigurableAxis confInvMassMotherpTBinsHel{"confInvMassMotherpTBinsHel", {5, 0, 5}, "pT binning in the pT vs. InvMassMother plot for helicity"}; /// Efficiency Configurable confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"}; @@ -218,10 +220,17 @@ struct FemtoUniversePairTaskTrackV0Helicity { } } - bool invMLambda(float invMassLambda, float invMassAntiLambda) + bool invMLambda(float invMassLambda, float invMassAntiLambda, int V0Type) { - if ((invMassLambda < V0configs.confV0InvMassLowLimit || invMassLambda > V0configs.confV0InvMassUpLimit) && (invMassAntiLambda < V0configs.confV0InvMassLowLimit || invMassAntiLambda > V0configs.confV0InvMassUpLimit)) { - return false; + if (V0configs.confSeparateInvMassCheck) { + const float pMass = V0Type ? invMassAntiLambda : invMassLambda; + if (pMass < V0configs.confV0InvMassLowLimit || pMass > V0configs.confV0InvMassUpLimit) { + return false; + } + } else { + if ((invMassLambda < V0configs.confV0InvMassLowLimit || invMassLambda > V0configs.confV0InvMassUpLimit) && (invMassAntiLambda < V0configs.confV0InvMassLowLimit || invMassAntiLambda > V0configs.confV0InvMassUpLimit)) { + return false; + } } return true; } @@ -287,6 +296,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { thetaRegistry.add("Theta/NegativeChild/hThetaPt", " ; p_{T} (GeV/#it{c}); cos(#theta)", kTH2F, {{100, 0, 10}, {110, -1.1, 1.1}}); thetaRegistry.add("Theta/NegativeChild/hThetaEta", " ; #eta; cos(#theta)", kTH2F, {{100, -1, 1}, {110, -1.1, 1.1}}); thetaRegistry.add("Theta/NegativeChild/hThetaPhi", " ; #phi; cos(#theta)", kTH2F, {{100, -1, 7}, {110, -1.1, 1.1}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel1", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel2", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel3", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel4", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); /// MC Truth registryMCtruth.add("plus/MCtruthLambda", "MC truth Lambdas;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); @@ -427,7 +440,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Histogramming same event for (const auto& part : groupPartsTwo) { - if (!invMLambda(part.mLambda(), part.mAntiLambda())) + if (!invMLambda(part.mLambda(), part.mAntiLambda(), V0configs.confV0Type1)) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); @@ -453,6 +466,15 @@ struct FemtoUniversePairTaskTrackV0Helicity { thetaRegistry.fill(HIST("Theta/NegativeChild/hThetaPt"), negChild.pt(), cosineTheta); thetaRegistry.fill(HIST("Theta/NegativeChild/hThetaEta"), negChild.eta(), cosineTheta); thetaRegistry.fill(HIST("Theta/NegativeChild/hThetaPhi"), negChild.phi(), cosineTheta); + + if (cosineTheta <= 1.0 && cosineTheta >= 0.1) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel1"), part.pt(), part.mLambda()); + else if (cosineTheta < 0.1 && cosineTheta >= -0.1) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel2"), part.pt(), part.mLambda()); + else if (cosineTheta < -0.1 && cosineTheta >= -0.5) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel3"), part.pt(), part.mLambda()); + else if (cosineTheta < -0.5 && cosineTheta >= -1) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel4"), part.pt(), part.mLambda()); } for (const auto& part : groupPartsOne) { @@ -476,7 +498,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Now build the combinations for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type1)) continue; /// PID using stored binned nsigma if (!isParticleCombined(p1, trackconfigs.confTrackChoicePartOne)) @@ -517,7 +539,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { } case 1: { - if (cosineTheta < 1.0 && cosineTheta >= 0.1) + if (cosineTheta <= 1.0 && cosineTheta >= 0.1) sameEventContHel1.setPair(p1, p2, multCol, confUse3D, weight); break; @@ -592,7 +614,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Histogramming same event for (const auto& part : groupPartsTwo) { - if (!invMLambda(part.mLambda(), part.mAntiLambda())) + if (!invMLambda(part.mLambda(), part.mAntiLambda(), V0configs.confV0Type2)) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); @@ -613,10 +635,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { auto pairProcessFunc = [&](auto& p1, auto& p2) -> void { // Lambda invariant mass cut for p1 - if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) + if (!invMLambda(p1.mLambda(), p1.mAntiLambda(), V0configs.confV0Type2)) return; // Lambda invariant mass cut for p2 - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type2)) return; // track cleaning if (!pairCleanerV0.isCleanPair(p1, p2, parts)) { @@ -773,7 +795,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type1)) continue; /// PID using stored binned nsigma if (!isParticleCombined(p1, trackconfigs.confTrackChoicePartOne)) @@ -815,7 +837,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { } case 1: { - if (cosineTheta < 1.0 && cosineTheta >= 0.1) + if (cosineTheta <= 1.0 && cosineTheta >= 0.1) mixedEventContHel1.setPair(p1, p2, multCol, confUse3D, weight); break; @@ -907,11 +929,11 @@ struct FemtoUniversePairTaskTrackV0Helicity { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut for p1 - if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) { + if (!invMLambda(p1.mLambda(), p1.mAntiLambda(), V0configs.confV0Type2)) { continue; } // Lambda invariant mass cut for p2 - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) { + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type2)) { continue; } From e16781db1d11ea7388d6414375973fc9e0edf854 Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:00:24 +0100 Subject: [PATCH 074/282] [PWGCF] Use correct efficiency for ref flow (#15531) Co-authored-by: MaximVirta --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index e9d32487a95..34d145524cd 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -1007,7 +1007,7 @@ struct FlowGfwV02 { if (!withinPtPOI && !withinPtRef) return; - double weff = getJTrackEfficiency(track); + double weff = getEfficiency(track, PidCharged); if (weff < 0) return; From 3dad17c0efcb01dcfea5316ecc90a40ec0b0a3b1 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:11:00 +0100 Subject: [PATCH 075/282] [PWGCF] FemtoUniverse: Fix range of deta-dphi histograms (#15524) --- PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 3a7738b2cc1..f01f0f07963 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -204,10 +204,10 @@ class FemtoUniverseDetaDphiStar std::string histSuffixkT1 = std::to_string(static_cast(ktBins[j] * 100.0)); std::string histSuffixkT2 = std::to_string(static_cast(ktBins[j + 1] * 100.0)); std::string histFolderkT = "kT_" + histSuffixkT1 + "_" + histSuffixkT2 + "/"; - histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {200, -0.3, 0.3}}); + histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); } } } From 73daccf86469e80273dbd9d2799c5dfb80dff58e Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:43:06 +0100 Subject: [PATCH 076/282] [PWGHF] Add forceTOF option in CharmReso bach selections (#15521) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Core/DataCreationCharmReso.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Core/DataCreationCharmReso.h b/PWGHF/D2H/Core/DataCreationCharmReso.h index 1ee7249b5ce..475a5ecdbae 100644 --- a/PWGHF/D2H/Core/DataCreationCharmReso.h +++ b/PWGHF/D2H/Core/DataCreationCharmReso.h @@ -198,9 +198,13 @@ struct HfResoConfigSingleTrackCuts : o2::framework::ConfigurableGroup { o2::framework::Configurable setTrackSelections{"setTrackSelections", 2, "flag to apply track selections: 0=none; 1=global track w/o DCA selection; 2=global track; 3=only ITS quality"}; o2::framework::Configurable maxEta{"maxEta", 0.8, "maximum pseudorapidity for single tracks to be paired with D mesons"}; o2::framework::Configurable minPt{"minPt", 0.1, "minimum pT for single tracks to be paired with D mesons"}; + o2::framework::Configurable forceTOF{"forceTOF", false, "force TOF for single tracks to be paired with D mesons"}; o2::framework::Configurable maxNsigmaTpcPi{"maxNsigmaTpcPi", -1., "maximum pion NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"}; o2::framework::Configurable maxNsigmaTpcKa{"maxNsigmaTpcKa", -1., "maximum kaon NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"}; o2::framework::Configurable maxNsigmaTpcPr{"maxNsigmaTpcPr", 3., "maximum proton NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"}; + o2::framework::Configurable maxNsigmaTofPi{"maxNsigmaTofPi", -1., "maximum pion NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"}; + o2::framework::Configurable maxNsigmaTofKa{"maxNsigmaTofKa", -1., "maximum kaon NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"}; + o2::framework::Configurable maxNsigmaTofPr{"maxNsigmaTofPr", -1., "maximum proton NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"}; }; struct HfResoConfigQaPlots : o2::framework::ConfigurableGroup { @@ -728,9 +732,22 @@ bool isTrackSelected(const Tr& track, const std::array& dDaughtersIds, c if (!track.hasTPC()) { return false; } - bool const isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value; - bool const isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value; - bool const isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value; + // --- TPC PID --- + bool isPionTPC = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value; + bool isKaonTPC = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value; + bool isProtonTPC = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value; + + // --- TOF PID --- + bool hasTOF = track.hasTOF(); + bool isPionTOF = hasTOF ? std::abs(track.tofNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTofPi.value : false; + bool isKaonTOF = hasTOF ? std::abs(track.tofNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTofKa.value : false; + bool isProtonTOF = hasTOF ? std::abs(track.tofNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTofPr.value : false; + + // --- Combined logic --- + bool isPion = isPionTPC && (!cfgSingleTrackCuts.forceTOF.value || isPionTOF); + bool isKaon = isKaonTPC && (!cfgSingleTrackCuts.forceTOF.value || isKaonTOF); + bool isProton = isProtonTPC && (!cfgSingleTrackCuts.forceTOF.value || isProtonTOF); + return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected } From 500a887bed3ff0096295d675250acb0f1c8bab85 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Fri, 27 Mar 2026 20:38:44 +0100 Subject: [PATCH 077/282] [PWGEM] PhotonMeson: Change Event histogram binning (#15539) --- PWGEM/PhotonMeson/Utils/EventHistograms.h | 68 +++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h index e45409dda9e..249e56d516b 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -28,10 +28,10 @@ namespace o2::aod::pwgem::photonmeson::utils::eventhistogram { -inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) +inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool useWeight = false) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{12, 0.5, 12.5}}, false); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{12, 0.5, 12.5}}, useWeight); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "No TF border"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No ITS ROF border"); @@ -66,16 +66,16 @@ inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}, "centrality FT0C (%)"}; - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, false); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1F, {{axis_cent_ft0a}}, false); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1F, {{axis_cent_ft0c}}, false); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1F, {{axis_cent_ft0m}}, false); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, false); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, false); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2F, {{60, 0, 60000}, {2000, 0, 20000}}, false); + fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{220, -11, +11}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, useWeight); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1F, {{axis_cent_ft0a}}, useWeight); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1F, {{axis_cent_ft0c}}, useWeight); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1F, {{axis_cent_ft0m}}, useWeight); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 10000}}, useWeight); fRegistry->addClone("Event/before/", "Event/after/"); } @@ -83,49 +83,49 @@ template void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, float weight = 1.) { const float maxZ = 10.f; - static constexpr std::string_view kEventTypes[2] = {"before/", "after/"}; - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); + static constexpr std::string_view EventTypes[2] = {"before/", "after/"}; + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); if (collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); } if (collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); } if (collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); } if (collision.sel8()) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); } if (std::abs(collision.posZ()) < maxZ) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); } - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); if (collision.alias_bit(kTVXinEMC)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); } if (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, weight); } - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultNTracksPVeta1"), collision.multNTracksPVeta1(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultFT0"), collision.multFT0A(), collision.multFT0C(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0A"), collision.centFT0A(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0C"), collision.centFT0C(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0M"), collision.centFT0M(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0CvsMultNTracksPV"), collision.centFT0C(), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultFT0CvsOccupancy"), collision.multFT0C(), collision.trackOccupancyInTimeRange(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPVeta1"), collision.multNTracksPVeta1(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0"), collision.multFT0A(), collision.multFT0C(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0A"), collision.centFT0A(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0C"), collision.centFT0C(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0M"), collision.centFT0M(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0CvsMultNTracksPV"), collision.centFT0C(), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsOccupancy"), collision.multFT0C(), collision.trackOccupancyInTimeRange(), weight); } } // namespace o2::aod::pwgem::photonmeson::utils::eventhistogram From b84603d7d6a80ee58d09b46293e275b3f9ba913a Mon Sep 17 00:00:00 2001 From: Marcello Di Costanzo <96481191+Marcellocosti@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:00:25 +0100 Subject: [PATCH 078/282] [PWGHF] More PID columns for D+ correlated bkgs studies (#15546) --- PWGHF/DataModel/DerivedTables.h | 5 ++++- PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 0a1c8a5efaf..359a2320b3a 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -979,8 +979,11 @@ DECLARE_SOA_TABLE_STAGED(HfDplusDaugs, "HFDPDAUG", //! Table to study daughter p hf_cand::PyProng2, hf_cand::PzProng2, hf_cand_par::NSigTpcTofPi0, - hf_cand_par::NSigTpcTofKa1, + hf_cand_par::NSigTpcTofPi1, hf_cand_par::NSigTpcTofPi2, + hf_cand_par::NSigTpcTofKa0, + hf_cand_par::NSigTpcTofKa1, + hf_cand_par::NSigTpcTofKa2, o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfDplusMls, "HFDPML", //! Table with candidate selection ML scores diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index a7a90b507c5..ddc56bfaebc 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -208,8 +208,11 @@ struct HfDerivedDataCreatorDplusToPiKPi { candidate.pyProng2(), candidate.pzProng2(), candidate.tpcTofNSigmaPi0(), + candidate.tpcTofNSigmaPi1(), + candidate.tpcTofNSigmaPi2(), + candidate.tpcTofNSigmaKa0(), candidate.tpcTofNSigmaKa1(), - candidate.tpcTofNSigmaPi2()); + candidate.tpcTofNSigmaKa2()); } if (fillCandidateMl) { rowCandidateMl( From 2ad258d7a616fd93c8494fc63d5259fa2a22ae7e Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Fri, 27 Mar 2026 22:31:51 +0100 Subject: [PATCH 079/282] [PWGCF] FemtoUniverse: Fix bug in badpoint fraction calculation (#15550) --- PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index f01f0f07963..f1a76754cd0 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -877,7 +877,7 @@ class FemtoUniverseDetaDphiStar badpoints++; } } - return badpoints / entries; + return (static_cast(badpoints) / static_cast(entries)); } // Get particle charge from mask From dd5112e63f76b5eaae02db208c1936bcfaa4cf80 Mon Sep 17 00:00:00 2001 From: Fan Si <147278151+fsii@users.noreply.github.com> Date: Fri, 27 Mar 2026 22:57:30 +0100 Subject: [PATCH 080/282] [PWGCF] Update task partNumFluc (#15541) --- PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx | 1059 ++++++------------ 1 file changed, 333 insertions(+), 726 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx index fbb529fbb52..eb5ec1866a7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -449,236 +450,6 @@ class FluctuationCalculatorTrack std::array mQs; }; -struct HolderCcdb { - std::map> runNumbersIndicesGroupIndices; - - std::vector fPtMeanDcaXyP; - std::vector fPtMeanDcaXyM; - std::vector fPtMeanDcaZP; - std::vector fPtMeanDcaZM; - std::vector fPtSigmaDcaXyP; - std::vector fPtSigmaDcaXyM; - std::vector fPtSigmaDcaZP; - std::vector fPtSigmaDcaZM; - - std::vector hCentralityPtEtaShiftTpcNSigmaPiP; - std::vector hCentralityPtEtaShiftTpcNSigmaPiM; - std::vector hCentralityPtEtaShiftTpcNSigmaKaP; - std::vector hCentralityPtEtaShiftTpcNSigmaKaM; - std::vector hCentralityPtEtaShiftTpcNSigmaPrP; - std::vector hCentralityPtEtaShiftTpcNSigmaPrM; - std::vector hCentralityPtEtaShiftTofNSigmaPiP; - std::vector hCentralityPtEtaShiftTofNSigmaPiM; - std::vector hCentralityPtEtaShiftTofNSigmaKaP; - std::vector hCentralityPtEtaShiftTofNSigmaKaM; - std::vector hCentralityPtEtaShiftTofNSigmaPrP; - std::vector hCentralityPtEtaShiftTofNSigmaPrM; - - std::vector hVzCentralityPtEtaEfficiencyTpcPiP; - std::vector hVzCentralityPtEtaEfficiencyTpcPiM; - std::vector hVzCentralityPtEtaEfficiencyTpcKaP; - std::vector hVzCentralityPtEtaEfficiencyTpcKaM; - std::vector hVzCentralityPtEtaEfficiencyTpcPrP; - std::vector hVzCentralityPtEtaEfficiencyTpcPrM; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPiP; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPiM; - std::vector hVzCentralityPtEtaEfficiencyTpcTofKaP; - std::vector hVzCentralityPtEtaEfficiencyTpcTofKaM; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPrP; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPrM; - - void clear() - { - runNumbersIndicesGroupIndices.clear(); - - fPtMeanDcaXyP.clear(); - fPtMeanDcaXyM.clear(); - fPtMeanDcaZP.clear(); - fPtMeanDcaZM.clear(); - fPtSigmaDcaXyP.clear(); - fPtSigmaDcaXyM.clear(); - fPtSigmaDcaZP.clear(); - fPtSigmaDcaZM.clear(); - - hCentralityPtEtaShiftTpcNSigmaPiP.clear(); - hCentralityPtEtaShiftTpcNSigmaPiM.clear(); - hCentralityPtEtaShiftTpcNSigmaKaP.clear(); - hCentralityPtEtaShiftTpcNSigmaKaM.clear(); - hCentralityPtEtaShiftTpcNSigmaPrP.clear(); - hCentralityPtEtaShiftTpcNSigmaPrM.clear(); - hCentralityPtEtaShiftTofNSigmaPiP.clear(); - hCentralityPtEtaShiftTofNSigmaPiM.clear(); - hCentralityPtEtaShiftTofNSigmaKaP.clear(); - hCentralityPtEtaShiftTofNSigmaKaM.clear(); - hCentralityPtEtaShiftTofNSigmaPrP.clear(); - hCentralityPtEtaShiftTofNSigmaPrM.clear(); - - hVzCentralityPtEtaEfficiencyTpcPiP.clear(); - hVzCentralityPtEtaEfficiencyTpcPiM.clear(); - hVzCentralityPtEtaEfficiencyTpcKaP.clear(); - hVzCentralityPtEtaEfficiencyTpcKaM.clear(); - hVzCentralityPtEtaEfficiencyTpcPrP.clear(); - hVzCentralityPtEtaEfficiencyTpcPrM.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPiP.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPiM.clear(); - hVzCentralityPtEtaEfficiencyTpcTofKaP.clear(); - hVzCentralityPtEtaEfficiencyTpcTofKaM.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPrP.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPrM.clear(); - } -}; - -struct HolderMcEvent { - std::int32_t runNumber = 0; - std::int32_t runIndex = 0; - std::int32_t runGroupIndex = 0; - double vz = 0.; - - void clear() - { - runNumber = 0; - runIndex = 0; - runGroupIndex = 0; - vz = 0.; - } -}; - -struct HolderEvent { - static constexpr std::pair RangeCentrality = {0., 100.}; - - std::int32_t runNumber = 0; - std::int32_t runIndex = 0; - std::int32_t runGroupIndex = 0; - double vz = 0.; - std::int32_t nGlobalTracksP = 0; - std::int32_t nGlobalTracksM = 0; - std::int32_t nPvContributorsP = 0; - std::int32_t nPvContributorsM = 0; - double meanDcaXyP = 0.; - double meanDcaXyM = 0.; - double meanSquareDcaXyP = 0.; - double meanSquareDcaXyM = 0.; - double meanDcaZP = 0.; - double meanDcaZM = 0.; - double meanSquareDcaZP = 0.; - double meanSquareDcaZM = 0.; - std::int32_t nTofBetaP = 0; - std::int32_t nTofBetaM = 0; - double centrality = 0.; - std::int32_t subgroupIndex = 0; - std::int32_t nChPMc = 0; - std::int32_t nChMMc = 0; - std::int32_t nKaPMc = 0; - std::int32_t nKaMMc = 0; - std::int32_t nPrPMc = 0; - std::int32_t nPrMMc = 0; - std::int32_t nChP = 0; - std::int32_t nChM = 0; - std::int32_t nKaP = 0; - std::int32_t nKaM = 0; - std::int32_t nPrP = 0; - std::int32_t nPrM = 0; - - void clear() - { - runNumber = 0; - runIndex = 0; - runGroupIndex = 0; - vz = 0.; - nGlobalTracksP = 0; - nGlobalTracksM = 0; - nPvContributorsP = 0; - nPvContributorsM = 0; - meanDcaXyP = 0.; - meanDcaXyM = 0.; - meanSquareDcaXyP = 0.; - meanSquareDcaXyM = 0.; - meanDcaZP = 0.; - meanDcaZM = 0.; - meanSquareDcaZP = 0.; - meanSquareDcaZM = 0.; - nTofBetaP = 0; - nTofBetaM = 0; - centrality = 0.; - subgroupIndex = 0; - nChPMc = 0; - nChMMc = 0; - nKaPMc = 0; - nKaMMc = 0; - nPrPMc = 0; - nPrMMc = 0; - nChP = 0; - nChM = 0; - nKaP = 0; - nKaM = 0; - nPrP = 0; - nPrM = 0; - } -}; - -struct HolderMcParticle { - std::int32_t pdgCode = 0; - std::int32_t charge = 0; - double pt = 0.; - double eta = 0.; - double phi = 0.; - - void clear() - { - pdgCode = 0; - charge = 0; - pt = 0.; - eta = 0.; - phi = 0.; - } -}; - -struct HolderTrack { - static constexpr double TruncationAbsNSigmaPid = 999.; - static constexpr double truncateNSigmaPid(const double value) { return (!(std::abs(value) < TruncationAbsNSigmaPid) ? -TruncationAbsNSigmaPid : value); } - - double dcaXY = 0.; - double dcaZ = 0.; - std::int32_t sign = 0; - double p = 0.; - double pt = 0.; - double eta = 0.; - double phi = 0.; - bool hasTpcPid = false; - double tpcNSigmaPi = 0.; - double tpcNSigmaKa = 0.; - double tpcNSigmaPr = 0.; - bool hasTofPid = false; - double tofNSigmaPi = 0.; - double tofNSigmaKa = 0.; - double tofNSigmaPr = 0.; - double tpcTofNSigmaPi = 0.; - double tpcTofNSigmaKa = 0.; - double tpcTofNSigmaPr = 0.; - - void clear() - { - dcaXY = 0.; - dcaZ = 0.; - sign = 0; - p = 0.; - pt = 0.; - eta = 0.; - phi = 0.; - hasTpcPid = false; - tpcNSigmaPi = 0.; - tpcNSigmaKa = 0.; - tpcNSigmaPr = 0.; - hasTofPid = false; - tofNSigmaPi = 0.; - tofNSigmaKa = 0.; - tofNSigmaPr = 0.; - tpcTofNSigmaPi = 0.; - tpcTofNSigmaKa = 0.; - tpcTofNSigmaPr = 0.; - } -}; - struct PartNumFluc { enum class CentralityDefinition { kFt0a = 0, kFt0c, @@ -780,11 +551,180 @@ struct PartNumFluc { Service pdg; Service ccdb; - HolderCcdb holderCcdb; - HolderMcEvent holderMcEvent; - HolderEvent holderEvent; - HolderMcParticle holderMcParticle; - HolderTrack holderTrack; + struct HolderCcdb { + std::map> runNumbersIndicesGroupIndices; + + std::vector fPtMeanDcaXyP; + std::vector fPtMeanDcaXyM; + std::vector fPtMeanDcaZP; + std::vector fPtMeanDcaZM; + std::vector fPtSigmaDcaXyP; + std::vector fPtSigmaDcaXyM; + std::vector fPtSigmaDcaZP; + std::vector fPtSigmaDcaZM; + + std::vector hCentralityPtEtaShiftTpcNSigmaPiP; + std::vector hCentralityPtEtaShiftTpcNSigmaPiM; + std::vector hCentralityPtEtaShiftTpcNSigmaKaP; + std::vector hCentralityPtEtaShiftTpcNSigmaKaM; + std::vector hCentralityPtEtaShiftTpcNSigmaPrP; + std::vector hCentralityPtEtaShiftTpcNSigmaPrM; + std::vector hCentralityPtEtaShiftTofNSigmaPiP; + std::vector hCentralityPtEtaShiftTofNSigmaPiM; + std::vector hCentralityPtEtaShiftTofNSigmaKaP; + std::vector hCentralityPtEtaShiftTofNSigmaKaM; + std::vector hCentralityPtEtaShiftTofNSigmaPrP; + std::vector hCentralityPtEtaShiftTofNSigmaPrM; + + std::vector hVzCentralityPtEtaEfficiencyTpcPiP; + std::vector hVzCentralityPtEtaEfficiencyTpcPiM; + std::vector hVzCentralityPtEtaEfficiencyTpcKaP; + std::vector hVzCentralityPtEtaEfficiencyTpcKaM; + std::vector hVzCentralityPtEtaEfficiencyTpcPrP; + std::vector hVzCentralityPtEtaEfficiencyTpcPrM; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPiP; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPiM; + std::vector hVzCentralityPtEtaEfficiencyTpcTofKaP; + std::vector hVzCentralityPtEtaEfficiencyTpcTofKaM; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPrP; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPrM; + + void clear() + { + runNumbersIndicesGroupIndices.clear(); + + fPtMeanDcaXyP.clear(); + fPtMeanDcaXyM.clear(); + fPtMeanDcaZP.clear(); + fPtMeanDcaZM.clear(); + fPtSigmaDcaXyP.clear(); + fPtSigmaDcaXyM.clear(); + fPtSigmaDcaZP.clear(); + fPtSigmaDcaZM.clear(); + + hCentralityPtEtaShiftTpcNSigmaPiP.clear(); + hCentralityPtEtaShiftTpcNSigmaPiM.clear(); + hCentralityPtEtaShiftTpcNSigmaKaP.clear(); + hCentralityPtEtaShiftTpcNSigmaKaM.clear(); + hCentralityPtEtaShiftTpcNSigmaPrP.clear(); + hCentralityPtEtaShiftTpcNSigmaPrM.clear(); + hCentralityPtEtaShiftTofNSigmaPiP.clear(); + hCentralityPtEtaShiftTofNSigmaPiM.clear(); + hCentralityPtEtaShiftTofNSigmaKaP.clear(); + hCentralityPtEtaShiftTofNSigmaKaM.clear(); + hCentralityPtEtaShiftTofNSigmaPrP.clear(); + hCentralityPtEtaShiftTofNSigmaPrM.clear(); + + hVzCentralityPtEtaEfficiencyTpcPiP.clear(); + hVzCentralityPtEtaEfficiencyTpcPiM.clear(); + hVzCentralityPtEtaEfficiencyTpcKaP.clear(); + hVzCentralityPtEtaEfficiencyTpcKaM.clear(); + hVzCentralityPtEtaEfficiencyTpcPrP.clear(); + hVzCentralityPtEtaEfficiencyTpcPrM.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPiP.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPiM.clear(); + hVzCentralityPtEtaEfficiencyTpcTofKaP.clear(); + hVzCentralityPtEtaEfficiencyTpcTofKaM.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPrP.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPrM.clear(); + } + } holderCcdb; + + struct HolderMcEvent { + std::int32_t runNumber{}; + std::int32_t runIndex{}; + std::int32_t runGroupIndex{}; + double vz{}; + std::int32_t nChP{}; + std::int32_t nChM{}; + std::int32_t nKaP{}; + std::int32_t nKaM{}; + std::int32_t nPrP{}; + std::int32_t nPrM{}; + + void clear() + { + *this = {}; + } + } holderMcEvent; + + struct HolderEvent { + static constexpr std::pair RangeCentrality = {0., 100.}; + + std::int32_t runNumber{}; + std::int32_t runIndex{}; + std::int32_t runGroupIndex{}; + double vz{}; + std::int32_t nGlobalTracksP{}; + std::int32_t nGlobalTracksM{}; + std::int32_t nPvContributorsP{}; + std::int32_t nPvContributorsM{}; + double meanDcaXyP{}; + double meanDcaXyM{}; + double meanSquareDcaXyP{}; + double meanSquareDcaXyM{}; + double meanDcaZP{}; + double meanDcaZM{}; + double meanSquareDcaZP{}; + double meanSquareDcaZM{}; + std::int32_t nTofBetaP{}; + std::int32_t nTofBetaM{}; + double centrality{}; + std::int32_t subgroupIndex{}; + std::int32_t nChP{}; + std::int32_t nChM{}; + std::int32_t nKaP{}; + std::int32_t nKaM{}; + std::int32_t nPrP{}; + std::int32_t nPrM{}; + + void clear() + { + *this = {}; + } + } holderEvent; + + struct HolderMcParticle { + std::int32_t pdgCode{}; + std::int32_t charge{}; + double pt{}; + double eta{}; + double phi{}; + + void clear() + { + *this = {}; + } + } holderMcParticle; + + struct HolderTrack { + static constexpr double TruncationAbsNSigmaPid = 999.; + static constexpr double truncateNSigmaPid(const double value) { return (!(std::abs(value) < TruncationAbsNSigmaPid) ? -TruncationAbsNSigmaPid : value); } + + double dcaXY{}; + double dcaZ{}; + std::int32_t sign{}; + double p{}; + double pt{}; + double eta{}; + double phi{}; + bool hasTpcPid{}; + double tpcNSigmaPi{}; + double tpcNSigmaKa{}; + double tpcNSigmaPr{}; + bool hasTofPid{}; + double tofNSigmaPi{}; + double tofNSigmaKa{}; + double tofNSigmaPr{}; + double tpcTofNSigmaPi{}; + double tpcTofNSigmaKa{}; + double tpcTofNSigmaPr{}; + + void clear() + { + *this = {}; + } + } holderTrack; std::unique_ptr fluctuationCalculatorTrackChP; std::unique_ptr fluctuationCalculatorTrackChM; @@ -815,8 +755,8 @@ struct PartNumFluc { HistogramRegistry hrCounter{"hrCounter", {}, OutputObjHandlingPolicy::AnalysisObject}; Filter filterCollision = (aod::evsel::sel8 == true); - Filter filterfTrack = requireQualityTracksInFilter(); - Filter filterfMcCollision = (aod::mccollisionprop::numRecoCollision > 0); + Filter filterTrack = requireQualityTracksInFilter(); + Filter filterMcCollision = (aod::mccollisionprop::numRecoCollision > 0); Preslice presliceTracksPerCollision = aod::track::collisionId; @@ -850,7 +790,7 @@ struct PartNumFluc { LOG(fatal) << "Invalid ccdb_object!"; } - const TGraph* const gRunNumberGroupIndex = dynamic_cast(ccdbObject->FindObject("gRunNumberGroupIndex")); + const TGraph* const gRunNumberGroupIndex = dynamic_cast(ccdbObject->FindObject("gRunNumberGroupIndex")); if (!gRunNumberGroupIndex || gRunNumberGroupIndex->IsA() != TGraph::Class()) { LOG(fatal) << "Invalid gRunNumberGroupIndex!"; } @@ -914,6 +854,42 @@ struct PartNumFluc { break; } + const auto readListRunGroup = [&](const std::int32_t runGroupIndex) -> const TList* { + const std::string name = Form("lRunGroup_%d", runGroupIndex); + const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(name.c_str())); + if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { + LOG(fatal) << "Invalid " << name << "!"; + } + return lRunGroup; + }; + const auto readFormula = [&](const TList* const lRunGroup, const char* const nameBase, const bool doAddingSuffixMc, const std::int32_t runGroupIndex) -> const TFormula* { + const std::string name = Form("%s%s_runGroup%d", nameBase, doAddingSuffixMc ? "_mc" : "", runGroupIndex); + const TFormula* const formula = dynamic_cast(lRunGroup->FindObject(name.c_str())); + if (!formula || formula->IsA() != TFormula::Class()) { + LOG(fatal) << "Invalid " << name << "!"; + } + LOG(info) << "Reading from CCDB: " << formula->GetName() << " \"" << formula->GetExpFormula("clingp") << "\""; + return formula; + }; + const auto readH3 = [&](const TList* const lRunGroup, const char* const nameBase, const bool doAddingSuffixMc, const std::int32_t runGroupIndex) -> const TH3* { + const std::string name = Form("%s%s_runGroup%d", nameBase, doAddingSuffixMc ? "_mc" : "", runGroupIndex); + const TH3* const h3 = dynamic_cast(lRunGroup->FindObject(name.c_str())); + if (!h3 || !h3->InheritsFrom(TH3::Class())) { + LOG(fatal) << "Invalid " << name << "!"; + } + LOG(info) << "Reading from CCDB: " << h3->GetName(); + return h3; + }; + const auto readHn = [&](const TList* const lRunGroup, const char* const nameBase, const bool doAddingSuffixMc, const std::int32_t runGroupIndex, const std::int32_t nDimensions) -> const THnBase* { + const std::string name = Form("%s%s_runGroup%d", nameBase, doAddingSuffixMc ? "_mc" : "", runGroupIndex); + const THnBase* const hn = dynamic_cast(lRunGroup->FindObject(name.c_str())); + if (!hn || !hn->InheritsFrom(THnBase::Class()) || hn->GetNdimensions() != nDimensions) { + LOG(fatal) << "Invalid " << name << "!"; + } + LOG(info) << "Reading from CCDB: " << hn->GetName(); + return hn; + }; + if (groupTrack.cfgFlagRecalibrationDca.value) { LOG(info) << "Enabling DCA recalibration."; @@ -926,157 +902,47 @@ struct PartNumFluc { holderCcdb.fPtSigmaDcaZP.resize(nRunGroups); holderCcdb.fPtSigmaDcaZM.resize(nRunGroups); for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.fPtMeanDcaXyP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaXyP[iRunGroup] || holderCcdb.fPtMeanDcaXyP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaXyP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaXyP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtMeanDcaXyM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaXyM[iRunGroup] || holderCcdb.fPtMeanDcaXyM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaXyM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaXyM[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtMeanDcaZP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaZP[iRunGroup] || holderCcdb.fPtMeanDcaZP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaZP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaZP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtMeanDcaZM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaZM[iRunGroup] || holderCcdb.fPtMeanDcaZM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaZM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaZM[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaXyP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaXyP[iRunGroup] || holderCcdb.fPtSigmaDcaXyP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaXyP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaXyP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaXyM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaXyM[iRunGroup] || holderCcdb.fPtSigmaDcaXyM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaXyM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaXyM[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaZP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaZP[iRunGroup] || holderCcdb.fPtSigmaDcaZP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaZP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaZP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaZM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaZM[iRunGroup] || holderCcdb.fPtSigmaDcaZM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaZM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaZM[iRunGroup]->GetExpFormula("clingp") << "\""; + const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); + holderCcdb.fPtMeanDcaXyP[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaXyP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtMeanDcaXyM[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaXyM", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtMeanDcaZP[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaZP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtMeanDcaZM[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaZM", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaXyP[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaXyP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaXyM[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaXyM", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaZP[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaZP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaZM[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaZM", doprocessMc.value, iRunGroup + 1); } } if (groupTrack.cfgFlagRecalibrationNSigmaPi.value || groupTrack.cfgFlagRecalibrationNSigmaKa.value || groupTrack.cfgFlagRecalibrationNSigmaPr.value) { - if (groupTrack.cfgFlagRecalibrationNSigmaPi.value) { - LOG(info) << "Enabling nSigmaPi recalibration."; - - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM.resize(nRunGroups); + const auto readH3ShiftNSigmaPid = [&](std::initializer_list*, const char*>> pairsVectorH3NameBase) { + for (const auto& [vectorH3, nameBase] : pairsVectorH3NameBase) { + vectorH3->resize(nRunGroups); + } for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; + const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); + for (const auto& [vectorH3, nameBase] : pairsVectorH3NameBase) { + (*vectorH3)[iRunGroup] = readH3(lRunGroup, nameBase, doprocessMc.value, iRunGroup + 1); } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup]->GetName(); } + }; + + if (groupTrack.cfgFlagRecalibrationNSigmaPi.value) { + LOG(info) << "Enabling nSigmaPi recalibration."; + + readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP, "hCentralityPtEtaShiftTpcNSigmaPiP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM, "hCentralityPtEtaShiftTpcNSigmaPiM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP, "hCentralityPtEtaShiftTofNSigmaPiP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM, "hCentralityPtEtaShiftTofNSigmaPiM"}}); } if (groupTrack.cfgFlagRecalibrationNSigmaKa.value) { LOG(info) << "Enabling nSigmaKa recalibration."; - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup]->GetName(); - } + readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP, "hCentralityPtEtaShiftTpcNSigmaKaP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM, "hCentralityPtEtaShiftTpcNSigmaKaM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP, "hCentralityPtEtaShiftTofNSigmaKaP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM, "hCentralityPtEtaShiftTofNSigmaKaM"}}); } if (groupTrack.cfgFlagRecalibrationNSigmaPr.value) { LOG(info) << "Enabling nSigmaPr recalibration."; - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup]->GetName(); - } + readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP, "hCentralityPtEtaShiftTpcNSigmaPrP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM, "hCentralityPtEtaShiftTpcNSigmaPrM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP, "hCentralityPtEtaShiftTofNSigmaPrP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM, "hCentralityPtEtaShiftTofNSigmaPrM"}}); } } @@ -1576,8 +1442,6 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - static constexpr std::int32_t NDimensionsEfficiency = 4; - const AxisSpec asCentrality(groupEvent.cfgAxisCentrality, "Centrality (%)"); const HistogramConfigSpec hcsDistribution(HistType::kTHnSparseD, {asCentrality, {200, -0.5, 199.5}, {200, -0.5, 199.5}}); const HistogramConfigSpec hcsFluctuationCalculator(HistType::kTH3D, {asCentrality, {groupEvent.cfgNSubgroups.value, -0.5, groupEvent.cfgNSubgroups.value - 0.5, "Subgroup Index"}, {fluctuation_calculator_base::NOrderVectors, -0.5, fluctuation_calculator_base::NOrderVectors - 0.5, "Order Vector Index"}}); @@ -1648,109 +1512,34 @@ struct PartNumFluc { hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrN", "", hcsFluctuationCalculator); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM.resize(nRunGroups); + const auto readHnEfficiency = [&](std::initializer_list*, const char*>> pairsVectorHnNameBase) { + for (const auto& [vectorHn, nameBase] : pairsVectorHnNameBase) { + vectorHn->resize(nRunGroups); + } for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; + const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); + for (const auto& [vectorHn, nameBase] : pairsVectorHnNameBase) { + (*vectorHn)[iRunGroup] = readHn(lRunGroup, nameBase, false, iRunGroup + 1, 4); } - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPiP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPiP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPiM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPiM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPiP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPiP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPiM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPiM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup]->GetName(); } + }; + + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { + readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP, "hVzCentralityPtEtaEfficiencyTpcPiP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM, "hVzCentralityPtEtaEfficiencyTpcPiM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP, "hVzCentralityPtEtaEfficiencyTpcTofPiP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM, "hVzCentralityPtEtaEfficiencyTpcTofPiM"}}); } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcKaP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcKaP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcKaM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcKaM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofKaP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofKaP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofKaM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofKaM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup]->GetName(); - } + readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP, "hVzCentralityPtEtaEfficiencyTpcKaP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM, "hVzCentralityPtEtaEfficiencyTpcKaM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP, "hVzCentralityPtEtaEfficiencyTpcTofKaP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM, "hVzCentralityPtEtaEfficiencyTpcTofKaM"}}); } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPrP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPrP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPrM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPrM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPrP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPrP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPrM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPrM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup]->GetName(); - } + readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP, "hVzCentralityPtEtaEfficiencyTpcPrP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM, "hVzCentralityPtEtaEfficiencyTpcPrM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP, "hVzCentralityPtEtaEfficiencyTpcTofPrP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM, "hVzCentralityPtEtaEfficiencyTpcTofPrM"}}); } } } template - double getEfficiency() + double getEfficiency(const bool doUsingMcParticleMomentum) { static_assert(particleSpecies == ParticleSpecies::kPi || particleSpecies == ParticleSpecies::kKa || particleSpecies == ParticleSpecies::kPr); static_assert(pidStrategy == PidStrategy::kTpc || pidStrategy == PidStrategy::kTpcTof); @@ -1762,7 +1551,7 @@ struct PartNumFluc { return 0.; } const THnBase* const hVzCentralityPtEtaEfficiency = pointersVectorHistogramEfficiency[static_cast(particleSpecies)][holderMcParticle.charge > 0 ? 0 : 1][pidStrategy == PidStrategy::kTpc ? 0 : 1]->at(std::abs(holderEvent.runGroupIndex) - 1); - return hVzCentralityPtEtaEfficiency ? hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta}.data())) : 0.; + return hVzCentralityPtEtaEfficiency ? (doUsingMcParticleMomentum ? hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta}.data())) : hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderTrack.pt, holderTrack.eta}.data()))) : 0.; } if (holderTrack.sign == 0) { @@ -1862,10 +1651,9 @@ struct PartNumFluc { return holderTrack.sign; } - template - bool isGoodMomentum() + bool isGoodMomentum(const bool doUsingMcParticleMomentum) { - if constexpr (doProcessingMc) { + if (doUsingMcParticleMomentum) { if (!(groupTrack.cfgCutMinPt.value < holderMcParticle.pt && holderMcParticle.pt < groupTrack.cfgCutMaxPt.value)) { return false; } @@ -1951,6 +1739,59 @@ struct PartNumFluc { return true; } + template + void calculateFluctuation() + { + const bool doUsingMcParticleMomentum = doProcessingMc && groupTrack.cfgFlagMcParticleMomentum.value; + if (!(isGoodMomentum(doUsingMcParticleMomentum) && holderTrack.hasTpcPid)) { + return; + } + + const auto processSign = [&](const std::int32_t sign, const std::int32_t pdgCodeP, const std::int32_t pdgCodeM, std::int32_t& nP, std::int32_t& nM, std::unique_ptr& fluctuationCalculatorTrackP, std::unique_ptr& fluctuationCalculatorTrackM, std::unique_ptr& fluctuationCalculatorTrackT, std::unique_ptr& fluctuationCalculatorTrackN) { + if (std::abs(sign) != 1) { + return; + } + if constexpr (doProcessingMc) { + if (holderMcParticle.pdgCode != (sign > 0 ? pdgCodeP : pdgCodeM)) { + return; + } + } + + const double efficiency = getEfficiency(doUsingMcParticleMomentum); + if (sign > 0) { + nP++; + fluctuationCalculatorTrackP->fill(1., efficiency); + fluctuationCalculatorTrackT->fill(1., efficiency); + fluctuationCalculatorTrackN->fill(1., efficiency); + } else { + nM++; + fluctuationCalculatorTrackM->fill(1., efficiency); + fluctuationCalculatorTrackT->fill(1., efficiency); + fluctuationCalculatorTrackN->fill(-1., efficiency); + } + }; // NOLINT(readability/braces) + + const auto processSpecies = [&](const double thresholdPtTof, const std::int32_t pdgCodeP, const std::int32_t pdgCodeM, std::int32_t& nP, std::int32_t& nM, std::unique_ptr& fluctuationCalculatorTrackP, std::unique_ptr& fluctuationCalculatorTrackM, std::unique_ptr& fluctuationCalculatorTrackT, std::unique_ptr& fluctuationCalculatorTrackN) { + if ((doUsingMcParticleMomentum ? holderMcParticle.pt : holderTrack.pt) < thresholdPtTof) { + processSign.template operator()(isPid(groupTrack.cfgFlagRejectionOthers.value), pdgCodeP, pdgCodeM, nP, nM, fluctuationCalculatorTrackP, fluctuationCalculatorTrackM, fluctuationCalculatorTrackT, fluctuationCalculatorTrackN); + } else if (holderTrack.hasTofPid) { + processSign.template operator()(isPid(groupTrack.cfgFlagRejectionOthers.value), pdgCodeP, pdgCodeM, nP, nM, fluctuationCalculatorTrackP, fluctuationCalculatorTrackM, fluctuationCalculatorTrackT, fluctuationCalculatorTrackN); + } + }; // NOLINT(readability/braces) + + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { + processSpecies.template operator()(groupTrack.cfgThresholdPtTofPi.value, PDG_t::kPiPlus, PDG_t::kPiMinus, holderEvent.nChP, holderEvent.nChM, fluctuationCalculatorTrackChP, fluctuationCalculatorTrackChM, fluctuationCalculatorTrackChT, fluctuationCalculatorTrackChN); + processSpecies.template operator()(groupTrack.cfgThresholdPtTofKa.value, PDG_t::kKPlus, PDG_t::kKMinus, holderEvent.nChP, holderEvent.nChM, fluctuationCalculatorTrackChP, fluctuationCalculatorTrackChM, fluctuationCalculatorTrackChT, fluctuationCalculatorTrackChN); + processSpecies.template operator()(groupTrack.cfgThresholdPtTofPr.value, PDG_t::kProton, PDG_t::kProtonBar, holderEvent.nChP, holderEvent.nChM, fluctuationCalculatorTrackChP, fluctuationCalculatorTrackChM, fluctuationCalculatorTrackChT, fluctuationCalculatorTrackChN); + } + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { + processSpecies.template operator()(groupTrack.cfgThresholdPtTofKa.value, PDG_t::kKPlus, PDG_t::kKMinus, holderEvent.nKaP, holderEvent.nKaM, fluctuationCalculatorTrackKaP, fluctuationCalculatorTrackKaM, fluctuationCalculatorTrackKaT, fluctuationCalculatorTrackKaN); + } + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { + processSpecies.template operator()(groupTrack.cfgThresholdPtTofPr.value, PDG_t::kProton, PDG_t::kProtonBar, holderEvent.nPrP, holderEvent.nPrM, fluctuationCalculatorTrackPrP, fluctuationCalculatorTrackPrM, fluctuationCalculatorTrackPrT, fluctuationCalculatorTrackPrN); + } + } + template bool initTrack(const T& track) { @@ -2418,236 +2259,6 @@ struct PartNumFluc { return true; } - template - void calculateFluctuation() - { - if (isGoodMomentum() && holderTrack.hasTpcPid) { - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPi.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofKa.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPr.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } - } - - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofKa.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nKaP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaP->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nKaM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaM->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nKaP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaP->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nKaM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaM->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(-1., efficiency); - } break; - } - } - } - - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPr.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nPrP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrP->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nPrM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrM->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nPrP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrP->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nPrM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrM->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(-1., efficiency); - } break; - } - } - } - } - } - template bool initMcEvent(const MC& mcCollision) { @@ -2675,7 +2286,7 @@ struct PartNumFluc { return false; } - if (groupEvent.cfgFlagInelEvent.value && !mcCollision.isInelGt0()) { + if (groupEvent.cfgFlagInelEventMc.value && !mcCollision.isInelGt0()) { hrCounter.fill(HIST("hNMcEvents"), 3.); return false; } @@ -3052,8 +2663,8 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPi.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPiP"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChP++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); @@ -3066,8 +2677,8 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPi.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPiM"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChM++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); @@ -3080,14 +2691,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldKa.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcKaP"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChP++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { - holderEvent.nKaPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum(true)) { + holderMcEvent.nKaP++; fluctuationCalculatorTrackKaP->fill(1., 1.); fluctuationCalculatorTrackKaT->fill(1., 1.); fluctuationCalculatorTrackKaN->fill(1., 1.); @@ -3100,14 +2711,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldKa.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcKaM"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChM++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { - holderEvent.nKaMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum(true)) { + holderMcEvent.nKaM++; fluctuationCalculatorTrackKaM->fill(1., 1.); fluctuationCalculatorTrackKaT->fill(1., 1.); fluctuationCalculatorTrackKaN->fill(-1., 1.); @@ -3120,14 +2731,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPr.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPrP"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChP++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { - holderEvent.nPrPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum(true)) { + holderMcEvent.nPrP++; fluctuationCalculatorTrackPrP->fill(1., 1.); fluctuationCalculatorTrackPrT->fill(1., 1.); fluctuationCalculatorTrackPrN->fill(1., 1.); @@ -3140,14 +2751,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPr.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPrM"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChM++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { - holderEvent.nPrMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum(true)) { + holderMcEvent.nPrM++; fluctuationCalculatorTrackPrM->fill(1., 1.); fluctuationCalculatorTrackPrT->fill(1., 1.); fluctuationCalculatorTrackPrN->fill(-1., 1.); @@ -3158,7 +2769,7 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNChPNChM_mc"), holderEvent.centrality, holderEvent.nChPMc, holderEvent.nChMMc); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNChPNChM_mc"), holderEvent.centrality, holderMcEvent.nChP, holderMcEvent.nChM); for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChP->getProductFast(iOrderVector)); hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChM->getProductFast(iOrderVector)); @@ -3167,7 +2778,7 @@ struct PartNumFluc { } } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNKaPNKaM_mc"), holderEvent.centrality, holderEvent.nKaPMc, holderEvent.nKaMMc); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNKaPNKaM_mc"), holderEvent.centrality, holderMcEvent.nKaP, holderMcEvent.nKaM); for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaP->getProductFast(iOrderVector)); hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaM->getProductFast(iOrderVector)); @@ -3176,7 +2787,7 @@ struct PartNumFluc { } } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNPrPNPrM_mc"), holderEvent.centrality, holderEvent.nPrPMc, holderEvent.nPrMMc); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNPrPNPrM_mc"), holderEvent.centrality, holderMcEvent.nPrP, holderMcEvent.nPrM); for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrP->getProductFast(iOrderVector)); hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrM->getProductFast(iOrderVector)); @@ -3628,11 +3239,7 @@ struct PartNumFluc { } if ((groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) && (!groupTrack.cfgFlagMcParticlePhysicalPrimary.value || mcParticle.isPhysicalPrimary())) { - if (groupTrack.cfgFlagMcParticleMomentum.value) { - calculateFluctuation(); - } else { - calculateFluctuation(); - } + calculateFluctuation(); } } From 8c61c16af5b5cddfce225157e62321b379c30ee1 Mon Sep 17 00:00:00 2001 From: Christian Reckziegel <57670185+christianreckziegel@users.noreply.github.com> Date: Fri, 27 Mar 2026 19:00:21 -0300 Subject: [PATCH 081/282] [PWGJE] fixes to charm hadronisation task (#15534) Co-authored-by: ALICE Action Bot --- PWGJE/Tasks/hfFragmentationFunction.cxx | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/PWGJE/Tasks/hfFragmentationFunction.cxx b/PWGJE/Tasks/hfFragmentationFunction.cxx index bff035d67bb..abcdcdb28b9 100644 --- a/PWGJE/Tasks/hfFragmentationFunction.cxx +++ b/PWGJE/Tasks/hfFragmentationFunction.cxx @@ -278,7 +278,7 @@ struct HfFragmentationFunction { // filling table distJetTable(axisDistance, - jet.pt(), jet.eta(), jet.phi(), jet.template tracks_as().size(), + jet.pt(), jet.eta(), jet.phi(), jet.template tracks_as().size() + jet.template candidates_as().size(), candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y(), candidate.mlScores()[0], candidate.mlScores()[1], candidate.mlScores()[2]); break; // get out of candidates' loop after first HF particle is found in jet @@ -319,7 +319,7 @@ struct HfFragmentationFunction { registry.fill(HIST("h_collision_counter"), 0.0); // skip collisions outside of |z| < vertexZCut - if (std::abs(mccollision.posZ()) > vertexZCut) { + if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) { continue; } registry.fill(HIST("h_collision_counter"), 1.0); @@ -366,7 +366,7 @@ struct HfFragmentationFunction { // store data in MC detector level table mcddistJetTable(jetutilities::deltaR(mcdjet, mcdd0cand), - mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_as().size(), // detector level jet + mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_as().size() + mcdjet.candidates_as().size(), // detector level jet mcdd0cand.pt(), mcdd0cand.eta(), mcdd0cand.phi(), mcdd0cand.m(), mcdd0cand.y(), (mcdd0cand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level D0 candidate mcdjet.has_matchedJetCand(), mcdd0cand.mlScores()[0], mcdd0cand.mlScores()[1], mcdd0cand.mlScores()[2], // // Machine Learning PID scores: background, prompt, non-prompt matchedFrom, selectedAs); // D0 = +1, D0bar = -1, neither = 0 @@ -388,8 +388,8 @@ struct HfFragmentationFunction { // store data in MC detector level table (calculate angular distance in eta-phi plane on the fly) mcpdistJetTable(jetutilities::deltaR(mcpjet, mcpd0cand), - mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.tracks_as().size(), // particle level jet - mcpd0cand.pt(), mcpd0cand.eta(), mcpd0cand.phi(), mcpd0cand.y(), (mcpd0cand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level D0 + mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.tracks_as().size() + mcpjet.candidates_as().size(), // particle level jet + mcpd0cand.pt(), mcpd0cand.eta(), mcpd0cand.phi(), mcpd0cand.y(), (mcpd0cand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level D0 mcpjet.has_matchedJetCand()); } } @@ -410,7 +410,7 @@ struct HfFragmentationFunction { for (const auto& mccollision : mccollisions) { registry.fill(HIST("h_collision_counter"), 0.0); // skip collisions outside of |z| < vertexZCut - if (std::abs(mccollision.posZ()) > vertexZCut) { + if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) { continue; } registry.fill(HIST("h_collision_counter"), 1.0); @@ -465,21 +465,21 @@ struct HfFragmentationFunction { } // store matched particle and detector level data in one single table (calculate angular distance in eta-phi plane on the fly) - matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size(), // particle level jet - mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF - jetutilities::deltaR(mcdjet, mcdcand), mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.template tracks_as().size(), // detector level jet - mcdcand.pt(), mcdcand.eta(), mcdcand.phi(), mcdcand.m(), mcdcand.y(), (mcdcand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level HF - mcdcand.mlScores()[0], mcdcand.mlScores()[1], mcdcand.mlScores()[2], // Machine Learning PID scores: background, prompt, non-prompt - matchedFrom, selectedAs); // HF = +1, HFbar = -1, neither = 0 + matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size() + mcpjet.template candidates_as().size(), // particle level jet + mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF + jetutilities::deltaR(mcdjet, mcdcand), mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.template tracks_as().size() + +mcdjet.template candidates_as().size(), // detector level jet + mcdcand.pt(), mcdcand.eta(), mcdcand.phi(), mcdcand.m(), mcdcand.y(), (mcdcand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level HF + mcdcand.mlScores()[0], mcdcand.mlScores()[1], mcdcand.mlScores()[2], // Machine Learning PID scores: background, prompt, non-prompt + matchedFrom, selectedAs); // HF = +1, HFbar = -1, neither = 0 } } else { // store matched particle and detector level data in one single table (calculate angular distance in eta-phi plane on the fly) - matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size(), // particle level jet - mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF - -2, -2, -2, -2, -2, // detector level jet - -2, -2, -2, -2, -2, -2, // detector level HF - -2, -2, -2, // Machine Learning PID scores: background, prompt, non-prompt - -2, -2); // HF = +1, HFbar = -1, neither = 0 + matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size() + +mcpjet.template candidates_as().size(), // particle level jet + mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF + -2, -2, -2, -2, -2, // detector level jet + -2, -2, -2, -2, -2, -2, // detector level HF + -2, -2, -2, // Machine Learning PID scores: background, prompt, non-prompt + -2, -2); // HF = +1, HFbar = -1, neither = 0 } } // end of mcpjets loop } // end of mccollisions loop From 04e290c56340021bb77a7c834e904221fc3ec1f8 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:39:40 +0100 Subject: [PATCH 082/282] [PWGLF] added cosphipsivseta and option to resocorr run by run (#15533) Co-authored-by: Prottay Das --- PWGLF/TableProducer/Common/zdcvector.cxx | 60 +++++++++++- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 116 +++++++++++++++++++---- 2 files changed, 155 insertions(+), 21 deletions(-) diff --git a/PWGLF/TableProducer/Common/zdcvector.cxx b/PWGLF/TableProducer/Common/zdcvector.cxx index 19fc5e65393..6ce044dac61 100644 --- a/PWGLF/TableProducer/Common/zdcvector.cxx +++ b/PWGLF/TableProducer/Common/zdcvector.cxx @@ -85,6 +85,7 @@ struct zdcvector { Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"}; Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; Configurable usemem{"usemem", true, "usemem"}; + Configurable usecfactor{"usecfactor", false, "use c factor"}; struct : ConfigurableGroup { Configurable vzFineNbins{"vzFineNbins", 20, "Number of bins in Vz fine histograms"}; @@ -119,6 +120,7 @@ struct zdcvector { AxisSpec vzfineAxis = {configbins.vzFineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; AxisSpec centfineAxis = {configbins.centFineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; + // AxisSpec EAxis = {500, 0, 1000, "Eaxis"}; histos.add("htpcnsigmapi", "htpcnsigmapi", kTH1F, {{50, -10, 10.0}}); histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}}); @@ -128,6 +130,14 @@ struct zdcvector { histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis}); + /*histos.add("hZNA0", "hZNA0", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNA1", "hZNA1", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNA2", "hZNA2", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNA3", "hZNA3", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC0", "hZNC0", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC1", "hZNC1", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC2", "hZNC2", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC3", "hZNC3", kTH2D, {{centfineAxis}, {EAxis}}, true);*/ ccdb->setURL(cfgCcdbParam.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); @@ -141,6 +151,11 @@ struct zdcvector { TH2D* gainprofile; TProfile* gainprofilevxy; + // int lastRunNumberTimeRec = -999; + // for time since start of run + // int runForStartTime = -999; + // uint64_t runStartTime = 0; + using MyCollisions = soa::Join; using AllTrackCandidates = soa::Join; @@ -180,6 +195,14 @@ struct zdcvector { return; } + // -------- define time since run start -------- + /*uint64_t ts = bc.timestamp(); + if (currentRunNumber != runForStartTime) { + runStartTime = ts; + runForStartTime = currentRunNumber; + } + double tsec = 1.e-3 * static_cast(ts - runStartTime); + */ histos.fill(HIST("hEvtSelInfo"), 1.5); auto zdc = bc.zdc(); @@ -187,6 +210,7 @@ struct zdcvector { auto znaEnergy = zdc.energySectorZNA(); auto zncEnergycommon = zdc.energyCommonZNC(); auto znaEnergycommon = zdc.energyCommonZNA(); + auto beamEne = 5.36 * 0.5; if (znaEnergycommon <= 0.0 || zncEnergycommon <= 0.0) { triggerevent = false; @@ -222,6 +246,14 @@ struct zdcvector { } histos.fill(HIST("hEvtSelInfo"), 5.5); + /*histos.fill(HIST("hZNA0"), centrality, znaEnergy[0]); + histos.fill(HIST("hZNA1"), centrality, znaEnergy[1]); + histos.fill(HIST("hZNA2"), centrality, znaEnergy[2]); + histos.fill(HIST("hZNA3"), centrality, znaEnergy[3]); + histos.fill(HIST("hZNC0"), centrality, zncEnergy[0]); + histos.fill(HIST("hZNC1"), centrality, zncEnergy[1]); + histos.fill(HIST("hZNC2"), centrality, zncEnergy[2]); + histos.fill(HIST("hZNC3"), centrality, zncEnergy[3]);*/ if (additionalEvSel && (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { triggerevent = false; @@ -244,6 +276,8 @@ struct zdcvector { auto alphaZDC = 0.395; constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75}; constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75}; + double zncEnergycommonsum = 0.0; + double znaEnergycommonsum = 0.0; histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); @@ -252,6 +286,7 @@ struct zdcvector { constexpr std::size_t ntow = 8; for (std::size_t iChA = 0; iChA < ntow; iChA++) { auto chanelid = iChA; + gainequal = 1.0; if (useGainCallib && gainprofile) { gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5)); } @@ -264,6 +299,7 @@ struct zdcvector { return; } else { double ampl = gainequal * znaEnergy[iChA]; + znaEnergycommonsum += ampl; if (followpub) { ampl = std::pow(ampl, alphaZDC); } @@ -280,6 +316,7 @@ struct zdcvector { return; } else { double ampl = gainequal * zncEnergy[iChA - 4]; + zncEnergycommonsum += ampl; if (followpub) { ampl = std::pow(ampl, alphaZDC); } @@ -291,13 +328,26 @@ struct zdcvector { } } + auto cZNC = 1.0; + auto cZNA = 1.0; + if (sumA > 0) { - qxZDCA = qxZDCA / sumA; - qyZDCA = qyZDCA / sumA; + float nSpecnA = znaEnergycommonsum / beamEne; + if (usecfactor) + cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789); + else + cZNA = 1.0; + qxZDCA = cZNA * (qxZDCA / sumA); + qyZDCA = cZNA * (qyZDCA / sumA); } if (sumC > 0) { - qxZDCC = qxZDCC / sumC; - qyZDCC = qyZDCC / sumC; + float nSpecnC = zncEnergycommonsum / beamEne; + if (usecfactor) + cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789); + else + cZNC = 1.0; + qxZDCC = cZNC * (qxZDCC / sumC); + qyZDCC = cZNC * (qyZDCC / sumC); } if (sumA <= 1e-4 || sumC <= 1e-4) { @@ -322,6 +372,8 @@ struct zdcvector { gainprofilevxy = ccdb->getForTimeStamp(confGainPathVxy.value, bc.timestamp()); } + // LOG(info)<<"*****time stamp is:"<GetBinContent(1); vy = vy - gainprofilevxy->GetBinContent(2); diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 50c891f43f2..c181e4293c0 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -90,6 +90,7 @@ struct lambdapolsp { TH1D* hwgtAL; TH1D* heffL; TH1D* heffAL; + TH1D* hwgtRESO; // fill output struct : ConfigurableGroup { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; @@ -154,13 +155,16 @@ struct lambdapolsp { Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for Lambda daughters"}; Configurable usesubdet{"usesubdet", false, "use subdet"}; Configurable useAccCorr{"useAccCorr", false, "use acceptance correction"}; + Configurable useResoRBR{"useResoRBR", false, "use resolution correction RBR"}; Configurable useyldwgt{"useyldwgt", false, "use yield weight"}; Configurable useeffwgt{"useeffwgt", false, "use eff weight"}; + Configurable usepsisubbeforeshift{"usepsisubbeforeshift", false, "use psi for sub detectors before shift modification"}; Configurable ConfAccPathL{"ConfAccPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to acceptance correction for Lambda"}; Configurable ConfAccPathAL{"ConfAccPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrAL", "Path to acceptance correction for AntiLambda"}; Configurable ConfWgtPathAL{"ConfWgtPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to yield weight correction for AntiLambda"}; Configurable ConfEffWgtPathL{"ConfEffWgtPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to eff weight correction for Lambda"}; Configurable ConfEffWgtPathAL{"ConfEffWgtPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to eff weight correction for AntiLambda"}; + Configurable ConfResoPath{"ConfResoPath", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to resolution correction run by run"}; struct : ConfigurableGroup { Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; @@ -213,12 +217,13 @@ struct lambdapolsp { ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"}; ConfigurableAxis configbinAxis{"configbinAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "BA"}; } axisGrp; + /* struct : ConfigurableGroup { ConfigurableAxis axisVertex{"axisVertex", {5, -10, 10}, "vertex axis for bin"}; ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {8, 0, 80}, "multiplicity percentile for bin"}; Configurable nMix{"nMix", 5, "number of event mixing"}; } meGrp; - + */ struct : ConfigurableGroup { ConfigurableAxis axisCosine{"axisCosine", {100, 0, 1}, "cosine axis"}; ConfigurableAxis axisRadius{"axisRadius", {200, 0, 100}, "radius axis"}; @@ -230,6 +235,8 @@ struct lambdapolsp { Configurable filldist{"filldist", true, "fill topo distr"}; Configurable lowmasscut{"lowmasscut", 1.11, "low mass cut"}; Configurable highmasscut{"highmasscut", 1.12, "high mass cut"}; + ConfigurableAxis axiscosphiminuspsi{"axiscosphiminuspsi", {200, -1, 1}, "cosphiminuspsi"}; + ConfigurableAxis axiseta{"axiseta", {16, -0.8, 0.8}, "eta axis"}; } distGrp; RCTFlagsChecker rctChecker; @@ -436,7 +443,7 @@ struct lambdapolsp { } if (distGrp.filldist) { - histos.add("hcosinelambda", "hcosinelambda", HistType::kTH1D, {distGrp.axisCosine}, true); + /*histos.add("hcosinelambda", "hcosinelambda", HistType::kTH1D, {distGrp.axisCosine}, true); histos.add("hdcabwv0daughlambda", "hdcabwv0daughlambda", HistType::kTH1D, {distGrp.axisDca}, true); histos.add("hlifetimelambda", "hlifetimelambda", HistType::kTH1D, {distGrp.axisLT}, true); histos.add("hradiuslambda", "hradiuslambda", HistType::kTH1D, {distGrp.axisRadius}, true); @@ -459,6 +466,13 @@ struct lambdapolsp { histos.add("htpcnegantilambda", "htpcnegantilambda", HistType::kTH1D, {distGrp.axisnsig}, true); histos.add("hptposantilambda", "hptposantilambda", HistType::kTH1D, {distGrp.axispt}, true); histos.add("hptnegantilambda", "hptnegantilambda", HistType::kTH1D, {distGrp.axispt}, true); + */ + histos.add("hALcosphiminuspsiCvseta", "hALcosphiminuspsiCvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hALcosphiminuspsiAvseta", "hALcosphiminuspsiAvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hALcosphiminuspsivseta", "hALcosphiminuspsivseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hLcosphiminuspsiCvseta", "hLcosphiminuspsiCvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hLcosphiminuspsiAvseta", "hLcosphiminuspsiAvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hLcosphiminuspsivseta", "hLcosphiminuspsivseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); } histos.add("hSparseGenLambda", "hSparseGenLambda", HistType::kTHnSparseF, runaxes2, true); @@ -499,8 +513,12 @@ struct lambdapolsp { ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); LOGF(info, "Getting alignment offsets from the CCDB..."); hwgtAL = ccdb->getForTimeStamp(ConfWgtPathAL.value, cfgCcdbParam.nolaterthan.value); - heffL = ccdb->getForTimeStamp(ConfEffWgtPathL.value, cfgCcdbParam.nolaterthan.value); - heffAL = ccdb->getForTimeStamp(ConfEffWgtPathAL.value, cfgCcdbParam.nolaterthan.value); + if (useeffwgt) { + heffL = ccdb->getForTimeStamp(ConfEffWgtPathL.value, cfgCcdbParam.nolaterthan.value); + heffAL = ccdb->getForTimeStamp(ConfEffWgtPathAL.value, cfgCcdbParam.nolaterthan.value); + } + if (useResoRBR) + hwgtRESO = ccdb->getForTimeStamp(ConfResoPath.value, cfgCcdbParam.nolaterthan.value); } template @@ -733,7 +751,7 @@ struct lambdapolsp { void fillHistograms(bool tag1, bool tag2, const ROOT::Math::PxPyPzMVector& particle, const ROOT::Math::PxPyPzMVector& daughter, double psiZDCC, double psiZDCA, double psiZDC, double centrality, - double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor) + double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor, double resowgt) { TRandom3 randPhi(0); @@ -761,6 +779,11 @@ struct lambdapolsp { // auto phiphiStar = GetPhiInRange(particle.Phi() - phiangle); acvalue = (4 / 3.14) * acvalue; + if (useResoRBR) { + Pol = Pol / resowgt; + PolA = PolA / resowgt; + PolC = PolC / resowgt; + } // PolC = PolC / acvalue; // PolA = PolA / acvalue; // Pol = Pol / acvalue; @@ -985,7 +1008,10 @@ struct lambdapolsp { auto qyZDCC = collision.qyZDCC(); auto psiZDCC = collision.psiZDCC(); auto psiZDCA = collision.psiZDCA(); - + if (usepsisubbeforeshift) { + psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); + psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); + } if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -999,6 +1025,7 @@ struct lambdapolsp { } auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane*/ + /*if (useonlypsis) { psiZDC = psiZDCC - psiZDCA; }*/ @@ -1043,6 +1070,15 @@ struct lambdapolsp { } } + double resowgt = 1.0; + + if (useResoRBR) { + int binxreso = hwgtRESO->GetXaxis()->FindBin(centrality + 0.000001); + resowgt = hwgtRESO->GetBinContent(binxreso); + } else { + resowgt = 1.0; + } + ///////////checking v1//////////////////////////////// if (checkwithpub) { @@ -1262,7 +1298,7 @@ struct lambdapolsp { acvalue = 1.0; } if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { - histos.fill(HIST("hcosinelambda"), v0.v0cosPA()); + /*histos.fill(HIST("hcosinelambda"), v0.v0cosPA()); histos.fill(HIST("hdcabwv0daughlambda"), v0.dcaV0daughters()); histos.fill(HIST("hlifetimelambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); histos.fill(HIST("hradiuslambda"), v0.v0radius()); @@ -1272,9 +1308,16 @@ struct lambdapolsp { histos.fill(HIST("htpcposlambda"), postrack.tpcNSigmaPr()); histos.fill(HIST("htpcneglambda"), negtrack.tpcNSigmaPi()); histos.fill(HIST("hptposlambda"), Proton.Pt()); - histos.fill(HIST("hptneglambda"), AntiPion.Pt()); + histos.fill(HIST("hptneglambda"), AntiPion.Pt());*/ + auto phiL = TMath::ATan2(v0.py(), v0.px()); + auto LcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiL - psiZDCC)); + auto LcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiL - psiZDCA)); + auto Lcosphiminuspsi = TMath::Cos(GetPhiInRange(phiL - psiZDC)); + histos.fill(HIST("hLcosphiminuspsiCvseta"), LcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hLcosphiminuspsiAvseta"), LcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hLcosphiminuspsivseta"), Lcosphiminuspsi, v0.eta()); } - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0); + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); } tagb = aLambdaTag; @@ -1289,7 +1332,7 @@ struct lambdapolsp { acvalue = 1.0; } if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { - histos.fill(HIST("hcosineantilambda"), v0.v0cosPA()); + /*histos.fill(HIST("hcosineantilambda"), v0.v0cosPA()); histos.fill(HIST("hdcabwv0daughantilambda"), v0.dcaV0daughters()); histos.fill(HIST("hlifetimeantilambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); histos.fill(HIST("hradiusantilambda"), v0.v0radius()); @@ -1299,9 +1342,16 @@ struct lambdapolsp { histos.fill(HIST("htpcposantilambda"), postrack.tpcNSigmaPi()); histos.fill(HIST("htpcnegantilambda"), negtrack.tpcNSigmaPr()); histos.fill(HIST("hptposantilambda"), Pion.Pt()); - histos.fill(HIST("hptnegantilambda"), AntiProton.Pt()); + histos.fill(HIST("hptnegantilambda"), AntiProton.Pt());*/ + auto phiAL = TMath::ATan2(v0.py(), v0.px()); + auto ALcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiAL - psiZDCC)); + auto ALcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiAL - psiZDCA)); + auto ALcosphiminuspsi = TMath::Cos(GetPhiInRange(phiAL - psiZDC)); + histos.fill(HIST("hALcosphiminuspsiCvseta"), ALcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hALcosphiminuspsiAvseta"), ALcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hALcosphiminuspsivseta"), ALcosphiminuspsi, v0.eta()); } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue); + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue, resowgt); } } } @@ -1374,7 +1424,10 @@ struct lambdapolsp { auto qyZDCC = collision.qyZDCC(); auto psiZDCC = collision.psiZDCC(); auto psiZDCA = collision.psiZDCA(); - + if (usepsisubbeforeshift) { + psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); + psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); + } if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -1451,6 +1504,14 @@ struct lambdapolsp { } } + double resowgt = 1.0; + if (useResoRBR) { + int binxreso = hwgtRESO->GetXaxis()->FindBin(centrality + 0.000001); + resowgt = hwgtRESO->GetBinContent(binxreso); + } else { + resowgt = 1.0; + } + //___________________________________________________________________________________________________ // loop over V0s as necessary for (const auto& v0 : V0s) { @@ -1509,7 +1570,7 @@ struct lambdapolsp { if (analyzeK0s && K0sTag) { K0s = Pion + AntiPion; double acvalue = 1.0; - fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0); + fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); } int binxwgt; @@ -1544,8 +1605,18 @@ struct lambdapolsp { } else { acvalue = 1.0; } - // double acvalue = 1.0; - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, (1. / effwgtvalueL)); + + if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { + auto phiL = TMath::ATan2(v0.py(), v0.px()); + auto LcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiL - psiZDCC)); + auto LcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiL - psiZDCA)); + auto Lcosphiminuspsi = TMath::Cos(GetPhiInRange(phiL - psiZDC)); + histos.fill(HIST("hLcosphiminuspsiCvseta"), LcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hLcosphiminuspsiAvseta"), LcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hLcosphiminuspsivseta"), Lcosphiminuspsi, v0.eta()); + } + + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, (1. / effwgtvalueL), resowgt); } tagb = aLambdaTag; @@ -1560,7 +1631,18 @@ struct lambdapolsp { } else { acvalue = 1.0; } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue * (1. / effwgtvalueAL)); + + if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { + auto phiAL = TMath::ATan2(v0.py(), v0.px()); + auto ALcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiAL - psiZDCC)); + auto ALcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiAL - psiZDCA)); + auto ALcosphiminuspsi = TMath::Cos(GetPhiInRange(phiAL - psiZDC)); + histos.fill(HIST("hALcosphiminuspsiCvseta"), ALcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hALcosphiminuspsiAvseta"), ALcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hALcosphiminuspsivseta"), ALcosphiminuspsi, v0.eta()); + } + + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue * (1. / effwgtvalueAL), resowgt); } } // lastRunNumber = currentRunNumber; From 5be9c9c26cbc52bf6c9d7311efa33bb2cf34226d Mon Sep 17 00:00:00 2001 From: aferrero2707 Date: Sat, 28 Mar 2026 02:25:47 +0100 Subject: [PATCH 083/282] [PWGDQ] updated muonGlobalAlignment task (#15538) --- PWGDQ/Tasks/muonGlobalAlignment.cxx | 242 ++++++++++++++++++++++------ 1 file changed, 192 insertions(+), 50 deletions(-) diff --git a/PWGDQ/Tasks/muonGlobalAlignment.cxx b/PWGDQ/Tasks/muonGlobalAlignment.cxx index 7ffbc5f2c6c..c2af75b9639 100644 --- a/PWGDQ/Tasks/muonGlobalAlignment.cxx +++ b/PWGDQ/Tasks/muonGlobalAlignment.cxx @@ -32,6 +32,8 @@ #include #include +#include "rapidjson/document.h" + #include #include #include @@ -114,6 +116,7 @@ struct muonGlobalAlignment { Configurable fChamberResolutionX{"cfgChamberResolutionX", 0.4, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb Configurable fChamberResolutionY{"cfgChamberResolutionY", 0.4, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb Configurable fSigmaCutImprove{"cfgSigmaCutImprove", 6., "Sigma cut for track improvement"}; + Configurable fMCHRealignCorrections{"cfgMCHRealignCorrections", "", "MCH DE positions/angles corrections in JSON format"}; } configRealign; //// Variables for ccdb @@ -167,6 +170,13 @@ struct muonGlobalAlignment { TrackFitter trackFitter; // Track fitter from MCH tracking library double mImproveCutChi2; // Chi2 cut for track improvement. + struct AlignmentCorrections { + double x{0}; + double y{0}; + double z{0}; + }; + std::map mMchAlignmentCorrections; + Preslice perMuon = aod::fwdtrkcl::fwdtrackId; o2::aod::rctsel::RCTFlagsChecker rctChecker{"CBT_muon_glo", false, false, true}; @@ -361,6 +371,26 @@ struct muonGlobalAlignment { trackFitter.useChamberResolution(); mImproveCutChi2 = 2. * configRealign.fSigmaCutImprove * configRealign.fSigmaCutImprove; + // Fill table of MCH alignment corrections + rapidjson::Document document; + // Check that the json is parsed correctly + rapidjson::ParseResult jsonOk = document.Parse(configRealign.fMCHRealignCorrections.value.c_str()); + if (jsonOk) { + for (rapidjson::Value::ConstMemberIterator it = document.MemberBegin(); it != document.MemberEnd(); it++) { + LOG(info) << "DE" << it->name.GetString() << " alignment corrections:"; + LOG(info) << " x: " << it->value["x"].GetDouble(); + LOG(info) << " y: " << it->value["y"].GetDouble(); + LOG(info) << " z: " << it->value["z"].GetDouble(); + + mMchAlignmentCorrections[std::stoi(it->name.GetString())] = { + it->value["x"].GetDouble(), + it->value["y"].GetDouble(), + it->value["z"].GetDouble()}; + } + } else { + LOG(error) << "JSON parse error: " << rapidjson::GetParseErrorFunc(jsonOk.Code()) << " (" << jsonOk.Offset() << ")"; + } + float mftLadderWidth = 1.7; AxisSpec dcaxMFTAxis = {400, -0.5, 0.5, "DCA_{x} (cm)"}; AxisSpec dcayMFTAxis = {400, -0.5, 0.5, "DCA_{y} (cm)"}; @@ -375,6 +405,8 @@ struct muonGlobalAlignment { AxisSpec vyAxis = {400, -0.5, 0.5, "vtx_{y} (cm)"}; AxisSpec vzAxis = {1000, -10.0, 10.0, "vtx_{z} (cm)"}; AxisSpec phiAxis = {36, -180.0, 180.0, "#phi (degrees)"}; + AxisSpec sxAxis = {50, -0.25, 0.25, "x slope"}; + AxisSpec syAxis = {50, -0.25, 0.25, "y slope"}; AxisSpec momAxis = {500, 0, 100.0, "p (GeV/c)"}; AxisSpec nMftClustersAxis = {6, 5, 11, "# of clusters"}; AxisSpec mftTrackTypeAxis = {2, 0, 2, "track type"}; @@ -395,6 +427,11 @@ struct muonGlobalAlignment { if (fEnableVertexShiftAnalysis) { registry.add("DCA/MFT/DCA_x_vs_phi_vs_zshift", std::format("DCA(x) vs. #phi vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, phiAxis, dcaxMFTAxis}}); registry.add("DCA/MFT/DCA_y_vs_phi_vs_zshift", std::format("DCA(y) vs. #phi vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, phiAxis, dcayMFTAxis}}); + + registry.add("DCA/MFT/DCA_x_vs_slopex_vs_zshift", std::format("DCA(x) vs. x slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, sxAxis, dcaxMFTAxis}}); + registry.add("DCA/MFT/DCA_x_vs_slopey_vs_zshift", std::format("DCA(x) vs. y slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, syAxis, dcaxMFTAxis}}); + registry.add("DCA/MFT/DCA_y_vs_slopex_vs_zshift", std::format("DCA(y) vs. x slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, sxAxis, dcayMFTAxis}}); + registry.add("DCA/MFT/DCA_y_vs_slopey_vs_zshift", std::format("DCA(y) vs. y slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, syAxis, dcayMFTAxis}}); } if (fEnableMftDcaAnalysis) { @@ -438,6 +475,9 @@ struct muonGlobalAlignment { registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom", std::format("DCA(x) vs. p, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom", std::format("DCA(y) vs. p, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); + registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom_corr", std::format("DCA(x) vs. p, quadrant, chargeSign (with corrections)").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); + registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom_corr", std::format("DCA(y) vs. p, quadrant, chargeSign (with corrections)").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); + registry.add("residuals/dx_vs_chamber", "Cluster x residual vs. chamber, quadrant, chargeSign", {HistType::kTHnSparseF, {{10, 1, 11, "chamber"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dxAxis}}); registry.add("residuals/dy_vs_chamber", "Cluster y residual vs. chamber, quadrant, chargeSign", @@ -448,6 +488,16 @@ struct muonGlobalAlignment { registry.add("residuals/dy_vs_de", "Cluster y residual vs. DE, quadrant, chargeSign, momentum", {HistType::kTHnSparseF, {dyAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("residuals/dx_vs_chamber_corr", "Cluster x residual vs. chamber, quadrant, chargeSign (with corrections)", + {HistType::kTHnSparseF, {{10, 1, 11, "chamber"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dxAxis}}); + registry.add("residuals/dy_vs_chamber_corr", "Cluster y residual vs. chamber, quadrant, chargeSign (with corrections)", + {HistType::kTHnSparseF, {{10, 1, 11, "chamber"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dyAxis}}); + + registry.add("residuals/dx_vs_de_corr", "Cluster x residual vs. DE, quadrant, chargeSign, momentum (with corrections)", + {HistType::kTHnSparseF, {dxAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("residuals/dy_vs_de_corr", "Cluster y residual vs. DE, quadrant, chargeSign, momentum (with corrections)", + {HistType::kTHnSparseF, {dyAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + if (fEnableMftMchResidualsExtraPlots) { registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_vz", std::format("DCA(x) vs. vz, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {dcazAxis, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_vz", std::format("DCA(y) vs. vz, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {dcazAxis, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); @@ -917,7 +967,7 @@ struct muonGlobalAlignment { return fwdtrack; } - void TransformMFT(o2::mch::TrackParam& track) + void TransformMFTPar(o2::mch::TrackParam& track) { // double zCH10 = -1437.6; double z = track.getZ(); @@ -950,7 +1000,7 @@ struct muonGlobalAlignment { { auto mchTrack = FwdtoMCH(track); - TransformMFT(mchTrack); + TransformMFTPar(mchTrack); auto transformedTrack = sExtrap.MCHtoFwd(mchTrack); track.setParameters(transformedTrack.getParameters()); @@ -967,7 +1017,7 @@ struct muonGlobalAlignment { auto mchTrack = FwdtoMCH(track); - TransformMFT(mchTrack); + TransformMFTPar(mchTrack); auto transformedTrack = sExtrap.MCHtoFwd(mchTrack); fwdtrack.setParameters(transformedTrack.getParameters()); @@ -1217,11 +1267,11 @@ struct muonGlobalAlignment { return propmuon; } - template - o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH(const TMFT& mftTrack, const TMCH& mchTrack, const double z) + template + o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH(const TMFT& mftTrack, const o2::mch::TrackParam& mchTrackPar, const double z) { // extrapolation with MCH tools - auto mchTrackAtMFT = FwdtoMCH(FwdToTrackPar(mchTrack)); + auto mchTrackAtMFT = mchTrackPar; o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrackAtMFT, mftTrack.z()); auto mftTrackPar = FwdToTrackPar(mftTrack); @@ -1232,24 +1282,13 @@ struct muonGlobalAlignment { UpdateTrackMomentum(mftTrackProp, mchTrackAtMFT); if (z < -505.f) { o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -466.f); - UpdateTrackMomentum(mftTrackProp, sExtrap.FwdtoMCH(FwdToTrackPar(mchTrack))); + UpdateTrackMomentum(mftTrackProp, mchTrackPar); } o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z); return MCHtoFwd(mftTrackProp); } - template - o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH_(const TMFT& mftTrack, const TMCH& mchTrack, const double z) - { - // extrapolation with MCH tools - auto mftTrackProp = sExtrap.FwdtoMCH(FwdToTrackPar(mftTrack)); - UpdateTrackMomentum(mftTrackProp, sExtrap.FwdtoMCH(FwdToTrackPar(mchTrack))); - o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z); - - return sExtrap.MCHtoFwd(mftTrackProp); - } - void FillDCAPlots(MyEvents const& collisions, MyBCs const& bcs, MyMuonsWithCov const& muonTracks, @@ -1346,7 +1385,7 @@ struct muonGlobalAlignment { } if (fEnableVertexShiftAnalysis) { - if (mftTrack.chi2() <= fTrackChi2MftUp && std::fabs(collision.posZ()) < 1.f) { + if (mftTrack.chi2() <= fTrackChi2MftUp && std::fabs(collision.posZ()) < 1.f && mftNclusters >= 6) { float zshift[21] = {// in millimeters -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0}; @@ -1356,6 +1395,14 @@ struct muonGlobalAlignment { double dcayShifted = mftTrackAtDCAshifted.getY() - collision.posY(); registry.get(HIST("DCA/MFT/DCA_x_vs_phi_vs_zshift"))->Fill(zshift[zi], phi, dcaxShifted); registry.get(HIST("DCA/MFT/DCA_y_vs_phi_vs_zshift"))->Fill(zshift[zi], phi, dcayShifted); + + auto mftTrackAtDCAshiftedPar = FwdtoMCH(mftTrackAtDCAshifted); + auto slopex = mftTrackAtDCAshiftedPar.getNonBendingSlope(); + auto slopey = mftTrackAtDCAshiftedPar.getBendingSlope(); + registry.get(HIST("DCA/MFT/DCA_x_vs_slopex_vs_zshift"))->Fill(zshift[zi], slopex, dcaxShifted); + registry.get(HIST("DCA/MFT/DCA_x_vs_slopey_vs_zshift"))->Fill(zshift[zi], slopey, dcaxShifted); + registry.get(HIST("DCA/MFT/DCA_y_vs_slopex_vs_zshift"))->Fill(zshift[zi], slopex, dcayShifted); + registry.get(HIST("DCA/MFT/DCA_y_vs_slopey_vs_zshift"))->Fill(zshift[zi], slopey, dcayShifted); } } } @@ -1386,7 +1433,7 @@ struct muonGlobalAlignment { continue; } - bool isGoodMFT = IsGoodMFT(mftTrack, 999.f, 5); + bool isGoodMFT = IsGoodMFT(mftTrack, fTrackChi2MftUp, 5); if (!isGoodMFT) { continue; } @@ -1409,6 +1456,68 @@ struct muonGlobalAlignment { } } + template + bool MchRealignTrack(const TMUON& mchTrack, const TCLUS& clusters, TrackRealigned& convertedTrack, bool applyCorrections) + { + // loop over attached clusters + int clIndex = -1; + auto clustersSliced = clusters.sliceBy(perMuon, mchTrack.globalIndex()); // Slice clusters by muon id + for (auto const& cluster : clustersSliced) { + clIndex += 1; + + int deId = cluster.deId(); + int chamber = deId / 100 - 1; + if (chamber < 0 || chamber > 9) { + continue; + } + + math_utils::Point3D local; + math_utils::Point3D master; + + master.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + + if (configRealign.fEnableMCHRealign) { + // Transformation from reference geometry frame to new geometry frame + transformRef[cluster.deId()].MasterToLocal(master, local); + transformNew[cluster.deId()].LocalToMaster(local, master); + } + + if (applyCorrections) { + auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId()); + if (correctionsIt != mMchAlignmentCorrections.end()) { + const auto& corrections = correctionsIt->second; + master.SetX(master.x() + corrections.x); + master.SetY(master.y() + corrections.y); + master.SetZ(master.z() + corrections.z); + } + } + + // realigned MCH cluster + mch::Cluster* clusterMCH = new mch::Cluster(); + clusterMCH->x = master.x(); + clusterMCH->y = master.y(); + clusterMCH->z = master.z(); + + uint32_t ClUId = mch::Cluster::buildUniqueId(static_cast(cluster.deId() / 100) - 1, cluster.deId(), clIndex); + clusterMCH->uid = ClUId; + clusterMCH->ex = cluster.isGoodX() ? 0.2 : 10.0; + clusterMCH->ey = cluster.isGoodY() ? 0.2 : 10.0; + + // Add transformed cluster into temporary variable + convertedTrack.createParamAtCluster(*clusterMCH); + } + + bool removable{false}; + // Refit the re-aligned track + if (convertedTrack.getNClusters() != 0) { + removable = RemoveTrack(convertedTrack); + } else { + LOGF(fatal, "Muon track %d has no associated clusters.", mchTrack.globalIndex()); + } + + return !removable; + } + void FillResidualsPlots(MyEvents const& collisions, MyBCs const& bcs, MyMuonsWithCov const& muonTracks, @@ -1445,13 +1554,23 @@ struct muonGlobalAlignment { if (!isGoodMFT) continue; + // refit MCH track if enabled TrackRealigned convertedTrack; + bool convertedTrackOk = false; + if (configRealign.fEnableMCHRealign) { + convertedTrackOk = MchRealignTrack(mchTrack, clusters, convertedTrack, false); + } + + // apply alignment corrections if available + TrackRealigned convertedTrackWithCorr; + bool convertedTrackWithCorrOk = false; + if (!mMchAlignmentCorrections.empty()) { + convertedTrackWithCorrOk = MchRealignTrack(mchTrack, clusters, convertedTrackWithCorr, true); + } + // loop over attached clusters - int clIndex = -1; auto clustersSliced = clusters.sliceBy(perMuon, mchTrack.globalIndex()); // Slice clusters by muon id for (auto const& cluster : clustersSliced) { - clIndex += 1; - int deId = cluster.deId(); int chamber = deId / 100 - 1; if (chamber < 0 || chamber > 9) @@ -1460,51 +1579,65 @@ struct muonGlobalAlignment { math_utils::Point3D local; math_utils::Point3D master; + math_utils::Point3D masterWithCorr; master.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + masterWithCorr.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + // apply realignment to MCH cluster if (configRealign.fEnableMCHRealign) { // Transformation from reference geometry frame to new geometry frame transformRef[cluster.deId()].MasterToLocal(master, local); transformNew[cluster.deId()].LocalToMaster(local, master); + transformNew[cluster.deId()].LocalToMaster(local, masterWithCorr); + } - mch::Cluster* clusterMCH = new mch::Cluster(); - clusterMCH->x = master.x(); - clusterMCH->y = master.y(); - clusterMCH->z = master.z(); + // apply alignment corrections to MCH cluster (if available) + if (!mMchAlignmentCorrections.empty()) { + auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId()); + if (correctionsIt != mMchAlignmentCorrections.end()) { + const auto& corrections = correctionsIt->second; + masterWithCorr.SetX(masterWithCorr.x() + corrections.x); + masterWithCorr.SetY(masterWithCorr.y() + corrections.y); + masterWithCorr.SetZ(masterWithCorr.z() + corrections.z); + } + } - uint32_t ClUId = mch::Cluster::buildUniqueId(static_cast(cluster.deId() / 100) - 1, cluster.deId(), clIndex); - clusterMCH->uid = ClUId; - clusterMCH->ex = cluster.isGoodX() ? 0.2 : 10.0; - clusterMCH->ey = cluster.isGoodY() ? 0.2 : 10.0; + // MFT-MCH residuals (MCH cluster is realigned if enabled) + // if the realignment is enabled and successful, the MFT track is extrpolated + // by taking the momentum from the MCH track refitted with the new alignment + if (!configRealign.fEnableMCHRealign || convertedTrackOk) { + auto mftTrackAtCluster = configRealign.fEnableMCHRealign ? PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrack.first()), master.z()) : PropagateMFTtoMCH(mftTrack, FwdtoMCH(FwdToTrackPar(mchTrack)), master.z()); - // Add transformed cluster into temporary variable - convertedTrack.createParamAtCluster(*clusterMCH); - } + std::array xPos{master.x(), mftTrackAtCluster.getX()}; + std::array yPos{master.y(), mftTrackAtCluster.getY()}; - auto mftTrackAtCluster = PropagateMFTtoMCH(mftTrack, mchTrack, master.z()); + registry.get(HIST("residuals/dx_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); + registry.get(HIST("residuals/dy_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); - std::array xPos{master.x(), mftTrackAtCluster.getX()}; - std::array yPos{master.y(), mftTrackAtCluster.getY()}; + registry.get(HIST("residuals/dx_vs_de"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dy_vs_de"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + } - registry.get(HIST("residuals/dx_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); - registry.get(HIST("residuals/dy_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); + // MFT-MCH residuals with realigned and/or corrected MCH clusters + // if the alignment corrections are available and the refitting is successful, the MFT track is extrpolated + // by taking the momentum from the MCH track refitted with the alignment corrections and the new + // alignment (if realignment is enabled) + if (convertedTrackWithCorrOk) { + auto mftTrackAtClusterWithCorr = PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrackWithCorr.first()), masterWithCorr.z()); - registry.get(HIST("residuals/dx_vs_de"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - registry.get(HIST("residuals/dy_vs_de"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - } + std::array xPos{masterWithCorr.x(), mftTrackAtClusterWithCorr.getX()}; + std::array yPos{masterWithCorr.y(), mftTrackAtClusterWithCorr.getY()}; - bool removable{false}; - if (configRealign.fEnableMCHRealign) { - // Refit the re-aligned track - if (convertedTrack.getNClusters() != 0) { - removable = RemoveTrack(convertedTrack); - } else { - LOGF(fatal, "Muon track %d has no associated clusters.", mchTrack.globalIndex()); + registry.get(HIST("residuals/dx_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); + registry.get(HIST("residuals/dy_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); + + registry.get(HIST("residuals/dx_vs_de_corr"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dy_vs_de_corr"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); } } - if (!removable) { + if (!configRealign.fEnableMCHRealign || convertedTrackOk) { auto mchTrackAtDCA = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrack, collision.posZ()) : PropagateMCH(mchTrack, collision.posZ()); auto dcax = mchTrackAtDCA.getX() - collision.posX(); auto dcay = mchTrackAtDCA.getY() - collision.posY(); @@ -1521,6 +1654,15 @@ struct muonGlobalAlignment { registry.get(HIST("residuals/dphi_at_mft"))->Fill(deltaPhi, mftTrack.x(), mftTrack.y(), posNeg, mchTrackAtMFT.getP()); } } + + if (convertedTrackWithCorrOk) { + auto mchTrackAtDCA = PropagateMCHRealigned(convertedTrackWithCorr, collision.posZ()); + auto dcax = mchTrackAtDCA.getX() - collision.posX(); + auto dcay = mchTrackAtDCA.getY() - collision.posY(); + + registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcax); + registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcay); + } } } } From a02daf734f5071e584365e8df36e029cd49686e9 Mon Sep 17 00:00:00 2001 From: ikantak <149821212+ikantak@users.noreply.github.com> Date: Sat, 28 Mar 2026 07:01:22 +0100 Subject: [PATCH 084/282] [PWGEM] Change pcmQCMC pT histograms from kTH1F to kTH1D (#15545) Co-authored-by: Isabel Kantak --- PWGEM/PhotonMeson/Core/V0PhotonCandidate.h | 2 +- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h index 2e98a0396b5..99c5afdc61b 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h @@ -71,7 +71,7 @@ struct V0PhotonCandidate { eleTPCSignal = ele.tpcSignal(); eleITSClusterSizes = ele.itsClusterSizes(); - chi2ndf = v0DecayVtx.GetChi2() / v0DecayVtx.GetNDF(); + chi2ndf = v0PV.GetChi2() / v0PV.GetNDF(); pca = posDecayVtx.GetDistanceFromParticle(eleDecayVtx); eta = RecoDecay::eta(std::array{px, py, pz}); posEta = RecoDecay::eta(std::array{posPx, posPy, posPz}); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index f35b926e50c..c7d269973be 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -233,9 +233,9 @@ struct PCMQCMC { const AxisSpec axis_rapidity{{0.0, +0.8, +0.9}, "rapidity |y_{#gamma}|"}; if (doprocessGen) { - fRegistry.add("Generated/hPt", "pT;p_{T} (GeV/c)", kTH1F, {axis_pt}, true); - fRegistry.add("Generated/hPtY", "Generated info", kTH2F, {axis_pt, axis_rapidity}, true); - fRegistry.add("Generated/hPt_ConversionPhoton", "converted photon pT;p_{T} (GeV/c)", kTH1F, {axis_pt}, true); + fRegistry.add("Generated/hPt", "pT;p_{T} (GeV/c)", kTH1D, {axis_pt}, true); + fRegistry.add("Generated/hPtY", "Generated info", kTH2D, {axis_pt, axis_rapidity}, true); + fRegistry.add("Generated/hPt_ConversionPhoton", "converted photon pT;p_{T} (GeV/c)", kTH1D, {axis_pt}, true); fRegistry.add("Generated/hY_ConversionPhoton", "converted photon y;rapidity y", kTH1F, {{40, -2.0f, 2.0f}}, true); fRegistry.add("Generated/hPhi_ConversionPhoton", "converted photon #varphi;#varphi (rad.)", kTH1F, {{180, 0, o2::constants::math::TwoPI}}, true); fRegistry.add("Generated/hXY", "conversion point in XY MC;V_{x} (cm);V_{y} (cm)", kTH2F, {{800, -100.0f, 100.0f}, {800, -100.0f, 100.0f}}, true); From 5c35140d423d2055cbdfef09c39bcdcff06e2c84 Mon Sep 17 00:00:00 2001 From: Stefanie Mrozinski <63045530+Steffimro@users.noreply.github.com> Date: Sat, 28 Mar 2026 10:03:35 +0000 Subject: [PATCH 085/282] [PWGEM] Add efficiency histograms + MC QA (#15552) - added ThnSparses to evaluate eta phi distribution at each reconstruction step in MC - added ThnSparses to calculate efficiency in kt bins for the CF - added new fake diagnostics in MC Co-authored-by: ALICE Action Bot --- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 1642 ++++++++++++++----------- 1 file changed, 932 insertions(+), 710 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 40a6599bb71..70285fbf054 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -62,9 +63,9 @@ /// Single-photon track-type combo. enum class V0Combo : int { Inclusive = 0, - ItstpcItstpc = 1, ///< both legs ITS+TPC - ItstpcTpconly = 2, ///< one ITS+TPC leg, one TPC-only - TpconlyTpconly = 3, ///< both legs TPC-only + ItstpcItstpc = 1, + ItstpcTpconly = 2, + TpconlyTpconly = 3, }; /// Photon-pair track-type combo. @@ -85,8 +86,10 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::dilepton::utils; +// EMMCEventLabels needed for processMC truth-efficiency loop using MyCollisions = soa::Join; + aod::EMEventsCent_000, aod::EMEventsQvec_001, + aod::EMMCEventLabels>; using MyCollision = MyCollisions::iterator; using MyV0Photons = soa::Join; @@ -97,29 +100,25 @@ using MyMCV0Leg = MyMCV0Legs::iterator; // ─── MC truth classification types ──────────────────────────────────────────── -/// Per-photon MC truth information built from the two V0 legs. struct PhotonMCInfo { - bool hasMC = false; // both legs have a valid MC label - bool sameMother = false; // both legs share the same MC mother - bool isTruePhoton = false; // mother PDG == 22 - - int mcPosId = -1; // MC particle index of the positive leg - int mcNegId = -1; // MC particle index of the negative leg - int motherId = -1; // MC particle index of the common mother + bool hasMC = false; + bool sameMother = false; + bool isTruePhoton = false; + int mcPosId = -1; + int mcNegId = -1; + int motherId = -1; int motherPdg = 0; - bool isPhysicalPrimary = false; }; -/// Classification of a photon pair at the MC-truth level. enum class PairTruthType : uint8_t { Unknown = 0, - TrueTrueDistinct, // both photons are true, from different MC photons - TrueTrueSamePhoton, // both photons are true, same MC photon (clone/split) - SharedMcLeg, // different reco tracks but same MC-level leg - TrueFake, // one photon is true, one is fake - FakeFake, // both photons are fake - Pi0Daughters, // both photons come from the same MC pi0 + TrueTrueDistinct, + TrueTrueSamePhoton, + SharedMcLeg, + TrueFake, + FakeFake, + Pi0Daughters, }; struct photonhbt { @@ -155,33 +154,24 @@ struct photonhbt { return static_cast(kTable[lo][hi]); } - // ─── Configurables: histogram axis bins ─────────────────────────────────── + // ─── Configurables ──────────────────────────────────────────────────────── - // HBT physics ConfigurableAxis confQBins{"confQBins", {60, 0, +0.3f}, "q bins for output histograms"}; - ConfigurableAxis confKtBins{"confKtBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6}, "kT bins"}; - - // Single-photon QA + ConfigurableAxis confKtBins{"confKtBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75}, "kT bins"}; ConfigurableAxis confPtBins{"confPtBins", {100, 0.f, 2.f}, "pT bins (GeV/c)"}; ConfigurableAxis confEtaBins{"confEtaBins", {80, -0.8f, 0.8f}, "eta bins"}; - ConfigurableAxis confPhiBins{"confPhiBins", {90, 0.f, o2::constants::math::TwoPI}, "phi bins (rad) — O2 track phi is in [0, 2pi]"}; - - // Pair angular - ConfigurableAxis confDeltaEtaBins{"confDeltaEtaBins", {100, -0.9f, +0.9f}, "Delta-eta bins"}; - ConfigurableAxis confDeltaPhiBins{"confDeltaPhiBins", {100, -o2::constants::math::PI, o2::constants::math::PI}, "Delta-phi bins (rad)"}; + ConfigurableAxis confPhiBins{"confPhiBins", {90, 0.f, o2::constants::math::TwoPI}, "phi bins (rad)"}; + ConfigurableAxis confDeltaEtaBins{"confDeltaEtaBins", {180, -1.6f, +1.6f}, "Delta-eta bins"}; + ConfigurableAxis confDeltaPhiBins{"confDeltaPhiBins", {180, -o2::constants::math::PI, o2::constants::math::PI}, "Delta-phi bins (rad)"}; ConfigurableAxis confEllipseValBins{"confEllipseValBins", {200, 0.f, 10.f}, "ellipse value bins"}; ConfigurableAxis confCosThetaBins{"confCosThetaBins", {100, 0.f, 1.f}, "cos(theta*) bins"}; ConfigurableAxis confOpeningAngleBins{"confOpeningAngleBins", {100, 0.f, o2::constants::math::PI}, "opening angle bins (rad)"}; - - // Pair geometry ConfigurableAxis confRBins{"confRBins", {100, 0.f, 100.f}, "conversion radius bins (cm)"}; ConfigurableAxis confDeltaRBins{"confDeltaRBins", {120, 0.f, 30.f}, "|R1-R2| bins (cm)"}; ConfigurableAxis confDeltaR3DBins{"confDeltaR3DBins", {100, 0.f, 100.f}, "3D distance between conversion points (cm)"}; ConfigurableAxis confDeltaRxyBins{"confDeltaRxyBins", {100, 0.f, 100.f}, "xy distance between conversion points (cm)"}; ConfigurableAxis confZConvBins{"confZConvBins", {200, -100.f, 100.f}, "conversion z (cm)"}; - ConfigurableAxis confDeltaZBins{"confDeltaZBins", {200, -100.f, 100.f}, "#Deltaz bins (cm)"}; ///< FIX: was missing - - // Event QA + ConfigurableAxis confDeltaZBins{"confDeltaZBins", {200, -100.f, 100.f}, "#Deltaz bins (cm)"}; ConfigurableAxis confOccupancyQA{"confOccupancyQA", {100, 0.f, 50000.f}, "occupancy"}; ConfigurableAxis confCentQABins{"confCentQABins", {110, 0.f, 110.f}, "centrality (%)"}; @@ -206,7 +196,7 @@ struct photonhbt { const AxisSpec axisDeltaR3D{confDeltaR3DBins, "|#vec{r}_{1}-#vec{r}_{2}| (cm)"}; const AxisSpec axisDeltaRxy{confDeltaRxyBins, "#Delta r_{xy} (cm)"}; const AxisSpec axisZConv{confZConvBins, "z_{conv} (cm)"}; - const AxisSpec axisDeltaZ{confDeltaZBins, "#Delta z (cm)"}; ///< FIX: was missing + const AxisSpec axisDeltaZ{confDeltaZBins, "#Delta z (cm)"}; const AxisSpec axisOccupancy{confOccupancyQA, "occupancy"}; const AxisSpec axisCentQA{confCentQABins, "centrality (%)"}; @@ -216,33 +206,43 @@ struct photonhbt { std::string prefix = "qaflags_group"; Configurable doPairQa{"doPairQa", true, "fill pair QA histograms at each cut step"}; Configurable doSinglePhotonQa{"doSinglePhotonQa", true, "fill single-photon QA histograms (pT, eta, phi)"}; - Configurable cfgMaxQinvForQA{"cfgMaxQinvForQA", 0.1f, - "fill per-step pair QA histograms (hDeltaEta, hDeltaPhi, THnSparses, ...) " - "only when q_inv < this value (GeV/c). " - "Set to the HBT signal region, typically 0.1. " - "Set <= 0 to disable the gate. The CF is always filled regardless."}; - Configurable cfgMaxQinvForFullRange{"cfgMaxQinvForFullRange", 0.3f, - "fill full-range histograms (hDeltaRVsQinv, hSparseDeltaRDeltaZQinv, ...) " - "only when q_inv < this value (GeV/c). " - "Should match the upper edge of confQBins (default 0.3) — " - "fills beyond the axis range only go into the overflow bin. " - "Set <= 0 to disable the gate."}; + Configurable cfgMaxQinvForQA{"cfgMaxQinvForQA", 0.1f, "fill per-step pair QA histograms only when q_inv < this value. Set <= 0 to disable."}; + Configurable cfgMaxQinvForFullRange{"cfgMaxQinvForFullRange", 0.3f, "fill full-range histograms only when q_inv < this value. Set <= 0 to disable."}; + Configurable cfgMaxQinvForMCQA{"cfgMaxQinvForMCQA", 0.3f, + "fill MC truth 1D histograms (hQinv, hKt, hDeltaEta, ...) only when q_inv < this value. " + "hDEtaDPhi is always filled (needs full sample). Set <= 0 to disable. Default 0.6 cuts " + "most combinatorics while covering well beyond the CF range for systematics."}; } qaflags; - // ─── Configurables: HBT kind ─────────────────────────────────────────────── - Configurable cfgDo3D{"cfgDo3D", false, "enable 3D (qout,qside,qlong) analysis"}; Configurable cfgDo2D{"cfgDo2D", false, "enable 2D (qout,qinv) projection (requires cfgDo3D)"}; Configurable cfgUseLCMS{"cfgUseLCMS", true, "measure 1D relative momentum in LCMS"}; - // ─── Configurables: events ───────────────────────────────────────────────── - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + Configurable cfgMCMaxQinv{"cfgMCMaxQinv", 0.3f, + "max q_{inv}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + Configurable cfgMCMinKt{"cfgMCMinKt", 0.0f, + "min k_{T}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + Configurable cfgMCMaxKt{"cfgMCMaxKt", 0.7f, + "max k_{T}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + struct : ConfigurableGroup { + std::string prefix = "mctruth_sparse_group"; + Configurable cfgFillDEtaDPhiVsQinvTrueTrueDistinct{"cfgFillDEtaDPhiVsQinvTrueTrueDistinct", true, "fill hDEtaDPhiVsQinv for TrueTrueDistinct pairs"}; + Configurable cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton{"cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton", false, "fill hDEtaDPhiVsQinv for TrueTrueSamePhoton pairs"}; + Configurable cfgFillDEtaDPhiVsQinvSharedMcLeg{"cfgFillDEtaDPhiVsQinvSharedMcLeg", false, "fill hDEtaDPhiVsQinv for SharedMcLeg pairs"}; + Configurable cfgFillDEtaDPhiVsQinvTrueFake{"cfgFillDEtaDPhiVsQinvTrueFake", false, "fill hDEtaDPhiVsQinv for TrueFake pairs"}; + Configurable cfgFillDEtaDPhiVsQinvFakeFake{"cfgFillDEtaDPhiVsQinvFakeFake", true, "fill hDEtaDPhiVsQinv for FakeFake pairs"}; + Configurable cfgFillDEtaDPhiVsQinvPi0Daughters{"cfgFillDEtaDPhiVsQinvPi0Daughters", false, "fill hDEtaDPhiVsQinv for Pi0Daughters pairs"}; + Configurable cfgFillDRDZQinvTrueTrueDistinct{"cfgFillDRDZQinvTrueTrueDistinct", true, "fill hSparseDeltaRDeltaZQinv for TrueTrueDistinct pairs"}; + Configurable cfgFillDRDZQinvTrueTrueSamePhoton{"cfgFillDRDZQinvTrueTrueSamePhoton", false, "fill hSparseDeltaRDeltaZQinv for TrueTrueSamePhoton pairs"}; + Configurable cfgFillDRDZQinvSharedMcLeg{"cfgFillDRDZQinvSharedMcLeg", false, "fill hSparseDeltaRDeltaZQinv for SharedMcLeg pairs"}; + Configurable cfgFillDRDZQinvTrueFake{"cfgFillDRDZQinvTrueFake", false, "fill hSparseDeltaRDeltaZQinv for TrueFake pairs"}; + Configurable cfgFillDRDZQinvFakeFake{"cfgFillDRDZQinvFakeFake", true, "fill hSparseDeltaRDeltaZQinv for FakeFake pairs"}; + Configurable cfgFillDRDZQinvPi0Daughters{"cfgFillDRDZQinvPi0Daughters", false, "fill hSparseDeltaRDeltaZQinv for Pi0Daughters pairs"}; + } mcthruth_sparse; Configurable maxY{"maxY", 0.9, "maximum rapidity"}; - // ─── Configurables: mixed event ──────────────────────────────────────────── - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; Configurable ndepth{"ndepth", 100, "depth for event mixing"}; Configurable ndiffBCMix{"ndiffBCMix", 594, "difference in global BC required for mixed events"}; @@ -255,26 +255,19 @@ struct photonhbt { ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}, "Mixing bins - EP angle"}; ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - // ─── Configurables: pair cuts ────────────────────────────────────────────── - struct : ConfigurableGroup { std::string prefix = "ggpaircut_group"; - // dr/cosOA cut Configurable cfgMinDRCosOA{"cfgMinDRCosOA", -1.f, "min. dr/cosOA; <0 = disabled"}; - // R/Z geometry cuts Configurable cfgDoRCut{"cfgDoRCut", false, "apply |R1-R2| > cfgMinDeltaR cut"}; Configurable cfgMinDeltaR{"cfgMinDeltaR", 0.f, "minimum |R1-R2| (cm)"}; Configurable cfgDoZCut{"cfgDoZCut", false, "apply |DeltaZ| > cfgMinDeltaZ cut"}; Configurable cfgMinDeltaZ{"cfgMinDeltaZ", 0.f, "minimum |DeltaZ| (cm)"}; - // Ellipse cut in (DeltaEta, DeltaPhi) Configurable cfgDoEllipseCut{"cfgDoEllipseCut", false, "reject pairs inside ellipse in DeltaEta-DeltaPhi"}; Configurable cfgEllipseSigEta{"cfgEllipseSigEta", 0.02f, "sigma_eta for ellipse cut"}; Configurable cfgEllipseSigPhi{"cfgEllipseSigPhi", 0.02f, "sigma_phi for ellipse cut"}; Configurable cfgEllipseR2{"cfgEllipseR2", 1.0f, "R^2 threshold: reject if ellipse value < R^2"}; } ggpaircuts; - // ─── Event cut ───────────────────────────────────────────────────────────── - EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -301,8 +294,6 @@ struct photonhbt { Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "all ITS layers OK"}; } eventcuts; - // ─── PCM cut ─────────────────────────────────────────────────────────────── - V0PhotonCut fV0PhotonCut; struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; @@ -341,6 +332,9 @@ struct photonhbt { } HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistryPairQA{"outputPairQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistryPairMC{"outputPairMC", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistryMC{"outputMC", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; std::mt19937 engine; @@ -352,11 +346,9 @@ struct photonhbt { std::vector epBinEgdes; std::vector occBinEdges; - // ─── Pair-cut helpers ────────────────────────────────────────────────────── - inline bool isInsideEllipse(float deta, float dphi) const { - if (!ggpaircuts.cfgDoEllipseCut.value) // .value needed: operator T() is non-const in O2 + if (!ggpaircuts.cfgDoEllipseCut.value) return false; const float sE = ggpaircuts.cfgEllipseSigEta.value; const float sP = ggpaircuts.cfgEllipseSigPhi.value; @@ -386,6 +378,12 @@ struct photonhbt { return (limit <= 0.f) || (qinv < limit); } + inline bool passQinvMCQAGate(float qinv) const + { + const float limit = qaflags.cfgMaxQinvForMCQA.value; + return (limit <= 0.f) || (qinv < limit); + } + static inline float computeCosTheta(const ROOT::Math::PtEtaPhiMVector& v1, const ROOT::Math::PtEtaPhiMVector& v2) { @@ -425,8 +423,6 @@ struct photonhbt { return clampBin(b, static_cast(edges.size()) - 2); } - /// ev_id : 0 = same-event, 1 = mixed-event - /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* qaPrefix() { @@ -460,27 +456,30 @@ struct photonhbt { void init(InitContext& /*context*/) { mRunNumber = 0; - parseBins(ConfVtxBins, ztxBinEdges); parseBins(ConfCentBins, centBinEdges); parseBins(ConfEPBins, epBinEgdes); parseBins(ConfOccupancyBins, occBinEdges); - emh1 = new MyEMH(ndepth); emh2 = new MyEMH(ndepth); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); DefineEMEventCut(); DefinePCMCut(); addhistograms(); - std::random_device seedGen; engine = std::mt19937(seedGen()); dist01 = std::uniform_int_distribution(0, 1); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current}-BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + + // Print histogram counts and memory estimates for all registries + // LOGF(info, "=== photonhbt histogram summary ==="); + // fRegistry.print(); + // fRegistryPairQA.print(); + // fRegistryPairMC.print(); + // fRegistryMC.print(); + // LOGF(info, "==================================="); } template @@ -491,61 +490,39 @@ struct photonhbt { mRunNumber = collision.runNumber(); } - // ─── PairQAObservables ───────────────────────────────────────────────────── - /// Plain data struct holding all observables computed from a photon pair. - /// Defined early so all histogram-booking and fill functions can use it. - struct PairQAObservables { - // photon four-vectors and pair kinematics - ROOT::Math::PtEtaPhiMVector v1; - ROOT::Math::PtEtaPhiMVector v2; - ROOT::Math::PtEtaPhiMVector k12; - // conversion-point coordinates - float x1 = 0.f, y1 = 0.f, z1 = 0.f; - float x2 = 0.f, y2 = 0.f, z2 = 0.f; - // conversion-point radii and distances - float r1 = 0.f, r2 = 0.f; - float dx = 0.f, dy = 0.f, dz = 0.f; - float deltaR = 0.f; ///< |R1-R2| - float deltaZ = 0.f; ///< z1-z2 - float deltaRxy = 0.f; ///< sqrt(dx^2+dy^2) - float deltaR3D = 0.f; ///< sqrt(dx^2+dy^2+dz^2) - // opening angle of conversion-point vectors - float opa = 0.f; - float cosOA = 0.f; - float drOverCosOA = 0.f; - float deta = 0.f, dphi = 0.f; - float pairEta = 0.f, pairPhi = 0.f; - float kt = 0.f, qinv = 0.f; - float cosTheta = 0.f; - float openingAngle = 0.f; - // validity flag + ROOT::Math::PtEtaPhiMVector v1, v2, k12; + float x1 = 0.f, y1 = 0.f, z1 = 0.f, x2 = 0.f, y2 = 0.f, z2 = 0.f; + float r1 = 0.f, r2 = 0.f, dx = 0.f, dy = 0.f, dz = 0.f; + float deltaR = 0.f, deltaZ = 0.f, deltaRxy = 0.f, deltaR3D = 0.f; + float opa = 0.f, cosOA = 0.f, drOverCosOA = 0.f; + float deta = 0.f, dphi = 0.f, pairEta = 0.f, pairPhi = 0.f; + float kt = 0.f, qinv = 0.f, cosTheta = 0.f, openingAngle = 0.f; bool valid = true; }; void addSinglePhotonQAHistogramsForStep(const std::string& path) { - fRegistry.add((path + "hPt").c_str(), "p_{T};p_{T} (GeV/c);counts", kTH1D, {axisPt}, true); - fRegistry.add((path + "hEta").c_str(), "#eta;#eta;counts", kTH1D, {axisEta}, true); - fRegistry.add((path + "hPhi").c_str(), "#phi;#phi (rad);counts", kTH1D, {axisPhi}, true); - fRegistry.add((path + "hEtaVsPhi").c_str(), "acceptance;#phi (rad);#eta", kTH2D, {axisPhi, axisEta}, true); - fRegistry.add((path + "hR").c_str(), "R_{conv};R_{conv} (cm);counts", kTH1D, {axisR}, true); - fRegistry.add((path + "hZConv").c_str(), "z_{conv};z_{conv} (cm);counts", kTH1D, {axisZConv}, true); - fRegistry.add((path + "hRVsZConv").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH2D, {axisZConv, axisR}, true); + fRegistryPairQA.add((path + "hPt").c_str(), "p_{T};p_{T} (GeV/c);counts", kTH1D, {axisPt}, true); + fRegistryPairQA.add((path + "hEta").c_str(), "#eta;#eta;counts", kTH1D, {axisEta}, true); + fRegistryPairQA.add((path + "hPhi").c_str(), "#phi;#phi (rad);counts", kTH1D, {axisPhi}, true); + fRegistryPairQA.add((path + "hEtaVsPhi").c_str(), "acceptance;#phi (rad);#eta", kTH2D, {axisPhi, axisEta}, true); + fRegistryPairQA.add((path + "hR").c_str(), "R_{conv};R_{conv} (cm);counts", kTH1D, {axisR}, true); + fRegistryPairQA.add((path + "hZConv").c_str(), "z_{conv};z_{conv} (cm);counts", kTH1D, {axisZConv}, true); + fRegistryPairQA.add((path + "hRVsZConv").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH2D, {axisZConv, axisR}, true); } void addFullRangeHistograms(const std::string& path) { - fRegistry.add((path + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv} (full range);q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); - fRegistry.add((path + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv} (full range);q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); - fRegistry.add((path + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv} (full range);q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); - fRegistry.add((path + "hQinvVsCent").c_str(), "q_{inv} vs centrality (full range);centrality (%);q_{inv} (GeV/c)", kTH2D, {axisCentQA, axisQinv}, true); - fRegistry.add((path + "hQinvVsOccupancy").c_str(), "q_{inv} vs occupancy (full range);occupancy;q_{inv} (GeV/c)", kTH2D, {axisOccupancy, axisQinv}, true); - fRegistry.add((path + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv} (full range)", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + fRegistry.add((path + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv};q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); + fRegistry.add((path + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv};q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); + fRegistry.add((path + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv};q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); + fRegistry.add((path + "hQinvVsCent").c_str(), "q_{inv} vs centrality;centrality (%);q_{inv} (GeV/c)", kTH2D, {axisCentQA, axisQinv}, true); + fRegistry.add((path + "hQinvVsOccupancy").c_str(), "q_{inv} vs occupancy;occupancy;q_{inv} (GeV/c)", kTH2D, {axisOccupancy, axisQinv}, true); + fRegistry.add((path + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); fRegistry.add((path + "hDeltaRCosOAVsQinv").c_str(), "#Delta r/cos(#theta_{op}/2) vs q_{inv};q_{inv} (GeV/c);#Delta r/cos(#theta_{op}/2) (cm)", kTH2D, {axisQinv, {100, 0, 100}}, true); } - /// ev_id : 0 = same-event, 1 = mixed-event template inline void fillFullRangeQA(PairQAObservables const& obs, float cent, float occupancy) { @@ -555,8 +532,7 @@ struct photonhbt { fRegistry.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); fRegistry.fill(HIST(base) + HIST("hQinvVsCent"), cent, obs.qinv); fRegistry.fill(HIST(base) + HIST("hQinvVsOccupancy"), occupancy, obs.qinv); - fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), - obs.deltaR, obs.deltaZ, obs.qinv); + fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); } template @@ -568,66 +544,37 @@ struct photonhbt { void addQAHistogramsForStep(const std::string& path) { - // ── 1D: photon kinematics ──────────────────────────────────────────────── - fRegistry.add((path + "hPairEta").c_str(), "pair #eta;#eta_{pair};counts", kTH1D, {axisEta}, true); - fRegistry.add((path + "hPairPhi").c_str(), "pair #phi;#phi_{pair} (rad);counts", kTH1D, {axisPhi}, true); - fRegistry.add((path + "hPairKt").c_str(), "pair k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistry.add((path + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); - - // ── 1D: angular ───────────────────────────────────────────────────────── - fRegistry.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); - fRegistry.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); - fRegistry.add((path + "hCosTheta").c_str(), "cos(#theta*) in pair rest frame;cos(#theta*);counts", kTH1D, {axisCosTheta}, true); - fRegistry.add((path + "hOpeningAngle").c_str(), "Opening angle;#alpha (rad);counts", kTH1D, {axisOpeningAngle}, true); - fRegistry.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma_{#eta})^{2}+(#Delta#phi/#sigma_{#phi})^{2};value;counts", kTH1D, {axisEllipseVal}, true); - - // ── 1D: geometry ──────────────────────────────────────────────────────── - fRegistry.add((path + "hR1").c_str(), "R_{conv,1};R_{1} (cm);counts", kTH1D, {axisR}, true); - fRegistry.add((path + "hR2").c_str(), "R_{conv,2};R_{2} (cm);counts", kTH1D, {axisR}, true); - fRegistry.add((path + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); - fRegistry.add((path + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); - fRegistry.add((path + "hDeltaRxy").c_str(), "#Delta r_{xy};#Delta r_{xy} (cm);counts", kTH1D, {axisDeltaRxy}, true); - fRegistry.add((path + "hDeltaR3D").c_str(), "|#vec{r}_{1}-#vec{r}_{2}|;#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); - - // ── 1D: event-level ───────────────────────────────────────────────────── - fRegistry.add((path + "hCent").c_str(), "centrality;centrality (%);counts", kTH1D, {axisCentQA}, true); - fRegistry.add((path + "hOccupancy").c_str(), "occupancy;occupancy;counts", kTH1D, {axisOccupancy}, true); - - // ── 2D: angular ───────────────────────────────────────────────────────── - fRegistry.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2D, {axisEta, axisDeltaEta}, true); - - // ── 2D: geometry ──────────────────────────────────────────────────────── - fRegistry.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); - fRegistry.add((path + "hDeltaRVsDeltaZ").c_str(), "|R_{1}-R_{2}| vs #Delta z;|R_{1}-R_{2}| (cm);#Delta z (cm)", kTH2D, {axisDeltaR, axisDeltaZ}, true); - - // ── 2D: geometry vs kT ────────────────────────────────────────────────── - // Note: hDeltaRVsQinv, hDeltaZVsQinv live in FullRange/ (always filled, full q range) - fRegistry.add((path + "hDeltaRVsKt").c_str(), "|R_{1}-R_{2}| vs k_{T};k_{T} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisKt, axisDeltaR}, true); - fRegistry.add((path + "hDeltaZVsKt").c_str(), "#Delta z vs k_{T};k_{T} (GeV/c);#Delta z (cm)", kTH2D, {axisKt, axisDeltaZ}, true); - - // ── 2D: angular vs geometry ───────────────────────────────────────────── - fRegistry.add((path + "hDeltaPhiVsDeltaR").c_str(), "#Delta#phi vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#phi (rad)", kTH2D, {axisDeltaR, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsDeltaR").c_str(), "#Delta#eta vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#eta", kTH2D, {axisDeltaR, axisDeltaEta}, true); - fRegistry.add((path + "hDeltaPhiVsDeltaZ").c_str(), "#Delta#phi vs #Delta z;#Delta z (cm);#Delta#phi (rad)", kTH2D, {axisDeltaZ, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsDeltaZ").c_str(), "#Delta#eta vs #Delta z;#Delta z (cm);#Delta#eta", kTH2D, {axisDeltaZ, axisDeltaEta}, true); - - // ── 2D: vs event properties ───────────────────────────────────────────── - fRegistry.add((path + "hDeltaRVsCent").c_str(), "|R_{1}-R_{2}| vs centrality;centrality (%);|R_{1}-R_{2}| (cm)", kTH2D, {axisCentQA, axisDeltaR}, true); - fRegistry.add((path + "hDeltaRVsOccupancy").c_str(), "|R_{1}-R_{2}| vs occupancy;occupancy;|R_{1}-R_{2}| (cm)", kTH2D, {axisOccupancy, axisDeltaR}, true); - - fRegistry.add((path + "hSparseDEtaDPhiCent").c_str(), - "#Delta#eta,#Delta#phi,centrality", - kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisCentQA}, true); - fRegistry.add((path + "hSparseDEtaDPhiOcc").c_str(), - "#Delta#eta,#Delta#phi,occupancy", - kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisOccupancy}, true); - fRegistry.add((path + "hSparseDEtaDPhiKt").c_str(), - "#Delta#eta,#Delta#phi,k_{T}", - kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); - fRegistry.add((path + "hSparseDeltaRDeltaZKt").c_str(), - "|R_{1}-R_{2}|,#Delta z,k_{T}", - kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); + fRegistryPairQA.add((path + "hPairEta").c_str(), "pair #eta;#eta_{pair};counts", kTH1D, {axisEta}, true); + fRegistryPairQA.add((path + "hPairPhi").c_str(), "pair #phi;#phi_{pair} (rad);counts", kTH1D, {axisPhi}, true); + fRegistryPairQA.add((path + "hPairKt").c_str(), "pair k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistryPairQA.add((path + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairQA.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); + fRegistryPairQA.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hCosTheta").c_str(), "cos(#theta*);cos(#theta*);counts", kTH1D, {axisCosTheta}, true); + fRegistryPairQA.add((path + "hOpeningAngle").c_str(), "Opening angle;#alpha (rad);counts", kTH1D, {axisOpeningAngle}, true); + fRegistryPairQA.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma)^{2}+(#Delta#phi/#sigma)^{2};value;counts", kTH1D, {axisEllipseVal}, true); + fRegistryPairQA.add((path + "hR1").c_str(), "R_{conv,1};R_{1} (cm);counts", kTH1D, {axisR}, true); + fRegistryPairQA.add((path + "hR2").c_str(), "R_{conv,2};R_{2} (cm);counts", kTH1D, {axisR}, true); + fRegistryPairQA.add((path + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); + fRegistryPairQA.add((path + "hDeltaRxy").c_str(), "#Delta r_{xy};#Delta r_{xy} (cm);counts", kTH1D, {axisDeltaRxy}, true); + fRegistryPairQA.add((path + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); + fRegistryPairQA.add((path + "hCent").c_str(), "centrality;centrality (%);counts", kTH1D, {axisCentQA}, true); + fRegistryPairQA.add((path + "hOccupancy").c_str(), "occupancy;occupancy;counts", kTH1D, {axisOccupancy}, true); + fRegistryPairQA.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2D, {axisEta, axisDeltaEta}, true); + fRegistryPairQA.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); + fRegistryPairQA.add((path + "hDeltaRVsDeltaZ").c_str(), "|R_{1}-R_{2}| vs #Delta z;|R_{1}-R_{2}| (cm);#Delta z (cm)", kTH2D, {axisDeltaR, axisDeltaZ}, true); + fRegistryPairQA.add((path + "hDeltaRVsKt").c_str(), "|R_{1}-R_{2}| vs k_{T};k_{T} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisKt, axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaZVsKt").c_str(), "#Delta z vs k_{T};k_{T} (GeV/c);#Delta z (cm)", kTH2D, {axisKt, axisDeltaZ}, true); + fRegistryPairQA.add((path + "hDeltaPhiVsDeltaR").c_str(), "#Delta#phi vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#phi (rad)", kTH2D, {axisDeltaR, axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hDeltaEtaVsDeltaR").c_str(), "#Delta#eta vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#eta", kTH2D, {axisDeltaR, axisDeltaEta}, true); + fRegistryPairQA.add((path + "hDeltaPhiVsDeltaZ").c_str(), "#Delta#phi vs #Delta z;#Delta z (cm);#Delta#phi (rad)", kTH2D, {axisDeltaZ, axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hDeltaEtaVsDeltaZ").c_str(), "#Delta#eta vs #Delta z;#Delta z (cm);#Delta#eta", kTH2D, {axisDeltaZ, axisDeltaEta}, true); + fRegistryPairQA.add((path + "hDeltaRVsCent").c_str(), "|R_{1}-R_{2}| vs centrality;centrality (%);|R_{1}-R_{2}| (cm)", kTH2D, {axisCentQA, axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaRVsOccupancy").c_str(), "|R_{1}-R_{2}| vs occupancy;occupancy;|R_{1}-R_{2}| (cm)", kTH2D, {axisOccupancy, axisDeltaR}, true); + fRegistryPairQA.add((path + "hSparseDEtaDPhiKt").c_str(), "#Delta#eta,#Delta#phi,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryPairQA.add((path + "hSparseDeltaRDeltaZKt").c_str(), "|R_{1}-R_{2}|,#Delta z,k_{T}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); } void addhistograms() @@ -645,44 +592,33 @@ struct photonhbt { addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterRZ/"); addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterEllipse/"); - // ── HBT correlation functions ───────────────────────────────────────────── if (cfgDo3D) { - fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", - kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) { - fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", - kTHnSparseD, {axisQout, axisQinv, axisKt}, true); - } + fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) + fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) { + if (cfgUseLCMS) fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); - } else { + else fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); - } } fRegistry.add("Pair/same/hDeltaRCosOA", "distance between 2 conversion points / cos(#theta_{op}/2);#Delta r / cos(#theta_{op}/2) (cm);counts", kTH1D, {{100, 0, 100}}, true); - // ── QA steps (same-event; mix-event cloned below) ───────────────────────── addQAHistogramsForStep("Pair/same/QA/Before/"); addQAHistogramsForStep("Pair/same/QA/AfterDRCosOA/"); addQAHistogramsForStep("Pair/same/QA/AfterRZ/"); addQAHistogramsForStep("Pair/same/QA/AfterEllipse/"); - // ── MC truth histograms (same-event; mix-event cloned below) ───────────── addMCHistograms(); - - // ── Full-range histograms: always filled, qinv as axis ─────────────────── + fRegistryPairQA.addClone("Pair/same/QA/", "Pair/mix/QA/"); + fRegistryPairMC.addClone("Pair/same/MC/", "Pair/mix/MC/"); addFullRangeHistograms("Pair/same/FullRange/"); - - // Clone all Pair/same/ histograms to Pair/mix/ fRegistry.addClone("Pair/same/", "Pair/mix/"); } - // ─── DefineEMEventCut ────────────────────────────────────────────────────── - void DefineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); @@ -704,8 +640,6 @@ struct photonhbt { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } - // ─── DefinePCMCut ────────────────────────────────────────────────────────── - void DefinePCMCut() { fV0PhotonCut = V0PhotonCut("fV0PhotonCut", "fV0PhotonCut"); @@ -733,7 +667,6 @@ struct photonhbt { fV0PhotonCut.SetRequireTPConly(pcmcuts.cfgRequireV0WithTPCOnly); } - /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* singlePhotonQAPrefix() { @@ -753,13 +686,13 @@ struct photonhbt { return; constexpr auto base = singlePhotonQAPrefix(); const float r = std::sqrt(g.vx() * g.vx() + g.vy() * g.vy()); - fRegistry.fill(HIST(base) + HIST("hPt"), g.pt()); - fRegistry.fill(HIST(base) + HIST("hEta"), g.eta()); - fRegistry.fill(HIST(base) + HIST("hPhi"), g.phi()); - fRegistry.fill(HIST(base) + HIST("hEtaVsPhi"), g.phi(), g.eta()); - fRegistry.fill(HIST(base) + HIST("hR"), r); - fRegistry.fill(HIST(base) + HIST("hZConv"), g.vz()); - fRegistry.fill(HIST(base) + HIST("hRVsZConv"), g.vz(), r); + fRegistryPairQA.fill(HIST(base) + HIST("hPt"), g.pt()); + fRegistryPairQA.fill(HIST(base) + HIST("hEta"), g.eta()); + fRegistryPairQA.fill(HIST(base) + HIST("hPhi"), g.phi()); + fRegistryPairQA.fill(HIST(base) + HIST("hEtaVsPhi"), g.phi(), g.eta()); + fRegistryPairQA.fill(HIST(base) + HIST("hR"), r); + fRegistryPairQA.fill(HIST(base) + HIST("hZConv"), g.vz()); + fRegistryPairQA.fill(HIST(base) + HIST("hRVsZConv"), g.vz(), r); } template @@ -772,11 +705,9 @@ struct photonhbt { auto k12 = 0.5 * (v1 + v2); float kt = k12.Pt(); float qinv = -(((v1 - v2) * rndm).M()); - ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); ROOT::Math::XYZVector uv_long(0, 0, 1); ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); - ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); ROOT::Math::Boost bst_z(0, 0, -beta_z); @@ -786,14 +717,12 @@ struct photonhbt { float qout_lcms = q3_lcms.Dot(uv_out); float qside_lcms = q3_lcms.Dot(uv_side); float qlong_lcms = q3_lcms.Dot(uv_long); - if (cfgDo3D) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_3D"), std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); - if (cfgDo2D) { + if (cfgDo2D) fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt, weight); - } } else { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt, weight); @@ -806,16 +735,13 @@ struct photonhbt { ROOT::Math::PtEtaPhiMVector v2, float weight = 1.f) { - float rndm = std::pow(-1, dist01(engine) % 2); auto k12 = 0.5 * (v1 + v2); float kt = k12.Pt(); float qinv = -(((v1 - v2) * rndm).M()); - ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); ROOT::Math::XYZVector uv_long(0, 0, 1); ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); - ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); ROOT::Math::Boost bst_z(0, 0, -beta_z); @@ -825,7 +751,6 @@ struct photonhbt { float qout_lcms = q3_lcms.Dot(uv_out); float qside_lcms = q3_lcms.Dot(uv_side); float qlong_lcms = q3_lcms.Dot(uv_long); - constexpr auto mcDir = []() constexpr -> const char* { if constexpr (ev_id == 0) { if constexpr (TruthT == PairTruthType::TrueTrueDistinct) @@ -853,17 +778,13 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - if (cfgDo3D) { - fRegistry.fill(HIST(mcDir) + HIST("CF_3D"), - std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); - if (cfgDo2D) { - fRegistry.fill(HIST(mcDir) + HIST("CF_2D"), - std::fabs(qout_lcms), std::fabs(qinv), kt, weight); - } + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); + if (cfgDo2D) + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt, weight); } else { - fRegistry.fill(HIST(mcDir) + HIST("CF_1D"), - cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt, weight); } } @@ -871,30 +792,23 @@ struct photonhbt { PairQAObservables buildPairQAObservables(TG1 const& g1, TG2 const& g2) { PairQAObservables o{}; - o.x1 = g1.vx(); o.y1 = g1.vy(); o.z1 = g1.vz(); o.x2 = g2.vx(); o.y2 = g2.vy(); o.z2 = g2.vz(); - o.r1 = std::sqrt(o.x1 * o.x1 + o.y1 * o.y1); o.r2 = std::sqrt(o.x2 * o.x2 + o.y2 * o.y2); - o.dx = o.x1 - o.x2; o.dy = o.y1 - o.y2; o.dz = o.z1 - o.z2; - o.deltaR = std::fabs(o.r1 - o.r2); o.deltaZ = o.dz; o.deltaRxy = std::sqrt(o.dx * o.dx + o.dy * o.dy); o.deltaR3D = std::sqrt(o.dx * o.dx + o.dy * o.dy + o.dz * o.dz); - - ROOT::Math::XYZVector cp1(o.x1, o.y1, o.z1); - ROOT::Math::XYZVector cp2(o.x2, o.y2, o.z2); - const float mag1 = std::sqrt(cp1.Mag2()); - const float mag2 = std::sqrt(cp2.Mag2()); + ROOT::Math::XYZVector cp1(o.x1, o.y1, o.z1), cp2(o.x2, o.y2, o.z2); + const float mag1 = std::sqrt(cp1.Mag2()), mag2 = std::sqrt(cp2.Mag2()); if (mag1 < 1e-12f || mag2 < 1e-12f) { o.valid = false; return o; @@ -907,20 +821,17 @@ struct photonhbt { o.opa -= o2::constants::math::PI; o.cosOA = std::cos(o.opa / 2.f); o.drOverCosOA = (std::fabs(o.cosOA) < 1e-12f) ? 1e12f : (o.deltaR3D / o.cosOA); - o.v1 = ROOT::Math::PtEtaPhiMVector(g1.pt(), g1.eta(), g1.phi(), 0.f); o.v2 = ROOT::Math::PtEtaPhiMVector(g2.pt(), g2.eta(), g2.phi(), 0.f); o.k12 = 0.5f * (o.v1 + o.v2); - o.deta = g1.eta() - g2.eta(); - o.dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); // dphi in [-pi, pi] + o.dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); o.pairEta = 0.5f * (g1.eta() + g2.eta()); - o.pairPhi = RecoDecay::constrainAngle(o.k12.Phi(), 0.f); // pair phi in [0, 2pi] — matches axisPhi + o.pairPhi = RecoDecay::constrainAngle(o.k12.Phi(), 0.f); o.kt = o.k12.Pt(); o.qinv = std::fabs((o.v1 - o.v2).M()); o.cosTheta = std::fabs(computeCosTheta(o.v1, o.v2)); o.openingAngle = o.opa; - return o; } @@ -929,149 +840,98 @@ struct photonhbt { { if (!qaflags.doPairQa) return; - constexpr auto base = qaPrefix(); - - // 1D: kinematics - fRegistry.fill(HIST(base) + HIST("hPairEta"), o.pairEta); - fRegistry.fill(HIST(base) + HIST("hPairPhi"), o.pairPhi); - fRegistry.fill(HIST(base) + HIST("hPairKt"), o.kt); - fRegistry.fill(HIST(base) + HIST("hQinv"), o.qinv); - - // 1D: angular - fRegistry.fill(HIST(base) + HIST("hDeltaEta"), o.deta); - fRegistry.fill(HIST(base) + HIST("hDeltaPhi"), o.dphi); - fRegistry.fill(HIST(base) + HIST("hCosTheta"), o.cosTheta); - fRegistry.fill(HIST(base) + HIST("hOpeningAngle"), o.openingAngle); - - // 1D: geometry - fRegistry.fill(HIST(base) + HIST("hR1"), o.r1); - fRegistry.fill(HIST(base) + HIST("hR2"), o.r2); - fRegistry.fill(HIST(base) + HIST("hDeltaR"), o.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZ"), o.deltaZ); - fRegistry.fill(HIST(base) + HIST("hDeltaRxy"), o.deltaRxy); - fRegistry.fill(HIST(base) + HIST("hDeltaR3D"), o.deltaR3D); - - // 1D: event - fRegistry.fill(HIST(base) + HIST("hCent"), cent); - fRegistry.fill(HIST(base) + HIST("hOccupancy"), occupancy); - - // 1D: ellipse value (diagnostic, conditional on cut being configured) - const float sE = ggpaircuts.cfgEllipseSigEta.value; - const float sP = ggpaircuts.cfgEllipseSigPhi.value; - if (sE > 1e-9f && sP > 1e-9f) { - const float ellipseVal = (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP); - fRegistry.fill(HIST(base) + HIST("hEllipseVal"), ellipseVal); - } - - // 2D: angular - fRegistry.fill(HIST(base) + HIST("hDEtaDPhi"), o.deta, o.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsPairEta"), o.pairEta, o.deta); - - // 2D: geometry - fRegistry.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); - fRegistry.fill(HIST(base) + HIST("hDeltaRVsDeltaZ"), o.deltaR, o.deltaZ); - - // 2D: geometry vs kT (qinv variants live in FullRange/) - fRegistry.fill(HIST(base) + HIST("hDeltaRVsKt"), o.kt, o.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZVsKt"), o.kt, o.deltaZ); - - // 2D: angular vs geometry - fRegistry.fill(HIST(base) + HIST("hDeltaPhiVsDeltaR"), o.deltaR, o.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsDeltaR"), o.deltaR, o.deta); - fRegistry.fill(HIST(base) + HIST("hDeltaPhiVsDeltaZ"), o.deltaZ, o.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsDeltaZ"), o.deltaZ, o.deta); - - // 2D: vs event properties (qinv variants live in FullRange/) - fRegistry.fill(HIST(base) + HIST("hDeltaRVsCent"), cent, o.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaRVsOccupancy"), occupancy, o.deltaR); - - // THnSparse (hSparseDeltaRDeltaZQinv lives in FullRange/) - fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiCent"), o.deta, o.dphi, cent); - fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiOcc"), o.deta, o.dphi, occupancy); - fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); - fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hPairEta"), o.pairEta); + fRegistryPairQA.fill(HIST(base) + HIST("hPairPhi"), o.pairPhi); + fRegistryPairQA.fill(HIST(base) + HIST("hPairKt"), o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hQinv"), o.qinv); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEta"), o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhi"), o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hCosTheta"), o.cosTheta); + fRegistryPairQA.fill(HIST(base) + HIST("hOpeningAngle"), o.openingAngle); + fRegistryPairQA.fill(HIST(base) + HIST("hR1"), o.r1); + fRegistryPairQA.fill(HIST(base) + HIST("hR2"), o.r2); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR"), o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaZ"), o.deltaZ); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRxy"), o.deltaRxy); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR3D"), o.deltaR3D); + fRegistryPairQA.fill(HIST(base) + HIST("hCent"), cent); + fRegistryPairQA.fill(HIST(base) + HIST("hOccupancy"), occupancy); + const float sE = ggpaircuts.cfgEllipseSigEta.value, sP = ggpaircuts.cfgEllipseSigPhi.value; + if (sE > 1e-9f && sP > 1e-9f) + fRegistryPairQA.fill(HIST(base) + HIST("hEllipseVal"), (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP)); + fRegistryPairQA.fill(HIST(base) + HIST("hDEtaDPhi"), o.deta, o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsPairEta"), o.pairEta, o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsDeltaZ"), o.deltaR, o.deltaZ); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsKt"), o.kt, o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaZVsKt"), o.kt, o.deltaZ); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiVsDeltaR"), o.deltaR, o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsDeltaR"), o.deltaR, o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiVsDeltaZ"), o.deltaZ, o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsDeltaZ"), o.deltaZ, o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsCent"), cent, o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsOccupancy"), occupancy, o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); } template - static PhotonMCInfo buildPhotonMCInfo(TPhoton const& g, - TMCParticles const& mcParticles) + static PhotonMCInfo buildPhotonMCInfo(TPhoton const& g, TMCParticles const& mcParticles) { PhotonMCInfo info{}; - const auto pos = g.template posTrack_as(); const auto neg = g.template negTrack_as(); - - // PWGEM uses emmcparticle, not the standard mcParticle accessor if (!pos.has_emmcparticle() || !neg.has_emmcparticle()) return info; - info.hasMC = true; info.mcPosId = pos.emmcparticleId(); info.mcNegId = neg.emmcparticleId(); - const auto mcPos = pos.template emmcparticle_as(); const auto mcNeg = neg.template emmcparticle_as(); - if (!mcPos.has_mothers() || !mcNeg.has_mothers()) return info; - - const int mothIdPos = mcPos.mothersIds()[0]; - const int mothIdNeg = mcNeg.mothersIds()[0]; + const int mothIdPos = mcPos.mothersIds()[0], mothIdNeg = mcNeg.mothersIds()[0]; if (mothIdPos != mothIdNeg) return info; - info.sameMother = true; info.motherId = mothIdPos; - const auto mother = mcParticles.iteratorAt(mothIdPos); info.motherPdg = mother.pdgCode(); info.isTruePhoton = (info.motherPdg == 22); info.isPhysicalPrimary = mother.isPhysicalPrimary(); - return info; } - static PairTruthType classifyPairTruth(PhotonMCInfo const& m1, - PhotonMCInfo const& m2) + static PairTruthType classifyPairTruth(PhotonMCInfo const& m1, PhotonMCInfo const& m2) { const bool t1 = m1.hasMC && m1.sameMother && m1.isTruePhoton; const bool t2 = m2.hasMC && m2.sameMother && m2.isTruePhoton; - if (m1.hasMC && m2.hasMC) { if ((m1.mcPosId >= 0 && (m1.mcPosId == m2.mcPosId || m1.mcPosId == m2.mcNegId)) || (m1.mcNegId >= 0 && (m1.mcNegId == m2.mcPosId || m1.mcNegId == m2.mcNegId))) return PairTruthType::SharedMcLeg; } - if (!t1 && !t2) return PairTruthType::FakeFake; if (t1 != t2) return PairTruthType::TrueFake; - - // Both are true photons — same or different MC photon? if (m1.motherId >= 0 && m1.motherId == m2.motherId) return PairTruthType::TrueTrueSamePhoton; - return PairTruthType::TrueTrueDistinct; } template - static bool isPi0DaughterPair(PhotonMCInfo const& m1, - PhotonMCInfo const& m2, + static bool isPi0DaughterPair(PhotonMCInfo const& m1, PhotonMCInfo const& m2, TMCParticles const& mcParticles) { - if (!m1.isTruePhoton || !m2.isTruePhoton) - return false; - if (m1.motherId < 0 || m2.motherId < 0) + if (!m1.isTruePhoton || !m2.isTruePhoton || m1.motherId < 0 || m2.motherId < 0) return false; - // The photons themselves must have the same grandmother = pi0 const auto ph1 = mcParticles.iteratorAt(m1.motherId); const auto ph2 = mcParticles.iteratorAt(m2.motherId); if (!ph1.has_mothers() || !ph2.has_mothers()) return false; - const int gm1 = ph1.mothersIds()[0]; - const int gm2 = ph2.mothersIds()[0]; + const int gm1 = ph1.mothersIds()[0], gm2 = ph2.mothersIds()[0]; if (gm1 != gm2) return false; return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == 111); @@ -1099,53 +959,245 @@ struct photonhbt { void addMCHistograms() { - const AxisSpec axisTruthType{{0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg,4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; + const AxisSpec axisTruthType{{0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, + "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg,4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; + const AxisSpec axisDeltaEtaMC{90, -1.6f, +1.6f, "#Delta#eta"}; + const AxisSpec axisDeltaPhiMC{90, -o2::constants::math::PI, +o2::constants::math::PI, "#Delta#phi (rad)"}; static constexpr std::array kTypes = { - "TrueTrueDistinct/", - "TrueTrueSamePhoton/", - "SharedMcLeg/", - "TrueFake/", - "FakeFake/", - "Pi0Daughters/"}; + "TrueTrueDistinct/", "TrueTrueSamePhoton/", "SharedMcLeg/", "TrueFake/", "FakeFake/", "Pi0Daughters/"}; for (const auto& label : kTypes) { const std::string base = std::string("Pair/same/MC/") + std::string(label); - if (cfgDo3D) { - fRegistry.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) { - fRegistry.add((base + "CF_2D").c_str(), "MC CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); - } + fRegistryPairMC.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) + fRegistryPairMC.add((base + "CF_2D").c_str(), "MC CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) { - fRegistry.add((base + "CF_1D").c_str(), "MC CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); - } else { - fRegistry.add((base + "CF_1D").c_str(), "MC CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); - } + if (cfgUseLCMS) + fRegistryPairMC.add((base + "CF_1D").c_str(), "MC CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); + else + fRegistryPairMC.add((base + "CF_1D").c_str(), "MC CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); } + fRegistryPairMC.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairMC.add((base + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); + fRegistryPairMC.add((base + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); + fRegistryPairMC.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add((base + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); + fRegistryPairMC.add((base + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); + fRegistryPairMC.add((base + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); + fRegistryPairMC.add((base + "hKt").c_str(), "k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistryPairMC.add((base + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv}", kTH2D, {axisQinv, axisDeltaR}, true); + fRegistryPairMC.add((base + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv}", kTH2D, {axisQinv, axisDeltaZ}, true); + fRegistryPairMC.add((base + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv}", kTH2D, {axisQinv, axisDeltaR3D}, true); + + const bool addDEtaDPhiVsQinv = + (label == "TrueTrueDistinct/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (label == "TrueTrueSamePhoton/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (label == "TrueFake/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (label == "FakeFake/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mcthruth_sparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value; + if (addDEtaDPhiVsQinv) + fRegistryPairMC.add((base + "hDEtaDPhiVsQinv").c_str(), "#Delta#eta vs #Delta#phi vs q_{inv}", kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + const bool addDRDZQinv = + (label == "TrueTrueDistinct/") ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueDistinct.value : (label == "TrueTrueSamePhoton/") ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mcthruth_sparse.cfgFillDRDZQinvSharedMcLeg.value + : (label == "TrueFake/") ? mcthruth_sparse.cfgFillDRDZQinvTrueFake.value + : (label == "FakeFake/") ? mcthruth_sparse.cfgFillDRDZQinvFakeFake.value + : mcthruth_sparse.cfgFillDRDZQinvPi0Daughters.value; + if (addDRDZQinv) + fRegistryPairMC.add((base + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + fRegistryPairMC.add((base + "hSparse_DEtaDPhi_kT").c_str(), + "#Delta#eta vs #Delta#phi vs k_{T};#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + } + fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsQinv", "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); + fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsKt", "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); - fRegistry.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); - fRegistry.add((base + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); - fRegistry.add((base + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); - fRegistry.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistry.add((base + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); - fRegistry.add((base + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); - fRegistry.add((base + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); - fRegistry.add((base + "hKt").c_str(), "k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistry.add((base + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv};q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); - fRegistry.add((base + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv};q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); - fRegistry.add((base + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv};q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); - fRegistry.add((base + "hDEtaDPhiVsQinv").c_str(), "#Delta#eta vs #Delta#phi vs q_{inv};#Delta#eta;#Delta#phi;q_{inv}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisQinv}, true); - fRegistry.add((base + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv};|R_{1}-R_{2}| (cm);#Delta z (cm);q_{inv} (GeV/c)", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + if (cfgDo3D) { + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_3D", "pairs with missing MC label — CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_2D", "pairs with missing MC label — CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + } else { + if (cfgUseLCMS) + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", "pairs with missing MC label — CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); + else + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", "pairs with missing MC label — CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); + } + fRegistryPairMC.add("Pair/same/MC/NoLabel/hDEtaDPhi", + "pairs with missing MC label: #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hKt", "pairs with missing MC label: k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hQinv", "pairs with missing MC label: q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + + fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_truePairs", + "reco pairs where both photons are true (TrueTrueDistinct+SamePhoton+Pi0);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_fakePairs", + "reco pairs with at least one fake photon (FakeFake+TrueFake+SharedMcLeg);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_kT_truePairs", + "reco true pairs: #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_truePairs", + "reco true pairs: #Delta#eta × #Delta#phi × q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_kT_fakePairs", + "reco fake pairs: #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_fakePairs", + "reco fake pairs: #Delta#eta × #Delta#phi × q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + + const AxisSpec axQinvMC{60, 0.f, 0.3f, "q_{inv}^{true} (GeV/c)"}; + + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_truthConverted", + "true converted pairs, denominator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_all4LegsThisColl", + "all 4 legs found — #Delta#eta #Delta#phi q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsBuilt", + "both V0s built — #Delta#eta × #Delta#phi × q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsSelected", + "both V0s pass cuts — numerator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_truthConverted", + "true converted pairs — denominator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_all4LegsThisColl", + "all 4 legs found — #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsBuilt", + "both V0s built — #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsSelected", + "both V0s pass cuts — numerator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_truthConverted", + "true converted pairs: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_all4LegsThisColl", + "all 4 legs found: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_bothPhotonsBuilt", + "both V0s built: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_bothPhotonsSelected", + "both V0s selected: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_truthConverted", + "true converted pairs — generator level #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_all4LegsThisColl", + "all 4 legs found — #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_bothPhotonsBuilt", + "both V0s built — #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_bothPhotonsSelected", + "both V0s selected — #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + + fRegistryMC.add("MC/TruthAO2D/hStage_vs_kT", + "pair reco stage vs k_{T} — integrated efficiency waterfall;" + "k_{T} (GeV/c);stage (0=converted,1=all4legs,2=bothBuilt,3=bothSel)", + kTH2D, {axisKt, AxisSpec{4, -0.5f, 3.5f, "stage"}}, true); + + fRegistryMC.add("MC/TruthAO2D/hStageConsistency", + "stage consistency check (expect all entries at 0);" + "N(V0 built but legs not found) per event;counts", + kTH1D, {AxisSpec{20, -0.5f, 19.5f, "N_{bad}"}}, true); + + { + const AxisSpec axRconv{180, 0.f, 90.f, "R_{conv}^{true} (cm)"}; + + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted", + "true pairs — denominator: R_{conv}(#gamma_{1}) vs R_{conv}(#gamma_{2});" + "R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected", + "true pairs — numerator: R_{conv}(#gamma_{1}) vs R_{conv}(#gamma_{2});" + "R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted", + "true pairs — denominator: min(R_{conv}) vs k_{T};" + "k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_bothPhotonsSelected", + "true pairs — numerator: min(R_{conv}) vs k_{T};" + "k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + + fRegistryMC.add("MC/LegDiag/hRconv_legFound_vs_pt", + "single photon leg found in this collision: R_{conv}^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);R_{conv}^{true} (cm)", + kTH2D, {axisPt, axRconv}, true); + fRegistryMC.add("MC/LegDiag/hRconv_legMissing_vs_pt", + "single photon leg NOT found in this collision: R_{conv}^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);R_{conv}^{true} (cm)", + kTH2D, {axisPt, axRconv}, true); } - fRegistry.add("Pair/same/MC/hTruthTypeVsQinv", "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); - fRegistry.add("Pair/same/MC/hTruthTypeVsKt", "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); + fRegistryMC.add("MC/PairCrossBuild/hSparse_DEtaDPhi_kT", + "pairs with cross-built V0 (legs from two different true photons);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/PairCrossBuild/hStageOut_vs_kT", + "cross-built pairs: how many were correctly built despite the fake V0;" + "k_{T} (GeV/c);N photons correctly built (0/1/2)", + kTH2D, {axisKt, AxisSpec{3, -0.5f, 2.5f, "N photons correctly built"}}, true); + fRegistryMC.add("MC/LegDiag/hNLegsPair_vs_kT", + "N legs found per pair (collision-local) vs k_{T};" + "k_{T} (GeV/c);N_{legs found} (0-4)", + kTH2D, {axisKt, AxisSpec{5, -0.5f, 4.5f, "N_{legs found} (this collision)"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegPt_vs_kT", + "p_{T}^{true} of missing V0 legs vs pair k_{T};" + "k_{T} (GeV/c);p_{T,leg}^{true} (GeV/c)", + kTH2D, {axisKt, AxisSpec{100, 0.f, 0.5f, "p_{T,leg}^{true} (GeV/c)"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegRconv_vs_kT", + "parent R_{conv}^{true} of missing leg vs pair k_{T};" + "k_{T} (GeV/c);R_{conv}^{true} (cm)", + kTH2D, {axisKt, axisR}, true); + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legFound", + "single photon: leg found — leg #Delta R^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);leg #Delta R^{true}", + kTH2D, {axisPt, AxisSpec{100, 0.f, 0.3f, "leg #Delta R^{true}"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legMissing", + "single photon: leg NOT found — leg #Delta R^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);leg #Delta R^{true}", + kTH2D, {axisPt, AxisSpec{100, 0.f, 0.3f, "leg #Delta R^{true}"}}, true); } template - inline void fillMCPairQATyped(PairQAObservables const& obs) + inline void fillMCPairQATyped(PairQAObservables const& obs, bool doSparse, bool doMCQA) { constexpr auto base = []() constexpr -> const char* { if constexpr (!IsMix) { @@ -1174,43 +1226,46 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - - fRegistry.fill(HIST(base) + HIST("hQinv"), obs.qinv); - fRegistry.fill(HIST(base) + HIST("hDeltaEta"), obs.deta); - fRegistry.fill(HIST(base) + HIST("hDeltaPhi"), obs.dphi); - fRegistry.fill(HIST(base) + HIST("hDEtaDPhi"), obs.deta, obs.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaR"), obs.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); - fRegistry.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); - fRegistry.fill(HIST(base) + HIST("hKt"), obs.kt); - + if (doMCQA) { + fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhi"), obs.deta, obs.dphi); + fRegistryPairMC.fill(HIST(base) + HIST("hQinv"), obs.qinv); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaEta"), obs.deta); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaPhi"), obs.dphi); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR"), obs.deltaR); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); + fRegistryPairMC.fill(HIST(base) + HIST("hKt"), obs.kt); + } + if (doSparse) + fRegistryPairMC.fill(HIST(base) + HIST("hSparse_DEtaDPhi_kT"), obs.deta, obs.dphi, obs.kt); constexpr auto summaryDir = IsMix ? "Pair/mix/MC/" : "Pair/same/MC/"; - const int typeIdx = static_cast(TruthT); - fRegistry.fill(HIST(summaryDir) + HIST("hTruthTypeVsQinv"), obs.qinv, typeIdx); - fRegistry.fill(HIST(summaryDir) + HIST("hTruthTypeVsKt"), obs.kt, typeIdx); + if (doMCQA) { + fRegistryPairMC.fill(HIST(summaryDir) + HIST("hTruthTypeVsQinv"), obs.qinv, static_cast(TruthT)); + fRegistryPairMC.fill(HIST(summaryDir) + HIST("hTruthTypeVsKt"), obs.kt, static_cast(TruthT)); + } } template - inline void fillMCPairQA(PairTruthType truthType, PairQAObservables const& obs) + inline void fillMCPairQA(PairTruthType truthType, PairQAObservables const& obs, bool doSparse, bool doMCQA) { switch (truthType) { case PairTruthType::TrueTrueDistinct: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::TrueTrueSamePhoton: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::SharedMcLeg: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::TrueFake: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::FakeFake: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::Pi0Daughters: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; default: break; @@ -1247,12 +1302,23 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - - fRegistry.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); - fRegistry.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); - fRegistry.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); - fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); + const bool fillDRDZ = ((TruthT == PairTruthType::TrueTrueDistinct) ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mcthruth_sparse.cfgFillDRDZQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mcthruth_sparse.cfgFillDRDZQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mcthruth_sparse.cfgFillDRDZQinvFakeFake.value + : mcthruth_sparse.cfgFillDRDZQinvPi0Daughters.value); + if (fillDRDZ) + fRegistryPairMC.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); + const bool enabled = ((TruthT == PairTruthType::TrueTrueDistinct) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mcthruth_sparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value); + if (enabled) + fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); } template @@ -1281,6 +1347,36 @@ struct photonhbt { break; } } + template + void fillPairHistogramNoLabel(TCollision const& /*collision*/, + ROOT::Math::PtEtaPhiMVector v1, + ROOT::Math::PtEtaPhiMVector v2) + { + float rndm = std::pow(-1, dist01(engine) % 2); + auto k12 = 0.5 * (v1 + v2); + float kt = k12.Pt(); + float qinv = -(((v1 - v2) * rndm).M()); + ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); + ROOT::Math::XYZVector uv_long(0, 0, 1); + ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); + ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); + float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); + ROOT::Math::Boost bst_z(0, 0, -beta_z); + auto q12_lcms = bst_z((v1c - v2c) * rndm); + auto q3_lcms = q12_lcms.Vect(); + float qabs_lcms = q3_lcms.R(); + float qout_lcms = q3_lcms.Dot(uv_out); + float qside_lcms = q3_lcms.Dot(uv_side); + float qlong_lcms = q3_lcms.Dot(uv_long); + if (cfgDo3D) { + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt); + if (cfgDo2D) + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt); + } else { + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt); + } + } template epArr = { - collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; const float ep2 = epArr[cfgEP2EstimatorForMix]; - - // ── Event QA and event cut ──────────────────────────────────────────── fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) continue; o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - - // ── Event mixing bins ───────────────────────────────────────────────── const float occupancy = (cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); const float centForQA = cent[cfgCentEstimator]; - - const int zbin = binOf(ztxBinEdges, collision.posZ()); - const int centbin = binOf(centBinEdges, centForQA); - const int epbin = binOf(epBinEgdes, ep2); - const int occbin = binOf(occBinEdges, occupancy); - + const int zbin = binOf(ztxBinEdges, collision.posZ()), centbin = binOf(centBinEdges, centForQA); + const int epbin = binOf(epBinEgdes, ep2), occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); auto keyDFCollision = std::make_pair(ndf, collision.globalIndex()); - - // ── Slice photons for this collision ────────────────────────────────── auto photons1Coll = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2Coll = photons2.sliceBy(perCollision2, collision.globalIndex()); - - // ── Single-photon QA - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photons1Coll) { - if (!cut1.template IsSelected(g)) - continue; - fillSinglePhotonQAStep<0>(g); - } - } - - std::unordered_set photonIdsAfterDRCosOA; - std::unordered_set photonIdsAfterRZ; - std::unordered_set photonIdsAfterEllipse; - - // ── Same-event pair loop ────────────────────────────────────────────── + if (qaflags.doSinglePhotonQa) + for (const auto& g : photons1Coll) + if (cut1.template IsSelected(g)) + fillSinglePhotonQAStep<0>(g); + std::unordered_set idsAfterDR, idsAfterRZ, idsAfterEllipse; for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1Coll, photons2Coll))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) continue; - - const auto pos1 = g1.template posTrack_as(); - const auto ele1 = g1.template negTrack_as(); - const auto pos2 = g2.template posTrack_as(); - const auto ele2 = g2.template negTrack_as(); - if (pos1.trackId() == pos2.trackId() || - pos1.trackId() == ele2.trackId() || - ele1.trackId() == pos2.trackId() || - ele1.trackId() == ele2.trackId()) + const auto pos1 = g1.template posTrack_as(), ele1 = g1.template negTrack_as(); + const auto pos2 = g2.template posTrack_as(), ele2 = g2.template negTrack_as(); + if (pos1.trackId() == pos2.trackId() || pos1.trackId() == ele2.trackId() || + ele1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) continue; - auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); - - // ── QA: Before any pair cut ─────────────────────────────────────── + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<0, 0>(obs, centForQA, occupancy); - - // ── Cut 1: dr/cosOA ─────────────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<0>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - - photonIdsAfterDRCosOA.insert(g1.globalIndex()); - photonIdsAfterDRCosOA.insert(g2.globalIndex()); - - // ── QA: After dr/cosOA cut ──────────────────────────────────────── + idsAfterDR.insert(g1.globalIndex()); + idsAfterDR.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 1>(obs, centForQA, occupancy); - - // ── Cut 2: R/Z geometry ─────────────────────────────────────────── if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - - photonIdsAfterRZ.insert(g1.globalIndex()); - photonIdsAfterRZ.insert(g2.globalIndex()); - - // ── QA: After R/Z cut ───────────────────────────────────────────── + idsAfterRZ.insert(g1.globalIndex()); + idsAfterRZ.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 2>(obs, centForQA, occupancy); - - // ── Cut 3: Ellipse in (DeltaEta, DeltaPhi) ──────────────────────── if (isInsideEllipse(obs.deta, obs.dphi)) continue; - - photonIdsAfterEllipse.insert(g1.globalIndex()); - photonIdsAfterEllipse.insert(g2.globalIndex()); - - // ── QA: After ellipse cut = final accepted pairs ────────────────── + idsAfterEllipse.insert(g1.globalIndex()); + idsAfterEllipse.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 3>(obs, centForQA, occupancy); - - if (doFullRange) + if (doFR) fillFullRangeQA<0>(obs, centForQA, occupancy); - fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); ndiphoton++; - auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { - EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); - gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); - emh1->AddTrackToEventPool(keyDFCollision, gtmp); - } - }; + EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); + emh1->AddTrackToEventPool(keyDFCollision,gtmp); + } }; addToPool(g1); addToPool(g2); - } // end same-event pair loop - - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photons1Coll) { - if (!cut1.template IsSelected(g)) - continue; - const int gid = g.globalIndex(); - if (photonIdsAfterDRCosOA.count(gid)) - fillSinglePhotonQAStep<1>(g); - if (photonIdsAfterRZ.count(gid)) - fillSinglePhotonQAStep<2>(g); - if (photonIdsAfterEllipse.count(gid)) - fillSinglePhotonQAStep<3>(g); - } } - + if (qaflags.doSinglePhotonQa) + for (const auto& g : photons1Coll) + if (cut1.template IsSelected(g)) { + const int gid = g.globalIndex(); + if (idsAfterDR.count(gid)) + fillSinglePhotonQAStep<1>(g); + if (idsAfterRZ.count(gid)) + fillSinglePhotonQAStep<2>(g); + if (idsAfterEllipse.count(gid)) + fillSinglePhotonQAStep<3>(g); + } usedPhotonIdsPerCol.clear(); - if (!cfgDoMix || ndiphoton == 0) continue; - auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); - for (const auto& mixID : poolIDs) { - // skip same event if (mixID.second == collision.globalIndex() && mixID.first == ndf) continue; - const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; - const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - - std::min(collision.globalBC(), bcMix); + const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); if (diffBC < ndiffBCMix) continue; - auto poolPhotons = emh1->GetTracksPerCollision(mixID); - - for (const auto& g1 : selectedPhotons) { + for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { - auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); - - // ── QA: Before any pair cut ───────────────────────────────── + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<1, 0>(obs, centForQA, occupancy); - - // ── Cut 1: dr/cosOA ───────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - - // ── QA: After dr/cosOA cut ────────────────────────────────── if (doQA) fillPairQAStep<1, 1>(obs, centForQA, occupancy); - - // ── Cut 2: R/Z geometry ───────────────────────────────────── if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - - // ── QA: After R/Z cut ─────────────────────────────────────── if (doQA) fillPairQAStep<1, 2>(obs, centForQA, occupancy); - - // ── Cut 3: Ellipse ────────────────────────────────────────── if (isInsideEllipse(obs.deta, obs.dphi)) continue; - - // ── QA: After ellipse cut ─────────────────────────────────── if (doQA) fillPairQAStep<1, 3>(obs, centForQA, occupancy); - - // ── Full-range fills ──────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeQA<1>(obs, centForQA, occupancy); - - // ── Fill CF histogram — always ────────────────────────────── fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); } - } - } // end mixed-event loop - + } if (ndiphoton > 0) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); } - } // end collision loop - } - - using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler< - std::tuple, - std::pair, - EMPair>; - - MyEMH* emh1 = nullptr; - MyEMH* emh2 = nullptr; - - std::unordered_set usedPhotonIdsPerCol; - std::map, uint64_t> mapMixedEventIdToGlobalBC; - - SliceCache cache; - Preslice perCollisionPCM = aod::v0photonkf::pmeventId; - - Filter collisionFilterCentrality = - (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - Filter collisionFilterOccupancyTrack = - eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && - o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilterOccupancyFT0c = - eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && - o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - - using FilteredMyCollisions = soa::Filtered; - - int ndf = 0; - - void processAnalysis(FilteredMyCollisions const& collisions, - MyV0Photons const& v0photons, - aod::V0Legs const& v0legs) - { - runPairing(collisions, - v0photons, v0photons, - v0legs, v0legs, - perCollisionPCM, perCollisionPCM, - fV0PhotonCut, fV0PhotonCut); - ndf++; + } } - PROCESS_SWITCH(photonhbt, processAnalysis, "pairing for analysis", true); - - template - void runPairingMC(TCollisions const& collisions, - TPhotons const& photons, - TLegs const& /*legs*/, - TMCParticles const& mcParticles, - TPreslice const& perCollision, - TCut const& cut) + template + void runPairingMC(TCollisions const& collisions, TPhotons const& photons, + TLegs const& /*legs*/, TMCParticles const& mcParticles, + TPreslice const& perCollision, TCut const& cut) { for (const auto& collision : collisions) { initCCDB(collision); int ndiphoton = 0; - const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) continue; - - const std::array epArr = { - collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; const float ep2 = epArr[cfgEP2EstimatorForMix]; - fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) continue; - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - const float occupancy = (cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); const float centForQA = cent[cfgCentEstimator]; - - const int zbin = binOf(ztxBinEdges, collision.posZ()); - const int centbin = binOf(centBinEdges, centForQA); - const int epbin = binOf(epBinEgdes, ep2); - const int occbin = binOf(occBinEdges, occupancy); - + const int zbin = binOf(ztxBinEdges, collision.posZ()), centbin = binOf(centBinEdges, centForQA); + const int epbin = binOf(epBinEgdes, ep2), occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); auto keyDFCollision = std::make_pair(ndf, collision.globalIndex()); - auto photonsColl = photons.sliceBy(perCollision, collision.globalIndex()); - - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photonsColl) { - if (!cut.template IsSelected(g)) - continue; - fillSinglePhotonQAStep<0>(g); - } - } - - std::unordered_set photonIdsAfterDRCosOA; - std::unordered_set photonIdsAfterRZ; - std::unordered_set photonIdsAfterEllipse; - - // ── Same-event pair loop ────────────────────────────────────────────── + if (qaflags.doSinglePhotonQa) + for (const auto& g : photonsColl) + if (cut.template IsSelected(g)) + fillSinglePhotonQAStep<0>(g); + std::unordered_set idsAfterDR, idsAfterRZ, idsAfterEllipse; for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photonsColl, photonsColl))) { - if (!cut.template IsSelected(g1) || - !cut.template IsSelected(g2)) + if (!cut.template IsSelected(g1) || !cut.template IsSelected(g2)) continue; - - const auto pos1 = g1.template posTrack_as(); - const auto ele1 = g1.template negTrack_as(); - const auto pos2 = g2.template posTrack_as(); - const auto ele2 = g2.template negTrack_as(); - if (pos1.trackId() == pos2.trackId() || - pos1.trackId() == ele2.trackId() || - ele1.trackId() == pos2.trackId() || - ele1.trackId() == ele2.trackId()) + const auto pos1 = g1.template posTrack_as(), ele1 = g1.template negTrack_as(); + const auto pos2 = g2.template posTrack_as(), ele2 = g2.template negTrack_as(); + if (pos1.trackId() == pos2.trackId() || pos1.trackId() == ele2.trackId() || + ele1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) continue; - - // ── MC truth classification ─────────────────────────────────────── const auto mc1 = buildPhotonMCInfo(g1, mcParticles); const auto mc2 = buildPhotonMCInfo(g2, mcParticles); auto truthType = classifyPairTruth(mc1, mc2); - if (truthType == PairTruthType::TrueTrueDistinct && - isPi0DaughterPair(mc1, mc2, mcParticles)) + if (truthType == PairTruthType::TrueTrueDistinct && isPi0DaughterPair(mc1, mc2, mcParticles)) truthType = PairTruthType::Pi0Daughters; - auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); - - // ── Pair QA: Before ─────────────────────────────────────────────── + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<0, 0>(obs, centForQA, occupancy); - - // ── Cut 1: dr/cosOA ─────────────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<0>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - - photonIdsAfterDRCosOA.insert(g1.globalIndex()); - photonIdsAfterDRCosOA.insert(g2.globalIndex()); + idsAfterDR.insert(g1.globalIndex()); + idsAfterDR.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 1>(obs, centForQA, occupancy); - - // ── Cut 2: R/Z geometry ─────────────────────────────────────────── if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - - photonIdsAfterRZ.insert(g1.globalIndex()); - photonIdsAfterRZ.insert(g2.globalIndex()); + idsAfterRZ.insert(g1.globalIndex()); + idsAfterRZ.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 2>(obs, centForQA, occupancy); - - // ── Cut 3: Ellipse ──────────────────────────────────────────────── if (isInsideEllipse(obs.deta, obs.dphi)) continue; - - photonIdsAfterEllipse.insert(g1.globalIndex()); - photonIdsAfterEllipse.insert(g2.globalIndex()); + idsAfterEllipse.insert(g1.globalIndex()); + idsAfterEllipse.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 3>(obs, centForQA, occupancy); - - // ── Full-range fills ────────────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeQA<0>(obs, centForQA, occupancy); - - // ── Fill inclusive CF — always ──────────────────────────────────── fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); ndiphoton++; + if (!mc1.hasMC || !mc2.hasMC) { + fillPairHistogramNoLabel(collision, obs.v1, obs.v2); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/hDEtaDPhi"), obs.deta, obs.dphi); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/hKt"), obs.kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/hQinv"), obs.qinv); + } else { + const bool doMCQA = passQinvMCQAGate(obs.qinv); + fillMCPairQA(truthType, obs, doQA, doMCQA); + if (doFR) + fillMCPairQAFullRange(truthType, obs); + const bool isTruePair = (truthType == PairTruthType::TrueTrueDistinct || + truthType == PairTruthType::TrueTrueSamePhoton || + truthType == PairTruthType::Pi0Daughters); + if (isTruePair) { + fRegistryPairMC.fill(HIST("Pair/same/MC/hDEtaDPhi_truePairs"), obs.deta, obs.dphi); + if (doMCQA) { + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_kT_truePairs"), obs.deta, obs.dphi, obs.kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_qinv_truePairs"), obs.deta, obs.dphi, obs.qinv); + } + } else { + fRegistryPairMC.fill(HIST("Pair/same/MC/hDEtaDPhi_fakePairs"), obs.deta, obs.dphi); + if (doMCQA) { + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_kT_fakePairs"), obs.deta, obs.dphi, obs.kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_qinv_fakePairs"), obs.deta, obs.dphi, obs.qinv); + } + } - if (doQA) - fillMCPairQA(truthType, obs); - if (doFullRange) - fillMCPairQAFullRange(truthType, obs); - switch (truthType) { - case PairTruthType::TrueTrueDistinct: - fillPairHistogramMC<0, PairTruthType::TrueTrueDistinct>(collision, obs.v1, obs.v2); - break; - case PairTruthType::TrueTrueSamePhoton: - fillPairHistogramMC<0, PairTruthType::TrueTrueSamePhoton>(collision, obs.v1, obs.v2); - break; - case PairTruthType::SharedMcLeg: - fillPairHistogramMC<0, PairTruthType::SharedMcLeg>(collision, obs.v1, obs.v2); - break; - case PairTruthType::TrueFake: - fillPairHistogramMC<0, PairTruthType::TrueFake>(collision, obs.v1, obs.v2); - break; - case PairTruthType::FakeFake: - fillPairHistogramMC<0, PairTruthType::FakeFake>(collision, obs.v1, obs.v2); - break; - case PairTruthType::Pi0Daughters: - fillPairHistogramMC<0, PairTruthType::Pi0Daughters>(collision, obs.v1, obs.v2); - break; - default: - break; + switch (truthType) { + case PairTruthType::TrueTrueDistinct: + fillPairHistogramMC<0, PairTruthType::TrueTrueDistinct>(collision, obs.v1, obs.v2); + break; + case PairTruthType::TrueTrueSamePhoton: + fillPairHistogramMC<0, PairTruthType::TrueTrueSamePhoton>(collision, obs.v1, obs.v2); + break; + case PairTruthType::SharedMcLeg: + fillPairHistogramMC<0, PairTruthType::SharedMcLeg>(collision, obs.v1, obs.v2); + break; + case PairTruthType::TrueFake: + fillPairHistogramMC<0, PairTruthType::TrueFake>(collision, obs.v1, obs.v2); + break; + case PairTruthType::FakeFake: + fillPairHistogramMC<0, PairTruthType::FakeFake>(collision, obs.v1, obs.v2); + break; + case PairTruthType::Pi0Daughters: + fillPairHistogramMC<0, PairTruthType::Pi0Daughters>(collision, obs.v1, obs.v2); + break; + default: + break; + } } auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { - EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); - gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); - emh1->AddTrackToEventPool(keyDFCollision, gtmp); - } - }; + EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); + emh1->AddTrackToEventPool(keyDFCollision,gtmp); + } }; addToPool(g1); addToPool(g2); - } // end same-event pair loop - - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photonsColl) { - if (!cut.template IsSelected(g)) - continue; - const int gid = g.globalIndex(); - if (photonIdsAfterDRCosOA.count(gid)) - fillSinglePhotonQAStep<1>(g); - if (photonIdsAfterRZ.count(gid)) - fillSinglePhotonQAStep<2>(g); - if (photonIdsAfterEllipse.count(gid)) - fillSinglePhotonQAStep<3>(g); - } } - + if (qaflags.doSinglePhotonQa) + for (const auto& g : photonsColl) + if (cut.template IsSelected(g)) { + const int gid = g.globalIndex(); + if (idsAfterDR.count(gid)) + fillSinglePhotonQAStep<1>(g); + if (idsAfterRZ.count(gid)) + fillSinglePhotonQAStep<2>(g); + if (idsAfterEllipse.count(gid)) + fillSinglePhotonQAStep<3>(g); + } usedPhotonIdsPerCol.clear(); - if (!cfgDoMix || ndiphoton == 0) continue; - auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); - for (const auto& mixID : poolIDs) { if (mixID.second == collision.globalIndex() && mixID.first == ndf) continue; const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; - const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - - std::min(collision.globalBC(), bcMix); + const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); if (diffBC < ndiffBCMix) continue; - auto poolPhotons = emh1->GetTracksPerCollision(mixID); - for (const auto& g1 : selectedPhotons) { + for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<1, 0>(obs, centForQA, occupancy); - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) @@ -1797,36 +1719,336 @@ struct photonhbt { continue; if (doQA) fillPairQAStep<1, 3>(obs, centForQA, occupancy); - if (doFullRange) + if (doFR) fillFullRangeQA<1>(obs, centForQA, occupancy); fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); } - } } - if (ndiphoton > 0) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); } - } // end collision loop + } + } + template + void runTruthEfficiency(TCollisions const& collisions, + TPhotons const& v0photons, + TLegs const& v0legs, + TMCParticles const& emmcParticles, + TMCEvents const& /*mcEvents*/, + TPresliceMCParts const& perMCCollision, + TPresliceLegs const& perCollisionLegs, + TCut const& cut) + { + auto wrapPhi = [](float dphi) -> float { + return RecoDecay::constrainAngle(dphi, -o2::constants::math::PI); + }; + + std::unordered_set mcIdsWithAnyV0Leg; + mcIdsWithAnyV0Leg.reserve(v0legs.size() * 2); + for (const auto& leg : v0legs) { + if (leg.has_emmcparticle()) + mcIdsWithAnyV0Leg.insert(leg.emmcparticleId()); + } + + for (const auto& collision : collisions) { + if (!fEMEventCut.IsSelected(collision)) + continue; + const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; + if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) + continue; + if (!collision.has_emmcevent()) + continue; + + const int64_t thisCollisionId = collision.globalIndex(); + const int mcEventId = collision.template emmcevent_as().globalIndex(); + + auto recoPhotonsColl = v0photons.sliceBy(perCollisionPCM, thisCollisionId); + auto emmcPartsColl = emmcParticles.sliceBy(perMCCollision, mcEventId); + auto legsColl = v0legs.sliceBy(perCollisionLegs, thisCollisionId); + + std::unordered_set legIdsThisCollision; + legIdsThisCollision.reserve(legsColl.size()); + for (const auto& leg : legsColl) { + if (leg.has_emmcparticle()) + legIdsThisCollision.insert(leg.emmcparticleId()); + } + + std::unordered_map> crossBuildMap; + + struct PhotonRecoInfo { + bool hasV0 = false, passesCut = false; + }; + std::unordered_map gammaRecoMap; + gammaRecoMap.reserve(recoPhotonsColl.size()); + + for (const auto& g : recoPhotonsColl) { + const auto pos = g.template posTrack_as(); + const auto neg = g.template negTrack_as(); + const bool wrongEvt = (pos.collisionId() != thisCollisionId || neg.collisionId() != thisCollisionId); + if (wrongEvt) + continue; + if (!pos.has_emmcparticle() || !neg.has_emmcparticle()) + continue; + const auto mcPos = pos.template emmcparticle_as(); + const auto mcNeg = neg.template emmcparticle_as(); + if (!mcPos.has_mothers() || !mcNeg.has_mothers()) + continue; + const int posMotherId = mcPos.mothersIds()[0], negMotherId = mcNeg.mothersIds()[0]; + if (posMotherId != negMotherId) { + const auto posMother = emmcParticles.iteratorAt(posMotherId); + const auto negMother = emmcParticles.iteratorAt(negMotherId); + if (posMother.pdgCode() == 22 && negMother.pdgCode() == 22) { + crossBuildMap[posMotherId].insert(negMotherId); + crossBuildMap[negMotherId].insert(posMotherId); + } + continue; + } + const int gammaId = posMotherId; + if (emmcParticles.iteratorAt(gammaId).pdgCode() != 22) + continue; + const bool passes = cut.template IsSelected, TLegs>(g); + auto& info = gammaRecoMap[gammaId]; + info.hasV0 = true; + info.passesCut = info.passesCut || passes; + } + + struct TruthGamma { + int id = -1, posId = -1, negId = -1; + float eta = 0.f, phi = 0.f, pt = 0.f, rTrue = -1.f, legDRtrue = -1.f; + }; + std::vector trueGammas; + trueGammas.reserve(32); + + for (const auto& g : emmcPartsColl) { + if (g.pdgCode() != 22) + continue; + if (!g.isPhysicalPrimary() && !g.producedByGenerator()) + continue; + if (std::fabs(g.eta()) > pcmcuts.cfgMaxEtaV0.value) + continue; + if (g.pt() < pcmcuts.cfgMinPtV0.value) + continue; + if (!g.has_daughters()) + continue; + int posId = -1, negId = -1; + float rTrue = -1.f; + for (const int dId : g.daughtersIds()) { + if (dId < 0) + continue; + const auto d = emmcParticles.iteratorAt(dId); + if (d.pdgCode() == -11) { + posId = dId; + rTrue = std::sqrt(d.vx() * d.vx() + d.vy() * d.vy()); + } else if (d.pdgCode() == 11) + negId = dId; + } + if (posId < 0 || negId < 0) + continue; + const auto mcPosE = emmcParticles.iteratorAt(posId); + const auto mcNegE = emmcParticles.iteratorAt(negId); + const float deTrE = static_cast(mcPosE.eta() - mcNegE.eta()); + const float dpTrE = wrapPhi(static_cast(mcPosE.phi() - mcNegE.phi())); + const float legDRt = std::sqrt(deTrE * deTrE + dpTrE * dpTrE); + trueGammas.push_back({static_cast(g.globalIndex()), posId, negId, + static_cast(g.eta()), static_cast(g.phi()), + static_cast(g.pt()), rTrue, legDRt}); + } + + { + int nBad = 0; + for (const auto& tg : trueGammas) { + const auto it = gammaRecoMap.find(tg.id); + if (it != gammaRecoMap.end() && it->second.hasV0 && + (mcIdsWithAnyV0Leg.count(tg.posId) == 0 || mcIdsWithAnyV0Leg.count(tg.negId) == 0)) + ++nBad; + } + fRegistryMC.fill(HIST("MC/TruthAO2D/hStageConsistency"), static_cast(nBad)); + } + + for (const auto& tg : trueGammas) { + const bool posFound = legIdsThisCollision.count(tg.posId) > 0; + const bool negFound = legIdsThisCollision.count(tg.negId) > 0; + for (const auto& [legId, legFound] : + std::initializer_list>{{tg.posId, posFound}, {tg.negId, negFound}}) { + if (legId < 0) + continue; + if (legFound) { + fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legFound"), tg.pt, tg.legDRtrue); + if (tg.rTrue >= 0.f) + fRegistryMC.fill(HIST("MC/LegDiag/hRconv_legFound_vs_pt"), tg.pt, tg.rTrue); + } else { + fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legMissing"), tg.pt, tg.legDRtrue); + if (tg.rTrue >= 0.f) + fRegistryMC.fill(HIST("MC/LegDiag/hRconv_legMissing_vs_pt"), tg.pt, tg.rTrue); + } + } + } + + for (size_t i = 0; i < trueGammas.size(); ++i) { + for (size_t j = i + 1; j < trueGammas.size(); ++j) { + const auto& g1 = trueGammas[i]; + const auto& g2 = trueGammas[j]; + const float deta = g1.eta - g2.eta; + const float dphi = wrapPhi(g1.phi - g2.phi); + const float px1 = g1.pt * std::cos(g1.phi), py1 = g1.pt * std::sin(g1.phi); + const float px2 = g2.pt * std::cos(g2.phi), py2 = g2.pt * std::sin(g2.phi); + const float kt = 0.5f * std::sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)); + + if (cfgMCMinKt > 0.f && kt < cfgMCMinKt) + continue; + if (cfgMCMaxKt > 0.f && kt > cfgMCMaxKt) + continue; + + const float e1 = g1.pt * std::cosh(g1.eta), e2 = g2.pt * std::cosh(g2.eta); + const float dot = e1 * e2 - (px1 * px2 + py1 * py2 + g1.pt * std::sinh(g1.eta) * g2.pt * std::sinh(g2.eta)); + const float qinv_true = std::sqrt(std::max(0.f, 2.f * dot)); + + if (cfgMCMaxQinv > 0.f && qinv_true > cfgMCMaxQinv) + continue; + + auto it1 = gammaRecoMap.find(g1.id), it2 = gammaRecoMap.find(g2.id); + const bool g1Built = (it1 != gammaRecoMap.end()) && it1->second.hasV0; + const bool g2Built = (it2 != gammaRecoMap.end()) && it2->second.hasV0; + const bool g1Sel = (it1 != gammaRecoMap.end()) && it1->second.passesCut; + const bool g2Sel = (it2 != gammaRecoMap.end()) && it2->second.passesCut; + + const bool pairAll4LegsThisColl = + legIdsThisCollision.count(g1.posId) > 0 && legIdsThisCollision.count(g1.negId) > 0 && + legIdsThisCollision.count(g2.posId) > 0 && legIdsThisCollision.count(g2.negId) > 0; + + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_truthConverted"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_truthConverted"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_truthConverted"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_truthConverted"), deta, dphi); + if (pairAll4LegsThisColl) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_all4LegsThisColl"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_all4LegsThisColl"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_all4LegsThisColl"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_all4LegsThisColl"), deta, dphi); + } + if (g1Built && g2Built) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsBuilt"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsBuilt"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_bothPhotonsBuilt"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_bothPhotonsBuilt"), deta, dphi); + } + if (g1Sel && g2Sel) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsSelected"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsSelected"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_bothPhotonsSelected"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_bothPhotonsSelected"), deta, dphi); + } + + if (g1.rTrue >= 0.f && g2.rTrue >= 0.f) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted"), g1.rTrue, g2.rTrue); + if (g1Sel && g2Sel) + fRegistryMC.fill(HIST("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected"), g1.rTrue, g2.rTrue); + } + const float minRconv = (g1.rTrue >= 0.f && g2.rTrue >= 0.f) ? std::min(g1.rTrue, g2.rTrue) + : (g1.rTrue >= 0.f ? g1.rTrue : g2.rTrue); + if (minRconv >= 0.f) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted"), kt, minRconv); + if (g1Sel && g2Sel) + fRegistryMC.fill(HIST("MC/TruthAO2D/hMinRconv_vs_kT_bothPhotonsSelected"), kt, minRconv); + } + + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 0.f); + if (pairAll4LegsThisColl) + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 1.f); + if (g1Built && g2Built) + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 2.f); + if (g1Sel && g2Sel) + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 3.f); + + const auto itCB = crossBuildMap.find(g1.id); + if (itCB != crossBuildMap.end() && itCB->second.count(g2.id) > 0) { + fRegistryMC.fill(HIST("MC/PairCrossBuild/hSparse_DEtaDPhi_kT"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/PairCrossBuild/hStageOut_vs_kT"), + kt, static_cast((g1Built ? 1 : 0) + (g2Built ? 1 : 0))); + } + + const int nLegsThisColl = + (legIdsThisCollision.count(g1.posId) > 0 ? 1 : 0) + + (legIdsThisCollision.count(g1.negId) > 0 ? 1 : 0) + + (legIdsThisCollision.count(g2.posId) > 0 ? 1 : 0) + + (legIdsThisCollision.count(g2.negId) > 0 ? 1 : 0); + fRegistryMC.fill(HIST("MC/LegDiag/hNLegsPair_vs_kT"), kt, static_cast(nLegsThisColl)); + + for (const auto& [tgRef, legId] : + std::initializer_list, int>>{ + {std::cref(g1), g1.posId}, {std::cref(g1), g1.negId}, {std::cref(g2), g2.posId}, {std::cref(g2), g2.negId}}) { + if (legId < 0 || legIdsThisCollision.count(legId) > 0) + continue; + const auto& tg_parent = tgRef.get(); + const float legPtTrue = static_cast(emmcParticles.iteratorAt(legId).pt()); + fRegistryMC.fill(HIST("MC/LegDiag/hMissingLegPt_vs_kT"), kt, legPtTrue); + if (tg_parent.rTrue >= 0.f) + fRegistryMC.fill(HIST("MC/LegDiag/hMissingLegRconv_vs_kT"), kt, tg_parent.rTrue); + } + } + } + } } + using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler< + std::tuple, std::pair, EMPair>; + + MyEMH* emh1 = nullptr; + MyEMH* emh2 = nullptr; + std::unordered_set usedPhotonIdsPerCol; + std::map, uint64_t> mapMixedEventIdToGlobalBC; + + SliceCache cache; + Preslice perCollisionPCM = aod::v0photonkf::pmeventId; + PresliceUnsorted perCollisionV0Legs = aod::v0leg::collisionId; + PresliceUnsorted perMCCollisionEMMCParts = aod::emmcparticle::emmceventId; + + Filter collisionFilterCentrality = + (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || + (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || + (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + Filter collisionFilterOccupancyTrack = + eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && + o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + Filter collisionFilterOccupancyFT0c = + eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && + o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + + using FilteredMyCollisions = soa::Filtered; + int ndf = 0; + + void processAnalysis(FilteredMyCollisions const& collisions, + MyV0Photons const& v0photons, + aod::V0Legs const& v0legs) + { + runPairing(collisions, v0photons, v0photons, v0legs, v0legs, + perCollisionPCM, perCollisionPCM, fV0PhotonCut, fV0PhotonCut); + ndf++; + } + PROCESS_SWITCH(photonhbt, processAnalysis, "pairing for analysis", true); + void processMC(FilteredMyCollisions const& collisions, MyV0Photons const& v0photons, MyMCV0Legs const& v0legs, aod::EMMCParticles const& mcParticles, - aod::EMMCEvents const& /*mcEvents*/) + aod::EMMCEvents const& mcEvents) { + runPairingMC(collisions, v0photons, v0legs, mcParticles, perCollisionPCM, fV0PhotonCut); + runTruthEfficiency(collisions, v0photons, v0legs, mcParticles, mcEvents, + perMCCollisionEMMCParts, perCollisionV0Legs, fV0PhotonCut); + ndf++; } - - PROCESS_SWITCH(photonhbt, processMC, "pairing with MC truth classification", false); + PROCESS_SWITCH(photonhbt, processMC, "MC CF + truth efficiency maps for CF correction", false); }; -// ============================================================================ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"photonhbt"})}; From d292dec24115db40068215cec3a8e3247e9a323b Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Sat, 28 Mar 2026 11:54:03 +0100 Subject: [PATCH 086/282] [PWGCF] flowSP: Add new px/pt obs and separate all PID in new process (#15498) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 41 +- PWGCF/Flow/Tasks/flowSP.cxx | 514 ++++++++++++++++------- 2 files changed, 393 insertions(+), 162 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 9adde113460..8dd974cf75f 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -230,7 +230,9 @@ struct ZdcQVectors { std::vector capCOORDS = {"X", "Y"}; AxisSpec axisPsiA = {100, -PI, PI, "#Psi_{1} ZNA"}; + AxisSpec axisPsiAShifted = {100, -PI, PI, "#Psi_{1} ZNA Shifted"}; AxisSpec axisPsiC = {100, -PI, PI, "#Psi_{1} ZNC"}; + AxisSpec axisPsiCShifted = {100, -PI, PI, "#Psi_{1} ZNC Shifted"}; // This is the only histogram that is AL~WA~YS filled. registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); @@ -306,12 +308,16 @@ struct ZdcQVectors { registry.add("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}}); registry.add("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}}); - registry.add("QA/psiZDCA", "psiZDCA", kTH2D, {axisPsiA, {100, 0, 100}}); - registry.add("QA/psiZDCA_shift", "psiZDCA_shift", kTH2D, {axisPsiA, {100, 0, 100}}); - registry.add("QA/psiZDCC", "psiZDCC", kTH2D, {axisPsiC, {100, 0, 100}}); - registry.add("QA/psiZDCC_shift", "psiZDCC_shift", kTH2D, {axisPsiC, {100, 0, 100}}); - registry.add("QA/psiZDCAC", "psiZDCAC", kTH2D, {axisPsiA, axisPsiC}); - registry.add("QA/psiZDCAC_shift", "psiZDCAC_shift", kTH2D, {axisPsiA, axisPsiC}); + registry.add("QA/shift/psiZDCA", "psiZDCA", kTH2D, {axisPsiA, {100, 0, 100}}); + registry.add("QA/shift/psiZDCA_shift", "psiZDCA_shift", kTH2D, {axisPsiA, {100, 0, 100}}); + registry.add("QA/shift/psiZDCC", "psiZDCC", kTH2D, {axisPsiC, {100, 0, 100}}); + registry.add("QA/shift/psiZDCC_shift", "psiZDCC_shift", kTH2D, {axisPsiC, {100, 0, 100}}); + registry.add("QA/shift/psiZDCAC", "psiZDCAC", kTH2D, {axisPsiA, axisPsiC}); + registry.add("QA/shift/psiZDCAC_shift", "psiZDCAC_shift", kTH2D, {axisPsiA, axisPsiC}); + + registry.add("QA/shift/DeltaPsiZDCA", "DeltaPsiZDCA", kTH2D, {axisPsiAShifted, axisPsiA}); + registry.add("QA/shift/DeltaPsiZDCC", "DeltaPsiZDCC", kTH2D, {axisPsiCShifted, axisPsiC}); + registry.add("QA/shift/DeltaPsiZDCAC", "DeltaPsiZDCAC", kTH2D, {axisPsiA, axisPsiC}); registry.add("QA/before/ZNA_pmC", "ZNA_pmC", kTProfile, {{1, 0, 1.}}); registry.add("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}}); @@ -1162,12 +1168,15 @@ struct ZdcQVectors { psiZDCAshift = std::atan2(std::sin(psiZDCAshift), std::cos(psiZDCAshift)); if (cfgFillHistRegistry && !cfgFillNothing) { - registry.fill(HIST("QA/psiZDCA"), psiZDCA, centrality); - registry.fill(HIST("QA/psiZDCC"), psiZDCC, centrality); - registry.fill(HIST("QA/psiZDCAC"), psiZDCA, psiZDCC); - registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift, centrality); - registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift, centrality); - registry.fill(HIST("QA/psiZDCAC_shift"), psiZDCAshift, psiZDCCshift); + registry.fill(HIST("QA/shift/psiZDCA"), psiZDCA, centrality); + registry.fill(HIST("QA/shift/psiZDCC"), psiZDCC, centrality); + registry.fill(HIST("QA/shift/psiZDCAC"), psiZDCA, psiZDCC); + registry.fill(HIST("QA/shift/psiZDCA_shift"), psiZDCAshift, centrality); + registry.fill(HIST("QA/shift/psiZDCC_shift"), psiZDCCshift, centrality); + registry.fill(HIST("QA/shift/psiZDCAC_shift"), psiZDCAshift, psiZDCCshift); + registry.fill(HIST("QA/shift/DeltaPsiZDCA"), psiZDCAshift, psiZDCA); + registry.fill(HIST("QA/shift/DeltaPsiZDCC"), psiZDCCshift, psiZDCC); + registry.fill(HIST("QA/shift/DeltaPsiZDCAC"), psiZDCAshift - psiZDCA, psiZDCCshift - psiZDCC); } double qXaShift = std::hypot(qRec[1], qRec[0]) * std::cos(psiZDCAshift); @@ -1178,10 +1187,10 @@ struct ZdcQVectors { if (isSelected && cfgFillHistRegistry && !cfgFillNothing) { fillCommonRegistry(qRec[0], qRec[1], qRec[2], qRec[3], v, centrality, rsTimestamp); registry.fill(HIST("QA/centrality_after"), centrality); - registry.get(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qRec[0]); - registry.get(HIST("QA/after/ZNA_Qy"))->Fill(Form("%d", runnumber), qRec[1]); - registry.get(HIST("QA/after/ZNC_Qx"))->Fill(Form("%d", runnumber), qRec[2]); - registry.get(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qRec[3]); + registry.get(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qXaShift); + registry.get(HIST("QA/after/ZNA_Qy"))->Fill(Form("%d", runnumber), qYaShift); + registry.get(HIST("QA/after/ZNC_Qx"))->Fill(Form("%d", runnumber), qXcShift); + registry.get(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qYcShift); } spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, isSelected, eventSelectionFlags); diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index a323867eb6b..d863773ce4c 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -154,9 +154,11 @@ struct FlowSP { Filter trackFilter = nabs(aod::track::eta) < cfgTrackSelsEta && aod::track::pt > cfgTrackSelsPtmin&& aod::track::pt < cfgTrackSelsPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgTrackSelsDCAxy&& nabs(aod::track::dcaZ) < cfgTrackSelsDCAz; Filter trackFilterMC = nabs(aod::mcparticle::eta) < cfgTrackSelsEta && aod::mcparticle::pt > cfgTrackSelsPtmin&& aod::mcparticle::pt < cfgTrackSelsPtmax; using GeneralCollisions = soa::Join; - using UnfilteredTracks = soa::Join; + using UnfilteredTracksPID = soa::Join; + using UnfilteredTracks = soa::Join; using UsedTracks = soa::Filtered; + using UsedTracksPID = soa::Filtered; using ZDCCollisions = soa::Filtered>; // For MC Reco and Gen @@ -230,6 +232,8 @@ struct FlowSP { double psiFull = 0; double trackPxA = 0; double trackPxC = 0; + double meanPxA = 0; + double meanPxC = 0; } spm; OutputObj fWeights{GFWWeights("weights")}; @@ -341,6 +345,7 @@ struct FlowSP { AxisSpec axisdEdx = {300, 0, 300, "dEdx for PID"}; AxisSpec axisBeta = {150, 0, 1.5, "Beta for PID"}; AxisSpec axisCharge = {3, 0, 3, "Charge: 0 = inclusive, 1 = positive, 2 = negative"}; + AxisSpec axisPx = {1000, -0.05, 0.05, "p_{x} (GeV/c)"}; std::vector ptbinning = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; AxisSpec axisPt = {ptbinning, "#it{p}_{T} GeV/#it{c}"}; @@ -425,6 +430,7 @@ struct FlowSP { histos.add("QA/after/PsiA_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); histos.add("QA/after/PsiC_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); histos.add("QA/after/PsiFull_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); + // histos.add("QA/after/DeltaPsivsPx", "", {HistType::kTH3D, {axisCent, axisPhiPlane, axisPx}}); } if (cfgFillQABefore) { @@ -432,7 +438,7 @@ struct FlowSP { } } - if (doprocessData || doprocessMCReco) { + if (doprocessData || doprocessMCReco || doprocessDataPID) { if (cfgFillTrackQA) { histos.add("incl/QA/after/pt_phi", "", {HistType::kTH2D, {axisPt, axisPhiMod}}); @@ -459,7 +465,7 @@ struct FlowSP { histos.addClone("incl/QA/after/", "incl/QA/before/"); } - if (cfgFillPIDQA) { + if (cfgFillPIDQA && doprocessDataPID) { histos.add("hPIDcounts", "", kTH2D, {{{4, 0, 4}, axisPt}}); histos.get(HIST("hPIDcounts"))->GetXaxis()->SetBinLabel(1, "UFO"); histos.get(HIST("hPIDcounts"))->GetXaxis()->SetBinLabel(2, "Pion"); @@ -499,6 +505,10 @@ struct FlowSP { histos.addClone("incl/pion/", "incl/proton/"); } + if (cfgFillEventQA) { + histos.add("QA/hCentFull", " ; Centrality (%); ", {HistType::kTH1D, {axisCent}}); + } + if (doprocessMCReco) { registry.add("trackMCReco/after/hIsPhysicalPrimary", "", {HistType::kTH2D, {{2, 0, 2}, axisCentrality}}); registry.add("trackMCReco/hTrackSize_unFiltered", "", {HistType::kTH2D, {{100, 0, 200000}, axisCentrality}}); @@ -514,6 +524,7 @@ struct FlowSP { registry.addClone("trackMCReco/after/incl/", "trackMCReco/after/neg/"); registry.addClone("trackMCReco/after/", "trackMCReco/before/"); } + if (doprocessData) { registry.add("QQCorrelations/qAqCX", "", kTProfile, {axisCent}); registry.add("QQCorrelations/qAqCY", "", kTProfile, {axisCent}); @@ -524,8 +535,12 @@ struct FlowSP { if (cfgFillGeneralV1Histos) { // track properties per centrality and per eta, pt bin + registry.add("incl/vnCodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnAodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnCSetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnASetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); } if (cfgFillMeanPT) { registry.add("incl/meanPT/meanRelPtA", "", kTProfile2D, {axisEtaVn, axisCentrality}); @@ -534,41 +549,33 @@ struct FlowSP { registry.add("incl/meanPT/hMeanPtEtaCent", "", kTProfile2D, {axisEtaVn, axisCent}); registry.add("incl/meanPT/ptV1A", "", kTProfile2D, {axisEtaVn, axisCent}); registry.add("incl/meanPT/ptV1C", "", kTProfile2D, {axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1Aodd", "", kTProfile2D, {axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1Codd", "", kTProfile2D, {axisEtaVn, axisCent}); registry.add("incl/meanPT/hMeanPtCent", "", kTProfile, {axisCent}); - } - if (cfgFillPID) { - registry.add("incl/pion/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - if (cfgFillEventPlane) { - registry.add("incl/pion/vnA_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnC_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnFull_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - } + registry.add("incl/meanPT/ptV1A3D", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1C3D", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + + registry.add("incl/meanPT/ptV1A3Dx", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1C3Dx", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + + registry.add("incl/meanPT/ptV1A3Dy", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1C3Dy", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + + registry.add("incl/meanPT/meanPxA", "", kTH3D, {axisCent, axisPhiPlane, axisPx}); + registry.add("incl/meanPT/meanPxC", "", kTH3D, {axisCent, axisPhiPlane, axisPx}); } if (cfgFillXandYterms) { registry.add("incl/vnAx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnAy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnCx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnCy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - if (cfgFillPID) { - registry.add("incl/pion/vnAx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnAy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnCx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnCy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - } } if (cfgFillMixedHarmonics) { registry.add("incl/MH/vnAxCxUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/MH/vnAyCyUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/MH/vnAxCyUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/MH/vnAyCxUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - if (cfgFillPID) { - registry.add("incl/pion/MH/vnAxCxUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/MH/vnAyCyUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/MH/vnAxCyUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/MH/vnAyCxUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - } } if (cfgFillEventPlane) { registry.add("incl/vnA_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); @@ -585,21 +592,53 @@ struct FlowSP { histos.add("QA/hCosPhiASinsPhiC", "hCosPhiASinsPhiC; Centrality(%); #LT Cos(#Psi^{A})Sin(#Psi^{C})#GT", kTProfile, {axisCent}); histos.add("QA/hFullEvPlaneRes", "hFullEvPlaneRes; Centrality(%); -#LT Cos(#Psi^{A} - #Psi^{C})#GT ", kTProfile, {axisCent}); } - if (cfgFillEventQA) { - histos.add("QA/hCentFull", " ; Centrality (%); ", {HistType::kTH1D, {axisCent}}); - } - } // end of doprocessData - if (cfgFillChargeDependence || cfgFillPID) { - registry.addClone("incl/pion/", "incl/proton/"); - registry.addClone("incl/pion/", "incl/kaon/"); + + } // end of doProcessData + + if (cfgFillChargeDependence || cfgFillChargeDependenceQA) { + LOGF(info, "Cloning charge dependence histograms"); registry.addClone("incl/", "pos/"); registry.addClone("incl/", "neg/"); - } - if (cfgFillPIDQA || cfgFillChargeDependenceQA) { + histos.addClone("incl/", "pos/"); histos.addClone("incl/", "neg/"); } + if (doprocessDataPID) { + if (cfgFillGeneralV1Histos) { + registry.add("incl/pion/vnCodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnAodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnCSetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnASetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + + if (cfgFillEventPlane) { + registry.add("incl/pion/vnA_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnC_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnFull_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + if (cfgFillXandYterms) { + registry.add("incl/pion/vnAx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnAy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnCx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnCy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + if (cfgFillMixedHarmonics) { + registry.add("incl/pion/MH/vnAxCxUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/MH/vnAyCyUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/MH/vnAxCyUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/MH/vnAyCxUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + registry.addClone("incl/pion/", "incl/proton/"); + registry.addClone("incl/pion/", "incl/kaon/"); + if (cfgFillChargeDependence) { + registry.addClone("incl/", "pos/"); + registry.addClone("incl/", "neg/"); + } + } + } else if (doprocessMCGen) { registry.add("trackMCGen/nCollReconstructedPerMcCollision", "", {HistType::kTH1D, {{10, -5, 5}}}); registry.add("trackMCGen/after/incl/hPt_hadron", "", {HistType::kTH3D, {axisPt, axisEta, axisCentrality}}); @@ -966,7 +1005,7 @@ struct FlowSP { histos.fill(HIST("hTrackCount"), trackSel_DCAz); - if (track.tpcNClsFound() < cfgTrackSelsNcls) + if (track.tpcNClsCrossedRows() < cfgTrackSelsNcls) return false; histos.fill(HIST("hTrackCount"), trackSel_NCls); @@ -1039,6 +1078,7 @@ struct FlowSP { histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vz"), psiA, collision.posZ(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vz"), psiC, collision.posZ(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vz"), psiFull, collision.posZ(), spm.centWeight); + // histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/DeltaPsivsPx"), spm.centrality, psiA - psiC - constants::math::PI, track.px(), spm.centWeight); } } return; @@ -1048,10 +1088,18 @@ struct FlowSP { inline void fillHistograms(TrackObject track) { double weight = spm.wacc[ct][pt] * spm.weff[ct][pt] * spm.centWeight; + int scale = 1.0; + int minusQ = -1.0; + if (track.eta() < 0) + scale = -1.0; if (cfgFillGeneralV1Histos) { + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnAodd"), track.pt(), track.eta(), spm.centrality, scale * (spm.uy * spm.qyA + spm.ux * spm.qxA) / std::sqrt(std::fabs(spm.corrQQ)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnCodd"), track.pt(), track.eta(), spm.centrality, scale * (spm.uy * spm.qyC + spm.ux * spm.qxC) / std::sqrt(std::fabs(spm.corrQQ)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnA"), track.pt(), track.eta(), spm.centrality, (spm.uy * spm.qyA + spm.ux * spm.qxA) / std::sqrt(std::fabs(spm.corrQQ)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnC"), track.pt(), track.eta(), spm.centrality, (spm.uy * spm.qyC + spm.ux * spm.qxC) / std::sqrt(std::fabs(spm.corrQQ)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnCSetPlane"), track.pt(), track.eta(), spm.centrality, (spm.uy + spm.ux) / std::sqrt(std::fabs(spm.corrQQ)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnASetPlane"), track.pt(), track.eta(), spm.centrality, (minusQ * spm.ux - spm.uy) / std::sqrt(std::fabs(spm.corrQQ)), weight); } if (cfgFillMixedHarmonics) { @@ -1079,6 +1127,18 @@ struct FlowSP { registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/hMeanPtCent"), spm.centrality, track.pt(), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A"), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C"), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1Aodd"), track.eta(), spm.centrality, track.pt() * scale * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1Codd"), track.eta(), spm.centrality, track.pt() * scale * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A3D"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3D"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A3Dx"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQx)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3Dx"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQx)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A3Dy"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA) / (std::sqrt(std::fabs(spm.corrQQy)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3Dy"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC) / (std::sqrt(std::fabs(spm.corrQQy)) * spm.meanPtWeight)), weight); } } @@ -1105,25 +1165,26 @@ struct FlowSP { histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hDCAxy_pt"), track.pt(), track.dcaXY(), spm.wacc[ct][par] * spm.weff[ct][par]); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hDCAz_pt"), track.pt(), track.dcaZ(), spm.wacc[ct][par] * spm.weff[ct][par]); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hSharedClusters_pt"), track.pt(), track.tpcFractionSharedCls(), spm.wacc[ct][par] * spm.weff[ct][par]); - histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_pt"), track.pt(), track.tpcNClsFound(), spm.wacc[ct][par] * spm.weff[ct][par]); - histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_vs_SharedClusters"), track.tpcNClsFound(), track.tpcFractionSharedCls(), spm.wacc[ct][par] * spm.weff[ct][par]); + histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_pt"), track.pt(), track.tpcNClsCrossedRows(), spm.wacc[ct][par] * spm.weff[ct][par]); + histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_vs_SharedClusters"), track.tpcNClsCrossedRows(), track.tpcFractionSharedCls(), spm.wacc[ct][par] * spm.weff[ct][par]); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hMeanPtEta"), track.eta(), spm.centrality, track.pt(), spm.wacc[ct][par] * spm.weff[ct][par]); } template inline void fillPIDQA(TrackObject track) { - if (!cfgFillPIDQA || !cfgFillTrackQA) + if (!cfgFillTrackQA) return; - - histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPi()); - histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPi()); - histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaKa()); - histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaKa()); - histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPr()); - histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPr()); - histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hdEdxTPC_pt"), track.pt(), track.tpcSignal()); - histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hBetaTOF_pt"), track.pt(), track.beta()); + if constexpr (framework::has_type_v) { + histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPi()); + histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPi()); + histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaKa()); + histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaKa()); + histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPr()); + histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPr()); + histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hdEdxTPC_pt"), track.pt(), track.tpcSignal()); + histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hBetaTOF_pt"), track.pt(), track.beta()); + } } template @@ -1339,12 +1400,11 @@ struct FlowSP { TProfile* relPxCNeg = new TProfile("relPxCNeg", "relPxCNeg", 8, -0.8, 0.8); TProfile* relPxCPos = new TProfile("relPxCPos", "relPxCPos", 8, -0.8, 0.8); - for (const auto& track : tracks) { - - ParticleType trackPID = (cfgFillPID || cfgFillPIDQA) ? getTrackPID(track) : kUnidentified; + double sumPxAEvent = 0; + int meanPxEventCount = 0; + double sumPxCEvent = 0; - if (cfgFillPIDQA) - histos.fill(HIST("hPIDcounts"), trackPID, track.pt()); + for (const auto& track : tracks) { if (track.sign() == 0) continue; @@ -1355,21 +1415,6 @@ struct FlowSP { if (cfgFillQABefore) { fillAllQA(track); - if (cfgFillPIDQA) { - switch (trackPID) { - case kPions: - fillAllQA(track); - break; - case kKaons: - fillAllQA(track); - break; - case kProtons: - fillAllQA(track); - break; - default: /* do nothing */ - break; - } - } } if (!trackSelected(track, field)) @@ -1419,21 +1464,6 @@ struct FlowSP { histos.fill(HIST("hTrackCount"), trackSel_ParticleWeights); fillAllQA(track); - if (cfgFillPIDQA) { - switch (trackPID) { - case kPions: - fillAllQA(track); - break; - case kKaons: - fillAllQA(track); - break; - case kProtons: - fillAllQA(track); - break; - default: /* do nothing */ - break; - } - } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - spm.ux = std::cos(cfgHarm * phi); @@ -1449,6 +1479,9 @@ struct FlowSP { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + spm.meanPxA = track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)); + spm.meanPxC = track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)); + fillHistograms(track); if (cfgFillChargeDependence) { @@ -1462,79 +1495,41 @@ struct FlowSP { } } - if (cfgFillPID) { - switch (trackPID) { - case kPions: - fillHistograms(track); - break; - case kKaons: - fillHistograms(track); - break; - case kProtons: - fillHistograms(track); - break; - default: /* do nothing */ - break; - } - if (cfgFillChargeDependence) { - switch (spm.charge) { - case kPositive: { - switch (trackPID) { - case kPions: - fillHistograms(track); - break; - case kKaons: - fillHistograms(track); - break; - case kProtons: - fillHistograms(track); - break; - default: /* do nothing */ - break; - } - break; - } - case kNegative: { - switch (trackPID) { - case kPions: - fillHistograms(track); - break; - case kKaons: - fillHistograms(track); - break; - case kProtons: - fillHistograms(track); - break; - default: /* do nothing */ - break; - } - break; - } - } - } - } // end of fillPID - double drelPxA = track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / std::sqrt(std::fabs(spm.corrQQ))); double drelPxC = track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / std::sqrt(std::fabs(spm.corrQQ))); - meanPTMap->Fill(track.eta(), track.pt(), spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight); - relPxA->Fill(track.eta(), drelPxA, spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight); - relPxC->Fill(track.eta(), drelPxC, spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight); + double weightIncl = spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight; + double weightPos = spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight; + double weightNeg = spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight; + + sumPxAEvent += spm.meanPxA * weightIncl; + sumPxCEvent += spm.meanPxC * weightIncl; + meanPxEventCount += weightIncl; + + meanPTMap->Fill(track.eta(), track.pt(), weightIncl); + relPxA->Fill(track.eta(), drelPxA, weightIncl); + relPxC->Fill(track.eta(), drelPxC, weightIncl); if (spm.charge == kPositive) { - meanPTMapPos->Fill(track.eta(), track.pt(), spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight); - relPxAPos->Fill(track.eta(), drelPxA, spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight); - relPxCPos->Fill(track.eta(), drelPxC, spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight); + meanPTMapPos->Fill(track.eta(), track.pt(), weightPos); + relPxAPos->Fill(track.eta(), drelPxA, weightPos); + relPxCPos->Fill(track.eta(), drelPxC, weightPos); } if (spm.charge == kNegative) { - meanPTMapNeg->Fill(track.eta(), track.pt(), spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight); - relPxANeg->Fill(track.eta(), drelPxA, spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight); - relPxCNeg->Fill(track.eta(), drelPxC, spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight); + meanPTMapNeg->Fill(track.eta(), track.pt(), weightNeg); + relPxANeg->Fill(track.eta(), drelPxA, weightNeg); + relPxCNeg->Fill(track.eta(), drelPxC, weightNeg); } } // end of track loop + double meanPxAEvent = sumPxAEvent / meanPxEventCount; + double meanPxCEvent = sumPxCEvent / meanPxEventCount; + + registry.fill(HIST("incl/meanPT/meanPxA"), spm.centrality, spm.psiA - spm.psiC, meanPxAEvent); + registry.fill(HIST("incl/meanPT/meanPxC"), spm.centrality, spm.psiA - spm.psiC, meanPxCEvent); + // Now we want to fill the final relPt histogram // Loop over all eta and fill bins if (cfgFillMeanPT) { @@ -1556,11 +1551,14 @@ struct FlowSP { if (meanPt != 0) { registry.fill(HIST("incl/meanPT/meanRelPtA"), eta, spm.centrality, drelPxA / meanPt, spm.centWeight); - registry.fill(HIST("neg/meanPT/meanRelPtA"), eta, spm.centrality, drelPxANeg / meanPtNeg, spm.centWeight); - registry.fill(HIST("pos/meanPT/meanRelPtA"), eta, spm.centrality, drelPxAPos / meanPtPos, spm.centWeight); registry.fill(HIST("incl/meanPT/meanRelPtC"), eta, spm.centrality, drelPxC / meanPt, spm.centWeight); - registry.fill(HIST("neg/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCNeg / meanPtNeg, spm.centWeight); - registry.fill(HIST("pos/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCPos / meanPtPos, spm.centWeight); + + if (cfgFillChargeDependence) { + registry.fill(HIST("neg/meanPT/meanRelPtA"), eta, spm.centrality, drelPxANeg / meanPtNeg, spm.centWeight); + registry.fill(HIST("pos/meanPT/meanRelPtA"), eta, spm.centrality, drelPxAPos / meanPtPos, spm.centWeight); + registry.fill(HIST("neg/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCNeg / meanPtNeg, spm.centWeight); + registry.fill(HIST("pos/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCPos / meanPtPos, spm.centWeight); + } } } } @@ -1578,6 +1576,230 @@ struct FlowSP { PROCESS_SWITCH(FlowSP, processData, "Process analysis for non-derived data", true); + void processDataPID(ZDCCollisions::iterator const& collision, aod::BCsWithTimestamps const&, UsedTracksPID const& tracks) + { + + histos.fill(HIST("hEventCount"), evSel_FilteredEvent); + auto bc = collision.bc_as(); + int standardMagField = 99999; + auto field = (cfgMagField == standardMagField) ? getMagneticField(bc.timestamp()) : cfgMagField; + + if (bc.runNumber() != cfg.lastRunNumber) { + cfg.correctionsLoaded = false; + cfg.clCentrality = false; + cfg.lastRunNumber = bc.runNumber(); + cfg.mAcceptance.clear(); + LOGF(info, "Size of mAcceptance: %i (should be 0)", (int)cfg.mAcceptance.size()); + } + + if (cfgFillQABefore) + fillEventQA(collision, tracks); + + loadCorrections(bc.timestamp()); + + spm.centrality = collision.centFT0C(); + + if (cfgCentFT0Cvariant1) + spm.centrality = collision.centFT0CVariant1(); + if (cfgCentFT0M) + spm.centrality = collision.centFT0M(); + if (cfgCentFV0A) + spm.centrality = collision.centFV0A(); + if (cfgCentNGlobal) + spm.centrality = collision.centNGlobal(); + + if (!eventSelected(collision, tracks.size())) + return; + + if (!collision.isSelected()) // selected by ZDCQVectors task (checks signal in ZDC) --> only possible in data not MC + return; + histos.fill(HIST("hEventCount"), evSel_isSelectedZDC); + + // Always fill centrality histogram after event selections! + histos.fill(HIST("hCentrality"), spm.centrality); + + spm.qxA = collision.qxA(); + spm.qyA = collision.qyA(); + spm.qxC = collision.qxC(); + spm.qyC = collision.qyC(); + + spm.vz = collision.posZ(); + + spm.psiA = 1.0 * std::atan2(spm.qyA, spm.qxA); + spm.psiC = 1.0 * std::atan2(spm.qyC, spm.qxC); + + // https://twiki.cern.ch/twiki/pub/ALICE/DirectedFlowAnalysisNote/vn_ZDC_ALICE_INT_NOTE_version02.pdf + spm.psiFull = 1.0 * std::atan2(spm.qyA + spm.qyC, spm.qxA + spm.qxC); + + if (spm.centrality > cfgCentMax || spm.centrality < cfgCentMin) + return; + + // Load correlations and SP resolution needed for Scalar Product and event plane methods. + // Only load once! + // If not loaded set to 1 + + if (cfgCCDBdir_QQ.value.empty() == false) { + if (!cfg.clQQ) { + TList* hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_QQ.value, bc.timestamp()); + cfg.hcorrQQ = reinterpret_cast(hcorrList->FindObject("qAqCXY")); + cfg.hcorrQQx = reinterpret_cast(hcorrList->FindObject("qAqCX")); + cfg.hcorrQQy = reinterpret_cast(hcorrList->FindObject("qAqCY")); + cfg.clQQ = true; + } + spm.corrQQ = cfg.hcorrQQ->GetBinContent(cfg.hcorrQQ->FindBin(spm.centrality)); + spm.corrQQx = cfg.hcorrQQx->GetBinContent(cfg.hcorrQQx->FindBin(spm.centrality)); + spm.corrQQy = cfg.hcorrQQy->GetBinContent(cfg.hcorrQQy->FindBin(spm.centrality)); + } + + double evPlaneRes = 1.; + if (cfgCCDBdir_SP.value.empty() == false) { + if (!cfg.clEvPlaneRes) { + cfg.hEvPlaneRes = ccdb->getForTimeStamp(cfgCCDBdir_SP.value, bc.timestamp()); + cfg.clEvPlaneRes = true; + } + evPlaneRes = cfg.hEvPlaneRes->GetBinContent(cfg.hEvPlaneRes->FindBin(spm.centrality)); + if (evPlaneRes < 0) + LOGF(fatal, " > 0 for centrality %.2f! Cannot determine resolution.. Change centrality ranges!!!", spm.centrality); + evPlaneRes = std::sqrt(evPlaneRes); + } + + spm.centWeight = 1.; + if (cfgCCDBdir_centrality.value.empty() == false) { + if (!cfg.clCentrality) { + cfg.hCentrality = ccdb->getForTimeStamp(cfgCCDBdir_centrality.value, bc.timestamp()); + cfg.clCentrality = true; + } + double centW = cfg.hCentrality->GetBinContent(cfg.hCentrality->FindBin(spm.centrality)); + if (centW < 0) { + spm.centWeight = 1. / centW; + } else { + LOGF(fatal, "Centrality weight cannot be negative .. setting to 0. for (%.2f)", spm.centrality); + spm.centWeight = 0.; + } + } + + fillEventQA(collision, tracks); + + for (const auto& track : tracks) { + + ParticleType trackPID = (cfgFillPID || cfgFillPIDQA) ? getTrackPID(track) : kUnidentified; + + histos.fill(HIST("hPIDcounts"), trackPID, track.pt()); + + if (track.sign() == 0) + continue; + + histos.fill(HIST("hTrackCount"), trackSel_ZeroCharge); + + spm.charge = ((track.sign() > 0)) ? kPositive : kNegative; + + if (cfgFillQABefore) { + switch (trackPID) { + case kPions: + fillAllQA(track); + break; + case kKaons: + fillAllQA(track); + break; + case kProtons: + fillAllQA(track); + break; + default: /* do nothing */ + break; + } + } + + if (!trackSelected(track, field)) + continue; + + // constrain angle to 0 -> [0,0+2pi] + auto phi = RecoDecay::constrainAngle(track.phi(), 0); + + switch (trackPID) { + case kPions: + fillAllQA(track); + break; + case kKaons: + fillAllQA(track); + break; + case kProtons: + fillAllQA(track); + break; + default: /* do nothing */ + break; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + spm.ux = std::cos(cfgHarm * phi); + spm.uy = std::sin(cfgHarm * phi); + + spm.uxMH = std::cos(cfgHarmMixed * phi); + spm.uyMH = std::sin(cfgHarmMixed * phi); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + spm.vnA = std::cos(cfgHarm * (phi - spm.psiA)) / evPlaneRes; + spm.vnC = std::cos(cfgHarm * (phi - spm.psiC)) / evPlaneRes; + spm.vnFull = std::cos(cfgHarm * (phi - spm.psiFull)) / evPlaneRes; + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + fillHistograms(track); + + switch (trackPID) { + case kPions: + fillHistograms(track); + break; + case kKaons: + fillHistograms(track); + break; + case kProtons: + fillHistograms(track); + break; + default: /* do nothing */ + break; + } + + if (cfgFillChargeDependence) { + switch (spm.charge) { + case kPositive: { + switch (trackPID) { + case kPions: + fillHistograms(track); + break; + case kKaons: + fillHistograms(track); + break; + case kProtons: + fillHistograms(track); + break; + default: /* do nothing */ + break; + } + break; + } + case kNegative: { + switch (trackPID) { + case kPions: + fillHistograms(track); + break; + case kKaons: + fillHistograms(track); + break; + case kProtons: + fillHistograms(track); + break; + default: /* do nothing */ + break; + } + break; + } + } + } + } // end of track loop + } + + PROCESS_SWITCH(FlowSP, processDataPID, "Process analysis for non-derived data with PID", false); + void processMCReco(CC const& collision, aod::BCsWithTimestamps const&, TCs const& tracks, FilteredTCs const& filteredTracks, aod::McParticles const&) { auto bc = collision.template bc_as(); From 8b275f08e4e982d0479053608629d6da073f1a23 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sat, 28 Mar 2026 16:03:23 +0100 Subject: [PATCH 087/282] [PWGCF] FemtoUniverse: Add approx. fractionTPCsCls in closed-pairs (#15556) --- ...niversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index f5a4409a2e7..cec5e937084 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -96,6 +96,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable> confCPRdeltaEtaCutMaxVector{"confCPRdeltaEtaCutMaxVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta max cut for Close Pair Rejection"}; Configurable> confCPRdeltaEtaCutMinVector{"confCPRdeltaEtaCutMinVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta min cut for Close Pair Rejection"}; Configurable confIsCPRkT{"confIsCPRkT", true, "kT dependent deltaEta-deltaPhi cut for Close Pair Rejection"}; + Configurable confPairFracSharedTPCcls{"confPairFracSharedTPCcls", 1.0, "Max. fraction of TPC shared clusters between two closed tracks"}; Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; Configurable confUseCCImCut{"confUseCCImCut", false, "Fill SH within specific quadrants of qout-qside"}; Configurable confMinqTcut{"confMinqTcut", 0.005, "Min. qT cut on filling SH"}; @@ -542,6 +543,10 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (kT < firstRealElement || kT > lastElement) continue; + float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); + if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + continue; + } if (twotracksconfigs.confIsCPR.value) { if (twotracksconfigs.confCPRFracMax.value) { @@ -585,6 +590,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (kT < firstRealElement || kT > lastElement) continue; + float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); + if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + continue; + } + double rand; rand = randgen->Rndm(); From 7e219fc5f6b028755f2933060d5cc88dd901ed34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Sat, 28 Mar 2026 16:51:30 +0100 Subject: [PATCH 088/282] [PWGUD] Fix includes and using statements (#15390) --- PWGUD/AQC/FITtest.cxx | 22 ++++---- PWGUD/AQC/udQC.cxx | 41 ++++++++++---- PWGUD/AQC/udQCmidRap.cxx | 33 ++++++++---- PWGUD/AQC/udQcMuon.cxx | 35 +++++++++--- PWGUD/Core/DGCutparHolder.cxx | 2 +- PWGUD/Core/DGCutparHolder.h | 1 + PWGUD/Core/DGPIDSelector.cxx | 17 ++++-- PWGUD/Core/DGPIDSelector.h | 14 +++-- PWGUD/Core/DGSelector.h | 19 ++++--- PWGUD/Core/SGCutParHolder.cxx | 2 +- PWGUD/Core/SGCutParHolder.h | 1 + PWGUD/Core/SGSelector.h | 7 +-- PWGUD/Core/SGTrackSelector.h | 14 ++--- PWGUD/Core/UDFSParser.cxx | 11 ++-- PWGUD/Core/UDFSParser.h | 1 - PWGUD/Core/UDGoodRunSelector.cxx | 6 +-- PWGUD/Core/UDGoodRunSelector.h | 2 +- PWGUD/Core/UDHelpers.h | 22 +++++--- PWGUD/Core/UPCHelpers.h | 11 ++-- PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h | 10 +++- PWGUD/Core/UPCPairCuts.h | 11 ++-- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 9 ++-- PWGUD/Core/decayTree.cxx | 10 ++++ PWGUD/Core/decayTree.h | 16 +++--- PWGUD/DataModel/McPIDTable.h | 9 ++-- PWGUD/DataModel/SGTables.h | 10 ++-- PWGUD/DataModel/TauEventTables.h | 10 ++-- PWGUD/DataModel/TauThreeProngEventTables.h | 4 +- PWGUD/DataModel/TwoTracksEventTables.h | 4 +- PWGUD/DataModel/UDIndex.h | 6 ++- PWGUD/DataModel/UDTables.h | 9 ++-- .../UDCollisionSelExtrasConverter.cxx | 8 +-- .../UDCollisionSelExtrasV002Converter.cxx | 10 ++-- .../UDCollisionSelExtrasV003Converter.cxx | 9 ++-- .../Converters/UDCollisionsConverter.cxx | 8 +-- .../Converters/UDFwdTracksExtraConverter.cxx | 8 +-- PWGUD/TableProducer/DGBCCandProducer.cxx | 44 ++++++++++++--- PWGUD/TableProducer/DGBCCandProducer.h | 9 ++-- PWGUD/TableProducer/SGCandProducer.cxx | 40 ++++++++------ PWGUD/TableProducer/UPCCandidateProducer.cxx | 33 +++++++++--- PWGUD/TableProducer/dgCandProducer.cxx | 39 +++++++++++--- PWGUD/TableProducer/fwdTrackPropagation.cxx | 39 ++++++++------ PWGUD/TableProducer/tauEventTableProducer.cxx | 41 +++++++------- .../tauThreeProngEventTableProducer.cxx | 54 +++++++++---------- .../twoTracksEventTableProducer.cxx | 44 ++++++++------- .../udMcCollisions2udCollisions.cxx | 16 +++--- .../TableProducer/udMcParticles2udTracks.cxx | 16 +++--- .../upcCandProducerGlobalMuon.cxx | 51 ++++++++++++------ PWGUD/TableProducer/upcCandProducerMuon.cxx | 47 ++++++++++------ PWGUD/Tasks/FwdMuonsUPC.cxx | 34 +++++++----- PWGUD/Tasks/analysisMCDPMJetSGv3.cxx | 32 +++++++---- PWGUD/Tasks/decayTreeAnalyzer.cxx | 29 ++++++---- PWGUD/Tasks/dgCandAnalyzer.cxx | 31 ++++++++--- PWGUD/Tasks/diffMCDataScanner.cxx | 29 ++++++++-- PWGUD/Tasks/diffMCQA.cxx | 32 +++++++++-- PWGUD/Tasks/diffQA.cxx | 36 ++++++++++--- PWGUD/Tasks/eventByevent.cxx | 25 ++++++--- PWGUD/Tasks/exclusivePentaquark.cxx | 24 ++++++--- PWGUD/Tasks/exclusivePhi.cxx | 24 ++++++--- PWGUD/Tasks/exclusivePhiLeptons.cxx | 25 ++++++--- PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx | 25 ++++++--- PWGUD/Tasks/exclusiveRhoTo4Pi.cxx | 37 +++++++------ PWGUD/Tasks/exclusiveTwoProtons.cxx | 27 +++++++--- PWGUD/Tasks/exclusiveTwoProtonsSG.cxx | 27 +++++++--- PWGUD/Tasks/flowCorrelationsUpc.cxx | 39 +++++++------- PWGUD/Tasks/flowCumulantsUpc.cxx | 50 ++++++++++------- PWGUD/Tasks/polarisationRho.cxx | 23 ++++++-- PWGUD/Tasks/sgD0Analyzer.cxx | 20 ++++--- PWGUD/Tasks/sgExcUniverse.cxx | 18 ++++--- PWGUD/Tasks/sgExclOmega.cxx | 22 +++++--- PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx | 21 +++++--- PWGUD/Tasks/sgExclusivePhi.cxx | 26 ++++++--- PWGUD/Tasks/sgExclusivePhiITSselections.cxx | 23 +++++--- PWGUD/Tasks/sgFITAnalyzer.cxx | 27 +++++++--- PWGUD/Tasks/sgFourPiAnalyzer.cxx | 24 +++++---- PWGUD/Tasks/sgInclJpsi.cxx | 21 +++++--- PWGUD/Tasks/sgPIDAnalyzer.cxx | 17 +++--- PWGUD/Tasks/sgPIDSpectra.cxx | 18 ++++--- PWGUD/Tasks/sgPIDSpectraTable.cxx | 15 +++--- PWGUD/Tasks/sgSixPiAnalyzer.cxx | 24 ++++----- PWGUD/Tasks/sgSpectraAnalyzer.cxx | 25 ++++++--- PWGUD/Tasks/sgTwoPiAnalyzer.cxx | 25 ++++----- PWGUD/Tasks/sginclusivePhiKstarSD.cxx | 39 +++++++++----- PWGUD/Tasks/testMcStdTabsRl.cxx | 33 ++++++------ PWGUD/Tasks/upcAnalysis.cxx | 22 +++++--- PWGUD/Tasks/upcCandidateAnalyzer.cxx | 19 +++++-- PWGUD/Tasks/upcEventITSROFcounter.cxx | 37 ++++++++----- PWGUD/Tasks/upcForward.cxx | 26 ++++++--- PWGUD/Tasks/upcJpsiCorr.cxx | 34 +++++++----- PWGUD/Tasks/upcMft.cxx | 54 ++++++++++--------- PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx | 28 +++++----- PWGUD/Tasks/upcPionAnalysis.cxx | 35 ++++++++---- PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx | 32 ++++++----- PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx | 49 ++++++++--------- PWGUD/Tasks/upcRhoAnalysis.cxx | 34 +++++++++--- PWGUD/Tasks/upcRhoPrimeAnalysis.cxx | 29 ++++++---- PWGUD/Tasks/upcTauRl.cxx | 48 ++++++++--------- PWGUD/Tasks/upcTauTau13topo.cxx | 42 +++++++++------ PWGUD/Tasks/upcTestFITBitMapping.cxx | 14 +++-- PWGUD/Tasks/upcTestRctTables.cxx | 19 ++++--- PWGUD/Tasks/upcVetoAnalysis.cxx | 41 ++++++++++---- 101 files changed, 1550 insertions(+), 845 deletions(-) diff --git a/PWGUD/AQC/FITtest.cxx b/PWGUD/AQC/FITtest.cxx index 8cada664d74..e1f2ac5a19a 100644 --- a/PWGUD/AQC/FITtest.cxx +++ b/PWGUD/AQC/FITtest.cxx @@ -14,20 +14,24 @@ /// \since 04.08.2023 #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/BCRange.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQC.cxx b/PWGUD/AQC/udQC.cxx index 3da67d1f683..0edcdc28117 100644 --- a/PWGUD/AQC/udQC.cxx +++ b/PWGUD/AQC/udQC.cxx @@ -14,17 +14,38 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 04.05.2023 -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/DataModel/FT0Corrected.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" -#include "Framework/StaticFor.h" -#include "TLorentzVector.h" -#include "TMath.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQCmidRap.cxx b/PWGUD/AQC/udQCmidRap.cxx index acb35f21f57..6a2ea533d4c 100644 --- a/PWGUD/AQC/udQCmidRap.cxx +++ b/PWGUD/AQC/udQCmidRap.cxx @@ -14,16 +14,31 @@ /// \author Paul Buehler /// \since 17.01.2023 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/DataModel/FT0Corrected.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" -#include "Framework/StaticFor.h" -#include "TLorentzVector.h" -#include "TMath.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQcMuon.cxx b/PWGUD/AQC/udQcMuon.cxx index eaa5f59bc8b..9f09ee2d2c9 100644 --- a/PWGUD/AQC/udQcMuon.cxx +++ b/PWGUD/AQC/udQcMuon.cxx @@ -16,18 +16,37 @@ /// \author Sara Haidlova, sara.haidlova@cern.ch /// \since 28.09.2025 +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/FT0Corrected.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/BCRange.h" - +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include #include using namespace o2; diff --git a/PWGUD/Core/DGCutparHolder.cxx b/PWGUD/Core/DGCutparHolder.cxx index 5775a7dd47e..ee003684f5a 100644 --- a/PWGUD/Core/DGCutparHolder.cxx +++ b/PWGUD/Core/DGCutparHolder.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "DGCutparHolder.h" +#include "PWGUD/Core/DGCutparHolder.h" #include diff --git a/PWGUD/Core/DGCutparHolder.h b/PWGUD/Core/DGCutparHolder.h index 8312d72ac32..a67aefc4080 100644 --- a/PWGUD/Core/DGCutparHolder.h +++ b/PWGUD/Core/DGCutparHolder.h @@ -13,6 +13,7 @@ #define PWGUD_CORE_DGCUTPARHOLDER_H_ #include + #include // object to hold customizable cut values diff --git a/PWGUD/Core/DGPIDSelector.cxx b/PWGUD/Core/DGPIDSelector.cxx index 04dab87ef7a..7e0de287e48 100644 --- a/PWGUD/Core/DGPIDSelector.cxx +++ b/PWGUD/Core/DGPIDSelector.cxx @@ -8,11 +8,22 @@ // 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 -#include "CommonConstants/PhysicsConstants.h" #include "DGPIDSelector.h" +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + // ----------------------------------------------------------------------------- float particleMass(TDatabasePDG* pdg, int pid) { diff --git a/PWGUD/Core/DGPIDSelector.h b/PWGUD/Core/DGPIDSelector.h index 74ad6b54a58..de825ab3568 100644 --- a/PWGUD/Core/DGPIDSelector.h +++ b/PWGUD/Core/DGPIDSelector.h @@ -12,12 +12,16 @@ #ifndef PWGUD_CORE_DGPIDSELECTOR_H_ #define PWGUD_CORE_DGPIDSELECTOR_H_ -#include -#include +#include + +#include +#include #include -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "Framework/Logger.h" + +#include +#include +#include +#include const int numDGPIDCutParameters = 9; float particleMass(TDatabasePDG* pdg, int pid); diff --git a/PWGUD/Core/DGSelector.h b/PWGUD/Core/DGSelector.h index c9349da9247..5c9afa99d00 100644 --- a/PWGUD/Core/DGSelector.h +++ b/PWGUD/Core/DGSelector.h @@ -12,14 +12,19 @@ #ifndef PWGUD_CORE_DGSELECTOR_H_ #define PWGUD_CORE_DGSELECTOR_H_ -#include - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "Framework/Logger.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/DGCutparHolder.h" +#include "PWGUD/Core/UDHelpers.h" + +#include + +#include +#include +#include + +#include + +#include +#include // ----------------------------------------------------------------------------- // add here Selectors for different types of diffractive events diff --git a/PWGUD/Core/SGCutParHolder.cxx b/PWGUD/Core/SGCutParHolder.cxx index d171bd45a61..ba180a97280 100644 --- a/PWGUD/Core/SGCutParHolder.cxx +++ b/PWGUD/Core/SGCutParHolder.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "SGCutParHolder.h" +#include "PWGUD/Core/SGCutParHolder.h" #include diff --git a/PWGUD/Core/SGCutParHolder.h b/PWGUD/Core/SGCutParHolder.h index 753e9f0c96f..fcee2d79703 100644 --- a/PWGUD/Core/SGCutParHolder.h +++ b/PWGUD/Core/SGCutParHolder.h @@ -13,6 +13,7 @@ #define PWGUD_CORE_SGCUTPARHOLDER_H_ #include + #include // object to hold customizable cut values diff --git a/PWGUD/Core/SGSelector.h b/PWGUD/Core/SGSelector.h index 881cfb603bb..4e2cef35a85 100644 --- a/PWGUD/Core/SGSelector.h +++ b/PWGUD/Core/SGSelector.h @@ -24,16 +24,17 @@ #include "Common/CCDB/RCTSelectionFlags.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" +#include +#include #include +#include #include #include template struct SelectionResult { - int value; // The original integer return value + int value; // The original integer return value std::shared_ptr bc; // Pointer to the BC object }; diff --git a/PWGUD/Core/SGTrackSelector.h b/PWGUD/Core/SGTrackSelector.h index 455eaf24ac1..b571faf07f7 100644 --- a/PWGUD/Core/SGTrackSelector.h +++ b/PWGUD/Core/SGTrackSelector.h @@ -16,18 +16,10 @@ #ifndef PWGUD_CORE_SGTRACKSELECTOR_H_ #define PWGUD_CORE_SGTRACKSELECTOR_H_ -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/UDTables.h" +#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "TVector3.h" -#include - -#include +#include +#include #include template diff --git a/PWGUD/Core/UDFSParser.cxx b/PWGUD/Core/UDFSParser.cxx index 08c6b947ab2..961412106c8 100644 --- a/PWGUD/Core/UDFSParser.cxx +++ b/PWGUD/Core/UDFSParser.cxx @@ -11,13 +11,18 @@ #include "UDFSParser.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonDataFormat/BunchFilling.h" -#include "Framework/Logger.h" +#include +#include +#include +#include +#include +#include #include #include +#include + // ----------------------------------------------------------------------------- UDFSParser::UDFSParser(const char* filename) { diff --git a/PWGUD/Core/UDFSParser.h b/PWGUD/Core/UDFSParser.h index 6ceddafa5df..a48fb9f8a4f 100644 --- a/PWGUD/Core/UDFSParser.h +++ b/PWGUD/Core/UDFSParser.h @@ -12,7 +12,6 @@ #ifndef PWGUD_CORE_UDFSPARSER_H_ #define PWGUD_CORE_UDFSPARSER_H_ -// #include #include #include diff --git a/PWGUD/Core/UDGoodRunSelector.cxx b/PWGUD/Core/UDGoodRunSelector.cxx index c9c7d317ec7..c8203a7a569 100644 --- a/PWGUD/Core/UDGoodRunSelector.cxx +++ b/PWGUD/Core/UDGoodRunSelector.cxx @@ -11,10 +11,10 @@ #include "PWGUD/Core/UDGoodRunSelector.h" -#include "Framework/Logger.h" +#include -#include "rapidjson/document.h" -#include "rapidjson/filereadstream.h" +#include +#include #include #include diff --git a/PWGUD/Core/UDGoodRunSelector.h b/PWGUD/Core/UDGoodRunSelector.h index 4cf49330698..1b73f2c3ac4 100644 --- a/PWGUD/Core/UDGoodRunSelector.h +++ b/PWGUD/Core/UDGoodRunSelector.h @@ -12,8 +12,8 @@ #ifndef PWGUD_CORE_UDGOODRUNSELECTOR_H_ #define PWGUD_CORE_UDGOODRUNSELECTOR_H_ -#include #include +#include #include // A class to select good runs diff --git a/PWGUD/Core/UDHelpers.h b/PWGUD/Core/UDHelpers.h index 73a3efcd775..94d356501a7 100644 --- a/PWGUD/Core/UDHelpers.h +++ b/PWGUD/Core/UDHelpers.h @@ -19,19 +19,25 @@ #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsFT0/Digit.h" -#include "Framework/Logger.h" +#include +#include +#include +#include +#include -#include "TLorentzVector.h" +#include + +#include #include -#include +#include +#include +#include +#include +#include #include // namespace with helpers for UD framework diff --git a/PWGUD/Core/UPCHelpers.h b/PWGUD/Core/UPCHelpers.h index 9dfa5fe3776..8495f9c5adc 100644 --- a/PWGUD/Core/UPCHelpers.h +++ b/PWGUD/Core/UPCHelpers.h @@ -14,13 +14,14 @@ #include "UPCCutparHolder.h" -#include "PWGUD/DataModel/UDTables.h" - -#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include -#include "CommonConstants/LHCConstants.h" -#include "Framework/AnalysisDataModel.h" +#include using BCsWithBcSels = o2::soa::Join; diff --git a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h index 2a53f2f41f8..83a3eed9053 100644 --- a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h +++ b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h @@ -16,9 +16,17 @@ #ifndef PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ #define PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ -#include "CommonConstants/MathConstants.h" +#include + +#include + +#include #include +#include +#include +#include +#include #include #include diff --git a/PWGUD/Core/UPCPairCuts.h b/PWGUD/Core/UPCPairCuts.h index f53b419ffda..817e4a86cfd 100644 --- a/PWGUD/Core/UPCPairCuts.h +++ b/PWGUD/Core/UPCPairCuts.h @@ -18,10 +18,13 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" +#include +#include +#include +#include +#include + +#include #include diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index 41af7ec5d78..ea4652b9b77 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -18,11 +18,14 @@ #ifndef PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ #define PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +#include #include +#include +#include #include enum MyParticle { diff --git a/PWGUD/Core/decayTree.cxx b/PWGUD/Core/decayTree.cxx index ed05772364e..ded7c2fa329 100644 --- a/PWGUD/Core/decayTree.cxx +++ b/PWGUD/Core/decayTree.cxx @@ -11,10 +11,20 @@ #include "decayTree.h" +#include +#include + +#include + #include #include +#include +#include +#include #include +#include +#include #include #include #include diff --git a/PWGUD/Core/decayTree.h b/PWGUD/Core/decayTree.h index 59421098605..162a1859181 100644 --- a/PWGUD/Core/decayTree.h +++ b/PWGUD/Core/decayTree.h @@ -12,15 +12,19 @@ #ifndef PWGUD_CORE_DECAYTREE_H_ #define PWGUD_CORE_DECAYTREE_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include -#include "TDatabasePDG.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGUD/DataModel/McPIDTable.h b/PWGUD/DataModel/McPIDTable.h index 3e2bf256db9..7f9cf4ea875 100644 --- a/PWGUD/DataModel/McPIDTable.h +++ b/PWGUD/DataModel/McPIDTable.h @@ -8,10 +8,11 @@ // 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. -#ifndef O2_ANALYSIS_UDDIFFMCSCAN_H -#define O2_ANALYSIS_UDDIFFMCSCAN_H -#include "Framework/AnalysisDataModel.h" +#ifndef PWGUD_DATAMODEL_MCPIDTABLE_H_ +#define PWGUD_DATAMODEL_MCPIDTABLE_H_ + +#include namespace o2::aod { @@ -33,4 +34,4 @@ DECLARE_SOA_TABLE(UDnSigmas, "AOD", "UDNSIGMAS", //! MCTruth of particle PID and } // namespace o2::aod -#endif // O2_ANALYSIS_UDDIFFMCSCAN_H +#endif // PWGUD_DATAMODEL_MCPIDTABLE_H_ diff --git a/PWGUD/DataModel/SGTables.h b/PWGUD/DataModel/SGTables.h index ddca7abf0fd..4e959cf886f 100644 --- a/PWGUD/DataModel/SGTables.h +++ b/PWGUD/DataModel/SGTables.h @@ -12,15 +12,11 @@ #ifndef PWGUD_DATAMODEL_SGTABLES_H_ #define PWGUD_DATAMODEL_SGTABLES_H_ -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/DataTypes.h" -#include "MathUtils/Utils.h" +#include +#include #include -#include +#include namespace o2::aod { diff --git a/PWGUD/DataModel/TauEventTables.h b/PWGUD/DataModel/TauEventTables.h index f508cbc2c4d..ae0fd33496e 100644 --- a/PWGUD/DataModel/TauEventTables.h +++ b/PWGUD/DataModel/TauEventTables.h @@ -16,10 +16,12 @@ /// \brief A table to store information about events preselected to be candidates for UPC gammagamma->tautau /// -#ifndef ALISW_TAUEVENTTABLES_H -#define ALISW_TAUEVENTTABLES_H +#ifndef PWGUD_DATAMODEL_TAUEVENTTABLES_H_ +#define PWGUD_DATAMODEL_TAUEVENTTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { @@ -221,4 +223,4 @@ DECLARE_SOA_TABLE(TrueTauTwoTracks, "AOD", "TRUETAUTWOTRACK", } // namespace o2::aod -#endif // ALISW_TAUEVENTTABLES_H +#endif // PWGUD_DATAMODEL_TAUEVENTTABLES_H_ diff --git a/PWGUD/DataModel/TauThreeProngEventTables.h b/PWGUD/DataModel/TauThreeProngEventTables.h index 61cc184cbdb..bd7da95f14c 100644 --- a/PWGUD/DataModel/TauThreeProngEventTables.h +++ b/PWGUD/DataModel/TauThreeProngEventTables.h @@ -19,7 +19,9 @@ #ifndef PWGUD_DATAMODEL_TAUTHREEPRONGEVENTTABLES_H_ #define PWGUD_DATAMODEL_TAUTHREEPRONGEVENTTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include // derived tables for tautau->4 (=1+3) tracks namespace o2::aod { diff --git a/PWGUD/DataModel/TwoTracksEventTables.h b/PWGUD/DataModel/TwoTracksEventTables.h index 5eb2640f431..0f50fe2f493 100644 --- a/PWGUD/DataModel/TwoTracksEventTables.h +++ b/PWGUD/DataModel/TwoTracksEventTables.h @@ -21,7 +21,9 @@ #ifndef PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_ #define PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/PWGUD/DataModel/UDIndex.h b/PWGUD/DataModel/UDIndex.h index 8a4a236c5af..16a7ed3a5ed 100644 --- a/PWGUD/DataModel/UDIndex.h +++ b/PWGUD/DataModel/UDIndex.h @@ -19,9 +19,10 @@ #ifndef PWGUD_DATAMODEL_UDINDEX_H_ #define PWGUD_DATAMODEL_UDINDEX_H_ -#include "UDTables.h" +#include "PWGUD/DataModel/UDTables.h" // IWYU pragma: keep + +#include -#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace udidx @@ -32,4 +33,5 @@ DECLARE_SOA_ARRAY_INDEX_COLUMN(UDCollision, udcollisions); DECLARE_SOA_TABLE(UDMcParticlesToUDTracks, "AOD", "UDP2UDT", udidx::UDTrackIds); DECLARE_SOA_TABLE(UDMcCollisionsToUDCollisions, "AOD", "UDMCC2UDC", udidx::UDCollisionIds); } // namespace o2::aod + #endif // PWGUD_DATAMODEL_UDINDEX_H_ diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index 774bb31751a..afb7728a5ab 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -25,12 +25,13 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/DataTypes.h" -#include "MathUtils/Utils.h" +#include +#include + +#include #include +#include #include namespace o2::aod diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx index 1fa1882e7d5..38ecb5abeb3 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx @@ -20,11 +20,13 @@ /// \author Sasha Bylinkin -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx index b10b467ec4d..d2b4d6408b4 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx @@ -13,11 +13,15 @@ /// \brief Converts UDCollisionSelExtras table from version 000 to 002 and 001 to 002 /// \author Roman Lavicka -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx index a41b2c4efa6..e52b6fce784 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx @@ -15,9 +15,12 @@ #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx index 8be7bce717b..99de6088fb4 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx @@ -20,11 +20,13 @@ /// \author Sasha Bylinkin -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx index f9b1f2d0d22..4806232f490 100644 --- a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx @@ -21,11 +21,13 @@ /// \author Andrea Giovanni Riffero -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/DGBCCandProducer.cxx b/PWGUD/TableProducer/DGBCCandProducer.cxx index 97b60c42c9e..eb272397af3 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.cxx +++ b/PWGUD/TableProducer/DGBCCandProducer.cxx @@ -14,15 +14,45 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 30.09.2022 -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/Vertex.h" -#include "PWGUD/DataModel/UDTables.h" +#include "DGBCCandProducer.h" + +#include "PWGUD/Core/DGCutparHolder.h" +#include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" -#include "PWGUD/Core/DGSelector.h" -#include "DGBCCandProducer.h" +#include "PWGUD/DataModel/UDTables.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/DGBCCandProducer.h b/PWGUD/TableProducer/DGBCCandProducer.h index 5bdc09498c6..64d30453dbf 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.h +++ b/PWGUD/TableProducer/DGBCCandProducer.h @@ -16,13 +16,10 @@ #ifndef PWGUD_TABLEPRODUCER_DGBCCANDPRODUCER_H_ #define PWGUD_TABLEPRODUCER_DGBCCANDPRODUCER_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/DataTypes.h" -#include "MathUtils/Utils.h" +#include +#include -#include -#include +#include namespace o2::aod { diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index b2702b54546..a45493d792e 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -19,32 +19,42 @@ // #include "PWGUD/Core/FITCutParHolder.h" +#include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include +#include #include +#include #include #include diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index 2208060bd59..ac0058c11dd 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -18,17 +18,36 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" - -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include +#include +#include +#include #include #include +#include #include #include #include diff --git a/PWGUD/TableProducer/dgCandProducer.cxx b/PWGUD/TableProducer/dgCandProducer.cxx index d47093843fb..6c075229fb1 100644 --- a/PWGUD/TableProducer/dgCandProducer.cxx +++ b/PWGUD/TableProducer/dgCandProducer.cxx @@ -12,21 +12,46 @@ // \brief Saves relevant information of DG candidates // \author Paul Buehler, paul.buehler@oeaw.ac.at +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" - +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include #include +#include #include #include diff --git a/PWGUD/TableProducer/fwdTrackPropagation.cxx b/PWGUD/TableProducer/fwdTrackPropagation.cxx index 64099fac4ed..655e78535a1 100644 --- a/PWGUD/TableProducer/fwdTrackPropagation.cxx +++ b/PWGUD/TableProducer/fwdTrackPropagation.cxx @@ -17,21 +17,30 @@ #include "PWGUD/DataModel/UDTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include #include #include #include diff --git a/PWGUD/TableProducer/tauEventTableProducer.cxx b/PWGUD/TableProducer/tauEventTableProducer.cxx index ec08a426f35..d91c5dffe8d 100644 --- a/PWGUD/TableProducer/tauEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauEventTableProducer.cxx @@ -16,32 +16,29 @@ /// \since 09.04.2025 // -// C++ headers -#include -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/TauEventTables.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -52,7 +49,7 @@ struct TauEventTableProducer { Produces tauTwoTracks; Produces trueTauTwoTracks; - // Global varialbes + // Global variables Service pdg; SGSelector sgSelector; diff --git a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx index 1900e1a1232..87878b7b364 100644 --- a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx @@ -23,40 +23,38 @@ // oopts="--aod-writer-json saveDerivedConfigData.json" // o2-analysis-ud-tau-three-prong-event-table-producer $copts $oopts > output.log -//// C++ headers -#include "Math/Vector4D.h" - -#include -#include -#include -#include -#include -// -//// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -// #include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -// -//// O2Physics headers -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -// #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include "PWGUD/Core/DGPIDSelector.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/TauThreeProngEventTables.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -#include "TPDGCode.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx index 3af6a964021..36c5c44112f 100644 --- a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx +++ b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx @@ -16,35 +16,33 @@ /// \since 20.06.2025 // -// C++ headers -#include -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/TwoTracksEventTables.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include -// ROOT -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx b/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx index cea35fb70ea..f97fe33a3f3 100644 --- a/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx +++ b/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx @@ -16,13 +16,17 @@ /// \brief A task to create a reverse index from UDMcCollisions to UDCollisions /// -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/DataModel/UDIndex.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/udMcParticles2udTracks.cxx b/PWGUD/TableProducer/udMcParticles2udTracks.cxx index 4a876a72fb3..e4f18bc20d9 100644 --- a/PWGUD/TableProducer/udMcParticles2udTracks.cxx +++ b/PWGUD/TableProducer/udMcParticles2udTracks.cxx @@ -16,13 +16,17 @@ /// \brief A task to create a reverse index from UDMcParticles to UDTracks /// -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/DataModel/UDIndex.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index c97704fe2ce..76c0a8b3e05 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -16,27 +16,44 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" +#include "PWGUD/DataModel/UDTables.h" #include "Common/Core/fwdtrackUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/GeomConstants.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include +#include #include #include diff --git a/PWGUD/TableProducer/upcCandProducerMuon.cxx b/PWGUD/TableProducer/upcCandProducerMuon.cxx index 329a83b432c..0ac8458d60f 100644 --- a/PWGUD/TableProducer/upcCandProducerMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerMuon.cxx @@ -16,24 +16,37 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" - -#include +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include #include +#include #include #include diff --git a/PWGUD/Tasks/FwdMuonsUPC.cxx b/PWGUD/Tasks/FwdMuonsUPC.cxx index 0c4b3d81e3b..b3351965727 100644 --- a/PWGUD/Tasks/FwdMuonsUPC.cxx +++ b/PWGUD/Tasks/FwdMuonsUPC.cxx @@ -16,22 +16,28 @@ /// \author Andrea Giovanni Riffero -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" #include "PWGUD/DataModel/UDTables.h" -#include "TLorentzVector.h" -#include "TSystem.h" -#include "TMath.h" -#include "TRandom3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include // table for saving tree with info on data namespace dimu diff --git a/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx b/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx index 4347871377a..26d8c91c0e0 100644 --- a/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx +++ b/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx @@ -13,18 +13,28 @@ /// /// \author Simone Ragoni -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -// #include "TDatabasePDG.h" -#include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" -// #include "TLorentzVector.h" -// #include "TVector3.h" -#include "Math/LorentzVector.h" // ROOT::Math::LorentzVector -#include "Math/PxPyPzM4D.h" // ROOT::Math::PxPyPzM4D -#include "TMath.h" + +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/decayTreeAnalyzer.cxx b/PWGUD/Tasks/decayTreeAnalyzer.cxx index c725a2ca72a..5a46ed7c8cb 100644 --- a/PWGUD/Tasks/decayTreeAnalyzer.cxx +++ b/PWGUD/Tasks/decayTreeAnalyzer.cxx @@ -13,18 +13,27 @@ // \author Paul Buehler, paul.buehler@oeaw.ac.at // \since 01.03.2024 -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "CommonConstants/LHCConstants.h" -#include "PWGUD/DataModel/UDTables.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UDGoodRunSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/decayTree.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/dgCandAnalyzer.cxx b/PWGUD/Tasks/dgCandAnalyzer.cxx index d7283115434..79b5b6c5f02 100644 --- a/PWGUD/Tasks/dgCandAnalyzer.cxx +++ b/PWGUD/Tasks/dgCandAnalyzer.cxx @@ -18,12 +18,31 @@ #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/diffMCDataScanner.cxx b/PWGUD/Tasks/diffMCDataScanner.cxx index 8ad8d7ae853..06fa70f5220 100644 --- a/PWGUD/Tasks/diffMCDataScanner.cxx +++ b/PWGUD/Tasks/diffMCDataScanner.cxx @@ -13,9 +13,32 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 01.10.2021 -#include "Framework/AnalysisTask.h" -#include "PWGUD/DataModel/McPIDTable.h" #include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/DataModel/McPIDTable.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; @@ -25,7 +48,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(ConfigParamSpec{"runCase", VariantType::Int, 0, {"runCase: 0 - histos, 1 - mcTruth, 2 - mc only, else - tree"}}); } -#include "Framework/runDataProcessing.h" +#include using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/diffMCQA.cxx b/PWGUD/Tasks/diffMCQA.cxx index 19bf3016a97..c6b1f650db2 100644 --- a/PWGUD/Tasks/diffMCQA.cxx +++ b/PWGUD/Tasks/diffMCQA.cxx @@ -13,13 +13,35 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 01.10.2021 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "TLorentzVector.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/diffQA.cxx b/PWGUD/Tasks/diffQA.cxx index a1e9ec34185..59bdd9a67eb 100644 --- a/PWGUD/Tasks/diffQA.cxx +++ b/PWGUD/Tasks/diffQA.cxx @@ -13,14 +13,38 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 20.05.2022 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "TLorentzVector.h" -#include "CommonConstants/LHCConstants.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/eventByevent.cxx b/PWGUD/Tasks/eventByevent.cxx index 072ae2d961c..913319bd785 100644 --- a/PWGUD/Tasks/eventByevent.cxx +++ b/PWGUD/Tasks/eventByevent.cxx @@ -10,16 +10,27 @@ // or submit itself to any jurisdiction. // -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include -#include "TLorentzVector.h" -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" + +#include +#include using namespace std; using namespace o2; diff --git a/PWGUD/Tasks/exclusivePentaquark.cxx b/PWGUD/Tasks/exclusivePentaquark.cxx index eb5170bb400..8f21b5f333f 100644 --- a/PWGUD/Tasks/exclusivePentaquark.cxx +++ b/PWGUD/Tasks/exclusivePentaquark.cxx @@ -11,15 +11,25 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include -using std::array; +#include +#include +#include + using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhi.cxx b/PWGUD/Tasks/exclusivePhi.cxx index c0850b4b84d..499f8e1046f 100644 --- a/PWGUD/Tasks/exclusivePhi.cxx +++ b/PWGUD/Tasks/exclusivePhi.cxx @@ -11,17 +11,27 @@ // #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include -#include +#include +#include #include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhiLeptons.cxx b/PWGUD/Tasks/exclusivePhiLeptons.cxx index cb2d8834862..ae4e80c31ed 100644 --- a/PWGUD/Tasks/exclusivePhiLeptons.cxx +++ b/PWGUD/Tasks/exclusivePhiLeptons.cxx @@ -11,16 +11,27 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include -#include +#include +#include +#include #include -using std::array; + using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx b/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx index ecc65174f26..577f25e63c6 100644 --- a/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx +++ b/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx @@ -8,19 +8,30 @@ // 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 "PWGUD/Core/SGSelector.h" + #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" +#include +#include +#include #include -#include +#include +#include +#include #include -using std::array; + using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx index 8cefae2262c..c295a40df6e 100644 --- a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx +++ b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx @@ -14,26 +14,33 @@ /// \author Anantha Padmanabhan M Nair #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TPDGCode.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include #include #include +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/exclusiveTwoProtons.cxx b/PWGUD/Tasks/exclusiveTwoProtons.cxx index d22c92cccbc..bc3c4783aba 100644 --- a/PWGUD/Tasks/exclusiveTwoProtons.cxx +++ b/PWGUD/Tasks/exclusiveTwoProtons.cxx @@ -11,15 +11,28 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include + +#include +#include +#include -#include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx b/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx index 521096634e9..7d8e3ed9326 100644 --- a/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx +++ b/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx @@ -11,15 +11,28 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include + +#include +#include +#include -#include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index b1b70fb5db9..061eda25566 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -15,30 +15,30 @@ /// copied from Thor Jensen (thor.kjaersgaard.jensen@cern.ch) and Debojit Sarkar (debojit.sarkar@cern.ch) #include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" -#include "PWGCF/DataModel/CorrelationsDerived.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/SGTables.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" - -#include "TRandom3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include namespace o2::aod @@ -56,6 +56,7 @@ DECLARE_SOA_TABLE(Truegapside, "AOD", "TRUEGAPSIDE", flowcorrupc::Truegapside); using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::constants::math; // define the filtered collisions and tracks #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index 98006bbde6a..ad75ae1a3c3 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -14,41 +14,51 @@ /// \since Mar/2025 /// \brief jira: , task to measure flow observables with cumulant method -#include "FlowContainer.h" -#include "GFW.h" -#include "GFWCumulant.h" -#include "GFWPowerArray.h" -#include "GFWWeights.h" - #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/SGTables.h" #include "PWGUD/DataModel/UDTables.h" +// +#include "PWGCF/GenericFramework/Core/FlowContainer.h" +#include "PWGCF/GenericFramework/Core/GFW.h" +#include "PWGCF/GenericFramework/Core/GFWWeights.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include -#include "TList.h" -#include "TVector3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include +#include +#include +#include #include #include #include +#include + +#include + +#include #include +#include #include +#include #include #include #include diff --git a/PWGUD/Tasks/polarisationRho.cxx b/PWGUD/Tasks/polarisationRho.cxx index c10e86baad6..386bd5de510 100644 --- a/PWGUD/Tasks/polarisationRho.cxx +++ b/PWGUD/Tasks/polarisationRho.cxx @@ -8,13 +8,26 @@ // 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 "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include #include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include "TLorentzVector.h" +#include + +#include + +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgD0Analyzer.cxx b/PWGUD/Tasks/sgD0Analyzer.cxx index 7e4c2019434..149683c1c40 100644 --- a/PWGUD/Tasks/sgD0Analyzer.cxx +++ b/PWGUD/Tasks/sgD0Analyzer.cxx @@ -17,15 +17,21 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" -#include +#include -#include +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgExcUniverse.cxx b/PWGUD/Tasks/sgExcUniverse.cxx index 6178d4cb0b0..a02a30b621d 100644 --- a/PWGUD/Tasks/sgExcUniverse.cxx +++ b/PWGUD/Tasks/sgExcUniverse.cxx @@ -15,15 +15,21 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgExclOmega.cxx b/PWGUD/Tasks/sgExclOmega.cxx index 858b0499caa..cb8c298ce0f 100644 --- a/PWGUD/Tasks/sgExclOmega.cxx +++ b/PWGUD/Tasks/sgExclOmega.cxx @@ -17,20 +17,28 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" -#include +#include + +#include +#include -#include using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + struct SGExclOmega { SGSelector sgSelector; Service pdg; diff --git a/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx b/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx index b0b2058a27d..73d2d5884a5 100644 --- a/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx +++ b/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx @@ -17,12 +17,21 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TMath.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/sgExclusivePhi.cxx b/PWGUD/Tasks/sgExclusivePhi.cxx index c4bed3d1456..a68d9ba8cdb 100644 --- a/PWGUD/Tasks/sgExclusivePhi.cxx +++ b/PWGUD/Tasks/sgExclusivePhi.cxx @@ -12,17 +12,29 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include -#include +#include +#include +#include #include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgExclusivePhiITSselections.cxx b/PWGUD/Tasks/sgExclusivePhiITSselections.cxx index 1e3fe149e59..d3d8a580b4b 100644 --- a/PWGUD/Tasks/sgExclusivePhiITSselections.cxx +++ b/PWGUD/Tasks/sgExclusivePhiITSselections.cxx @@ -12,17 +12,26 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include +#include +#include +#include #include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgFITAnalyzer.cxx b/PWGUD/Tasks/sgFITAnalyzer.cxx index 60464ed6cf4..f3369b3a7cb 100644 --- a/PWGUD/Tasks/sgFITAnalyzer.cxx +++ b/PWGUD/Tasks/sgFITAnalyzer.cxx @@ -15,18 +15,29 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/PIDResponseTOF.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgFourPiAnalyzer.cxx b/PWGUD/Tasks/sgFourPiAnalyzer.cxx index 13979d87c38..ef6f1b17a0b 100644 --- a/PWGUD/Tasks/sgFourPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgFourPiAnalyzer.cxx @@ -17,25 +17,27 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" +#include +#include -#include "TLorentzVector.h" -#include +#include -#include using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + struct SGFourPiAnalyzer { SGSelector sgSelector; Service pdg; diff --git a/PWGUD/Tasks/sgInclJpsi.cxx b/PWGUD/Tasks/sgInclJpsi.cxx index eba36e3845c..4ead557224a 100644 --- a/PWGUD/Tasks/sgInclJpsi.cxx +++ b/PWGUD/Tasks/sgInclJpsi.cxx @@ -17,20 +17,27 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" -#include +#include + +#include -#include using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + struct SGInclJpsi { SGSelector sgSelector; Service pdg; diff --git a/PWGUD/Tasks/sgPIDAnalyzer.cxx b/PWGUD/Tasks/sgPIDAnalyzer.cxx index c3038cee058..f68d3b0ddf9 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -13,19 +13,16 @@ // \author Sasha Bylinkin, alexander.bylinkin@gmail.com // \since April 2023 -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/SGTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" -#include -#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgPIDSpectra.cxx b/PWGUD/Tasks/sgPIDSpectra.cxx index 2792dee4be2..706c34a1150 100644 --- a/PWGUD/Tasks/sgPIDSpectra.cxx +++ b/PWGUD/Tasks/sgPIDSpectra.cxx @@ -15,15 +15,21 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgPIDSpectraTable.cxx b/PWGUD/Tasks/sgPIDSpectraTable.cxx index bd781969afc..75b81336c3d 100644 --- a/PWGUD/Tasks/sgPIDSpectraTable.cxx +++ b/PWGUD/Tasks/sgPIDSpectraTable.cxx @@ -12,18 +12,21 @@ // \Single Gap Event Analyzer // \author Sasha Bylinkin, alexander.bylinkin@gmail.com // \since April 2023 + #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/SGTables.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include #include diff --git a/PWGUD/Tasks/sgSixPiAnalyzer.cxx b/PWGUD/Tasks/sgSixPiAnalyzer.cxx index 1a3ed6604e2..ff288249dc2 100644 --- a/PWGUD/Tasks/sgSixPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgSixPiAnalyzer.cxx @@ -17,20 +17,20 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" +#include +#include -#include "TLorentzVector.h" -#include - -#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgSpectraAnalyzer.cxx b/PWGUD/Tasks/sgSpectraAnalyzer.cxx index 1d73df42642..b17c699970f 100644 --- a/PWGUD/Tasks/sgSpectraAnalyzer.cxx +++ b/PWGUD/Tasks/sgSpectraAnalyzer.cxx @@ -17,20 +17,31 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -// #include "PWGUD/Core/RLhelper.h" -#include "TLorentzVector.h" -#include +#include +#include + using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + namespace excl_fs { DECLARE_SOA_COLUMN(GS, gs, int); diff --git a/PWGUD/Tasks/sgTwoPiAnalyzer.cxx b/PWGUD/Tasks/sgTwoPiAnalyzer.cxx index 7a2c8aefc3c..77c6e4f2d94 100644 --- a/PWGUD/Tasks/sgTwoPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgTwoPiAnalyzer.cxx @@ -17,20 +17,21 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" +#include +#include -#include "TLorentzVector.h" -#include - -#include +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index ea7c42308a2..a67bd2bd325 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -16,24 +16,35 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TPDGCode.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGUD/Tasks/testMcStdTabsRl.cxx b/PWGUD/Tasks/testMcStdTabsRl.cxx index 9748b28784f..7651b5e5c2a 100644 --- a/PWGUD/Tasks/testMcStdTabsRl.cxx +++ b/PWGUD/Tasks/testMcStdTabsRl.cxx @@ -16,24 +16,25 @@ /// \since 12.02.2025 // -// C++ headers -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -// ROOT headers -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcAnalysis.cxx b/PWGUD/Tasks/upcAnalysis.cxx index 74a007314e0..f6dc8ba1323 100644 --- a/PWGUD/Tasks/upcAnalysis.cxx +++ b/PWGUD/Tasks/upcAnalysis.cxx @@ -9,16 +9,22 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include + +#include +#include +#include -#include -#include -#include "TLorentzVector.h" +#include +#include using namespace o2; using namespace o2::aod::evsel; diff --git a/PWGUD/Tasks/upcCandidateAnalyzer.cxx b/PWGUD/Tasks/upcCandidateAnalyzer.cxx index 568ecacb872..dcf23797803 100644 --- a/PWGUD/Tasks/upcCandidateAnalyzer.cxx +++ b/PWGUD/Tasks/upcCandidateAnalyzer.cxx @@ -9,12 +9,23 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 51241be5d69..c33c17ecfe4 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -15,23 +15,32 @@ /// \author Roman Lavicka , Austrian Academy of Sciences & SMI /// \since 09.08.2024 -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "ITSMFTBase/DPLAlpideParam.h" -#include "CCDB/BasicCCDBManager.h" -#include "ReconstructionDataFormats/Vertex.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" -#include "PWGUD/DataModel/UDTables.h" -#include "PWGUD/Core/SGSelector.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcForward.cxx b/PWGUD/Tasks/upcForward.cxx index bebcf0b2be2..49325f3e0db 100644 --- a/PWGUD/Tasks/upcForward.cxx +++ b/PWGUD/Tasks/upcForward.cxx @@ -14,16 +14,26 @@ o2-analysis-timestamp| o2-analysis-upc-forward | o2-analysis-event-selection -- for now AO2D.root I am using is alien:///alice/data/2015/LHC15o/000246392/pass5_lowIR/PWGZZ/Run3_Conversion/148_20210304-0829_child_1/AOD/001/AO2D.root */ -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -#include "TLorentzVector.h" -#include "Common/CCDB/TriggerAliases.h" + +#include + +#include using namespace std; using namespace o2; diff --git a/PWGUD/Tasks/upcJpsiCorr.cxx b/PWGUD/Tasks/upcJpsiCorr.cxx index ad0145dae34..1732869e0d6 100644 --- a/PWGUD/Tasks/upcJpsiCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCorr.cxx @@ -15,25 +15,33 @@ /// \author Sara Haidlova, sara.haidlova@cern.ch /// \since March 2024 -#include -#include - -// O2 headers -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -// ROOT headers -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcMft.cxx b/PWGUD/Tasks/upcMft.cxx index a3ae2b03287..6349589e6b4 100644 --- a/PWGUD/Tasks/upcMft.cxx +++ b/PWGUD/Tasks/upcMft.cxx @@ -9,31 +9,35 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// c++ headers -#include - -// root headers -#include -#include -#include "TMath.h" -#include "TLorentzVector.h" - -// framework headers -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -// for track propagation -#include "ReconstructionDataFormats/TrackFwd.h" -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "MathUtils/Utils.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "TGeoGlobalMagField.h" -#include "Field/MagneticField.h" -#include "DataFormatsMFT/TrackMFT.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include // define namespaces using namespace o2; diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index 68f9c1698e1..0ae2035f93a 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx @@ -18,25 +18,25 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include using namespace o2; diff --git a/PWGUD/Tasks/upcPionAnalysis.cxx b/PWGUD/Tasks/upcPionAnalysis.cxx index fc215ea1822..470281f0a77 100644 --- a/PWGUD/Tasks/upcPionAnalysis.cxx +++ b/PWGUD/Tasks/upcPionAnalysis.cxx @@ -9,18 +9,35 @@ // 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" -#include -#include "PWGUD/DataModel/UDTables.h" -#include -#include -#include "TLorentzVector.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/DataModel/UDTables.h" + #include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx b/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx index 88d8f36d18d..d026d6ce962 100644 --- a/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx +++ b/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx @@ -19,19 +19,25 @@ #include "Common/Core/RecoDecay.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TMath.h" -#include "TRandom3.h" -#include "TSystem.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx index 8baf7f42206..b87d5f3eb29 100644 --- a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx +++ b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx @@ -31,36 +31,31 @@ // #include "PWGUD/Core/SGSelector.h" - -#include "Common/Core/TrackSelection.h" -#include "Common/Core/Zorro.h" -#include "Common/Core/ZorroSummary.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include -#include -#include -#include -#include -#include - +#include "PWGUD/DataModel/UDTables.h" + +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include +#include #include -#include #include #include diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index 2b5d7405fca..18c3eb5f08a 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -19,13 +19,31 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TPDGCode.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include #include #include @@ -799,7 +817,7 @@ struct UpcRhoAnalysis { if (selectRuns && getRunIndex(collision.runNumber(), selectedRuns) == 0) return; - fillCollisionQcHistos<0>(collision); // fill QC histograms before cuts + fillCollisionQcHistos<0>(collision); // fill QC histograms before cuts if (!collisionPassesCuts(collision, runIndex)) // apply collision cuts return; diff --git a/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx b/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx index f8f03970ff0..703f0989283 100644 --- a/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx @@ -15,16 +15,25 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TH1F.h" -#include "TH2F.h" - -#include "random" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/upcTauRl.cxx b/PWGUD/Tasks/upcTauRl.cxx index 78e9f7b48ae..264dae05eb8 100644 --- a/PWGUD/Tasks/upcTauRl.cxx +++ b/PWGUD/Tasks/upcTauRl.cxx @@ -16,35 +16,35 @@ /// \since 12.07.2022 // -// C++ headers -#include -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include -// ROOT headers -#include "Math/Vector4D.h" -#include "TPDGCode.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTauTau13topo.cxx b/PWGUD/Tasks/upcTauTau13topo.cxx index d2dd61ade0c..a14ebd9cb35 100644 --- a/PWGUD/Tasks/upcTauTau13topo.cxx +++ b/PWGUD/Tasks/upcTauTau13topo.cxx @@ -17,27 +17,35 @@ // copts="--configuration json://tautauConfig.json -b" // o2-analysis-ud-tautau13topo $copts > output.log -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -// #include "TDatabasePDG.h" // not recommended in o2 -#include "Framework/O2DatabasePDGPlugin.h" - -// #include "TLorentzVector.h" -#include "Math/Vector4D.h" -// #include "Common/DataModel/EventSelection.h" -// #include "Common/DataModel/TrackSelectionTables.h" - -#include "PWGUD/Core/DGPIDSelector.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/PIDResponseTPC.h" -// #include -#include "TPDGCode.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTestFITBitMapping.cxx b/PWGUD/Tasks/upcTestFITBitMapping.cxx index 8456c46dc85..eefd4f0aa83 100644 --- a/PWGUD/Tasks/upcTestFITBitMapping.cxx +++ b/PWGUD/Tasks/upcTestFITBitMapping.cxx @@ -16,13 +16,19 @@ #include "PWGUD/Core/UDHelpers.h" // udhelpers::Bits256, makeBits256, testBit, getPhiEtaFromFitBit #include "PWGUD/DataModel/UDTables.h" // aod::UDCollisionFITBits -#include "FT0Base/Geometry.h" // o2::ft0::Geometry -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include // o2::ft0::Geometry +#include +#include +#include +#include +#include +#include #include #include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx index 5f6d1bd8db1..2e70f5c2a1a 100644 --- a/PWGUD/Tasks/upcTestRctTables.cxx +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -16,18 +16,21 @@ /// \since 27.06.2025 // -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/upcVetoAnalysis.cxx b/PWGUD/Tasks/upcVetoAnalysis.cxx index 45b3844ed51..fab4246a0f7 100644 --- a/PWGUD/Tasks/upcVetoAnalysis.cxx +++ b/PWGUD/Tasks/upcVetoAnalysis.cxx @@ -8,21 +8,40 @@ // 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include #include +#include +#include #include +#include #include #include -#include -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" using namespace o2::framework; using namespace o2::framework::expressions; From c0cbb58684c1f8cce6f79ca7a99701f4f3c3f29a Mon Sep 17 00:00:00 2001 From: jaelpark Date: Sat, 28 Mar 2026 21:49:44 +0200 Subject: [PATCH 089/282] PWGCF: Prompt scores support, no prompt selection for reflections (#15558) --- PWGCF/Tasks/correlations.cxx | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index 6044510a562..0460b80886f 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -109,6 +109,7 @@ struct CorrelationTask { O2_DEFINE_CONFIGURABLE(cfgPtDepMLbkg, std::vector, {}, "pT interval for ML training") O2_DEFINE_CONFIGURABLE(cfgPtCentDepMLbkgSel, std::vector, {}, "Bkg ML selection") + O2_DEFINE_CONFIGURABLE(cfgPtCentDepMLpromptSel, std::vector, {}, "Prompt ML selection") ConfigurableAxis axisVertex{"axisVertex", {7, -7, 7}, "vertex axis for histograms"}; ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; @@ -174,8 +175,14 @@ struct CorrelationTask { void init(o2::framework::InitContext&) { - if ((doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML) && (cfgPtDepMLbkg->empty() || cfgPtCentDepMLbkgSel->empty())) - LOGF(fatal, "cfgPtDepMLbkg or cfgPtCentDepMLbkgSel can not be empty when ML 2-prong selections are used."); + if (doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML || doprocessMCEfficiency2ProngML || doprocessMCReflection2ProngML) { + if (cfgPtDepMLbkg->empty() || cfgPtCentDepMLbkgSel->empty()) + LOGF(fatal, "cfgPtDepMLbkg or cfgPtCentDepMLbkgSel can not be empty when ML 2-prong selections are used."); + if (cfgPtDepMLbkg->size() != cfgPtCentDepMLbkgSel->size()) + LOGF(fatal, "cfgPtDepMLbkg and cfgPtCentDepMLbkgSel must be same size."); + if (!cfgPtCentDepMLpromptSel->empty() && cfgPtCentDepMLpromptSel->size() != cfgPtDepMLbkg->size()) + LOGF(fatal, "cfgPtDepMLbkg and cfgPtCentDepMLpromptSel must be same size."); + } registry.add("yields", "multiplicity/centrality vs pT vs eta", {HistType::kTH3F, {{100, 0, 100, "/multiplicity/centrality"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("etaphi", "multiplicity/centrality vs eta vs phi", {HistType::kTH3F, {{100, 0, 100, "multiplicity/centrality"}, {100, -2, 2, "#eta"}, {200, 0, o2::constants::math::TwoPI, "#varphi"}}}); if (doprocessSame2ProngDerived || doprocessSame2ProngDerivedML || doprocessSame2Prong2Prong || doprocessSame2Prong2ProngML || doprocessMCSameDerived2Prong) { @@ -326,7 +333,15 @@ struct CorrelationTask { { auto it = std::lower_bound(cfgPtDepMLbkg->begin(), cfgPtDepMLbkg->end(), track.pt()); int idx = std::distance(cfgPtDepMLbkg->begin(), it) - 1; - return !((track.decay() == 0 && track.mlProbD0()[0] > cfgPtCentDepMLbkgSel->at(idx)) || (track.decay() == 1 && track.mlProbD0bar()[0] > cfgPtCentDepMLbkgSel->at(idx))); + return (track.decay() != aod::cf2prongtrack::D0ToPiK || + (track.mlProbD0()[0] < cfgPtCentDepMLbkgSel->at(idx) && // not background + (cfgPtCentDepMLpromptSel->empty() || + track.mlProbD0()[1] > cfgPtCentDepMLpromptSel->at(idx)))) && // prompt + + ((track.decay() != aod::cf2prongtrack::D0barToKPi && track.decay() != aod::cf2prongtrack::D0barToKPiExclusive) || + (track.mlProbD0bar()[0] < cfgPtCentDepMLbkgSel->at(idx) && // not background + (cfgPtCentDepMLpromptSel->empty() || + track.mlProbD0bar()[1] > cfgPtCentDepMLpromptSel->at(idx)))); // prompt } template @@ -571,7 +586,7 @@ struct CorrelationTask { } if constexpr (std::experimental::is_detected::value) { - if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (track1.decay() & aod::cf2prongmcpart::Prompt) == 0) + if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (!cfgPtCentDepMLpromptSel->empty() && (track1.decay() & aod::cf2prongmcpart::Prompt) == 0)) continue; } else if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) { @@ -654,7 +669,7 @@ struct CorrelationTask { // If decay attributes are found for the second track/particle, we assume 2p-2p correlation if constexpr (std::experimental::is_detected::value) { - if ((((track2.mcDecay()) != aod::cf2prongtrack::D0ToPiK) && ((track2.mcDecay()) != aod::cf2prongtrack::D0barToKPiExclusive)) || (track2.decay() & aod::cf2prongmcpart::Prompt) == 0) + if ((((track2.mcDecay()) != aod::cf2prongtrack::D0ToPiK) && ((track2.mcDecay()) != aod::cf2prongtrack::D0barToKPiExclusive)) || (!cfgPtCentDepMLpromptSel->empty() && (track2.decay() & aod::cf2prongmcpart::Prompt) == 0)) continue; } else if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track2.decay()))) == 0u) { @@ -1196,8 +1211,12 @@ struct CorrelationTask { p2indexCache.clear(); for (const auto& mcParticle : mcParticles) { if (std::find(cfgMcTriggerPDGs->begin(), cfgMcTriggerPDGs->end(), mcParticle.pdgCode()) != cfgMcTriggerPDGs->end()) { - if (((mcParticle.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (mcParticle.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (mcParticle.decay() & aod::cf2prongmcpart::Prompt) == 0) + if ((mcParticle.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (mcParticle.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) continue; // wrong decay channel + if constexpr (!reflectionSpec) { + if (!cfgPtCentDepMLpromptSel->empty() && (mcParticle.decay() & aod::cf2prongmcpart::Prompt) == 0) + continue; + } if (mcParticle.cfParticleDaugh0Id() < 0 && mcParticle.cfParticleDaugh1Id() < 0) continue; // daughters not found if constexpr (!reflectionSpec) From f70d39c8f3b6a27cd8f088351846fc303d57c720 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Sat, 28 Mar 2026 23:30:41 +0100 Subject: [PATCH 090/282] [PWGLF] Add forward detector timing information in strangeness data model (#15547) Co-authored-by: ALICE Builder --- PWGLF/DataModel/LFStrangenessTables.h | 10 ++ .../Strangeness/strangederivedbuilder.cxx | 92 +++++++++++++++---- 2 files changed, 84 insertions(+), 18 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index bc7fd7d3aaa..6303ac2351e 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -274,6 +274,16 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //! // stracollision::EnergyCommonZNC, stracollision::IsUPC); +DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent + DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 mult::MultFT0A, mult::MultFT0C, // FIT detectors diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index a68b06b4b79..499514add65 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -78,20 +78,21 @@ struct strangederivedbuilder { struct : ProducesGroup { //__________________________________________________ // fundamental building blocks of derived data - Produces strangeColl; // characterises collisions - Produces strangeCollLabels; // characterises collisions - Produces strangeMCColl; // characterises collisions / MC - Produces strangeMCMults; // characterises collisions / MC mults - Produces strangeCents; // characterises collisions / centrality in Run 3 - Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 - Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 - Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 - Produces strangeStamps; // provides timestamps, run numbers - Produces straEvTimes; // provides event times (FT0, TOF) - Produces v0collref; // references collisions from V0s - Produces casccollref; // references collisions from cascades - Produces kfcasccollref; // references collisions from KF cascades - Produces tracasccollref; // references collisions from tracked cascades + Produces strangeColl; // characterises collisions + Produces strangeCollLabels; // characterises collisions + Produces strangeMCColl; // characterises collisions / MC + Produces strangeMCMults; // characterises collisions / MC mults + Produces strangeCents; // characterises collisions / centrality in Run 3 + Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 + Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 + Produces strangeEvSelExtras; // extra event selection variables in Run 3 + Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 + Produces strangeStamps; // provides timestamps, run numbers + Produces straEvTimes; // provides event times (FT0, TOF) + Produces v0collref; // references collisions from V0s + Produces casccollref; // references collisions from cascades + Produces kfcasccollref; // references collisions from KF cascades + Produces tracasccollref; // references collisions from tracked cascades //__________________________________________________ // track extra references @@ -207,6 +208,8 @@ struct strangederivedbuilder { ConfigurableAxis axisFDDC{"FDDCamplitude", {100, 0.0f, 2000.0f}, "FDDCamplitude"}; ConfigurableAxis axisZNA{"ZNAamplitude", {100, 0.0f, 250.0f}, "ZNAamplitude"}; ConfigurableAxis axisZNC{"ZNCamplitude", {100, 0.0f, 250.0f}, "ZNCamplitude"}; + ConfigurableAxis axisZNAtime{"ZNAtime", {100, -999.f, 999.0f}, "ZNAtime"}; + ConfigurableAxis axisZNCtime{"ZNCtime", {100, -999.f, 999.0f}, "ZNCtime"}; } axisDetectors; // For manual sliceBy @@ -404,6 +407,8 @@ struct strangederivedbuilder { auto hFDDCMultVsFDDCUD = histos.add("hFDDCMultVsFDDCUD", "hFDDCMultVsFDDCUD; FDD-C Mult; FDD-C UD", kTH2F, {axisDetectors.axisFDDC, axisDetectors.axisFDDC}); auto hZNAMultVsZNAUD = histos.add("hZNAMultVsZNAUD", "hZNAMultVsZNAUD; ZNA Mult; ZNA UD", kTH2F, {axisDetectors.axisZNA, axisDetectors.axisZNA}); auto hZNCMultVsZNCUD = histos.add("hZNCMultVsZNCUD", "hZNCMultVsZNCUD; ZNC Mult; ZNC UD", kTH2F, {axisDetectors.axisZNC, axisDetectors.axisZNC}); + auto hZNATimeVsZNAUD = histos.add("hZNATimeVsZNAUD", "hZNAMultVsZNAUD; ZNA time; ZNA UD", kTH2F, {axisDetectors.axisZNAtime, axisDetectors.axisZNAtime}); + auto hZNCTimeVsZNCUD = histos.add("hZNCTimeVsZNCUD", "hZNCMultVsZNCUD; ZNC time; ZNC UD", kTH2F, {axisDetectors.axisZNCtime, axisDetectors.axisZNCtime}); for (int ii = 1; ii < 101; ii++) { float value = 100.5f - static_cast(ii); @@ -458,6 +463,14 @@ struct strangederivedbuilder { float totalFDDAmplitudeC = -999; float energyCommonZNA = -999; float energyCommonZNC = -999; + float timeZNA = -999; + float timeZNC = -999; + float timeFV0A = -999; + float timeFT0A = -999; + float timeFT0C = -999; + float timeFDDA = -999; + float timeFDDC = -999; + uint8_t ft0TriggerMask = 0; // +-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+ // set UD information in case present at this stage @@ -474,6 +487,14 @@ struct strangederivedbuilder { totalFDDAmplitudeC = udColl.totalFDDAmplitudeC(); energyCommonZNA = udColl.energyCommonZNA(); energyCommonZNC = udColl.energyCommonZNC(); + timeZNA = udColl.timeZNA(); + timeZNC = udColl.timeZNC(); + timeFDDA = udColl.timeFDDA(); + timeFDDC = udColl.timeFDDC(); + timeFV0A = udColl.timeFV0A(); + timeFT0A = udColl.timeFT0A(); + timeFT0C = udColl.timeFT0C(); + ft0TriggerMask = udColl.triggerMaskFT0(); histos.fill(HIST("hFT0AMultVsFT0AUD"), collision.multFT0A(), udColl.totalFT0AmplitudeA()); histos.fill(HIST("hFT0CMultVsFT0CUD"), collision.multFT0C(), udColl.totalFT0AmplitudeC()); @@ -482,6 +503,14 @@ struct strangederivedbuilder { histos.fill(HIST("hFDDCMultVsFDDCUD"), collision.multFDDC(), udColl.totalFDDAmplitudeC()); histos.fill(HIST("hZNAMultVsZNAUD"), collision.multZNA(), udColl.energyCommonZNA()); histos.fill(HIST("hZNCMultVsZNCUD"), collision.multZNC(), udColl.energyCommonZNC()); + if (bc.has_zdc()) { + auto zdc = bc.zdc(); + histos.fill(HIST("hZNATimeVsZNAUD"), zdc.timeZNA(), udColl.timeZNA()); + histos.fill(HIST("hZNCTimeVsZNCUD"), zdc.timeZNC(), udColl.timeZNC()); + } else { + histos.fill(HIST("hZNATimeVsZNAUD"), -999., udColl.timeZNA()); + histos.fill(HIST("hZNCTimeVsZNCUD"), -999., udColl.timeZNC()); + } } } } @@ -502,6 +531,29 @@ struct strangederivedbuilder { centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); } + if (gapSide < 0) { // if UD collision is not found, store the timing information from collision instead + if (bc.has_zdc()) { + auto zdc = bc.zdc(); + timeZNA = zdc.timeZNA(); + timeZNC = zdc.timeZNC(); + } + if (collision.has_foundFDD()) { // Analysis is fully based on FT0 presence + const auto& fdd = collision.foundFDD(); + timeFDDA = fdd.timeA(); + timeFDDC = fdd.timeC(); + } + if (collision.has_foundFV0()) { // Analysis is fully based on FV0 presence + const auto& fv0a = collision.foundFV0(); + timeFV0A = fv0a.time(); + } + if (collision.has_foundFT0()) { // Analysis is fully based on FT0 presence + const auto& ft0 = collision.foundFT0(); + timeFT0A = ft0.timeA(); + timeFT0C = ft0.timeC(); + ft0TriggerMask = ft0.triggerMask(); + } + } + products.strangeCents(collision.centFT0M(), collision.centFT0A(), centrality, collision.centFV0A(), collision.centFT0CVariant1(), collision.centMFT(), collision.centNGlobal()); @@ -534,6 +586,10 @@ struct strangederivedbuilder { collision.flags(), collision.alias_raw(), collision.rct_raw()); + products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info + timeFDDA, timeFDDC, // FDD info + timeFV0A, // FV0A info + timeFT0A, timeFT0C, ft0TriggerMask); // FT0 info } else { // We are in Run 2 products.strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(), collision.centRun2SPDTracklets(), collision.centRun2SPDClusters()); @@ -651,23 +707,23 @@ struct strangederivedbuilder { } } - void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs) + void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&) { populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs, UDCollisionsFull const& udCollisions) + void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) { populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); From 1593a2170a71099e7bd3cfb6aebd0770bbe8cd44 Mon Sep 17 00:00:00 2001 From: Nasir Mehdi Malik <89008506+nasirmehdimalik@users.noreply.github.com> Date: Sun, 29 Mar 2026 06:22:53 +0530 Subject: [PATCH 091/282] [PWGLF] Added configurable track cuts for systematic studies and mass resolution histograms (#15557) --- PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx | 162 +++++++++++++++------ 1 file changed, 119 insertions(+), 43 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx index 6af3bde09f8..bd0964bbea5 100644 --- a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx @@ -17,9 +17,6 @@ #include "PWGLF/DataModel/LFResonanceTables.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" - #include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" @@ -41,18 +38,25 @@ struct lambdaAnalysis_pb { Preslice perRCol = aod::resodaughter::resoCollisionId; Preslice perCollision = aod::track::collisionId; // Configurables. - + aod::ResoMCParents const* mResoParents = nullptr; Configurable ConfEvtOccupancyInTimeRange{"ConfEvtOccupancyInTimeRange", false, "occupancy selection true or false"}; Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histogram"}; Configurable nBinsInvM{"nBinsInvM", 120, "N bins in InvMass histogram"}; Configurable lambda1520id{"lambda1520id", 3124, "pdg"}; Configurable doRotate{"doRotate", true, "rotated inv mass spectra"}; - // Tracks Configurable cPtMin{"cPtMin", 0.15, "Minimum Track pT"}; Configurable cPMin{"cPMin", 0., "Minimum Track p"}; Configurable cEtaCut{"cEtaCut", 0.8, "Pseudorapidity cut"}; Configurable cDcaz{"cDcazMin", 1., "Minimum DCAz"}; + Configurable cfgRapidityShift{"cfgRapidityShift", 0., " rapidity shift"}; + Configurable cfgRapidityCut{"cfgRapidityCut", 0.5, "Rapidity window"}; + // TPC crossed rows (absolute) + Configurable cfgMinCrossedRows{"cfgMinCrossedRows", 70, "min TPC crossed rows"}; + Configurable cfgUseCrossedRows{"cfgUseCrossedRows", false, "apply crossed rows cut"}; + + Configurable cfgMinTPCcls{"cfgMinTPCcls", 70, "min TPC clusters found"}; + Configurable cfgUseTPCcls{"cfgUseTPCcls", false, "apply TPC clusters cut"}; Configurable> cDcaPtBinsPr{"cDcaPtBinsPr", {0.0f, 0.5f, 1.0f, 2.0f, 3.0f, 5.0f, 1000.0f}, "Proton pT bin edges for DCAxy cut"}; @@ -141,7 +145,7 @@ struct lambdaAnalysis_pb { const AxisSpec axisdEdx(380, 10, 200, {"#frac{dE}{dx}"}); const AxisSpec axisVz(120, -12, 12, {"vz"}); const AxisSpec axisEP(120, -3.14, 3.14, {"#theta"}); - const AxisSpec axisInvM(nBinsInvM, 1.2, 1.8, {"M_{inv} (GeV/c^{2})"}); + const AxisSpec axisInvM(nBinsInvM, 1.4, 2.0, {"M_{inv} (GeV/c^{2})"}); AxisSpec axisOccupancy = {occupancy_bins, "Occupancy [-40,100]"}; AxisSpec axisDCAz = {cDCAzBins, "DCA_{z} (cm)"}; @@ -150,7 +154,11 @@ struct lambdaAnalysis_pb { if (doprocessMix || doprocessMixDF || doprocessMixepDF) { histos.add("Event/mixing_vzVsmultpercentile", "FT0(%)", kTH3F, {axisCent, axisVz, axisEP}); } - // QA Before + // QA Beforei + histos.add("QAbefore/hEta_rec", "Reco dN/d#eta; #eta; dN/d#eta", kTH1F, {{50, -1.0, 1.0}}); + histos.add("QAbefore/hPt_rec", "Reco pT; p_{T} (GeV/c); Tracks", kTH1F, {axisP_pid}); + histos.add("QAbefore/hPhi_rec", "Reco #varphi; #varphi (rad); Tracks", kTH1F, {{72, 0, 6.2832}}); + histos.add("QAbefore/hEtaPhi_rec", "Reco #eta vs #varphi; #eta; #varphi", kTH2F, {axisEta, {72, 0, 6.2832}}); histos.add("QAbefore/Proton/h2d_pr_nsigma_tpc_p", "n#sigma^{TPC} Protons", kTH2F, {axisP_pid, axisTPCNsigma}); histos.add("QAbefore/Proton/h2d_pr_nsigma_tof_p", "n#sigma^{TOF} Protons", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAbefore/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma^{TPC} vs n#sigma^{TOF} Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); @@ -172,6 +180,8 @@ struct lambdaAnalysis_pb { histos.add("QAafter/Proton/h2d_Prpi_nsigma_tof_p", " Protons pion", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_Prka_nsigma_tof_p", " Protons kaon", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); + histos.add("QAafter/Proton/hTPCNClsCrossedRowsVsPt", "TPC Crossed Rows vs pT;p_{T} (GeV/c);N_{cls,crossed};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); + histos.add("QAafter/Proton/hTPCNClsFoundVsPt", "TPC Found Clusters vs pT;p_{T} (GeV/c);N_{cls,found};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); histos.add("QAafter/Kaon/hd_ka_pt", "p_{T}-spectra Kaons", kTH2F, {axisPt_pid, axisCent}); histos.add("QAafter/Kaon/h2d_ka_dca_z", "dca_{z} Kaons", kTH2F, {axisPt_pid, axisDCAz}); histos.add("QAafter/Kaon/h2d_ka_dca_xy", "dca_{xy} Kaons", kTH2F, {axisPt_pid, axisDCAxy}); @@ -185,7 +195,8 @@ struct lambdaAnalysis_pb { histos.add("QAafter/Kaon/h2d_Kapi_nsigma_tof_p", " Kaons pion", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Kaon/h2d_Kapr_nsigma_tof_p", " Kaons proton", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); - + histos.add("QAafter/Kaon/hTPCNClsCrossedRowsVsPt", "TPC Crossed Rows vs pT;p_{T} (GeV/c);N_{cls,crossed};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); + histos.add("QAafter/Kaon/hTPCNClsFoundVsPt", "TPC Found Clusters vs pT;p_{T} (GeV/c);N_{cls,found};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); // Analysis // Lambda Invariant Mass if (!doprocessMC) { @@ -193,7 +204,8 @@ struct lambdaAnalysis_pb { histos.add("Analysis/h4d_lstar_invm_US_MP", "THn #bar #Lambda(1520)", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_PP", "THn Like Signs p K^{+}", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_MM", "THn Like Signs #bar{p} K^{-}", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); - histos.add("Analysis/h4d_lstar_invm_rot", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); + histos.add("Analysis/h4d_lstar_invm_rot_PM", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); + histos.add("Analysis/h4d_lstar_invm_rot_MP", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_US_PM_mix", "THn Mixed Events", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_US_MP_mix", "THn anti Mixed Events", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_LS_PP_mix", "THn Mixed Events PP", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); @@ -201,7 +213,7 @@ struct lambdaAnalysis_pb { } // MC if (doprocessMC) { - + histos.add("Event/hMCEventCutflow", "MC Event Cutflow", kTH1F, {{7, 0, 7}}); histos.add("QAChecks/h1d_pr_rec_pt", "Reconstructed p_{T}-spectra Protons", kTH1F, {axisPt_pid}); histos.add("QAChecks/h1d_ka_rec_pt", "Recondstucted p_{T}-spectra Kaons", kTH1F, {axisPt_pid}); histos.add("QAChecks/h1d_pr_gen_pt", "Generated p_{T}-spectra Protons", kTH1F, {axisPt_pid}); @@ -211,13 +223,14 @@ struct lambdaAnalysis_pb { histos.add("Analysis/h3d_gen_lstar_MP", "Generated #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {axisInvM, axisPt, axisCent}); histos.add("Analysis/h3d_rec_lstar_PM", "Reconstructed #Lambda(1520) p_{T}", kTHnSparseF, {axisInvM, axisPt, axisCent}); histos.add("Analysis/h3d_rec_lstar_MP", "Reconstructed #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {axisInvM, axisPt, axisCent}); + histos.add("Analysis/h3d_reso_lstar_PM", "Resolution #Lambda(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent}); + histos.add("Analysis/h3d_reso_lstar_MP", "Resolution #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent}); } } template bool selTracks(T const& track) { - if (track.pt() < cPtMin) return false; @@ -233,9 +246,15 @@ struct lambdaAnalysis_pb { if (cPVContributor && !track.isPVContributor()) return false; + if (cfgUseCrossedRows && track.tpcNClsCrossedRows() < cfgMinCrossedRows) + return false; + + if (cfgUseTPCcls && track.tpcNClsFound() < cfgMinTPCcls) + return false; + return true; } - // ── Proton DCA Selection ────────────────────────────────────────────────── + template bool dcaSelectionProton(T const& track, float p) { @@ -342,6 +361,7 @@ struct lambdaAnalysis_pb { } } if (tpcPIDPassed && tofPIDPassed) { + return true; } return false; @@ -408,6 +428,7 @@ struct lambdaAnalysis_pb { } } if (tpcPIDPassed && tofPIDPassed) { + return true; } return false; @@ -420,14 +441,13 @@ struct lambdaAnalysis_pb { float p_ptot = 0., k_ptot = 0.; for (auto const& [trkPr, trkKa] : soa::combinations(soa::CombinationsFullIndexPolicy(trk1, trk2))) { - // Do not analyse same index tracks. - if (trkPr.index() == trkKa.index() && !mix) + if (trkPr.index() == trkKa.index()) // && !mix) continue; - // pT, DCA, Global Tracks and PVcontrib selection. if (!selTracks(trkPr) || !selTracks(trkKa)) continue; + // LOGF(info, "eork 4 %d, %d %d ",trkPr.index(),trk1.size(),trkPr.size()); auto _pxPr = trkPr.px(); auto _pyPr = trkPr.py(); @@ -442,7 +462,6 @@ struct lambdaAnalysis_pb { // Fill QA before track selection. if (!mix) { auto _tpcnsigmaPr = trkPr.tpcNSigmaPr(); - histos.fill(HIST("QAbefore/Proton/h2d_pr_nsigma_tpc_p"), p_ptot, _tpcnsigmaPr); if (trkPr.hasTOF()) { auto _tofnsigmaPr = trkPr.tofNSigmaPr(); @@ -485,6 +504,9 @@ struct lambdaAnalysis_pb { histos.fill(HIST("QAafter/Proton/h2d_Prka_nsigma_tpc_p"), p_ptot, trkPr.tpcNSigmaKa()); histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tpc_p"), p_ptot, _tpcnsigmaPr); histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tpc_pt"), _ptPr, _tpcnsigmaPr); + histos.fill(HIST("QAafter/Proton/hTPCNClsCrossedRowsVsPt"), _ptPr, trkPr.tpcNClsCrossedRows()); + histos.fill(HIST("QAafter/Proton/hTPCNClsFoundVsPt"), _ptPr, trkPr.tpcNClsFound()); + if (!cUseTpcOnly && trkPr.hasTOF()) { auto _tofnsigmaPr = trkPr.tofNSigmaPr(); histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tof_p"), p_ptot, _tofnsigmaPr); @@ -505,6 +527,9 @@ struct lambdaAnalysis_pb { histos.fill(HIST("QAafter/Kaon/h2d_Kapr_nsigma_tpc_p"), k_ptot, trkKa.tpcNSigmaPr()); histos.fill(HIST("QAafter/Kaon/h2d_ka_nsigma_tpc_p"), k_ptot, _tpcnsigmaKa); histos.fill(HIST("QAafter/Kaon/h2d_ka_nsigma_tpc_pt"), _ptKa, _tpcnsigmaKa); + histos.fill(HIST("QAafter/Kaon/hTPCNClsCrossedRowsVsPt"), _ptKa, trkKa.tpcNClsCrossedRows()); + histos.fill(HIST("QAafter/Kaon/hTPCNClsFoundVsPt"), _ptKa, trkKa.tpcNClsFound()); + if (!cUseTpcOnly && trkKa.hasTOF()) { auto _tofnsigmaKa = trkKa.tofNSigmaKa(); histos.fill(HIST("QAafter/Kaon/h2d_ka_nsigma_tof_p"), k_ptot, _tofnsigmaKa); @@ -525,9 +550,12 @@ struct lambdaAnalysis_pb { float _M = RecoDecay::m(arrMomrec, std::array{MassProton, MassKaonCharged}); float _pt = RecoDecay::pt(std::array{_pxPr + _pxKa, _pyPr + _pyKa}); - if (std::abs(RecoDecay::y(std::array{_pxPr + _pxKa, _pyPr + _pyKa, _pzPr + _pzKa}, MassLambda1520)) > 0.5) - continue; + float _y = std::abs(RecoDecay::y(std::array{_pxPr + _pxKa, _pyPr + _pyKa, _pzPr + _pzKa}, _M)); + float _yshift = _y - cfgRapidityShift; + + if (std::abs(_yshift) > cfgRapidityCut) + continue; // Apply kinematic cuts. // Fill Invariant Mass Histograms. @@ -543,7 +571,14 @@ struct lambdaAnalysis_pb { for (int i = 0; i < cNofRotations; i++) { float delta = o2::constants::math::PI / rotationalcut; - float theta2 = (o2::constants::math::PI - delta) + i * (2.f * delta / (cNofRotations - 1)); + float theta2; + if (cNofRotations == 1) { + // Single rotation — just rotate by exactly PI + theta2 = o2::constants::math::PI; + } else { + theta2 = (o2::constants::math::PI - delta) + + i * (2.f * delta / (cNofRotations - 1)); + } float phiRot = trkKa.phi() + theta2; if (phiRot > o2::constants::math::TwoPI) @@ -561,12 +596,19 @@ struct lambdaAnalysis_pb { float _Mrot = RecoDecay::m(arrMomRot, std::array{MassProton, MassKaonCharged}); float _ptRot = RecoDecay::pt(std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot}); - if (std::abs(RecoDecay::y( - std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot, _pzPr + _pzKa}, - MassLambda1520)) > 0.5f) + float _yrot = std::abs(RecoDecay::y(std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot, _pzPr + _pzKa}, MassLambda1520)); + + float _yshiftrot = _yrot - cfgRapidityShift; + + if (std::abs(_yshiftrot) > cfgRapidityCut) continue; - histos.fill(HIST("Analysis/h4d_lstar_invm_rot"), _Mrot, _ptRot, mult, occup); + if (trkPr.sign() * trkKa.sign() < 0) { + if (trkPr.sign() > 0) + histos.fill(HIST("Analysis/h4d_lstar_invm_rot_PM"), _Mrot, _ptRot, mult, occup); + else + histos.fill(HIST("Analysis/h4d_lstar_invm_rot_MP"), _Mrot, _ptRot, mult, occup); + } } } } else { @@ -591,7 +633,6 @@ struct lambdaAnalysis_pb { histos.fill(HIST("Analysis/h4d_lstar_invm_LS_MM_mix"), _M, _pt, mult, occup); } } - if constexpr (mc) { if (trkPr.sign() * trkKa.sign() < 0) { if (std::abs(trkPr.pdgCode()) != 2212 || std::abs(trkKa.pdgCode()) != 321) @@ -599,15 +640,34 @@ struct lambdaAnalysis_pb { if (trkPr.motherId() != trkKa.motherId()) continue; + if (trkPr.motherPDG() != trkKa.motherPDG()) + continue; + + if (trkPr.pdgCode() == 0 || trkKa.pdgCode() == 0) + continue; + + if (trkPr.motherPDG() == -1 || trkKa.motherPDG() == -1) + continue; if (std::abs(trkPr.motherPDG()) != lambda1520id) // L* pdg_code = 3124 continue; - // MC histograms + float massParent = 0.; + for (auto const& _part : *mResoParents) { + if (_part.mcParticleId() == trkPr.motherId()) { + std::array pvecParent = {_part.px(), _part.py(), _part.pz()}; + massParent = RecoDecay::m(pvecParent, _part.e()); + break; + } + } + + float _MRes = _M - massParent; if (trkPr.motherPDG() > 0) { histos.fill(HIST("Analysis/h3d_rec_lstar_PM"), _M, _pt, mult); + histos.fill(HIST("Analysis/h3d_reso_lstar_PM"), _MRes, _pt, mult); } else { histos.fill(HIST("Analysis/h3d_rec_lstar_MP"), _M, _pt, mult); + histos.fill(HIST("Analysis/h3d_reso_lstar_MP"), _MRes, _pt, mult); } } } @@ -621,7 +681,6 @@ struct lambdaAnalysis_pb { void processData(resoCols::iterator const& collision, resoTracks const& tracks) { - // LOGF(info, " collisions: Index = %d %d", collision.globalIndex(),tracks.size()); histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent(), 100); histos.fill(HIST("Event/h_ft0_vz"), collision.posZ()); @@ -634,54 +693,74 @@ struct lambdaAnalysis_pb { void processMC(resoMCCols::iterator const& collision, soa::Join const& tracks, aod::ResoMCParents const& resoParents) { - if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts()) + histos.fill(HIST("Event/hMCEventCutflow"), 0); // All collisions + + if (cEvtMCTriggerTVX && !collision.isTriggerTVX()) return; + histos.fill(HIST("Event/hMCEventCutflow"), 1); // After TriggerTVX + + if (cEvtMCVtxIn10 && !collision.isVtxIn10()) + return; + histos.fill(HIST("Event/hMCEventCutflow"), 2); // After VtxIn10 + if (cEvtMCINELgt0 && !collision.isINELgt0()) return; + histos.fill(HIST("Event/hMCEventCutflow"), 3); // After INELgt0 + if (cEvtMCSel8 && !collision.isInSel8()) return; - if (cEvtMCVtxIn10 && !collision.isVtxIn10()) - return; - if (cEvtMCTriggerTVX && !collision.isTriggerTVX()) - return; + histos.fill(HIST("Event/hMCEventCutflow"), 4); // After Sel8 + if (cEvtMCRecINELgt0 && !collision.isRecINELgt0()) return; + histos.fill(HIST("Event/hMCEventCutflow"), 5); // After RecINELgt0 + + if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts()) + return; + histos.fill(HIST("Event/hMCEventCutflow"), 6); // After AfterAllCuts auto mult = collision.cent(); auto mult = collision.cent(); histos.fill(HIST("Event/h1d_ft0_mult_percentile"), mult, 100); histos.fill(HIST("Event/h_ft0_vz"), collision.posZ()); + mResoParents = &resoParents; fillDataHistos(tracks, tracks, mult); // get MC pT-spectra for (auto const& track : tracks) { + histos.fill(HIST("QAbefore/hEta_rec"), track.eta()); + histos.fill(HIST("QAbefore/hPt_rec"), track.pt()); + histos.fill(HIST("QAbefore/hPhi_rec"), track.phi()); + histos.fill(HIST("QAbefore/hEtaPhi_rec"), track.eta(), track.phi()); // get the generated level pT spectra of protons and kaons if (std::abs(track.pdgCode()) == 321) histos.fill(HIST("QAChecks/h1d_ka_gen_pt"), track.pt()); - if (std::abs(track.pdgCode()) == 2212) histos.fill(HIST("QAChecks/h1d_pr_gen_pt"), track.pt()); - // get the reconstructed level pT spectra of protons and kaons if (!selTracks(track)) continue; float p = TMath::Sqrt(track.px() * track.px() + track.py() * track.py() + track.pz() * track.pz()); - if (selectionPIDKaon(track, p) && std::abs(track.pdgCode()) == 321) { - histos.fill(HIST("QAChecks/h1d_ka_rec_pt"), track.pt()); + if (selectionPIDKaon(track, p)) { + if (std::abs(track.pdgCode()) == 321) { + histos.fill(HIST("QAChecks/h1d_ka_rec_pt"), track.pt()); + } } - if (selectionPIDProton(track, p) && std::abs(track.pdgCode()) == 2212) { - histos.fill(HIST("QAChecks/h1d_pr_rec_pt"), track.pt()); + if (selectionPIDProton(track, p)) { + if (std::abs(track.pdgCode()) == 2212) { + histos.fill(HIST("QAChecks/h1d_pr_rec_pt"), track.pt()); + } } } for (auto const& part : resoParents) { if (std::abs(part.pdgCode()) != lambda1520id) // // L* pdg_code = 3124 continue; - if (std::abs(part.y()) > 0.5) { // rapidity cut - continue; - } + // if (std::abs(part.y()) > 0.5) { // rapidity cut + // continue; + // } bool pass1 = false; bool pass2 = false; @@ -696,9 +775,7 @@ struct lambdaAnalysis_pb { if (!pass1 || !pass2) // If we have both decay products continue; std::array pvec = {part.px(), part.py(), part.pz()}; - float mass = RecoDecay::m(pvec, part.e()); - if (part.pdgCode() > 0) histos.fill(HIST("Analysis/h3d_gen_lstar_PM"), mass, part.pt(), mult); else @@ -711,7 +788,6 @@ struct lambdaAnalysis_pb { void processMix(resoCols& collisions, resoTracks const& tracks) { - LOGF(debug, "Event Mixing Started"); BinningType2 binningPositions2{{cMixVtxBins, cMixMultBins}, true}; From 89ffabd46f242dd178229cbfd1ae0bcc0a9dd1e0 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sun, 29 Mar 2026 04:31:45 +0200 Subject: [PATCH 092/282] [PWGCF] FemtoUniverse: Add filtering on tracks (#15562) --- ...PairTaskTrackTrackSpherHarMultKtExtended.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index cec5e937084..7d20486a76a 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -96,6 +96,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable> confCPRdeltaEtaCutMaxVector{"confCPRdeltaEtaCutMaxVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta max cut for Close Pair Rejection"}; Configurable> confCPRdeltaEtaCutMinVector{"confCPRdeltaEtaCutMinVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta min cut for Close Pair Rejection"}; Configurable confIsCPRkT{"confIsCPRkT", true, "kT dependent deltaEta-deltaPhi cut for Close Pair Rejection"}; + Configurable confTrkDCAxyMax{"confTrkDCAxyMax", 0.2, "Max DCA in xy "}; + Configurable confTrkDCAzMax{"confTrkDCAzMax", 0.2, "Max DCA in z "}; + Configurable confTrkTPCcRowsMin{"confTrkTPCcRowsMin", 80, "Min of TPC crossed rows"}; + Configurable confTrkTPCfClsMin{"confTrkTPCfClsMin", 0.83, "Min. fraction of crossed rows/findable TPC clusters"}; + Configurable confTrkTPCfracsClsMax{"confTrkTPCfracsClsMax", 1.0, "Max of fraction of TPC shared cluster "}; + Configurable confTrkTPCnClsMin{"confTrkTPCnClsMin", 80, "Min number of TPC clusters"}; + Configurable confTrkTPCsClsMax{"confTrkTPCsClsMax", 160, "Max number of TPC shared clusters"}; Configurable confPairFracSharedTPCcls{"confPairFracSharedTPCcls", 1.0, "Max. fraction of TPC shared clusters between two closed tracks"}; Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; Configurable confUseCCImCut{"confUseCCImCut", false, "Fill SH within specific quadrants of qout-qside"}; @@ -114,7 +121,15 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { using FemtoFullParticles = soa::Join; // Filters for selecting particles (both p1 and p2) - Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax); // example filtering on Configurable + Filter trackAdditionalfilter = ((nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax) && + (aod::track::dcaXY <= twotracksconfigs.confTrkDCAxyMax) && + (aod::track::dcaZ <= twotracksconfigs.confTrkDCAzMax) && + (aod::femtouniverseparticle::tpcNClsCrossedRows >= twotracksconfigs.confTrkTPCcRowsMin) && + (aod::femtouniverseparticle::tpcFractionSharedCls <= twotracksconfigs.confTrkTPCfracsClsMax) && + (aod::femtouniverseparticle::tpcNClsFound >= twotracksconfigs.confTrkTPCnClsMin) && + ((aod::femtouniverseparticle::tpcNClsCrossedRows / aod::track::tpcNClsFindable) >= twotracksconfigs.confTrkTPCfClsMin) && + (aod::track::tpcNClsShared >= twotracksconfigs.confTrkTPCsClsMax)); + using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this optionconfIsCPRkT using FemtoRecoParticles = soa::Join; From c5b66a6c22e0585b6ecfea4351789891633e8a3d Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Sun, 29 Mar 2026 11:47:43 +0200 Subject: [PATCH 093/282] [PWGHF] Add PID, track eta and ZDC time histograms in UPC process (#15559) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskD0.cxx | 139 ++++++++++++++++++++++++++++++++----- 1 file changed, 120 insertions(+), 19 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index e879ba57c9a..03da2e17f43 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -94,6 +94,8 @@ struct HfTaskD0 { Configurable storeCentrality{"storeCentrality", false, "Flag to store centrality information"}; Configurable storeOccupancyAndIR{"storeOccupancyAndIR", false, "Flag to store occupancy information and interaction rate"}; Configurable storeTrackQuality{"storeTrackQuality", false, "Flag to store track quality information"}; + Configurable storeZdcEnergy{"storeZdcEnergy", false, "Flag to store ZDC energy info"}; + Configurable storeZdcTime{"storeZdcTime", true, "Flag to store ZDC time info"}; // ML inference Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -121,6 +123,7 @@ struct HfTaskD0 { using CollisionsWithMcLabels = soa::Join; using CollisionsWithMcLabelsCent = soa::Join; using TracksSelQuality = soa::Join; + using TracksWPid = soa::Join; Filter filterD0Flag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK))) != static_cast(0); @@ -161,6 +164,7 @@ struct HfTaskD0 { ConfigurableAxis thnConfigAxisFV0A{"thnConfigAxisFV0A", {2001, -1.5, 1999.5}, "axis for FV0-A amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisFDD{"thnConfigAxisFDD", {200, 0., 4000.}, "axis for FDD amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisZN{"thnConfigAxisZN", {510, -1.5, 49.5}, "axis for ZN energy (a.u.)"}; + ConfigurableAxis thnConfigAxisTimeZN{"thnConfigAxisTimeZN", {700, -35., 35.}, "axis for ZN energy (a.u.)"}; HistogramRegistry registry{ "registry", @@ -248,7 +252,10 @@ struct HfTaskD0 { LOGP(fatal, "DCAFitterN and KFParticle can not be enabled at a time."); } if ((storeCentrality || storeOccupancyAndIR) && !(doprocessDataWithDCAFitterNCent || doprocessMcWithDCAFitterNCent || doprocessDataWithDCAFitterNMlCent || doprocessMcWithDCAFitterNMlCent || doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) { - LOGP(fatal, "Can't enable the storeCentrality and storeOccupancu without cent process or UPC process"); + LOGP(fatal, "Can't enable the storeCentrality and storeOccupancy without cent process or UPC process"); + } + if ((storeZdcEnergy || storeZdcTime) && !(doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) { + LOGP(fatal, "Can't enable the storeZdcEnergy and storeZdcTime without UPC process"); } auto vbins = (std::vector)binsPt; registry.add("hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -309,8 +316,10 @@ struct HfTaskD0 { const AxisSpec thnAxisFV0A{thnConfigAxisFV0A, "FV0-A amplitude"}; const AxisSpec thnAxisFDDA{thnConfigAxisFDD, "FDD-A amplitude"}; const AxisSpec thnAxisFDDC{thnConfigAxisFDD, "FDD-C amplitude"}; - const AxisSpec thnAxisZNA{thnConfigAxisZN, "ZNA energy"}; - const AxisSpec thnAxisZNC{thnConfigAxisZN, "ZNC energy"}; + const AxisSpec thnAxisEnergyZNA{thnConfigAxisZN, "ZNA energy"}; + const AxisSpec thnAxisEnergyZNC{thnConfigAxisZN, "ZNC energy"}; + const AxisSpec thnAxisTimeZNA{thnConfigAxisTimeZN, "ZNA Time"}; + const AxisSpec thnAxisTimeZNC{thnConfigAxisTimeZN, "ZNC Time"}; if (doprocessMcWithDCAFitterN || doprocessMcWithDCAFitterNCent || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithDCAFitterNMlCent || doprocessMcWithKFParticleMl) { std::vector axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; @@ -367,9 +376,15 @@ struct HfTaskD0 { axes.push_back(thnAxisFV0A); axes.push_back(thnAxisFDDA); axes.push_back(thnAxisFDDC); - axes.push_back(thnAxisZNA); - axes.push_back(thnAxisZNC); axes.push_back(thnAxisNumPvContr); + if (storeZdcEnergy) { + axes.push_back(thnAxisEnergyZNA); + axes.push_back(thnAxisEnergyZNC); + } + if (storeZdcTime) { + axes.push_back(thnAxisTimeZNA); + axes.push_back(thnAxisTimeZNC); + } } if (applyMl) { @@ -381,9 +396,39 @@ struct HfTaskD0 { } registry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); - registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 20}, {200, 0., 20}}}); + registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 200}, {1000, 0., 2000}}}); + registry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{700, -35., 35.}, {700, -35., 35.}}}); registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap type;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}}); - registry.add("Data/hGapVsEta", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + registry.add("Data/hGapVsEtaTrack0", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + registry.add("Data/hGapVsEtaTrack1", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + + registry.add("Data/hTPCnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng0Kaon_GapA", "Gap A Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Pion_GapA", "Gap A Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng0Pion_GapC", "Gap C Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + + registry.add("Data/hTOFnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng0Kaon_GapA", "Gap A Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Pion_GapA", "Gap A Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng0Pion_GapC", "Gap C Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + + registry.add("Data/hTpcTofnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng0Kaon_GapA", "Gap A Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Pion_GapA", "Gap A Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng0Pion_GapC", "Gap C Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hGapVsRap", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); hfEvSel.addHistograms(registry); @@ -579,7 +624,8 @@ struct HfTaskD0 { BCsType const& bcs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, - aod::FDDs const& fdds) + aod::FDDs const& fdds, + TracksWPid const&) { for (const auto& collision : collisions) { float centrality{-1.f}; @@ -599,7 +645,6 @@ struct HfTaskD0 { if (gapResult.bc) { bcForUPC = *(gapResult.bc); } - // Get FIT information from the UPC BC upchelpers::FITInfo fitInfo{}; udhelpers::getFITinfo(fitInfo, bcForUPC, bcs, ft0s, fv0as, fdds); @@ -608,13 +653,18 @@ struct HfTaskD0 { const bool hasZdc = bcForUPC.has_zdc(); float zdcEnergyZNA = -1.f; float zdcEnergyZNC = -1.f; + float zdcTimeZNA = -999.f; + float zdcTimeZNC = -999.f; + if (hasZdc) { const auto& zdc = bcForUPC.zdc(); zdcEnergyZNA = zdc.energyCommonZNA(); zdcEnergyZNC = zdc.energyCommonZNC(); + zdcTimeZNA = zdc.timeZNA(); + zdcTimeZNC = zdc.timeZNC(); registry.fill(HIST("Data/zdc/energyZNA_vs_energyZNC"), zdcEnergyZNA, zdcEnergyZNC); + registry.fill(HIST("Data/zdc/timeZNA_vs_timeZNC"), zdcTimeZNA, zdcTimeZNC); } - registry.fill(HIST("Data/fitInfo/ampFT0A_vs_ampFT0C"), fitInfo.ampFT0A, fitInfo.ampFT0C); registry.fill(HIST("Data/hUpcGapAfterSelection"), gap); @@ -637,9 +687,50 @@ struct HfTaskD0 { const float massD0 = HfHelper::invMassD0ToPiK(candidate); const float massD0bar = HfHelper::invMassD0barToKPi(candidate); const auto ptCandidate = candidate.pt(); - registry.fill(HIST("Data/hGapVsEta"), gap, candidate.eta()); + + auto track0 = candidate.template prong0_as(); + auto track1 = candidate.template prong1_as(); + + registry.fill(HIST("Data/hGapVsEtaTrack0"), gap, track0.eta()); + registry.fill(HIST("Data/hGapVsEtaTrack1"), gap, track1.eta()); registry.fill(HIST("Data/hGapVsRap"), gap, HfHelper::yD0(candidate)); + if (gap == 0 && candidate.isSelD0() >= selectionFlagD0) { // A side // D0 --> K-Pi+ + registry.fill(HIST("Data/hTPCnSigProng0Pion_GapA"), track0.p(), track0.tpcNSigmaPi()); + registry.fill(HIST("Data/hTPCnSigProng1Kaon_GapA"), track1.p(), track1.tpcNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng0Pion_GapA"), track0.p(), track0.tofNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng1Kaon_GapA"), track1.p(), track1.tofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng0Pion_GapA"), track0.p(), track0.tpcTofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng1Kaon_GapA"), track1.p(), track1.tpcTofNSigmaKa()); + } + + if (gap == 0 && candidate.isSelD0bar() >= selectionFlagD0) { // A side // D0-bar --> K+Pi- + registry.fill(HIST("Data/hTPCnSigProng0Kaon_GapA"), track0.p(), track0.tpcNSigmaKa()); + registry.fill(HIST("Data/hTPCnSigProng1Pion_GapA"), track1.p(), track1.tpcNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng0Kaon_GapA"), track0.p(), track0.tofNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng1Pion_GapA"), track1.p(), track1.tofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng0Kaon_GapA"), track0.p(), track0.tpcTofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng1Pion_GapA"), track1.p(), track1.tpcTofNSigmaPi()); + } + + if (gap == 1 && candidate.isSelD0() >= selectionFlagD0) { // C side // D0 --> K-Pi+ + registry.fill(HIST("Data/hTPCnSigProng0Pion_GapC"), track0.p(), track0.tpcNSigmaPi()); + registry.fill(HIST("Data/hTPCnSigProng1Kaon_GapC"), track1.p(), track1.tpcNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng0Pion_GapC"), track0.p(), track0.tofNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng1Kaon_GapC"), track1.p(), track1.tofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng0Pion_GapC"), track0.p(), track0.tpcTofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng1Kaon_GapC"), track1.p(), track1.tpcTofNSigmaKa()); + } + + if (gap == 1 && candidate.isSelD0bar() >= selectionFlagD0) { // C side // D0-bar --> K+Pi- + registry.fill(HIST("Data/hTPCnSigProng0Kaon_GapC"), track0.p(), track0.tpcNSigmaKa()); + registry.fill(HIST("Data/hTPCnSigProng1Pion_GapC"), track1.p(), track1.tpcNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng0Kaon_GapC"), track0.p(), track0.tofNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng1Pion_GapC"), track1.p(), track1.tofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng0Kaon_GapC"), track0.p(), track0.tpcTofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng1Pion_GapC"), track1.p(), track1.tpcTofNSigmaPi()); + } + if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hMass"), massD0, ptCandidate); registry.fill(HIST("hMassFinerBinning"), massD0, ptCandidate); @@ -654,11 +745,13 @@ struct HfTaskD0 { // Fill THnSparse with structure matching histogram axes: [mass, pt, (mlScores if FillMl), rapidity, d0Type, (cent if storeCentrality), (occ, ir if storeOccupancyAndIR), gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC] auto fillTHnData = [&](float mass, int d0Type) { // Pre-calculate vector size to avoid reallocations - constexpr int NAxesBase = 13; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr + constexpr int NAxesBase = 11; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr constexpr int NAxesMl = FillMl ? 3 : 0; // 3 ML scores if FillMl int const nAxesCent = storeCentrality ? 1 : 0; // centrality if storeCentrality int const nAxesOccIR = storeOccupancyAndIR ? 2 : 0; // occupancy and IR if storeOccupancyAndIR - int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR; + int const nAxesZdcEnergy = storeZdcEnergy ? 2 : 0; // ZDC energy if storeZdcEnergy + int const nAxesZdcTime = storeZdcTime ? 2 : 0; // ZDC time if storeZdctime + int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR + nAxesZdcEnergy + nAxesZdcTime; std::vector valuesToFill; valuesToFill.reserve(nAxesTotal); @@ -689,10 +782,15 @@ struct HfTaskD0 { valuesToFill.push_back(static_cast(fitInfo.ampFV0A)); valuesToFill.push_back(static_cast(fitInfo.ampFDDA)); valuesToFill.push_back(static_cast(fitInfo.ampFDDC)); - valuesToFill.push_back(static_cast(zdcEnergyZNA)); - valuesToFill.push_back(static_cast(zdcEnergyZNC)); valuesToFill.push_back(static_cast(numPvContributors)); - + if (storeZdcEnergy) { + valuesToFill.push_back(static_cast(zdcEnergyZNA)); + valuesToFill.push_back(static_cast(zdcEnergyZNC)); + } + if (storeZdcTime) { + valuesToFill.push_back(static_cast(zdcTimeZNA)); + valuesToFill.push_back(static_cast(zdcTimeZNC)); + } if constexpr (FillMl) { registry.get(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"))->Fill(valuesToFill.data()); } else { @@ -1181,9 +1279,11 @@ struct HfTaskD0 { aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, - aod::Zdcs const& /*zdcs*/) + TracksWPid const& tracks, + aod::Zdcs const& /*zdcs*/ + ) { - runAnalysisPerCollisionDataWithUpc(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds); + runAnalysisPerCollisionDataWithUpc(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds, tracks); } PROCESS_SWITCH(HfTaskD0, processDataWithDCAFitterNWithUpc, "Process real data with DCAFitterN w/o ML with UPC", false); @@ -1194,9 +1294,10 @@ struct HfTaskD0 { aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, + TracksWPid const& tracks, aod::Zdcs const& /*zdcs*/) { - runAnalysisPerCollisionDataWithUpc(collisions, selectedD0CandidatesMl, bcs, ft0s, fv0as, fdds); + runAnalysisPerCollisionDataWithUpc(collisions, selectedD0CandidatesMl, bcs, ft0s, fv0as, fdds, tracks); } PROCESS_SWITCH(HfTaskD0, processDataWithDCAFitterNMlWithUpc, "Process real data with DCAFitterN and ML with UPC", false); }; From 517402f5263396ea681526c02ec8008a00adced0 Mon Sep 17 00:00:00 2001 From: Kegang Xiong Date: Sun, 29 Mar 2026 20:23:57 +0800 Subject: [PATCH 094/282] [PWGCF] Add some plots (#15563) Co-authored-by: kegangxiong --- PWGCF/Flow/Tasks/flowZdcEnergy.cxx | 40 +++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx index fb868177af1..87f129a6b8f 100644 --- a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx +++ b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx @@ -52,6 +52,7 @@ struct flowZdcEnergy { ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality (%)"}; ConfigurableAxis axisMult{"axisMult", {100, 0, 100000}, "Multiplicity"}; + ConfigurableAxis axisMultDivided{"axisMultDivided", {30, 0, 15000}, "Multiplicity bins for ZN energy"}; ConfigurableAxis axisPt{"axisPt", {100, 0, 15}, "#P_{t}"}; ConfigurableAxis axisEta{"axisEta", {64, -1.6, 1.6}, "#eta"}; ConfigurableAxis axisEnergy{"axisEnergy", {300, 0, 300}, "Energy"}; @@ -120,6 +121,21 @@ struct flowZdcEnergy { registry.add("hEnergyWithCent_ZNA_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisCent}}); registry.add("hEnergyWithCent_ZNC_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisCent}}); registry.add("hEnergyWithCent_RescaledSumDiff", "", {HistType::kTH2D, {axisRescaledDiff, axisCent}}); + + registry.add("hEnergyWithMult_ZNA_Common", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_Common", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_RescaledDiff", "", {HistType::kTH2D, {axisRescaledDiff, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_1", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_2", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_3", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_4", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_1", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_2", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_3", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_4", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_RescaledSumDiff", "", {HistType::kTH2D, {axisRescaledDiff, axisMultDivided}}); } // Helper: event selection @@ -128,9 +144,6 @@ struct flowZdcEnergy { { if (!UseEvsel) { registry.fill(HIST("QA/hEventCount"), kAllEvents); - registry.fill(HIST("QA/hEventCount"), kSeln); - registry.fill(HIST("QA/hEventCount"), kZvtx); - registry.fill(HIST("QA/hEventCount"), kCentrality); } else { registry.fill(HIST("QA/hEventCount"), kAllEvents); if (runmode == 2 && !collision.sel7()) { @@ -154,7 +167,7 @@ struct flowZdcEnergy { // Helper: fill ZDC observables template - void fillZDCObservables(TCollision const& collision, float centrality) + void fillZDCObservables(TCollision const& collision, float centrality, float multiTPC) { const auto& foundBC = collision.template foundBC_as(); if (!foundBC.has_zdc()) { @@ -198,11 +211,26 @@ struct flowZdcEnergy { registry.fill(HIST("hEnergyWithCent_ZNA_SumSectors"), sumEnergyZNA, centrality); registry.fill(HIST("hEnergyWithCent_ZNC_SumSectors"), sumEnergyZNC, centrality); + registry.fill(HIST("hEnergyWithMult_ZNA_Common"), energyCommonZNA, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_Common"), energyCommonZNC, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_1"), energySectorZNA1, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_2"), energySectorZNA2, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_3"), energySectorZNA3, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_4"), energySectorZNA4, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_1"), energySectorZNC1, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_2"), energySectorZNC2, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_3"), energySectorZNC3, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_4"), energySectorZNC4, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_SumSectors"), sumEnergyZNA, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_SumSectors"), sumEnergyZNC, multiTPC); + if (commonDen > 1.e-6f) { registry.fill(HIST("hEnergyWithCent_RescaledDiff"), (energyCommonZNA - energyCommonZNC) / commonDen, centrality); + registry.fill(HIST("hEnergyWithMult_RescaledDiff"), (energyCommonZNA - energyCommonZNC) / commonDen, multiTPC); } if (sumDen > 1.e-6f) { registry.fill(HIST("hEnergyWithCent_RescaledSumDiff"), (sumEnergyZNA - sumEnergyZNC) / sumDen, centrality); + registry.fill(HIST("hEnergyWithMult_RescaledSumDiff"), (sumEnergyZNA - sumEnergyZNC) / sumDen, multiTPC); } } @@ -222,7 +250,7 @@ struct flowZdcEnergy { registry.fill(HIST("QA/hCentrality"), centrality); registry.fill(HIST("QA/hMultiplicity"), multi); registry.fill(HIST("QA/hMultiplicity_TPC"), multiTPC); - fillZDCObservables(collision, centrality); + fillZDCObservables(collision, centrality, multiTPC); for (const auto& track : tracks) { registry.fill(HIST("QA/hPt"), track.pt()); @@ -246,7 +274,7 @@ struct flowZdcEnergy { registry.fill(HIST("QA/hCentrality"), centrality); registry.fill(HIST("QA/hMultiplicity"), multi); registry.fill(HIST("QA/hMultiplicity_TPC"), multiTPC); - fillZDCObservables(collision, centrality); + fillZDCObservables(collision, centrality, multiTPC); for (const auto& track : tracks) { registry.fill(HIST("QA/hPt"), track.pt()); From 7213b2f616a01518497cf9a881e9180609db3512 Mon Sep 17 00:00:00 2001 From: lcernusa Date: Mon, 30 Mar 2026 09:03:51 +0200 Subject: [PATCH 095/282] [PWGCF] Flow-decorrelation, added MC-true (#15566) --- .../Tasks/flowDecorrelation.cxx | 238 ++++++++++++++++-- 1 file changed, 221 insertions(+), 17 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx index 89bb63cc0cd..692a6583f5c 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx @@ -100,13 +100,24 @@ struct FlowDecorrelation { O2_DEFINE_CONFIGURABLE(cfgLocalEfficiency, bool, false, "Use local efficiency object") O2_DEFINE_CONFIGURABLE(cfgUseEventWeights, bool, false, "Use event weights for mixed event") O2_DEFINE_CONFIGURABLE(cfgDrawEtaPhiDis, bool, false, "draw eta-phi distribution for detectors in used") - O2_DEFINE_CONFIGURABLE(nClustersMftTrack, int, 5, "Minimum number of clusters for MFT track") - O2_DEFINE_CONFIGURABLE(cfgCutChi2Mft, float, -1.0f, "max chi2 of MFT track") - O2_DEFINE_CONFIGURABLE(cfgCutTrackTimeMft, float, -1.0f, "max deviation of MFT track wrt. bc in ns") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0AInside, bool, false, "Rejection of inner ring channels of the FT0A detector") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0AOutside, bool, false, "Rejection of outer ring channels of the FT0A detector") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector") + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(nClustersMftTrack, int, 5, "Minimum number of clusters for MFT track") + O2_DEFINE_CONFIGURABLE(cfgCutChi2Mft, float, -1.0f, "max chi2 of MFT track") + O2_DEFINE_CONFIGURABLE(cfgCutTrackTimeMft, float, -1.0f, "max deviation of MFT track wrt. bc in ns"); + } cfgMftCuts; + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(cfgRejectFT0AInside, bool, false, "Rejection of inner ring channels of the FT0A detector") + O2_DEFINE_CONFIGURABLE(cfgRejectFT0AOutside, bool, false, "Rejection of outer ring channels of the FT0A detector") + O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") + O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector"); + } cfgFt0RingRejections; + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(cfgEtaTpcCut, float, 0.8f, "Eta cut of TPC MC particles") + O2_DEFINE_CONFIGURABLE(cfgMinEtaFt0cCut, float, -3.4f, "Min eta cut of FT0C MC particles") + O2_DEFINE_CONFIGURABLE(cfgMaxEtaFt0cCut, float, -2.0f, "Max eta cut of FT0C MC particles") + O2_DEFINE_CONFIGURABLE(cfgUseFt0cStructure, bool, true, "Use the true structure of FT0C in MC-true"); + O2_DEFINE_CONFIGURABLE(cfgUseCFStepAll, bool, true, "Use CFStepAll in addition to primry"); + } cfgMcTrue; struct : ConfigurableGroup { O2_DEFINE_CONFIGURABLE(cfgMultCentHighCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 10.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); O2_DEFINE_CONFIGURABLE(cfgMultCentLowCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x - 3.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); @@ -147,8 +158,8 @@ struct FlowDecorrelation { ConfigurableAxis axisDeltaEtaTpcFt0c{"axisDeltaEtaTpcFt0c", {32, 1.2, 4.2}, "delta eta axis, 1.2~4.2 for TPC-FT0C"}; ConfigurableAxis axisDeltaEtaFt0aFt0c{"axisDeltaEtaFt0aFt0c", {32, 4.2, 8.2}, "delta eta axis, 4.2~8.2 for FT0A-FT0C"}; ConfigurableAxis axisDeltaEtaTpcMft{"axisDeltaEtaTpcMft", {32, 1.3, 4.8}, "delta eta axis, 1.3~4.8 for TPC-MFT"}; - ConfigurableAxis axisDeltaEtaTpcFv0{"axisDeltaEtaTpcFv0", {32, -1.2, -6.1}, "delta eta axis for TPC-FV0 histograms"}; - ConfigurableAxis axisEtaTrigger{"axisEtaTrigger", {VARIABLE_WIDTH, -3.3, -2.1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 3.5, 4.9}, "eta trigger axis for histograms"}; + ConfigurableAxis axisDeltaEtaTpcFv0{"axisDeltaEtaTpcFv0", {32, -6.1, -1.2}, "delta eta axis for TPC-FV0 histograms"}; + ConfigurableAxis axisEtaTrigger{"axisEtaTrigger", {VARIABLE_WIDTH, -3.4, -2.0, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 3.5, 4.9}, "eta trigger axis for histograms"}; ConfigurableAxis axisEtaAssoc{"axisEtaAssoc", {VARIABLE_WIDTH, -3.3, -2.1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 3.5, 4.9}, "eta associated axis for histograms"}; ConfigurableAxis axisVtxMix{"axisVtxMix", {VARIABLE_WIDTH, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, "vertex axis for mixed event histograms"}; ConfigurableAxis axisMultMix{"axisMultMix", {VARIABLE_WIDTH, 0, 10, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260}, "multiplicity / centrality axis for mixed event histograms"}; @@ -171,6 +182,17 @@ struct FlowDecorrelation { using FilteredCollisions = soa::Filtered>; using FilteredTracks = soa::Filtered>; + Filter particleFilter = (nabs(aod::mcparticle::eta) < cfgMcTrue.cfgEtaTpcCut || ((aod::mcparticle::eta > cfgMcTrue.cfgMinEtaFt0cCut) && (aod::mcparticle::eta < cfgMcTrue.cfgMaxEtaFt0cCut))) && (aod::mcparticle::pt > cfgCutPtMin) && (aod::mcparticle::pt < cfgCutPtMax); + using FilteredMcParticles = soa::Filtered; + + // Filter for MCcollisions + Filter mccollisionFilter = nabs(aod::mccollision::posZ) < cfgCutVtxZ; + using FilteredMcCollisions = soa::Filtered; + + using SmallGroupMcCollisions = soa::SmallGroups>; + + PresliceUnsorted collisionPerMCCollision = aod::mccollisionlabel::mcCollisionId; + // FT0 geometry o2::ft0::Geometry ft0Det; o2::fv0::Geometry* fv0Det{}; @@ -243,6 +265,7 @@ struct FlowDecorrelation { const AxisSpec axisPhi{72, 0.0, constants::math::TwoPI, "#varphi"}; const AxisSpec axisEta{40, -1., 1., "#eta"}; const AxisSpec axisEtaFull{90, -4., 5., "#eta"}; + const AxisSpec axisCentrality{20, 0., 100., "cent"}; ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -268,7 +291,23 @@ struct FlowDecorrelation { registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(12, "MultCorrelation"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(13, "cfgEvSelV0AT0ACut"); } - + if (doprocessMcSameTpcFt0c) { + registry.add("MCTrue/MCeventcount", "MCeventcount", {HistType::kTH1F, {{5, 0, 5, "bin"}}}); // histogram to see how many events are in the same and mixed event + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(2, "same all"); + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(3, "same reco"); + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(4, "mixed all"); + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(5, "mixed reco"); + registry.add("MCTrue/MCCentrality", "cent", {HistType::kTH1D, {axisCentrality}}); + registry.add("MCTrue/MCNch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); + registry.add("MCTrue/MCzVtx", "MCzVtx", {HistType::kTH1D, {axisVertex}}); + registry.add("MCTrue/MCPhi", "MCPhi", {HistType::kTH1D, {axisPhi}}); + registry.add("MCTrue/MCEta", "MCEta", {HistType::kTH1D, {axisEtaFull}}); + registry.add("MCTrue/MCEtaTrueShape", "MCEta", {HistType::kTH1D, {axisEtaFull}}); + registry.add("MCTrue/MCpT", "MCpT", {HistType::kTH1D, {axisPtEfficiency}}); + registry.add("MCTrue/MCTrig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtEfficiency}}}); + registry.add("MCTrue/MCdeltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); // check to see the delta eta and delta phi distribution + registry.add("MCTrue/MCdeltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); + } if (cfgEvSelMultCorrelation) { cfgFuncParas.multT0CCutPars = cfgFuncParas.cfgMultT0CCutPars; cfgFuncParas.multPVT0CCutPars = cfgFuncParas.cfgMultPVT0CCutPars; @@ -421,6 +460,10 @@ struct FlowDecorrelation { same.setObject(new CorrelationContainer("sameEvent_TPC_FV0", "sameEvent_TPC_FV0", corrAxisTpcFv0, effAxis, userAxis)); mixed.setObject(new CorrelationContainer("mixedEvent_TPC_FV0", "mixedEvent_TPC_FV0", corrAxisTpcFv0, effAxis, userAxis)); } + if (doprocessMcSameTpcFt0c) { + same.setObject(new CorrelationContainer("sameEvent_TPC_FV0", "sameEvent_TPC_FV0", corrAxisTpcFt0c, effAxis, userAxis)); + mixed.setObject(new CorrelationContainer("mixedEvent_TPC_FV0", "mixedEvent_TPC_FV0", corrAxisTpcFt0c, effAxis, userAxis)); + } LOGF(info, "End of init"); } @@ -428,13 +471,13 @@ struct FlowDecorrelation { bool isAcceptedMftTrack(TTrackAssoc const& mftTrack) { // cut on the number of clusters of the reconstructed MFT track - if (mftTrack.nClusters() < nClustersMftTrack) + if (mftTrack.nClusters() < cfgMftCuts.nClustersMftTrack) return false; - if (cfgCutChi2Mft > 0. && mftTrack.chi2() > cfgCutChi2Mft) + if (cfgMftCuts.cfgCutChi2Mft > 0. && mftTrack.chi2() > cfgMftCuts.cfgCutChi2Mft) return false; - if (cfgCutTrackTimeMft > 0. && std::abs(mftTrack.trackTime()) > cfgCutTrackTimeMft) + if (cfgMftCuts.cfgCutTrackTimeMft > 0. && std::abs(mftTrack.trackTime()) > cfgMftCuts.cfgCutTrackTimeMft) return false; return true; @@ -729,11 +772,11 @@ struct FlowDecorrelation { float ampl = 0.; getChannel(ft0, iCh, chanelid, ampl, corType); if (corType == kFT0C) { - if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) { continue; } } else if (corType == kFT0A) { - if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) { continue; } } @@ -786,7 +829,7 @@ struct FlowDecorrelation { int channelIdA = 0; float amplA = 0.f; getChannel(ft0Trig, iChA, channelIdA, amplA, kFT0A); - if ((cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax))) { continue; } @@ -801,7 +844,7 @@ struct FlowDecorrelation { int channelIdC = 0; float amplC = 0.f; getChannel(ft0Assoc, iChC, channelIdC, amplC, kFT0C); - if ((cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax))) { continue; } @@ -983,6 +1026,24 @@ struct FlowDecorrelation { return 1; } + bool ft0cCollisionCourse(float eta, float phi, float vtxZ) + { + double theta = 2 * std::atan(std::exp(-eta)); + double vx = std::sin(theta) * std::cos(phi); // veloctiy component along x + double vy = std::sin(theta) * std::sin(phi); // veloctiy component along y + double vz = std::cos(theta); // veloctiy component along z + + double x = vx * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex + double y = vy * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex + + if (std::abs(x) < 24 && (std::abs(y) > 6.825 && std::abs(y) < 18.25)) + return true; + else if (std::abs(y) < 24 && (std::abs(x) > 6.675 && std::abs(x) < 18.175)) + return true; + else + return false; + } + void processSameTpcFt0a(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) { if (!collision.sel8()) @@ -1558,6 +1619,149 @@ struct FlowDecorrelation { } } PROCESS_SWITCH(FlowDecorrelation, processMixedTpcFv0, "Process mixed events for TPC-FV0 correlation", false); + + template + void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + { + int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); + + float triggerWeight = 1.0f; + float associatedWeight = 1.0f; + // loop over all FT0C tracks + for (auto const& track1 : tracks1) { + + if (!cfgMcTrue.cfgUseFt0cStructure) { + if (std::abs(track1.eta()) < 0.9) + continue; + } else if (!ft0cCollisionCourse(track1.eta(), track1.phi(), posZ)) { + continue; + } + + if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track1.isPhysicalPrimary()) + continue; + + if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && system == SameEvent) + registry.fill(HIST("MCTrue/MCEtaTrueShape"), track1.eta()); + + if (system == SameEvent && doprocessMcSameTpcFt0c) + registry.fill(HIST("MCTrue/MCTrig_hist"), fSampleIndex, posZ, track1.pt(), eventWeight * triggerWeight); + + // loop over all TPC tracks + for (auto const& track2 : tracks2) { + + if (std::abs(track2.eta()) > 0.9) + continue; + + if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track2.isPhysicalPrimary()) + continue; + + if (track1.globalIndex() == track2.globalIndex()) + continue; // For pt-differential correlations, skip if the trigger and associate are the same track + + float deltaPhi = RecoDecay::constrainAngle(track2.phi() - track1.phi(), -PIHalf); + float deltaEta = track2.eta() - track1.eta(); + + // fill the right sparse and histograms + if (system == SameEvent) { + same->getPairHist()->Fill(step, fSampleIndex, posZ, track2.eta(), track1.eta(), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + registry.fill(HIST("MCTrue/MCdeltaEta_deltaPhi_same"), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + } else if (system == MixedEvent) { + mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track2.eta(), track1.eta(), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + registry.fill(HIST("MCTrue/MCdeltaEta_deltaPhi_mixed"), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + } + } + } + } + + void processMcSameTpcFt0c(FilteredMcCollisions::iterator const& mcCollision, FilteredMcParticles const& mcParticles, SmallGroupMcCollisions const& collisions) + { + float cent = -1; + if (!cfgCentTableUnavailable) { + for (const auto& collision : collisions) { + cent = getCentrality(collision); + } + } + + if (cfgSelCollByNch && (mcParticles.size() < cfgCutMultMin || mcParticles.size() >= cfgCutMultMax)) { + return; + } + if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax)) { + return; + } + + registry.fill(HIST("MCTrue/MCeventcount"), SameEvent); // because its same event i put it in the 1 bin + if (!cfgCentTableUnavailable) + registry.fill(HIST("MCTrue/MCCentrality"), cent); + registry.fill(HIST("MCTrue/MCNch"), mcParticles.size()); + registry.fill(HIST("MCTrue/MCzVtx"), mcCollision.posZ()); + for (const auto& mcParticle : mcParticles) { + if (mcParticle.isPhysicalPrimary()) { + registry.fill(HIST("MCTrue/MCPhi"), mcParticle.phi()); + registry.fill(HIST("MCTrue/MCEta"), mcParticle.eta()); + registry.fill(HIST("MCTrue/MCpT"), mcParticle.pt()); + } + } + if (cfgMcTrue.cfgUseCFStepAll) { + same->fillEvent(mcParticles.size(), CorrelationContainer::kCFStepAll); + fillMCCorrelations(mcParticles, mcParticles, mcCollision.posZ(), SameEvent, 1.0f); + } + + registry.fill(HIST("MCTrue/MCeventcount"), 2.5); + same->fillEvent(mcParticles.size(), CorrelationContainer::kCFStepTrackedOnlyPrim); + fillMCCorrelations(mcParticles, mcParticles, mcCollision.posZ(), SameEvent, 1.0f); + } + PROCESS_SWITCH(FlowDecorrelation, processMcSameTpcFt0c, "Process MC same event", false); + + void processMcMixed(FilteredMcCollisions const& mcCollisions, FilteredMcParticles const& mcParticles, SmallGroupMcCollisions const& collisions) + { + auto getTracksSize = [&mcParticles, this](FilteredMcCollisions::iterator const& mcCollision) { + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), this->cache); + auto mult = associatedTracks.size(); + return mult; + }; + + using MixedBinning = FlexibleBinningPolicy, o2::aod::mccollision::PosZ, decltype(getTracksSize)>; + + MixedBinning binningOnVtxAndMult{{getTracksSize}, {axisVtxMix, axisMultMix}, true}; + + auto tracksTuple = std::make_tuple(mcParticles, mcParticles); + Pair pairs{binningOnVtxAndMult, cfgMixEventNumMin, -1, mcCollisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + for (auto it = pairs.begin(); it != pairs.end(); it++) { + auto& [collision1, tracks1, collision2, tracks2] = *it; + + if (cfgSelCollByNch && (tracks1.size() < cfgCutMultMin || tracks1.size() >= cfgCutMultMax)) + continue; + + if (cfgSelCollByNch && (tracks2.size() < cfgCutMultMin || tracks2.size() >= cfgCutMultMax)) + continue; + + auto groupedCollisions = collisions.sliceBy(collisionPerMCCollision, collision1.globalIndex()); + + float cent = -1; + if (!cfgCentTableUnavailable) { + for (const auto& collision : groupedCollisions) { + cent = getCentrality(collision); + } + } + + if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax)) + continue; + + registry.fill(HIST("MCTrue/MCeventcount"), MixedEvent); // fill the mixed event in the 3 bin + float eventWeight = 1.0f; + if (cfgUseEventWeights) { + eventWeight = 1.0f / it.currentWindowNeighbours(); + } + + if (cfgMcTrue.cfgUseCFStepAll) { + fillMCCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent, eventWeight); + } + + registry.fill(HIST("MCTrue/MCeventcount"), 4.5); + fillMCCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent, eventWeight); + } + } + PROCESS_SWITCH(FlowDecorrelation, processMcMixed, "Process MC mixed events", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 43850958202ce01f23d8625c813332b159c043af Mon Sep 17 00:00:00 2001 From: jaimenorman Date: Mon, 30 Mar 2026 09:27:48 +0100 Subject: [PATCH 096/282] [PWGJE] add occupancy cut and PbPb checks (#15564) --- PWGJE/Tasks/jetHadronRecoil.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index 39fc652ae82..0cfbcd2ea8d 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -70,6 +70,7 @@ struct JetHadronRecoil { Configurable centralityMin{"centralityMin", -999.0, "minimum centrality"}; Configurable centralityMax{"centralityMax", 999.0, "maximum centrality"}; Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; + Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum track occupancy in time range"}; 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"}; @@ -93,7 +94,7 @@ struct JetHadronRecoil { Filter jetCuts = aod::jet::r == nround(jetR.node() * 100.0f); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); Filter particleCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta > trackEtaMin && aod::jmcparticle::eta < trackEtaMax); - Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax); + Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax && aod::jcollision::trackOccupancyInTimeRange < trackOccupancyInTimeRangeMax); std::vector ptBinningPart = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, @@ -147,8 +148,11 @@ struct JetHadronRecoil { jetReclusterer.recombScheme = fastjet::WTA_pt_scheme; registry.add("hZvtxSelected", "Z vertex position;Z_{vtx};entries", {HistType::kTH1F, {{80, -20, 20}}}, doSumw); + registry.add("hCentOccupancy", "centrality vs track occupancy;centrality (%);track occupancy", {HistType::kTH2F, {{100, 0, 100}, {200, 0, 10000}}}, doSumw); + registry.add("hCentRho", "centrality vs rho;centrality (%);#rho", {HistType::kTH2F, {{100, 0, 100}, {125, 0, 250}}}, doSumw); if (doprocessData || doprocessDataWithRhoSubtraction || doprocessMCD || doprocessMCDWithRhoSubtraction || doprocessMCDWeighted || doprocessMCDWeightedWithRhoSubtraction || doprocessMCP || doprocessMCPWeighted || doprocessMCPOnTheFly || doprocessMCPOnTheFlyWeighted) { + registry.add("hNtracksRho", "track multiplicity vs #rho;N_{tracks};#rho", {HistType::kTH2F, {{125, 0, 5000}, {125, 0, 250}}}, doSumw); registry.add("hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}, doSumw); registry.add("hSignalTriggersPtHard", "Signal triggers vs PtHard", {HistType::kTH1F, {pThatAxis}}, doSumw); registry.add("hReferenceTriggersPtHard", "Reference triggers vs PtHard", {HistType::kTH1F, {pThatAxis}}, doSumw); @@ -168,6 +172,7 @@ struct JetHadronRecoil { registry.add("hJetEta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}, doSumw); registry.add("hJetPhi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{100, 0.0, o2::constants::math::TwoPI}}}, doSumw); registry.add("hJet3D", "3D jet distribution;p_{T};#eta;#phi", {HistType::kTH3F, {{500, -100, 400}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}}, doSumw); + registry.add("hJetPtArea", "jet p_{T}vs area;jet p_{T};A_{jet}", {HistType::kTH2F, {{500, -100, 400}, {100, 0, 2}}}, doSumw); } if (doprocessData || doprocessDataWithRhoSubtraction || doprocessMCD || doprocessMCDWithRhoSubtraction || doprocessMCDWeighted || doprocessMCDWeightedWithRhoSubtraction) { @@ -253,6 +258,7 @@ struct JetHadronRecoil { double phiTT = 0; double ptTT = 0; int nTT = 0; + int nTracks = 0; double leadingPT = 0; double leadingTrackPt = 0; double leadingJetPt = 0; @@ -295,7 +301,9 @@ struct JetHadronRecoil { registry.fill(HIST("hPhiTrack"), track.phi(), weight); registry.fill(HIST("hTrack3D"), track.pt(), track.eta(), track.phi(), weight); registry.fill(HIST("hPtTrackPtHard"), track.pt() / pTHat, track.pt(), weight); + nTracks++; } + registry.fill(HIST("hNtracksRho"), nTracks, rho); if (nTT > 0) { int trigNumber = rand->Integer(nTT); phiTT = phiTTAr[trigNumber]; @@ -340,6 +348,7 @@ struct JetHadronRecoil { registry.fill(HIST("hJetEta"), jet.eta(), weight); registry.fill(HIST("hJetPhi"), jet.phi(), weight); registry.fill(HIST("hJet3D"), jet.pt() - (rho * jet.area()), jet.eta(), jet.phi(), weight); + registry.fill(HIST("hJetPtArea"), jet.pt(), jet.area(), weight); if (nTT > 0) { float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT); @@ -388,6 +397,7 @@ struct JetHadronRecoil { double phiTT = 0; double ptTT = 0; int nTT = 0; + int nTracks = 0; double leadingPT = 0; double leadingTrackPt = 0; double leadingJetPt = 0; @@ -430,7 +440,9 @@ struct JetHadronRecoil { registry.fill(HIST("hPhiTrack"), track.phi(), weight); registry.fill(HIST("hTrack3D"), track.pt(), track.eta(), track.phi(), weight); registry.fill(HIST("hPtTrackPtHard"), track.pt() / pTHat, track.pt(), weight); + nTracks++; } + registry.fill(HIST("hNtracksRho"), nTracks, rho); if (nTT > 0) { int trigNumber = rand->Integer(nTT); phiTT = phiTTAr[trigNumber]; @@ -641,7 +653,6 @@ struct JetHadronRecoil { const auto jetsTagColl = jetsTag.sliceBy(perColJetMC, collisionID); for (const auto& jetTag : jetsTagColl) { - if (jetTag.pt() > pTHatMaxMCP * pTHat) { if (outlierRejectEvent) { return; @@ -859,6 +870,8 @@ struct JetHadronRecoil { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); + registry.fill(HIST("hCentOccupancy"), collision.centFT0M(), collision.trackOccupancyInTimeRange()); + registry.fill(HIST("hCentRho"), collision.centFT0M(), collision.rho()); fillHistograms(jets, tracks, 1.0, collision.rho()); } PROCESS_SWITCH(JetHadronRecoil, processDataWithRhoSubtraction, "process data with rho subtraction", false); @@ -903,6 +916,8 @@ struct JetHadronRecoil { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); + registry.fill(HIST("hCentOccupancy"), collision.centFT0M(), collision.trackOccupancyInTimeRange()); + registry.fill(HIST("hCentRho"), collision.centFT0M(), collision.rho()); fillHistogramsMCD(jets, tracks, 1.0, collision.rho(), collision.mcCollision().ptHard()); } PROCESS_SWITCH(JetHadronRecoil, processMCDWithRhoSubtraction, "process MC detector level with rho subtraction", false); @@ -947,6 +962,8 @@ struct JetHadronRecoil { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.mcCollision().weight()); + registry.fill(HIST("hCentOccupancy"), collision.centFT0M(), collision.trackOccupancyInTimeRange(), collision.mcCollision().weight()); + registry.fill(HIST("hCentRho"), collision.centFT0M(), collision.rho()); fillHistogramsMCD(jets, tracks, collision.mcCollision().weight(), collision.rho(), collision.mcCollision().ptHard()); } PROCESS_SWITCH(JetHadronRecoil, processMCDWeightedWithRhoSubtraction, "process MC detector level with event weights and rho subtraction", false); From 06c6c2c58ca5e031f2993d92474136ebeb67469d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Mon, 30 Mar 2026 11:58:34 +0200 Subject: [PATCH 097/282] [PWGDQ] Fix includes and using statements (#15384) --- PWGDQ/Core/AnalysisCompositeCut.cxx | 6 ++ PWGDQ/Core/AnalysisCompositeCut.h | 10 ++- PWGDQ/Core/AnalysisCut.cxx | 4 + PWGDQ/Core/AnalysisCut.h | 10 ++- PWGDQ/Core/CutsLibrary.cxx | 15 +++- PWGDQ/Core/CutsLibrary.h | 7 +- PWGDQ/Core/DQMlResponse.h | 7 +- PWGDQ/Core/HistogramManager.cxx | 35 +++++--- PWGDQ/Core/HistogramManager.h | 25 +++--- PWGDQ/Core/HistogramsLibrary.cxx | 18 +++- PWGDQ/Core/HistogramsLibrary.h | 6 +- PWGDQ/Core/MCProng.cxx | 10 ++- PWGDQ/Core/MCProng.h | 9 +- PWGDQ/Core/MCSignal.cxx | 13 ++- PWGDQ/Core/MCSignal.h | 5 +- PWGDQ/Core/MCSignalLibrary.cxx | 20 +++-- PWGDQ/Core/MCSignalLibrary.h | 3 - PWGDQ/Core/MixingHandler.cxx | 15 ++-- PWGDQ/Core/MixingHandler.h | 7 +- PWGDQ/Core/MixingLibrary.cxx | 10 +++ PWGDQ/Core/MixingLibrary.h | 5 -- PWGDQ/Core/MuonMatchingMlResponse.h | 4 +- PWGDQ/Core/VarManager.cxx | 28 ++++++- PWGDQ/Core/VarManager.h | 72 ++++++++-------- PWGDQ/DataModel/MchTrkEffTables.h | 4 +- PWGDQ/DataModel/ReducedInfoTables.h | 49 ++++++----- PWGDQ/DataModel/ReducedTablesAlice3.h | 8 +- PWGDQ/Macros/dqFlowAccWeights.C | 24 +++--- PWGDQ/Macros/evalMchTrackingEfficiency.cxx | 23 ++--- PWGDQ/Macros/fit_library/CB2Pdf.cxx | 14 ++-- PWGDQ/Macros/fit_library/CB2Pdf.h | 18 ++-- PWGDQ/Macros/fit_library/ExpPdf.cxx | 13 +-- PWGDQ/Macros/fit_library/ExpPdf.h | 18 ++-- PWGDQ/Macros/fit_library/GausPdf.cxx | 13 +-- PWGDQ/Macros/fit_library/GausPdf.h | 18 ++-- PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx | 13 +-- PWGDQ/Macros/fit_library/Pol4ExpPdf.h | 19 +++-- PWGDQ/Macros/fit_library/VWGPdf.cxx | 13 +-- PWGDQ/Macros/fit_library/VWGPdf.h | 18 ++-- PWGDQ/TableProducer/generatedQuarkoniaMC.cxx | 57 ++++++------- PWGDQ/TableProducer/tableMaker.cxx | 65 +++++++------- PWGDQ/TableProducer/tableMakerJpsiHf.cxx | 25 ++++-- PWGDQ/TableProducer/tableMakerMC.cxx | 41 +++++---- .../TableProducer/tableMakerMC_withAssoc.cxx | 45 ++++++---- .../tableMakerMuonMchTrkEfficiency.cxx | 51 +++++------ PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 84 +++++++++++-------- PWGDQ/Tasks/DalitzSelection.cxx | 32 ++++--- PWGDQ/Tasks/MIDefficiency.cxx | 34 ++++---- PWGDQ/Tasks/ModelConverterEventExtended.cxx | 14 +--- PWGDQ/Tasks/ModelConverterMultPv.cxx | 15 ++-- PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx | 14 +--- PWGDQ/Tasks/TagAndProbe.cxx | 50 ++++------- PWGDQ/Tasks/dqCorrelation.cxx | 51 +++++------ PWGDQ/Tasks/dqEfficiency.cxx | 25 +++--- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 42 ++++++---- PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx | 45 ++++++---- PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx | 45 +++++----- PWGDQ/Tasks/dqFlow.cxx | 68 ++++++++------- PWGDQ/Tasks/filterPP.cxx | 24 +++--- PWGDQ/Tasks/filterPPwithAssociation.cxx | 34 ++++---- PWGDQ/Tasks/filterPbPb.cxx | 22 +++-- PWGDQ/Tasks/mchAlignRecord.cxx | 83 ++++++++---------- PWGDQ/Tasks/mftMchMatcher.cxx | 50 ++++++----- PWGDQ/Tasks/muonDCA.cxx | 25 ++++-- PWGDQ/Tasks/muonGlobalAlignment.cxx | 54 ++++++++++-- PWGDQ/Tasks/qaMatching.cxx | 65 +++++++++++--- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 58 ++++++------- PWGDQ/Tasks/tableReader.cxx | 45 +++++----- PWGDQ/Tasks/tableReader_withAssoc.cxx | 53 +++++++----- PWGDQ/Tasks/tableReader_withAssoc_direct.cxx | 50 ++++++----- PWGDQ/Tasks/taskFwdTrackPid.cxx | 36 +++----- PWGDQ/Tasks/taskJpsiHf.cxx | 24 ++++-- PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx | 16 +++- PWGDQ/Tasks/v0selector.cxx | 41 +++++---- 74 files changed, 1195 insertions(+), 897 deletions(-) mode change 100755 => 100644 PWGDQ/Macros/fit_library/ExpPdf.cxx mode change 100755 => 100644 PWGDQ/Macros/fit_library/ExpPdf.h mode change 100755 => 100644 PWGDQ/Macros/fit_library/GausPdf.cxx mode change 100755 => 100644 PWGDQ/Macros/fit_library/GausPdf.h mode change 100755 => 100644 PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx mode change 100755 => 100644 PWGDQ/Macros/fit_library/Pol4ExpPdf.h diff --git a/PWGDQ/Core/AnalysisCompositeCut.cxx b/PWGDQ/Core/AnalysisCompositeCut.cxx index 5ab08001953..cbf0f328283 100644 --- a/PWGDQ/Core/AnalysisCompositeCut.cxx +++ b/PWGDQ/Core/AnalysisCompositeCut.cxx @@ -11,6 +11,12 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "AnalysisCut.h" + +#include + +#include + ClassImp(AnalysisCompositeCut) //____________________________________________________________________________ diff --git a/PWGDQ/Core/AnalysisCompositeCut.h b/PWGDQ/Core/AnalysisCompositeCut.h index f3d603909c4..a6b3f6afda4 100644 --- a/PWGDQ/Core/AnalysisCompositeCut.h +++ b/PWGDQ/Core/AnalysisCompositeCut.h @@ -14,10 +14,14 @@ // Cut class manipulating groups of cuts // -#ifndef AnalysisCompositeCut_H -#define AnalysisCompositeCut_H +#ifndef PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ +#define PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ #include "PWGDQ/Core/AnalysisCut.h" + +#include +#include + #include //_________________________________________________________________________ @@ -52,4 +56,4 @@ class AnalysisCompositeCut : public AnalysisCut ClassDef(AnalysisCompositeCut, 2); }; -#endif +#endif // PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ diff --git a/PWGDQ/Core/AnalysisCut.cxx b/PWGDQ/Core/AnalysisCut.cxx index ecb1ace04e6..a1dae4ce6b0 100644 --- a/PWGDQ/Core/AnalysisCut.cxx +++ b/PWGDQ/Core/AnalysisCut.cxx @@ -11,6 +11,10 @@ #include "PWGDQ/Core/AnalysisCut.h" +#include + +#include + #include #include diff --git a/PWGDQ/Core/AnalysisCut.h b/PWGDQ/Core/AnalysisCut.h index 6c7185b13ec..16f2916fe93 100644 --- a/PWGDQ/Core/AnalysisCut.h +++ b/PWGDQ/Core/AnalysisCut.h @@ -14,10 +14,14 @@ // Class for analysis cuts applied on the variables defined in the VarManager // -#ifndef AnalysisCut_H -#define AnalysisCut_H +#ifndef PWGDQ_CORE_ANALYSISCUT_H_ +#define PWGDQ_CORE_ANALYSISCUT_H_ #include +#include + +#include + #include //_________________________________________________________________________ @@ -176,4 +180,4 @@ inline bool AnalysisCut::IsSelected(float* values) return true; } -#endif +#endif // PWGDQ_CORE_ANALYSISCUT_H_ diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index cb9c124d418..09bb472266b 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -14,20 +14,27 @@ #include "PWGDQ/Core/CutsLibrary.h" #include "AnalysisCompositeCut.h" +#include "AnalysisCut.h" #include "VarManager.h" +#include +#include + #include +#include + +#include +#include #include +#include #include -#include +#include #include +#include #include -using std::cout; -using std::endl; - AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) { // diff --git a/PWGDQ/Core/CutsLibrary.h b/PWGDQ/Core/CutsLibrary.h index b38577f3c2b..51508c3a929 100644 --- a/PWGDQ/Core/CutsLibrary.h +++ b/PWGDQ/Core/CutsLibrary.h @@ -17,9 +17,12 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/VarManager.h" + +#include #include +#include +#include #include // /////////////////////////////////////////////// @@ -98,8 +101,6 @@ // End of Cuts for CEFP // // /////////////////////////////////////////////// -#include "rapidjson/document.h" - namespace o2::aod { namespace dqcuts diff --git a/PWGDQ/Core/DQMlResponse.h b/PWGDQ/Core/DQMlResponse.h index 64bfe233cc7..9b72e1257b7 100644 --- a/PWGDQ/Core/DQMlResponse.h +++ b/PWGDQ/Core/DQMlResponse.h @@ -17,11 +17,16 @@ #ifndef PWGDQ_CORE_DQMLRESPONSE_H_ #define PWGDQ_CORE_DQMLRESPONSE_H_ +#include "PWGDQ/Core/VarManager.h" + #include "Tools/ML/MlResponse.h" +#include + +#include #include #include -#include +#include #include namespace o2::analysis diff --git a/PWGDQ/Core/HistogramManager.cxx b/PWGDQ/Core/HistogramManager.cxx index 4882b7d84f5..ae1c4be3022 100644 --- a/PWGDQ/Core/HistogramManager.cxx +++ b/PWGDQ/Core/HistogramManager.cxx @@ -11,28 +11,37 @@ #include "PWGDQ/Core/HistogramManager.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include -#include -#include #include +#include #include -#include -#include "Framework/Logger.h" using namespace std; -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include +#include +#include +#include +#include +#include ClassImp(HistogramManager); diff --git a/PWGDQ/Core/HistogramManager.h b/PWGDQ/Core/HistogramManager.h index 4b1393b2eb7..94aa3ecec00 100644 --- a/PWGDQ/Core/HistogramManager.h +++ b/PWGDQ/Core/HistogramManager.h @@ -17,17 +17,20 @@ #ifndef PWGDQ_CORE_HISTOGRAMMANAGER_H_ #define PWGDQ_CORE_HISTOGRAMMANAGER_H_ -#include -#include -#include -#include -#include #include +#include +#include +#include +#include -#include +#include +#include + +#include +#include #include +#include #include -#include class HistogramManager : public TNamed { @@ -103,10 +106,10 @@ class HistogramManager : public TNamed std::map>> fVariablesMap; //! map holding identifiers for all variables needed by histograms // various - bool fUseDefaultVariableNames; //! toggle the usage of default variable names and units - uint64_t fBinsAllocated; //! number of allocated bins - TString* fVariableNames; //! variable names - TString* fVariableUnits; //! variable units + bool fUseDefaultVariableNames; //! toggle the usage of default variable names and units + uint64_t fBinsAllocated; //! number of allocated bins + TString* fVariableNames; //! variable names + TString* fVariableUnits; //! variable units void MakeAxisLabels(TAxis* ax, const char* labels); diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 9d12b892322..e198ea2d7af 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,11 +13,25 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" +#include "HistogramManager.h" #include "VarManager.h" -#include "CommonConstants/MathConstants.h" +#include +#include + +#include +#include +#include + +#include +#include + +#include #include +#include +#include +#include #include void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) @@ -2537,7 +2551,7 @@ void o2::aod::dqhistograms::AddHistogramsFromJSON(HistogramManager* hm, const ch str += json[i]; } } - LOG(fatal) << "**** Parsing error is somewhere here: " << str.Data() << endl; + LOG(fatal) << "**** Parsing error is somewhere here: " << str.Data() << std::endl; return; } diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 869fb3a85f3..99530b1cb6f 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -15,11 +15,7 @@ #ifndef PWGDQ_CORE_HISTOGRAMSLIBRARY_H_ #define PWGDQ_CORE_HISTOGRAMSLIBRARY_H_ -#include #include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/VarManager.h" -#include "CommonConstants/MathConstants.h" -#include "rapidjson/document.h" namespace o2::aod { @@ -29,7 +25,7 @@ void DefineHistograms(HistogramManager* hm, const char* histClass, const char* g template bool ValidateJSONHistogram(T hist); void AddHistogramsFromJSON(HistogramManager* hm, const char* json); -} +} // namespace dqhistograms } // namespace o2::aod #endif // PWGDQ_CORE_HISTOGRAMSLIBRARY_H_ diff --git a/PWGDQ/Core/MCProng.cxx b/PWGDQ/Core/MCProng.cxx index f2fffa9ba55..1e50a10fce2 100644 --- a/PWGDQ/Core/MCProng.cxx +++ b/PWGDQ/Core/MCProng.cxx @@ -11,10 +11,16 @@ #include "PWGDQ/Core/MCProng.h" -#include -#include +#include + +#include + #include +#include +#include #include +#include +#include ClassImp(MCProng); diff --git a/PWGDQ/Core/MCProng.h b/PWGDQ/Core/MCProng.h index cd42965d271..4677a995bc7 100644 --- a/PWGDQ/Core/MCProng.h +++ b/PWGDQ/Core/MCProng.h @@ -57,12 +57,13 @@ A few non-existent PYTHIA codes are used to select more than one PYTHIA code. #ifndef PWGDQ_CORE_MCPRONG_H_ #define PWGDQ_CORE_MCPRONG_H_ -#include "TNamed.h" -#include "TString.h" +#include -#include -#include +#include + +#include #include +#include class MCProng { diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index 7a234b65088..cb05a02b02c 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -9,11 +9,18 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include - #include "PWGDQ/Core/MCSignal.h" +#include "MCProng.h" + +#include + +#include + +#include +#include +#include + using std::cout; using std::endl; diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index 42fe0a0a050..f13f9657fbd 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -57,10 +57,11 @@ process(aod::McParticles const& mcTracks) { #define PWGDQ_CORE_MCSIGNAL_H_ #include "MCProng.h" -#include "TNamed.h" +#include + +#include #include -#include class MCSignal : public TNamed { diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index c1c2380c3a4..0bc89619d35 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -11,16 +11,24 @@ // // Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no // -#include -#include -// #include - #include "PWGDQ/Core/MCSignalLibrary.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/Logger.h" +#include "MCProng.h" +#include "MCSignal.h" + +#include +#include #include +#include + +#include +#include + +#include +#include +#include +#include using namespace o2::constants::physics; // using std::cout; diff --git a/PWGDQ/Core/MCSignalLibrary.h b/PWGDQ/Core/MCSignalLibrary.h index f244c7cbbfc..5b34271a574 100644 --- a/PWGDQ/Core/MCSignalLibrary.h +++ b/PWGDQ/Core/MCSignalLibrary.h @@ -18,9 +18,6 @@ #include "PWGDQ/Core/MCProng.h" #include "PWGDQ/Core/MCSignal.h" -#include "rapidjson/document.h" - -#include #include namespace o2::aod diff --git a/PWGDQ/Core/MixingHandler.cxx b/PWGDQ/Core/MixingHandler.cxx index 532b91ea9ac..5fd601f67d0 100644 --- a/PWGDQ/Core/MixingHandler.cxx +++ b/PWGDQ/Core/MixingHandler.cxx @@ -10,15 +10,18 @@ // or submit itself to any jurisdiction. #include "PWGDQ/Core/MixingHandler.h" + #include "PWGDQ/Core/VarManager.h" -#include -#include -using namespace std; +#include +#include +#include -#include -#include -#include +#include +#include + +#include +using namespace std; ClassImp(MixingHandler); diff --git a/PWGDQ/Core/MixingHandler.h b/PWGDQ/Core/MixingHandler.h index 12b4b4dcc1a..f73d5632895 100644 --- a/PWGDQ/Core/MixingHandler.h +++ b/PWGDQ/Core/MixingHandler.h @@ -17,15 +17,12 @@ #ifndef PWGDQ_CORE_MIXINGHANDLER_H_ #define PWGDQ_CORE_MIXINGHANDLER_H_ -#include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" #include -#include -#include -#include #include -#include + +#include #include diff --git a/PWGDQ/Core/MixingLibrary.cxx b/PWGDQ/Core/MixingLibrary.cxx index 90fd639464a..28e453b5479 100644 --- a/PWGDQ/Core/MixingLibrary.cxx +++ b/PWGDQ/Core/MixingLibrary.cxx @@ -13,6 +13,16 @@ // #include "PWGDQ/Core/MixingLibrary.h" +#include "PWGDQ/Core/MixingHandler.h" +#include "PWGDQ/Core/VarManager.h" + +#include + +#include + +#include +#include + #include #include diff --git a/PWGDQ/Core/MixingLibrary.h b/PWGDQ/Core/MixingLibrary.h index c6de5b9ecd3..2372c735cff 100644 --- a/PWGDQ/Core/MixingLibrary.h +++ b/PWGDQ/Core/MixingLibrary.h @@ -16,11 +16,6 @@ #define PWGDQ_CORE_MIXINGLIBRARY_H_ #include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/VarManager.h" - -#include - -#include "rapidjson/document.h" namespace o2::aod { diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h index 236a4f48329..ee2f419a5f5 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -18,7 +18,9 @@ #include "Tools/ML/MlResponse.h" -#include +#include + +#include #include #include diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index ac2902c0f3a..bbe9f08f28b 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -8,17 +8,39 @@ // 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 "PWGDQ/Core/VarManager.h" #include "Tools/KFparticle/KFUtilities.h" +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include + +#include + +#include +#include + #include -#include +#include +#include #include +#include +#include #include -using std::cout; -using std::endl; using namespace o2::constants::physics; ClassImp(VarManager); diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index fa0f694d227..594317a5cd4 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -22,38 +22,45 @@ #endif #include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/Core/UPCHelpers.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/EventPlaneHelper.h" -#include "Common/Core/PID/PIDTOFParamService.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/Core/trackUtilities.h" #include +#include #include #include #include +#include +#include +#include #include -#include #include #include +#include #include +#include #include +#include #include #include +#include #include #include +#include +#include #include -#include -#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include -#include -#include -#include -#include +#include +#include #include #include #include @@ -61,22 +68,21 @@ #include #include #include -#include -#include -#include +#include +#include +#include + +#include #include #include #include -#include #include #include #include #include -using std::complex; -using std::cout; -using std::endl; +#include using SMatrix55 = ROOT::Math::SMatrix>; using SMatrix5 = ROOT::Math::SVector; @@ -2772,10 +2778,10 @@ void VarManager::FillTrack(T const& track, float* values) if (fgUsedVars[kM11REFoverMpsingle]) { float m = o2::constants::physics::MassMuon; ROOT::Math::PtEtaPhiMVector v(track.pt(), track.eta(), track.phi(), m); - complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex Q42(values[kQ42XA], values[kQ42YA]); - complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(TMath::Cos(2 * v.Phi()), TMath::Sin(2 * v.Phi())); + std::complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex Q42(values[kQ42XA], values[kQ42YA]); + std::complex Q23(values[kQ23XA], values[kQ23YA]); + std::complex P2(TMath::Cos(2 * v.Phi()), TMath::Sin(2 * v.Phi())); values[kM11REFoverMpsingle] = values[kMultSingleMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM11REF] / values[kMultSingleMuons] : 0; values[kM1111REFoverMpsingle] = values[kMultSingleMuons] > 0 && !(std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) || std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF])) ? values[kM1111REF] / values[kMultSingleMuons] : 0; values[kCORR2REFbysinglemu] = std::isnan(values[kM11REFoverMpsingle]) || std::isinf(values[kM11REFoverMpsingle]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REFoverMpsingle]) || std::isinf(values[kM1111REFoverMpsingle]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR2REF]; @@ -4032,10 +4038,10 @@ void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values) values[kWV24ME] = (std::isnan(V22ME) || std::isinf(V22ME) || std::isnan(V24ME) || std::isinf(V24ME)) ? 0. : 1.0; if constexpr ((fillMap & ReducedEventQvectorExtra) > 0) { - complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex Q42(values[kQ42XA], values[kQ42YA]); - complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); + std::complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex Q42(values[kQ42XA], values[kQ42YA]); + std::complex Q23(values[kQ23XA], values[kQ23YA]); + std::complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); values[kM01POIME] = values[kMultDimuonsME] * values[kS11A]; values[kM0111POIME] = values[kMultDimuonsME] * (values[kS31A] - 3. * values[kS11A] * values[kS12A] + 2. * values[kS13A]); values[kCORR2POIME] = (P2 * conj(Q21)).real() / values[kM01POIME]; @@ -5318,9 +5324,9 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kM11M1111REF] = values[kM11REF] * values[kM1111REF]; // For cumulants: A = Full TPC, B = Negative TPC, C = Positive TPC - complex QA(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex QB(values[kQ2X0B] * S11B, values[kQ2Y0B] * S11B); - complex QC(values[kQ2X0C] * S11C, values[kQ2Y0C] * S11C); + std::complex QA(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex QB(values[kQ2X0B] * S11B, values[kQ2Y0B] * S11B); + std::complex QC(values[kQ2X0C] * S11C, values[kQ2Y0C] * S11C); values[kM11REFetagap] = S11B * S11C; values[kCORR2REFetagap] = ((QB * conj(QC)).real()) / values[kM11REFetagap]; values[kCORR2REFetagap] = std::isnan(values[kM11REFetagap]) || std::isinf(values[kM11REFetagap]) || std::isnan(values[kCORR2REFetagap]) || std::isinf(values[kCORR2REFetagap]) ? 0 : values[kCORR2REFetagap]; @@ -5656,10 +5662,10 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) // kV4, kC4POI, kC4REF etc. if constexpr ((fillMap & ReducedEventQvectorExtra) > 0) { - complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex Q42(values[kQ42XA], values[kQ42YA]); - complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); + std::complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex Q42(values[kQ42XA], values[kQ42YA]); + std::complex Q23(values[kQ23XA], values[kQ23YA]); + std::complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); values[kM01POI] = values[kMultDimuons] * values[kS11A]; values[kM0111POI] = values[kMultDimuons] * (values[kS31A] - 3. * values[kS11A] * values[kS12A] + 2. * values[kS13A]); values[kCORR2POI] = (P2 * conj(Q21)).real() / values[kM01POI]; @@ -5681,8 +5687,8 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) values[kM11M0111overMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kM0111POI]) || std::isinf(values[kM0111POI]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kCORR4POI]) || std::isinf(values[kCORR4POI])) ? (values[kM11REF] * values[kM0111POI]) / values[kMultDimuons] : 0; values[kM11M01overMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kM01POI]) || std::isinf(values[kM01POI]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kCORR2POI]) || std::isinf(values[kCORR2POI])) ? (values[kM11REF] * values[kM01POI]) / values[kMultDimuons] : 0; - complex P2plus(TMath::Cos(2 * v1.Phi()), TMath::Sin(2 * v1.Phi())); - complex P2minus(TMath::Cos(2 * v2.Phi()), TMath::Sin(2 * v2.Phi())); + std::complex P2plus(TMath::Cos(2 * v1.Phi()), TMath::Sin(2 * v1.Phi())); + std::complex P2minus(TMath::Cos(2 * v2.Phi()), TMath::Sin(2 * v2.Phi())); values[kM11REFoverMpplus] = values[kMultAntiMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM11REF] / values[kMultAntiMuons] : 0; values[kM1111REFoverMpplus] = values[kMultAntiMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM1111REF] / values[kMultAntiMuons] : 0; values[kM11REFoverMpminus] = values[kMultMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM11REF] / values[kMultMuons] : 0; diff --git a/PWGDQ/DataModel/MchTrkEffTables.h b/PWGDQ/DataModel/MchTrkEffTables.h index 3fbecfb619c..a7aa5d1e323 100644 --- a/PWGDQ/DataModel/MchTrkEffTables.h +++ b/PWGDQ/DataModel/MchTrkEffTables.h @@ -17,7 +17,9 @@ #ifndef PWGDQ_DATAMODEL_MCHTRKEFFTABLES_H_ #define PWGDQ_DATAMODEL_MCHTRKEFFTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 94c22011d6e..71a15a1ddbd 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -20,13 +20,16 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/Qvectors.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "MathUtils/Utils.h" +#include +#include +#include #include +#include #include namespace o2::aod @@ -49,24 +52,24 @@ namespace reducedevent { // basic event information -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_BITMAP_COLUMN(Tag, tag, 64); //! Bit-field for storing event information (e.g. high level info, cut decisions) -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(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) -DECLARE_SOA_COLUMN(DCAzBimodalityCoefficient, dcazBimodalityCoefficient, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_BITMAP_COLUMN(Tag, tag, 64); //! Bit-field for storing event information (e.g. high level info, cut decisions) +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(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) +DECLARE_SOA_COLUMN(DCAzBimodalityCoefficient, dcazBimodalityCoefficient, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event DECLARE_SOA_COLUMN(DCAzBimodalityCoefficientBinned, dcazBimodalityCoefficientBinned, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event, binned DECLARE_SOA_COLUMN(DCAzBimodalityCoefficientBinnedTrimmed1, dcazBimodalityCoefficientBinnedTrimmed1, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event, binned and trimmed 1 DECLARE_SOA_COLUMN(DCAzBimodalityCoefficientBinnedTrimmed2, dcazBimodalityCoefficientBinnedTrimmed2, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event, binned and trimmed 2 @@ -699,8 +702,8 @@ DECLARE_SOA_COLUMN(Vy2, vy2, float); //! Y production vertex in cm DECLARE_SOA_COLUMN(Vz2, vz2, float); //! Z production vertex in cm DECLARE_SOA_COLUMN(Vt2, vt2, float); //! Production vertex time -DECLARE_SOA_COLUMN(IsAmbig1, isAmbig1, int); //! -DECLARE_SOA_COLUMN(IsAmbig2, isAmbig2, int); //! +DECLARE_SOA_COLUMN(IsAmbig1, isAmbig1, int); //! +DECLARE_SOA_COLUMN(IsAmbig2, isAmbig2, int); //! DECLARE_SOA_COLUMN(IsCorrectAssoc1, isCorrectAssoc1, bool); //! DECLARE_SOA_COLUMN(IsCorrectAssoc2, isCorrectAssoc2, bool); //! diff --git a/PWGDQ/DataModel/ReducedTablesAlice3.h b/PWGDQ/DataModel/ReducedTablesAlice3.h index e1cad38495b..787d7d38793 100644 --- a/PWGDQ/DataModel/ReducedTablesAlice3.h +++ b/PWGDQ/DataModel/ReducedTablesAlice3.h @@ -24,8 +24,12 @@ #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include +#include + +#include +#include namespace o2::aod { diff --git a/PWGDQ/Macros/dqFlowAccWeights.C b/PWGDQ/Macros/dqFlowAccWeights.C index 00cb5107d45..d4786089810 100644 --- a/PWGDQ/Macros/dqFlowAccWeights.C +++ b/PWGDQ/Macros/dqFlowAccWeights.C @@ -14,23 +14,25 @@ /// /// \author Chi ZHANG, CEA-Saclay, chi.zhang@cern.ch -#include -#include -#include -#include -#include -#include +#include "PWGCF/GenericFramework/Core/GFWWeights.h" + +#include +#include -#include #include -#include "Framework/Logger.h" -#include "CCDB/BasicCCDBManager.h" -#include "PWGCF/GenericFramework/Core/GFWWeights.h" +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace std; -void dqFlowAccWeights(int64 tmin = 1546300800000, int64 tmax = 1577833200000, std::string Period = "LHC23zzh_pass2", std::string SubDir = "d-q-event-qvector", std::string FileName = "AnalysisResults.root") +void dqFlowAccWeights(int64_t tmin = 1546300800000, int64_t tmax = 1577833200000, std::string Period = "LHC23zzh_pass2", std::string SubDir = "d-q-event-qvector", std::string FileName = "AnalysisResults.root") { if (tmax < tmin) { LOG(fatal) << "Wrong validity syntax!"; diff --git a/PWGDQ/Macros/evalMchTrackingEfficiency.cxx b/PWGDQ/Macros/evalMchTrackingEfficiency.cxx index 34610915850..c59afbb40b8 100644 --- a/PWGDQ/Macros/evalMchTrackingEfficiency.cxx +++ b/PWGDQ/Macros/evalMchTrackingEfficiency.cxx @@ -14,17 +14,20 @@ /// /// \author Zaida Conesa del Valle /// \author Andrea Tavira García -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include -#include "TFile.h" -#include "TDirectoryFile.h" -#include "THn.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TAxis.h" -#include "TCanvas.h" -#include "TStyle.h" -#include "TLegend.h" +#include double computeEfficiencyPerChamber(THnF* hnf, int iAxis, int iCh, double binLimits[2]); double computeEfficiencyPerChamber(THnF* hnf, const int iAxis[3], int iCh, double binLimits[3][2]); diff --git a/PWGDQ/Macros/fit_library/CB2Pdf.cxx b/PWGDQ/Macros/fit_library/CB2Pdf.cxx index 7f2501825e3..05d13210aaa 100644 --- a/PWGDQ/Macros/fit_library/CB2Pdf.cxx +++ b/PWGDQ/Macros/fit_library/CB2Pdf.cxx @@ -11,13 +11,17 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "CB2Pdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(CB2Pdf); diff --git a/PWGDQ/Macros/fit_library/CB2Pdf.h b/PWGDQ/Macros/fit_library/CB2Pdf.h index a9e3a87409e..23cb291dcdd 100644 --- a/PWGDQ/Macros/fit_library/CB2Pdf.h +++ b/PWGDQ/Macros/fit_library/CB2Pdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef CB2PDF -#define CB2PDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class CB2Pdf : public RooAbsPdf { @@ -51,4 +53,4 @@ class CB2Pdf : public RooAbsPdf ClassDef(CB2Pdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ diff --git a/PWGDQ/Macros/fit_library/ExpPdf.cxx b/PWGDQ/Macros/fit_library/ExpPdf.cxx old mode 100755 new mode 100644 index 1841ccd7cbb..c4e0d0988c1 --- a/PWGDQ/Macros/fit_library/ExpPdf.cxx +++ b/PWGDQ/Macros/fit_library/ExpPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "ExpPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(ExpPdf); diff --git a/PWGDQ/Macros/fit_library/ExpPdf.h b/PWGDQ/Macros/fit_library/ExpPdf.h old mode 100755 new mode 100644 index 394c73c52e6..306b0aea210 --- a/PWGDQ/Macros/fit_library/ExpPdf.h +++ b/PWGDQ/Macros/fit_library/ExpPdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef EXPPDF -#define EXPPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class ExpPdf : public RooAbsPdf { @@ -43,4 +45,4 @@ class ExpPdf : public RooAbsPdf ClassDef(ExpPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ diff --git a/PWGDQ/Macros/fit_library/GausPdf.cxx b/PWGDQ/Macros/fit_library/GausPdf.cxx old mode 100755 new mode 100644 index 84d303e3a2b..2ec58abc577 --- a/PWGDQ/Macros/fit_library/GausPdf.cxx +++ b/PWGDQ/Macros/fit_library/GausPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "GausPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(GausPdf); diff --git a/PWGDQ/Macros/fit_library/GausPdf.h b/PWGDQ/Macros/fit_library/GausPdf.h old mode 100755 new mode 100644 index 4edb19ff47c..80a1e956817 --- a/PWGDQ/Macros/fit_library/GausPdf.h +++ b/PWGDQ/Macros/fit_library/GausPdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef GAUSPDF -#define GAUSPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class GausPdf : public RooAbsPdf { @@ -43,4 +45,4 @@ class GausPdf : public RooAbsPdf ClassDef(GausPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ diff --git a/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx b/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx old mode 100755 new mode 100644 index 912406a3b0b..ff254cc02ae --- a/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx +++ b/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "Pol4ExpPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(Pol4ExpPdf); diff --git a/PWGDQ/Macros/fit_library/Pol4ExpPdf.h b/PWGDQ/Macros/fit_library/Pol4ExpPdf.h old mode 100755 new mode 100644 index 13cd8696c6c..67202dbe5ac --- a/PWGDQ/Macros/fit_library/Pol4ExpPdf.h +++ b/PWGDQ/Macros/fit_library/Pol4ExpPdf.h @@ -11,14 +11,17 @@ /// \author Luca Micheletti , CERN -#ifndef POL4EXPPDF -#define POL4EXPPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include +#include + +#include +#include TString nameParameters[] = {"p0", "p1", "p2", "p3", "p4", "p5", "N_bkg", "N_sig", "mean", "width"}; @@ -53,4 +56,4 @@ class Pol4ExpPdf : public RooAbsPdf ClassDef(Pol4ExpPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ diff --git a/PWGDQ/Macros/fit_library/VWGPdf.cxx b/PWGDQ/Macros/fit_library/VWGPdf.cxx index 8cebc90b2f4..e935afb4150 100644 --- a/PWGDQ/Macros/fit_library/VWGPdf.cxx +++ b/PWGDQ/Macros/fit_library/VWGPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "VWGPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(VWGPdf); diff --git a/PWGDQ/Macros/fit_library/VWGPdf.h b/PWGDQ/Macros/fit_library/VWGPdf.h index 9077d43be71..3ed4f2f81e6 100644 --- a/PWGDQ/Macros/fit_library/VWGPdf.h +++ b/PWGDQ/Macros/fit_library/VWGPdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef VWGPDF -#define VWGPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class VWGPdf : public RooAbsPdf { @@ -45,4 +47,4 @@ class VWGPdf : public RooAbsPdf ClassDef(VWGPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ diff --git a/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx b/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx index 22d5d78e6f7..209af151241 100644 --- a/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx +++ b/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx @@ -17,47 +17,40 @@ // when dealing with derived data. #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGLF/DataModel/EPCalibrationTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" - -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" + +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Qvectors.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include #include +#include #include -#include -#include #include -#include +#include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; // simple bit checkers #define bitset(var, nbit) ((var) |= (1 << (nbit))) diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index 5eb39ddd4d4..f2938705e87 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -17,13 +17,7 @@ // The skimming can optionally produce just the barrel, muon, or both barrel and muon tracks // The event filtering (filterPP), centrality, and V0Bits (from v0-selector) can be switched on/off by selecting one // of the process functions -// C++ includes -#include -#include -#include -#include -#include -// other includes + #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" @@ -44,32 +38,37 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsGlobalTracking/RecoContainer.h" -#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexerParams.h" -#include "DetectorsVertexing/VertexTrackMatcher.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Primitive2D.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/VtxTrackIndex.h" -#include "ReconstructionDataFormats/VtxTrackRef.h" - -#include "TGeoGlobalMagField.h" - -using std::cout; -using std::endl; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx index d5690ab7b78..c5569ae7e14 100644 --- a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx +++ b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx @@ -15,7 +15,6 @@ /// \author Fabrizio Grosa , CERN #include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" @@ -24,13 +23,29 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/EventSelection.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include #include +#include #include #include diff --git a/PWGDQ/TableProducer/tableMakerMC.cxx b/PWGDQ/TableProducer/tableMakerMC.cxx index e2c529a5a7d..8a2d93f9f89 100644 --- a/PWGDQ/TableProducer/tableMakerMC.cxx +++ b/PWGDQ/TableProducer/tableMakerMC.cxx @@ -26,6 +26,7 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -35,22 +36,30 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include "TList.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include #include #include #include diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index bb0b08895c6..f9e22bd4308 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -27,7 +27,8 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" @@ -37,24 +38,34 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include "TList.h" +#include "Tools/ML/MlResponse.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include #include +#include #include #include #include diff --git a/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx b/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx index 11634be2e0d..84d9a42bbbc 100644 --- a/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx +++ b/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx @@ -19,34 +19,37 @@ /// \author Zaida Conesa del Valle /// -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "TDatabasePDG.h" -// -#include "Common/DataModel/TrackSelectionTables.h" -// -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -// -#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/DataModel/MchTrkEffTables.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 7993444ad80..25c81606e27 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -17,14 +17,7 @@ // The skimming can optionally produce just the barrel, muon, or both barrel and muon tracks // The event filtering, centrality, and V0Bits (from v0-selector) can be switched on/off by selecting one // of the process functions -// C++ includes -#include -#include -#include -#include -#include -#include -// other includes + #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" @@ -34,44 +27,63 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/FwdTrackReAlignTables.h" -#include "Common/DataModel/MftmchMatchingML.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsGlobalTracking/RecoContainer.h" -#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexerParams.h" -#include "DetectorsVertexing/VertexTrackMatcher.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Primitive2D.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/VtxTrackIndex.h" -#include "ReconstructionDataFormats/VtxTrackRef.h" - -#include "TGeoGlobalMagField.h" +#include "Tools/ML/MlResponse.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/DalitzSelection.cxx b/PWGDQ/Tasks/DalitzSelection.cxx index 4312434c2e6..c3768b02918 100644 --- a/PWGDQ/Tasks/DalitzSelection.cxx +++ b/PWGDQ/Tasks/DalitzSelection.cxx @@ -21,22 +21,31 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include #include #include #include @@ -47,7 +56,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::soa; -using std::array; using MyEvents = soa::Join; diff --git a/PWGDQ/Tasks/MIDefficiency.cxx b/PWGDQ/Tasks/MIDefficiency.cxx index 3dcbcc4d595..26bca045c2b 100644 --- a/PWGDQ/Tasks/MIDefficiency.cxx +++ b/PWGDQ/Tasks/MIDefficiency.cxx @@ -18,25 +18,25 @@ /// /// \author Luca Quaglia - -// O2 physics classes #include "PWGDQ/DataModel/ReducedInfoTables.h" -// O2 -#include "DataFormatsMID/Track.h" //MID track from O2 -#include "Framework/Variant.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/CompletionPolicyHelpers.h" - -#include "MIDEfficiency/Efficiency.h" -#include "MIDBase/DetectorParameters.h" -#include "MIDBase/Mapping.h" +#include //MID track from O2 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGDQ/Tasks/ModelConverterEventExtended.cxx b/PWGDQ/Tasks/ModelConverterEventExtended.cxx index ec0a6a0c4be..b73eb3ea581 100644 --- a/PWGDQ/Tasks/ModelConverterEventExtended.cxx +++ b/PWGDQ/Tasks/ModelConverterEventExtended.cxx @@ -14,18 +14,12 @@ // Task used to convert the data model from the old format to the new format. To avoid // the conflict with the old data model. -// other includes #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include -#include -#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/ModelConverterMultPv.cxx b/PWGDQ/Tasks/ModelConverterMultPv.cxx index 088590435b8..e844a1bd104 100644 --- a/PWGDQ/Tasks/ModelConverterMultPv.cxx +++ b/PWGDQ/Tasks/ModelConverterMultPv.cxx @@ -14,17 +14,14 @@ // Task used to convert the data model from the old format to the new format. To avoid // the conflict with the old data model. -// other includes -#include -#include -#include -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx index f4e28daee31..634c291cf9e 100644 --- a/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx +++ b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx @@ -14,18 +14,12 @@ // Task used to convert the data model from the old format to the new format. To avoid // the conflict with the old data model. -// other includes #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include -#include -#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/TagAndProbe.cxx b/PWGDQ/Tasks/TagAndProbe.cxx index 2a35b33b87e..b637ec64aad 100644 --- a/PWGDQ/Tasks/TagAndProbe.cxx +++ b/PWGDQ/Tasks/TagAndProbe.cxx @@ -12,57 +12,41 @@ /// \file TagAndProbe.cxx /// \brief Task Tag-And-Probe matching efficiency studies -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TableHelper.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include -#include -#include #include -#include +#include + #include #include +#include #include #include #include #include -#include -#include #include -#include #include using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqCorrelation.cxx b/PWGDQ/Tasks/dqCorrelation.cxx index f6ba8f3bd39..890bdefe46b 100644 --- a/PWGDQ/Tasks/dqCorrelation.cxx +++ b/PWGDQ/Tasks/dqCorrelation.cxx @@ -13,48 +13,43 @@ // #include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" -#include "PWGCF/GenericFramework/Core/GFWCumulant.h" -#include "PWGCF/GenericFramework/Core/GFWPowerArray.h" #include "PWGCF/GenericFramework/Core/GFWWeights.h" -#include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" -#include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/HistogramsLibrary.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include "TProfile.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -#include +#include +#include #include #include -#include +#include + +#include + +#include #include -#include +#include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqEfficiency.cxx b/PWGDQ/Tasks/dqEfficiency.cxx index c044d031729..45e84b4c3e4 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -23,26 +23,29 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include +#include + +#include #include -#include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index daf203e0b29..62d9bc01b32 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -26,28 +26,39 @@ #include "Common/Core/TableHelper.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include +#include +#include #include #include +#include + #include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include @@ -62,6 +73,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx index 2d36e5dd0db..745e0833de4 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx @@ -24,37 +24,47 @@ #include "Common/Core/PID/PIDTOFParamService.h" #include "Common/Core/TableHelper.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include "TGeoGlobalMagField.h" -#include -#include #include #include +#include #include #include -#include +#include + +#include +#include +#include +#include +#include #include +#include #include #include #include @@ -69,6 +79,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod diff --git a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx index eae943e6124..8815bfa32d9 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -20,49 +20,44 @@ #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" #include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/Core/PID/PIDTOFParamService.h" -#include "Common/Core/TableHelper.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include -#include -#include #include #include -#include -#include +#include + +#include +#include +#include +#include +#include #include #include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index 52e3ca8c29c..547068bab36 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -16,42 +16,51 @@ /// o2-analysis-timestamp --aod-file AO2D.root -b | o2-analysis-event-selection -b | o2-analysis-multiplicity-table -b | o2-analysis-centrality-table -b | o2-analysis-fdd-converter -b | o2-analysis-trackselection -b | o2-analysis-trackextension -b | o2-analysis-pid-tpc-full -b | o2-analysis-pid-tof-full -b | o2-analysis-pid-tof-base -b | o2-analysis-pid-tof-beta -b | o2-analysis-dq-flow -b /// tested (June 2, 2022) on AO2D.root files from train production 242 -#include -#include -#include -#include -#include -#include -#include -#include -#include "CCDB/BasicCCDBManager.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/HistogramsLibrary.h" -#include "PWGDQ/Core/CutsLibrary.h" -#include "PWGDQ/Core/MixingLibrary.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" #include "PWGCF/GenericFramework/Core/GFWCumulant.h" -#include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFWWeights.h" -#include "PWGCF/GenericFramework/Core/GFWConfig.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "PWGDQ/Core/AnalysisCut.h" +#include "PWGDQ/Core/CutsLibrary.h" +#include "PWGDQ/Core/HistogramManager.h" +#include "PWGDQ/Core/HistogramsLibrary.h" +#include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include using std::complex; -using std::cout; -using std::endl; using std::pow; using std::string; @@ -59,7 +68,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; -using namespace o2::analysis; // Declarations of various short names using MyBcs = soa::Join; diff --git a/PWGDQ/Tasks/filterPP.cxx b/PWGDQ/Tasks/filterPP.cxx index 61065f3fc74..1bfa487594e 100644 --- a/PWGDQ/Tasks/filterPP.cxx +++ b/PWGDQ/Tasks/filterPP.cxx @@ -19,35 +19,35 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include + +#include +#include +#include #include -#include #include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/filterPPwithAssociation.cxx b/PWGDQ/Tasks/filterPPwithAssociation.cxx index 850b5811d8a..5cce787ffd7 100644 --- a/PWGDQ/Tasks/filterPPwithAssociation.cxx +++ b/PWGDQ/Tasks/filterPPwithAssociation.cxx @@ -19,35 +19,33 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/CollisionAssociation.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include +#include + +#include +#include +#include #include #include #include diff --git a/PWGDQ/Tasks/filterPbPb.cxx b/PWGDQ/Tasks/filterPbPb.cxx index f127a7f3c26..8132956aa5b 100644 --- a/PWGDQ/Tasks/filterPbPb.cxx +++ b/PWGDQ/Tasks/filterPbPb.cxx @@ -9,17 +9,27 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // + #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/Core/UPCHelpers.h" -#include "CommonConstants/LHCConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" -#include +#include "Common/DataModel/EventSelection.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include #include diff --git a/PWGDQ/Tasks/mchAlignRecord.cxx b/PWGDQ/Tasks/mchAlignRecord.cxx index c3dbce0865f..e2a9814bd20 100644 --- a/PWGDQ/Tasks/mchAlignRecord.cxx +++ b/PWGDQ/Tasks/mchAlignRecord.cxx @@ -16,58 +16,45 @@ #include "PWGDQ/Core/VarManager.h" -#include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonUtils/NameConf.h" -#include "DataFormatsMCH/Cluster.h" -#include "DataFormatsMCH/TrackMCH.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GRPGeomHelper.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsCommonDataFormats/AlignParam.h" -#include "DetectorsCommonDataFormats/DetID.h" -#include "DetectorsCommonDataFormats/DetectorNameConf.h" -#include "Framework/AnalysisTask.h" -#include "Framework/CallbackService.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -#include "MCHAlign/Aligner.h" -#include "MCHBase/TrackerParam.h" -#include "MCHGeometryTransformer/Transformations.h" -#include "MCHTracking/Track.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackFitter.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackMCHMID.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include + +#include +#include #include -#include -#include +#include +#include +#include +#include #include #include -#include #include using namespace o2; @@ -76,8 +63,6 @@ using namespace o2::framework::expressions; using namespace o2::aod; using namespace std; -using std::cout; -using std::endl; const int fgNCh = 10; const int fgNDetElemCh[fgNCh] = {4, 4, 4, 4, 18, 18, 26, 26, 26, 26}; diff --git a/PWGDQ/Tasks/mftMchMatcher.cxx b/PWGDQ/Tasks/mftMchMatcher.cxx index efabe3b2d51..321cacb238d 100644 --- a/PWGDQ/Tasks/mftMchMatcher.cxx +++ b/PWGDQ/Tasks/mftMchMatcher.cxx @@ -14,37 +14,41 @@ #include "PWGDQ/Core/VarManager.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FwdTrackReAlignTables.h" -#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MFTTracking/Constants.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include +#include + #include -#include +#include #include #include #include diff --git a/PWGDQ/Tasks/muonDCA.cxx b/PWGDQ/Tasks/muonDCA.cxx index a607ad16b4b..bbb4b63db5e 100644 --- a/PWGDQ/Tasks/muonDCA.cxx +++ b/PWGDQ/Tasks/muonDCA.cxx @@ -16,13 +16,24 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include using namespace o2; diff --git a/PWGDQ/Tasks/muonGlobalAlignment.cxx b/PWGDQ/Tasks/muonGlobalAlignment.cxx index c2af75b9639..968bb3842a3 100644 --- a/PWGDQ/Tasks/muonGlobalAlignment.cxx +++ b/PWGDQ/Tasks/muonGlobalAlignment.cxx @@ -16,32 +16,70 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MFTTracking/Constants.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include "rapidjson/document.h" #include -#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::mch; using namespace o2::framework; diff --git a/PWGDQ/Tasks/qaMatching.cxx b/PWGDQ/Tasks/qaMatching.cxx index ea18c0aa9d7..9611f690500 100644 --- a/PWGDQ/Tasks/qaMatching.cxx +++ b/PWGDQ/Tasks/qaMatching.cxx @@ -15,31 +15,72 @@ // #include "PWGDQ/Core/MuonMatchingMlResponse.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MFTTracking/Constants.h" - -#include +#include "Tools/ML/MlResponse.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include +#include + +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include #include #include +#include #include #include #include #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::aod; diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index 77077aeeb75..d4601569e86 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -34,44 +34,46 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UPCHelpers.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Tools/ML/MlResponse.h" #include "Tools/ML/model.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/Vector3D.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include +#include #include #include #include +#include #include #include #include diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index fdb1c4c0d6f..3c776e2a42d 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -22,36 +22,39 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include #include #include -#include -#include +#include + +#include +#include +#include #include #include #include +#include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 5a71f06bbce..5cbc6a50c62 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -26,42 +26,48 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TableHelper.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include -#include -#include #include #include +#include +#include #include -#include #include +#include + #include +#include +#include #include #include +#include #include #include +#include #include #include -#include -#include #include #include +#include #include using std::cout; @@ -72,6 +78,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod @@ -1648,8 +1655,8 @@ struct AnalysisSameEventPairing { if (fEnableBarrelMixingHistos) { DefineHistograms(fHistMan, "PairingMEQA", "mixedevent-pairing"); // histograms for QA of the pairing }; - dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON - VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill + dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON + VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); } } diff --git a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx index 1cdf8f65336..ecd087c6b16 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx @@ -22,42 +22,49 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/PID/PIDTOFParamService.h" #include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include "TGeoGlobalMagField.h" -#include -#include +#include #include #include -#include +#include #include -#include +#include + +#include +#include +#include #include +#include #include #include #include @@ -72,6 +79,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; Zorro zorro; diff --git a/PWGDQ/Tasks/taskFwdTrackPid.cxx b/PWGDQ/Tasks/taskFwdTrackPid.cxx index 33b89b0e745..8f7febbbf28 100644 --- a/PWGDQ/Tasks/taskFwdTrackPid.cxx +++ b/PWGDQ/Tasks/taskFwdTrackPid.cxx @@ -13,41 +13,27 @@ /// \brief Task for the analysis of forward PID with MFT /// \author Luca Micheletti , INFN -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include + #include -#include +#include #include -#include -#include +#include + +#include #include #include #include diff --git a/PWGDQ/Tasks/taskJpsiHf.cxx b/PWGDQ/Tasks/taskJpsiHf.cxx index fcc78628b20..b41950b4056 100644 --- a/PWGDQ/Tasks/taskJpsiHf.cxx +++ b/PWGDQ/Tasks/taskJpsiHf.cxx @@ -15,18 +15,26 @@ /// \author Fabrizio Grosa , CERN #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGHF/Core/HfHelper.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsAnalysis.h" #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include #include #include diff --git a/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx b/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx index ff161fbafc1..999b46bd148 100644 --- a/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx +++ b/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx @@ -21,10 +21,18 @@ #include "PWGDQ/DataModel/MchTrkEffTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index 4a809dc9b86..f464459adf0 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -23,40 +23,37 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/Vector4D.h" - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include #include #include -#include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; /*using FullTracksExt = soa::Join Date: Mon, 30 Mar 2026 14:15:14 +0200 Subject: [PATCH 098/282] [PWGCF] bitmask fix to fill properly (#15571) Co-authored-by: MaximVirta Co-authored-by: ALICE Action Bot --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 34d145524cd..b921074a4f8 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -1016,13 +1016,13 @@ struct FlowGfwV02 { // Fill cumulants for different particles // ***Need to add proper weights for each particle!*** if (withinPtRef) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 0); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 1); if (withinPtPOI && pidInd == PidPions) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidPions); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidPions + 1); if (withinPtPOI && pidInd == PidKaons) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidKaons); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidKaons + 1); if (withinPtPOI && pidInd == PidProtons) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons + 1); return; } From c4a1d49943797fb08ff2f1f90548e9235e0a837a Mon Sep 17 00:00:00 2001 From: Jesper Karlsson Gumprecht <113693781+jesgum@users.noreply.github.com> Date: Mon, 30 Mar 2026 05:41:10 -0700 Subject: [PATCH 099/282] [ALICE3] Strangeness finding with otf decayer output (#15569) --- ALICE3/DataModel/OTFMCParticle.h | 25 +- ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx | 2 +- ALICE3/TableProducer/OTF/onTheFlyTracker.cxx | 9 +- .../TableProducer/alice3strangenessFinder.cxx | 300 +++++++++++++----- ALICE3/Tasks/alice3DecayerQa.cxx | 12 +- ALICE3/Tasks/alice3Strangeness.cxx | 3 +- 6 files changed, 247 insertions(+), 104 deletions(-) diff --git a/ALICE3/DataModel/OTFMCParticle.h b/ALICE3/DataModel/OTFMCParticle.h index 403bf6deada..cf24e2e7691 100644 --- a/ALICE3/DataModel/OTFMCParticle.h +++ b/ALICE3/DataModel/OTFMCParticle.h @@ -34,16 +34,22 @@ DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(IsAlive, isAlive, bool); DECLARE_SOA_COLUMN(IsPrimary, isPrimary, bool); +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Mother0, mother0, int, "McPartsWithDau_Mother0"); //! Track index of the first mother +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Mother1, mother1, int, "McPartsWithDau_Mother1"); //! Track index of the last mother +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Daughter0, daughter0, int, "McPartsWithDau_Daughter0"); //! Track index of the first daugther +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Daughter1, daughter1, int, "McPartsWithDau_Daughter1"); //! Track index of the last daugther +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers); //! Mother tracks (possible empty) array. Iterate over mcParticle.mothers_as()) +DECLARE_SOA_SELF_SLICE_INDEX_COLUMN(Daughters, daughters); //! Daughter tracks (possibly empty) slice. Check for non-zero with mcParticle.has_daughters(). Iterate over mcParticle.daughters_as()) } // namespace otfmcparticle -DECLARE_SOA_TABLE_FULL(McPartsWithDau, "McPartsWithDau", "AOD", "MCPARTSWITHDAU", +DECLARE_SOA_TABLE_FULL(McPartWithDaus, "McPartWithDaus", "AOD", "MCPARTSWITHDAU", o2::soa::Index<>, mcparticle::McCollisionId, mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags, - mcparticle::MothersIds, - mcparticle::DaughtersIdSlice, + otfmcparticle::MothersIds, + otfmcparticle::DaughtersIdSlice, mcparticle::Weight, mcparticle::Px, mcparticle::Py, @@ -68,7 +74,18 @@ DECLARE_SOA_TABLE_FULL(McPartsWithDau, "McPartsWithDau", "AOD", "MCPARTSWITHDAU" mcparticle::GetProcess, mcparticle::IsPhysicalPrimary); -using McPartWithDau = McPartsWithDau::iterator; +using McPartWithDau = McPartWithDaus::iterator; + +namespace otfmctracklable +{ +DECLARE_SOA_INDEX_COLUMN(McPartWithDau, mcPartWithDau); //! MC particle +DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t); //! Bit mask to indicate detector mismatches (bit ON means mismatch). Bit 0-6: mismatch at ITS layer. Bit 12: ITSAB tracklet mismatch. Bit 13: ITS-TPC mismatch. Bit 14: isNoise == True (global track), Bit 15: isFake == True (global track) +} // namespace otfmctracklable + +DECLARE_SOA_TABLE(McTrackWithDauLabels, "AOD", "MCTRACKWithDAULABEL", //! Table joined to the track table containing the MC index + otfmctracklable::McPartWithDauId, otfmctracklable::McMask); + +using McTrackWithDauLabel = McTrackWithDauLabels::iterator; } // namespace o2::aod diff --git a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx index c4a028f9445..da4988d5648 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx @@ -72,7 +72,7 @@ static const std::vector pdgCodes{kK0Short, kOmegaPlusBar}; struct OnTheFlyDecayer { - Produces tableMcParticlesWithDau; + Produces tableMcParticlesWithDau; o2::upgrade::Decayer decayer; Service pdgDB; diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index 10aaa8aa030..0be208dbdb7 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -124,6 +124,7 @@ struct OnTheFlyTracker { Produces tableStoredTracksCov; Produces tableTracksCovExtension; Produces tableMcTrackLabels; + Produces tableMcTrackWithDauLabels; Produces tableTracksDCA; Produces tableTracksDCACov; Produces tableCollisionsAlice3; @@ -1871,7 +1872,7 @@ struct OnTheFlyTracker { } } - void processConfigurationDev(aod::McCollision const& mcCollision, aod::McPartsWithDau const& mcParticles, const int icfg) + void processConfigurationDev(aod::McCollision const& mcCollision, aod::McPartWithDaus const& mcParticles, const int icfg) { // const int lastTrackIndex = tableStoredTracksCov.lastIndex() + 1; // bookkeep the last added track const std::string histPath = "Configuration_" + std::to_string(icfg) + "/"; @@ -2065,7 +2066,7 @@ struct OnTheFlyTracker { trackParCov.getSigmaSnpZ(), trackParCov.getSigmaSnp2(), trackParCov.getSigmaTglY(), trackParCov.getSigmaTglZ(), trackParCov.getSigmaTglSnp(), trackParCov.getSigmaTgl2(), trackParCov.getSigma1PtY(), trackParCov.getSigma1PtZ(), trackParCov.getSigma1PtSnp(), trackParCov.getSigma1PtTgl(), trackParCov.getSigma1Pt2()); - tableMcTrackLabels(trackParCov.mcLabel, 0); + tableMcTrackWithDauLabels(trackParCov.mcLabel, 0); tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits); // populate extra tables if required to do so @@ -2111,7 +2112,7 @@ struct OnTheFlyTracker { trackParCov.getSigmaSnpZ(), trackParCov.getSigmaSnp2(), trackParCov.getSigmaTglY(), trackParCov.getSigmaTglZ(), trackParCov.getSigmaTglSnp(), trackParCov.getSigmaTgl2(), trackParCov.getSigma1PtY(), trackParCov.getSigma1PtZ(), trackParCov.getSigma1PtSnp(), trackParCov.getSigma1PtTgl(), trackParCov.getSigma1Pt2()); - tableMcTrackLabels(trackParCov.mcLabel, 0); + tableMcTrackWithDauLabels(trackParCov.mcLabel, 0); tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits); // populate extra tables if required to do so @@ -2129,7 +2130,7 @@ struct OnTheFlyTracker { } } - void processDecayer(aod::McCollision const& mcCollision, aod::McPartsWithDau const& mcParticles) + void processDecayer(aod::McCollision const& mcCollision, aod::McPartWithDaus const& mcParticles) { for (size_t icfg = 0; icfg < mSmearer.size(); ++icfg) { processConfigurationDev(mcCollision, mcParticles, static_cast(icfg)); diff --git a/ALICE3/TableProducer/alice3strangenessFinder.cxx b/ALICE3/TableProducer/alice3strangenessFinder.cxx index 3d79ff057a4..e96db585c25 100644 --- a/ALICE3/TableProducer/alice3strangenessFinder.cxx +++ b/ALICE3/TableProducer/alice3strangenessFinder.cxx @@ -22,6 +22,7 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "ALICE3/Core/TrackUtilities.h" +#include "ALICE3/DataModel/OTFMCParticle.h" #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFStrangeness.h" @@ -64,8 +65,10 @@ using namespace o2::framework; using namespace o2::constants::physics; using Alice3TracksWPid = soa::Join; -using Alice3Tracks = soa::Join; +using Alice3TracksACTS = soa::Join; +using Alice3TracksOTF = soa::Join; using Alice3MCParticles = soa::Join; + struct Alice3strangenessFinder { SliceCache cache; @@ -81,6 +84,13 @@ struct Alice3strangenessFinder { Configurable nSigmaTOF{"nSigmaTOF", 5.0f, "Nsigma for TOF PID (if enabled)"}; Configurable dcaXYconstant{"dcaXYconstant", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; Configurable dcaXYpTdep{"dcaXYpTdep", 0.0, "[1] in |DCAxy| > [0]+[1]/pT"}; + + ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, "K0 mass axis"}; + ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.101f, 1.131f}, "Lambda mass axis"}; + ConfigurableAxis axisXiMass{"axisXiMass", {200, 1.22f, 1.42f}, "Xi mass axis"}; + ConfigurableAxis axisMassOmega{"axisMassOmega", {200, 1.57f, 1.77f}, "Omega mass axis"}; + + ConfigurableAxis axisEta{"axisEta", {80, -4.f, 4.f}, "Eta axis"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.025f, 0.05f, 0.075f, 0.1f, 0.125f, 0.15f, 0.175f, 0.2f, 0.225f, 0.25f, 0.275f, 0.3f, 0.325f, 0.35f, 0.375f, 0.4f, 0.425f, 0.45f, 0.475f, 0.5f, 0.525f, 0.55f, 0.575f, 0.6f, 0.625f, 0.65f, 0.675f, 0.7f, 0.725f, 0.75f, 0.775f, 0.8f, 0.82f, 0.85f, 0.875f, 0.9f, 0.925f, 0.95f, 0.975f, 1.0f, 1.05f, 1.1f}, "pt axis for QA histograms"}; Configurable bachMinConstDCAxy{"bachMinConstDCAxy", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; @@ -88,26 +98,36 @@ struct Alice3strangenessFinder { Configurable bachMinConstDCAz{"bachMinConstDCAz", -1.0f, "[0] in |DCAz| > [0]+[1]/pT"}; Configurable bachMinPtDepDCAz{"bachMinPtDepDCAz", 0.0, "[1] in |DCAz| > [0]+[1]/pT"}; - // Vertexing - Configurable propagateToPCA{"propagateToPCA", false, "create tracks version propagated to PCA"}; - Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; - Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; - Configurable maxR{"maxR", 150., "reject PCA's above this radius"}; - Configurable maxDZIni{"maxDZIni", 5, "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; - Configurable maxDXYIni{"maxDXYIni", 4, "reject (if>0) PCA candidate if tracks DXY exceeds threshold"}; - Configurable maxVtxChi2{"maxVtxChi2", 10, "reject (if>0) vtx. chi2 above this value"}; - Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; - Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + Configurable v0MaxDauDCA{"v0MaxDauDCA", 0.005f, "DCA between v0 daughters (cm)"}; + Configurable cascMaxDauDCA{"cascMaxDauDCA", 0.005f, "DCA between cascade daughters (cm)"}; + + // DCA Fitter + struct : ConfigurableGroup { + std::string prefix = "cfgFitter"; + + // Vertexing + Configurable propagateToPCA{"propagateToPCA", false, "create tracks version propagated to PCA"}; + Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; + Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; + Configurable maxR{"maxR", 150., "reject PCA's above this radius"}; + Configurable maxDZIni{"maxDZIni", 5, "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; + Configurable maxDXYIni{"maxDXYIni", 4, "reject (if>0) PCA candidate if tracks DXY exceeds threshold"}; + Configurable maxVtxChi2{"maxVtxChi2", 10, "reject (if>0) vtx. chi2 above this value"}; + Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; + Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + + // propagation options + Configurable usePropagator{"usePropagator", false, "use external propagator"}; + Configurable refitWithMatCorr{"refitWithMatCorr", false, "refit V0 applying material corrections"}; + Configurable useCollinearV0{"useCollinearV0", true, "use collinear approximation for V0 fitting"}; + Configurable maxIter{"maxIter", 30, "maximum number of iterations for vertex fitter"}; + } cfgFitter; + Configurable acceptedLambdaMassWindow{"acceptedLambdaMassWindow", 0.2f, "accepted Lambda mass window around PDG mass"}; // Operation Configurable magneticField{"magneticField", 20.0f, "Magnetic field (in kilogauss)"}; Configurable mcSameMotherCheck{"mcSameMotherCheck", true, "check if tracks come from the same MC mother"}; - // propagation options - Configurable usePropagator{"usePropagator", false, "use external propagator"}; - Configurable refitWithMatCorr{"refitWithMatCorr", false, "refit V0 applying material corrections"}; - Configurable useCollinearV0{"useCollinearV0", true, "use collinear approximation for V0 fitting"}; - Configurable maxIter{"maxIter", 30, "maximum number of iterations for vertex fitter"}; // for the ACTS study Configurable isK0Gun{"isK0Gun", false, "is K0s Monte Carlo gun used"}; @@ -120,15 +140,32 @@ struct Alice3strangenessFinder { Service pdgDB; - // partitions for D mesons - Partition positiveSecondaryTracks = + // partitions for v0/casc dau tracks + Partition positiveSecondaryTracksACTS = aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition negativeSecondaryTracks = + Partition negativeSecondaryTracksACTS = aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition bachelorTracks = + Partition bachelorTracksACTS = nabs(aod::track::dcaXY) > bachMinConstDCAxy + bachMinPtDepDCAxy* nabs(aod::track::signed1Pt) && nabs(aod::track::dcaZ) > bachMinConstDCAz + bachMinPtDepDCAz* nabs(aod::track::signed1Pt); + + Partition positiveSecondaryTracksOTF = + aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); + Partition negativeSecondaryTracksOTF = + aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); + Partition bachelorTracksOTF = + nabs(aod::track::dcaXY) > bachMinConstDCAxy + bachMinPtDepDCAxy* nabs(aod::track::signed1Pt) && nabs(aod::track::dcaZ) > bachMinConstDCAz + bachMinPtDepDCAz* nabs(aod::track::signed1Pt); + Partition positiveMCParticles = aod::mcparticle_alice3::charge > 0.0f; Partition negativeMCParticles = aod::mcparticle_alice3::charge < 0.0f; + + Partition trueK0s = aod::mcparticle::pdgCode == static_cast(PDG_t::kK0Short); + Partition trueLambda = aod::mcparticle::pdgCode == static_cast(PDG_t::kLambda0); + Partition trueAntiLambda = aod::mcparticle::pdgCode == static_cast(PDG_t::kLambda0Bar); + Partition trueXi = aod::mcparticle::pdgCode == static_cast(PDG_t::kXiMinus); + Partition trueAntiXi = aod::mcparticle::pdgCode == static_cast(PDG_t::kXiPlusBar); + Partition trueOmega = aod::mcparticle::pdgCode == static_cast(PDG_t::kOmegaMinus); + Partition trueAntiOmega = aod::mcparticle::pdgCode == static_cast(PDG_t::kOmegaPlusBar); + // Partition negativeSecondaryPions = nabs(aod::upgrade_tof::nSigmaPionInnerTOF) < nSigmaTOF && nabs(aod::upgrade_tof::nSigmaPionOuterTOF) < nSigmaTOF && aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); // Partition positiveSecondaryPions = nabs(aod::upgrade_tof::nSigmaPionInnerTOF) < nSigmaTOF && nabs(aod::upgrade_tof::nSigmaPionOuterTOF) < nSigmaTOF && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); // Partition secondaryProtons = nabs(aod::upgrade_tof::nSigmaProtonInnerTOF) < nSigmaTOF && nabs(aod::upgrade_tof::nSigmaProtonOuterTOF) < nSigmaTOF && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); @@ -151,18 +188,18 @@ struct Alice3strangenessFinder { { // Initialization code here fitter.setBz(magneticField); - fitter.setUseAbsDCA(useAbsDCA); - fitter.setPropagateToPCA(propagateToPCA); - fitter.setMaxR(maxR); - fitter.setMinParamChange(minParamChange); - fitter.setMinRelChi2Change(minRelChi2Change); - fitter.setMaxDZIni(maxDZIni); - fitter.setMaxDXYIni(maxDXYIni); - fitter.setMaxChi2(maxVtxChi2); - fitter.setUsePropagator(usePropagator); - fitter.setRefitWithMatCorr(refitWithMatCorr); - fitter.setCollinear(useCollinearV0); - fitter.setMaxIter(maxIter); + fitter.setUseAbsDCA(cfgFitter.useAbsDCA); + fitter.setPropagateToPCA(cfgFitter.propagateToPCA); + fitter.setMaxR(cfgFitter.maxR); + fitter.setMinParamChange(cfgFitter.minParamChange); + fitter.setMinRelChi2Change(cfgFitter.minRelChi2Change); + fitter.setMaxDZIni(cfgFitter.maxDZIni); + fitter.setMaxDXYIni(cfgFitter.maxDXYIni); + fitter.setMaxChi2(cfgFitter.maxVtxChi2); + fitter.setUsePropagator(cfgFitter.usePropagator); + fitter.setRefitWithMatCorr(cfgFitter.refitWithMatCorr); + fitter.setCollinear(cfgFitter.useCollinearV0); + fitter.setMaxIter(cfgFitter.maxIter); fitter.setMatCorrType(o2::base::Propagator::MatCorrType::USEMatCorrNONE); histos.add("hFitterQA", "", kTH1D, {{10, 0, 10}}); // For QA reasons, counting found candidates at different stages @@ -198,14 +235,29 @@ struct Alice3strangenessFinder { hV0Counter->GetXaxis()->SetBinLabel(3, "AntiLambda"); hV0Counter->GetXaxis()->SetBinLabel(4, "Misidentified"); - auto hCascadeCounter = histos.add("hCascadeCounter", "hCascadeCounter", kTH1D, {{5, 0, 5}}); - hCascadeCounter->GetXaxis()->SetBinLabel(1, "Xi"); - hCascadeCounter->GetXaxis()->SetBinLabel(2, "AntiXi"); - hCascadeCounter->GetXaxis()->SetBinLabel(3, "Omega"); - hCascadeCounter->GetXaxis()->SetBinLabel(4, "AntiOmega"); - hCascadeCounter->GetXaxis()->SetBinLabel(5, "Misidentified"); histos.add("hRadiusVsHitsNeg", "", kTH2D, {{400, 0, 400}, {12, 0.5, 12.5}}); // radius vs hist for MC studies histos.add("hRadiusVsHitsPos", "", kTH2D, {{400, 0, 400}, {12, 0.5, 12.5}}); // radius vs hist for MC studies + + auto hV0Building = histos.add("hV0Building", "hV0Building", kTH1D, {{10, 0.5, 10.5}}); + hV0Building->GetXaxis()->SetBinLabel(1, "Pair"); + hV0Building->GetXaxis()->SetBinLabel(2, "Pdg check"); + hV0Building->GetXaxis()->SetBinLabel(3, "DCA Fitter"); + + auto hCascadeBuilding = histos.add("hCascadeBuilding", "hCascadeBuilding", kTH1D, {{10, 0.5, 10.5}}); + hCascadeBuilding->GetXaxis()->SetBinLabel(1, "Attempts"); + hCascadeBuilding->GetXaxis()->SetBinLabel(2, "La mass window"); + hCascadeBuilding->GetXaxis()->SetBinLabel(3, "DCA Fitter"); + + if (doprocessGenerated) { + histos.add("hGeneratedK0s", "hGeneratedK0s", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedLambda", "hGeneratedLambda", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedAntiLambda", "hGeneratedAntiLambda", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedXi", "hGeneratedXi", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedAntiXi", "hGeneratedAntiXi", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedOmega", "hGeneratedOmega", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedAntiOmega", "hGeneratedAntiOmega", kTH2D, {{axisPt}, {axisEta}}); + } + histos.print(); } @@ -218,22 +270,34 @@ struct Alice3strangenessFinder { template bool checkSameMother(TTrackType const& track1, TTrackType const& track2) { - bool returnValue = false; - // Association check - if (track1.has_mcParticle() && track2.has_mcParticle()) { - auto mcParticle1 = track1.template mcParticle_as(); - auto mcParticle2 = track2.template mcParticle_as(); - if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { - for (const auto& mcParticleMother1 : mcParticle1.template mothers_as()) { - for (const auto& mcParticleMother2 : mcParticle2.template mothers_as()) { - if (mcParticleMother1.globalIndex() == mcParticleMother2.globalIndex()) { - returnValue = true; + // MC label points to McPartWithDaus + if constexpr (requires { track1.has_mcPartWithDau(); }) { + if (!track1.has_mcPartWithDau() || !track2.has_mcPartWithDau()) { + return false; + } + auto mcParticle1 = track1.template mcPartWithDau_as(); + auto mcParticle2 = track2.template mcPartWithDau_as(); + if (mcParticle1.mothersIds().empty() || mcParticle2.mothersIds().empty()) { + return false; + } + return mcParticle1.mothersIds()[0] == mcParticle2.mothersIds()[0]; + } else { // MC label points directly to aod::McParticles + bool returnValue = false; + if (track1.has_mcParticle() && track2.has_mcParticle()) { + auto mcParticle1 = track1.template mcParticle_as(); + auto mcParticle2 = track2.template mcParticle_as(); + if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { + for (const auto& m1 : mcParticle1.template mothers_as()) { + for (const auto& m2 : mcParticle2.template mothers_as()) { + if (m1.globalIndex() == m2.globalIndex()) { + returnValue = true; + } } } } } - } // end association check - return returnValue; + return returnValue; + } } template @@ -259,13 +323,13 @@ struct Alice3strangenessFinder { histos.fill(HIST("hFitterStatusCode"), fitterStatusCode); histos.fill(HIST("hFitterQA"), 1.5); if (nCand == 0) { - LOG(info) << "0 candidates found by fitter"; + LOG(debug) << "0 candidates found by fitter"; return false; } histos.fill(HIST("hFitterQA"), 2.5); //}-{}-{}-{}-{}-{}-{}-{}-{}-{} if (!fitter.isPropagateTracksToVertexDone() && !fitter.propagateTracksToVertex()) { - LOG(info) << "RejProp failed"; + LOG(debug) << "RejProp failed"; return false; } histos.fill(HIST("hFitterQA"), 3.5); @@ -342,40 +406,88 @@ struct Alice3strangenessFinder { } } - void processFindV0CandidateNoPid(aod::Collision const& collision, Alice3Tracks const&, aod::McParticles const&) + void processGenerated(aod::McParticles const&) { - auto negativeSecondaryTracksGrouped = negativeSecondaryTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto positiveSecondaryTracksGrouped = positiveSecondaryTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto bachelorTracksGrouped = bachelorTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - const std::array vtx = {collision.posX(), collision.posY(), collision.posZ()}; + for (const auto& mcParticle : trueK0s) { + histos.fill(HIST("hGeneratedK0s"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueLambda) { + histos.fill(HIST("hGeneratedLambda"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueAntiLambda) { + histos.fill(HIST("hGeneratedAntiLambda"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueXi) { + histos.fill(HIST("hGeneratedXi"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueAntiXi) { + histos.fill(HIST("hGeneratedAntiXi"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueOmega) { + histos.fill(HIST("hGeneratedOmega"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueAntiOmega) { + histos.fill(HIST("hGeneratedAntiOmega"), mcParticle.pt(), mcParticle.eta()); + } + } + template + void processFindV0CandidateNoPid(TCollision collision, TTracksGrouped negTracksGrouped, TTracksGrouped posTracksGrouped, TTracksGrouped bachTracksGrouped) + { + const std::array vtx = {collision.posX(), collision.posY(), collision.posZ()}; histos.fill(HIST("hEventCounter"), 1.0); - for (auto const& posTrack : positiveSecondaryTracksGrouped) { + for (auto const& posTrack : posTracksGrouped) { if (!posTrack.isReconstructed()) { continue; // no ghost tracks } o2::track::TrackParCov pos = getTrackParCov(posTrack); - for (auto const& negTrack : negativeSecondaryTracksGrouped) { + for (auto const& negTrack : negTracksGrouped) { if (!negTrack.isReconstructed()) { continue; // no ghost tracks } + histos.fill(HIST("hV0Building"), 1.0); if (mcSameMotherCheck && !checkSameMother(posTrack, negTrack)) { continue; // keep only if same mother } - if ((posTrack.pdgCode() != kPiPlus && negTrack.pdgCode() != kPiMinus) && isK0Gun) - continue; - if ((posTrack.pdgCode() != kProton && negTrack.pdgCode() != kPiMinus) && isLambdaGun) - continue; + + // ACTS: pdg code attached to track + if constexpr (requires { posTrack.pdgCode(); }) { + if ((posTrack.pdgCode() != kPiPlus && negTrack.pdgCode() != kPiMinus) && isK0Gun) { + continue; + } + if ((posTrack.pdgCode() != kProton && negTrack.pdgCode() != kPiMinus) && isLambdaGun) { + continue; + } + } + + // OTF: pdg code from mcParticle table + if constexpr (requires { posTrack.has_mcPartWithDau(); }) { + if (!posTrack.has_mcPartWithDau() && !negTrack.has_mcPartWithDau()) { + continue; + } + auto mcParticlePos = posTrack.template mcPartWithDau_as(); + auto mcParticleNeg = negTrack.template mcPartWithDau_as(); + if ((mcParticlePos.pdgCode() != kPiPlus && mcParticleNeg.pdgCode() != kPiMinus) && isK0Gun) { + continue; + } + if ((mcParticlePos.pdgCode() != kProton && mcParticleNeg.pdgCode() != kPiMinus) && isLambdaGun) { + continue; + } + } + + histos.fill(HIST("hV0Building"), 2.0); o2::track::TrackParCov neg = getTrackParCov(negTrack); Candidate v0cand; if (!buildDecayCandidateTwoBody(pos, neg, vtx, v0cand)) { continue; // failed at building candidate } + histos.fill(HIST("hV0Building"), 3.0); + // TODO: not all ACTS tracks have MC association, so this check is not possible for all candidates, fix is needed // auto mcParticle1 = posTrack.template mcParticle_as(); // if (mcParticle1.pdgCode() == kK0Short) { @@ -408,19 +520,22 @@ struct Alice3strangenessFinder { std::array{v0cand.pDau1[0], v0cand.pDau1[1], v0cand.pDau1[2]}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton}); - const bool inLambdaMassWindow = std::abs(lambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; - const bool inAntiLambdaMassWindow = std::abs(antiLambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; if (!buildCascade) { continue; // not building cascades, so skip the rest } + + const bool inLambdaMassWindow = std::abs(lambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; + const bool inAntiLambdaMassWindow = std::abs(antiLambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; if (!inLambdaMassWindow && !inAntiLambdaMassWindow) { continue; // Likely not a lambda, should not be considered for cascade building } - for (const auto& bachTrack : bachelorTracksGrouped) { + + for (const auto& bachTrack : bachTracksGrouped) { if (bachTrack.globalIndex() == posTrack.globalIndex() || bachTrack.globalIndex() == negTrack.globalIndex()) { continue; // avoid using any track that was already used } + histos.fill(HIST("hCascadeBuilding"), 1.0); if (inLambdaMassWindow && bachTrack.sign() > 0) { continue; // only consider lambda and neg bach track } @@ -429,6 +544,8 @@ struct Alice3strangenessFinder { continue; // only consider anti-lambda and pos bach track } + histos.fill(HIST("hCascadeBuilding"), 2.0); + // TODO mc same mother check Candidate cascCand; @@ -436,6 +553,7 @@ struct Alice3strangenessFinder { if (!buildDecayCandidateTwoBody(v0, bach, vtx, cascCand)) { continue; // failed at building candidate } + histos.fill(HIST("hCascadeBuilding"), 3.0); const float massXi = RecoDecay::m(std::array{std::array{cascCand.pDau0[0], cascCand.pDau0[1], cascCand.pDau0[2]}, std::array{cascCand.pDau1[0], cascCand.pDau1[1], cascCand.pDau1[2]}}, @@ -445,12 +563,6 @@ struct Alice3strangenessFinder { std::array{cascCand.pDau1[0], cascCand.pDau1[1], cascCand.pDau1[2]}}, std::array{o2::constants::physics::MassLambda, o2::constants::physics::MassKaonCharged}); - tableCascadeIndices(0, // cascade index, dummy value - posTrack.globalIndex(), - negTrack.globalIndex(), - bachTrack.globalIndex(), - collision.globalIndex()); - const float dcaPosToPV = calculateDCAStraightToPV(posTrack.x(), posTrack.y(), posTrack.z(), posTrack.px(), posTrack.py(), posTrack.pz(), vtx[0], vtx[1], vtx[2]); @@ -463,6 +575,12 @@ struct Alice3strangenessFinder { bachTrack.px(), bachTrack.py(), bachTrack.pz(), vtx[0], vtx[1], vtx[2]); + tableCascadeIndices(0, // cascade index, dummy value + posTrack.globalIndex(), + negTrack.globalIndex(), + bachTrack.globalIndex(), + collision.globalIndex()); + tableCascadeCores(bachTrack.sign(), massXi, massOm, cascCand.posSV[0], cascCand.posSV[1], cascCand.posSV[2], v0cand.posSV[0], v0cand.posSV[1], v0cand.posSV[2], @@ -473,23 +591,11 @@ struct Alice3strangenessFinder { v0cand.dcaDau, cascCand.dcaDau, dcaPosToPV, dcaNegToPV, dcaBachToPV, cascCand.dcaToPV, cascCand.dcaToPV); - - auto mcParticle2 = bachTrack.template mcParticle_as(); - if (mcParticle2.pdgCode() == PDG_t::kXiMinus) { - histos.fill(HIST("hCascadeCounter"), 0.5); - } else if (mcParticle2.pdgCode() == PDG_t::kXiPlusBar) { - histos.fill(HIST("hCascadeCounter"), 1.5); - } else if (mcParticle2.pdgCode() == PDG_t::kOmegaMinus) { - histos.fill(HIST("hCascadeCounter"), 2.5); - } else if (mcParticle2.pdgCode() == PDG_t::kOmegaPlusBar) { - histos.fill(HIST("hCascadeCounter"), 3.5); - } else { - histos.fill(HIST("hCascadeCounter"), 4.5); - } } // end bachTrack } // end negTrack } // end posTrack } + void processMCTrueFromACTS(aod::McCollision const& collision, Alice3MCParticles const&) { @@ -567,13 +673,31 @@ struct Alice3strangenessFinder { // auto secondaryProtonsGrouped = secondaryProtons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); // auto secondaryAntiProtonsGrouped = secondaryAntiProtons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); // } - PROCESS_SWITCH(Alice3strangenessFinder, processFindV0CandidateNoPid, "find V0 without PID", true); + + void processFindV0CandidateACTS(aod::Collision const& collision, Alice3TracksACTS const&, aod::McParticles const&) + { + auto negTracksGrouped = negativeSecondaryTracksACTS->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto posTracksGrouped = positiveSecondaryTracksACTS->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto bachTracksGrouped = bachelorTracksACTS->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + processFindV0CandidateNoPid(collision, negTracksGrouped, posTracksGrouped, bachTracksGrouped); + } + + void processFindV0CandidateOTF(aod::Collision const& collision, Alice3TracksOTF const&, aod::McPartWithDaus const&) + { + auto negTracksGrouped = negativeSecondaryTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto posTracksGrouped = positiveSecondaryTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto bachTracksGrouped = bachelorTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + processFindV0CandidateNoPid(collision, negTracksGrouped, posTracksGrouped, bachTracksGrouped); + } + + PROCESS_SWITCH(Alice3strangenessFinder, processGenerated, "process generated information", true); + PROCESS_SWITCH(Alice3strangenessFinder, processFindV0CandidateACTS, "find V0 without PID from ACTS reconstruction", true); + PROCESS_SWITCH(Alice3strangenessFinder, processFindV0CandidateOTF, "find V0 without PID from OTF simulations", false); PROCESS_SWITCH(Alice3strangenessFinder, processMCTrueFromACTS, "process MC truth from ACTS", false); // PROCESS_SWITCH(alice3strangenessFinder, processFindV0CandidateWithPid, "find V0 with PID", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/ALICE3/Tasks/alice3DecayerQa.cxx b/ALICE3/Tasks/alice3DecayerQa.cxx index b84d33af111..cf1c369d17f 100644 --- a/ALICE3/Tasks/alice3DecayerQa.cxx +++ b/ALICE3/Tasks/alice3DecayerQa.cxx @@ -62,11 +62,11 @@ struct Alice3DecayerQA { Partition trueKa = aod::mcparticle::pdgCode == static_cast(kKMinus); Partition truePr = aod::mcparticle::pdgCode == static_cast(kProton); - Partition trueElWithDau = aod::mcparticle::pdgCode == static_cast(kElectron); - Partition trueMuWithDau = aod::mcparticle::pdgCode == static_cast(kMuonMinus); - Partition truePiWithDau = aod::mcparticle::pdgCode == static_cast(kPiPlus); - Partition trueKaWithDau = aod::mcparticle::pdgCode == static_cast(kKMinus); - Partition truePrWithDau = aod::mcparticle::pdgCode == static_cast(kProton); + Partition trueElWithDau = aod::mcparticle::pdgCode == static_cast(kElectron); + Partition trueMuWithDau = aod::mcparticle::pdgCode == static_cast(kMuonMinus); + Partition truePiWithDau = aod::mcparticle::pdgCode == static_cast(kPiPlus); + Partition trueKaWithDau = aod::mcparticle::pdgCode == static_cast(kKMinus); + Partition truePrWithDau = aod::mcparticle::pdgCode == static_cast(kProton); void init(o2::framework::InitContext&) { @@ -125,7 +125,7 @@ struct Alice3DecayerQA { } } - void processMCWithDau(const aod::McCollision&, const aod::McPartsWithDau& particles) + void processMCWithDau(const aod::McCollision&, const aod::McPartWithDaus& particles) { for (const auto& particle : trueElWithDau) { histos.fill(HIST("MCWithDau/hElPt"), particle.pt()); diff --git a/ALICE3/Tasks/alice3Strangeness.cxx b/ALICE3/Tasks/alice3Strangeness.cxx index 499624cd6bf..7527db49495 100644 --- a/ALICE3/Tasks/alice3Strangeness.cxx +++ b/ALICE3/Tasks/alice3Strangeness.cxx @@ -20,6 +20,7 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "ALICE3/DataModel/OTFCollision.h" +#include "ALICE3/DataModel/OTFMCParticle.h" #include "ALICE3/DataModel/OTFStrangeness.h" #include "ALICE3/DataModel/tracksAlice3.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -49,7 +50,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::constants::math; -using Alice3Tracks = soa::Join; +using Alice3Tracks = soa::Join; using FullV0Candidates = soa::Join; using FullCascadeCandidates = soa::Join; using FullCollisions = soa::Join; From f485960602c5e25b4a46c7ee1e92faf1fc7a9cde Mon Sep 17 00:00:00 2001 From: Oveis Sheibani <54555081+Oveissheibani@users.noreply.github.com> Date: Mon, 30 Mar 2026 07:52:56 -0500 Subject: [PATCH 100/282] [PWGCF/TwoParticleCorrelations] Add Lambda-Cascade correlation task (#15535) --- .../Tasks/CMakeLists.txt | 9 +- .../Tasks/Lambdacascadecorrelation.cxx | 3704 +++++++++++++++++ 2 files changed, 3712 insertions(+), 1 deletion(-) create mode 100644 PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 7584e824e6a..49b1a9573a4 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -96,4 +96,11 @@ o2physics_add_dpl_workflow(eta-dihadron o2physics_add_dpl_workflow(nuclei-balance SOURCES nucleibalance.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore - COMPONENT_NAME Analysis) \ No newline at end of file + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(lambdacascadecorrelation + SOURCES Lambdacascadecorrelation.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB + COMPONENT_NAME Analysis) + + diff --git a/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx new file mode 100644 index 00000000000..dfcb3182d43 --- /dev/null +++ b/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx @@ -0,0 +1,3704 @@ +// 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. + +/// \file Lambdacascadecorrelation.cxx +/// \brief Correlation-balance functions of multistrange baryons +/// \author Oveis Sheibani + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/inelGt.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "TDatabasePDG.h" +#include "TPDGCode.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::physics; +using namespace o2::constants::math; +using namespace o2::soa; + +// use parameters + cov mat non-propagated, aux info + (extension propagated) +using FullTracksExt = soa::Join; +using FullTracksExtIU = soa::Join; +using FullTracksExtWithPID = soa::Join; +using FullTracksExtIUWithPID = soa::Join; + +namespace o2::aod +{ +namespace cascadeflags +{ +DECLARE_SOA_COLUMN(IsSelected, isSelected, int); //~! +} // namespace cascadeflags +DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //! + cascadeflags::IsSelected); +using CascDataExtSelected = soa::Join; +} // namespace o2::aod + +using MyCollisions = soa::Join; +using MyCollisionsMult = soa::Join; +using MyCascades = soa::Filtered; +using LabeledCascades = soa::Join; + +namespace o2::aod +{ +namespace lambdacollision +{ +DECLARE_SOA_COLUMN(Cent, cent, float); +DECLARE_SOA_COLUMN(Mult, mult, float); +DECLARE_SOA_COLUMN(RefCollId, refCollId, int64_t); // <--- 1. Add this line +} // namespace lambdacollision +DECLARE_SOA_TABLE(LambdaCollisions, "AOD", "LAMBDACOLS", o2::soa::Index<>, + lambdacollision::Cent, + lambdacollision::Mult, + lambdacollision::RefCollId, // <--- 2. Add this line + aod::collision::PosX, + aod::collision::PosY, + aod::collision::PosZ); +using LambdaCollision = LambdaCollisions::iterator; + +namespace lambdamcgencollision +{ +DECLARE_SOA_COLUMN(RefMcCollId, refMcCollId, int64_t); // original McCollision global index +} +DECLARE_SOA_TABLE(LambdaMcGenCollisions, "AOD", "LMCGENCOLS", o2::soa::Index<>, + lambdacollision::Cent, + lambdacollision::Mult, + lambdamcgencollision::RefMcCollId, + o2::aod::mccollision::PosX, + o2::aod::mccollision::PosY, + o2::aod::mccollision::PosZ); +using LambdaMcGenCollision = LambdaMcGenCollisions::iterator; + +namespace lambdatrack +{ +DECLARE_SOA_INDEX_COLUMN(LambdaCollision, lambdaCollision); +DECLARE_SOA_COLUMN(Px, px, float); +DECLARE_SOA_COLUMN(Py, py, float); +DECLARE_SOA_COLUMN(Pz, pz, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +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(CosPA, cosPA, float); +DECLARE_SOA_COLUMN(DcaDau, dcaDau, float); +DECLARE_SOA_COLUMN(V0Type, v0Type, int8_t); +DECLARE_SOA_COLUMN(V0PrmScd, v0PrmScd, int8_t); +DECLARE_SOA_COLUMN(CorrFact, corrFact, float); +} // namespace lambdatrack +DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, + lambdatrack::LambdaCollisionId, + lambdatrack::Px, + lambdatrack::Py, + lambdatrack::Pz, + lambdatrack::Pt, + lambdatrack::Eta, + lambdatrack::Phi, + lambdatrack::Rap, + lambdatrack::Mass, + lambdatrack::PosTrackId, + lambdatrack::NegTrackId, + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::V0Type, + lambdatrack::V0PrmScd, + lambdatrack::CorrFact); +using LambdaTrack = LambdaTracks::iterator; + +namespace lambdatrackext +{ +DECLARE_SOA_COLUMN(LambdaSharingDaughter, lambdaSharingDaughter, bool); +DECLARE_SOA_COLUMN(LambdaSharingDauIds, lambdaSharingDauIds, std::vector); +DECLARE_SOA_COLUMN(TrueLambdaFlag, trueLambdaFlag, bool); +} // namespace lambdatrackext +DECLARE_SOA_TABLE(LambdaTracksExt, "AOD", "LAMBDATRACKSEXT", + lambdatrackext::LambdaSharingDaughter, + lambdatrackext::LambdaSharingDauIds, + lambdatrackext::TrueLambdaFlag); + +using LambdaTrackExt = LambdaTracksExt::iterator; + +namespace lambdamcgentrack +{ +DECLARE_SOA_INDEX_COLUMN(LambdaMcGenCollision, lambdaMcGenCollision); +} +DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, + lambdamcgentrack::LambdaMcGenCollisionId, + o2::aod::mcparticle::Px, + o2::aod::mcparticle::Py, + o2::aod::mcparticle::Pz, + lambdatrack::Pt, + lambdatrack::Eta, + lambdatrack::Phi, + lambdatrack::Rap, + lambdatrack::Mass, + lambdatrack::PosTrackId, + lambdatrack::NegTrackId, + lambdatrack::V0Type, + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::V0PrmScd, + lambdatrack::CorrFact); +using LambdaMcGenTrack = LambdaMcGenTracks::iterator; + +} // namespace o2::aod + +enum CollisionLabels { + kTotColBeforeHasMcCollision = 1, + kTotCol, + kPassSelCol +}; + +enum TrackLabels { + kTracksBeforeHasMcParticle = 1, + kAllV0Tracks, + kV0KShortMassRej, + kNotLambdaNotAntiLambda, + kV0IsBothLambdaAntiLambda, + kNotLambdaAfterSel, + kV0IsLambdaOrAntiLambda, + kPassV0DauTrackSel, + kPassV0KinCuts, + kPassV0TopoSel, + kAllSelPassed, + kPrimaryLambda, + kSecondaryLambda, + kLambdaDauNotMcParticle, + kLambdaNotPrPiMinus, + kAntiLambdaNotAntiPrPiPlus, + kPassTrueLambdaSel, + kEffCorrPtCent, + kEffCorrPtRapCent, + kNoEffCorr, + kPFCorrPtCent, + kPFCorrPtRapCent, + kNoPFCorr, + kGenTotAccLambda, + kGenLambdaNoDau, + kGenLambdaToPrPi +}; + +enum CentEstType { + kCentFT0M = 0, + kCentFV0A +}; + +enum RunType { + kRun3 = 0, + kRun2 +}; + +enum ParticleType { + kLambda = 0, + kAntiLambda +}; + +enum ParticlePairType { + kLambdaAntiLambda = 0, + kLambdaLambda, + kAntiLambdaAntiLambda +}; + +enum ShareDauLambda { + kUniqueLambda = 0, + kLambdaShareDau +}; + +enum RecGenType { + kRec = 0, + kGen +}; + +enum DMCType { + kData = 0, + kMC +}; + +enum CorrHistDim { + OneDimCorr = 1, + TwoDimCorr, + ThreeDimCorr +}; + +enum PrmScdType { + kPrimary = 0, + kSecondary +}; + +enum PrmScdPairType { + kPP = 0, + kPS, + kSP, + kSS +}; + +struct LambdaTableProducer { + + Produces lambdaCollisionTable; + Produces lambdaTrackTable; + Produces lambdaMCGenCollisionTable; + Produces lambdaMCGenTrackTable; + + // Collisions + Configurable cCentEstimator{"cCentEstimator", 0, "Centrality Estimator : 0-FT0M, 1-FV0A"}; + Configurable cMinZVtx{"cMinZVtx", -10.0, "Min VtxZ cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 10.0, "Max VtxZ cut"}; + Configurable cMinMult{"cMinMult", 0., "Minumum Multiplicity"}; + Configurable cMaxMult{"cMaxMult", 100.0, "Maximum Multiplicity"}; + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; + Configurable cInt7Trig{"cInt7Trig", false, "kINT7 MB Trigger"}; + Configurable cSel7Trig{"cSel7Trig", false, "Sel7 (V0A + V0C) Selection Run2"}; + 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"}; + Configurable cIsGoodITSLayers{"cIsGoodITSLayers", false, "Good ITS Layers All"}; + + // Tracks + Configurable cTrackMinPt{"cTrackMinPt", 0.15, "p_{T} minimum"}; + Configurable cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} maximum"}; + Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; + Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "TPC Min Crossed Rows"}; + Configurable cMinTpcCROverCls{"cMinTpcCROverCls", 0.8, "Tpc Min Crossed Rows Over Findable Clusters"}; + Configurable cMaxTpcSharedClusters{"cMaxTpcSharedClusters", 0.4, "Tpc Max Shared Clusters"}; + Configurable cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"}; + Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"}; + Configurable cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"}; + + // V0s + Configurable cMinDcaProtonToPV{"cMinDcaProtonToPV", 0.02, "Minimum Proton DCAr to PV"}; + Configurable cMinDcaPionToPV{"cMinDcaPionToPV", 0.06, "Minimum Pion DCAr to PV"}; + Configurable cMinV0DcaDaughters{"cMinV0DcaDaughters", 0., "Minimum DCA between V0 daughters"}; + Configurable cMaxV0DcaDaughters{"cMaxV0DcaDaughters", 1., "Maximum DCA between V0 daughters"}; + Configurable cMinDcaV0ToPV{"cMinDcaV0ToPV", 0.0, "Minimum DCA V0 to PV"}; + Configurable cMaxDcaV0ToPV{"cMaxDcaV0ToPV", 999.0, "Maximum DCA V0 to PV"}; + Configurable cMinV0TransRadius{"cMinV0TransRadius", 0.5, "Minimum V0 radius from PV"}; + Configurable cMaxV0TransRadius{"cMaxV0TransRadius", 999.0, "Maximum V0 radius from PV"}; + Configurable cMinV0CTau{"cMinV0CTau", 0.0, "Minimum ctau"}; + Configurable cMaxV0CTau{"cMaxV0CTau", 30.0, "Maximum ctau"}; + Configurable cMinV0CosPA{"cMinV0CosPA", 0.995, "Minimum V0 CosPA to PV"}; + Configurable cKshortRejMassWindow{"cKshortRejMassWindow", 0.01, "Reject K0Short Candidates"}; + Configurable cKshortRejFlag{"cKshortRejFlag", true, "K0short Mass Rej Flag"}; + + // V0s kinmatic acceptance + Configurable cMinV0Mass{"cMinV0Mass", 1.10, "V0 Mass Min"}; + Configurable cMaxV0Mass{"cMaxV0Mass", 1.12, "V0 Mass Min"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 4.2, "Minimum V0 pT"}; + Configurable cMaxV0Rap{"cMaxV0Rap", 0.5, "|rap| cut"}; + Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Do Eta Analysis"}; + Configurable cV0TypeSelFlag{"cV0TypeSelFlag", false, "V0 Type Selection Flag"}; + Configurable cV0TypeSelection{"cV0TypeSelection", 1, "V0 Type Selection"}; + + // V0s MC + Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; + Configurable cSelMCPSV0{"cSelMCPSV0", true, "Select Primary/Secondary V0"}; + Configurable cCheckRecoDauFlag{"cCheckRecoDauFlag", true, "Check for reco daughter PID"}; + Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; + Configurable cGenSecondaryLambda{"cGenSecondaryLambda", false, "Secondary Generated Lambda"}; + Configurable cGenDecayChannel{"cGenDecayChannel", true, "Gen Level Decay Channel Flag"}; + Configurable cRecoMomResoFlag{"cRecoMomResoFlag", false, "Check effect of momentum space smearing on balance function"}; + + // Efficiency Correction + Configurable cCorrectionFlag{"cCorrectionFlag", false, "Correction Flag"}; + Configurable cGetEffFact{"cGetEffFact", false, "Get Efficiency Factor Flag"}; + Configurable cGetPrimFrac{"cGetPrimFrac", false, "Get Primary Fraction Flag"}; + Configurable cCorrFactHist{"cCorrFactHist", 0, "Efficiency Factor Histogram"}; + Configurable cPrimFracHist{"cPrimFracHist", 0, "Primary Fraction Histogram"}; + + // 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 = {{"hEffVsPtCentLambda", "hEffVsPtCentAntiLambda"}, + {"hEffVsPtYCentLambda", "hEffVsPtYCentAntiLambda"}, + {"hEffVsPtEtaCentLambda", "hEffVsPtEtaCentAntiLambda"}}; + + // initialize corr_factor objects + std::vector> vPrimFracStrings = {{"hPrimFracVsPtCentLambda", "hPrimFracVsPtCentAntiLambda"}, + {"hPrimFracVsPtYCentLambda", "hPrimFracVsPtYCentAntiLambda"}, + {"hPrimFracVsPtEtaCentLambda", "hPrimFracVsPtEtaCentAntiLambda"}}; + + // Initialize Global Variables + float cent = 0., mult = 0.; + float pt = 0., eta = 0., rap = 0., phi = 0.; + + void init(InitContext const&) + { + // Set CCDB url + ccdb->setURL(cUrlCCDB.value); + ccdb->setCaching(true); + + // initialize axis specifications + const AxisSpec axisCols(5, 0.5, 5.5, ""); + const AxisSpec axisTrks(30, 0.5, 30.5, ""); + const AxisSpec axisCent(100, 0, 100, "FT0M (%)"); + const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); + const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); + const AxisSpec axisPID(8000, -4000, 4000, "PdgCode"); + + const AxisSpec axisV0Mass(140, 1.08, 1.15, "M_{p#pi} (GeV/#it{c}^{2})"); + const AxisSpec axisV0Pt(100., 0., 10., "p_{T} (GeV/#it{c})"); + const AxisSpec axisV0Rap(48, -1.2, 1.2, "y"); + const AxisSpec axisV0Eta(48, -1.2, 1.2, "#eta"); + const AxisSpec axisV0Phi(36, 0., TwoPI, "#phi (rad)"); + + const AxisSpec axisRadius(2000, 0, 200, "r(cm)"); + const AxisSpec axisCosPA(300, 0.97, 1.0, "cos(#theta_{PA})"); + const AxisSpec axisDcaV0PV(1000, 0., 10., "dca (cm)"); + const AxisSpec axisDcaProngPV(5000, -50., 50., "dca (cm)"); + const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); + const AxisSpec axisCTau(2000, 0, 200, "c#tau (cm)"); + const AxisSpec axisGCTau(2000, 0, 200, "#gammac#tau (cm)"); + const AxisSpec axisAlpha(40, -1, 1, "#alpha"); + const AxisSpec axisQtarm(40, 0, 0.4, "q_{T}"); + + const AxisSpec axisTrackPt(40, 0, 4, "p_{T} (GeV/#it{c})"); + const AxisSpec axisTrackDCA(200, -1, 1, "dca_{XY} (cm)"); + const AxisSpec axisMomPID(80, 0, 4, "p (GeV/#it{c})"); + const AxisSpec axisNsigma(401, -10.025, 10.025, {"n#sigma"}); + const AxisSpec axisdEdx(360, 20, 200, "#frac{dE}{dx}"); + + // Create Histograms. + // Event histograms + histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCols}); + histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + + // QA + histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisTrks}); + 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/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}); + + // Kinematic Histograms + histos.add("McRec/Lambda/hPt", "Transverse Momentum", kTH1F, {axisV0Pt}); + histos.add("McRec/Lambda/hEta", "Pseudorapidity", kTH1F, {axisV0Eta}); + histos.add("McRec/Lambda/hRap", "Rapidity", kTH1F, {axisV0Rap}); + histos.add("McRec/Lambda/hPhi", "Azimuthal Angle", kTH1F, {axisV0Phi}); + + // QA Anti-Lambda + histos.addClone("QA/Lambda/", "QA/AntiLambda/"); + histos.addClone("McRec/Lambda/", "McRec/AntiLambda/"); + + // MC Generated Histograms + if (doprocessMCRun3 || doprocessMCRun2 || doprocessMCRecoRun3 || doprocessMCRecoRun2) { + // McReco Histos + 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_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + + // McGen Histos + histos.add("McGen/h1f_collision_recgen", "# of Reco Collision Associated to One Mc Generator Collision", kTH1F, {axisMult}); + histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCols}); + histos.add("McGen/h2f_collision_posZ", "V_{z}-distribution", kTH2F, {axisVz, axisVz}); + histos.add("McGen/h2f_collision_cent", "FT0M Centrality", kTH2F, {axisCent, axisCent}); + histos.add("McGen/h1f_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + histos.add("McGen/h1f_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + + histos.addClone("McRec/", "McGen/"); + + histos.add("McGen/Lambda/Proton/hPt", "Proton p_{T}", kTH1F, {axisTrackPt}); + histos.add("McGen/Lambda/Proton/hEta", "Proton #eta", kTH1F, {axisV0Eta}); + histos.add("McGen/Lambda/Proton/hRap", "Proton y", kTH1F, {axisV0Rap}); + histos.add("McGen/Lambda/Proton/hPhi", "Proton #phi", kTH1F, {axisV0Phi}); + + histos.addClone("McGen/Lambda/Proton/", "McGen/Lambda/Pion/"); + histos.addClone("McGen/Lambda/Proton/", "McGen/AntiLambda/Proton/"); + histos.addClone("McGen/Lambda/Pion/", "McGen/AntiLambda/Pion/"); + + // set bin lables specific to MC + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotColBeforeHasMcCollision, "kTotColBeforeHasMcCollision"); + histos.get(HIST("McGen/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotCol, "kTotCol"); + histos.get(HIST("McGen/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kPassSelCol, "kPassSelCol"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kTracksBeforeHasMcParticle, "kTracksBeforeHasMcParticle"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPrimaryLambda, "kPrimaryLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kSecondaryLambda, "kSecondaryLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaDauNotMcParticle, "kLambdaDauNotMcParticle"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaNotPrPiMinus, "kLambdaNotPrPiMinus"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAntiLambdaNotAntiPrPiPlus, "kAntiLambdaNotAntiPrPiPlus"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassTrueLambdaSel, "kPassTrueLambdaSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenTotAccLambda, "kGenTotAccLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenLambdaNoDau, "kGenLambdaNoDau"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenLambdaToPrPi, "kGenLambdaToPrPi"); + } + + // set bin labels + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotCol, "kTotCol"); + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kPassSelCol, "kPassSelCol"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAllV0Tracks, "kAllV0Tracks"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0KShortMassRej, "kV0KShortMassRej"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotLambdaNotAntiLambda, "kNotLambdaNotAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0IsBothLambdaAntiLambda, "kV0IsBothLambdaAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotLambdaAfterSel, "kNotLambdaAfterSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0IsLambdaOrAntiLambda, "kV0IsLambdaOrAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0DauTrackSel, "kPassV0DauTrackSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0KinCuts, "kPassV0KinCuts"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0TopoSel, "kPassV0TopoSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAllSelPassed, "kAllSelPassed"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPtCent, "kEffCorrPtCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPtRapCent, "kEffCorrPtRapCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNoEffCorr, "kNoEffCorr"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPFCorrPtCent, "kPFCorrPtCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPFCorrPtRapCent, "kPFCorrPtRapCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNoPFCorr, "kNoPFCorr"); + } + + template + bool selCollision(C const& col) + { + // VtxZ Selection + if (col.posZ() <= cMinZVtx || col.posZ() >= cMaxZVtx) { + return false; + } + + if constexpr (run == kRun3) { // Run3 Min-Bias Trigger + // select centrality estimator + if (cCentEstimator == kCentFT0M) { + cent = col.centFT0M(); + } else if (cCentEstimator == kCentFV0A) { + cent = col.centFV0A(); + } + if (cSel8Trig && !col.sel8()) { + return false; + } + } else { // Run2 Min-Bias Trigger + cent = col.centRun2V0M(); + if (cInt7Trig && !col.alias_bit(kINT7)) { + return false; + } + if (cSel7Trig && !col.sel7()) { + return false; + } + } + + if (cent <= cMinMult || cent >= cMaxMult) { // select centrality percentile class + return false; + } + + if (cTriggerTvxSel && !col.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; + } + + if (cTFBorder && !col.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return false; + } + + if (cNoItsROBorder && !col.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return false; + } + + if (cItsTpcVtx && !col.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return false; + } + + if (cPileupReject && !col.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return false; + } + + if (cZVtxTimeDiff && !col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + + if (cIsGoodITSLayers && !col.selection_bit(aod::evsel::kIsGoodITSLayersAll)) { + return false; + } + + // Set Multiplicity + mult = col.multNTracksPV(); + + return true; + } + + // Kinematic Selection + bool kinCutSelection(float const& pt, float const& rap, float const& ptMin, float const& ptMax, float const& rapMax) + { + if (pt <= ptMin || pt >= ptMax || rap >= rapMax) { + return false; + } + + return true; + } + + // Track Selection + template + bool selTrack(T const& track) + { + if (!kinCutSelection(track.pt(), std::abs(track.eta()), cTrackMinPt, cTrackMaxPt, cTrackEtaCut)) { + return false; + } + + if (track.tpcNClsCrossedRows() <= cMinTpcCrossedRows) { + return false; + } + + if (track.tpcCrossedRowsOverFindableCls() < cMinTpcCROverCls) { + return false; + } + + if (track.tpcNClsShared() > cMaxTpcSharedClusters) { + return false; + } + + if (track.tpcChi2NCl() > cMaxChi2Tpc) { + return false; + } + + return true; + } + + // Daughter Track Selection + template + bool selDaughterTracks(V const& v0, T const&, ParticleType const& v0Type) + { + auto posTrack = v0.template posTrack_as(); + auto negTrack = v0.template negTrack_as(); + + if (!selTrack(posTrack) || !selTrack(negTrack)) { + return false; + } + + // Apply DCA Selection on Daughter Tracks Based on Lambda/AntiLambda daughters + float dcaProton = 0., dcaPion = 0.; + if (v0Type == kLambda) { + dcaProton = std::abs(v0.dcapostopv()); + dcaPion = std::abs(v0.dcanegtopv()); + } else if (v0Type == kAntiLambda) { + dcaPion = std::abs(v0.dcapostopv()); + dcaProton = std::abs(v0.dcanegtopv()); + } + + if (dcaProton < cMinDcaProtonToPV || dcaPion < cMinDcaPionToPV) { + return false; + } + + return true; + } + + template + bool topoCutSelection(C const& col, V const& v0, T const&) + { + // DCA + if (v0.dcaV0daughters() <= cMinV0DcaDaughters || v0.dcaV0daughters() >= cMaxV0DcaDaughters) { + return false; + } + + if (v0.dcav0topv() <= cMinDcaV0ToPV || v0.dcav0topv() >= cMaxDcaV0ToPV) { + return false; + } + + if (v0.v0radius() <= cMinV0TransRadius || v0.v0radius() >= cMaxV0TransRadius) { + return false; + } + + // ctau + float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; + if (ctau <= cMinV0CTau || ctau >= cMaxV0CTau) { + return false; + } + + // cosine of pointing angle + if (v0.v0cosPA() <= cMinV0CosPA) { + return false; + } + + // all selection criterion passed (Return True) + return true; + } + + template + bool selLambdaDauWithTpcPid(T const& postrack, T const& negtrack) + { + bool returnFlag = false; + float tpcNSigmaPr = 0., tpcNSigmaPi = 0.; + + switch (part) { + // postrack = Proton, negtrack = Pion + case kLambda: + tpcNSigmaPr = postrack.tpcNSigmaPr(); + tpcNSigmaPi = negtrack.tpcNSigmaPi(); + break; + + // negtrack = Proton, postrack = Pion + case kAntiLambda: + tpcNSigmaPr = negtrack.tpcNSigmaPr(); + tpcNSigmaPi = postrack.tpcNSigmaPi(); + break; + } + + if (std::abs(tpcNSigmaPr) < cTpcNsigmaCut && std::abs(tpcNSigmaPi) < cTpcNsigmaCut) { + returnFlag = true; + } + + return returnFlag; + } + + template + bool selLambdaMassWindow(V const& v0, T const&, ParticleType& v0type) + { + // Kshort mass rejection hypothesis + if (cKshortRejFlag && (std::abs(v0.mK0Short() - MassK0Short) <= cKshortRejMassWindow)) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kV0KShortMassRej); + return false; + } + + // initialize daughter tracks + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + // initialize selection flags + bool lambdaFlag = false, antiLambdaFlag = false; + + // get v0 track as lambda + if ((v0.mLambda() > cMinV0Mass && v0.mLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + lambdaFlag = true; + v0type = kLambda; + } + + // get v0 track as anti-lambda + if ((v0.mAntiLambda() > cMinV0Mass && v0.mAntiLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + antiLambdaFlag = true; + v0type = kAntiLambda; + } + + if (!lambdaFlag && !antiLambdaFlag) { // neither Lambda nor Anti-Lambda + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotLambdaNotAntiLambda); + 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"), kV0IsBothLambdaAntiLambda); + return false; + } + + if (lambdaFlag || antiLambdaFlag) { + return true; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotLambdaAfterSel); + + return false; + } + + template + bool selV0Particle(C const& col, V const& v0, T const& tracks, ParticleType& v0Type) + { + // Apply Lambda Mass Hypothesis + if (!selLambdaMassWindow(v0, tracks, v0Type)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kV0IsLambdaOrAntiLambda); + + // Apply Daughter Track Selection + if (!selDaughterTracks(v0, tracks, v0Type)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0DauTrackSel); + + // Apply Kinematic Selection + float rap = 0.; + if (!cDoEtaAnalysis) { + rap = std::abs(v0.yLambda()); + } else { + rap = std::abs(v0.eta()); + } + + if (!kinCutSelection(v0.pt(), rap, cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0KinCuts); + + // Apply Topological Selection + if (!topoCutSelection(col, v0, tracks)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0TopoSel); + + // All Selection Criterion Passed + return true; + } + + template + bool hasAmbiguousDaughters(V const& v0, T const&) + { + auto posTrack = v0.template posTrack_as(); + auto negTrack = v0.template negTrack_as(); + + auto posTrackCompCols = posTrack.compatibleCollIds(); + auto negTrackCompCols = negTrack.compatibleCollIds(); + + // Check if daughter tracks belongs to more than one collision (Ambiguous Tracks) + if (posTrackCompCols.size() > 1 || negTrackCompCols.size() > 1) { + return true; + } + + // Check if compatible collision index matches the track collision index + if (((posTrackCompCols.size() != 0) && (posTrackCompCols[0] != posTrack.collisionId())) || + ((negTrackCompCols.size() != 0) && (negTrackCompCols[0] != negTrack.collisionId()))) { + return true; + } + + // Pass as not ambiguous + return false; + } + + template + PrmScdType isPrimaryV0(V const& v0) + { + auto mcpart = v0.template mcParticle_as(); + + // check for secondary lambda + if (!mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kSecondaryLambda); + return kSecondary; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPrimaryLambda); + return kPrimary; + } + + template + bool selTrueMcRecLambda(V const& v0, T const&) + { + auto mcpart = v0.template mcParticle_as(); + + // check if Lambda/AntiLambda + if (std::abs(mcpart.pdgCode()) != kLambda0) { + return false; + } + + // Check for daughters + if (cCheckRecoDauFlag) { + 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"), kLambdaDauNotMcParticle); + return false; + } + + auto mcpostrack = postrack.template mcParticle_as(); + auto mcnegtrack = negtrack.template mcParticle_as(); + + if (mcpart.pdgCode() == kLambda0) { + if (mcpostrack.pdgCode() != kProton || mcnegtrack.pdgCode() != kPiMinus) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kLambdaNotPrPiMinus); + return false; + } + } else if (mcpart.pdgCode() == kLambda0Bar) { + if (mcpostrack.pdgCode() != kPiPlus || mcnegtrack.pdgCode() != kProtonBar) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kAntiLambdaNotAntiPrPiPlus); + return false; + } + } + } + + return true; + } + + template + float getCorrectionFactors(V const& v0) + { + // Check for efficiency correction flag + if (!cCorrectionFlag) { + return 1.; + } + + // Get from CCDB + auto ccdbObj = ccdb->getForTimeStamp(cPathCCDB.value, -1); + + // Check CCDB Object + if (!ccdbObj) { + LOGF(warning, "CCDB OBJECT NOT FOUND"); + return 1.; + } + + // initialize efficiency factor and primary fraction values + float effCorrFact = 1., primFrac = 1.; + float rap = (cDoEtaAnalysis) ? v0.eta() : v0.yLambda(); + + // Get Efficiency Factor + if (cGetEffFact) { + TObject* objEff = reinterpret_cast(ccdbObj->FindObject(Form("%s", vCorrFactStrings[cCorrFactHist][part].c_str()))); + TH1F* histEff = reinterpret_cast(objEff->Clone()); + if (histEff->GetDimension() == TwoDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtCent); + effCorrFact = histEff->GetBinContent(histEff->FindBin(cent, v0.pt())); + } else if (histEff->GetDimension() == ThreeDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtRapCent); + effCorrFact = histEff->GetBinContent(histEff->FindBin(cent, v0.pt(), rap)); + } else { + histos.fill(HIST("Tracks/h1f_tracks_info"), kNoEffCorr); + LOGF(warning, "CCDB OBJECT IS NOT A HISTOGRAM !!!"); + effCorrFact = 1.; + } + delete histEff; + } + + // Get Primary Fraction + // (The dimension of this could be different than efficiency because of large errors !!!) + if (cGetPrimFrac) { + TObject* objPrm = reinterpret_cast(ccdbObj->FindObject(Form("%s", vPrimFracStrings[cPrimFracHist][part].c_str()))); + TH1F* histPrm = reinterpret_cast(objPrm->Clone()); + if (histPrm->GetDimension() == TwoDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kPFCorrPtCent); + primFrac = histPrm->GetBinContent(histPrm->FindBin(cent, v0.pt())); + } else if (histPrm->GetDimension() == ThreeDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kPFCorrPtRapCent); + primFrac = histPrm->GetBinContent(histPrm->FindBin(cent, v0.pt(), rap)); + } else { + histos.fill(HIST("Tracks/h1f_tracks_info"), kNoPFCorr); + LOGF(warning, "CCDB OBJECT IS NOT A HISTOGRAM !!!"); + primFrac = 1.; + } + delete histPrm; + } + + return primFrac * effCorrFact; + } + + template + void fillLambdaMothers(V const& v0, T const&) + { + auto mcpart = v0.template mcParticle_as(); + auto lambdaMothers = mcpart.template mothers_as(); + histos.fill(HIST("Tracks/h2f_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + } + + 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(); + auto negtrack = v0.template negTrack_as(); + float mass = 0.; + + if constexpr (part == kLambda) { + mass = v0.mLambda(); + } else { + mass = v0.mAntiLambda(); + } + + // ctau + float e = RecoDecay::e(v0.px(), v0.py(), v0.pz(), mass); + float gamma = e / mass; + float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; + float gctau = ctau * gamma; + + 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()); + } + + // Fill Lambda Kinematic Histograms + template + void fillKinematicHists(float const& pt, float const& eta, float const& y, float const& phi) + { + static constexpr std::string_view SubDirRG[] = {"McRec/", "McGen/"}; + static constexpr std::string_view SubDirPart[] = {"Lambda/", "AntiLambda/"}; + + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPt"), pt); + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hEta"), eta); + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hRap"), y); + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPhi"), phi); + } + + // Reconstructed Level Tables + template + void fillLambdaRecoTables(C const& collision, V const& v0tracks, T const& tracks) + { + // Total Collisions + histos.fill(HIST("Events/h1f_collisions_info"), kTotCol); + + // Select Collision (Only for Data... McRec has been selected already !!!) + if constexpr (dmc == kData) { + if (!selCollision(collision)) { + return; + } + } + + histos.fill(HIST("Events/h1f_collisions_info"), kPassSelCol); + histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); + + // Fill Collision Table + // lambdaCollisionTable(cent, mult, collision.posX(), collision.posY(), collision.posZ()); + lambdaCollisionTable(cent, mult, collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ()); + + // initialize v0track objects + ParticleType v0Type = kLambda; + PrmScdType v0PrmScdType = kPrimary; + float mass = 0., corr_fact = 1.; + + for (auto const& v0 : v0tracks) { + // check for corresponding MCGen Particle + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kTracksBeforeHasMcParticle); + if (!v0.has_mcParticle()) { + continue; + } + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kAllV0Tracks); + histos.fill(HIST("Tracks/h2f_armpod_before_sel"), v0.alpha(), v0.qtarm()); + + // Select V0 Particle as Lambda/AntiLambda + if (!selV0Particle(collision, v0, tracks, v0Type)) { + continue; + } + + // Select V0 Type Selection + if (cV0TypeSelFlag && v0.v0Type() != cV0TypeSelection) { + continue; + } + + // we have v0 as lambda + histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed); + + // Remove lambda with ambiguous daughters (Only for run3) + if constexpr (run == kRun3) { + if (cRemoveAmbiguousTracks && hasAmbiguousDaughters(v0, tracks)) { + continue; + } + } + + // Get Lambda mass and kinematic variables + mass = (v0Type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); + pt = v0.pt(); + eta = v0.eta(); + rap = v0.yLambda(); + phi = v0.phi(); + + // do MC analysis + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h2f_tracks_pid_before_sel"), v0.mcParticle().pdgCode(), v0.pt()); + + // Get Primary/Secondary Lambda + if (cSelMCPSV0) { + v0PrmScdType = isPrimaryV0(v0); + } + + // check for true Lambda/Anti-Lambda + if (cSelectTrueLambda && !selTrueMcRecLambda(v0, tracks)) { + continue; + } + + // get mothers information + if (v0PrmScdType == kSecondary) { + fillLambdaMothers(v0, tracks); + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassTrueLambdaSel); + histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); + + if (cRecoMomResoFlag) { + auto mc = v0.template mcParticle_as(); + pt = mc.pt(); + eta = mc.eta(); + rap = mc.y(); + phi = mc.phi(); + float y = (cDoEtaAnalysis) ? eta : rap; + // apply kinematic selection (On Truth) + if (!kinCutSelection(pt, std::abs(y), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + continue; + } + } + } + + histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); + + // get correction factors + corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0) : getCorrectionFactors(v0); + + // fill lambda qa + if (v0Type == kLambda) { + histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); + } else { + histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); + } + + // Fill Lambda/AntiLambda Table + lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), + pt, eta, phi, rap, mass, v0.template posTrack_as().index(), v0.template negTrack_as().index(), + v0.v0cosPA(), v0.dcaV0daughters(), (int8_t)v0Type, v0PrmScdType, corr_fact); + } + } + + // MC Generater Level Tables + template + void fillLambdaMcGenTables(C const& mcCollision, M const& mcParticles) + { + // Fill McGen Collision Table + lambdaMCGenCollisionTable(cent, mult, mcCollision.globalIndex(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + + // initialize track objects + ParticleType v0Type = kLambda; + PrmScdType v0PrmScdType = kPrimary; + float rap = 0.; + + for (auto const& mcpart : mcParticles) { + // check for Lambda first + if (mcpart.pdgCode() == kLambda0) { + v0Type = kLambda; + } else if (mcpart.pdgCode() == kLambda0Bar) { + v0Type = kAntiLambda; + } else { + continue; + } + + // check for Primary Lambda/AntiLambda + if (mcpart.isPhysicalPrimary()) { + v0PrmScdType = kPrimary; + } else { + v0PrmScdType = kSecondary; + } + + // Decide Eta/Rap + if (!cDoEtaAnalysis) { + rap = mcpart.y(); + } else { + rap = mcpart.eta(); + } + + // Apply Kinematic Acceptance + if (!kinCutSelection(mcpart.pt(), std::abs(rap), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + continue; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenTotAccLambda); + + // get daughter track info and check for decay channel flag + if (!mcpart.has_daughters()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaNoDau); + continue; + } + auto dautracks = mcpart.template daughters_as(); + std::vector daughterPDGs, daughterIDs; + std::vector vDauPt, vDauEta, vDauRap, vDauPhi; + for (auto const& dautrack : dautracks) { + daughterPDGs.push_back(dautrack.pdgCode()); + daughterIDs.push_back(dautrack.globalIndex()); + vDauPt.push_back(dautrack.pt()); + vDauEta.push_back(dautrack.eta()); + vDauRap.push_back(dautrack.y()); + vDauPhi.push_back(dautrack.phi()); + } + if (cGenDecayChannel) { // check decay channel + if (v0Type == kLambda) { + if (daughterPDGs[0] != kProton || daughterPDGs[1] != kPiMinus) { + continue; + } + } else if (v0Type == kAntiLambda) { + if (daughterPDGs[0] != kProtonBar || daughterPDGs[1] != kPiPlus) { + continue; + } + } + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaToPrPi); + + if (v0Type == kLambda) { + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0]); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1]); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode()); + histos.fill(HIST("McGen/Lambda/Proton/hPt"), vDauPt[0]); + histos.fill(HIST("McGen/Lambda/Proton/hEta"), vDauEta[0]); + histos.fill(HIST("McGen/Lambda/Proton/hRap"), vDauRap[0]); + histos.fill(HIST("McGen/Lambda/Proton/hPhi"), vDauPhi[0]); + histos.fill(HIST("McGen/Lambda/Pion/hPt"), vDauPt[1]); + histos.fill(HIST("McGen/Lambda/Pion/hEta"), vDauEta[1]); + histos.fill(HIST("McGen/Lambda/Pion/hRap"), vDauRap[1]); + histos.fill(HIST("McGen/Lambda/Pion/hPhi"), vDauPhi[1]); + fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); + } else { + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0]); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1]); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode()); + histos.fill(HIST("McGen/AntiLambda/Pion/hPt"), vDauPt[0]); + histos.fill(HIST("McGen/AntiLambda/Pion/hEta"), vDauEta[0]); + histos.fill(HIST("McGen/AntiLambda/Pion/hRap"), vDauRap[0]); + histos.fill(HIST("McGen/AntiLambda/Pion/hPhi"), vDauPhi[0]); + histos.fill(HIST("McGen/AntiLambda/Proton/hPt"), vDauPt[1]); + histos.fill(HIST("McGen/AntiLambda/Proton/hEta"), vDauEta[1]); + histos.fill(HIST("McGen/AntiLambda/Proton/hRap"), vDauRap[1]); + histos.fill(HIST("McGen/AntiLambda/Proton/hPhi"), vDauPhi[1]); + fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); + } + + // Fill Lambda McGen Table + 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., v0PrmScdType, 1.); + } + } + + template + void analyzeMcRecoGen(M const& mcCollision, C const& collisions, V const& V0s, T const& tracks, P const& mcParticles) + { + // Number of Rec Collisions Associated to the McGen Collision + int nRecCols = collisions.size(); + if (nRecCols != 0) { + histos.fill(HIST("McGen/h1f_collision_recgen"), nRecCols); + } + + // Always fill gen tables so processMCGenXi/Omega has entries. + // selCollision sets cent/mult as a side-effect — works for both Run2 and Run3. + cent = 0.f; + mult = 0.f; + if (nRecCols >= 1 && + collisions.begin().has_mcCollision() && + collisions.begin().mcCollisionId() == mcCollision.globalIndex()) { + selCollision(collisions.begin()); // sets cent and mult + } + fillLambdaMcGenTables(mcCollision, mcParticles); + + // Reco tables only for clean 1-to-1 matched collisions + if (nRecCols != 1) { + return; + } + histos.fill(HIST("McGen/h1f_collisions_info"), kTotCol); + if (!collisions.begin().has_mcCollision() || !selCollision(collisions.begin()) || collisions.begin().mcCollisionId() != mcCollision.globalIndex()) { + return; + } + histos.fill(HIST("McGen/h1f_collisions_info"), kPassSelCol); + histos.fill(HIST("McGen/h2f_collision_posZ"), mcCollision.posZ(), collisions.begin().posZ()); + auto v0Tracks = V0s.sliceBy(perCollision, collisions.begin().globalIndex()); + fillLambdaRecoTables(collisions.begin(), v0Tracks, tracks); + } + + SliceCache cache; + Preslice> perCollision = aod::v0data::collisionId; + + using CollisionsRun3 = soa::Join; + using CollisionsRun2 = soa::Join; + using Tracks = soa::Join; + using TracksRun2 = soa::Join; + using TracksMC = soa::Join; + using TracksMCRun2 = soa::Join; + using McV0Tracks = soa::Join; + + void processDataRun3(CollisionsRun3::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) + { + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", true); + + void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, TracksRun2 const& tracks) + { + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processDataRun2, "Process for Run2 DATA", false); + + void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&) + { + // check collision + if (!selCollision(collision)) { + return; + } + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun3, "Process for Run3 McReco DATA", false); + + void processMCRecoRun2(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, TracksMCRun2 const& tracks, aod::McParticles const&) + { + // check collision + if (!selCollision(collision)) { + return; + } + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun2, "Process for Run2 McReco DATA", false); + + void processMCRun3(aod::McCollisions::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + McV0Tracks const& V0s, TracksMC const& tracks, + aod::McParticles const& mcParticles) + { + analyzeMcRecoGen(mcCollision, collisions, V0s, tracks, mcParticles); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRun3, "Process for Run3 MC RecoGen", false); + + void processMCRun2(aod::McCollisions::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + McV0Tracks const& V0s, TracksMCRun2 const& tracks, + aod::McParticles const& mcParticles) + { + analyzeMcRecoGen(mcCollision, collisions, V0s, tracks, mcParticles); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRun2, "Process for Run2 MC RecoGen", false); + + // Gen-only: fills LambdaMcGenCollisions + LambdaMcGenTracks without touching reco tables. + // Use alongside processMCRecoRun3 (which fills reco tables only). + void processMCGenOnlyRun3(aod::McCollisions::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + aod::McParticles const& mcParticles) + { + // Try to obtain centrality from a matched reco collision + cent = 0.f; + mult = 0.f; + if (collisions.size() >= 1) { + auto firstReco = collisions.begin(); + if (firstReco.has_mcCollision() && + firstReco.mcCollisionId() == mcCollision.globalIndex()) { + selCollision(firstReco); // sets cent and mult + } + } + fillLambdaMcGenTables(mcCollision, mcParticles); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCGenOnlyRun3, "Gen-only Run3 (no reco tables)", false); +}; + +struct LambdaTracksExtProducer { + + Produces lambdaTrackExtTable; + + // Configurables + Configurable cAcceptAllLambda{"cAcceptAllLambda", false, "Accept all Lambda"}; + Configurable cRejAllLambdaShaDau{"cRejAllLambdaShaDau", true, "Reject all Lambda sharing daughters"}; + Configurable cSelLambdaMassPdg{"cSelLambdaMassPdg", false, "Select Lambda closest to Pdg Mass"}; + Configurable cSelLambdaTScore{"cSelLambdaTScore", false, "Select Lambda based on t-score"}; + Configurable cA{"cA", 0.6, "a * |lambdaMass - lambdaPdgMass|"}; + Configurable cB{"cB", 0.6, "b * DcaPrPi"}; + Configurable cC{"cC", 0.6, "c * Cos(theta_{PA})"}; + + // Histogram Registry. + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext const&) + { + // Axis Specifications + const AxisSpec axisMult(10, 0, 10); + const AxisSpec axisMass(100, 1.06, 1.16, "Inv Mass (GeV/#it{c}^{2})"); + const AxisSpec axisCPA(100, 0.995, 1.0, "cos(#theta_{PA})"); + const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); + const AxisSpec axisDEta(320, -1.6, 1.6, "#Delta#eta"); + const AxisSpec axisDPhi(640, -PIHalf, 3. * PIHalf, "#Delta#varphi"); + + // Histograms Booking + histos.add("h1i_totlambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h1i_totantilambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h1i_lambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h1i_antilambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h2d_n2_etaphi_LaP_LaM", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaP_LaP", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaM_LaM", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + + // InvMass, DcaDau and CosPA + histos.add("Reco/h1f_lambda_invmass", "M_{p#pi}", kTH1F, {axisMass}); + histos.add("Reco/h1f_lambda_cospa", "cos(#theta_{PA})", kTH1F, {axisCPA}); + histos.add("Reco/h1f_lambda_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); + histos.add("Reco/h1f_antilambda_invmass", "M_{p#pi}", kTH1F, {axisMass}); + histos.add("Reco/h1f_antilambda_cospa", "cos(#theta_{PA})", kTH1F, {axisCPA}); + histos.add("Reco/h1f_antilambda_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); + + histos.addClone("Reco/", "SharingDau/"); + } + + template + void fillHistos(T const& track) + { + static constexpr std::string_view SubDir[] = {"Reco/", "SharingDau/"}; + + if (track.v0Type() == kLambda) { + histos.fill(HIST(SubDir[sd]) + HIST("h1f_lambda_invmass"), track.mass()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_lambda_dcadau"), track.dcaDau()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_lambda_cospa"), track.cosPA()); + } else { + histos.fill(HIST(SubDir[sd]) + HIST("h1f_antilambda_invmass"), track.mass()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_antilambda_dcadau"), track.dcaDau()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_antilambda_cospa"), track.cosPA()); + } + } + + void process(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) + { + + int nTotLambda = 0, nTotAntiLambda = 0, nSelLambda = 0, nSelAntiLambda = 0; + + for (auto const& lambda : tracks) { + bool lambdaMinDeltaMassFlag = true, lambdaMinTScoreFlag = true; + bool lambdaSharingDauFlag = false, trueLambdaFlag = false; + std::vector vSharedDauLambdaIndex; + float tLambda = 0., tTrack = 0.; + + if (lambda.v0Type() == kLambda) { + ++nTotLambda; + } else if (lambda.v0Type() == kAntiLambda) { + ++nTotAntiLambda; + } + + tLambda = (cA * std::abs(lambda.mass() - MassLambda0)) + (cB * lambda.dcaDau()) + (cC * std::abs(lambda.cosPA() - 1.)); + + for (auto const& track : tracks) { + // check lambda index (don't analyze same lambda track !!!) + if (lambda.index() == track.index()) { + continue; + } + + // check if lambda shares daughters with any other track + if (lambda.posTrackId() == track.posTrackId() || lambda.negTrackId() == track.negTrackId()) { + vSharedDauLambdaIndex.push_back(track.index()); + lambdaSharingDauFlag = true; + + // Fill DEta-DPhi Histogram + if ((lambda.v0Type() == kLambda && track.v0Type() == kAntiLambda) || (lambda.v0Type() == kAntiLambda && track.v0Type() == kLambda)) { + histos.fill(HIST("h2d_n2_etaphi_LaP_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kLambda && track.v0Type() == kLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaP_LaP"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kAntiLambda && track.v0Type() == kAntiLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaM_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } + + // decision based on mass closest to PdgMass of Lambda + if (std::abs(lambda.mass() - MassLambda0) > std::abs(track.mass() - MassLambda0)) { + lambdaMinDeltaMassFlag = false; + } + + // decisions based on t-score + tTrack = (cA * std::abs(track.mass() - MassLambda0)) + (cB * track.dcaDau()) + (cC * std::abs(track.cosPA() - 1.)); + if (tLambda > tTrack) { + lambdaMinTScoreFlag = false; + } + } + } + + // fill QA histograms + if (lambdaSharingDauFlag) { + fillHistos(lambda); + } else { + fillHistos(lambda); + } + + if (cAcceptAllLambda) { // Accept all lambda + trueLambdaFlag = true; + } else if (cRejAllLambdaShaDau && !lambdaSharingDauFlag) { // Reject all lambda sharing daughter + trueLambdaFlag = true; + } else if (cSelLambdaMassPdg && lambdaMinDeltaMassFlag) { // Select lambda closest to pdg mass + trueLambdaFlag = true; + } else if (cSelLambdaTScore && lambdaMinTScoreFlag) { // Select lambda based on t-score + trueLambdaFlag = true; + } + + // Multiplicity of selected lambda + if (trueLambdaFlag) { + if (lambda.v0Type() == kLambda) { + ++nSelLambda; + } else if (lambda.v0Type() == kAntiLambda) { + ++nSelAntiLambda; + } + } + + // fill LambdaTrackExt table + lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, trueLambdaFlag); + } + + // fill multiplicity histograms + if (nTotLambda != 0) { + histos.fill(HIST("h1i_totlambda_mult"), nTotLambda); + } + + if (nTotAntiLambda != 0) { + histos.fill(HIST("h1i_totantilambda_mult"), nTotAntiLambda); + } + + if (nSelLambda != 0) { + histos.fill(HIST("h1i_lambda_mult"), nSelLambda); + } + + if (nSelAntiLambda != 0) { + histos.fill(HIST("h1i_antilambda_mult"), nSelAntiLambda); + } + } +}; + +struct LambdaR2Correlation { + // Global Configurables + Configurable cNPtBins{"cNPtBins", 34, "N pT Bins"}; + Configurable cMinPt{"cMinPt", 0.8, "pT Min"}; + Configurable cMaxPt{"cMaxPt", 4.2, "pT Max"}; + Configurable cNRapBins{"cNRapBins", 20, "N Rapidity Bins"}; + Configurable cMinRap{"cMinRap", -0.5, "Minimum Rapidity"}; + Configurable cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"}; + Configurable cNPhiBins{"cNPhiBins", 36, "N Phi Bins"}; + Configurable cAnaSecondaries{"cAnaSecondaries", false, "Analysze Secondaries"}; + Configurable cAnaPairs{"cAnaPairs", false, "Analyze Pairs Flag"}; + Configurable cAnaSecondaryPairs{"cAnaSecondaryPairs", false, "Analyze Secondary Pairs Flag"}; + + // Eta/Rap Analysis + Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Eta/Rap Analysis Flag"}; + + // Centrality Axis + ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; + + // Histogram Registry. + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Initialize global variables + float nrapbins = 0.; + float kminrap = 0.; + float kmaxrap = 0.; + float nphibins = 0.; + float kminphi = 0.; + float kmaxphi = TwoPI; + float rapbinwidth = 0.; + float phibinwidth = 0.; + float q = 0., e = 0., qinv = 0.; + float cent = 0.; + + void init(InitContext const&) + { + // Set Density Histogram Attributes + 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(cNRapBins) * static_cast(cNPhiBins); + float kminrapphi = 0.; + float kmaxrapphi = knrapphibins; + + const AxisSpec axisCheck(1, 0, 1, ""); + const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); + const AxisSpec axisCent(cMultBins, "FT0M (%)"); + const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); + const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); + const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); + const AxisSpec axisPt(cNPtBins, cMinPt, cMaxPt, "p_{T} (GeV/#it{c})"); + const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta"); + const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); + const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#varphi (rad)"); + const AxisSpec axisRapPhi(knrapphibins, kminrapphi, kmaxrapphi, "y #varphi"); + const AxisSpec axisQinv(100, 0, 10, "q_{inv} (GeV/#it{c})"); + + // Create Histograms. + // Event + 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/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTH2F, {axisCent, axisChMult}); + histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTH2F, {axisCent, axisMult}); + histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTH2F, {axisCent, axisMult}); + + // Efficiency Histograms + // Single Particle Efficiencies + histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRap}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRap}); + + // Single and Two Particle Densities + // 1D Histograms + histos.add("Reco/Primary/h3f_n1_centmasspt_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisMass, axisPt}); + histos.add("Reco/Primary/h3f_n1_centmasspt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisMass, axisPt}); + histos.add("Reco/Primary/h2f_n1_pt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/h2f_n1_pt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/h2f_n1_eta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisEta}); + histos.add("Reco/Primary/h2f_n1_eta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisEta}); + histos.add("Reco/Primary/h2f_n1_rap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisRap}); + histos.add("Reco/Primary/h2f_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisRap}); + histos.add("Reco/Primary/h2f_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPhi}); + histos.add("Reco/Primary/h2f_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPhi}); + + // rho1 for R2 RapPhi + histos.add("Reco/Primary/h3f_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisRap, axisPhi}); + histos.add("Reco/Primary/h3f_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisPhi}); + + // rho1 for Q_{inv} + histos.add("Reco/Primary/h3f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/h3f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); + + // Clone Singles Primary/Secondary Histogram + if (cAnaSecondaries) { + histos.addClone("Reco/Primary/", "Reco/Secondary/"); + } + + if (cAnaPairs) { + // rho2 for numerator of R2 + histos.add("Reco/PP/h3f_n2_raprap_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisRap}); + histos.add("Reco/PP/h3f_n2_raprap_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisRap, axisRap}); + histos.add("Reco/PP/h3f_n2_raprap_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisRap}); + histos.add("Reco/PP/h3f_n2_phiphi_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisPhi, axisPhi}); + histos.add("Reco/PP/h3f_n2_phiphi_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisPhi, axisPhi}); + histos.add("Reco/PP/h3f_n2_phiphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisPhi, axisPhi}); + + // rho2 for R2 Rap1Phi1Rap2Phi2 + histos.add("Reco/PP/h3f_n2_rapphi_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); + histos.add("Reco/PP/h3f_n2_rapphi_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); + histos.add("Reco/PP/h3f_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); + + // rho2 for R2 Qinv + histos.add("Reco/PP/h2f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + + // Clone Pairs Histograms + if (cAnaSecondaryPairs) { + histos.addClone("Reco/PP/", "Reco/PS/"); + histos.addClone("Reco/PP/", "Reco/SP/"); + histos.addClone("Reco/PP/", "Reco/SS/"); + } + } + + // MCGen + if (doprocessMCGen) { + histos.addClone("Event/Reco/", "Event/McGen/"); + histos.addClone("Reco/", "McGen/"); + } + } + + template + void fillPairHistos(U& p1, U& p2) + { + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirPrmScd[] = {"PP/", "PS/", "SP/", "SS/"}; + static constexpr std::string_view SubDirHist[] = {"LaP_LaM", "LaP_LaP", "LaM_LaM"}; + + float rap1 = (cDoEtaAnalysis) ? p1.eta() : p1.rap(); + float rap2 = (cDoEtaAnalysis) ? p2.eta() : p2.rap(); + + int rapbin1 = static_cast((rap1 - kminrap) / rapbinwidth); + int rapbin2 = static_cast((rap2 - kminrap) / rapbinwidth); + + int phibin1 = static_cast(p1.phi() / phibinwidth); + int phibin2 = static_cast(p2.phi() / phibinwidth); + + float corfac = p1.corrFact() * p2.corrFact(); + + // fill rho2 histograms + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_raprap_") + HIST(SubDirHist[part_pair]), cent, rap1, rap2, corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_phiphi_") + HIST(SubDirHist[part_pair]), cent, p1.phi(), p2.phi(), corfac); + + 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(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_rapphi_") + HIST(SubDirHist[part_pair]), cent, rapphix + 0.5, rapphiy + 0.5, corfac); + } + + // qinv histograms + 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(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h2f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, qinv, corfac); + } + + template + void analyzeSingles(T const& tracks) + { + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirPrmScd[] = {"Primary/", "Secondary/"}; + static constexpr std::string_view SubDirHist[] = {"LaP", "LaM"}; + + int ntrk = 0; + + for (auto const& track : tracks) { + // count tracks + ++ntrk; + + // Efficiency Plots + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h2f_n1_centpt_") + HIST(SubDirHist[part]), cent, track.pt()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centpteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centptrap_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap()); + + // QA Plots + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_centmasspt_") + HIST(SubDirHist[part]), cent, track.mass(), track.pt()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_pt_") + HIST(SubDirHist[part]), cent, track.pt(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_eta_") + HIST(SubDirHist[part]), cent, track.eta(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_phi_") + HIST(SubDirHist[part]), cent, track.phi(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_rap_") + HIST(SubDirHist[part]), cent, track.rap(), track.corrFact()); + + // Rho1 for N1RapPhi + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_rapphi_") + HIST(SubDirHist[part]), cent, track.rap(), track.phi(), track.corrFact()); + + // Rho1 for Q_{inv} Bkg Estimation + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_pteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta(), track.corrFact()); + } + + // fill multiplicity histograms + if (ntrk != 0) { + if (part == kLambda) { + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h2f_lambda_mult"), cent, ntrk); + } else { + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h2f_antilambda_mult"), cent, ntrk); + } + } + } + + template + void analyzePairs(T const& trks_1, T const& trks_2) + { + for (auto const& trk_1 : trks_1) { + for (auto const& trk_2 : trks_2) { + // check for same index for Lambda-Lambda / AntiLambda-AntiLambda + if (samelambda && ((trk_1.index() == trk_2.index()))) { + continue; + } + fillPairHistos(trk_1, trk_2); + } + } + } + + using LambdaCollisions = aod::LambdaCollisions; + using LambdaTracks = soa::Join; + + // using MyCascades = aod::CascDataExt; // ← NOT CascDatas. NEVER CascDatas. + using MyCascades = soa::Filtered; + + SliceCache cache; + Partition partPrimLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partPrimAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + Partition partSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) + { + histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); + histos.fill(HIST("Event/Reco/h1f_ft0m_mult_percentile"), collision.cent()); + histos.fill(HIST("Event/Reco/h2f_Mult_vs_Centrality"), collision.cent(), collision.mult()); + + cent = collision.cent(); + + auto lambdaPrimTracks = partPrimLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaPrimTracks = partPrimAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto lambdaSecdTracks = partSecdLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaSecdTracks = partSecdAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + + analyzeSingles(lambdaPrimTracks); + analyzeSingles(antiLambdaPrimTracks); + + if (cAnaSecondaries) { + analyzeSingles(lambdaSecdTracks); + analyzeSingles(antiLambdaSecdTracks); + } + + if (cAnaPairs) { + // Primary Pairs Only + analyzePairs(lambdaPrimTracks, antiLambdaPrimTracks); + analyzePairs(lambdaPrimTracks, lambdaPrimTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaPrimTracks); + + // Secondary Pairs + if (cAnaSecondaryPairs) { + analyzePairs(lambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaPrimTracks, lambdaSecdTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, lambdaPrimTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, lambdaSecdTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaSecdTracks); + } + } + } + + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); + + using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; + using LambdaMcGenTracks = aod::LambdaMcGenTracks; + + SliceCache cachemc; + Partition partMcPrimLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partMcPrimAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partMcSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + Partition partMcSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + + void processMCGen(LambdaMcGenCollisions::iterator const& mcgencol, LambdaMcGenTracks const&) + { + histos.fill(HIST("Event/McGen/h1f_collision_posz"), mcgencol.posZ()); + histos.fill(HIST("Event/McGen/h1f_ft0m_mult_percentile"), mcgencol.cent()); + histos.fill(HIST("Event/McGen/h2f_Mult_vs_Centrality"), mcgencol.cent(), mcgencol.mult()); + + cent = mcgencol.cent(); + + auto lambdaPrimTracks = partMcPrimLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto antiLambdaPrimTracks = partMcPrimAntiLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto lambdaSecdTracks = partMcSecdLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto antiLambdaSecdTracks = partMcSecdAntiLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + + analyzeSingles(lambdaPrimTracks); + analyzeSingles(antiLambdaPrimTracks); + + if (cAnaSecondaries) { + analyzeSingles(lambdaSecdTracks); + analyzeSingles(antiLambdaSecdTracks); + } + + if (cAnaPairs) { + // Primary Pairs Only + analyzePairs(lambdaPrimTracks, antiLambdaPrimTracks); + analyzePairs(lambdaPrimTracks, lambdaPrimTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaPrimTracks); + + // Secondary Pairs + if (cAnaSecondaryPairs) { + analyzePairs(lambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaPrimTracks, lambdaSecdTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, lambdaPrimTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, lambdaSecdTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaSecdTracks); + } + } + } + + PROCESS_SWITCH(LambdaR2Correlation, processMCGen, "Process for MC Generated", false); +}; + +struct CascadeSelector { + + Service ccdb; + Service pdgDB; + + 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"}; + Configurable doNoSameBunchPileUp{"doNoSameBunchPileUp", true, "Switch to apply NoSameBunchPileUp event selection"}; + Configurable INEL{"INEL", 0, "Number of charged tracks within |eta| < 1 has to be greater than value"}; + Configurable maxVertexZ{"maxVertexZ", 10., "Maximum value of z coordinate of PV"}; + Configurable etaCascades{"etaCascades", 0.8, "min/max of eta for cascades"}; + Configurable doCompetingMassCut{"doCompetingMassCut", true, "Switch to apply a competing mass cut for the Omega's"}; + Configurable competingMassWindow{"competingMassWindow", 0.01, "Mass window for the competing mass cut"}; + + // 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", 1.0, "min/max of eta for tracks"}; + Configurable tpcChi2{"tpcChi2", 4, "TPC Chi2"}; + Configurable itsChi2{"itsChi2", 36, "ITS Chi2"}; + + // Selection criteria - compatible with core wagon autodetect - copied from cascadeanalysis.cxx + //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* + Configurable v0setting_cospa{"v0setting_cospa", 0.995, "v0setting_cospa"}; + Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1.0, "v0setting_dcav0dau"}; + Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.1, "v0setting_dcapostopv"}; + Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.1, "v0setting_dcanegtopv"}; + Configurable v0setting_radius{"v0setting_radius", 0.9, "v0setting_radius"}; + Configurable cascadesetting_cospa{"cascadesetting_cospa", 0.95, "cascadesetting_cospa"}; + Configurable cascadesetting_dcacascdau{"cascadesetting_dcacascdau", 1.0, "cascadesetting_dcacascdau"}; + Configurable cascadesetting_dcabachtopv{"cascadesetting_dcabachtopv", 0.05, "cascadesetting_dcabachtopv"}; + Configurable cascadesetting_cascradius{"cascadesetting_cascradius", 0.9, "cascadesetting_cascradius"}; + Configurable cascadesetting_v0masswindow{"cascadesetting_v0masswindow", 0.01, "cascadesetting_v0masswindow"}; + Configurable cascadesetting_mindcav0topv{"cascadesetting_mindcav0topv", 0.01, "cascadesetting_mindcav0topv"}; + //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* + + // TODO: variables as function of Omega mass, only do Xi for now + ConfigurableAxis radiusAxis = {"radiusAxis", {100, 0.0f, 50.0f}, "cm"}; + ConfigurableAxis cpaAxis = {"cpaAxis", {100, 0.95f, 1.0f}, "CPA"}; + ConfigurableAxis vertexAxis = {"vertexAxis", {100, -10.0f, 10.0f}, "cm"}; + ConfigurableAxis dcaAxis = {"dcaAxis", {100, 0.0f, 2.0f}, "cm"}; + ConfigurableAxis invXiMassAxis = {"invXiMassAxis", {100, 1.28f, 1.38f}, "Inv. Mass (GeV/c^{2})"}; + ConfigurableAxis invOmegaMassAxis = {"invOmegaMassAxis", {100, 1.62f, 1.72f}, "Inv. Mass (GeV/c^{2})"}; + ConfigurableAxis ptAxis = {"ptAxis", {150, 0, 15}, "#it{p}_{T}"}; + ConfigurableAxis rapidityAxis{"rapidityAxis", {100, -1.f, 1.f}, "y"}; + ConfigurableAxis invLambdaMassAxis{"invLambdaMassAxis", {100, 1.07f, 1.17f}, "Inv. Mass (GeV/c^{2})"}; + AxisSpec itsClustersAxis{8, -0.5, 7.5, "number of ITS clusters"}; + AxisSpec tpcRowsAxis{160, -0.5, 159.5, "TPC crossed rows"}; + HistogramRegistry registry{ + "registry", + { + // basic selection variables + {"hV0Radius", "hV0Radius", {HistType::kTH3F, {radiusAxis, invXiMassAxis, ptAxis}}}, + {"hCascRadius", "hCascRadius", {HistType::kTH3F, {radiusAxis, invXiMassAxis, ptAxis}}}, + {"hV0CosPA", "hV0CosPA", {HistType::kTH3F, {cpaAxis, invXiMassAxis, ptAxis}}}, + {"hCascCosPA", "hCascCosPA", {HistType::kTH3F, {cpaAxis, invXiMassAxis, ptAxis}}}, + {"hDCAPosToPV", "hDCAPosToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCANegToPV", "hDCANegToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCABachToPV", "hDCABachToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCAV0ToPV", "hDCAV0ToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCAV0Dau", "hDCAV0Dau", {HistType::kTH3F, {dcaAxis, invXiMassAxis, ptAxis}}}, + {"hDCACascDau", "hDCACascDau", {HistType::kTH3F, {dcaAxis, invXiMassAxis, ptAxis}}}, + {"hLambdaMass", "hLambdaMass", {HistType::kTH3F, {invLambdaMassAxis, invXiMassAxis, ptAxis}}}, + + {"hMassXiMinus", "hMassXiMinus", {HistType::kTH3F, {invXiMassAxis, ptAxis, rapidityAxis}}}, + {"hMassXiPlus", "hMassXiPlus", {HistType::kTH3F, {invXiMassAxis, ptAxis, rapidityAxis}}}, + {"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH3F, {invOmegaMassAxis, ptAxis, rapidityAxis}}}, + {"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH3F, {invOmegaMassAxis, ptAxis, rapidityAxis}}}, + + // // invariant mass per cut, start with Xi + // {"hMassXi0", "Xi inv mass before selections", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi1", "Xi inv mass after TPCnCrossedRows cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi2", "Xi inv mass after ITSnClusters cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi3", "Xi inv mass after topo cuts", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi4", "Xi inv mass after V0 daughters PID cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi5", "Xi inv mass after bachelor PID cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + + // ITS & TPC clusters, with Xi inv mass + {"hTPCnCrossedRowsPos", "hTPCnCrossedRowsPos", {HistType::kTH3F, {tpcRowsAxis, invXiMassAxis, ptAxis}}}, + {"hTPCnCrossedRowsNeg", "hTPCnCrossedRowsNeg", {HistType::kTH3F, {tpcRowsAxis, invXiMassAxis, ptAxis}}}, + {"hTPCnCrossedRowsBach", "hTPCnCrossedRowsBach", {HistType::kTH3F, {tpcRowsAxis, invXiMassAxis, ptAxis}}}, + {"hITSnClustersPos", "hITSnClustersPos", {HistType::kTH3F, {itsClustersAxis, invXiMassAxis, ptAxis}}}, + {"hITSnClustersNeg", "hITSnClustersNeg", {HistType::kTH3F, {itsClustersAxis, invXiMassAxis, ptAxis}}}, + {"hITSnClustersBach", "hITSnClustersBach", {HistType::kTH3F, {itsClustersAxis, invXiMassAxis, ptAxis}}}, + {"hTPCChi2Pos", "hTPCChi2Pos", {HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Pos"}}}}, + {"hTPCChi2Neg", "hTPCChi2Neg", {HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Neg"}}}}, + {"hTPCChi2Bach", "hTPCChi2Bach", {HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Bach"}}}}, + {"hITSChi2Pos", "hITSChi2Pos", {HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Pos"}}}}, + {"hITSChi2Neg", "hITSChi2Neg", {HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Neg"}}}}, + {"hITSChi2Bach", "hITSChi2Bach", {HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Bach"}}}}, + + {"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, "track Chi2 OK"); + h->GetXaxis()->SetBinLabel(5, "Topo OK"); + h->GetXaxis()->SetBinLabel(6, "Track eta OK"); + h->GetXaxis()->SetBinLabel(7, "Cascade eta OK"); + h->GetXaxis()->SetBinLabel(8, "V0 PID OK"); + h->GetXaxis()->SetBinLabel(9, "Bach PID OK"); + + auto hEventSel = registry.add("hEventSel", "hEventSel", HistType::kTH1I, {{10, 0, 10, "selection criteria"}}); + hEventSel->GetXaxis()->SetBinLabel(1, "All"); + hEventSel->GetXaxis()->SetBinLabel(2, "sel8"); + hEventSel->GetXaxis()->SetBinLabel(3, "INEL0"); + hEventSel->GetXaxis()->SetBinLabel(4, "V_z"); + hEventSel->GetXaxis()->SetBinLabel(5, "NoSameBunchPileUp"); + hEventSel->GetXaxis()->SetBinLabel(6, "Selected events"); + + if (doprocessRecMC) { + // only create the rec matched to gen histograms if relevant + registry.add("truerec/hV0Radius", "hV0Radius", HistType::kTH1F, {radiusAxis}); + registry.add("truerec/hCascRadius", "hCascRadius", HistType::kTH1F, {radiusAxis}); + registry.add("truerec/hV0CosPA", "hV0CosPA", HistType::kTH1F, {cpaAxis}); + registry.add("truerec/hCascCosPA", "hCascCosPA", HistType::kTH1F, {cpaAxis}); + registry.add("truerec/hDCAPosToPV", "hDCAPosToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCANegToPV", "hDCANegToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCABachToPV", "hDCABachToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCAV0ToPV", "hDCAV0ToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCAV0Dau", "hDCAV0Dau", HistType::kTH1F, {dcaAxis}); + registry.add("truerec/hDCACascDau", "hDCACascDau", HistType::kTH1F, {dcaAxis}); + registry.add("truerec/hLambdaMass", "hLambdaMass", HistType::kTH1F, {invLambdaMassAxis}); + registry.add("truerec/hTPCnCrossedRowsPos", "hTPCnCrossedRowsPos", HistType::kTH1F, {tpcRowsAxis}); + registry.add("truerec/hTPCnCrossedRowsNeg", "hTPCnCrossedRowsNeg", HistType::kTH1F, {tpcRowsAxis}); + registry.add("truerec/hTPCnCrossedRowsBach", "hTPCnCrossedRowsBach", HistType::kTH1F, {tpcRowsAxis}); + registry.add("truerec/hITSnClustersPos", "hITSnClustersPos", HistType::kTH1F, {itsClustersAxis}); + registry.add("truerec/hITSnClustersNeg", "hITSnClustersNeg", HistType::kTH1F, {itsClustersAxis}); + registry.add("truerec/hITSnClustersBach", "hITSnClustersBach", HistType::kTH1F, {itsClustersAxis}); + registry.add("truerec/hTPCChi2Pos", "hTPCChi2Pos", HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Pos"}}); + registry.add("truerec/hTPCChi2Neg", "hTPCChi2Neg", HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Neg"}}); + registry.add("truerec/hTPCChi2Bach", "hTPCChi2Bach", HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Bach"}}); + registry.add("truerec/hITSChi2Pos", "hITSChi2Pos", HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Pos"}}); + registry.add("truerec/hITSChi2Neg", "hITSChi2Neg", HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Neg"}}); + registry.add("truerec/hITSChi2Bach", "hITSChi2Bach", HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Bach"}}); + registry.add("truerec/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("truerec/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("truerec/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("truerec/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + } + + if (doprocessGenMC) { + // only create the MC gen histograms if relevant + registry.add("gen/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("gen/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("gen/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("gen/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + + registry.add("genwithrec/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("genwithrec/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("genwithrec/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("genwithrec/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + + registry.add("genwithrec/hNevents", "hNevents", HistType::kTH1F, {{1, 0, 1, "N generated events with reconstructed event"}}); + registry.add("gen/hNevents", "hNevents", HistType::kTH1F, {{1, 0, 1, "N generated events"}}); + } + } + + template + bool eventSelection(TCollision const& collision, bool fillHistos) + { + + if (fillHistos) + registry.fill(HIST("hEventSel"), 0); + if (doSel8 && !collision.sel8()) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 1); + return false; + } else if (collision.multNTracksPVeta1() <= INEL) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 2); + return false; + } else if (std::abs(collision.posZ()) > maxVertexZ) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 3); + return false; + } else if (doNoSameBunchPileUp && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 4); + return false; + } + // passes all selections + if (fillHistos) + registry.fill(HIST("hEventSel"), 5); + return true; + } + + template + void fillMatchedHistos(LabeledCascades::iterator rec, int flag, TCollision collision) + { + if (flag == 0) + return; + if (!rec.has_mcParticle()) + return; + auto gen = rec.mcParticle(); + if (!gen.isPhysicalPrimary()) + return; + int genpdg = gen.pdgCode(); + if ((flag < 3 && std::abs(genpdg) == 3312) || (flag > 1 && std::abs(genpdg) == 3334)) { + // if casc is consistent with Xi and has matched gen Xi OR cand is consistent with Omega and has matched gen omega + // have to do this in case we reco true Xi with only Omega hypothesis (or vice versa) (very unlikely) + registry.fill(HIST("truerec/hV0Radius"), rec.v0radius()); + registry.fill(HIST("truerec/hCascRadius"), rec.cascradius()); + registry.fill(HIST("truerec/hV0CosPA"), rec.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("truerec/hCascCosPA"), rec.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("truerec/hDCAPosToPV"), rec.dcapostopv()); + registry.fill(HIST("truerec/hDCANegToPV"), rec.dcanegtopv()); + registry.fill(HIST("truerec/hDCABachToPV"), rec.dcabachtopv()); + registry.fill(HIST("truerec/hDCAV0ToPV"), rec.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("truerec/hDCAV0Dau"), rec.dcaV0daughters()); + registry.fill(HIST("truerec/hDCACascDau"), rec.dcacascdaughters()); + registry.fill(HIST("truerec/hLambdaMass"), rec.mLambda()); + registry.fill(HIST("truerec/hITSnClustersPos"), rec.posTrack_as().itsNCls()); + registry.fill(HIST("truerec/hITSnClustersNeg"), rec.negTrack_as().itsNCls()); + registry.fill(HIST("truerec/hITSnClustersBach"), rec.bachelor_as().itsNCls()); + registry.fill(HIST("truerec/hTPCnCrossedRowsPos"), rec.posTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("truerec/hTPCnCrossedRowsNeg"), rec.negTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("truerec/hTPCnCrossedRowsBach"), rec.bachelor_as().tpcNClsCrossedRows()); + registry.fill(HIST("truerec/hITSChi2Pos"), rec.posTrack_as().itsChi2NCl()); + registry.fill(HIST("truerec/hITSChi2Neg"), rec.negTrack_as().itsChi2NCl()); + registry.fill(HIST("truerec/hITSChi2Bach"), rec.bachelor_as().itsChi2NCl()); + registry.fill(HIST("truerec/hTPCChi2Pos"), rec.posTrack_as().tpcChi2NCl()); + registry.fill(HIST("truerec/hTPCChi2Neg"), rec.negTrack_as().tpcChi2NCl()); + registry.fill(HIST("truerec/hTPCChi2Bach"), rec.bachelor_as().tpcChi2NCl()); + switch (genpdg) { // is matched so we can use genpdg + case 3312: + registry.fill(HIST("truerec/hXiMinus"), rec.pt(), rec.yXi()); + break; + case -3312: + registry.fill(HIST("truerec/hXiPlus"), rec.pt(), rec.yXi()); + break; + case 3334: + registry.fill(HIST("truerec/hOmegaMinus"), rec.pt(), rec.yOmega()); + break; + case -3334: + registry.fill(HIST("truerec/hOmegaPlus"), rec.pt(), rec.yOmega()); + break; + } + } + } + + template + int processCandidate(TCascade const& casc, TCollision const& collision) + { + // these are the tracks: + auto bachTrack = casc.template bachelor_as(); + auto posTrack = casc.template posTrack_as(); + auto negTrack = casc.template negTrack_as(); + + // topo variables before cuts: + registry.fill(HIST("hV0Radius"), casc.v0radius(), casc.mXi(), casc.pt()); + registry.fill(HIST("hCascRadius"), casc.cascradius(), casc.mXi(), casc.pt()); + registry.fill(HIST("hV0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), casc.mXi(), casc.pt()); + registry.fill(HIST("hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCAPosToPV"), casc.dcapostopv(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCANegToPV"), casc.dcanegtopv(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCABachToPV"), casc.dcabachtopv(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCAV0ToPV"), casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCAV0Dau"), casc.dcaV0daughters(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCACascDau"), casc.dcacascdaughters(), casc.mXi(), casc.pt()); + registry.fill(HIST("hLambdaMass"), casc.mLambda(), casc.mXi(), casc.pt()); + + registry.fill(HIST("hITSnClustersPos"), posTrack.itsNCls(), casc.mXi(), casc.pt()); + registry.fill(HIST("hITSnClustersNeg"), negTrack.itsNCls(), casc.mXi(), casc.pt()); + registry.fill(HIST("hITSnClustersBach"), bachTrack.itsNCls(), casc.mXi(), casc.pt()); + registry.fill(HIST("hTPCnCrossedRowsPos"), posTrack.tpcNClsCrossedRows(), casc.mXi(), casc.pt()); + registry.fill(HIST("hTPCnCrossedRowsNeg"), negTrack.tpcNClsCrossedRows(), casc.mXi(), casc.pt()); + registry.fill(HIST("hTPCnCrossedRowsBach"), bachTrack.tpcNClsCrossedRows(), casc.mXi(), casc.pt()); + registry.fill(HIST("hITSChi2Pos"), posTrack.itsChi2NCl()); + registry.fill(HIST("hITSChi2Neg"), negTrack.itsChi2NCl()); + registry.fill(HIST("hITSChi2Bach"), bachTrack.itsChi2NCl()); + registry.fill(HIST("hTPCChi2Pos"), posTrack.tpcChi2NCl()); + registry.fill(HIST("hTPCChi2Neg"), negTrack.tpcChi2NCl()); + registry.fill(HIST("hTPCChi2Bach"), bachTrack.tpcChi2NCl()); + + registry.fill(HIST("hSelectionStatus"), 0); // all the cascade before selections + // registry.fill(HIST("hMassXi0"), casc.mXi(), casc.pt()); + + // TPC N crossed rows todo: check if minTPCCrossedRows > 50 + if (posTrack.tpcNClsCrossedRows() < minTPCCrossedRows || negTrack.tpcNClsCrossedRows() < minTPCCrossedRows || bachTrack.tpcNClsCrossedRows() < minTPCCrossedRows) + return 0; + + registry.fill(HIST("hSelectionStatus"), 1); // passes nTPC crossed rows + // registry.fill(HIST("hMassXi1"), casc.mXi(), casc.pt()); + + // ITS N clusters todo: check if minITSClusters > 0 + if (posTrack.itsNCls() < minITSClusters || negTrack.itsNCls() < minITSClusters || bachTrack.itsNCls() < minITSClusters) + return 0; + + registry.fill(HIST("hSelectionStatus"), 2); // passes nITS clusters + // registry.fill(HIST("hMassXi2"), casc.mXi(), casc.pt()); + + // Chi2 cuts + if (posTrack.itsChi2NCl() > itsChi2 || negTrack.itsChi2NCl() > itsChi2 || bachTrack.itsChi2NCl() > itsChi2) + return 0; + if (posTrack.tpcChi2NCl() > tpcChi2 || negTrack.tpcChi2NCl() > tpcChi2 || bachTrack.tpcChi2NCl() > tpcChi2) + return 0; + + registry.fill(HIST("hSelectionStatus"), 3); // passes Chi2 cuts + + //// TOPO CUTS //// TODO: improve! + double pvx = collision.posX(); + double pvy = collision.posY(); + double pvz = collision.posZ(); + if (casc.v0radius() < v0setting_radius || + casc.cascradius() < cascadesetting_cascradius || + casc.v0cosPA(pvx, pvy, pvz) < v0setting_cospa || + casc.casccosPA(pvx, pvy, pvz) < cascadesetting_cospa || + casc.dcav0topv(pvx, pvy, pvz) < cascadesetting_mindcav0topv || + std::abs(casc.mLambda() - 1.115683) > cascadesetting_v0masswindow) + return 0; // It failed at least one topo selection + + registry.fill(HIST("hSelectionStatus"), 4); // passes topo + // registry.fill(HIST("hMassXi3"), casc.mXi(), casc.pt()); + + if (std::abs(posTrack.eta()) > etaTracks || std::abs(negTrack.eta()) > etaTracks || std::abs(bachTrack.eta()) > etaTracks) + return 0; + + registry.fill(HIST("hSelectionStatus"), 5); // passes track eta + + if (std::abs(casc.eta()) > etaCascades) + return 0; + + registry.fill(HIST("hSelectionStatus"), 6); // passes candidate eta + + // TODO: TOF (for pT > 2 GeV per track?) + + //// TPC PID //// + // Lambda check + if (casc.sign() < 0) { + // Proton check: + if (std::abs(posTrack.tpcNSigmaPr()) > tpcNsigmaProton) + return 0; + // Pion check: + if (std::abs(negTrack.tpcNSigmaPi()) > tpcNsigmaPion) + return 0; + } else { + // Proton check: + if (std::abs(negTrack.tpcNSigmaPr()) > tpcNsigmaProton) + return 0; + // Pion check: + if (std::abs(posTrack.tpcNSigmaPi()) > tpcNsigmaPion) + return 0; + } + registry.fill(HIST("hSelectionStatus"), 7); // passes V0 daughters PID + // registry.fill(HIST("hMassXi4"), casc.mXi(), casc.pt()); + + // setting selection flag based on bachelor PID (and competing mass cut for omega's) + int flag = 0; + if (std::abs(bachTrack.tpcNSigmaPi()) < tpcNsigmaBachelor) + flag = 1; + if (std::abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor && (!doCompetingMassCut || std::abs(pdgDB->Mass(3312) - casc.mXi()) > competingMassWindow)) + flag = 3 - flag; // 3 if only consistent with omega, 2 if consistent with both + + switch (flag) { + case 1: // only Xi + registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID + if (casc.sign() < 0) { + registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi()); + } else { + registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi()); + } + break; + case 2: // Xi or Omega + registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID + if (casc.sign() < 0) { + registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi()); + registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } else { + registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi()); + registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } + break; + case 3: // only Omega + registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID + if (casc.sign() < 0) { + registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } else { + registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } + break; + } + + return flag; + + } // processCandidate + + void processGenMC(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) + { + // evsel + if (INEL >= 0 && !pwglf::isINELgtNmc(mcParticles, INEL, pdgDB)) + return; + if (std::abs(mcCollision.posZ()) > maxVertexZ) + return; + + registry.fill(HIST("gen/hNevents"), 0); + + for (auto const& mcPart : mcParticles) { + if (!mcPart.isPhysicalPrimary()) + continue; + if (std::abs(mcPart.eta()) > etaCascades) + continue; + + switch (mcPart.pdgCode()) { + case 3312: + registry.fill(HIST("gen/hXiMinus"), mcPart.pt(), mcPart.y()); + break; + case -3312: + registry.fill(HIST("gen/hXiPlus"), mcPart.pt(), mcPart.y()); + break; + case 3334: + registry.fill(HIST("gen/hOmegaMinus"), mcPart.pt(), mcPart.y()); + break; + case -3334: + registry.fill(HIST("gen/hOmegaPlus"), mcPart.pt(), mcPart.y()); + break; + } + } + + // Do the same thing, but now making sure there is at least one matched reconstructed event: + if (collisions.size() < 1) { + return; + } else { + bool evSel = false; // will be true if at least one rec. collision passes evsel + for (auto const& collision : collisions) { + // can be more than 1 rec. collisions due to event splitting + evSel = eventSelection(collision, false); + if (evSel) // exit loop if we find 1 rec. event that passes evsel + break; + } + if (evSel) { + // N gen events with a reconstructed event + registry.fill(HIST("genwithrec/hNevents"), 0); + + for (auto const& mcPart : mcParticles) { + if (!mcPart.isPhysicalPrimary()) + continue; + if (std::abs(mcPart.eta()) > etaCascades) + continue; + + switch (mcPart.pdgCode()) { + case 3312: + registry.fill(HIST("genwithrec/hXiMinus"), mcPart.pt(), mcPart.y()); + break; + case -3312: + registry.fill(HIST("genwithrec/hXiPlus"), mcPart.pt(), mcPart.y()); + break; + case 3334: + registry.fill(HIST("genwithrec/hOmegaMinus"), mcPart.pt(), mcPart.y()); + break; + case -3334: + registry.fill(HIST("genwithrec/hOmegaPlus"), mcPart.pt(), mcPart.y()); + break; + } + } + } + } + } // processGen + + // wrappers for data/MC processes on reco level + void processRecData(MyCollisions::iterator const& collision, aod::CascDataExt const& Cascades, FullTracksExtIUWithPID const&, aod::BCsWithTimestamps const&) + { + bool evSel = eventSelection(collision, true); + // do not skip the collision if event selection fails - 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; + } + int flag = processCandidate(casc, collision); + cascflags(flag); + } + } + + void processRecMC(MyCollisions::iterator const& collision, LabeledCascades const& Cascades, FullTracksExtIUWithPID const&, aod::BCsWithTimestamps const&, aod::McParticles const&) + { + bool evSel = eventSelection(collision, true); + // do not skip the collision if event selection fails - 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; + } + int flag = processCandidate(casc, collision); + cascflags(flag); + // do mc matching here + fillMatchedHistos(casc, flag, collision); // if sign < 0 then pdg > 0 + } + } + + PROCESS_SWITCH(CascadeSelector, processRecData, "Process rec data", true); + PROCESS_SWITCH(CascadeSelector, processRecMC, "Process rec MC", false); + PROCESS_SWITCH(CascadeSelector, processGenMC, "Process gen MC", false); +}; // struct + +struct CascadeCorrelations { + Service ccdb; + + // 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{"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"}; + + ConfigurableAxis radiusAxis = {"radiusAxis", {100, 0.0f, 50.0f}, "cm"}; + ConfigurableAxis cpaAxis = {"cpaAxis", {100, 0.95f, 1.0f}, "CPA"}; + ConfigurableAxis invMassAxis = {"invMassAxis", {1000, 1.0f, 2.0f}, "Inv. Mass (GeV/c^{2})"}; + ConfigurableAxis deltaPhiAxis = {"deltaPhiAxis", {180, -PIHalf, 3 * PIHalf}, "#Delta#varphi"}; // 180 is divisible by 18 (tpc sectors) and 20 (run 2 binning) + ConfigurableAxis ptAxis = {"ptAxis", {150, 0, 15}, "#it{p}_{T}"}; + ConfigurableAxis vertexAxis = {"vertexAxis", {200, -10.0f, 10.0f}, "cm"}; + ConfigurableAxis dcaAxis = {"dcaAxis", {100, 0.0f, 2.0f}, "cm"}; + ConfigurableAxis multiplicityAxis{"multiplicityAxis", {100, 0, 100}, "Multiplicity (centFT0M?)"}; + ConfigurableAxis invLambdaMassAxis{"invLambdaMassAxis", {100, 1.07f, 1.17f}, "Inv. Mass (GeV/c^{2})"}; + AxisSpec signAxis{3, -1.5, 1.5, "sign of cascade"}; + AxisSpec deltaYAxis{40, -2.f, 2.f, "#Delta y"}; + AxisSpec rapidityAxis{100, -1.f, 1.f, "y"}; + AxisSpec selectionFlagAxis{4, -0.5f, 3.5f, "Selection flag of casc candidate"}; + AxisSpec itsClustersAxis{8, -0.5, 7.5, "number of ITS clusters"}; + AxisSpec tpcRowsAxis{160, -0.5, 159.5, "TPC crossed rows"}; + + // initialize efficiency maps + TH1D* hEffXiMin; + TH1D* hEffXiPlus; + TH1D* hEffOmegaMin; + TH1D* hEffOmegaPlus; + + // used in MC closure test + Service pdgDB; + o2::pwglf::ParticleCounter mCounter; + + void init(InitContext const&) + { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + if (doEfficiencyCorrection) { + TList* effList = ccdb->getForTimeStamp(efficiencyCCDBPath, 1); + if (!effList) { + LOGF(fatal, "null ptr in efficiency list!"); + } + hEffXiMin = static_cast(effList->FindObject("hXiMinEff")); + hEffXiPlus = static_cast(effList->FindObject("hXiPlusEff")); + hEffOmegaMin = static_cast(effList->FindObject("hOmegaMinEff")); + hEffOmegaPlus = static_cast(effList->FindObject("hOmegaPlusEff")); + } + + mCounter.mPdgDatabase = pdgDB.service; + mCounter.mSelectPrimaries = true; + } + + double getEfficiency(TH1* h, double pT, double y = 0) + { + // This function returns 1 / eff + double eff = h->GetBinContent(h->FindFixBin(pT, y)); + if (eff == 0) + return 0; + else + return 1. / eff; + } + + bool autoCorrelation(std::array triggerTracks, std::array assocTracks) + { + // function that loops over 2 arrays of track indices, checking for common elements + for (int triggerTrack : triggerTracks) { + for (int assocTrack : assocTracks) { + if (triggerTrack == assocTrack) + return true; + } + } + return false; + } + + HistogramRegistry registry{ + "registry", + { + // inv mass + {"hMassXiMinus", "hMassXiMinus", {HistType::kTH3F, {{200, 1.24, 1.44, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + {"hMassXiPlus", "hMassXiPlus", {HistType::kTH3F, {{200, 1.24, 1.44, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + {"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH3F, {{200, 1.6, 1.8, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + {"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH3F, {{200, 1.6, 1.8, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + // efficiency corrected inv mass + {"hMassXiEffCorrected", "hMassXiEffCorrected", {HistType::kTHnSparseF, {invMassAxis, signAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, + {"hMassOmegaEffCorrected", "hMassOmegaEffCorrected", {HistType::kTHnSparseF, {invMassAxis, signAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, + + // trigger QA + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, + + // basic selection variables (after cuts) + {"hV0Radius", "hV0Radius", {HistType::kTH1F, {radiusAxis}}}, + {"hCascRadius", "hCascRadius", {HistType::kTH1F, {radiusAxis}}}, + {"hV0CosPA", "hV0CosPA", {HistType::kTH1F, {cpaAxis}}}, + {"hCascCosPA", "hCascCosPA", {HistType::kTH1F, {cpaAxis}}}, + {"hDCAPosToPV", "hDCAPosToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCANegToPV", "hDCANegToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCABachToPV", "hDCABachToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCAV0ToPV", "hDCAV0ToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCAV0Dau", "hDCAV0Dau", {HistType::kTH1F, {dcaAxis}}}, + {"hDCACascDau", "hDCACascDau", {HistType::kTH1F, {dcaAxis}}}, + {"hLambdaMass", "hLambdaMass", {HistType::kTH1F, {invLambdaMassAxis}}}, + {"hTPCnCrossedRowsPos", "hTPCnCrossedRowsPos", {HistType::kTH1F, {tpcRowsAxis}}}, + {"hTPCnCrossedRowsNeg", "hTPCnCrossedRowsNeg", {HistType::kTH1F, {tpcRowsAxis}}}, + {"hTPCnCrossedRowsBach", "hTPCnCrossedRowsBach", {HistType::kTH1F, {tpcRowsAxis}}}, + {"hITSnClustersPos", "hITSnClustersPos", {HistType::kTH1F, {itsClustersAxis}}}, + {"hITSnClustersNeg", "hITSnClustersNeg", {HistType::kTH1F, {itsClustersAxis}}}, + {"hITSnClustersBach", "hITSnClustersBach", {HistType::kTH1F, {itsClustersAxis}}}, + + {"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, {{180, 0, TwoPI, "#varphi"}}}}, + {"hEta", "hEta", {HistType::kTH1F, {{100, -2, 2, "#eta"}}}}, + {"hRapidityXi", "hRapidityXi", {HistType::kTH1F, {rapidityAxis}}}, + {"hRapidityOmega", "hRapidityOmega", {HistType::kTH1F, {rapidityAxis}}}, + + // correlation histos + {"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {deltaPhiAxis}}}, + {"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {deltaPhiAxis}}}, + + {"hXiXi", "hXiXi", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"hXiOm", "hXiOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"hOmOm", "hOmOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + + // Mixed events + {"MixedEvents/hMEVz1", "hMEVz1", {HistType::kTH1F, {vertexAxis}}}, + {"MixedEvents/hMEVz2", "hMEVz2", {HistType::kTH1F, {vertexAxis}}}, + {"MixedEvents/hMEDeltaPhiSS", "hMEDeltaPhiSS", {HistType::kTH1F, {deltaPhiAxis}}}, + {"MixedEvents/hMEDeltaPhiOS", "hMEDeltaPhiOS", {HistType::kTH1F, {deltaPhiAxis}}}, + {"MixedEvents/hMEQA", "hMEQA", {HistType::kTH1I, {{2, 0, 2, "QA for exceptions in ME (this histogram should have 0 entries!)"}}}}, + {"MixedEvents/hMEAutoCorrelation", "hMEAutoCorrelation", {HistType::kTH1I, {{4, -0.5f, 3.5f, "Types of SS autocorrelation"}}}}, + {"MixedEvents/hMEAutoCorrelationOS", "hMEAutoCorrelationOS", {HistType::kTH1I, {{2, -1.f, 1.f, "Charge of OS autocorrelated track"}}}}, + + {"MixedEvents/hMEXiXi", "hMEXiXi", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"MixedEvents/hMEXiOm", "hMEXiOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"MixedEvents/hMEOmOm", "hMEOmOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + + // MC closure + {"MC/hMCPlusMinus", "hMCPlusMinus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + {"MC/hMCPlusPlus", "hMCPlusPlus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + {"MC/hMCMinusPlus", "hMCMinusPlus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + {"MC/hMCMinusMinus", "hMCMinusMinus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + + {"MC/hGenMultNoReco", "hGenMultNoReco", {HistType::kTH1I, {{100, 0, 100, "Number of generated charged primaries"}}}}, + {"MC/hGenMultOneReco", "hGenMultOneReco", {HistType::kTH1I, {{100, 0, 100, "Number of generated charged primaries"}}}}, + {"MC/hSplitEvents", "hSplitEvents", {HistType::kTH1I, {{10, 0, 10, "Number of rec. events per gen event"}}}}, + + // debug + {"MC/hPhi", "hPhi", {HistType::kTH1F, {{180, 0, TwoPI}}}}, + {"MC/hEta", "hEta", {HistType::kTH1F, {{100, -2, 2}}}}, + {"MC/hRapidity", "hRapidity", {HistType::kTH1F, {{100, -2, 2}}}}, + }, + }; + + // cascade filter + Filter cascadeSelector = aod::cascadeflags::isSelected > 0; + + // Warning: it is not possible to use this axis as configurable due to a bug - however, default values are sensible. + 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. + using BinningType = ColumnBinningPolicy; + BinningType colBinning{{axisVtxZ}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + + void processSameEvent(MyCollisionsMult::iterator const& collision, MyCascades const& Cascades, FullTracksExtIU const&, aod::BCsWithTimestamps const&) + { + + double weight; + // Some QA on the 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(), casc.yXi()); + weight = getEfficiency(hEffXiMin, casc.pt(), casc.yXi()); + } else { + registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi()); + weight = getEfficiency(hEffXiPlus, casc.pt(), casc.yXi()); + } + // LOGF(info, "casc pt %f, weight %f", casc.pt(), weight); + registry.fill(HIST("hMassXiEffCorrected"), casc.mXi(), casc.sign(), casc.pt(), casc.yXi(), collision.posZ(), collision.centFT0M(), weight); + registry.fill(HIST("hRapidityXi"), casc.yXi()); + } + if (casc.isSelected() >= 2) { // consistent with Omega or both + if (casc.sign() < 0) { + registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega()); + weight = getEfficiency(hEffOmegaMin, casc.pt(), casc.yOmega()); + } else { + registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega()); + weight = getEfficiency(hEffOmegaPlus, casc.pt(), casc.yOmega()); + } + registry.fill(HIST("hMassOmegaEffCorrected"), casc.mOmega(), casc.sign(), casc.pt(), casc.yOmega(), collision.posZ(), collision.centFT0M(), weight); + registry.fill(HIST("hRapidityOmega"), casc.yOmega()); + } + registry.fill(HIST("hV0Radius"), casc.v0radius()); + registry.fill(HIST("hCascRadius"), casc.cascradius()); + registry.fill(HIST("hV0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hDCAPosToPV"), casc.dcapostopv()); + registry.fill(HIST("hDCANegToPV"), casc.dcanegtopv()); + registry.fill(HIST("hDCABachToPV"), casc.dcabachtopv()); + registry.fill(HIST("hDCAV0ToPV"), casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hDCAV0Dau"), casc.dcaV0daughters()); + registry.fill(HIST("hDCACascDau"), casc.dcacascdaughters()); + registry.fill(HIST("hLambdaMass"), casc.mLambda()); + registry.fill(HIST("hITSnClustersPos"), casc.posTrack_as().itsNCls()); + registry.fill(HIST("hITSnClustersNeg"), casc.negTrack_as().itsNCls()); + registry.fill(HIST("hITSnClustersBach"), casc.bachelor_as().itsNCls()); + registry.fill(HIST("hTPCnCrossedRowsPos"), casc.posTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("hTPCnCrossedRowsNeg"), casc.negTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("hTPCnCrossedRowsBach"), casc.bachelor_as().tpcNClsCrossedRows()); + + registry.fill(HIST("hSelectionFlag"), casc.isSelected()); + registry.fill(HIST("hPhi"), casc.phi()); + registry.fill(HIST("hEta"), casc.eta()); + } // casc loop + + for (auto& [c0, c1] : combinations(Cascades, Cascades)) { // combinations automatically applies strictly upper in case of 2 identical tables + // Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them + auto* triggerAddress = &c0; + auto* assocAddress = &c1; + if (assocAddress->pt() > triggerAddress->pt()) { + std::swap(triggerAddress, assocAddress); + } + auto trigger = *triggerAddress; + auto assoc = *assocAddress; + + // autocorrelation check + std::array triggerTracks = {trigger.posTrackId(), trigger.negTrackId(), trigger.bachelorId()}; + std::array assocTracks = {assoc.posTrackId(), assoc.negTrackId(), assoc.bachelorId()}; + if (autoCorrelation(triggerTracks, assocTracks)) + continue; + + // calculate angular correlations + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); + + double invMassXiTrigg = trigger.mXi(); + double invMassOmTrigg = trigger.mOmega(); + double invMassXiAssoc = assoc.mXi(); + double invMassOmAssoc = assoc.mOmega(); + + double weightTrigg = 1.; + double weightAssoc = 1.; + + if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + registry.fill(HIST("hXiXi"), dphi, trigger.yXi() - assoc.yXi(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("hXiOm"), dphi, trigger.yXi() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + } + if (trigger.isSelected() >= 2 && std::abs(trigger.yOmega()) < maxRapidity) { // trigger Omega + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffOmegaMin, trigger.pt()) : getEfficiency(hEffOmegaPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + // if Omega-Xi, fill the Xi-Omega histogram (flip the trigger/assoc and dphy,dy signs) + registry.fill(HIST("hXiOm"), RecoDecay::constrainAngle(assoc.phi() - trigger.phi(), -PIHalf), -(trigger.yOmega() - assoc.yXi()), assoc.sign(), trigger.sign(), assoc.pt(), trigger.pt(), invMassXiAssoc, invMassOmTrigg, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("hOmOm"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + } + + // QA plots + if (trigger.sign() * assoc.sign() < 0) { + registry.fill(HIST("hDeltaPhiOS"), dphi); + } else { + registry.fill(HIST("hDeltaPhiSS"), dphi); + } + } // correlations + } // process same event + + void processMixedEvent(MyCollisionsMult const& collisions, MyCascades const& Cascades, FullTracksExtIU const&) + { + auto cascadesTuple = std::make_tuple(Cascades); + SameKindPair pair{colBinning, nMixedEvents, -1, collisions, cascadesTuple, &cache}; + + for (auto const& [col1, cascades1, col2, cascades2] : pair) { + if (!col1.sel8() || !col2.sel8()) + continue; + if (std::abs(col1.posZ()) > zVertexCut || std::abs(col2.posZ()) > zVertexCut) + continue; + if (col1.globalIndex() == col2.globalIndex()) { + registry.fill(HIST("hMEQA"), 0.5); + continue; + } + registry.fill(HIST("MixedEvents/hMEVz1"), col1.posZ()); + registry.fill(HIST("MixedEvents/hMEVz2"), col2.posZ()); + + for (auto& [casc1, casc2] : combinations(CombinationsFullIndexPolicy(cascades1, cascades2))) { + // specify FullIndexPolicy since the cascades are from different collisions + auto* triggerAddress = &casc1; + auto* assocAddress = &casc2; + if (assocAddress->pt() > triggerAddress->pt()) { + std::swap(triggerAddress, assocAddress); + } + auto trigger = *triggerAddress; + auto assoc = *assocAddress; + + if (trigger.collisionId() == assoc.collisionId()) { + registry.fill(HIST("hMEQA"), 1.5); + continue; + } + + std::array triggerTracks = {trigger.posTrackId(), trigger.negTrackId(), trigger.bachelorId()}; + std::array assocTracks = {assoc.posTrackId(), assoc.negTrackId(), assoc.bachelorId()}; + if (autoCorrelation(triggerTracks, assocTracks)) + continue; + + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); + + double invMassXiTrigg = trigger.mXi(); + double invMassOmTrigg = trigger.mOmega(); + double invMassXiAssoc = assoc.mXi(); + double invMassOmAssoc = assoc.mOmega(); + + double weightTrigg = 1.; + double weightAssoc = 1.; + + if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + registry.fill(HIST("MixedEvents/hMEXiXi"), dphi, trigger.yXi() - assoc.yXi(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("MixedEvents/hMEXiOm"), dphi, trigger.yXi() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + } + if (trigger.isSelected() >= 2 && std::abs(trigger.yOmega()) < maxRapidity) { // trigger Omega + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffOmegaMin, trigger.pt()) : getEfficiency(hEffOmegaPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + // if Omega-Xi, fill the Xi-Omega histogram (flip the trigger/assoc and dphy,dy signs) + registry.fill(HIST("MixedEvents/hMEXiOm"), RecoDecay::constrainAngle(assoc.phi() - trigger.phi(), -PIHalf), -(trigger.yOmega() - assoc.yXi()), assoc.sign(), trigger.sign(), assoc.pt(), trigger.pt(), invMassXiAssoc, invMassOmTrigg, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("MixedEvents/hMEOmOm"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + } + + // QA plots + if (trigger.sign() * assoc.sign() < 0) { + registry.fill(HIST("MixedEvents/hMEDeltaPhiOS"), dphi); + } else { + registry.fill(HIST("MixedEvents/hMEDeltaPhiSS"), dphi); + } + } // correlations + } // collisions + } // process mixed events + + Configurable etaGenCascades{"etaGenCascades", 0.8, "min/max of eta for generated cascades"}; + Filter genCascadesFilter = nabs(aod::mcparticle::pdgCode) == 3312; + + void processMC(aod::McCollision const&, soa::SmallGroups> const& collisions, soa::Filtered const& genCascades, aod::McParticles const& mcParticles) + { + // Let's do some logic on matched reconstructed collisions - if there less or more than one, fill some QA and skip the rest + double FT0mult = -1; // non-sensible default value just in case + double vtxz = -999.; // non-sensible default value just in case + if (collisions.size() < 1) { + registry.fill(HIST("MC/hSplitEvents"), 0); + registry.fill(HIST("MC/hGenMultNoReco"), mCounter.countFT0A(mcParticles) + mCounter.countFT0C(mcParticles)); + return; + } else if (collisions.size() == 1) { + registry.fill(HIST("MC/hSplitEvents"), 1); + registry.fill(HIST("MC/hGenMultOneReco"), mCounter.countFT0A(mcParticles) + mCounter.countFT0C(mcParticles)); + for (auto const& collision : collisions) { // not really a loop, as there is only one collision + FT0mult = collision.centFT0M(); + vtxz = collision.posZ(); + } + } else if (collisions.size() > 1) { + registry.fill(HIST("MC/hSplitEvents"), collisions.size()); + return; + } + + // QA + for (auto& casc : genCascades) { + if (!casc.isPhysicalPrimary()) + continue; + registry.fill(HIST("MC/hPhi"), casc.phi()); + registry.fill(HIST("MC/hEta"), casc.eta()); + registry.fill(HIST("MC/hRapidity"), casc.y()); + } + + for (auto& [c0, c1] : combinations(genCascades, genCascades)) { // combinations automatically applies strictly upper in case of 2 identical tables + // Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them + auto* triggerAddress = &c0; + auto* assocAddress = &c1; + if (assocAddress->pt() > triggerAddress->pt()) { + std::swap(triggerAddress, assocAddress); + } + auto trigger = *triggerAddress; + auto assoc = *assocAddress; + + if (!trigger.isPhysicalPrimary() || !assoc.isPhysicalPrimary()) + continue; // require the cascades to be primaries + if (std::abs(trigger.eta()) > etaGenCascades) + continue; // only apply eta cut to trigger - trigger normalization still valid without introducing 2-particle-acceptance effects + + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); + + if (trigger.pdgCode() < 0) { // anti-trigg --> Plus + if (assoc.pdgCode() < 0) { // anti-assoc --> Plus + registry.fill(HIST("MC/hMCPlusPlus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } else { // assoc --> Minus + registry.fill(HIST("MC/hMCPlusMinus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } + } else { // trig --> Minus + if (assoc.pdgCode() < 0) { // anti-assoc --> Plus + registry.fill(HIST("MC/hMCMinusPlus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } else { + registry.fill(HIST("MC/hMCMinusMinus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } + } + } + } + + PROCESS_SWITCH(CascadeCorrelations, processSameEvent, "Process same events", true); + PROCESS_SWITCH(CascadeCorrelations, processMixedEvent, "Process mixed events", true); + PROCESS_SWITCH(CascadeCorrelations, processMC, "Process MC", false); + +}; // struct + +// Branch data structs for TTree filling — plain POD, no O2 framework types. +// Stored via a single raw pointer (1 StructToTuple slot) from the task struct. +namespace lxicorr +{ +struct CascBranches { + float pt, rap, mass; + int sign; + float cascCosPA, v0CosPA; + float cascRadius, v0Radius; + float dcaV0Dau, dcaCascDau; + float dcaV0ToPV, dcaPosToPV, dcaNegToPV, dcaBachToPV; + float cent, pvZ; + // MC truth-matching (filled only in MC mode; default = no match) + int pdgCode{0}; // PDG of matched McParticle (0 = no match = background) + bool isPhysPrim{false}; +}; + +// Holds branch data for both Xi and Omega — one raw pointer covers both. +// Gen-level branches — kinematics + truth only, no topology +struct GenBranches { + float pt, rap, cent, pvZ; + int pdgCode; + bool isPhysPrim; +}; + +// Single pointer covers all four branch sets — 1 StructToTuple slot +struct BranchPair { + CascBranches xi{}; + CascBranches om{}; + GenBranches xiGen{}; + GenBranches omGen{}; +}; + +inline void connectBranches(TTree* t, CascBranches* b) +{ + t->Branch("pt", &b->pt); + t->Branch("rap", &b->rap); + t->Branch("mass", &b->mass); + t->Branch("sign", &b->sign); + t->Branch("cascCosPA", &b->cascCosPA); + t->Branch("v0CosPA", &b->v0CosPA); + t->Branch("cascRadius", &b->cascRadius); + t->Branch("v0Radius", &b->v0Radius); + t->Branch("dcaV0Dau", &b->dcaV0Dau); + t->Branch("dcaCascDau", &b->dcaCascDau); + t->Branch("dcaV0ToPV", &b->dcaV0ToPV); + t->Branch("dcaPosToPV", &b->dcaPosToPV); + t->Branch("dcaNegToPV", &b->dcaNegToPV); + t->Branch("dcaBachToPV", &b->dcaBachToPV); + t->Branch("cent", &b->cent); + t->Branch("pvZ", &b->pvZ); + t->Branch("pdgCode", &b->pdgCode); + t->Branch("isPhysPrim", &b->isPhysPrim); +} + +inline void connectGenBranches(TTree* t, GenBranches* b) +{ + t->Branch("pt", &b->pt); + t->Branch("rap", &b->rap); + t->Branch("pdgCode", &b->pdgCode); + t->Branch("isPhysPrim", &b->isPhysPrim); + t->Branch("cent", &b->cent); + t->Branch("pvZ", &b->pvZ); +} +} // namespace lxicorr + +struct LambdaXiCorrelation { + + // --- Configurables --- + Configurable maxY{"maxY", 0.5, "Max |y| for Lambda, Xi and Omega"}; + Configurable useEff{"useEff", false, "Apply Lambda efficiency correction"}; + // Omega bachelor kaon PID cut (kept separate from Xi pion cut for physics correctness) + Configurable tpcNsigmaBachKaon{"tpcNsigmaBachKaon", 3.0f, "TPC NSigma bachelor kaon (Omega selection)"}; + // FT0M centrality bins — same variable-width defaults as LambdaR2Correlation + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.0f, 80.0f, 100.0f}, "FT0M centrality (%)"}; + Configurable saveCascTree{"saveCascTree", false, "Save TTree of cascade topological variables into AnalysisResults.root"}; + + // --- Outputs --- + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // Direct OutputObj members → framework registers and writes these into + // AnalysisResults.root under the "CascadeTrees" folder automatically. + // setObject() is called in init() when saveCascTree is true. + OutputObj treeXi{"XiCandidates", OutputObjHandlingPolicy::AnalysisObject}; + OutputObj treeOmega{"OmegaCandidates", OutputObjHandlingPolicy::AnalysisObject}; + OutputObj treeXiGen{"XiCandidatesGen", OutputObjHandlingPolicy::AnalysisObject}; + OutputObj treeOmegaGen{"OmegaCandidatesGen", OutputObjHandlingPolicy::AnalysisObject}; + // Single raw pointer covers all four branch sets — 1 StructToTuple slot + lxicorr::BranchPair* bp{nullptr}; + + // --- Data Slicing Definitions --- + using GoodLambdas = soa::Join; + Partition goodLambda = aod::lambdatrackext::trueLambdaFlag == true; + + Preslice lambdasPerCollision = aod::lambdatrack::lambdaCollisionId; + Preslice cascadesPerCollision = aod::cascdata::collisionId; + Preslice labeledCascPerCollision = aod::cascdata::collisionId; + // Gen-level lambda slicing: use HashBy (unsorted-safe) via o2::framework::expressions + // Simple approach: iterate all and match by collision index inline (no cache needed) + + using LambdaCollisionsExt = aod::LambdaCollisions; + + // Gen Xi/Omega: PDG filtering is done inline inside each process function. + // (Two Filter declarations on the same table within one struct are AND-ed, + // so |pdg|==3312 AND |pdg|==3334 would always be false.) + Preslice mcParticlesPerMcCollision = aod::mcparticle::mcCollisionId; + + // --- R2 Calculation Helper --- + // R2 = (N_events * Pair_Yield) / (Single_Yield_1 * Single_Yield_2) - 1 + static TH2* calculateR2(TH2* hPairs, TH1* hSinglesTrig, TH1* hSinglesAssoc, double nEvents) + { + if (!hPairs || !hSinglesTrig || !hSinglesAssoc || nEvents <= 0) + return nullptr; + + TH2* hR2 = reinterpret_cast(hPairs->Clone(Form("%s_R2", hPairs->GetName()))); + hR2->Reset(); + + double nS1 = hSinglesTrig->Integral(); + double nS2 = hSinglesAssoc->Integral(); + + if (nS1 > 0 && nS2 > 0) { + hR2->Add(hPairs); + hR2->Scale(nEvents / (nS1 * nS2)); + + for (int i = 1; i <= hR2->GetNbinsX(); i++) { + for (int j = 1; j <= hR2->GetNbinsY(); j++) { + double content = hR2->GetBinContent(i, j); + hR2->SetBinContent(i, j, content - 1.0); + } + } + } + return hR2; + } + + void init(InitContext const&) + { + // --- 1. Axis Definitions --- + const AxisSpec dphi{72, -PIHalf, 3 * PIHalf, "#Delta#varphi"}; + const AxisSpec dy{40, -2.0f, 2.0f, "#Delta y"}; + const AxisSpec cent{centAxis, "FT0M (%)"}; + const AxisSpec pt{100, 0, 10, "p_{T} (GeV/c)"}; + const AxisSpec rap{100, -1.0, 1.0, "y"}; + const AxisSpec massLam{100, 1.09, 1.14, "M_{p#pi} (GeV/c^{2})"}; + const AxisSpec massXi{100, 1.28, 1.36, "M_{#Lambda#pi} (GeV/c^{2})"}; + const AxisSpec massOm{100, 1.62, 1.72, "M_{#LambdaK} (GeV/c^{2})"}; + const AxisSpec radius{100, 0, 100, "Radius (cm)"}; + const AxisSpec cpa{100, 0.9, 1.0, "Cos(PA)"}; + const AxisSpec dca{100, 0.0, 5.0, "DCA (cm)"}; + const AxisSpec pvDca{100, -10.0, 10.0, "DCA to PV (cm)"}; + // Fixed AxisSpec (not ConfigurableAxis) so bin edges cannot be misconfigured at runtime + const AxisSpec tpcRows{160, -0.5, 159.5, "TPC crossed rows"}; + + // --- 2. Histograms --- + histos.add("Event/hEventCount", "Event Counter", kTH1F, {{1, 0, 1, "Count"}}); + + // Singles: Lambda + histos.add("Singles/Lambda/hPt", "Lambda p_{T}", kTH1F, {pt}); + histos.add("Singles/AntiLambda/hPt", "AntiLambda p_{T}", kTH1F, {pt}); + + histos.add("Singles/Lambda/hPtVsMass", "Lambda p_{T} vs Mass", kTH2F, {massLam, pt}); + histos.add("Singles/AntiLambda/hPtVsMass", "AntiLambda p_{T} vs Mass", kTH2F, {massLam, pt}); + + // Singles: Xi & QA + histos.add("QA/Xi/hRadius", "Xi Radius", kTH1F, {radius}); + histos.add("QA/Xi/hCosPA", "Xi CosPA", kTH1F, {cpa}); + histos.add("QA/Xi/hDCAV0Dau", "DCA V0 Daughters", kTH1F, {dca}); + histos.add("QA/Xi/hDCACascDau", "DCA Casc Daughters", kTH1F, {dca}); + histos.add("QA/Xi/hDCAV0ToPV", "DCA V0 to PV", kTH1F, {pvDca}); + histos.add("QA/Xi/hDCAPosToPV", "DCA Pos to PV", kTH1F, {pvDca}); + histos.add("QA/Xi/hDCANegToPV", "DCA Neg to PV", kTH1F, {pvDca}); + histos.add("QA/Xi/hDCABachToPV", "DCA Bach to PV", kTH1F, {pvDca}); + + // Cascade track QA — TPC crossed rows per daughter (fixed AxisSpec, immune to config override) + histos.add("QA/Casc/hTPCRowsPos", "TPC crossed rows (pos)", kTH1F, {tpcRows}); + histos.add("QA/Casc/hTPCRowsNeg", "TPC crossed rows (neg)", kTH1F, {tpcRows}); + histos.add("QA/Casc/hTPCRowsBach", "TPC crossed rows (bach)", kTH1F, {tpcRows}); + + histos.add("Singles/XiMinus/hPtVsMass", "Xi^{-} p_{T} vs Mass", kTH2F, {massXi, pt}); + histos.add("Singles/XiPlus/hPtVsMass", "Xi^{+} p_{T} vs Mass", kTH2F, {massXi, pt}); + histos.add("Singles/XiMinus/hRap", "Xi^{-} Rapidity", kTH1F, {rap}); + histos.add("Singles/XiPlus/hRap", "Xi^{+} Rapidity", kTH1F, {rap}); + + // --- Omega QA --- + histos.add("QA/Om/hRadius", "Omega Radius", kTH1F, {radius}); + histos.add("QA/Om/hCosPA", "Omega CosPA", kTH1F, {cpa}); + histos.add("QA/Om/hDCAV0Dau", "DCA V0 Daughters", kTH1F, {dca}); + histos.add("QA/Om/hDCACascDau", "DCA Casc Daughters", kTH1F, {dca}); + histos.add("QA/Om/hDCAV0ToPV", "DCA V0 to PV", kTH1F, {pvDca}); + histos.add("QA/Om/hDCAPosToPV", "DCA Pos to PV", kTH1F, {pvDca}); + histos.add("QA/Om/hDCANegToPV", "DCA Neg to PV", kTH1F, {pvDca}); + histos.add("QA/Om/hDCABachToPV", "DCA Bach to PV", kTH1F, {pvDca}); + + // Singles: Omega + histos.add("Singles/OmegaMinus/hPtVsMass", "Omega^{-} p_{T} vs Mass", kTH2F, {massOm, pt}); + histos.add("Singles/OmegaPlus/hPtVsMass", "Omega^{+} p_{T} vs Mass", kTH2F, {massOm, pt}); + histos.add("Singles/OmegaMinus/hRap", "Omega^{-} Rapidity", kTH1F, {rap}); + histos.add("Singles/OmegaPlus/hRap", "Omega^{+} Rapidity", kTH1F, {rap}); + + // Pairs: Xi (R2 inputs) + histos.add("Pairs/Lam_XiM/hDeltaPhiDeltaY", "L-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/Lam_XiP/hDeltaPhiDeltaY", "L-Xi+", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_XiM/hDeltaPhiDeltaY", "AL-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_XiP/hDeltaPhiDeltaY", "AL-Xi+", kTH3F, {cent, dphi, dy}); + + // Pairs: Omega (R2 inputs) + histos.add("Pairs/Lam_OmM/hDeltaPhiDeltaY", "L-Om-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/Lam_OmP/hDeltaPhiDeltaY", "L-Om+", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_OmM/hDeltaPhiDeltaY", "AL-Om-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_OmP/hDeltaPhiDeltaY", "AL-Om+", kTH3F, {cent, dphi, dy}); + + // --- MC Gen-level histograms (mirror reco under McGen/) --- + // Singles: gen Lambda + histos.add("McGen/Singles/Lambda/hPt", "Gen #Lambda p_{T}", kTH1F, {pt}); + histos.add("McGen/Singles/AntiLambda/hPt", "Gen #bar{#Lambda} p_{T}", kTH1F, {pt}); + + // Singles: gen Xi + histos.add("McGen/Singles/XiMinus/hPtVsRap", "Gen #Xi^{-} p_{T} vs y", kTH2F, {rap, pt}); + histos.add("McGen/Singles/XiPlus/hPtVsRap", "Gen #Xi^{+} p_{T} vs y", kTH2F, {rap, pt}); + + // Singles: gen Omega + histos.add("McGen/Singles/OmegaMinus/hPtVsRap", "Gen #Omega^{-} p_{T} vs y", kTH2F, {rap, pt}); + histos.add("McGen/Singles/OmegaPlus/hPtVsRap", "Gen #Omega^{+} p_{T} vs y", kTH2F, {rap, pt}); + + // Pairs: gen Lam-Xi + histos.add("McGen/Pairs/Lam_XiM/hDeltaPhiDeltaY", "Gen L-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/Lam_XiP/hDeltaPhiDeltaY", "Gen L-Xi+", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_XiM/hDeltaPhiDeltaY", "Gen AL-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_XiP/hDeltaPhiDeltaY", "Gen AL-Xi+", kTH3F, {cent, dphi, dy}); + + // Pairs: gen Lam-Omega + histos.add("McGen/Pairs/Lam_OmM/hDeltaPhiDeltaY", "Gen L-Om-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/Lam_OmP/hDeltaPhiDeltaY", "Gen L-Om+", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_OmM/hDeltaPhiDeltaY", "Gen AL-Om-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_OmP/hDeltaPhiDeltaY", "Gen AL-Om+", kTH3F, {cent, dphi, dy}); + + // --- 3. Efficiency map production histograms --- + // Axis definitions for efficiency maps (coarser binning to avoid empty bins) + const AxisSpec effCent{cent}; + const AxisSpec effPt{50, 0, 10, "p_{T} (GeV/c)"}; + const AxisSpec effRap{20, -1.0, 1.0, "y"}; + + // Generator-level denominator: all physical-primary Xi/Omega in acceptance + histos.add("Eff/Gen/XiMinus/hCentPtRap", "Gen #Xi^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Gen/XiPlus/hCentPtRap", "Gen #Xi^{+}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Gen/OmegaMinus/hCentPtRap", "Gen #Omega^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Gen/OmegaPlus/hCentPtRap", "Gen #Omega^{+}", kTH3F, {effCent, effPt, effRap}); + // Reco-level numerator: truth-matched reco Xi/Omega (physical-primary) + histos.add("Eff/Reco/XiMinus/hCentPtRap", "Reco #Xi^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Reco/XiPlus/hCentPtRap", "Reco #Xi^{+}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Reco/OmegaMinus/hCentPtRap", "Reco #Omega^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Reco/OmegaPlus/hCentPtRap", "Reco #Omega^{+}", kTH3F, {effCent, effPt, effRap}); + + // TTree setup — only allocates when saveCascTree is enabled. + // OutputObj are direct task members, so the framework automatically + // writes them into AnalysisResults.root under their own folder. + if (saveCascTree) { + bp = new lxicorr::BranchPair{}; + treeXi.setObject(new TTree("XiCandidates", "Xi topological variables")); + treeOmega.setObject(new TTree("OmegaCandidates", "Omega topological variables")); + lxicorr::connectBranches(treeXi.object.get(), &bp->xi); + lxicorr::connectBranches(treeOmega.object.get(), &bp->om); + treeXiGen.setObject(new TTree("XiCandidatesGen", "Xi gen-level kinematics")); + treeOmegaGen.setObject(new TTree("OmegaCandidatesGen", "Omega gen-level kinematics")); + lxicorr::connectGenBranches(treeXiGen.object.get(), &bp->xiGen); + lxicorr::connectGenBranches(treeOmegaGen.object.get(), &bp->omGen); + } + } + + // --- Analysis Functions --- + + template + void analyzeSinglesLambda(T const& tracks) + { + for (const auto& track : tracks) { + if (std::abs(track.rap()) > maxY) + continue; + + float w = useEff ? track.corrFact() : 1.0f; + bool isAnti = (track.v0Type() == 1); + + if (!isAnti) { + histos.fill(HIST("Singles/Lambda/hPt"), track.pt(), w); + histos.fill(HIST("Singles/Lambda/hPtVsMass"), track.mass(), track.pt(), w); + } else { + histos.fill(HIST("Singles/AntiLambda/hPt"), track.pt(), w); + histos.fill(HIST("Singles/AntiLambda/hPtVsMass"), track.mass(), track.pt(), w); + } + } + } + + template + void analyzeSinglesXi(T const& cascades, F const& flagsStart, float pvX, float pvY, float pvZ, float centVal) + { + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + float xiY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + + // QA Filling + histos.fill(HIST("QA/Xi/hRadius"), casc.cascradius()); + histos.fill(HIST("QA/Xi/hCosPA"), casc.casccosPA(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Xi/hDCAV0Dau"), casc.dcaV0daughters()); + histos.fill(HIST("QA/Xi/hDCACascDau"), casc.dcacascdaughters()); + histos.fill(HIST("QA/Xi/hDCAV0ToPV"), casc.dcav0topv(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Xi/hDCAPosToPV"), casc.dcapostopv()); + histos.fill(HIST("QA/Xi/hDCANegToPV"), casc.dcanegtopv()); + histos.fill(HIST("QA/Xi/hDCABachToPV"), casc.dcabachtopv()); + + if (casc.sign() < 0) { + histos.fill(HIST("Singles/XiMinus/hPtVsMass"), casc.mXi(), casc.pt()); + histos.fill(HIST("Singles/XiMinus/hRap"), xiY); + } else { + histos.fill(HIST("Singles/XiPlus/hPtVsMass"), casc.mXi(), casc.pt()); + histos.fill(HIST("Singles/XiPlus/hRap"), xiY); + } + + // MC: fill efficiency numerator for truth-matched primary Xi + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + if (std::abs(mcpart.pdgCode()) == 3312 && mcpart.isPhysicalPrimary()) { + if (mcpart.pdgCode() == 3312) + histos.fill(HIST("Eff/Reco/XiMinus/hCentPtRap"), centVal, casc.pt(), xiY); + else + histos.fill(HIST("Eff/Reco/XiPlus/hCentPtRap"), centVal, casc.pt(), xiY); + } + } + } + + if (bp) { + auto& b = bp->xi; + b.pt = casc.pt(); + b.rap = xiY; + b.mass = casc.mXi(); + b.sign = casc.sign(); + b.cascCosPA = casc.casccosPA(pvX, pvY, pvZ); + b.v0CosPA = casc.v0cosPA(pvX, pvY, pvZ); + b.cascRadius = casc.cascradius(); + b.v0Radius = casc.v0radius(); + b.dcaV0Dau = casc.dcaV0daughters(); + b.dcaCascDau = casc.dcacascdaughters(); + b.dcaV0ToPV = casc.dcav0topv(pvX, pvY, pvZ); + b.dcaPosToPV = casc.dcapostopv(); + b.dcaNegToPV = casc.dcanegtopv(); + b.dcaBachToPV = casc.dcabachtopv(); + b.cent = centVal; + b.pvZ = pvZ; + // MC truth matching + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + b.pdgCode = mcpart.pdgCode(); + b.isPhysPrim = mcpart.isPhysicalPrimary(); + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + treeXi->Fill(); + } + } + } + + // Omega singles: kaon bachelor PID cut distinguishes Omega from Xi + template + void analyzeSinglesOmega(T const& cascades, F const& flagsStart, float pvX, float pvY, float pvZ, float centVal) + { + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + float omY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + + // Require kaon bachelor PID — NSigma lives on the track, not the cascade row + auto bachTrack = casc.template bachelor_as(); + if (std::abs(bachTrack.tpcNSigmaKa()) > tpcNsigmaBachKaon) + continue; + + // QA Filling (mirrors Xi QA under QA/Om/) + histos.fill(HIST("QA/Om/hRadius"), casc.cascradius()); + histos.fill(HIST("QA/Om/hCosPA"), casc.casccosPA(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Om/hDCAV0Dau"), casc.dcaV0daughters()); + histos.fill(HIST("QA/Om/hDCACascDau"), casc.dcacascdaughters()); + histos.fill(HIST("QA/Om/hDCAV0ToPV"), casc.dcav0topv(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Om/hDCAPosToPV"), casc.dcapostopv()); + histos.fill(HIST("QA/Om/hDCANegToPV"), casc.dcanegtopv()); + histos.fill(HIST("QA/Om/hDCABachToPV"), casc.dcabachtopv()); + + if (casc.sign() < 0) { + histos.fill(HIST("Singles/OmegaMinus/hPtVsMass"), casc.mOmega(), casc.pt()); + histos.fill(HIST("Singles/OmegaMinus/hRap"), omY); + } else { + histos.fill(HIST("Singles/OmegaPlus/hPtVsMass"), casc.mOmega(), casc.pt()); + histos.fill(HIST("Singles/OmegaPlus/hRap"), omY); + } + + // MC: fill efficiency numerator for truth-matched primary Omega + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + if (std::abs(mcpart.pdgCode()) == 3334 && mcpart.isPhysicalPrimary()) { + if (mcpart.pdgCode() == 3334) + histos.fill(HIST("Eff/Reco/OmegaMinus/hCentPtRap"), centVal, casc.pt(), omY); + else + histos.fill(HIST("Eff/Reco/OmegaPlus/hCentPtRap"), centVal, casc.pt(), omY); + } + } + } + + if (bp) { + auto& b = bp->om; + b.pt = casc.pt(); + b.rap = omY; + b.mass = casc.mOmega(); + b.sign = casc.sign(); + b.cascCosPA = casc.casccosPA(pvX, pvY, pvZ); + b.v0CosPA = casc.v0cosPA(pvX, pvY, pvZ); + b.cascRadius = casc.cascradius(); + b.v0Radius = casc.v0radius(); + b.dcaV0Dau = casc.dcaV0daughters(); + b.dcaCascDau = casc.dcacascdaughters(); + b.dcaV0ToPV = casc.dcav0topv(pvX, pvY, pvZ); + b.dcaPosToPV = casc.dcapostopv(); + b.dcaNegToPV = casc.dcanegtopv(); + b.dcaBachToPV = casc.dcabachtopv(); + b.cent = centVal; + b.pvZ = pvZ; + // MC truth matching + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + b.pdgCode = mcpart.pdgCode(); + b.isPhysPrim = mcpart.isPhysicalPrimary(); + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + treeOmega->Fill(); + } + } + } + + template + void analyzePairs(L const& lambdas, C const& cascades, F const& flagsStart, float centVal) + { + for (const auto& lam : lambdas) { + if (std::abs(lam.rap()) > maxY) + continue; + float wLam = useEff ? lam.corrFact() : 1.0f; + bool isAntiLam = (lam.v0Type() == 1); + + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + float xiY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + + float dphi = RecoDecay::constrainAngle(casc.phi() - lam.phi(), -PIHalf); + float dy = xiY - lam.rap(); + + bool isXiPlus = (casc.sign() > 0); + + if (!isAntiLam && !isXiPlus) + histos.fill(HIST("Pairs/Lam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (!isAntiLam && isXiPlus) + histos.fill(HIST("Pairs/Lam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && !isXiPlus) + histos.fill(HIST("Pairs/AntiLam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && isXiPlus) + histos.fill(HIST("Pairs/AntiLam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + } + } + } + + // Omega pair loop: same structure as Xi pairs but uses Omega mass for rapidity + kaon PID + template + void analyzeOmegaPairs(L const& lambdas, C const& cascades, F const& flagsStart, float centVal) + { + for (const auto& lam : lambdas) { + if (std::abs(lam.rap()) > maxY) + continue; + float wLam = useEff ? lam.corrFact() : 1.0f; + bool isAntiLam = (lam.v0Type() == 1); + + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + auto bachTrack = casc.template bachelor_as(); + if (std::abs(bachTrack.tpcNSigmaKa()) > tpcNsigmaBachKaon) + continue; + + float omY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + + float dphi = RecoDecay::constrainAngle(casc.phi() - lam.phi(), -PIHalf); + float dy = omY - lam.rap(); + + bool isOmPlus = (casc.sign() > 0); + + if (!isAntiLam && !isOmPlus) + histos.fill(HIST("Pairs/Lam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (!isAntiLam && isOmPlus) + histos.fill(HIST("Pairs/Lam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && !isOmPlus) + histos.fill(HIST("Pairs/AntiLam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && isOmPlus) + histos.fill(HIST("Pairs/AntiLam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + } + } + } + + void processXi(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + aod::CascDataExt const& cascades, + aod::CascadeFlags const& cascflags) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(cascadesPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesXi(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzePairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processXi, "Λ–Ξ correlation", true); + + void processOmega(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + aod::CascDataExt const& cascades, + aod::CascadeFlags const& cascflags, + FullTracksExtIUWithPID const& /*tracks*/) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(cascadesPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesOmega(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzeOmegaPairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processOmega, "Λ–Ω correlation", false); + + // --------------------------------------------------------------------------- + // MC Reco-level with truth matching: Λ–Ξ + // Same as processXi but cascades carry McCascLabels → tree gets pdgCode/isPhysPrim. + // --------------------------------------------------------------------------- + void processMCRecoXi(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + LabeledCascades const& cascades, + aod::CascadeFlags const& cascflags, + aod::McParticles const& /*mcparts*/) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(labeledCascPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesXi(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzePairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCRecoXi, "MC reco Λ–Ξ (truth-tagged tree)", false); + + // --------------------------------------------------------------------------- + // MC Reco-level with truth matching: Λ–Ω + // Same as processOmega but cascades carry McCascLabels → tree gets pdgCode/isPhysPrim. + // --------------------------------------------------------------------------- + void processMCRecoOmega(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + LabeledCascades const& cascades, + aod::CascadeFlags const& cascflags, + FullTracksExtIUWithPID const& /*tracks*/, + aod::McParticles const& /*mcparts*/) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(labeledCascPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesOmega(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzeOmegaPairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCRecoOmega, "MC reco Λ–Ω (truth-tagged tree)", false); + + // --------------------------------------------------------------------------- + // MC Gen-level: Λ–Ξ truth correlation (closure test) + // Loops over generator-level primary Λ from LambdaMcGenTracks and + // generator-level Ξ from McParticles (inline PDG == ±3312 check). + // McParticles are sliced per McCollision using the stored refMcCollId. + // No reconstruction, no PID cuts — pure truth-level R2. + // --------------------------------------------------------------------------- + void processMCGenXi(aod::LambdaMcGenCollisions::iterator const& mcgencol, + aod::LambdaMcGenTracks const& genLambdasAll, + aod::McParticles const& allMcParts) + { + int32_t thisColId = mcgencol.globalIndex(); + histos.fill(HIST("Event/hEventCount"), 0.5); + float centVal = mcgencol.cent(); + + // Slice McParticles to only those belonging to this McCollision + int64_t mcCollId = mcgencol.refMcCollId(); + auto genXis = allMcParts.sliceBy(mcParticlesPerMcCollision, mcCollId); + + // Fill gen Lambda singles — filter by collision ID inline + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/Lambda/hPt"), lam.pt()); + } + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kAntiLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/AntiLambda/hPt"), lam.pt()); + } + + // Fill gen Xi singles (inline PDG filter) + for (const auto& xi : genXis) { + if (std::abs(xi.pdgCode()) != 3312) + continue; // inline PDG filter + if (!xi.isPhysicalPrimary()) + continue; + float xiY = RecoDecay::y(std::array{xi.px(), xi.py(), xi.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + if (xi.pdgCode() == 3312) + histos.fill(HIST("McGen/Singles/XiMinus/hPtVsRap"), xiY, xi.pt()); + else if (xi.pdgCode() == -3312) + histos.fill(HIST("McGen/Singles/XiPlus/hPtVsRap"), xiY, xi.pt()); + + // Efficiency denominator: all physical-primary gen Xi in acceptance + if (xi.pdgCode() == 3312) + histos.fill(HIST("Eff/Gen/XiMinus/hCentPtRap"), centVal, xi.pt(), xiY); + else + histos.fill(HIST("Eff/Gen/XiPlus/hCentPtRap"), centVal, xi.pt(), xiY); + + if (bp) { + auto& b = bp->xiGen; + b.pt = xi.pt(); + b.rap = xiY; + b.pdgCode = xi.pdgCode(); + b.isPhysPrim = xi.isPhysicalPrimary(); + b.cent = centVal; + b.pvZ = mcgencol.posZ(); + treeXiGen->Fill(); + } + } + + // Fill gen Lam-Xi pairs + auto fillGenXiPairs = [&](bool isAntiLam) { + int8_t wantType = isAntiLam ? (int8_t)kAntiLambda : (int8_t)kLambda; + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != wantType || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + for (const auto& xi : genXis) { + if (std::abs(xi.pdgCode()) != 3312) + continue; // inline PDG filter + if (!xi.isPhysicalPrimary()) + continue; + float xiY = RecoDecay::y(std::array{xi.px(), xi.py(), xi.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + float dphi = RecoDecay::constrainAngle(xi.phi() - lam.phi(), -PIHalf); + float dy = xiY - lam.rap(); + bool isXiPlus = (xi.pdgCode() == -3312); + if (!isAntiLam && !isXiPlus) + histos.fill(HIST("McGen/Pairs/Lam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (!isAntiLam && isXiPlus) + histos.fill(HIST("McGen/Pairs/Lam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (isAntiLam && !isXiPlus) + histos.fill(HIST("McGen/Pairs/AntiLam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else + histos.fill(HIST("McGen/Pairs/AntiLam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy); + } + } + }; + fillGenXiPairs(false); + fillGenXiPairs(true); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCGenXi, "MC gen-level Λ–Ξ closure", false); + + // --------------------------------------------------------------------------- + // MC Gen-level: Λ–Ω truth correlation (closure test) + // Same structure as processMCGenXi but uses |PDG| == 3334 (Omega). + // No kaon PID cut needed — truth level. + // --------------------------------------------------------------------------- + void processMCGenOmega(aod::LambdaMcGenCollisions::iterator const& mcgencol, + aod::LambdaMcGenTracks const& genLambdasAll, + aod::McParticles const& allMcParts) + { + int32_t thisColId = mcgencol.globalIndex(); + histos.fill(HIST("Event/hEventCount"), 0.5); + float centVal = mcgencol.cent(); + + // Slice McParticles to only those belonging to this McCollision + int64_t mcCollId = mcgencol.refMcCollId(); + auto genOmegas = allMcParts.sliceBy(mcParticlesPerMcCollision, mcCollId); + + // Fill gen Lambda singles — filter by collision ID inline + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/Lambda/hPt"), lam.pt()); + } + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kAntiLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/AntiLambda/hPt"), lam.pt()); + } + + // Fill gen Omega singles (inline PDG filter) + for (const auto& om : genOmegas) { + if (std::abs(om.pdgCode()) != 3334) + continue; // inline PDG filter + if (!om.isPhysicalPrimary()) + continue; + float omY = RecoDecay::y(std::array{om.px(), om.py(), om.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + if (om.pdgCode() == 3334) + histos.fill(HIST("McGen/Singles/OmegaMinus/hPtVsRap"), omY, om.pt()); + else if (om.pdgCode() == -3334) + histos.fill(HIST("McGen/Singles/OmegaPlus/hPtVsRap"), omY, om.pt()); + + // Efficiency denominator: all physical-primary gen Omega in acceptance + if (om.pdgCode() == 3334) + histos.fill(HIST("Eff/Gen/OmegaMinus/hCentPtRap"), centVal, om.pt(), omY); + else + histos.fill(HIST("Eff/Gen/OmegaPlus/hCentPtRap"), centVal, om.pt(), omY); + + if (bp) { + auto& b = bp->omGen; + b.pt = om.pt(); + b.rap = omY; + b.pdgCode = om.pdgCode(); + b.isPhysPrim = om.isPhysicalPrimary(); + b.cent = centVal; + b.pvZ = mcgencol.posZ(); + treeOmegaGen->Fill(); + } + } + + // Fill gen Lam-Omega pairs + auto fillGenOmPairs = [&](bool isAntiLam) { + int8_t wantType = isAntiLam ? (int8_t)kAntiLambda : (int8_t)kLambda; + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != wantType || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + for (const auto& om : genOmegas) { + if (std::abs(om.pdgCode()) != 3334) + continue; // inline PDG filter + if (!om.isPhysicalPrimary()) + continue; + float omY = RecoDecay::y(std::array{om.px(), om.py(), om.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + float dphi = RecoDecay::constrainAngle(om.phi() - lam.phi(), -PIHalf); + float dy = omY - lam.rap(); + bool isOmPlus = (om.pdgCode() == -3334); + if (!isAntiLam && !isOmPlus) + histos.fill(HIST("McGen/Pairs/Lam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (!isAntiLam && isOmPlus) + histos.fill(HIST("McGen/Pairs/Lam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (isAntiLam && !isOmPlus) + histos.fill(HIST("McGen/Pairs/AntiLam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else + histos.fill(HIST("McGen/Pairs/AntiLam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy); + } + } + }; + fillGenOmPairs(false); + fillGenOmPairs(true); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCGenOmega, "MC gen-level Λ–Ω closure", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + // adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + // adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc) + + }; +} From c340ddb9f28d9fd00e3c95871197d216c98de246 Mon Sep 17 00:00:00 2001 From: tutripat <73981392+tutripat@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:04:49 +0200 Subject: [PATCH 101/282] [PWGLF] Major modifications related to MFT analysis (#15561) Co-authored-by: ALICE Action Bot --- .../GlobalEventProperties/CMakeLists.txt | 4 +- .../PseudorapidityDensityMFT.cxx | 2870 +++++++++++++++++ .../GlobalEventProperties/dndeta-mft-pp.cxx | 1223 ------- 3 files changed, 2872 insertions(+), 1225 deletions(-) create mode 100644 PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx delete mode 100644 PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx diff --git a/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt index b80c7711571..c622a91ee37 100644 --- a/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt +++ b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt @@ -19,8 +19,8 @@ o2physics_add_dpl_workflow(ucc-zdc PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(dndeta-mft-pp - SOURCES dndeta-mft-pp.cxx +o2physics_add_dpl_workflow(pseudorapidity-density-mft + SOURCES PseudorapidityDensityMFT.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx new file mode 100644 index 00000000000..370f7da75a9 --- /dev/null +++ b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx @@ -0,0 +1,2870 @@ +// Copyright 2020-2025 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 PseudorapidityDensityMFT.cxx +/// \author Sarah Herrmann +/// \author Tulika Tripathy +/// \brief This code loops over MFT tracks and collisions and fills histograms +/// useful to compute dNdeta + +#include "PWGMM/Mult/DataModel/bestCollisionTable.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/GeomConstants.h" +#include "CommonConstants/MathConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DetectorsBase/Propagator.h" +#include "Field/MagneticField.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Configurable.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/RuntimeError.h" +#include "Framework/runDataProcessing.h" +#include "MathUtils/Utils.h" +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "ReconstructionDataFormats/TrackFwd.h" +#include "ReconstructionDataFormats/TrackParametrization.h" + +#include "Math/MatrixFunctions.h" +#include "Math/SMatrix.h" +#include "Math/SVector.h" +#include "TFile.h" +#include "TGeoGlobalMagField.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::track; +using namespace o2::aod::rctsel; + +AxisSpec ptAxis = {2001, -0.005, 20.005}; +AxisSpec deltazAxis = {6100, -6.1, 6.1}; +AxisSpec zAxis = {3001, -30.1, 30.1}; +AxisSpec phiAxis = {629, 0, o2::constants::math::TwoPI, "Rad", "phi axis"}; +AxisSpec etaAxis = {18, -4.6, -1.}; +// AxisSpec dcaXyAxis = {2000, -10, 10}; +// AxisSpec dcaZAxis = {2000, -10, 10}; +// AxisSpec dcaXAxis = {2000, -10, 10}; +// AxisSpec dcaYAxis = {2000, -10, 10};// previous AxisSpec dcaYAxis = {2000, -10, 10}; + +AxisSpec dcaXyAxis = {6000, -30, 30}; +AxisSpec dcaZAxis = {6000, -30, 30}; +AxisSpec dcaXAxis = {6000, -30, 30}; +AxisSpec dcaYAxis = {6000, -30, 30}; // previous AxisSpec dcaYAxis = {2000, -10, 10}; + +// AxisSpec dcaXyAxis = {600, -0.15f, 0.15f}; +// AxisSpec dcaZAxis = {600, -0.15f, 0.15f}; +// AxisSpec dcaXAxis = {600, -0.15f, 0.15f}; +// AxisSpec dcaYAxis = {600, -0.15f, 0.15f}; + +AxisSpec centAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}}; + +// Vertex position axes (cm) +AxisSpec vxAxis = {200, -0.5, 0.5, "V_{x} (cm)"}; +AxisSpec vyAxis = {200, -0.5, 0.5, "V_{y} (cm)"}; +// Status axis for reco/truth (1=reco, 2=true) +AxisSpec recoTruthStatusAxis = {2, 0.5, 2.5, "status"}; + +// Delta-vertex axes (reco - true) in cm +AxisSpec deltaVxAxis = {400, -0.5, 0.5, "#DeltaV_{x} = V_{x}^{rec}-V_{x}^{true} (cm)"}; +AxisSpec deltaVyAxis = {400, -0.5, 0.5, "#DeltaV_{y} = V_{y}^{rec}-V_{y}^{true} (cm)"}; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionIts = + TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | + TrackSelectionFlags::kITSHits; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionTpc = + TrackSelectionFlags::kTPCNCls | + TrackSelectionFlags::kTPCCrossedRowsOverNCls | + TrackSelectionFlags::kTPCChi2NDF; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = + TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; + +// using MFTTracksLabeled = soa::Join; +// replace your alias with the extension included: +using FullBCs = soa::Join; + +// using MFTTracksLabeled = +// soa::Join; +using MFTTracksLabeled = + soa::Join; +using MFTTracksLabeled2d = + soa::Join; + +using MFTTracksLabeledOrg = + soa::Join; +// using McCollisionsWithExtra = soa::Join; +using McCollisionsWithExtra = o2::soa::Join; + +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; +struct PseudorapidityDensityMFT { + SliceCache cache; + Preslice perCol = o2::aod::fwdtrack::collisionId; + Preslice perMcCol = aod::mcparticle::mcCollisionId; + Preslice perColCentral = aod::track::collisionId; + + Service pdg; + + // --- CCDB magnetic field (needed for propagateToDCAhelix in this device) --- + Service ccdbMgr; + Configurable ccdburlMag{"ccdburlMag", "http://alice-ccdb.cern.ch", + "CCDB url for GRPMagField"}; + Configurable grpmagPathMag{"grpmagPathMag", "GLO/Config/GRPMagField", + "CCDB path for GRPMagField"}; + + int magRunNumber = -1; + float bzMFT = 0.f; + o2::parameters::GRPMagField* grpmag = nullptr; + static constexpr double CenterMft[3] = {0., 0., -61.4}; + + enum class GenRecoCutBin : int { + AllRecoCollisions = 1, + UseContBestCollisionIndex, + HasMcCollision, + IsTriggerTVX, + NoTimeFrameBorder, + NoITSROFrameBorder, + NoSameBunchPileup, + GoodZvtxFT0vsPV, + NoCollInRofStandard, + NoCollInRofStrict, + NoCollInTimeRangeStandard, + NoCollInTimeRangeStrict, + NoHighMultCollInPrevRof, + RctMFT, + VzWindow, + InelGt0 + }; + + enum class TrackLabelSummaryBin : int { + AllTracks = 1, + NoMcLabel, + FakeTracks, + TrueTracks, + PrimaryTracks, + SecondaryTracks + }; + + enum class GenRecoTimeComTrackMode : int { + AllNonOrphan = 0, + NonOrphanNonAmbiguous, + NonOrphanAmbiguous + }; + + enum class RightWrongBin : int { + Right = 1, + Wrong, + Neither, + Both + }; + enum class EventSelectionBin : int { + All = 1, + Vz, + VzItsRof, + VzSelected, + Sel8VzInelGt0, + SelInelInelFwdGt0, + Rejected, + GoodBCs, + BCsWithCollisions, + BCsWithPileupSplitting, + PerCollisionSampleGt0, + MidtracksAndPerCollisionSampleGt0 + }; + enum class HashTableRowCountsBin : int { + RowsSaved = 1, + UniqueRecoColsSaved, + UniqueBestRecoCols + }; + enum class WrongVertexRecoExistsBin : int { + RecoOfTrueExists = 1, + RecoOfTrueMissing + }; + enum class BoolBin : int { + No = 0, + Yes = 1 + }; + enum class SingleCountBin : int { + Count = 1 + }; + enum class EventEfficiencyBin : int { + Generated = 1, + GeneratedInelGt0, + Reconstructed, + Selected, + SelectedInelGt0 + }; + enum class CentralitySelectionBin : int { + All = 1, + Selected, + Rejected + }; + static constexpr float ForwardEtaMax = -2.0f; + static constexpr float ForwardEtaMin = -3.9f; + + static constexpr float PhiVetoLow = 0.02f; + static constexpr float PhiVetoPiMin = 3.10f; + static constexpr float PhiVetoPiMax = 3.23f; + static constexpr float PhiVetoHigh = 6.21f; + + static constexpr float NdfScale = 2.0f; + static constexpr float NdfOffset = 5.0f; + static constexpr float MinNdf = 1.0f; + + template + static float getTrackNdf(TrackT const& track) + { + return std::max(NdfScale * track.nClusters() - NdfOffset, MinNdf); + } + static constexpr int NoCompatibleCollisions = 0; + static constexpr int SingleCompatibleCollision = 1; + + static constexpr int OrphanAmbDegree = 0; + static constexpr int NonAmbiguousAmbDegree = 1; + + static constexpr int ChargeUnitTimesThree = 3; + + void initMagField(FullBCs::iterator const& bc) + { + if (magRunNumber == bc.runNumber()) { + return; + } + + grpmag = ccdbMgr->getForTimeStamp(grpmagPathMag.value, bc.timestamp()); + if (!grpmag) { + LOGF(warning, "GRPMagField not found in CCDB for ts=%lld", static_cast(bc.timestamp())); + bzMFT = 0.f; + magRunNumber = bc.runNumber(); + return; + } + + // This sets TGeoGlobalMagField internally + o2::base::Propagator::initFieldFromGRP(grpmag); + magRunNumber = bc.runNumber(); + + auto* field = static_cast(TGeoGlobalMagField::Instance()->GetField()); + if (field) { + bzMFT = field->getBz(CenterMft); + LOGP(info, "Initialized magnetic field for run {}: bzMFT={} kG", magRunNumber, bzMFT); + } else { + LOGF(warning, "TGeoGlobalMagField has no field even after initFieldFromGRP; bzMFT=0"); + bzMFT = 0.f; + } + } + + RCTFlagsChecker rctChecker{"CBT"}; + RCTFlagsChecker myChecker{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}; + Configurable maxGenRecoEvents{"maxGenRecoEvents", -1, + "Maximum number of MC collisions to process in processGenReco (-1 = all)"}; + + int nProcessedGenReco = 0; + + Configurable estimatorEta{"estimatorEta", 1.0, + "eta range for INEL>0 sample definition"}; + + Configurable useEvSel{"useEvSel", true, "use event selection"}; + Configurable useNoSameBunchPileup{"useNoSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"}; + Configurable useNoCollInRofStandard{"useNoCollInRofStandard", true, "Require evsel::kNoCollInRofStrict in processGenReco"}; + Configurable useNoCollInRofStrict{"useNoCollInRofStrict", true, "Require evsel::kNoCollInRofStrict in processGenReco"}; + Configurable useNoCollInTimeRangeStrict{"useNoCollInTimeRangeStrict", true, "Require evsel::kNoCollInTimeRangeStrict in processGenReco"}; + Configurable useNoCollInTimeRangeStandard{"useNoCollInTimeRangeStandard", true, "Require evsel::kNoCollInTimeRangeStandard in processGenReco"}; + Configurable useNoHighMultCollInPrevRof{"useNoHighMultCollInPrevRof", true, "Require evsel::kNoHighMultCollInPrevRof in processGenReco"}; + Configurable useGoodZvtxFT0vsPV{"useGoodZvtxFT0vsPV", true, "Require evsel::kIsGoodZvtxFT0vsPV in processGenReco"}; + Configurable useRctMFT{"useRctMFT", true, "Apply RCT runlist flags for MFT"}; + + Configurable disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROF cut for event selection"}; + + ConfigurableAxis multBinning{"multBinning", {701, -0.5, 700.5}, ""}; + ConfigurableAxis etaBinning{"etaBinning", {36, -4.6, -1.}, ""}; + Configurable useZDiffCut{"useZDiffCut", true, "use Z difference cut"}; + Configurable maxZDiff{"maxZDiff", 1.0f, "max allowed Z difference for reconstructed collisions (cm)"}; + + Configurable usePhiCut{"usePhiCut", true, "use azimuthal angle cut"}; + Configurable useDCAxyCut{"useDCAxyCut", false, "use DCAxy cut"}; + Configurable useCont{"useCont", false, "No of contributors cut"}; + + Configurable usePtCut{"usePtCut", false, "use Pt cut"}; + + Configurable useDCAzCut{"useDCAzCut", false, "use DCAz cut"}; + + Configurable cfgPhiCut{"cfgPhiCut", 0.1f, + "Cut on azimuthal angle of MFT tracks"}; + Configurable cfgPhiCut1{"cfgPhiCut1", 0.0f, + "low Cut on azimuthal angle of MFT tracks"}; + Configurable cfgPhiCut2{"cfgPhiCut2", 6.3f, + "high Cut on azimuthal angle of MFT tracks"}; + Configurable cfgVzCut1{"cfgVzCut1", -30.0f, + "Cut1 on vertex position of MFT tracks"}; + Configurable cfgVzCut2{"cfgVzCut2", 30.0f, + "Cut2 on vertex position of MFT tracks"}; + Configurable cfgnCluster{"cfgnCluster", 5.0f, + "Cut on no of clusters per MFT track"}; + Configurable cfgnEta1{"cfgnEta1", -4.5f, + "Cut on eta1"}; + Configurable cfgnEta2{"cfgnEta2", -1.0f, + "Cut on eta1"}; + Configurable cfgnPt{"cfgnPt", 10.0f, + "Cut on Pt"}; + Configurable cfgChi2NDFMax{"cfgChi2NDFMax", 2000.0f, "Max allowed chi2/NDF for MFT tracks"}; + Configurable maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"}; + Configurable maxDCAz{"maxDCAz", 2.0f, "Cut on dcaZ"}; + Configurable useLostByCutVeto{"useLostByCutVeto", true, "Reject tracks with lostNoRecoOfTrue or lostRecoExistsButNotCompatible"}; + + Configurable cfgGenRecoTimeComTrackMode{"cfgGenRecoTimeComTrackMode", + static_cast(GenRecoTimeComTrackMode::AllNonOrphan), + "processGenRecoTimeCom track mode: AllNonOrphan=0, NonOrphanNonAmbiguous=1, NonOrphanAmbiguous=2"}; + + HistogramRegistry registry{ + "registry", + { + {"TracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}, // + {"Tracks/EtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}, // + {"TracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}, // + {"TracksPhiZvtx", + "; #varphi; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {phiAxis, zAxis}}}, // + {"TracksPtEta", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}, // + {"EventSelection", + ";status;events", + {HistType::kTH1F, {{15, 0.5, 15.5}}}}, + {"EventCounts", + ";status;events", + {HistType::kTH1F, {{2, 0.5, 2.5}}}}, + }}; + + void init(InitContext&) + { + ccdbMgr->setURL(ccdburlMag.value); // or ccdburlMag.value (depending on your Configurable) + ccdbMgr->setCaching(true); + ccdbMgr->setLocalObjectValidityChecking(); + + if (static_cast(doprocessMult) + + static_cast(doprocessMultReassoc) + + static_cast(doprocessMultReassoc3d) + + static_cast(doprocessCountingCentrality) > + 1) { + LOGP(fatal, + "Exactly one process function between processMult, " + "processMultReassoc, processMultReassoc3d and processCountingCentrality should be " + "enabled!"); + } + AxisSpec multAxis = {multBinning, "N_{trk}"}; + auto hstat = registry.get(HIST("EventSelection")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(static_cast(EventSelectionBin::All), "All"); + x->SetBinLabel(static_cast(EventSelectionBin::Vz), "Vz"); + x->SetBinLabel(static_cast(EventSelectionBin::VzItsRof), "Vz+ITSRof"); + x->SetBinLabel(static_cast(EventSelectionBin::VzSelected), "Vz+Selected"); + x->SetBinLabel(static_cast(EventSelectionBin::Sel8VzInelGt0), "Sel8+Vz+INEL>0"); + x->SetBinLabel(static_cast(EventSelectionBin::SelInelInelFwdGt0), "Sel INEL,INEL_fwd>0"); + x->SetBinLabel(static_cast(EventSelectionBin::Rejected), "Rejected"); + x->SetBinLabel(static_cast(EventSelectionBin::GoodBCs), "Good BCs"); + x->SetBinLabel(static_cast(EventSelectionBin::BCsWithCollisions), "BCs with collisions"); + x->SetBinLabel(static_cast(EventSelectionBin::BCsWithPileupSplitting), "BCs with pile-up/splitting"); + x->SetBinLabel(static_cast(EventSelectionBin::PerCollisionSampleGt0), "percollisionSample>0"); + x->SetBinLabel(static_cast(EventSelectionBin::MidtracksAndPerCollisionSampleGt0), "midtracks+percollisionSample>0"); + registry.add({"EventsNtrkZvtx", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtx_gt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_all", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/Control/DCAXY", + " ; DCA_{XY} (cm)", + {HistType::kTH1F, {dcaXyAxis}}}); + + if (doprocessGenReco || doprocessGenRecoTimeCom) { + registry.add({"EventsRecoCuts_GenReco", + ";cut;events", + {HistType::kTH1F, {{16, 0.5, 16.5}}}}); + { + auto h = registry.get(HIST("EventsRecoCuts_GenReco")); + auto* x = h->GetXaxis(); + x->SetBinLabel(static_cast(GenRecoCutBin::AllRecoCollisions), "All reco collisions (loop entry)"); + x->SetBinLabel(static_cast(GenRecoCutBin::UseContBestCollisionIndex), "useContBestcollisionIndex"); + x->SetBinLabel(static_cast(GenRecoCutBin::HasMcCollision), "has_mcCollision()"); + x->SetBinLabel(static_cast(GenRecoCutBin::IsTriggerTVX), "kIsTriggerTVX (if useEvSel)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoTimeFrameBorder), "kNoTimeFrameBorder (if useEvSel)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoITSROFrameBorder), "kNoITSROFrameBorder (if useEvSel)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoSameBunchPileup), "kNoSameBunchPileup"); + x->SetBinLabel(static_cast(GenRecoCutBin::GoodZvtxFT0vsPV), "kIsGoodZvtxFT0vsPV"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInRofStandard), "kNoCollInRofStandard (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInRofStrict), "kNoCollInRofStrict (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInTimeRangeStandard), "kNoCollInTimeRangeStandard (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInTimeRangeStrict), "kNoCollInTimeRangeStrict (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoHighMultCollInPrevRof), "kNoHighMultCollInPrevRof (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::RctMFT), "myChecker (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::VzWindow), "Vz window"); + x->SetBinLabel(static_cast(GenRecoCutBin::InelGt0), "INEL>0 (midtracks>0)"); + // x->SetBinLabel(11, "rctChecker (cfg)"); + + // x->SetBinLabel(15, "Passed all event cuts"); + } + + AxisSpec trackLabelAxis = {6, 0.5, 6.5, "Track label category"}; + registry.add({"Purity/TrackLabelSummary", + ";Track label category;Counts", + {HistType::kTH1D, {trackLabelAxis}}}); + { + auto h = registry.get(HIST("Purity/TrackLabelSummary")); + auto* x = h->GetXaxis(); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::AllTracks), "All tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::NoMcLabel), "No MC label"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::FakeTracks), "Fake tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::TrueTracks), "True tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::PrimaryTracks), "Primary tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::SecondaryTracks), "Secondary tracks"); + } + registry.add({"Purity/TrackEtaCategorySparse", + ";#eta_{all};#eta_{noMC};#eta_{fake};#eta_{true};#eta_{primary};#eta_{secondary}", + {HistType::kTHnSparseF, {etaBinning, etaBinning, etaBinning, etaBinning, etaBinning, etaBinning}}}); + + registry.add({"Purity/WrongVertexRecoExists", + ";status;Counts", + {HistType::kTH1F, {{2, 0.5, 2.5}}}}); + { + auto h = registry.get(HIST("Purity/WrongVertexRecoExists")); + if (h) { + h->GetXaxis()->SetBinLabel(static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists), "Reco of true exists"); + h->GetXaxis()->SetBinLabel(static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing), "Reco of true missing"); + } + } + + registry.add({"Purity/HashTableRowCounts", + ";status;counts", + {HistType::kTH1F, {{3, 0.5, 3.5}}}}); + auto hHashTableRowCounts = registry.get(HIST("Purity/HashTableRowCounts")); + auto* xHash = hHashTableRowCounts->GetXaxis(); + xHash->SetBinLabel(static_cast(HashTableRowCountsBin::RowsSaved), "rows saved"); + xHash->SetBinLabel(static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), "unique recoCol saved"); + xHash->SetBinLabel(static_cast(HashTableRowCountsBin::UniqueBestRecoCols), "unique bestRecoCol"); + registry.add({"Purity/THnDCAChosenVsRight_Wrong", + ";#eta;DCA_{xy}^{chosen} (cm);DCA_{xy}^{calculated} (cm);DCA_{xy}^{right} (cm);DCA_{z}^{chosen} (cm);DCA_{z}^{calculated} (cm);DCA_{z}^{right} (cm)", + {HistType::kTHnSparseF, {etaBinning, dcaXyAxis, dcaXyAxis, dcaXyAxis, dcaZAxis, dcaZAxis, dcaZAxis}}}); + registry.add({"Purity/THnDCAChosenVsRight_Right", + ";#eta;DCA_{xy}^{chosen} (cm);DCA_{xy}^{calculated} (cm);DCA_{xy}^{right} (cm);DCA_{z}^{chosen} (cm);DCA_{z}^{calculated} (cm);DCA_{z}^{right} (cm)", + {HistType::kTHnSparseF, {etaBinning, dcaXyAxis, dcaXyAxis, dcaXyAxis, dcaZAxis, dcaZAxis, dcaZAxis}}}); + registry.add("Purity/RecoOfTrueExists", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueInCompatible", + "Reco collision(s) of true MC event present in track compatible collisions;inCompatible (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueExistsR", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueInCompatibleR", + "Reco collision(s) of true MC event present in track compatible collisions;inCompatible (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + registry.add("Purity/RecoOfTrueExistsW", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueInCompatibleW", + "Reco collision(s) of true MC event present in track compatible collisions;inCompatible (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + registry.add("Purity/hCorrectRecoIDinTheListR", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/hCorrectRecoIDinTheListW", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + // P(Nch): number of selected MFT tracks per accepted reco collision (after all event+track cuts) + // Tracks lost because of the OR cut ( !exists || !inCompatible ) + registry.add("Purity/LostByBoth", + "Tracks rejected by (!recoOfTrueExists || !recoOfTrueInCompatible);status (0=kept,1=lost);tracks", + kTH1F, {{2, -0.5, 1.5}}); + // Number of ITS-TPC contributors to the reconstructed collision (PV contributors) + registry.add({"Purity/reco/CollisionNumContrib", + ";N_{contrib} ( PV contributors);collisions", + {HistType::kTH1F, {{3001, -0.5, 3000.5}}}}); + + // Tracks that were WRONG (by your definition) BEFORE applying the cut + registry.add("Purity/WrongBeforeRecoOfTrueCut", + "Tracks classified wrong BEFORE applying recoOfTrue cut;wrong (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + // Optional but very useful: intersection (lost AND wrong) + + registry.add({"Purity/reco/PNchMFT_afterCuts", + ";N_{trk}^{MFT} (selected);events", + {HistType::kTH1F, {multAxis}}}); + registry.add({"Purity/DCAyVsDCAx_Right", + ";DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTH2F, {dcaXAxis, dcaYAxis}}}); + registry.add({"Purity/reco/woOrp/All", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/reco/woOrp/AllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/SelectedAfterDCAxy/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/SelectedAfterDCAxy/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"TracksToPartPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"EventsReco", + "; status; events", + {HistType::kTH1F, {{7, 0.5, 7.5}}}}); + + // Additional histograms for processGenReco (w/o orphan), grouped under Purity/reco/ + registry.add({"Purity/reco/weakStrange/SelectedTracksEta", + "; #eta; selected reco tracks from weak strange decays", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/reco/weakStrange/SelectedTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); selected reco tracks from weak strange decays", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/SelectedTracksEta", + "; #eta; selected reco tracks", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/reco/woOrp/nTrk", + " ; N_{Trk}^{all}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksDCAxyZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaXyAxis, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksDCAzZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaZAxis, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // --- Category-wise woOrp histograms (after track cuts & woOrp) --- + // Fake tracks (no MC particle) + registry.add({"Purity/reco/woOrp_fake/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Tracks that have an MC particle (matched) + registry.add({"Purity/reco/woOrp_hasMC/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Secondary tracks (has MC but not primary) + registry.add({"Purity/reco/woOrp_secondary/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Primary tracks (has MC and is physical primary) + registry.add({"Purity/reco/woOrp_primary/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // MC-side (generator truth) histograms for purity in processGenReco + registry.add({"Purity/mc/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/mc/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/mc/PrimaryTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksDCAxyZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaXyAxis, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksDCAzZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaZAxis, zAxis}}}); + + registry.add({"Purity/mc/PrimaryTracksPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + // --- MC-side (NO-DCA) truth histograms for pre-DCA accounting --- + registry.add({"Purity/mc_noDCA/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/mc_noDCA/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Book keeping for pre-DCA selection counters (for symmetry with AfterDCAxy) + registry.add({"Purity/SelectedBeforeDCAxy/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/SelectedBeforeDCAxy/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + // --- Fake-track counters (reco side after DCA selections) --- + registry.add({"Purity/Fakes/All", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/Fakes/AllEta", + ";#eta_{reco};counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/Fakes/TracksEtaZvtx", + "; #eta_{reco}; #it{z}_{vtx}^{rec} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/Fakes/TracksPhiEta", + "; #varphi_{reco}; #eta_{reco}; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + // Fake reason breakdown: 1-INEL>0 true (vz), 2-Reco sel (woOrp), 3-has_mcParticle, 4-isPrimary, 5-rightVertex + + // --- Purity calculation histograms (as profiles: purity = ) --- + registry.add({"Purity/PurityOverall", + ";bin;purity", + {HistType::kTProfile, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/PurityVsEta", + ";#eta;purity", + {HistType::kTProfile, {etaBinning}}}); + registry.add({"RightWrong", + ";category;counts", + {HistType::kTH1F, {{4, 0.5, 4.5}}}}); + auto hrw = registry.get(HIST("RightWrong")); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Right), "right"); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Wrong), "wrong"); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Neither), "neither"); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Both), "both"); + + registry.add({"Purity/RightWrongLater", + ";category;counts", + {HistType::kTH1F, {{4, 0.5, 4.5}}}}); + auto hrw1 = registry.get(HIST("Purity/RightWrongLater")); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Right), "right"); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Wrong), "wrong"); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Neither), "neither"); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Both), "both"); + + // Vertex-position difference for wrong-vertex associations (reco - true MC) + registry.add({"deltaVZ_fromReco", + ";#Delta z_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"deltaVZ_fromTrue", + ";#Delta z_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/DeltaXWrong", + ";#Delta x_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaYWrong", + ";#Delta y_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaZWrong", + ";#Delta z_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/xReco", + ";#Delta z_{vtx}^{reco} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/xTrue", + ";#Delta z_{vtx}^{true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/yReco", + ";#Delta z_{vtx}^{reco} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/yTrue", + ";#Delta z_{vtx}^{true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/zReco", + ";#Delta z_{vtx}^{reco} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/zTrue", + ";#Delta z_{vtx}^{true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + + // Vertex positions: store both reco and truth in one THnSparse with a status axis + registry.add({"Purity/VtxXYZTruth", + "; V_{x} (cm); V_{y} (cm); V_{z} (cm)", + {HistType::kTHnSparseF, {vxAxis, vyAxis, zAxis}}}); + registry.add({"Purity/VtxXYZReco", + "; V_{x} (cm); V_{y} (cm); V_{z} (cm)", + {HistType::kTHnSparseF, {vxAxis, vyAxis, zAxis}}}); + + // Delta vertex positions (reco - true) + registry.add({"Purity/DeltaVtxXYZ", + "; #DeltaV_{x} (cm); #DeltaV_{y} (cm); #DeltaV_{z} (cm)", + {HistType::kTHnSparseF, {deltaVxAxis, deltaVyAxis, deltazAxis}}}); + + registry.add({"Purity/DeltaXRight", + ";#Delta x_{vtx}^{reco-true} (cm) (right);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaYRight", + ";#Delta y_{vtx}^{reco-true} (cm) (right);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaZRight", + ";#Delta z_{vtx}^{reco-true} (cm) (right);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + + // 5D THnSparse histograms: (eta, DCAxy, DCAz, DCAx, DCAy) + + // 1) All / Primary / Secondary after track selection (no vertex classification) + registry.add({"Purity/RecoSparseAll", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"RecoSparseAllBest", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"RecoSparseAllBestWrong", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparsePrimary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseSecondary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 2) Right-vertex: all / primary / secondary + registry.add({"Purity/RecoSparseRightAll", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseRightPrimary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseRightSecondary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 3) Wrong-vertex: all / primary / secondary + registry.add({"Purity/RecoSparseWrongAll", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseWrongPrimary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseWrongSecondary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 4) Generator-truth DCA 5D THnSparse: (eta_truth, DCAxy_truth, DCAz_truth, DCAx_truth, DCAy_truth) + // booked under Tracks/dca/Truth/ + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthAll", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthPrim", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (primary)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthSec", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (secondary)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // Right-vertex truth DCA + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthRightAll", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (right vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthRightPrim", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (primary, right vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthRightSec", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (secondary, right vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // Wrong-vertex truth DCA + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthWrongAll", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (wrong vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthWrongPrim", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (primary, wrong vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthWrongSec", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (secondary, wrong vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 5) Delta-DCA THnSparse: (ΔDCAxy, ΔDCAz, ΔDCAx, ΔDCAy) for right/wrong vertex, all/primary/secondary + registry.add({"Tracks/dca/Truth/THnDeltaDCARightAll", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCARightPrim", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (primary, right vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCARightSec", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (secondary, right vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Tracks/dca/Truth/THnDeltaDCAWrongAll", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (wrong vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCAWrongPrim", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (primary, wrong vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCAWrongSec", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (secondary, wrong vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseAll_EventCount", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/RecoSparseAll_EventCountBest", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/RecoSparseRightAll_EventCount", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/RecoSparseWrongAll_EventCount", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/BestRecoColNotFound", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + } + + if (doprocessGen) { + registry.add({"EventsNtrkZvtxGen", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtxGen_t", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtxGen_gt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtxGen_gt0t", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"TracksEtaZvtxGen", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksEtaZvtxGen_t", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksEtaZvtxGen_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksEtaZvtxGen_gt0t", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksPhiEtaGen", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPhiEtaGen_gt0", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPhiEtaGen_gt0t", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPhiZvtxGen", + "; #varphi; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {phiAxis, zAxis}}}); // + registry.add({"TracksToPartPtEta", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}); // + registry.add({"TracksPtEtaGen", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}); + registry.add({"TracksPtEtaGen_t", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}); + registry.add({"NotFoundEventZvtx", + " ; #it{z}_{vtx} (cm)", + {HistType::kTH1F, {zAxis}}}); + registry.add({"EventsZposDiff", + " ; Z_{rec} - Z_{gen} (cm)", + {HistType::kTH1F, {deltazAxis}}}); + + registry.add({"TracksEtaZvtxGen_gt0_primary", + "; #eta; #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksPhiEtaGen_gt0_primary", + "; #varphi; #eta; primary tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPtZvtxGen_gt0_primary", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"EventsSplitMult", " ; N_{gen}", {HistType::kTH1F, {multAxis}}}); + auto heff = registry.get(HIST("EventEfficiency")); + x = heff->GetXaxis(); + x->SetBinLabel(static_cast(EventEfficiencyBin::Generated), "Generated"); + x->SetBinLabel(static_cast(EventEfficiencyBin::GeneratedInelGt0), "Generated INEL>0"); + x->SetBinLabel(static_cast(EventEfficiencyBin::Reconstructed), "Reconstructed"); + x->SetBinLabel(static_cast(EventEfficiencyBin::Selected), "Selected"); + x->SetBinLabel(static_cast(EventEfficiencyBin::SelectedInelGt0), "Selected INEL>0"); + } + + if (doprocessMultReassoc || doprocessMultReassoc3d) { + // Purity denominator histograms (reco side after DCAxy selection) + + registry.add({"Tracks/Control/DeltaZ", + " ; #it{z_{orig}}-#it{z_{reass}}", + {HistType::kTH1F, {zAxis}}}); + + registry.add({"Tracks/Control/TrackAmbDegree", + " ; N_{coll}^{comp}", + {HistType::kTH1F, {{51, -0.5, 50.5}}}}); + registry.add({"Tracks/Control/TrackIsAmb", + " ; isAmbiguous", + {HistType::kTH1I, {{2, -0.5, 1.5}}}}); + + registry.add({"Tracks/Control/ReassignedTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Tracks/Control/ReassignedTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"Tracks/Control/ReassignedVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); + + registry.add({"Tracks/Control/notReassignedTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Tracks/Control/notReassignedTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"Tracks/Control/notReassignedVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); + registry.add({"Tracks/Control/Chi2NDF", + " ; #chi^{2}/ndf", + {HistType::kTH1F, {{5000, 0.0, 5000.0}}}}); + registry.add({"Tracks/Control/amb/AmbTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + + registry.add({"Tracks/Control/woOrp/nTrk", + " ; N_{Trk}^{all}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // + registry.add({"Tracks/Control/amb/nTrkAmb", + " ; N_{Trk}^{amb}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // + registry.add({"Tracks/Control/nonamb/nTrkNonAmb", + " ; N_{Trk}^{nonamb}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // + + registry.add({"Tracks/Control/amb/AmbTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); // + registry.add({"Tracks/Control/amb/AmbVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); // + registry.add({"Tracks/Control/amb/EtaZvtxAmb_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/amb/DCAxy_amb", " ; DCA_{xy} (cm) ambiguous", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {dcaXyAxis}}}); // + + registry.add({"Tracks/Control/nonamb/nonAmbTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + + registry.add({"Tracks/Control/nonamb/nonAmbTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); // + registry.add({"Tracks/Control/nonamb/nonAmbVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); // + registry.add({"Tracks/Control/nonamb/EtaZvtxNonAmb_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/nonamb/DCAxy_nonamb", " ; DCA_{xy}(cm) non-ambiguous", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{dcaXyAxis}}}}); // + + registry.add({"Tracks/Control/woOrp/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/woOrp/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx_sel8", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelgt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/woOrp/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); // + registry.add({"Tracks/Control/woOrp/woOrpVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); // + registry.add({"Tracks/Control/woOrp/DCAxy_woOrp", " ; DCA_{xy}(cm) w/o orphan", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{dcaXyAxis}}}}); // + + if (doprocessMultReassoc3d) { + // DCAz histograms analogous to DCAxy, only for 3D reassociation + registry.add({"Tracks/Control/DCAZ", + " ; DCA_{Z} (cm)", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Tracks/Control/amb/DCAz_amb", + " ; DCA_{z} (cm) ambiguous", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Tracks/Control/nonamb/DCAz_nonamb", + " ; DCA_{z}(cm) non-ambiguous", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Tracks/Control/woOrp/DCAz_woOrp", + " ; DCA_{z}(cm) w/o orphan", + {HistType::kTH1F, {dcaZAxis}}}); + } + + registry.add({"collisionID", " ; Collision ID", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // + registry.add({"collisionIDamb", " ; Collision ID amb", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // + registry.add({"NonambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisionsNonAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisionsAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisions_InelMFT", " ; Number of selected events with Inel>0 and MFT>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisions_Inel", " ; Number of selected events with Inel>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"ambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + } + + if (doprocessCountingCentrality) { + registry.add({"Events/Centrality/Selection", + ";status;centrality;events", + {HistType::kTH2F, {{3, 0.5, 3.5}, centAxis}}}); + auto hstat = registry.get(HIST("Events/Centrality/Selection")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(static_cast(CentralitySelectionBin::All), "All"); + x->SetBinLabel(static_cast(CentralitySelectionBin::Selected), "Selected"); + x->SetBinLabel(static_cast(CentralitySelectionBin::Rejected), "Rejected"); + + registry.add({"Events/Centrality/NtrkZvtx", + "; N_{trk}; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {multAxis, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/EtaZvtx", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/PhiEta", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/PtEta", + " ; p_{T} (GeV/c); #eta; centrality", + {HistType::kTH3F, {ptAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/DCAXYPt", + " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", + {HistType::kTH3F, {ptAxis, dcaXyAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedDCAXYPt", + " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", + {HistType::kTH3F, {ptAxis, dcaXyAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ExtraDCAXYPt", + " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", + {HistType::kTH3F, {ptAxis, dcaXyAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ExtraTracksEtaZvtx", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ExtraTracksPhiEta", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedTracksEtaZvtx", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedTracksPhiEta", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedVertexCorr", + "; Z_{vtx}^{orig} (cm); Z_{vtx}^{re} (cm); centrality", + {HistType::kTH3F, {zAxis, zAxis, centAxis}}}); + } + + if (doprocessGenCent) { + registry.add({"Events/Centrality/EventEfficiency", + ";status;centrality;events", + {HistType::kTH2F, {{2, 0.5, 2.5}, centAxis}}}); + auto heff = registry.get(HIST("Events/Centrality/EventEfficiency")); + auto* x = heff->GetXaxis(); + x->SetBinLabel(1, "Generated"); + x->SetBinLabel(2, "Selected"); + + registry.add("Events/Centrality/CentPercentileMCGen", + "CentPercentileMCGen", kTH1D, {centAxis}, false); + registry.add({"Events/Centrality/NtrkZvtxGen", + "; N_{trk}; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {multAxis, zAxis, centAxis}}}); + registry.add({"Events/Centrality/NtrkZvtxGen_t", + "; N_{trk}; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {multAxis, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/EtaZvtxGen_t", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/EtaZvtxGen", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/PhiEtaGen", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + } + } + + using FullBCs = soa::Join; + void processTagging(FullBCs const& bcs, + soa::Join const& collisions) + { + + std::vector::iterator> cols; + for (const auto& bc : bcs) { + if (!useEvSel || + (useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) && + bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::GoodBCs)); + cols.clear(); + for (const auto& collision : collisions) { + if (collision.has_foundBC()) { + if (collision.foundBCId() == bc.globalIndex()) { + cols.emplace_back(collision); + } + } else if (collision.bcId() == bc.globalIndex()) { + cols.emplace_back(collision); + } + } + LOGP(debug, "BC {} has {} collisions", bc.globalBC(), cols.size()); + if (!cols.empty()) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::BCsWithCollisions)); + if (cols.size() > 1) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::BCsWithPileupSplitting)); + } + } + } + } + } + + bool passGenRecoTrackMode(auto const& track) const + { + const auto compatibleColls = track.compatibleCollIds(); + const auto nCompatibleColls = compatibleColls.size(); + + if (nCompatibleColls == NoCompatibleCollisions) { + return false; + } + + const auto mode = + static_cast(cfgGenRecoTimeComTrackMode.value); + + switch (mode) { + case GenRecoTimeComTrackMode::AllNonOrphan: + return nCompatibleColls > NoCompatibleCollisions; + case GenRecoTimeComTrackMode::NonOrphanNonAmbiguous: + return nCompatibleColls == SingleCompatibleCollision; + case GenRecoTimeComTrackMode::NonOrphanAmbiguous: + return nCompatibleColls > SingleCompatibleCollision; + default: + return false; + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processTagging, + "Collect event sample stats", true); + + static constexpr float SampleEtaMax = -2.8f; + static constexpr float SampleEtaMin = -3.2f; + + Partition sample = + (aod::fwdtrack::eta < SampleEtaMax) && (aod::fwdtrack::eta > SampleEtaMin); + + static constexpr float CentralEtaMax = 1.f; + Partition sampleCentral = (nabs(aod::track::eta) < CentralEtaMax); + + static constexpr int ValidBestCollisionIdMin = 0; + static constexpr int InvalidCollisionId = -1; + static constexpr float MaxBestDcaXy = 2.f; + expressions::Filter atrackFilter = + (aod::fwdtrack::bestCollisionId >= ValidBestCollisionIdMin) && + (aod::fwdtrack::eta < ForwardEtaMax) && + (aod::fwdtrack::eta > ForwardEtaMin) && + (nabs(aod::fwdtrack::bestDCAXY) <= MaxBestDcaXy); + + using CollwEv = soa::Join; + + expressions::Filter trackSelectionCentral = + ((aod::track::trackCutFlag & TrackSelectionIts) == TrackSelectionIts) && + ifnode((aod::track::v001::detectorMap & (uint8_t)o2::aod::track::TPC) == + (uint8_t)o2::aod::track::TPC, + (aod::track::trackCutFlag & TrackSelectionTpc) == + TrackSelectionTpc, + true) && + ((aod::track::trackCutFlag & TrackSelectionDca) == TrackSelectionDca) && + (nabs(aod::track::eta) < estimatorEta); + + using FiCentralTracks = soa::Filtered< + soa::Join>; // central tracks for INEL>0 + + void processMult(CollwEv::iterator const& collision, + aod::MFTTracks const& tracks, + FiCentralTracks const& midtracks, aod::Tracks const&) + { + + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::All)); + if (!useEvSel || (useEvSel && collision.sel8())) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::VzSelected)); + auto z = collision.posZ(); + auto perCollisionSample = sampleCentral->sliceByCached( + o2::aod::track::collisionId, collision.globalIndex(), cache); + auto nTrk = perCollisionSample.size(); + + registry.fill(HIST("EventsNtrkZvtx"), nTrk, z); + + if (midtracks.size() > 0) // INEL>0 + { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Sel8VzInelGt0)); + registry.fill(HIST("EventsNtrkZvtx_gt0"), nTrk, z); + } + + if (tracks.size() > 0) { + for (const auto& track : tracks) { + + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + + if (usePhiCut) { + if ((phi < cfgPhiCut) || + ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || + (phi > o2::constants::math::TwoPI - cfgPhiCut) || + ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && + (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) + continue; + } + + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + if (midtracks.size() > 0) // INEL>0 + { + registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); + } + registry.fill(HIST("TracksPhiEta"), phi, track.eta()); + registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); + if ((track.eta() < ForwardEtaMax) && (track.eta() > ForwardEtaMin)) { + registry.fill(HIST("TracksPhiZvtx"), phi, z); + } + } + } + + } else { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Rejected)); + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processMult, + "Process reco or data info", true); + // Common implementation for both BestCollisionsFwd and BestCollisionsFwd3d + template + void processMultReassocCommon(CollwEv::iterator const& collision, + o2::aod::MFTTracks const&, + RetracksT const& retracks, + FiCentralTracks const& midtracks, aod::Tracks const&) + { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::All)); + auto perCollisionSample = sampleCentral->sliceByCached( + o2::aod::track::collisionId, collision.globalIndex(), cache); + auto nTrk = perCollisionSample.size(); + auto z = collision.posZ(); + registry.fill(HIST("EventsNtrkZvtx"), nTrk, z); + if ((z >= cfgVzCut1) && (z <= cfgVzCut2)) { + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_all"), nTrk, z); + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Vz)); + for (const auto& retrack : retracks) { + auto track = retrack.mfttrack(); + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) { + continue; + } + } + float dcaXyCut = retrack.bestDCAXY(); + if (useDCAxyCut) { + if (dcaXyCut > maxDCAxy) + continue; + } + if constexpr (std::is_same_v>) { + float dcaZCut = retrack.bestDCAZ(); + if (useDCAzCut) { + if (dcaZCut > maxDCAz) + continue; + } + } + if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx"), track.eta(), z); + } + } + if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return; + } + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::VzItsRof)); + if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::VzSelected)); + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8"), nTrk, z); + std::unordered_set uniqueEvents; + std::unordered_set uniqueEventsAmb; + std::unordered_set uniqueCollisions; + std::unordered_set uniqueCollisionsAmb; + std::unordered_set eventsInelMFT; + std::unordered_set eventsInel; + if (midtracks.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Sel8VzInelGt0)); + registry.fill(HIST("EventsNtrkZvtx_gt0"), nTrk, z); + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0"), nTrk, z); + eventsInel.insert(collision.globalIndex()); + } + if (perCollisionSample.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::PerCollisionSampleGt0)); + } + if (midtracks.size() > 0 && perCollisionSample.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::MidtracksAndPerCollisionSampleGt0)); + } + int64_t i = 0.0, j = 0.0, k = 0.0; + for (const auto& retrack : retracks) { + auto track = retrack.mfttrack(); + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) { + continue; + } + } + float dcaXyCut = retrack.bestDCAXY(); + if (useDCAxyCut) { + if (dcaXyCut > maxDCAxy) + continue; + } + if constexpr (std::is_same_v>) { + float dcaZCut = retrack.bestDCAZ(); + if (useDCAzCut) { + if (dcaZCut > maxDCAz) + continue; + } + } + if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + registry.fill(HIST("Tracks/Control/Chi2NDF"), chi2ndf); + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8"), track.eta(), z); + if (midtracks.size() > 0 && retrack.ambDegree() > 0) { + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelgt0"), track.eta(), z); + } + } + } + if (retracks.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::SelInelInelFwdGt0)); + if (midtracks.size() > 0) { + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0"), nTrk, z); + } + for (const auto& retrack : retracks) { + auto track = retrack.mfttrack(); + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + float dcaXyCut = retrack.bestDCAXY(); + o2::math_utils::bringTo02Pi(phi); + // Declare dcaZCut only if needed below. + if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) { + continue; + } + } + if (useDCAxyCut) { + if (dcaXyCut > maxDCAxy) + continue; + } + if constexpr (std::is_same_v>) { + float dcaZCut = retrack.bestDCAZ(); + if (useDCAzCut) { + if (dcaZCut > maxDCAz) + continue; + } + } + + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + if (midtracks.size() > 0 && retrack.ambDegree() > 0) { + registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0"), track.eta(), z); + eventsInelMFT.insert(retrack.bestCollisionId()); + } + if (retrack.ambDegree() != 0) { + registry.fill(HIST("Tracks/Control/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); + ++k; + } + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("TracksPhiEta"), phi, track.eta()); + registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); + if ((track.eta() < ForwardEtaMax) && (track.eta() > ForwardEtaMin)) { + registry.fill(HIST("TracksPhiZvtx"), phi, z); + } + if (track.collisionId() > InvalidCollisionId && + retrack.ambDegree() == SingleCompatibleCollision) { + registry.fill(HIST("collisionID"), track.collisionId()); + } + if (track.collisionId() > InvalidCollisionId && + retrack.ambDegree() > SingleCompatibleCollision) { + registry.fill(HIST("collisionIDamb"), track.collisionId()); + } + if (track.collisionId() != retrack.bestCollisionId()) { + registry.fill(HIST("Tracks/Control/ReassignedTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/ReassignedTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/ReassignedVertexCorr"), + track.template collision_as().posZ(), z); + + registry.fill(HIST("Tracks/Control/DeltaZ"), + track.template collision_as().posZ() - + collision.posZ()); + } + if (track.collisionId() == retrack.bestCollisionId()) { + registry.fill(HIST("Tracks/Control/notReassignedTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/notReassignedTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/notReassignedVertexCorr"), + track.template collision_as().posZ(), z); + } + + registry.fill(HIST("Tracks/Control/TrackAmbDegree"), + retrack.ambDegree()); + registry.fill(HIST("Tracks/Control/DCAXY"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/DCAZ"), retrack.bestDCAZ()); + } + int isAmbiguous = 0; + + if (retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { + isAmbiguous = 1; + ++i; + + registry.fill(HIST("Tracks/Control/amb/EtaZvtxAmb_gt0"), track.eta(), z); + + registry.fill(HIST("Tracks/Control/amb/AmbTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/amb/AmbTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/amb/AmbVertexCorr"), + track.template collision_as().posZ(), z); + registry.fill(HIST("Tracks/Control/amb/DCAxy_amb"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/amb/DCAz_amb"), retrack.bestDCAZ()); + } + uniqueEventsAmb.insert(retrack.bestCollisionId()); + } + if (midtracks.size() > 0 && retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { + uniqueCollisionsAmb.insert(collision.globalIndex()); + } + + registry.fill(HIST("Tracks/Control/TrackIsAmb"), isAmbiguous); + if (retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { + ++j; + registry.fill(HIST("Tracks/Control/nonamb/EtaZvtxNonAmb_gt0"), track.eta(), z); + registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/nonamb/nonAmbVertexCorr"), + track.template collision_as().posZ(), z); + registry.fill(HIST("Tracks/Control/nonamb/DCAxy_nonamb"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/nonamb/DCAz_nonamb"), retrack.bestDCAZ()); + } + uniqueEvents.insert(retrack.bestCollisionId()); + } + if (midtracks.size() > 0 && retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { + uniqueCollisions.insert(collision.globalIndex()); + } + + if (retrack.ambDegree() != 0) { + registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/woOrp/woOrpVertexCorr"), + track.template collision_as().posZ(), z); + registry.fill(HIST("Tracks/Control/woOrp/DCAxy_woOrp"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/woOrp/DCAz_woOrp"), retrack.bestDCAZ()); + } + } + } + } + registry.fill(HIST("ambEventCounts"), 1, uniqueEventsAmb.size()); + registry.fill(HIST("NonambEventCounts"), 1, uniqueEvents.size()); + registry.fill(HIST("hNumCollisionsNonAmb_InelMFT"), 1, uniqueCollisions.size()); + registry.fill(HIST("hNumCollisionsAmb_InelMFT"), 1, uniqueCollisionsAmb.size()); + registry.fill(HIST("hNumCollisions_InelMFT"), 1, eventsInelMFT.size()); + } + registry.fill(HIST("Tracks/Control/amb/nTrkAmb"), i); + registry.fill(HIST("Tracks/Control/nonamb/nTrkNonAmb"), j); + registry.fill(HIST("Tracks/Control/woOrp/nTrk"), k); + registry.fill(HIST("hNumCollisions_Inel"), 1, eventsInel.size()); + } + } else { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Rejected)); + } + } + + void processMultReassoc(CollwEv::iterator const& collision, + o2::aod::MFTTracks const& mft, + soa::SmallGroups const& retracks, + FiCentralTracks const& midtracks, aod::Tracks const& trk) + { + processMultReassocCommon(collision, mft, retracks, midtracks, trk); + } + + void processMultReassoc3d(CollwEv::iterator const& collision, + o2::aod::MFTTracks const& mft, + soa::SmallGroups const& retracks, + FiCentralTracks const& midtracks, aod::Tracks const& trk) + { + processMultReassocCommon(collision, mft, retracks, midtracks, trk); + } + PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc, + "Process reco or data info", false); + + PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc3d, + "Process reco or data info (3d)", false); + + using ExColsCent = soa::Join; + + void processCountingCentrality(ExColsCent::iterator const& collision, + aod::MFTTracks const& tracks) + { + auto c = collision.centFT0C(); + registry.fill(HIST("Events/Centrality/Selection"), 1., c); + + if (!useEvSel || collision.sel8()) { + auto z = collision.posZ(); + registry.fill(HIST("Events/Centrality/Selection"), 2., c); + auto perCollisionSample = sample->sliceByCached( + o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + auto nTrk = perCollisionSample.size(); + + registry.fill(HIST("Events/Centrality/NtrkZvtx"), nTrk, z, c); + + for (const auto& track : tracks) { + + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + + if (usePhiCut) { + if ((phi < cfgPhiCut) || + ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || + (phi > o2::constants::math::TwoPI - cfgPhiCut) || + ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && + (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) + continue; + } + + registry.fill(HIST("Tracks/Centrality/EtaZvtx"), track.eta(), z, c); + registry.fill(HIST("Tracks/Centrality/PhiEta"), phi, track.eta(), c); + } + + } else { + registry.fill(HIST("Events/Centrality/Selection"), 3., + c); // rejected events + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processCountingCentrality, + "Count tracks in centrality bins", false); + + using Particles = soa::Filtered; + expressions::Filter primaries = + (aod::mcparticle::flags & + (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == + (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; + static constexpr float McSampleEtaMax = 1.1f; + Partition mcSample = nabs(aod::mcparticle::eta) < McSampleEtaMax; + Partition mcSampleCentral = + nabs(aod::mcparticle::eta) < estimatorEta; + + void processGen( + aod::McCollisions::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + Particles const& particles, aod::MFTTracks const& /*tracks*/, + FiCentralTracks const& midtracks) + { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::Generated)); + + auto perCollisionMCSample = mcSample->sliceByCached( + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto nCharged = 0; + for (const auto& particle : perCollisionMCSample) { + auto charge = 0.; + auto p = pdg->GetParticle(particle.pdgCode()); + if (p != nullptr) { + charge = p->Charge(); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + nCharged++; + } + registry.fill(HIST("EventsNtrkZvtxGen_t"), nCharged, mcCollision.posZ()); + + //--------for INEL>0 + auto perCollisionMCSampleCentral = mcSampleCentral->sliceByCached( + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto nChargedCentral = 0; + for (const auto& particle : perCollisionMCSample) { + auto charge = 0.; + auto p = pdg->GetParticle(particle.pdgCode()); + if (p != nullptr) { + charge = p->Charge(); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + nChargedCentral++; + } + if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { + if (nChargedCentral > 0) { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::GeneratedInelGt0)); + registry.fill(HIST("EventsNtrkZvtxGen_gt0t"), nCharged, + mcCollision.posZ()); + } + } + //----------- + bool atLeastOne = false; + bool atLeastOneGt0 = false; + int moreThanOne = 0; + + LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), + collisions.size()); + for (const auto& collision : collisions) { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::Reconstructed)); + if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return; + } + if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { + atLeastOne = true; + auto perCollisionSample = sample->sliceByCached( + o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::Selected)); + auto perCollisionSampleCentral = + midtracks.sliceBy(perColCentral, collision.globalIndex()); + if ((collision.posZ() >= cfgVzCut1) && (collision.posZ() <= cfgVzCut2) && (mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::SelectedInelGt0)); + atLeastOneGt0 = true; + registry.fill(HIST("EventsNtrkZvtxGen_gt0"), + perCollisionSample.size(), collision.posZ()); + } + + registry.fill(HIST("EventsZposDiff"), + collision.posZ() - mcCollision.posZ()); + if (useZDiffCut) { + if (std::abs(collision.posZ() - mcCollision.posZ()) > maxZDiff) { + continue; + } + } + registry.fill(HIST("EventsNtrkZvtxGen"), perCollisionSample.size(), + collision.posZ()); + ++moreThanOne; + } + } + } + if (collisions.size() == 0) { + registry.fill(HIST("NotFoundEventZvtx"), mcCollision.posZ()); + } + if (moreThanOne > 1) { + registry.fill(HIST("EventsSplitMult"), nCharged); + } + if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { + + for (const auto& particle : particles) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = static_cast(p->Charge()); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + float ptCut = particle.pt(); + + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) + continue; + } + if (usePtCut) { + if (ptCut > cfgnPt) + continue; + } + if (cfgnEta1 < particle.eta() && particle.eta() < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + registry.fill(HIST("TracksEtaZvtxGen_t"), particle.eta(), + mcCollision.posZ()); + if (perCollisionMCSampleCentral.size() > 0) { + registry.fill(HIST("TracksEtaZvtxGen_gt0t"), particle.eta(), + mcCollision.posZ()); + registry.fill(HIST("TracksPhiEtaGen_gt0t"), particle.phi(), particle.eta()); + } + if (atLeastOne) { + registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), + mcCollision.posZ()); + registry.fill(HIST("TracksPtEtaGen"), particle.pt(), particle.eta()); + if (atLeastOneGt0) { + registry.fill(HIST("TracksEtaZvtxGen_gt0"), particle.eta(), + mcCollision.posZ()); + registry.fill(HIST("TracksPhiEtaGen_gt0"), particle.phi(), particle.eta()); + if (particle.isPhysicalPrimary()) { + registry.fill(HIST("TracksEtaZvtxGen_gt0_primary"), particle.eta(), mcCollision.posZ()); + registry.fill(HIST("TracksPhiEtaGen_gt0_primary"), particle.phi(), particle.eta()); + registry.fill(HIST("TracksPtZvtxGen_gt0_primary"), particle.pt(), mcCollision.posZ()); + } + } + } + + registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + registry.fill(HIST("TracksPhiZvtxGen"), particle.phi(), + mcCollision.posZ()); + registry.fill(HIST("TracksPtEtaGen_t"), particle.pt(), particle.eta()); + } + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGen, + "Process generator-level info", false); + + using ExColsGenCent = + soa::SmallGroups>; + + void processGenCent(aod::McCollisions::iterator const& mcCollision, + ExColsGenCent const& collisions, + Particles const& particles, + MFTTracksLabeled const& /*tracks*/) + { + + LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), + collisions.size()); + + float cGen = -1; + bool atLeastOne = false; + for (const auto& collision : collisions) { + float cRec = -1; + if constexpr (ExColsGenCent::template contains()) { + cRec = collision.centFT0C(); + } + if (!useEvSel || (useEvSel && collision.sel8())) { + if constexpr (ExColsGenCent::template contains()) { + if (!atLeastOne) { + cGen = cRec; + } + } + atLeastOne = true; + + registry.fill(HIST("Events/Centrality/EventEfficiency"), 2., cGen); + registry.fill(HIST("Events/Centrality/CentPercentileMCGen"), cGen); + + auto perCollisionSample = sample->sliceByCached( + o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + registry.fill(HIST("Events/Centrality/NtrkZvtxGen"), + perCollisionSample.size(), collision.posZ(), cGen); + } + } + + registry.fill(HIST("Events/Centrality/EventEfficiency"), 1., cGen); + + auto perCollisionMCSample = mcSample->sliceByCached( + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto nCharged = 0; + + for (const auto& particle : perCollisionMCSample) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = static_cast(p->Charge()); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + nCharged++; + } + + if constexpr (ExColsGenCent::template contains()) { + registry.fill(HIST("Events/Centrality/NtrkZvtxGen_t"), nCharged, + mcCollision.posZ(), cGen); + } + + for (const auto& particle : particles) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = static_cast(p->Charge()); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + + if constexpr (ExColsGenCent::template contains()) { + registry.fill(HIST("Tracks/Centrality/EtaZvtxGen_t"), particle.eta(), + mcCollision.posZ(), cGen); + } + + if (atLeastOne) { + if constexpr (ExColsGenCent::template contains()) { + registry.fill(HIST("Tracks/Centrality/EtaZvtxGen"), particle.eta(), + mcCollision.posZ(), cGen); + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("Tracks/Centrality/PhiEtaGen"), phi, + particle.eta(), cGen); + } + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenCent, + "Process generator-level info in centrality bins", false); + + void processGenPt( + soa::Join::iterator const& collision, + MFTTracksLabeled const& tracks, aod::McParticles const&) + { + if (!useEvSel || (useEvSel && collision.sel8())) { + for (const auto& track : tracks) { + if (!track.has_mcParticle()) { + continue; + } + auto particle = track.mcParticle(); + if (!particle.isPhysicalPrimary()) { + continue; + } + registry.fill(HIST("TracksToPartPtEta"), particle.pt(), particle.eta()); + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenPt, + "Process particle-level info of pt", false); + + void processGenRecoTimeCom(McCollisionsWithExtra::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + MFTTracksLabeledOrg const& tracks, + FiCentralTracks const& midtracks, + aod::McParticles const&) + { + const auto fillGenRecoCut = [&](GenRecoCutBin bin) { + registry.fill(HIST("EventsRecoCuts_GenReco"), static_cast(bin)); + }; + fillGenRecoCut(GenRecoCutBin::AllRecoCollisions); + std::unordered_map recoToMc; + std::unordered_map> mcToReco; // MC collision id -> list of reco collision globalIndex + + for (const auto& collision : collisions) { + int nSavedRows = 0; + std::unordered_set uniqueRecoColsSaved; + int recoCol = collision.globalIndex(); // reconstructed vertex index + int mcCol = collision.mcCollisionId(); // true MC collision index + + if (mcCol >= 0) { + recoToMc[recoCol] = mcCol; + mcToReco[mcCol].push_back(recoCol); + + ++nSavedRows; + uniqueRecoColsSaved.insert(recoCol); + } + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + + registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); + + if (useCont && collision.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); + + if (!collision.has_mcCollision()) { + LOGF(warning, "No MC collision found..."); + return; + } + fillGenRecoCut(GenRecoCutBin::HasMcCollision); + + auto countAndPassEvSelGenReco = [&](auto const& collision) { + struct EvSelStep { + bool enabled; + decltype(aod::evsel::kIsTriggerTVX) bit; + GenRecoCutBin bin; + }; + + const std::array steps = {{ + {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, + {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, + {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, + {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, + {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, + {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, + {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, + {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, + {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, + {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, + }}; + + if (!useEvSel) { + for (const auto& step : steps) { + fillGenRecoCut(step.bin); + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + return true; + } + + for (const auto& step : steps) { + if (!step.enabled) { + fillGenRecoCut(step.bin); + continue; + } + + if (!collision.selection_bit(step.bit)) { + return false; + } + fillGenRecoCut(step.bin); + } + + if (useRctMFT && !myChecker(collision)) { + return false; + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + + return true; + }; + + if (!countAndPassEvSelGenReco(collision)) { + continue; + } + + const auto z = collision.posZ(); + if ((z < cfgVzCut1) || (z > cfgVzCut2)) { + continue; + } + fillGenRecoCut(GenRecoCutBin::VzWindow); + + auto perCollisionSampleCentral = midtracks.sliceBy(perColCentral, collision.globalIndex()); + if (perCollisionSampleCentral.size() <= 0) { + continue; + } + fillGenRecoCut(GenRecoCutBin::InelGt0); + + // constexpr uint8_t kFakeMcMask = 1u << 7; + for (const auto& track : tracks) { + float ndf = getTrackNdf(track); + const float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + // const float dcaXyCut = track.bestDCAXY(); + // const float dcaZCut = track.bestDCAZ(); + const float ptCut = track.pt(); + o2::math_utils::bringTo02Pi(phi); + + const bool failTrackCuts = + track.nClusters() < cfgnCluster || + track.eta() <= cfgnEta1 || + track.eta() >= cfgnEta2 || + chi2ndf >= cfgChi2NDFMax || + phi <= cfgPhiCut1 || + phi >= cfgPhiCut2 || + (usePhiCut && + ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh))) || + // (useDCAxyCut && dcaxyCut > maxDCAxy) || + // (useDCAzCut && std::abs(dcazCut) > maxDCAz) || + (usePtCut && ptCut > cfgnPt); + + if (failTrackCuts) { + continue; + } + const bool hasMcLabel = track.has_mcParticle(); + const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; + const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; + const bool hasNoMcLabel = !hasMcLabel; + const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); + const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); + const float eta = track.eta(); + if (!passGenRecoTrackMode(track)) { // 0-> All nonorphans, 1->Non-Amb, 2->Amb + continue; + } + int bin = static_cast(RightWrongBin::Neither); + bool recoOfTrueExists = false; + + if (isTrueByLabel) { + int recoCol = track.collisionId(); + auto itRecoToMc = recoToMc.find(recoCol); + const int mcOfTrack = track.mcParticle().mcCollisionId(); + + // Check whether any reco vertex exists for the true MC collision of this track + for (const auto& [recoId, mcId] : recoToMc) { + if (mcId == mcOfTrack) { + recoOfTrueExists = true; + break; + } + } + + if (recoCol >= 0 && itRecoToMc != recoToMc.end()) { + int mcFromReco = itRecoToMc->second; + bin = (mcFromReco == mcOfTrack) + ? static_cast(RightWrongBin::Right) + : static_cast(RightWrongBin::Wrong); + } + } + + registry.fill(HIST("RightWrong"), bin); + + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/WrongVertexRecoExists"), recoOfTrueExists ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); + } + + const auto fillTrackLabelSummary = [&](TrackLabelSummaryBin bin) { + registry.fill(HIST("Purity/TrackLabelSummary"), static_cast(bin)); + }; + const auto fillTrackEtaCategory = [&](TrackLabelSummaryBin bin) { + constexpr float EtaSentinel = -999.f; + + float etaAll = EtaSentinel; + float etaNoMc = EtaSentinel; + float etaFake = EtaSentinel; + float etaTrue = EtaSentinel; + float etaPrimary = EtaSentinel; + float etaSecondary = EtaSentinel; + + switch (bin) { + case TrackLabelSummaryBin::AllTracks: + etaAll = eta; + break; + case TrackLabelSummaryBin::NoMcLabel: + etaNoMc = eta; + break; + case TrackLabelSummaryBin::FakeTracks: + etaFake = eta; + break; + case TrackLabelSummaryBin::TrueTracks: + etaTrue = eta; + break; + case TrackLabelSummaryBin::PrimaryTracks: + etaPrimary = eta; + break; + case TrackLabelSummaryBin::SecondaryTracks: + etaSecondary = eta; + break; + } + + registry.fill(HIST("Purity/TrackEtaCategorySparse"), + etaAll, etaNoMc, etaFake, etaTrue, etaPrimary, etaSecondary); + }; + + // registry.fill(HIST("Purity/TrackLabelStatus"), hasMcLabel ? 1.0 : 0.0); + // registry.fill(HIST("Purity/TrackFakeStatus"), isFakeByLabel ? 1.0 : 0.0); + + fillTrackLabelSummary(TrackLabelSummaryBin::AllTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::AllTracks); + + if (hasNoMcLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::NoMcLabel); + fillTrackEtaCategory(TrackLabelSummaryBin::NoMcLabel); + continue; + } + + if (isFakeByLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::FakeTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::FakeTracks); + continue; + } + + fillTrackLabelSummary(TrackLabelSummaryBin::TrueTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::TrueTracks); + + if (isPrimaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::PrimaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::PrimaryTracks); + } + + if (isSecondaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::SecondaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::SecondaryTracks); + } + // registry.fill(HIST("RightWrong"), bin); + + } // Track loop 1 + } // Collision + } + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenRecoTimeCom, + "Process for MC time compatible", false); + + // using MFTTracksLabeled = soa::Join; + // using MFTTracksLabeled =soa::Join; + + // aod::MFTTracks const& tracks + // soa::Join::iterator const& mcCollision + // aod::McCollisions::iterator const& mcCollision + // McCollisionsWithExtra::iterator const& mcCollision + + // void processMCeff(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + // soa::Join::iterator const& mcCollision //This worked + void processGenReco(McCollisionsWithExtra::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + FullBCs const& bcs, + MFTTracksLabeled const& tracks, + FiCentralTracks const& midtracks, + aod::McParticles const&) + + { + + const auto fillGenRecoCut = [&](GenRecoCutBin bin) { + registry.fill(HIST("EventsRecoCuts_GenReco"), static_cast(bin)); + }; + fillGenRecoCut(GenRecoCutBin::AllRecoCollisions); + + // if (maxGenRecoEvents >= 0 && nProcessedGenReco >= maxGenRecoEvents) { + // return; + // } + // ++nProcessedGenReco; // for HIR + std::unordered_map recoToMc; + std::unordered_map> mcToReco; // MC collision id -> list of reco collision globalIndex + std::unordered_map recoToMcVZ; + std::unordered_map recoVtxX; + std::unordered_map recoVtxY; + std::unordered_map recoVtxZ; + std::unordered_map> recoVtxByRecoId; + std::unordered_map> recoVtxByMcId; + + recoVtxByRecoId.reserve(collisions.size()); + recoVtxByMcId.reserve(collisions.size()); + mcToReco.reserve(collisions.size()); + + // --- Make sure magnetic field exists in THIS device before any propagation --- + // IMPORTANT: calling collision.bc_as() requires the BC table to be subscribed. + // We subscribe by taking `FullBCs const& bcs` in the process signature and init once here. + bool magInited = false; + for (auto const& bc : bcs) { + initMagField(bc); + magInited = true; + break; // once is enough (initMagField is internally guarded) + } + if (!magInited) { + LOGF(fatal, "BC table is empty: cannot initialize magnetic field"); + } + + //_______________________________________________________________________________ + + for (const auto& collision : collisions) { + int nSavedRows = 0; + std::unordered_set uniqueRecoColsSaved; + int recoCol = collision.globalIndex(); // reconstructed vertex index + int mcCol = collision.mcCollisionId(); // true MC collision index + + if (mcCol >= 0) { + recoToMc[recoCol] = mcCol; + mcToReco[mcCol].push_back(recoCol); + + ++nSavedRows; + uniqueRecoColsSaved.insert(recoCol); + } + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + + recoVtxX[recoCol] = collision.posX(); + recoVtxY[recoCol] = collision.posY(); + recoVtxZ[recoCol] = collision.posZ(); + + registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); + + if (useCont && collision.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); + + if (!collision.has_mcCollision()) { + LOGF(warning, "No MC collision found..."); + return; + } + fillGenRecoCut(GenRecoCutBin::HasMcCollision); + + auto countAndPassEvSelGenReco = [&](auto const& collision) { + struct EvSelStep { + bool enabled; + decltype(aod::evsel::kIsTriggerTVX) bit; + GenRecoCutBin bin; + }; + + const std::array steps = {{ + {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, + {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, + {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, + {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, + {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, + {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, + {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, + {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, + {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, + {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, + }}; + + if (!useEvSel) { + for (const auto& step : steps) { + fillGenRecoCut(step.bin); + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + return true; + } + + for (const auto& step : steps) { + if (!step.enabled) { + fillGenRecoCut(step.bin); + continue; + } + + if (!collision.selection_bit(step.bit)) { + return false; + } + fillGenRecoCut(step.bin); + } + + if (useRctMFT && !myChecker(collision)) { + return false; + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + + return true; + }; + + if (!countAndPassEvSelGenReco(collision)) { + continue; + } + + const auto z = collision.posZ(); + if ((z < cfgVzCut1) || (z > cfgVzCut2)) { + continue; + } + fillGenRecoCut(GenRecoCutBin::VzWindow); + + auto perCollisionSampleCentral = midtracks.sliceBy(perColCentral, collision.globalIndex()); + if (perCollisionSampleCentral.size() <= 0) { + continue; + } + fillGenRecoCut(GenRecoCutBin::InelGt0); + + //________________________________________________________________________________ + + registry.fill(HIST("Purity/xReco"), collision.posX()); + registry.fill(HIST("Purity/xTrue"), mcCollision.posX()); + registry.fill(HIST("Purity/yReco"), collision.posY()); + + registry.fill(HIST("Purity/yTrue"), mcCollision.posY()); + registry.fill(HIST("Purity/zReco"), collision.posZ()); + registry.fill(HIST("Purity/zTrue"), mcCollision.posZ()); + + // --- Vertex position THnSparse: status axis (1=reco, 2=true) --- + registry.fill(HIST("Purity/VtxXYZTruth"), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + registry.fill(HIST("Purity/VtxXYZReco"), collision.posX(), collision.posY(), collision.posZ()); + + // --- Delta vertex THnSparse (reco - true) --- + registry.fill(HIST("Purity/DeltaVtxXYZ"), + collision.posX() - mcCollision.posX(), // Reco - Truth + collision.posY() - mcCollision.posY(), + collision.posZ() - mcCollision.posZ()); + + recoVtxByRecoId[collision.globalIndex()] = {collision.posX(), collision.posY(), collision.posZ()}; + recoVtxByMcId[collision.mcCollisionId()] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; + + int64_t woOrpCount = 0; + bool filledRight = false; + bool filledWrong = false; + int nMftSelectedAfterCuts = 0; + std::unordered_set uniqueBestRecoCols; + // auto particle = templatedTrack.template mcParticle_as(); + + if (tracks.size() > 0) { + bool countedPrimary = false; + for (const auto& track : tracks) { // track loop starts + // All compatible collisions assigned by track-to-collision-associator + if (!(midtracks.size() > 0)) + continue; + // std::cout <<" midtracks.size() " <= cfgnEta2 || + chi2ndf >= cfgChi2NDFMax || + phi <= cfgPhiCut1 || + phi >= cfgPhiCut2 || + (usePhiCut && + ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh))) || + (useDCAxyCut && dcaXyCut > maxDCAxy) || + (useDCAzCut && std::abs(dcaZCut) > maxDCAz) || + (usePtCut && ptCut > cfgnPt); + + if (failTrackCuts) { + continue; + } + + const bool hasMcLabel = track.has_mcParticle(); + const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; + const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; + const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); + const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); + const auto mcColObj = track.mcParticle().mcCollision_as(); + const auto mcPart = track.mcParticle(); + + if (!passGenRecoTrackMode(track)) { // + continue; + } + int bin = static_cast(RightWrongBin::Neither); + bool recoOfTrueExists = false; + bool recoOfTrueInCompatible = false; + + const int bestColID = track.bestCollisionId(); // same as track.collisionId(); + if (isTrueByLabel) { + auto itRecoToMc = recoToMc.find(bestColID); + const int mcOfTrack = track.mcParticle().mcCollisionId(); + const auto compatibleIds = track.compatibleCollIds(); + auto itRecoList = mcToReco.find(mcOfTrack); + + // 1) First check whether the correct reco collision of the true MC collision + // is present in the compatible-collision list. + if (!compatibleIds.empty() && itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + for (const auto& trueRecoId : itRecoList->second) { + for (const auto& compatibleId : compatibleIds) { + if (compatibleId == trueRecoId) { + recoOfTrueInCompatible = true; + break; + } + } + if (recoOfTrueInCompatible) { + break; + } + } + } + + // 2) Then check whether any reco collision for the true MC collision exists at all. + if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + recoOfTrueExists = true; + } + + // 3) Finally classify the actually chosen reco collision as right/wrong. + if (bestColID >= 0 && itRecoToMc != recoToMc.end()) { + const int mcFromReco = itRecoToMc->second; + bin = (mcFromReco == mcOfTrack) + ? static_cast(RightWrongBin::Right) + : static_cast(RightWrongBin::Wrong); + } + } + + registry.fill(HIST("RightWrong"), bin); + registry.fill(HIST("Purity/RecoOfTrueExists"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatible"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/WrongVertexRecoExists"), + recoOfTrueExists ? static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists) + : static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing)); + registry.fill(HIST("Purity/RecoOfTrueExistsW"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatibleW"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } + + if (bin == static_cast(RightWrongBin::Right)) { + registry.fill(HIST("Purity/RecoOfTrueExistsR"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatibleR"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } + + registry.fill(HIST("Purity/RecoSparseAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparsePrimary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + + registry.fill(HIST("RecoSparseAllBest"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (bin == static_cast(RightWrongBin::Wrong)) { + float vzBest = 999.; + float vzTrue = 999.; + auto itVzBest = recoVtxZ.find(bestColID); + if (itVzBest != recoVtxZ.end()) { + vzBest = itVzBest->second; + } + auto itVzTrue = recoToMcVZ.find(vzBest); + if (itVzTrue != recoToMcVZ.end()) { + vzTrue = itVzBest->second; + } + double_t vztrueParticle = mcColObj.posZ(); + double_t diff1 = vzBest - vztrueParticle; + double_t diff2 = vzBest - vzTrue; + registry.fill(HIST("deltaVZ_fromReco"), diff1); + registry.fill(HIST("deltaVZ_fromTrue"), diff2); + registry.fill(HIST("RecoSparseAllBestWrong"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + + // Truth DCA components w.r.t. MC collision vertex + const auto dcaXtruth = mcPart.vx() - mcColObj.posX(); // here mcColObj -> mcPart.mcCollision() + const auto dcaYtruth = mcPart.vy() - mcColObj.posY(); + const auto dcaZtruth = mcPart.vz() - mcColObj.posZ(); + const auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + + dcaYtruth * dcaYtruth); + + const float etaTruth = mcPart.eta(); + const bool isPrimaryTruth = mcPart.isPhysicalPrimary(); + + // Base truth histograms (independent of right/wrong vertex) + registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthAll"), + etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); + if (isPrimaryTruth) { + registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthPrim"), + etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); + } else { + registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthSec"), + etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); + } + + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksPtZvtx"), track.pt(), z); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/reco/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpPtZvtx_gt0"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAxyZvtx_gt0"), dcaXyCut, z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAzZvtx_gt0"), dcaZCut, z); + } + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksPhiEta"), phi, track.eta()); + + if (isFakeByLabel) { + // std::cout << " track.eta() " < 0) { + registry.fill(HIST("Purity/reco/woOrp_fake/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_fake/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + if (isTrueByLabel) { + // Has MC particle + // std::cout << " track.eta() has mc particle " < 0) { + registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + if (isSecondaryCharged) { + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksPtZvtx"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksPhiEta"), phi, track.eta()); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + if (isPrimaryCharged) { + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksPtZvtx"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksPhiEta"), phi, track.eta()); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + + ++woOrpCount; + // Category 2: all reco tracks after selections (woOrp) + + // --- Primary vs Fake accounting --- + const float xTrue = mcColObj.posX(); + const float yTrue = mcColObj.posY(); + const float zTrue = mcColObj.posZ(); + + std::array dcaInfOrig{999., 999., 999.}; + std::array dcaChosen{999., 999.}; // (DCAxy, DCAz) to chosen reco vertex + std::array dcaRight{999., 999.}; // (DCAxy, DCAz) to truth MC vertex (reference) + std::array dcaChosenXYZ{999., 999., 999.}; // (DCAx, DCAy, DCAz) to chosen reco vertex + + const double bZ = o2::base::Propagator::Instance()->getNominalBz(); + + // Build forward track parameters once per track, then use a fresh copy for each vertex propagation + std::vector v1; // empty -> null cov + SMatrix55 tcovs(v1.begin(), v1.end()); + SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); + o2::track::TrackParCovFwd trackPar0{track.z(), tpars, tcovs, track.chi2()}; + + auto trackPar = trackPar0; // copy + dcaInfOrig = {999., 999., 999.}; + const std::array vtxChosen{collision.posX(), collision.posY(), collision.posZ()}; + trackPar.propagateToDCAhelix(bZ, vtxChosen, dcaInfOrig); + dcaChosenXYZ = dcaInfOrig; // store (DCAx, DCAy, DCAz) + dcaChosen[0] = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + dcaChosen[1] = dcaInfOrig[2]; + + dcaInfOrig = {999., 999., 999.}; + const std::array vtxTruth{xTrue, yTrue, zTrue}; + trackPar.propagateToDCAhelix(bZ, vtxTruth, dcaInfOrig); + dcaRight[0] = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + dcaRight[1] = dcaInfOrig[2]; + + registry.fill(HIST("Purity/DCAyVsDCAx_Right"), dcaChosenXYZ[2], dcaChosenXYZ[1]); + // Fill only for WRONG-vertex tracks (the diagnostic you want) + if (bin == static_cast(RightWrongBin::Wrong)) { + // std::cout <<"dcaxy choosen " << dcaXyCut<<" dcaxy calculated "<(RightWrongBin::Right)) { + // std::cout <<"dcaxy choosen " << dcaXyCut<<" dcaxy calculated "<(RightWrongBin::Right)) { + // Right-vertex: all / primary / secondary + registry.fill(HIST("Purity/RecoSparseRightAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (!filledRight) { + registry.fill(HIST("Purity/RecoSparseRightAll_EventCount"), static_cast(SingleCountBin::Count)); + + filledRight = true; + } + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparseRightPrimary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseRightSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + } else if (bin == static_cast(RightWrongBin::Wrong)) { + // Wrong-vertex: all / primary / secondary + registry.fill(HIST("Purity/RecoSparseWrongAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (!filledWrong) { + registry.fill(HIST("Purity/RecoSparseWrongAll_EventCount"), static_cast(SingleCountBin::Count)); + filledWrong = true; + } + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparseWrongPrimary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseWrongSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + } + // Reconstructed vertex position for bestbestColID, if available + auto itVtxX = recoVtxX.find(bestColID); + + if (itVtxX != recoVtxX.end()) { + + const float xReco = itVtxX->second; + const float yReco = recoVtxY[bestColID]; + const float zReco = recoVtxZ[bestColID]; + const bool recoVzIn = (zReco >= cfgVzCut1) && (zReco <= cfgVzCut2); + const bool trueVzIn = (zTrue >= cfgVzCut1) && (zTrue <= cfgVzCut2); + + if (!(recoVzIn && trueVzIn)) { + continue; // skip filling Delta* histos for this track + } + + const float deltaXvtx = xReco - xTrue; + const float deltaYvtx = yReco - yTrue; + const float deltaZvtx = zReco - zTrue; + + // We are interested in how far the WRONG collisions are from the true one + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/DeltaXWrong"), deltaXvtx); + registry.fill(HIST("Purity/DeltaYWrong"), deltaYvtx); + registry.fill(HIST("Purity/DeltaZWrong"), deltaZvtx); + } + if (bin == static_cast(RightWrongBin::Right)) { + registry.fill(HIST("Purity/DeltaXRight"), deltaXvtx); + registry.fill(HIST("Purity/DeltaYRight"), deltaYvtx); + registry.fill(HIST("Purity/DeltaZRight"), deltaZvtx); + } + } + + // --- Delta-DCA components: truth minus reco --- + const float deltaDCAxy = dcaXYtruth - dcaXYReco; + const float deltaDCAz = dcaZtruth - dcaZReco; + const float deltaDCAx = dcaXtruth - dcaXReco; + const float deltaDCAy = dcaYtruth - dcaYReco; + if (bin == static_cast(RightWrongBin::Right)) { + // Right-vertex: all / primary / secondary + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightAll"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + if (isPrimaryCharged) { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightPrim"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } else { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightSec"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } + } else { + // Wrong-vertex: all / primary / secondary + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongAll"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + if (isPrimaryCharged) { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongPrim"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } else { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongSec"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } + } + + // auto mcColObj = track.mcParticle().mcCollision_as(); + // True primary match (purity numerator) + registry.fill(HIST("Purity/mc/PrimaryAll"), static_cast(SingleCountBin::Count)); + registry.fill(HIST("Purity/mc/PrimaryAllEta"), mcPart.eta()); + registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx"), mcPart.eta(), mcCollision.posZ()); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx_gt0"), mcPart.eta(), mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksPtZvtx_gt0"), mcPart.pt(), mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksDCAxyZvtx_gt0"), dcaXyCut, mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksDCAzZvtx_gt0"), dcaZCut, mcCollision.posZ()); + } + registry.fill(HIST("Purity/mc/PrimaryTracksPhiEta"), mcPart.phi(), mcPart.eta()); + registry.fill(HIST("Purity/SelectedAfterDCAxy/PrimaryAll"), static_cast(SingleCountBin::Count)); + registry.fill(HIST("Purity/SelectedAfterDCAxy/PrimaryAllEta"), mcPart.eta()); + countedPrimary = true; + + // --- Purity profiles (mean of indicator gives purity) --- + registry.fill(HIST("Purity/PurityOverall"), + static_cast(SingleCountBin::Count), + countedPrimary ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + + registry.fill(HIST("Purity/PurityVsEta"), track.eta(), + countedPrimary ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } // track loop + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueBestRecoCols), uniqueBestRecoCols.size()); + } + registry.fill(HIST("Purity/reco/woOrp/nTrk"), woOrpCount); + registry.fill(HIST("Purity/reco/PNchMFT_afterCuts"), nMftSelectedAfterCuts); + } // collision + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenReco, + "Process particle-level info of pt", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx b/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx deleted file mode 100644 index 93b8625ba65..00000000000 --- a/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx +++ /dev/null @@ -1,1223 +0,0 @@ -// Copyright 2020-2025 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 dndeta-mft.cxx -// \author Sarah Herrmann -// -// \brief This code loops over MFT tracks and collisions and fills histograms -// useful to compute dNdeta - -#include "PWGMM/Mult/DataModel/bestCollisionTable.h" - -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" - -#include "TFile.h" - -#include -#include -#include -#include -#include -#include -#include - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::aod::track; - -AxisSpec PtAxis = {1001, -0.005, 10.005}; -AxisSpec DeltaZAxis = {61, -6.1, 6.1}; -AxisSpec ZAxis = {301, -30.1, 30.1}; -AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "Rad", "phi axis"}; -// AxisSpec EtaAxis = {18, -4.6, -1.}; -AxisSpec DCAxyAxis = {5000, -1, 500}; -AxisSpec DCAzAxis = {5000, -251, 250}; -AxisSpec CentAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}}; - -static constexpr TrackSelectionFlags::flagtype trackSelectionITS = - TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | - TrackSelectionFlags::kITSHits; - -static constexpr TrackSelectionFlags::flagtype trackSelectionTPC = - TrackSelectionFlags::kTPCNCls | - TrackSelectionFlags::kTPCCrossedRowsOverNCls | - TrackSelectionFlags::kTPCChi2NDF; - -static constexpr TrackSelectionFlags::flagtype trackSelectionDCA = - TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; - -using MFTTracksLabeled = soa::Join; - -struct PseudorapidityDensityMFT { - SliceCache cache; - Preslice perCol = o2::aod::fwdtrack::collisionId; - Preslice perMcCol = aod::mcparticle::mcCollisionId; - Preslice perColCentral = aod::track::collisionId; - - Service pdg; - - Configurable estimatorEta{"estimatorEta", 1.0, - "eta range for INEL>0 sample definition"}; - - Configurable useEvSel{"useEvSel", true, "use event selection"}; - Configurable disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROF cut for event selection"}; - ConfigurableAxis multBinning{"multBinning", {701, -0.5, 700.5}, ""}; - ConfigurableAxis EtaAxis = {"etaBinning", {36, -4.6, -1.}, ""}; - - Configurable useZDiffCut{"useZDiffCut", true, "use Z difference cut"}; - Configurable maxZDiff{ - "maxZDiff", 1.0f, - "max allowed Z difference for reconstructed collisions (cm)"}; - - Configurable usePhiCut{"usePhiCut", true, "use azimuthal angle cut"}; - Configurable useDCAxyCut{"useDCAxyCut", false, "use DCAxy cut"}; - Configurable useDCAzCut{"useDCAzCut", false, "use DCAz cut"}; - - Configurable cfgPhiCut{"cfgPhiCut", 0.1f, - "Cut on azimuthal angle of MFT tracks"}; - Configurable cfgPhiCut1{"cfgPhiCut1", 0.0f, - "low Cut on azimuthal angle of MFT tracks"}; - Configurable cfgPhiCut2{"cfgPhiCut2", 6.3f, - "high Cut on azimuthal angle of MFT tracks"}; - Configurable cfgVzCut1{"cfgVzCut1", -30.0f, - "Cut1 on vertex position of MFT tracks"}; - Configurable cfgVzCut2{"cfgVzCut2", 30.0f, - "Cut2 on vertex position of MFT tracks"}; - Configurable cfgnCluster{"cfgnCluster", 5.0f, - "Cut on no of clusters per MFT track"}; - Configurable cfgnEta1{"cfgnEta1", -4.5f, - "Cut on eta1"}; - Configurable cfgnEta2{"cfgnEta2", -1.0f, - "Cut on eta1"}; - Configurable cfgChi2NDFMax{"cfgChi2NDFMax", 2000.0f, "Max allowed chi2/NDF for MFT tracks"}; - Configurable maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"}; - Configurable maxDCAz{"maxDCAz", 2.0f, "Cut on dcaZ"}; - - HistogramRegistry registry{ - "registry", - {{"TracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}, // - {"Tracks/EtaZvtx_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}, // - {"TracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}, // - {"TracksPhiZvtx", - "; #varphi; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {PhiAxis, ZAxis}}}, // - {"TracksPtEta", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}, // - {"EventSelection", - ";status;events", - {HistType::kTH1F, {{15, 0.5, 15.5}}}}, - {"EventCounts", - ";status;events", - {HistType::kTH1F, {{2, 0.5, 2.5}}}}, - {"Tracks/Control/TrackCount", ";status;Track counts", {HistType::kTH1F, {{15, 0.5, 15.5}}}}, // added - // Purity-related histograms - {"Purity/SelectedAfterDCAxy/All", - ";bin;counts", - {HistType::kTH1F, {{1, 0.5, 1.5}}}}, - {"Purity/SelectedAfterDCAxy/AllEta", - ";#eta;counts", - {HistType::kTH1F, {EtaAxis}}}, - {"Purity/Gen/PrimaryEta", - ";#eta;primaries", - {HistType::kTH1F, {EtaAxis}}}, - {"Purity/Gen/All", - ";bin;counts", - {HistType::kTH1F, {{1, 0.5, 1.5}}}}, - {"Purity/Gen/AllEta", - ";#eta;counts", - {HistType::kTH1F, {EtaAxis}}}}}; - - void init(InitContext&) - { - if (static_cast(doprocessMult) + - static_cast(doprocessMultReassoc) + - static_cast(doprocessMultReassoc3d) + - static_cast(doprocessCountingCentrality) > - 1) { - LOGP(fatal, - "Exactly one process function between processMult, " - "processMultReassoc, processMultReassoc3d and processCountingCentrality should be " - "enabled!"); - } - AxisSpec MultAxis = {multBinning, "N_{trk}"}; - auto hstat = registry.get(HIST("EventSelection")); - auto* x = hstat->GetXaxis(); - x->SetBinLabel(1, "All"); - x->SetBinLabel(2, "Vz"); - x->SetBinLabel(3, "Vz+ITSRof"); - x->SetBinLabel(4, "Vz+Selected"); - x->SetBinLabel(5, "Sel8+Vz+INEL>0"); - x->SetBinLabel(6, "Sel INEL,INEL_fwd>0"); - x->SetBinLabel(7, "Rejected"); - x->SetBinLabel(8, "Good BCs"); - x->SetBinLabel(9, "BCs with collisions"); - x->SetBinLabel(10, "BCs with pile-up/splitting"); - x->SetBinLabel(11, "percollisionSample>0"); - x->SetBinLabel(12, "midtracks+percollisionSample>0"); - registry.add({"EventsNtrkZvtx", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtx_gt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_all", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/Control/DCAXY", - " ; DCA_{XY} (cm)", - {HistType::kTH1F, {DCAxyAxis}}}); - if (doprocessGen) { - registry.add({"EventsNtrkZvtxGen", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtxGen_t", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtxGen_gt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtxGen_gt0t", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen_t", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen_gt0t", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksPhiEtaGen", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"TracksPhiEtaGen_gt0", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"TracksPhiEtaGen_gt0t", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"TracksPhiZvtxGen", - "; #varphi; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {PhiAxis, ZAxis}}}); // - registry.add({"TracksToPartPtEta", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}); // - registry.add({"TracksPtEtaGen", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}); - registry.add({"TracksPtEtaGen_t", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}); - registry.add({"EventEfficiency", - "; status; events", - {HistType::kTH1F, {{5, 0.5, 5.5}}}}); - registry.add({"NotFoundEventZvtx", - " ; #it{z}_{vtx} (cm)", - {HistType::kTH1F, {ZAxis}}}); - registry.add({"EventsZposDiff", - " ; Z_{rec} - Z_{gen} (cm)", - {HistType::kTH1F, {DeltaZAxis}}}); - registry.add({"EventsSplitMult", " ; N_{gen}", {HistType::kTH1F, {MultAxis}}}); - auto heff = registry.get(HIST("EventEfficiency")); - x = heff->GetXaxis(); - x->SetBinLabel(1, "Generated"); - x->SetBinLabel(2, "Generated INEL>0"); - x->SetBinLabel(3, "Reconstructed"); - x->SetBinLabel(4, "Selected"); - x->SetBinLabel(5, "Selected INEL>0"); - } - - if (doprocessMultReassoc || doprocessMultReassoc3d) { - registry.add({"Tracks/Control/DeltaZ", - " ; #it{z_{orig}}-#it{z_{reass}}", - {HistType::kTH1F, {ZAxis}}}); - - registry.add({"Tracks/Control/TrackAmbDegree", - " ; N_{coll}^{comp}", - {HistType::kTH1F, {{51, -0.5, 50.5}}}}); - registry.add({"Tracks/Control/TrackIsAmb", - " ; isAmbiguous", - {HistType::kTH1I, {{2, -0.5, 1.5}}}}); - - auto htrk = registry.get(HIST("Tracks/Control/TrackCount")); - auto* x = htrk->GetXaxis(); - x->SetBinLabel(0, "All"); - x->SetBinLabel(1, "Reass"); - x->SetBinLabel(2, "Not Reass"); - x->SetBinLabel(3, "Amb"); - x->SetBinLabel(4, "Amb+Not-reass"); - x->SetBinLabel(5, "Non-Amb"); - x->SetBinLabel(6, "Not-Reass+Non-Amb"); - x->SetBinLabel(7, "Amb+Non-Amb"); - x->SetBinLabel(8, "colid<0"); - x->SetBinLabel(9, "wo orphan"); - - registry.add({"Tracks/Control/ReassignedTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"Tracks/Control/ReassignedTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"Tracks/Control/ReassignedVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); - - registry.add({"Tracks/Control/notReassignedTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"Tracks/Control/notReassignedTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"Tracks/Control/notReassignedVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); - registry.add({"Tracks/Control/Chi2NDF", - " ; #chi^{2}/ndf", - {HistType::kTH1F, {{5000, 0.0, 5000.0}}}}); - registry.add({"Tracks/Control/amb/AmbTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - - registry.add({"Tracks/Control/woOrp/nTrk", - " ; N_{Trk}^{all}", - {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // - registry.add({"Tracks/Control/amb/nTrkAmb", - " ; N_{Trk}^{amb}", - {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // - registry.add({"Tracks/Control/nonamb/nTrkNonAmb", - " ; N_{Trk}^{nonamb}", - {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // - - registry.add({"Tracks/Control/amb/AmbTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); // - registry.add({"Tracks/Control/amb/AmbVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); // - registry.add({"Tracks/Control/amb/EtaZvtxAmb_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/amb/DCAxy_amb", " ; DCA_{xy} (cm) ambiguous", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {DCAxyAxis}}}); // - - registry.add({"Tracks/Control/nonamb/nonAmbTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - - registry.add({"Tracks/Control/nonamb/nonAmbTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); // - registry.add({"Tracks/Control/nonamb/nonAmbVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); // - registry.add({"Tracks/Control/nonamb/EtaZvtxNonAmb_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/nonamb/DCAxy_nonamb", " ; DCA_{xy}(cm) non-ambiguous", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{DCAxyAxis}}}}); // - - registry.add({"Tracks/Control/woOrp/woOrpTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/woOrp/woOrpEtaZvtx_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx_sel8", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelgt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/woOrp/woOrpTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); // - registry.add({"Tracks/Control/woOrp/woOrpVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); // - registry.add({"Tracks/Control/woOrp/DCAxy_woOrp", " ; DCA_{xy}(cm) w/o orphan", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{DCAxyAxis}}}}); // - - if (doprocessMultReassoc3d) { - // DCAz histograms analogous to DCAxy, only for 3D reassociation - registry.add({"Tracks/Control/DCAZ", - " ; DCA_{Z} (cm)", - {HistType::kTH1F, {DCAzAxis}}}); - registry.add({"Tracks/Control/amb/DCAz_amb", - " ; DCA_{z} (cm) ambiguous", - {HistType::kTH1F, {DCAzAxis}}}); - registry.add({"Tracks/Control/nonamb/DCAz_nonamb", - " ; DCA_{z}(cm) non-ambiguous", - {HistType::kTH1F, {DCAzAxis}}}); - registry.add({"Tracks/Control/woOrp/DCAz_woOrp", - " ; DCA_{z}(cm) w/o orphan", - {HistType::kTH1F, {DCAzAxis}}}); - } - - registry.add({"collisionID", " ; Collision ID", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // - registry.add({"collisionIDamb", " ; Collision ID amb", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // - registry.add({"NonambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisionsNonAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisionsAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisions_InelMFT", " ; Number of selected events with Inel>0 and MFT>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisions_Inel", " ; Number of selected events with Inel>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"ambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - } - - if (doprocessCountingCentrality) { - registry.add({"Events/Centrality/Selection", - ";status;centrality;events", - {HistType::kTH2F, {{3, 0.5, 3.5}, CentAxis}}}); - auto hstat = registry.get(HIST("Events/Centrality/Selection")); - auto* x = hstat->GetXaxis(); - x->SetBinLabel(1, "All"); - x->SetBinLabel(2, "Selected"); - x->SetBinLabel(3, "Rejected"); - - registry.add({"Events/Centrality/NtrkZvtx", - "; N_{trk}; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/EtaZvtx", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/PhiEta", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/PtEta", - " ; p_{T} (GeV/c); #eta; centrality", - {HistType::kTH3F, {PtAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/DCAXYPt", - " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", - {HistType::kTH3F, {PtAxis, DCAxyAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedDCAXYPt", - " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", - {HistType::kTH3F, {PtAxis, DCAxyAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ExtraDCAXYPt", - " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", - {HistType::kTH3F, {PtAxis, DCAxyAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ExtraTracksEtaZvtx", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ExtraTracksPhiEta", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedTracksEtaZvtx", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedTracksPhiEta", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedVertexCorr", - "; Z_{vtx}^{orig} (cm); Z_{vtx}^{re} (cm); centrality", - {HistType::kTH3F, {ZAxis, ZAxis, CentAxis}}}); - } - - if (doprocessGenCent) { - registry.add({"Events/Centrality/EventEfficiency", - ";status;centrality;events", - {HistType::kTH2F, {{2, 0.5, 2.5}, CentAxis}}}); - auto heff = registry.get(HIST("Events/Centrality/EventEfficiency")); - auto* x = heff->GetXaxis(); - x->SetBinLabel(1, "Generated"); - x->SetBinLabel(2, "Selected"); - - registry.add("Events/Centrality/CentPercentileMCGen", - "CentPercentileMCGen", kTH1D, {CentAxis}, false); - registry.add({"Events/Centrality/NtrkZvtxGen", - "; N_{trk}; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}}); - registry.add({"Events/Centrality/NtrkZvtxGen_t", - "; N_{trk}; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/EtaZvtxGen_t", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/EtaZvtxGen", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/PhiEtaGen", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - } - } - - using FullBCs = soa::Join; - void processTagging(FullBCs const& bcs, - soa::Join const& collisions) - { - - std::vector::iterator> cols; - for (const auto& bc : bcs) { - if (!useEvSel || - (useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) && - bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) { - registry.fill(HIST("EventSelection"), 8); // added 5->12 - cols.clear(); - for (const auto& collision : collisions) { - if (collision.has_foundBC()) { - if (collision.foundBCId() == bc.globalIndex()) { - cols.emplace_back(collision); - } - } else if (collision.bcId() == bc.globalIndex()) { - cols.emplace_back(collision); - } - } - LOGP(debug, "BC {} has {} collisions", bc.globalBC(), cols.size()); - if (!cols.empty()) { - registry.fill(HIST("EventSelection"), 9); // added 6->13 - if (cols.size() > 1) { - registry.fill(HIST("EventSelection"), 10); // added 7->14 - } - } - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processTagging, - "Collect event sample stats", true); - - Partition sample = - (aod::fwdtrack::eta < -2.8f) && (aod::fwdtrack::eta > -3.2f); - - Partition sampleCentral = (nabs(aod::track::eta) < 1.f); - - expressions::Filter atrackFilter = - (aod::fwdtrack::bestCollisionId >= 0) && (aod::fwdtrack::eta < -2.0f) && - (aod::fwdtrack::eta > -3.9f) && (nabs(aod::fwdtrack::bestDCAXY) <= 2.f); - - using CollwEv = soa::Join; - - expressions::Filter trackSelectionCentral = - ((aod::track::trackCutFlag & trackSelectionITS) == trackSelectionITS) && - ifnode((aod::track::v001::detectorMap & (uint8_t)o2::aod::track::TPC) == - (uint8_t)o2::aod::track::TPC, - (aod::track::trackCutFlag & trackSelectionTPC) == - trackSelectionTPC, - true) && - ((aod::track::trackCutFlag & trackSelectionDCA) == trackSelectionDCA) && - (nabs(aod::track::eta) < estimatorEta); - - using FiCentralTracks = soa::Filtered< - soa::Join>; // central tracks for INEL>0 - - void processMult(CollwEv::iterator const& collision, - aod::MFTTracks const& tracks, - FiCentralTracks const& midtracks, aod::Tracks const&) - { - - registry.fill(HIST("EventSelection"), 1.); - if (!useEvSel || (useEvSel && collision.sel8())) { - registry.fill(HIST("EventSelection"), 2.); - auto z = collision.posZ(); - auto perCollisionSample = sampleCentral->sliceByCached( - o2::aod::track::collisionId, collision.globalIndex(), cache); - auto Ntrk = perCollisionSample.size(); - - registry.fill(HIST("EventsNtrkZvtx"), Ntrk, z); - - if (midtracks.size() > 0) // INEL>0 - { - registry.fill(HIST("EventSelection"), 3.); - registry.fill(HIST("EventsNtrkZvtx_gt0"), Ntrk, z); - } - - if (tracks.size() > 0) { - for (const auto& track : tracks) { - - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - - if (usePhiCut) { - if ((phi < cfgPhiCut) || - ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || - (phi > o2::constants::math::TwoPI - cfgPhiCut) || - ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && - (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) - continue; - } - - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - if (midtracks.size() > 0) // INEL>0 - { - registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); - } - registry.fill(HIST("TracksPhiEta"), phi, track.eta()); - registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); - if ((track.eta() < -2.0f) && (track.eta() > -3.9f)) { - registry.fill(HIST("TracksPhiZvtx"), phi, z); - } - } - } - - } else { - registry.fill(HIST("EventSelection"), 4.); - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processMult, - "Process reco or data info", true); - // Common implementation for both BestCollisionsFwd and BestCollisionsFwd3d - template - void processMultReassocCommon(CollwEv::iterator const& collision, - o2::aod::MFTTracks const&, - RetracksT const& retracks, - FiCentralTracks const& midtracks, aod::Tracks const&) - { - registry.fill(HIST("EventSelection"), 1.); - auto perCollisionSample = sampleCentral->sliceByCached( - o2::aod::track::collisionId, collision.globalIndex(), cache); - auto Ntrk = perCollisionSample.size(); - auto z = collision.posZ(); - registry.fill(HIST("EventsNtrkZvtx"), Ntrk, z); - if ((z >= cfgVzCut1) && (z <= cfgVzCut2)) { - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_all"), Ntrk, z); - registry.fill(HIST("EventSelection"), 2.); - for (const auto& retrack : retracks) { - auto track = retrack.mfttrack(); - float ndf = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); - float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - float dcaxy_cut = retrack.bestDCAXY(); - if (useDCAxyCut) { - if (dcaxy_cut > maxDCAxy) - continue; - } - if constexpr (std::is_same_v>) { - float dcaz_cut = retrack.bestDCAZ(); - if (useDCAzCut) { - if (dcaz_cut > maxDCAz) - continue; - } - } - if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx"), track.eta(), z); - } - } - if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { - return; - } - registry.fill(HIST("EventSelection"), 3.); - if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { - registry.fill(HIST("EventSelection"), 4.); - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8"), Ntrk, z); - std::unordered_set uniqueEvents; - std::unordered_set uniqueEventsAmb; - std::unordered_set uniqueCollisions; - std::unordered_set uniqueCollisionsAmb; - std::unordered_set eventsInelMFT; - std::unordered_set eventsInel; - if (midtracks.size() > 0) { - registry.fill(HIST("EventSelection"), 5.); - registry.fill(HIST("EventsNtrkZvtx_gt0"), Ntrk, z); - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0"), Ntrk, z); - eventsInel.insert(collision.globalIndex()); - } - if (perCollisionSample.size() > 0) { - registry.fill(HIST("EventSelection"), 11.); - } - if (midtracks.size() > 0 && perCollisionSample.size() > 0) { - registry.fill(HIST("EventSelection"), 12.); - } - int64_t i = 0.0, j = 0.0, k = 0.0; - for (const auto& retrack : retracks) { - auto track = retrack.mfttrack(); - float ndf = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); - float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - float dcaxy_cut = retrack.bestDCAXY(); - if (useDCAxyCut) { - if (dcaxy_cut > maxDCAxy) - continue; - } - if constexpr (std::is_same_v>) { - float dcaz_cut = retrack.bestDCAZ(); - if (useDCAzCut) { - if (dcaz_cut > maxDCAz) - continue; - } - } - if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - registry.fill(HIST("Tracks/Control/Chi2NDF"), chi2ndf); - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8"), track.eta(), z); - if (midtracks.size() > 0 && retrack.ambDegree() > 0) { - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelgt0"), track.eta(), z); - } - } - } - if (retracks.size() > 0) { - registry.fill(HIST("EventSelection"), 6.); - if (midtracks.size() > 0) { - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0"), Ntrk, z); - } - for (const auto& retrack : retracks) { - auto track = retrack.mfttrack(); - float ndf = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); - float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - float dcaxy_cut = retrack.bestDCAXY(); - o2::math_utils::bringTo02Pi(phi); - // Declare dcaz_cut only if needed below. - if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - if (useDCAxyCut) { - if (dcaxy_cut > maxDCAxy) - continue; - } - if constexpr (std::is_same_v>) { - float dcaz_cut = retrack.bestDCAZ(); - if (useDCAzCut) { - if (dcaz_cut > maxDCAz) - continue; - } - } - // Purity denominator: all tracks that pass the DCA selection and other quality cuts - registry.fill(HIST("Purity/SelectedAfterDCAxy/All"), 1.); - registry.fill(HIST("Purity/SelectedAfterDCAxy/AllEta"), track.eta()); - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - if (midtracks.size() > 0 && retrack.ambDegree() > 0) { - registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0"), track.eta(), z); - eventsInelMFT.insert(retrack.bestCollisionId()); - } - if (retrack.ambDegree() != 0) { - registry.fill(HIST("Tracks/Control/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); - ++k; - } - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Tracks/Control/TrackCount"), 0); - registry.fill(HIST("TracksPhiEta"), phi, track.eta()); - registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); - if ((track.eta() < -2.0f) && (track.eta() > -3.9f)) { - registry.fill(HIST("TracksPhiZvtx"), phi, z); - } - if (track.collisionId() > -1 && retrack.ambDegree() == 1) { - registry.fill(HIST("Tracks/Control/TrackCount"), 8); - registry.fill(HIST("collisionID"), track.collisionId()); - } - if (track.collisionId() > -1 && retrack.ambDegree() > 1) { - registry.fill(HIST("collisionIDamb"), track.collisionId()); - } - if (track.collisionId() != retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/ReassignedTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/ReassignedTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/ReassignedVertexCorr"), - track.template collision_as().posZ(), z); - - registry.fill(HIST("Tracks/Control/DeltaZ"), - track.template collision_as().posZ() - - collision.posZ()); - registry.fill(HIST("Tracks/Control/TrackCount"), 1); - } - if (track.collisionId() == retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/notReassignedTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/notReassignedTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/notReassignedVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/TrackCount"), 2); - } - - registry.fill(HIST("Tracks/Control/TrackAmbDegree"), - retrack.ambDegree()); - registry.fill(HIST("Tracks/Control/DCAXY"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/DCAZ"), retrack.bestDCAZ()); - } - int isAmbiguous = 0; - - if (retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { - isAmbiguous = 1; - ++i; - - registry.fill(HIST("Tracks/Control/amb/EtaZvtxAmb_gt0"), track.eta(), z); - - registry.fill(HIST("Tracks/Control/amb/AmbTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/amb/AmbTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/amb/AmbVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/amb/DCAxy_amb"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/amb/DCAz_amb"), retrack.bestDCAZ()); - } - registry.fill(HIST("Tracks/Control/TrackCount"), 3); - if (track.collisionId() == retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/TrackCount"), 5); - } - uniqueEventsAmb.insert(retrack.bestCollisionId()); - } - if (midtracks.size() > 0 && retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { - uniqueCollisionsAmb.insert(collision.globalIndex()); - } - - registry.fill(HIST("Tracks/Control/TrackIsAmb"), isAmbiguous); - if (retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { - ++j; - registry.fill(HIST("Tracks/Control/nonamb/EtaZvtxNonAmb_gt0"), track.eta(), z); - registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/nonamb/nonAmbVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/nonamb/DCAxy_nonamb"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/nonamb/DCAz_nonamb"), retrack.bestDCAZ()); - } - registry.fill(HIST("Tracks/Control/TrackCount"), 4); - if (track.collisionId() == retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/TrackCount"), 6); - } - uniqueEvents.insert(retrack.bestCollisionId()); - } - if (midtracks.size() > 0 && retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { - uniqueCollisions.insert(collision.globalIndex()); - } - if ((retrack.ambDegree() > 1) || (retrack.ambDegree() <= 1)) - registry.fill(HIST("Tracks/Control/TrackCount"), 7); - if (retrack.ambDegree() != 0) { - registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/woOrp/woOrpVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/TrackCount"), 9); // without orphan - registry.fill(HIST("Tracks/Control/woOrp/DCAxy_woOrp"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/woOrp/DCAz_woOrp"), retrack.bestDCAZ()); - } - } - } - } - registry.fill(HIST("ambEventCounts"), 1, uniqueEventsAmb.size()); - registry.fill(HIST("NonambEventCounts"), 1, uniqueEvents.size()); - registry.fill(HIST("hNumCollisionsNonAmb_InelMFT"), 1, uniqueCollisions.size()); - registry.fill(HIST("hNumCollisionsAmb_InelMFT"), 1, uniqueCollisionsAmb.size()); - registry.fill(HIST("hNumCollisions_InelMFT"), 1, eventsInelMFT.size()); - } - registry.fill(HIST("Tracks/Control/amb/nTrkAmb"), i); - registry.fill(HIST("Tracks/Control/nonamb/nTrkNonAmb"), j); - registry.fill(HIST("Tracks/Control/woOrp/nTrk"), k); - registry.fill(HIST("hNumCollisions_Inel"), 1, eventsInel.size()); - } - } else { - registry.fill(HIST("EventSelection"), 7); - } - } - - void processMultReassoc(CollwEv::iterator const& collision, - o2::aod::MFTTracks const& mft, - soa::SmallGroups const& retracks, - FiCentralTracks const& midtracks, aod::Tracks const& trk) - { - processMultReassocCommon(collision, mft, retracks, midtracks, trk); - } - - void processMultReassoc3d(CollwEv::iterator const& collision, - o2::aod::MFTTracks const& mft, - soa::SmallGroups const& retracks, - FiCentralTracks const& midtracks, aod::Tracks const& trk) - { - processMultReassocCommon(collision, mft, retracks, midtracks, trk); - } - PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc, - "Process reco or data info", false); - - PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc3d, - "Process reco or data info (3d)", false); - - using ExColsCent = soa::Join; - - void processCountingCentrality(ExColsCent::iterator const& collision, - aod::MFTTracks const& tracks) - { - auto c = collision.centFT0C(); - registry.fill(HIST("Events/Centrality/Selection"), 1., c); - - if (!useEvSel || collision.sel8()) { - auto z = collision.posZ(); - registry.fill(HIST("Events/Centrality/Selection"), 2., c); - auto perCollisionSample = sample->sliceByCached( - o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); - auto Ntrk = perCollisionSample.size(); - - registry.fill(HIST("Events/Centrality/NtrkZvtx"), Ntrk, z, c); - - for (const auto& track : tracks) { - - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - - if (usePhiCut) { - if ((phi < cfgPhiCut) || - ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || - (phi > o2::constants::math::TwoPI - cfgPhiCut) || - ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && - (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) - continue; - } - - registry.fill(HIST("Tracks/Centrality/EtaZvtx"), track.eta(), z, c); - registry.fill(HIST("Tracks/Centrality/PhiEta"), phi, track.eta(), c); - } - - } else { - registry.fill(HIST("Events/Centrality/Selection"), 3., - c); // rejected events - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processCountingCentrality, - "Count tracks in centrality bins", false); - - using Particles = soa::Filtered; - expressions::Filter primaries = - (aod::mcparticle::flags & - (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == - (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; - Partition mcSample = nabs(aod::mcparticle::eta) < 1.1f; - Partition mcSampleCentral = - nabs(aod::mcparticle::eta) < estimatorEta; - - void processGen( - aod::McCollisions::iterator const& mcCollision, - o2::soa::SmallGroups> const& collisions, - Particles const& particles, aod::MFTTracks const& /*tracks*/, - FiCentralTracks const& midtracks) - { - registry.fill(HIST("EventEfficiency"), 1.); - - auto perCollisionMCSample = mcSample->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto nCharged = 0; - for (const auto& particle : perCollisionMCSample) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { - continue; - } - nCharged++; - } - registry.fill(HIST("EventsNtrkZvtxGen_t"), nCharged, mcCollision.posZ()); - - //--------for INEL>0 - auto perCollisionMCSampleCentral = mcSampleCentral->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto nChargedCentral = 0; - for (const auto& particle : perCollisionMCSample) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { - continue; - } - nChargedCentral++; - } - if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { - if (nChargedCentral > 0) { - registry.fill(HIST("EventEfficiency"), 2.); - registry.fill(HIST("EventsNtrkZvtxGen_gt0t"), nCharged, - mcCollision.posZ()); - } - } - //----------- - bool atLeastOne = false; - bool atLeastOne_gt0 = false; - int moreThanOne = 0; - - LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), - collisions.size()); - for (const auto& collision : collisions) { - registry.fill(HIST("EventEfficiency"), 3.); - if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { - return; - } - if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { - atLeastOne = true; - auto perCollisionSample = sample->sliceByCached( - o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); - - registry.fill(HIST("EventEfficiency"), 4.); - - auto perCollisionSampleCentral = - midtracks.sliceBy(perColCentral, collision.globalIndex()); - if ((collision.posZ() >= cfgVzCut1) && (collision.posZ() <= cfgVzCut2) && (mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { - if (perCollisionSampleCentral.size() > 0) { - registry.fill(HIST("EventEfficiency"), 5.); - atLeastOne_gt0 = true; - registry.fill(HIST("EventsNtrkZvtxGen_gt0"), - perCollisionSample.size(), collision.posZ()); - } - - registry.fill(HIST("EventsZposDiff"), - collision.posZ() - mcCollision.posZ()); - if (useZDiffCut) { - if (std::abs(collision.posZ() - mcCollision.posZ()) > maxZDiff) { - continue; - } - } - registry.fill(HIST("EventsNtrkZvtxGen"), perCollisionSample.size(), - collision.posZ()); - ++moreThanOne; - } - } - } - if (collisions.size() == 0) { - registry.fill(HIST("NotFoundEventZvtx"), mcCollision.posZ()); - } - if (moreThanOne > 1) { - registry.fill(HIST("EventsSplitMult"), nCharged); - } - if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { - for (const auto& particle : particles) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0; - if (p != nullptr) { - charge = static_cast(p->Charge()); - } - if (std::abs(charge) < 3.) { - continue; - } - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - if (cfgnEta1 < particle.eta() && particle.eta() < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - // Purity numerator reference at generator level: physical primaries in the same eta window - if (particle.isPhysicalPrimary()) { - registry.fill(HIST("Purity/Gen/PrimaryEta"), particle.eta()); - // Truth-side total counters for primaries in acceptance (for purity calculations) - registry.fill(HIST("Purity/Gen/All"), 1.); - registry.fill(HIST("Purity/Gen/AllEta"), particle.eta()); - } - registry.fill(HIST("TracksEtaZvtxGen_t"), particle.eta(), - mcCollision.posZ()); - if (perCollisionMCSampleCentral.size() > 0) { - registry.fill(HIST("TracksEtaZvtxGen_gt0t"), particle.eta(), - mcCollision.posZ()); - registry.fill(HIST("TracksPhiEtaGen_gt0t"), particle.phi(), particle.eta()); - } - if (atLeastOne) { - registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), - mcCollision.posZ()); - registry.fill(HIST("TracksPtEtaGen"), particle.pt(), particle.eta()); - if (atLeastOne_gt0) { - registry.fill(HIST("TracksEtaZvtxGen_gt0"), particle.eta(), - mcCollision.posZ()); - registry.fill(HIST("TracksPhiEtaGen_gt0"), particle.phi(), particle.eta()); - } - } - - registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - registry.fill(HIST("TracksPhiZvtxGen"), particle.phi(), - mcCollision.posZ()); - registry.fill(HIST("TracksPtEtaGen_t"), particle.pt(), particle.eta()); - } - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processGen, - "Process generator-level info", false); - - using ExColsGenCent = - soa::SmallGroups>; - - void processGenCent(aod::McCollisions::iterator const& mcCollision, - ExColsGenCent const& collisions, - Particles const& particles, - MFTTracksLabeled const& /*tracks*/) - { - - LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), - collisions.size()); - - float c_gen = -1; - bool atLeastOne = false; - for (const auto& collision : collisions) { - float c_rec = -1; - if constexpr (ExColsGenCent::template contains()) { - c_rec = collision.centFT0C(); - } - if (!useEvSel || (useEvSel && collision.sel8())) { - if constexpr (ExColsGenCent::template contains()) { - if (!atLeastOne) { - c_gen = c_rec; - } - } - atLeastOne = true; - - registry.fill(HIST("Events/Centrality/EventEfficiency"), 2., c_gen); - registry.fill(HIST("Events/Centrality/CentPercentileMCGen"), c_gen); - - auto perCollisionSample = sample->sliceByCached( - o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); - registry.fill(HIST("Events/Centrality/NtrkZvtxGen"), - perCollisionSample.size(), collision.posZ(), c_gen); - } - } - - registry.fill(HIST("Events/Centrality/EventEfficiency"), 1., c_gen); - - auto perCollisionMCSample = mcSample->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto nCharged = 0; - - for (const auto& particle : perCollisionMCSample) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0; - if (p != nullptr) { - charge = static_cast(p->Charge()); - } - if (std::abs(charge) < 3.) { - continue; - } - nCharged++; - } - - if constexpr (ExColsGenCent::template contains()) { - registry.fill(HIST("Events/Centrality/NtrkZvtxGen_t"), nCharged, - mcCollision.posZ(), c_gen); - } - - for (const auto& particle : particles) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0; - if (p != nullptr) { - charge = static_cast(p->Charge()); - } - if (std::abs(charge) < 3.) { - continue; - } - - if constexpr (ExColsGenCent::template contains()) { - registry.fill(HIST("Tracks/Centrality/EtaZvtxGen_t"), particle.eta(), - mcCollision.posZ(), c_gen); - } - - if (atLeastOne) { - if constexpr (ExColsGenCent::template contains()) { - registry.fill(HIST("Tracks/Centrality/EtaZvtxGen"), particle.eta(), - mcCollision.posZ(), c_gen); - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Tracks/Centrality/PhiEtaGen"), phi, - particle.eta(), c_gen); - } - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processGenCent, - "Process generator-level info in centrality bins", false); - - void processGenPt( - soa::Join::iterator const& collision, - MFTTracksLabeled const& tracks, aod::McParticles const&) - { - if (!useEvSel || (useEvSel && collision.sel8())) { - for (const auto& track : tracks) { - if (!track.has_mcParticle()) { - continue; - } - auto particle = track.mcParticle(); - if (!particle.isPhysicalPrimary()) { - continue; - } - registry.fill(HIST("TracksToPartPtEta"), particle.pt(), particle.eta()); - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processGenPt, - "Process particle-level info of pt", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} From 94d82701145bd43d40caec6acca8b40a144a2359 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:11:25 +0200 Subject: [PATCH 102/282] [PWGCF] FemtoUniverse: Add approx. fracTPCsCls in mixed-event pairs (#15570) --- ...emtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 7d20486a76a..2955e47a58c 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -968,6 +968,12 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (kT < firstRealElement || kT > lastElement) continue; + + float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); + if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + continue; + } + double rand; rand = randgen->Rndm(); auto part1 = p1; From 403d2003d489ac3ad1472688d1e897e4318a17c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Jos=C3=A9?= <52935244+lucasjsilva@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:40:50 +0200 Subject: [PATCH 103/282] [PWGLF] Correction on histogram filling (#15544) --- PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 30025ca9103..a0ef2af5aa0 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -256,7 +256,6 @@ struct StudyPnch { if (!isGenTrackSelected(track)) { continue; } - // Verify that the track belongs to the given MC collision if (track.mcCollisionId() != McCol.globalIndex()) { continue; } @@ -276,7 +275,6 @@ struct StudyPnch { if (!isTrackSelected(track)) { continue; } - // Verify that the track belongs to the given MC collision if (track.has_mcParticle()) { auto particle = track.mcParticle(); if (particle.mcCollisionId() != McCol.mcCollisionId()) { @@ -287,7 +285,7 @@ struct StudyPnch { } histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); } - // Once all the frequencies have been counted, a loop can be made to fill the histogram + // Loop to fill the histogram without cloned tracks for (const auto& [globalIndex, frequency] : recoFrequencies) { histos.fill(HIST("hCountNTracks"), frequency); // Fill histogram with not cloned tracks @@ -355,18 +353,19 @@ struct StudyPnch { if (!isEventSelected(RecCol)) { continue; } + // Evaluation of reconstructed collisions with more than 1 contributor if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; } auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); if (multrec > 0) { - histos.fill(HIST("hMultiplicityMCrec"), multrec); + histos.fill(HIST("hMultiplicityMCrecMod"), multrec); } auto multgen = countGenTracks(GenParticles, mcCollision); if (multgen > 0 && multrec > 0) { - histos.fill(HIST("hMultiplicityMCgen"), multgen); - histos.fill(HIST("hResponseMatrix"), multrec, multgen); + histos.fill(HIST("hMultiplicityMCgenMod"), multgen); + histos.fill(HIST("hResponseMatrixMod"), multrec, multgen); } } } From af80b928c642b33226096e6457c8fbefd525b4f4 Mon Sep 17 00:00:00 2001 From: Gianni Shigeru Setoue Liveraro <81832939+gianniliveraro@users.noreply.github.com> Date: Mon, 30 Mar 2026 11:42:48 -0300 Subject: [PATCH 104/282] [PWGLF] EMCal in sigma0 analysis (#15577) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFSigmaTables.h | 73 +- .../TableProducer/Strangeness/CMakeLists.txt | 2 +- .../Strangeness/sigma0builder.cxx | 911 ++++++++++++++++-- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 359 ++++--- 4 files changed, 1117 insertions(+), 228 deletions(-) diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 9d728bab596..6c8c9c3a232 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -35,16 +35,11 @@ using std::array; namespace o2::aod { -// Indexing -namespace sigma0Core -{ -DECLARE_SOA_INDEX_COLUMN_FULL(PhotonV0, photonV0, int, V0Cores, "_PhotonV0"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(LambdaV0, lambdaV0, int, V0Cores, "_LambdaV0"); //! -} // namespace sigma0Core - // for real data namespace sigma0Core { +DECLARE_SOA_COLUMN(PhotonV0ID, photonV0ID, int); +DECLARE_SOA_COLUMN(LambdaV0ID, lambdaV0ID, int); DECLARE_SOA_COLUMN(X, x, float); DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(Z, z, float); @@ -163,6 +158,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(LambdaPhi, lambdaPhi, //! Phi in the range [0, 2pi) } // namespace sigma0Core DECLARE_SOA_TABLE(Sigma0Cores, "AOD", "SIGMA0CORES", + // Indices for debug + sigma0Core::PhotonV0ID, sigma0Core::LambdaV0ID, + // Basic properties sigma0Core::X, sigma0Core::Y, sigma0Core::Z, sigma0Core::DCADaughters, sigma0Core::PhotonPx, sigma0Core::PhotonPy, sigma0Core::PhotonPz, sigma0Core::PhotonMass, @@ -502,6 +500,42 @@ DECLARE_SOA_TABLE(Sigma0PhotonExtras, "AOD", "SIGMA0PHOTON", sigma0PhotonExtra::PhotonNegTrackCode, sigma0PhotonExtra::PhotonV0Type); +// For EMCal Photon extra info +namespace sigma0EMPhoton +{ +//______________________________________________________ +// REGULAR COLUMNS FOR SIGMA0EMPHOTON +DECLARE_SOA_COLUMN(PhotonID, photonID, int); +DECLARE_SOA_COLUMN(PhotonEnergy, photonEnergy, float); +DECLARE_SOA_COLUMN(PhotonEMCEta, photonEMCEta, float); +DECLARE_SOA_COLUMN(PhotonEMCPhi, photonEMCPhi, float); +DECLARE_SOA_COLUMN(PhotonM02, photonM02, float); +DECLARE_SOA_COLUMN(PhotonM20, photonM20, float); +DECLARE_SOA_COLUMN(PhotonNCells, photonNCells, int); +DECLARE_SOA_COLUMN(PhotonTime, photonTime, float); +DECLARE_SOA_COLUMN(PhotonIsExotic, photonIsExotic, bool); +DECLARE_SOA_COLUMN(PhotonDistToBad, photonDistToBad, float); +DECLARE_SOA_COLUMN(PhotonNLM, photonNLM, int); +DECLARE_SOA_COLUMN(PhotonDefinition, photonDefinition, int); +DECLARE_SOA_COLUMN(PhotonHasAssocTrk, photonHasAssocTrk, bool); + +} // namespace sigma0EMPhoton + +DECLARE_SOA_TABLE(Sigma0EMPhotons, "AOD", "SIGMA0EMPHOTON", + sigma0EMPhoton::PhotonID, + sigma0EMPhoton::PhotonEnergy, + sigma0EMPhoton::PhotonEMCEta, + sigma0EMPhoton::PhotonEMCPhi, + sigma0EMPhoton::PhotonM02, + sigma0EMPhoton::PhotonM20, + sigma0EMPhoton::PhotonNCells, + sigma0EMPhoton::PhotonTime, + sigma0EMPhoton::PhotonIsExotic, + sigma0EMPhoton::PhotonDistToBad, + sigma0EMPhoton::PhotonNLM, + sigma0EMPhoton::PhotonDefinition, + sigma0EMPhoton::PhotonHasAssocTrk); + // For Lambda extra info namespace sigma0LambdaExtra { @@ -567,6 +601,7 @@ DECLARE_SOA_TABLE(Sigma0LambdaExtras, "AOD", "SIGMA0LAMBDA", // for MC namespace sigma0MCCore { +DECLARE_SOA_COLUMN(ParticleIdMC, particleIdMC, int); //! V0 Particle ID DECLARE_SOA_COLUMN(MCradius, mcradius, float); DECLARE_SOA_COLUMN(PDGCode, pdgCode, int); DECLARE_SOA_COLUMN(PDGCodeMother, pdgCodeMother, int); @@ -576,6 +611,9 @@ DECLARE_SOA_COLUMN(IsProducedByGenerator, isProducedByGenerator, bool); DECLARE_SOA_COLUMN(PhotonMCPx, photonmcpx, float); DECLARE_SOA_COLUMN(PhotonMCPy, photonmcpy, float); DECLARE_SOA_COLUMN(PhotonMCPz, photonmcpz, float); +DECLARE_SOA_COLUMN(PhotonAmplitudeA, photonAmplitudeA, float); // Energy fraction deposited by a particle inside this calo cell. +DECLARE_SOA_COLUMN(PhotonPDGCodePos, photonPDGCodePos, int); +DECLARE_SOA_COLUMN(PhotonPDGCodeNeg, photonPDGCodeNeg, int); DECLARE_SOA_COLUMN(IsPhotonPrimary, isPhotonPrimary, bool); DECLARE_SOA_COLUMN(PhotonPDGCode, photonPDGCode, int); DECLARE_SOA_COLUMN(PhotonPDGCodeMother, photonPDGCodeMother, int); @@ -585,6 +623,8 @@ DECLARE_SOA_COLUMN(LambdaMCPx, lambdamcpx, float); DECLARE_SOA_COLUMN(LambdaMCPy, lambdamcpy, float); DECLARE_SOA_COLUMN(LambdaMCPz, lambdamcpz, float); DECLARE_SOA_COLUMN(IsLambdaPrimary, isLambdaPrimary, bool); +DECLARE_SOA_COLUMN(LambdaPDGCodePos, lambdaPDGCodePos, int); +DECLARE_SOA_COLUMN(LambdaPDGCodeNeg, lambdaPDGCodeNeg, int); DECLARE_SOA_COLUMN(LambdaPDGCode, lambdaPDGCode, int); DECLARE_SOA_COLUMN(LambdaPDGCodeMother, lambdaPDGCodeMother, int); DECLARE_SOA_COLUMN(LambdaIsCorrectlyAssoc, lambdaIsCorrectlyAssoc, bool); @@ -691,15 +731,17 @@ DECLARE_SOA_DYNAMIC_COLUMN(LambdaMCPhi, lambdaMCPhi, //! Phi in the range [0, 2p } // namespace sigma0MCCore DECLARE_SOA_TABLE(Sigma0MCCores, "AOD", "SIGMA0MCCORES", + // MC particle index for debug + sigma0MCCore::ParticleIdMC, // Basic properties sigma0MCCore::MCradius, sigma0MCCore::PDGCode, sigma0MCCore::PDGCodeMother, sigma0MCCore::MCprocess, sigma0MCCore::IsProducedByGenerator, - sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, - sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, + sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::PhotonAmplitudeA, + sigma0MCCore::PhotonPDGCodePos, sigma0MCCore::PhotonPDGCodeNeg, sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz, - sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, + sigma0MCCore::LambdaPDGCodePos, sigma0MCCore::LambdaPDGCodeNeg, sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, // Dynamic columns sigma0MCCore::IsSigma0, @@ -728,11 +770,6 @@ DECLARE_SOA_TABLE(Sigma0MCCores, "AOD", "SIGMA0MCCORES", sigma0MCCore::LambdaMCY, sigma0MCCore::LambdaMCPhi); -namespace sigma0MCCore -{ -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle for Sigma0 -} - // for MC namespace kstarMCCore { @@ -923,12 +960,6 @@ DECLARE_SOA_TABLE(KStarGens, "AOD", "KSTARGENS", DECLARE_SOA_TABLE(SigmaCollRef, "AOD", "SIGMACOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraCollisionId); -DECLARE_SOA_TABLE(SigmaIndices, "AOD", "SIGMAINDEX", //! index table when using AO2Ds - o2::soa::Index<>, sigma0Core::PhotonV0Id, sigma0Core::LambdaV0Id, o2::soa::Marker<1>); - -DECLARE_SOA_TABLE(SigmaMCLabels, "AOD", "SIGMAMCLABEL", //! optional table to refer to mcparticles - o2::soa::Index<>, sigma0MCCore::McParticleId); - DECLARE_SOA_TABLE(SigmaGenCollRef, "AOD", "SIGMAGENCOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraMCCollisionId); diff --git a/PWGLF/TableProducer/Strangeness/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/CMakeLists.txt index 3f1d8565951..08ec72c6913 100644 --- a/PWGLF/TableProducer/Strangeness/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/CMakeLists.txt @@ -139,7 +139,7 @@ o2physics_add_dpl_workflow(cascademlselection o2physics_add_dpl_workflow(sigma0builder SOURCES sigma0builder.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB + PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(lambdajetpolarizationbuilder diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index cc6dcf403cf..bad2b681d13 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -20,6 +20,8 @@ // gianni.shigeru.setoue.liveraro@cern.ch // +#include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGLF/DataModel/LFSigmaTables.h" #include "PWGLF/DataModel/LFStrangenessMLTables.h" #include "PWGLF/DataModel/LFStrangenessPIDTables.h" @@ -66,8 +68,10 @@ using V0DerivedMCDatas = soa::Join; using V0TOFDerivedMCDatas = soa::Join; +using EMCalMCClusters = soa::Join; + static const std::vector DirList = {"V0BeforeSel", "PhotonSel", "LambdaSel", "KShortSel"}; -; +static const std::vector DirList2 = {"EMCalPhotonBeforeSel", "EMCalPhotonSel"}; struct sigma0builder { Service ccdb; @@ -75,7 +79,6 @@ struct sigma0builder { //___________________________________________________ // KStar Specific - Produces kstarcores; // kstar candidates info for analysis Produces kshortExtras; // lambdas from sigma0 candidates info Produces kstarPhotonExtras; // photons from kstar candidates info @@ -86,15 +89,14 @@ struct sigma0builder { //__________________________________________________ // Sigma0 specific - Produces sigmaIndices; // references V0Cores from sigma0Gens - Produces sigma0cores; // sigma0 candidates info for analysis - Produces sigmaPhotonExtras; // photons from sigma0 candidates info - Produces sigmaLambdaExtras; // lambdas from sigma0 candidates info - Produces sigma0CollRefs; // references collisions from Sigma0Cores - Produces sigma0mccores; // Reco sigma0 MC properties - Produces sigma0mclabel; // Link of reco sigma0 to mcparticles - Produces sigma0Gens; // Generated sigma0s - Produces sigma0GenCollRefs; // references collisions from sigma0Gens + Produces sigma0cores; // sigma0 candidates info for analysis + Produces sigmaPhotonExtras; // photons from sigma0 candidates info + Produces sigmaEmCalPhotonExtras; // EMCAL photons from sigma0 candidates info + Produces sigmaLambdaExtras; // lambdas from sigma0 candidates info + Produces sigma0CollRefs; // references collisions from Sigma0Cores + Produces sigma0mccores; // Reco sigma0 MC properties + Produces sigma0Gens; // Generated sigma0s + Produces sigma0GenCollRefs; // references collisions from sigma0Gens //__________________________________________________ // Pi0 specific @@ -161,8 +163,13 @@ struct sigma0builder { Configurable minIR{"minIR", -1, "minimum IR collisions"}; Configurable maxIR{"maxIR", -1, "maximum IR collisions"}; + Configurable fSkipEmptyEMCal{"fSkipEmptyEMCal", true, "Flag to skip events without EMCal clusters"}; + } eventSelections; + // Photon Source + // Configurable fUsePCMPhotons{"fUsePCMPhotons", true, "Use PCM Photons for sigma0/kstar reconstruction. If False, EMCal photons are used instead."}; + // Tables to fill Configurable fillPi0Tables{"fillPi0Tables", false, "fill pi0 tables for QA"}; Configurable fillSigma0Tables{"fillSigma0Tables", true, "fill sigma0 tables for analysis"}; @@ -178,7 +185,7 @@ struct sigma0builder { std::string prefix = "lambdaSelections"; // JSON group name Configurable Lambda_MLThreshold{"Lambda_MLThreshold", 0.1, "Decision Threshold value to select lambdas"}; Configurable AntiLambda_MLThreshold{"AntiLambda_MLThreshold", 0.1, "Decision Threshold value to select antilambdas"}; - Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true lambda/alambdas only"}; + Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true lambda/alambdas only"}; Configurable LambdaMinDCANegToPv{"LambdaMinDCANegToPv", .05, "min DCA Neg To PV (cm)"}; Configurable LambdaMinDCAPosToPv{"LambdaMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"}; Configurable LambdaMaxDCAV0Dau{"LambdaMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"}; @@ -207,7 +214,7 @@ struct sigma0builder { struct : ConfigurableGroup { std::string prefix = "photonSelections"; // JSON group name Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; - Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true photons only"}; + Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true photons only"}; Configurable Photonv0TypeSel{"Photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable PhotonMinDCADauToPv{"PhotonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"}; Configurable PhotonMaxDCAV0Dau{"PhotonMaxDCAV0Dau", 3.5, "Max DCA V0 Daughters (cm)"}; @@ -232,11 +239,27 @@ struct sigma0builder { Configurable PhotonPhiMax2{"PhotonPhiMax2", -1, "Phi min value to reject photons, region 2 (leave negative if no selection desired)"}; } photonSelections; + //// Photon criteria: + struct : ConfigurableGroup { + std::string prefix = "EMCalPhotonSelections"; // JSON group name + Configurable definition{"definition", 13, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; + Configurable MinCells{"MinCells", 1, "Min number of cells in cluster"}; + Configurable MinEnergy{"MinEnergy", 0.0, "Minimum energy of selected clusters (GeV)"}; + Configurable MaxEnergy{"MaxEnergy", 5, "Max energy of selected clusters (GeV)"}; + Configurable MaxEta{"MaxEta", 1.0, "Max absolute cluster Eta"}; + Configurable MinTime{"MinTime", -50, "Minimum time of selected clusters (ns)"}; + Configurable MaxTime{"MaxTime", 50, "Max time of selected clusters (ns)"}; + Configurable RemoveExotic{"RemoveExotic", false, "Flag to enable the removal of exotic clusters"}; + Configurable MinM02{"MinM02", -1., "Minimum shower shape long axis"}; + Configurable MaxM02{"MaxM02", 5., "Max shower shape long axis"}; + + } EMCalPhotonSelections; + // KShort criteria: struct : ConfigurableGroup { std::string prefix = "kshortSelections"; // JSON group name Configurable KShort_MLThreshold{"KShort_MLThreshold", 0.1, "Decision Threshold value to select kshorts"}; - Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true kshorts only"}; + Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true kshorts only"}; Configurable KShortMinDCANegToPv{"KShortMinDCANegToPv", .05, "min DCA Neg To PV (cm)"}; Configurable KShortMinDCAPosToPv{"KShortMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"}; Configurable KShortMaxDCAV0Dau{"KShortMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"}; @@ -315,16 +338,22 @@ struct sigma0builder { ConfigurableAxis axisIRBinning{"axisIRBinning", {151, -10, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisLifetime{"axisLifetime", {200, 0, 50}, "Lifetime"}; - // For manual sliceBy (necessary to calculate the correction factors) - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + // EMCal-specifc + ConfigurableAxis axisClrDefinition{"axisClrDefinition", {51, -0.5, 50.5}, "Cluster Definition"}; + ConfigurableAxis axisClrNCells{"axisClrNCells", {25, 0.0, 25}, "N cells per cluster"}; + ConfigurableAxis axisClrEnergy{"axisClrEnergy", {400, 0.0, 10}, "Energy per cluster"}; + ConfigurableAxis axisClrTime{"axisClrTime", {300, -30.0, 30.0}, "cluster time (ns)"}; + ConfigurableAxis axisClrShape{"axisClrShape", {100, 0.0, 1.0}, "cluster shape"}; void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); if (doprocessRealData + doprocessRealDataWithTOF + + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithTOF + + doprocessMonteCarloWithEMCal + doprocessV0QA + doprocessV0MCQA > 1) { @@ -373,9 +402,11 @@ struct sigma0builder { } } + bool fUsePCMPhoton = !doprocessRealDataWithEMCal && !doprocessMonteCarloWithEMCal && !doprocessPCMVsEMCalQA; + for (const auto& histodir : DirList) { if ((histodir == "V0BeforeSel" && !fFillNoSelV0Histos) || - (histodir == "PhotonSel" && !fFillSelPhotonHistos) || + (histodir == "PhotonSel" && !fFillSelPhotonHistos && !fUsePCMPhoton) || (histodir == "LambdaSel" && !fFillSelLambdaHistos) || (histodir == "KShortSel" && !fFillSelKShortHistos)) { continue; @@ -424,20 +455,43 @@ struct sigma0builder { histos.add(histodir + "/h3dV0XYZ", "h3dV0XYZ", kTH3D, {axisXY, axisXY, axisZ}); } - histos.add("PhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Mass"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Y"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Neg Eta"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Pos Eta"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "DCAToPV"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "DCADau"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Radius"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(9, "Z"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(10, "CosPA"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(11, "Phi"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(12, "TPCCR"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "TPC NSigma"); + if (fUsePCMPhoton || doprocessPCMVsEMCalQA) { + histos.add("PhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Mass"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Y"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Neg Eta"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Pos Eta"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "DCAToPV"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "DCADau"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Radius"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(9, "Z"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(10, "CosPA"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(11, "Phi"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(12, "TPCCR"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "TPC NSigma"); + + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + + } else { + for (const auto& histodir : DirList2) { + histos.add(histodir + "/hDefinition", "hDefinition", kTH1D, {axisClrDefinition}); + histos.add(histodir + "/h2dNCells", "h2dNCells", kTH2D, {axisPt, axisClrNCells}); + histos.add(histodir + "/h2dEnergy", "h2dEnergy", kTH2D, {axisPt, axisClrEnergy}); + histos.add(histodir + "/h2dEtaVsPhi", "h2dEtaVsPhi", kTH2D, {axisRapidity, axisPhi}); + histos.add(histodir + "/h2dTime", "h2dTime", kTH2D, {axisPt, axisClrTime}); + histos.add(histodir + "/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); + histos.add(histodir + "/h2dShape", "h2dShape", kTH2D, {axisPt, axisClrShape}); + } + } histos.add("LambdaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); histos.get(HIST("LambdaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); @@ -471,13 +525,14 @@ struct sigma0builder { histos.get(HIST("KShortSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "ITSNCls"); histos.get(HIST("KShortSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(14, "Lifetime"); - if (doprocessRealData || doprocessRealDataWithTOF || doprocessMonteCarlo || doprocessMonteCarloWithTOF) { + if (doprocessRealData || doprocessRealDataWithTOF || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithTOF || doprocessMonteCarloWithEMCal) { histos.add("SigmaSel/hSigma0DauDeltaIndex", "hSigma0DauDeltaIndex", kTH1F, {{100, -49.5f, 50.5f}}); histos.add("SigmaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Sigma Mass Window"); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Sigma Y Window"); + histos.add("SigmaSel/hSigmaMassBeforeSel", "hSigmaMassBeforeSel", kTH1F, {axisSigmaMass}); histos.add("SigmaSel/hSigmaMassSelected", "hSigmaMassSelected", kTH1F, {axisSigmaMass}); histos.add("KStarSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); @@ -501,7 +556,7 @@ struct sigma0builder { } // MC - if (doprocessMonteCarlo || doprocessMonteCarloWithTOF) { + if (doprocessMonteCarlo || doprocessMonteCarloWithTOF || doprocessMonteCarloWithEMCal) { histos.add("MCQA/h2dPhotonNMothersVsPDG", "h2dPhotonNMothersVsPDG", kTHnSparseD, {{10, -0.5f, +9.5f}, {10001, -5000.5f, +5000.5f}}); histos.add("MCQA/h2dPhotonNMothersVsMCProcess", "h2dPhotonNMothersVsMCProcess", kTH2D, {{10, -0.5f, +9.5f}, {50, -0.5f, 49.5f}}); histos.add("MCQA/hPhotonMotherSize", "hPhotonMotherSize", kTH1D, {{10, -0.5f, +9.5f}}); @@ -529,6 +584,30 @@ struct sigma0builder { histos.add("MCQA/hNoV0MCCores", "hNoV0MCCores", kTH1D, {{4, -0.5f, +3.5f}}); } + if (doprocessPCMVsEMCalQA) { + histos.add("PhotonMCQA/hPCMPhotonMCpT", "hPCMPhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dPCMPhotonMCpTResolution", "h2dPCMPhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/hPCMSigma0PhotonMCpT", "hPCMSigma0PhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dPCMSigma0PhotonMCpTResolution", "h2dPCMSigma0PhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + + histos.add("PhotonMCQA/hEMCalPhotonMCpT", "hEMCalPhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCpTResolution", "h2dEMCalPhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCEnergyResolution", "h2dEMCalPhotonMCEnergyResolution", kTH2D, {axisClrEnergy, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCEtaResolution", "h2dEMCalPhotonMCEtaResolution", kTH2D, {axisRapidity, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCPhiResolution", "h2dEMCalPhotonMCPhiResolution", kTH2D, {axisPhi, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCFractionEnergy", "h2dEMCalPhotonMCFractionEnergy", kTH2D, {axisPt, {100, -1.0f, 1.0f}}); + + histos.add("PhotonMCQA/hEMCalSigma0PhotonMCpT", "hEMCalSigma0PhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCpTResolution", "h2dEMCalSigma0PhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCEnergyResolution", "h2dEMCalSigma0PhotonMCEnergyResolution", kTH2D, {axisClrEnergy, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCEtaResolution", "h2dEMCalSigma0PhotonMCEtaResolution", kTH2D, {axisRapidity, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCPhiResolution", "h2dEMCalSigma0PhotonMCPhiResolution", kTH2D, {axisPhi, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCFractionEnergy", "h2dEMCalSigma0PhotonMCFractionEnergy", kTH2D, {axisPt, {100, -1.0f, 1.0f}}); + + histos.add("PhotonMCQA/hGenPhoton", "hGenPhoton", kTH1D, {axisPt}); + histos.add("PhotonMCQA/hGenSigma0Photon", "hGenSigma0Photon", kTH1D, {axisPt}); + } + if (doprocessGeneratedRun3 && genSelections.doQA) { // Pi0s @@ -705,6 +784,10 @@ struct sigma0builder { bool fIsV01Primary = false; bool fIsV02Primary = false; bool fV0PairProducedByGenerator = false; + int V01PDGCodePos = 0; + int V02PDGCodePos = 0; + int V01PDGCodeNeg = 0; + int V02PDGCodeNeg = 0; int V01PDGCode = 0; int V02PDGCode = 0; int V01PDGCodeMother = 0; @@ -720,6 +803,7 @@ struct sigma0builder { float V02MCpy = -999.f; float V02MCpz = -999.f; float V0PairMCRadius = -999.f; + float EMCalClusterAmplitude = -999.f; }; // ______________________________________________________ @@ -831,6 +915,10 @@ struct sigma0builder { // MC association info MCinfo.fIsV01Primary = v01MC.isPhysicalPrimary(); MCinfo.fIsV02Primary = v02MC.isPhysicalPrimary(); + MCinfo.V01PDGCodePos = v01MC.pdgCodePositive(); + MCinfo.V01PDGCodeNeg = v01MC.pdgCodeNegative(); + MCinfo.V02PDGCodePos = v02MC.pdgCodePositive(); + MCinfo.V02PDGCodeNeg = v02MC.pdgCodeNegative(); MCinfo.V01PDGCode = v01MC.pdgCode(); MCinfo.V02PDGCode = v02MC.pdgCode(); MCinfo.V01PDGCodeMother = v01MC.pdgCodeMother(); @@ -933,6 +1021,169 @@ struct sigma0builder { return MCinfo; } + template + V0PairMCInfo getClusterV0PairMCInfo(TEMCalCls const& cluster, + TV0 const& v0, + TCollision const& collision, + TMCParticles const& mcparticles) + { + // Output container + V0PairMCInfo MCinfo; + + // ============================================================ + // 1) --- V0 (Lambda/AntiLambda) MC information --- + // ============================================================ + + // Check if V0 has MC information + if (!v0.has_v0MCCore()) { + return MCinfo; + } + + auto v0MC = v0.template v0MCCore_as>(); + auto mcLambda = mcparticles.rawIteratorAt(v0MC.particleIdMC()); + + // Save basic Lambda MC info (always saved, independent of matching) + MCinfo.V02MCpx = v0MC.pxMC(); + MCinfo.V02MCpy = v0MC.pyMC(); + MCinfo.V02MCpz = v0MC.pzMC(); + MCinfo.fIsV02Primary = v0MC.isPhysicalPrimary(); + MCinfo.V02PDGCode = v0MC.pdgCode(); + MCinfo.V02PDGCodeMother = v0MC.pdgCodeMother(); + MCinfo.V02PDGCodePos = v0MC.pdgCodePositive(); + MCinfo.V02PDGCodeNeg = v0MC.pdgCodeNegative(); + + // Check correct MC collision assignment (if available) + if (collision.has_straMCCollision()) { + auto MCCollision = collision.template straMCCollision_as< + soa::Join>(); + MCinfo.fIsV02CorrectlyAssign = (v0MC.straMCCollisionId() == MCCollision.globalIndex()); + } + + // Retrieve Lambda mothers + auto const& lambdaMothers = mcLambda.template mothers_as(); + if (lambdaMothers.empty()) { + // No ancestry -> cannot match to any parent + return MCinfo; + } + + // Assumption: first mother is the physical one + auto const& lambdaMother = lambdaMothers.front(); + int lambdaMotherIndex = lambdaMother.globalIndex(); + + // ============================================================ + // 2) --- EMCal cluster: loop over MC contributors --- + // ============================================================ + + int matchedPhotonId = -1; // MC photon candidate + int matchedMotherIndex = -1; // Common Sigma0 candidate + + // Fallback: sum of all contributor momenta (useful for resolution studies, perhaps?) + float sumPx = 0.f, sumPy = 0.f, sumPz = 0.f; + + // Loop over all MC contributors to the cluster + for (size_t i = 0; i < cluster.mcParticleIds().size(); i++) { + + int mcId = cluster.mcParticleIds()[i]; + auto mcPart = mcparticles.iteratorAt(mcId); + + // Accumulate total momentum (fallback strategy) + sumPx += mcPart.px(); + sumPy += mcPart.py(); + sumPz += mcPart.pz(); + + // ------------------------------------------------------------ + // Check 1: + // Does this contributor come from a Sigma0/AntiSigma0 somewhere in its ancestry? + // ------------------------------------------------------------ + int daughterId = aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain(mcPart, mcparticles, std::vector{PDG_t::kSigma0, PDG_t::kSigma0Bar}); + + if (daughterId < 0) + continue; // Not from Sigma0 -> try next contributor + + auto mcPhoton = mcparticles.iteratorAt(daughterId); + + // Sanity check: are we getting the correct particles? + auto dummy = mcparticles.rawIteratorAt(daughterId); + if (mcPhoton.globalIndex() != dummy.globalIndex()) + LOGF(fatal, "The behave of rawIteratorAt != iteratorAt. Index %i != %i. Please check. Aborting.", mcPhoton.globalIndex(), dummy.globalIndex()); + + // Require true photon, please + if (mcPhoton.pdgCode() != PDG_t::kGamma) + continue; + + // Get Sigma0 index from photon mother + auto mothers = mcPhoton.mothersIds(); + if (mothers.empty()) // No mothers? Weird + continue; + + int sigmaIndex = mothers[0]; + + // ------------------------------------------------------------ + // Check 2: + // Does this photon share the same mother as the Lambda? + // ------------------------------------------------------------ + if (sigmaIndex == lambdaMotherIndex) { + matchedPhotonId = daughterId; + matchedMotherIndex = sigmaIndex; + MCinfo.EMCalClusterAmplitude = cluster.amplitudeA()[i]; + break; // SUCCESS -> stop loop + } + } + + // ============================================================ + // 3) --- SUCCESS: true Lambda–photon pair from same Sigma0 --- + // ============================================================ + + if (matchedPhotonId >= 0 && matchedMotherIndex >= 0) { + + auto mcPhoton = mcparticles.iteratorAt(matchedPhotonId); + auto mcSigma = mcparticles.iteratorAt(matchedMotherIndex); + + // --- Pair (Sigma0) information + MCinfo.fV0PairProducedByGenerator = mcSigma.producedByGenerator(); + MCinfo.V0PairPDGCode = mcSigma.pdgCode(); + MCinfo.V0PairMCProcess = mcSigma.getProcess(); + MCinfo.V0PairMCParticleID = mcSigma.globalIndex(); + MCinfo.V0PairMCRadius = std::hypot(mcSigma.vx(), mcSigma.vy()); + + // Sigma0 mother (optional) + auto const& sigmaMothers = mcSigma.template mothers_as(); + if (!sigmaMothers.empty()) { + MCinfo.V0PairPDGCodeMother = sigmaMothers.front().pdgCode(); + } + + // --- Photon MC info + MCinfo.V01MCpx = mcPhoton.px(); + MCinfo.V01MCpy = mcPhoton.py(); + MCinfo.V01MCpz = mcPhoton.pz(); + MCinfo.fIsV01Primary = mcPhoton.isPhysicalPrimary(); + MCinfo.V01PDGCode = mcPhoton.pdgCode(); + + if (!mcPhoton.mothersIds().empty()) { + auto mcMother = mcparticles.iteratorAt(mcPhoton.mothersIds()[0]); + MCinfo.V01PDGCodeMother = mcMother.pdgCode(); + } + + return MCinfo; + } + + // ============================================================ + // 4) --- FAILURE: no true matching photon found --- + // ============================================================ + + // Strategy: + // - Keep Lambda MC info (already filled) + // - For cluster: + // use summed momentum of contributors (proxy for cluster truth) + // - Leave PDG / primary flags as default (dummy) + + MCinfo.V01MCpx = sumPx; + MCinfo.V01MCpy = sumPy; + MCinfo.V01MCpz = sumPz; + + return MCinfo; + } + // ______________________________________________________ // Check whether the collision passes our collision selections // Should work with collisions, mccollisions, stracollisions and stramccollisions tables! @@ -1079,12 +1330,21 @@ struct sigma0builder { std::vector getListOfRecoCollIndices(TMCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); int biggestNContribs = -1; int bestCollisionIndex = -1; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { // consider event selections in the recoed <-> gen collision association, for the denominator (or numerator) of the efficiency (or signal loss)? + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.useEvtSelInDenomEff && eventSelections.fUseEventSelection) { if (!IsEventAccepted(collision, false)) continue; @@ -1108,6 +1368,14 @@ struct sigma0builder { void fillGeneratedEventProperties(TMCCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { // Apply selections on MC collisions if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { @@ -1125,14 +1393,15 @@ struct sigma0builder { histos.fill(HIST("V0QA/hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); // Check if there is at least one of the reconstructed collisions associated to this MC collision // If so, we consider it bool atLeastOne = false; int biggestNContribs = -1; float centrality = 100.5f; int nCollisions = 0; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.fUseEventSelection) { if (!IsEventAccepted(collision, false)) continue; @@ -1501,9 +1770,28 @@ struct sigma0builder { } } + // Function to fill QA histograms. mode = 0 (before selections, all clusters), 1 after all selections + template + void fillEMCalHistos(TEMCalClusterObject const& cluster) + { + // Check whether it is before or after selections + static constexpr std::string_view MainDir2[] = {"EMCalPhotonBeforeSel", "EMCalPhotonSel"}; + + // calculate pT for cluster assuming they are photons (so no mass) + float gammapT = sqrt(cluster.energy() * cluster.energy()) / std::cosh(cluster.eta()); + + histos.fill(HIST(MainDir2[mode]) + HIST("/hDefinition"), cluster.definition()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dNCells"), gammapT, cluster.nCells()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dEnergy"), gammapT, cluster.energy()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dShape"), gammapT, cluster.m02()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dEtaVsPhi"), cluster.eta(), cluster.phi()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dTime"), gammapT, cluster.time()); + histos.fill(HIST(MainDir2[mode]) + HIST("/hExotic"), cluster.isExotic()); + } + // Function to fill QA histograms. mode = 0 (before selections, all v0s), 1 (photon candidates), 2 (lambda/alambda candidates) template - void fillHistos(TV0Object const& v0, TCollision const& collision) + void fillV0Histos(TV0Object const& v0, TCollision const& collision) { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"V0BeforeSel", "PhotonSel", "LambdaSel", "KShortSel"}; @@ -1567,7 +1855,56 @@ struct sigma0builder { } //_______________________________________________ - // Process photon candidate + // Process v0 photon candidate + template + bool processEMCalPhotonCandidate(TEMCalClusterObject const& cluster) + { + // Clusterizer + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 1.); + if (cluster.definition() != EMCalPhotonSelections.definition && EMCalPhotonSelections.definition > -1) + return false; + + // Number of Cells + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 2.); + if (cluster.nCells() < EMCalPhotonSelections.MinCells) + return false; + + // Energy + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 3.); + if (cluster.energy() < EMCalPhotonSelections.MinEnergy || cluster.energy() > EMCalPhotonSelections.MaxEnergy) + return false; + + // Eta + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 4.); + if (TMath::Abs(cluster.eta()) > EMCalPhotonSelections.MaxEta) + return false; + + // Timing + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 5.); + if (cluster.time() < EMCalPhotonSelections.MinTime || cluster.time() > EMCalPhotonSelections.MaxTime) + return false; + + // Exotic Clusters + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 6.); + if (cluster.isExotic() && EMCalPhotonSelections.RemoveExotic) { + return false; + } + + // Shower shape long axis + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 7.); + if (cluster.nCells() > 1) { // Only if we have more than one + if (cluster.m02() < EMCalPhotonSelections.MinM02 || cluster.m02() > EMCalPhotonSelections.MaxM02) { + return false; + } + } + + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 8.); + + return true; + } + + //_______________________________________________ + // Process v0 photon candidate template bool processPhotonCandidate(TV0Object const& gamma) { @@ -1918,14 +2255,20 @@ struct sigma0builder { } //_______________________________________________ - // Build sigma0 candidate + // Build sigma0 candidate with PCM photons template - bool buildSigma0(TV0Object const& lambda, TV0Object const& gamma, TCollision const& collision, TMCParticles const& mcparticles) + bool buildPCMSigma0(TV0Object const& lambda, TV0Object const& gamma, TCollision const& collision, TMCParticles const& mcparticles) { //_______________________________________________ + // Same index rejection + if (gamma.globalIndex() == lambda.globalIndex()) + return false; + // Checking if both V0s are made of the very same tracks if (gamma.posTrackExtraId() == lambda.posTrackExtraId() || - gamma.negTrackExtraId() == lambda.negTrackExtraId()) { + gamma.negTrackExtraId() == lambda.negTrackExtraId() || + gamma.posTrackExtraId() == lambda.negTrackExtraId() || + gamma.negTrackExtraId() == lambda.posTrackExtraId()) { return false; } @@ -1959,26 +2302,23 @@ struct sigma0builder { // Sigma0 topological info auto sigma0TopoInfo = propagateV0PairToDCA(gamma, lambda); - sigma0cores(sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, + sigma0cores(gamma.globalIndex(), lambda.globalIndex(), sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, gamma.px(), gamma.py(), gamma.pz(), gamma.mGamma(), lambda.px(), lambda.py(), lambda.pz(), lambda.mLambda(), lambda.mAntiLambda()); // MC properties if constexpr (requires { gamma.motherMCPartId(); lambda.motherMCPartId(); }) { auto sigma0MCInfo = getV0PairMCInfo(gamma, lambda, collision, mcparticles); - sigma0mccores(sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, - sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, - sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, + sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, + sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude, + sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, sigma0MCInfo.V02MCpx, sigma0MCInfo.V02MCpy, sigma0MCInfo.V02MCpz, - sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); - - sigma0mclabel(sigma0MCInfo.V0PairMCParticleID); + sigma0MCInfo.V02PDGCodePos, sigma0MCInfo.V02PDGCodeNeg, sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); } // Sigma0s -> stracollisions link histos.fill(HIST("SigmaSel/hSigma0DauDeltaIndex"), gamma.globalIndex() - lambda.globalIndex()); sigma0CollRefs(collision.globalIndex()); - sigmaIndices(gamma.globalIndex(), lambda.globalIndex()); //_______________________________________________ // Photon extra properties @@ -2043,6 +2383,111 @@ struct sigma0builder { return true; } + // Build sigma0 candidate + template + bool buildEMCalSigma0(TV0Object const& lambda, TEMCalClsObject const& gamma, TCollision const& collision, TMCParticles const& mcparticles, std::vector const& emcaltracksmatched) + { + // calculate pT for cluster assuming they are photons (so no mass) + float gammapT = sqrt(gamma.energy() * gamma.energy()) / std::cosh(gamma.eta()); + + // Momentum components + float gammapx = gammapT * std::cos(gamma.phi()); + float gammapy = gammapT * std::sin(gamma.phi()); + float gammapz = gammapT * std::sinh(gamma.phi()); + + //_______________________________________________ + // Sigma0 pre-selections + std::array pVecPhotons{gammapx, gammapy, gammapz}; + std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; + + auto arrMom = std::array{pVecPhotons, pVecLambda}; + float sigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + + // N.B. At this stage, we are only using the reconstructed rapidity (ideally with a very loose cut) + // A proper selection should be done in the sigmaanalysis + float sigmaY = RecoDecay::y(std::array{gammapx + lambda.px(), gammapy + lambda.py(), gammapz + lambda.pz()}, o2::constants::physics::MassSigma0); + + histos.fill(HIST("SigmaSel/hSelectionStatistics"), 1.); + histos.fill(HIST("SigmaSel/hSigmaMassBeforeSel"), sigmaMass); + if (TMath::Abs(sigmaMass - o2::constants::physics::MassSigma0) > Sigma0Window) + return false; + + histos.fill(HIST("SigmaSel/hSelectionStatistics"), 2.); + if (TMath::Abs(sigmaY) > SigmaMaxRap) + return false; + + histos.fill(HIST("SigmaSel/hSigmaMassSelected"), sigmaMass); + histos.fill(HIST("SigmaSel/hSelectionStatistics"), 3.); + + //_______________________________________________ + // Calculate properties & Fill tables + sigma0cores(gamma.globalIndex(), lambda.globalIndex(), + 0.0f, 0.0f, 0.0f, 0.0f, // N.B: Filling with dummy values for now + gammapx, gammapy, gammapz, 0.0f, + lambda.px(), lambda.py(), lambda.pz(), lambda.mLambda(), lambda.mAntiLambda()); + + // MC properties + if constexpr (requires { gamma.mcParticleIds(); lambda.motherMCPartId(); }) { + + auto sigma0MCInfo = getClusterV0PairMCInfo(gamma, lambda, collision, mcparticles); + + sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, + sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude, + sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, + sigma0MCInfo.V02MCpx, sigma0MCInfo.V02MCpy, sigma0MCInfo.V02MCpz, + sigma0MCInfo.V02PDGCodePos, sigma0MCInfo.V02PDGCodeNeg, sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); + } + + sigma0CollRefs(collision.globalIndex()); + + //_______________________________________________ + // Photon extra properties + bool hasAssociatedTrack = emcaltracksmatched[gamma.globalIndex()]; + sigmaEmCalPhotonExtras(gamma.id(), gamma.energy(), gamma.eta(), gamma.phi(), + gamma.m02(), gamma.m20(), gamma.nCells(), gamma.time(), + gamma.isExotic(), gamma.distanceToBadChannel(), gamma.nlm(), gamma.definition(), hasAssociatedTrack); + + //_______________________________________________ + // Lambda extra properties + auto posTrackLambda = lambda.template posTrackExtra_as(); + auto negTrackLambda = lambda.template negTrackExtra_as(); + + uint8_t fLambdaPosTrackCode = ((uint8_t(posTrackLambda.hasTPC()) << hasTPC) | + (uint8_t(posTrackLambda.hasITSTracker()) << hasITSTracker) | + (uint8_t(posTrackLambda.hasITSAfterburner()) << hasITSAfterburner) | + (uint8_t(posTrackLambda.hasTRD()) << hasTRD) | + (uint8_t(posTrackLambda.hasTOF()) << hasTOF)); + + uint8_t fLambdaNegTrackCode = ((uint8_t(negTrackLambda.hasTPC()) << hasTPC) | + (uint8_t(negTrackLambda.hasITSTracker()) << hasITSTracker) | + (uint8_t(negTrackLambda.hasITSAfterburner()) << hasITSAfterburner) | + (uint8_t(negTrackLambda.hasTRD()) << hasTRD) | + (uint8_t(negTrackLambda.hasTOF()) << hasTOF)); + + float fLambdaLifeTime = lambda.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float fLambdaPrTOFNSigma = -999.f; + float fLambdaPiTOFNSigma = -999.f; + float fALambdaPrTOFNSigma = -999.f; + float fALambdaPiTOFNSigma = -999.f; + + if constexpr (requires { lambda.tofNSigmaLaPr(); }) { // If TOF info avaiable + fLambdaPrTOFNSigma = lambda.tofNSigmaLaPr(); + fLambdaPiTOFNSigma = lambda.tofNSigmaLaPi(); + fALambdaPrTOFNSigma = lambda.tofNSigmaALaPr(); + fALambdaPiTOFNSigma = lambda.tofNSigmaALaPi(); + } + + sigmaLambdaExtras(lambda.qtarm(), lambda.alpha(), fLambdaLifeTime, lambda.v0radius(), lambda.v0cosPA(), lambda.dcaV0daughters(), lambda.dcanegtopv(), lambda.dcapostopv(), + posTrackLambda.tpcNSigmaPr(), posTrackLambda.tpcNSigmaPi(), negTrackLambda.tpcNSigmaPr(), negTrackLambda.tpcNSigmaPi(), + fLambdaPrTOFNSigma, fLambdaPiTOFNSigma, fALambdaPrTOFNSigma, fALambdaPiTOFNSigma, + posTrackLambda.tpcCrossedRows(), negTrackLambda.tpcCrossedRows(), + lambda.positiveeta(), lambda.negativeeta(), + posTrackLambda.itsNCls(), negTrackLambda.itsNCls(), posTrackLambda.itsChi2PerNcl(), negTrackLambda.itsChi2PerNcl(), + fLambdaPosTrackCode, fLambdaNegTrackCode, lambda.v0Type()); + + return true; + } + //_______________________________________________ // Build kstar candidate template @@ -2165,25 +2610,40 @@ struct sigma0builder { } // Process photon and lambda candidates to build sigma0 candidates - template - void dataProcess(TCollision const& collisions, TV0s const& fullV0s, TMCParticles const& mcparticles) + template + void dataProcess(TCollision const& collisions, TV0s const& fullV0s, TEMCal const& fullEMCalClusters, TEMCalTracks const& emcaltracks, TMCParticles const& mcparticles) { //_______________________________________________ // Initial setup + bool fUsePCMPhoton = !doprocessRealDataWithEMCal && !doprocessMonteCarloWithEMCal; + // Auxiliary vectors to store best candidates std::vector bestGammasArray; std::vector bestLambdasArray; - - std::vector bestKStarGammasArray; std::vector bestKShortsArray; // Custom grouping std::vector> v0grouped(collisions.size()); + std::vector> emclustersgrouped(collisions.size()); + std::vector emcaltracksgrouped; + // Grouping step: for (const auto& v0 : fullV0s) { v0grouped[v0.straCollisionId()].push_back(v0.globalIndex()); } + if constexpr (soa::is_table) { + emcaltracksgrouped.resize(fullEMCalClusters.size(), false); + for (const auto& cluster : fullEMCalClusters) { + emclustersgrouped[cluster.collisionId()].push_back(cluster.globalIndex()); + } + + // Mapping emccluster to matched tracks + for (const auto& calotrack : emcaltracks) { + emcaltracksgrouped[calotrack.emcalclusterId()] = true; + } + } + //_______________________________________________ // Collisions loop for (const auto& coll : collisions) { @@ -2193,11 +2653,14 @@ struct sigma0builder { continue; } + if constexpr (soa::is_table) { + if (emclustersgrouped[coll.globalIndex()].size() == 0 && eventSelections.fSkipEmptyEMCal) + continue; + } + // Clear vectors bestGammasArray.clear(); bestLambdasArray.clear(); - - bestKStarGammasArray.clear(); bestKShortsArray.clear(); float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); @@ -2209,40 +2672,56 @@ struct sigma0builder { auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); if (fFillNoSelV0Histos) - fillHistos<0>(v0, coll); // Filling "all V0s" histograms + fillV0Histos<0>(v0, coll); // Filling "all V0s" histograms - if (processPhotonCandidate(v0)) { // selecting photons - if (fFillSelPhotonHistos) - fillHistos<1>(v0, coll); // QA histos - bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates + if (fUsePCMPhoton) { + if (processPhotonCandidate(v0)) { // selecting photons + if (fFillSelPhotonHistos) + fillV0Histos<1>(v0, coll); // QA histos + bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates + } } if (processLambdaCandidate(v0, coll)) { // selecting lambdas if (fFillSelLambdaHistos) - fillHistos<2>(v0, coll); // QA histos + fillV0Histos<2>(v0, coll); // QA histos bestLambdasArray.push_back(v0.globalIndex()); // Save indices of best lambda candidates } if (processKShortCandidate(v0, coll)) { // selecting kshorts if (fFillSelKShortHistos) - fillHistos<3>(v0, coll); // QA histos + fillV0Histos<3>(v0, coll); // QA histos bestKShortsArray.push_back(v0.globalIndex()); // Save indices of best kshort candidates } } + // If EMCalClusters is available, we don't use PCM + if constexpr (soa::is_table) { + for (size_t i = 0; i < emclustersgrouped[coll.globalIndex()].size(); i++) { + auto cluster = fullEMCalClusters.rawIteratorAt(emclustersgrouped[coll.globalIndex()][i]); + fillEMCalHistos<0>(cluster); + + if (processEMCalPhotonCandidate(cluster)) { // selecting photons + fillEMCalHistos<1>(cluster); // QA histos + bestGammasArray.push_back(cluster.globalIndex()); // Save indices of best gamma candidates + } + } + } + //_______________________________________________ // Wrongly collision association study (MC-specific) if constexpr (requires { coll.straMCCollisionId(); }) { if (doAssocStudy) { - analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis + if constexpr (!soa::is_table) + analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis analyzeV0CollAssoc(coll, fullV0s, bestLambdasArray, false); // Lambda-analysis } } //_______________________________________________ - // V0 nested loop + // Photon-V0 nested loop + int nSigma0Candidates = 0; for (size_t i = 0; i < bestGammasArray.size(); ++i) { - auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); //_______________________________________________ // Sigma0 loop @@ -2251,35 +2730,52 @@ struct sigma0builder { auto lambda = fullV0s.rawIteratorAt(bestLambdasArray[j]); // Building sigma0 candidate & filling tables - if (!buildSigma0(lambda, gamma1, coll, mcparticles)) - continue; + if constexpr (soa::is_table) { // using EMCal photons + auto gamma1 = fullEMCalClusters.rawIteratorAt(bestGammasArray[i]); + if (!buildEMCalSigma0(lambda, gamma1, coll, mcparticles, emcaltracksgrouped)) + continue; + } else { // using PCM photons + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); + if (!buildPCMSigma0(lambda, gamma1, coll, mcparticles)) + continue; + } + + nSigma0Candidates++; } } //_______________________________________________ // KStar loop - if (fillKStarTables) { - for (size_t j = 0; j < bestKShortsArray.size(); ++j) { - auto kshort = fullV0s.rawIteratorAt(bestKShortsArray[j]); - - // Building kstar candidate & filling tables - if (!buildKStar(kshort, gamma1, coll, mcparticles)) - continue; + if constexpr (!soa::is_table) { // Don't use EMCal clusters here + if (fillKStarTables) { + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); + for (size_t j = 0; j < bestKShortsArray.size(); ++j) { + auto kshort = fullV0s.rawIteratorAt(bestKShortsArray[j]); + + // Building kstar candidate & filling tables + if (!buildKStar(kshort, gamma1, coll, mcparticles)) + continue; + } } } //_______________________________________________ // pi0 loop - if (fillPi0Tables) { - for (size_t j = i + 1; j < bestGammasArray.size(); ++j) { - auto gamma2 = fullV0s.rawIteratorAt(bestGammasArray[j]); - - // Building pi0 candidate & filling tables - if (!buildPi0(gamma1, gamma2, coll, mcparticles)) - continue; + if constexpr (!soa::is_table) { // Don't use EMCal clusters here + if (fillPi0Tables) { + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); + for (size_t j = i + 1; j < bestGammasArray.size(); ++j) { + auto gamma2 = fullV0s.rawIteratorAt(bestGammasArray[j]); + + // Building pi0 candidate & filling tables + if (!buildPi0(gamma1, gamma2, coll, mcparticles)) + continue; + } } } } + + LOGF(info, "N. photons: %i, N. lambdas: %i, expected pairs: %i, got: %i", bestGammasArray.size(), bestLambdasArray.size(), bestGammasArray.size() * bestLambdasArray.size(), nSigma0Candidates); } } @@ -2317,7 +2813,7 @@ struct sigma0builder { auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); if (fFillNoSelV0Histos) - fillHistos<0>(v0, coll); // Filling "all V0s" histograms + fillV0Histos<0>(v0, coll); // Filling "all V0s" histograms // Selection process fPassPhotonSel = processPhotonCandidate(v0); @@ -2327,7 +2823,7 @@ struct sigma0builder { // Reco part: if (fPassPhotonSel) { if (fFillSelPhotonHistos) - fillHistos<1>(v0, coll); + fillV0Histos<1>(v0, coll); // Fill analysis Histos: float PhotonY = RecoDecay::y(std::array{v0.px(), v0.py(), v0.pz()}, o2::constants::physics::MassGamma); @@ -2337,7 +2833,7 @@ struct sigma0builder { } if (fPassLambdaSel) { if (fFillSelLambdaHistos) - fillHistos<2>(v0, coll); + fillV0Histos<2>(v0, coll); // Fill analysis Histos: histos.fill(HIST("V0QA/h3dLambdaMass"), centrality, v0.pt(), v0.mLambda()); @@ -2352,7 +2848,7 @@ struct sigma0builder { if (fPassKShortSel) { if (fFillSelKShortHistos) - fillHistos<3>(v0, coll); + fillV0Histos<3>(v0, coll); // Fill analysis Histos: histos.fill(HIST("V0QA/h3dKShortMass"), centrality, v0.pt(), v0.mK0Short()); @@ -2403,25 +2899,250 @@ struct sigma0builder { } } } + + template + void runPCMVsEMCalQA(TCollision const& collisions, TV0s const& fullV0s, TEMCal const& fullEMCalClusters, TEMCalTracks const& emcaltracks, TMCParticles const& mcparticles) + { + + // Custom grouping + std::vector> v0grouped(collisions.size()); + std::vector> emclustersgrouped(collisions.size()); + std::vector emcaltracksgrouped(collisions.size(), false); + + // Grouping step: + for (const auto& v0 : fullV0s) { + v0grouped[v0.straCollisionId()].push_back(v0.globalIndex()); + } + + for (const auto& cluster : fullEMCalClusters) { + emclustersgrouped[cluster.collisionId()].push_back(cluster.globalIndex()); + } + + // Mapping emccluster to matched tracks + for (const auto& calotrack : emcaltracks) { + emcaltracksgrouped[calotrack.emcalclusterId()] = true; + } + + //_______________________________________________ + // Collisions loop + for (const auto& coll : collisions) { + // Event selection + if (eventSelections.fUseEventSelection) { + if (!IsEventAccepted(coll, true)) + continue; + } + + float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); + histos.fill(HIST("hEventCentrality"), centrality); + + //_______________________________________________ + // V0s loop + for (size_t i = 0; i < v0grouped[coll.globalIndex()].size(); i++) { + auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); + + if (processPhotonCandidate(v0)) { // selecting PCM photons + + // Check if V0 has MC information + if (!v0.has_v0MCCore()) { + continue; + } + + auto v0MC = v0.template v0MCCore_as>(); + auto mcv0Photon = mcparticles.rawIteratorAt(v0MC.particleIdMC()); + + if (mcv0Photon.pdgCode() != PDG_t::kGamma || !mcv0Photon.isPhysicalPrimary() || TMath::Abs(mcv0Photon.y()) > 0.5) + continue; + + // MC pT histo + histos.fill(HIST("PhotonMCQA/hPCMPhotonMCpT"), mcv0Photon.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dPCMPhotonMCpTResolution"), mcv0Photon.pt(), 1 - v0.pt() / mcv0Photon.pt()); + + // photon from sigma0/asigma0 + auto const& v0photonMothers = mcv0Photon.template mothers_as(); + if (!v0photonMothers.empty()) { + // Assumption: first mother is the physical one + auto const& v0photonMother = v0photonMothers.front(); + if (TMath::Abs(v0photonMother.pdgCode()) == PDG_t::kSigma0) { // Sigma0 or ASigma0 + // For efficiency + histos.fill(HIST("PhotonMCQA/hPCMSigma0PhotonMCpT"), mcv0Photon.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dPCMSigma0PhotonMCpTResolution"), mcv0Photon.pt(), 1 - v0.pt() / mcv0Photon.pt()); + } + } + } + } + + // EMCal clusters loop + for (size_t icl = 0; icl < emclustersgrouped[coll.globalIndex()].size(); icl++) { + auto cluster = fullEMCalClusters.rawIteratorAt(emclustersgrouped[coll.globalIndex()][icl]); + + if (!processEMCalPhotonCandidate(cluster)) + continue; + + // ============================================================ + // --- Reco kinematics (assume photon mass = 0) + // ============================================================ + + float E = cluster.energy(); + float eta = cluster.eta(); + + float pt = E / std::cosh(eta); + + // ============================================================ + // --- MC matching + // ============================================================ + // Map to avoid double counting of photons in case of conversions (one cluster can be matched to both e+ and e-) + std::unordered_set uniquePhotonIds; + + // Loop over cluster contributors + for (size_t i = 0; i < cluster.mcParticleIds().size(); i++) { + + int mcId = cluster.mcParticleIds()[i]; + auto mcPart = mcparticles.iteratorAt(mcId); + + // ============================================================ + // Find photon ancestor (including conversions) + // ============================================================ + + int photonId = -1; + + // Case 1: particle itself is photon + if (mcPart.pdgCode() == PDG_t::kGamma) { + photonId = mcPart.globalIndex(); + } else { + // Case 2: climb ancestry to find photon + int candidateId = + aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain( + mcPart, mcparticles, std::vector{22}); + + if (candidateId >= 0) + photonId = candidateId; + } + + if (photonId < 0) + continue; + + // ============================================================ + // Avoid double counting (conversion case!) + // ============================================================ + + if (uniquePhotonIds.find(photonId) != uniquePhotonIds.end()) + continue; + + uniquePhotonIds.insert(photonId); + + auto mcPhoton = mcparticles.iteratorAt(photonId); + + // ============================================================ + // Select TRUE + PRIMARY photons + // ============================================================ + + if (mcPhoton.pdgCode() != PDG_t::kGamma || !mcPhoton.isPhysicalPrimary() || TMath::Abs(mcPhoton.y()) > 0.5) + continue; + + // ============================================================ + // Fill QA histos + // ============================================================ + + // MC pT histo + histos.fill(HIST("PhotonMCQA/hEMCalPhotonMCpT"), mcPhoton.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCpTResolution"), mcPhoton.pt(), 1 - pt / mcPhoton.pt()); + + // Energy resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCEnergyResolution"), mcPhoton.e(), 1 - cluster.energy() / mcPhoton.e()); + + // Eta resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCEtaResolution"), mcPhoton.eta(), cluster.eta() - mcPhoton.eta()); + + // Phi resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCPhiResolution"), mcPhoton.phi(), cluster.phi() - mcPhoton.phi()); + + // Fraction of energy Vs MC pT + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCFractionEnergy"), mcPhoton.pt(), cluster.amplitudeA()[i]); + + // photon from sigma0/asigma0 + auto const& photonMothers = mcPhoton.template mothers_as(); + if (!photonMothers.empty()) { + // Assumption: first mother is the physical one + auto const& photonMother = photonMothers.front(); + if (TMath::Abs(photonMother.pdgCode()) == PDG_t::kSigma0) { // Sigma0 or ASigma0 + // For efficiency + histos.fill(HIST("PhotonMCQA/hEMCalSigma0PhotonMCpT"), mcPhoton.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCpTResolution"), mcPhoton.pt(), 1 - pt / mcPhoton.pt()); + + // Energy resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCEnergyResolution"), mcPhoton.e(), 1 - cluster.energy() / mcPhoton.e()); + + // Eta resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCEtaResolution"), mcPhoton.eta(), cluster.eta() - mcPhoton.eta()); + + // Phi resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCPhiResolution"), mcPhoton.phi(), cluster.phi() - mcPhoton.phi()); + + // Fraction of energy Vs MC pT + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCFractionEnergy"), mcPhoton.pt(), cluster.amplitudeA()[i]); + } + } + } + } + + } // end of collisions loop + + // Process MC generated photons + for (const auto& mcpart : mcparticles) { + if (mcpart.pdgCode() != PDG_t::kGamma || !mcpart.isPhysicalPrimary() || TMath::Abs(mcpart.y()) > 0.5) + continue; + + histos.fill(HIST("PhotonMCQA/hGenPhoton"), mcpart.pt()); + + // photon from sigma0/asigma0 + auto const& photonMothers = mcpart.template mothers_as(); + if (!photonMothers.empty()) { + // Assumption: first mother is the physical one + auto const& photonMother = photonMothers.front(); + if (TMath::Abs(photonMother.pdgCode()) == PDG_t::kSigma0) { // Sigma0 or ASigma0 + histos.fill(HIST("PhotonMCQA/hGenSigma0Photon"), mcpart.pt()); + } + } + } + } + // Sigma0 processing part void processRealData(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&) { - dataProcess(collisions, fullV0s, nullptr); + dataProcess(collisions, fullV0s, nullptr, nullptr, nullptr); } void processRealDataWithTOF(soa::Join const& collisions, V0TOFStandardDerivedDatas const& fullV0s, dauTracks const&) { - dataProcess(collisions, fullV0s, nullptr); + dataProcess(collisions, fullV0s, nullptr, nullptr, nullptr); + } + + void processRealDataWithEMCal(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&, aod::EMCALClusters const& fullEMCalClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + { + dataProcess(collisions, fullV0s, fullEMCalClusters, emcmatchedtracks, nullptr); } void processMonteCarlo(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { - dataProcess(collisions, fullV0s, mcParticles); + dataProcess(collisions, fullV0s, nullptr, nullptr, mcParticles); } void processMonteCarloWithTOF(soa::Join const& collisions, V0TOFDerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { - dataProcess(collisions, fullV0s, mcParticles); + dataProcess(collisions, fullV0s, nullptr, nullptr, mcParticles); + } + + void processMonteCarloWithEMCal(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + { + dataProcess(collisions, fullV0s, fullEMCalMCClusters, emcmatchedtracks, mcParticles); } void processGeneratedRun3(aod::McParticles const& mcParticles) @@ -2445,14 +3166,22 @@ struct sigma0builder { runGenV0QA(mcCollisions, V0MCCores, collisions); } + void processPCMVsEMCalQA(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + { + runPCMVsEMCalQA(collisions, fullV0s, fullEMCalMCClusters, emcmatchedtracks, mcParticles); + } + PROCESS_SWITCH(sigma0builder, processRealData, "process as if real data", true); - PROCESS_SWITCH(sigma0builder, processRealDataWithTOF, "process as if real data", false); + PROCESS_SWITCH(sigma0builder, processRealDataWithTOF, "process as if real data, uses TOF PID info", false); + PROCESS_SWITCH(sigma0builder, processRealDataWithEMCal, "process as if real data, uses EMCal clusters", false); PROCESS_SWITCH(sigma0builder, processMonteCarlo, "process as if MC data", false); PROCESS_SWITCH(sigma0builder, processMonteCarloWithTOF, "process as if MC data, uses TOF PID info", false); + PROCESS_SWITCH(sigma0builder, processMonteCarloWithEMCal, "process as if MC data, uses EMCal clusters", false); PROCESS_SWITCH(sigma0builder, processGeneratedRun3, "process generated MC info", false); PROCESS_SWITCH(sigma0builder, processV0QA, "process QA of lambdas and photons", false); PROCESS_SWITCH(sigma0builder, processV0MCQA, "process QA of lambdas and photons", false); PROCESS_SWITCH(sigma0builder, processV0Generated, "process QA of gen lambdas and photons", false); + PROCESS_SWITCH(sigma0builder, processPCMVsEMCalQA, "process QA of PCM and EMCal photons", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 9c37b4a8b1b..fd6b48609e1 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -60,8 +60,10 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using MCSigma0s = soa::Join; using Sigma0s = soa::Join; +using MCSigma0s = soa::Join; +using Sigma0sWithEMCal = soa::Join; +using MCSigma0sWithEMCal = soa::Join; static const std::vector PhotonSels = {"NoSel", "V0Type", "DCADauToPV", "DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT", @@ -88,10 +90,6 @@ struct sigmaanalysis { ctpRateFetcher rateFetcher; //__________________________________________________ - // For manual sliceBy - // SliceCache cache; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Event level @@ -220,6 +218,23 @@ struct sigmaanalysis { Configurable PhotonPhiMax2{"PhotonPhiMax2", -1, "Phi min value to reject photons, region 2 (leave negative if no selection desired)"}; } photonSelections; + //// Photon criteria: + struct : ConfigurableGroup { + std::string prefix = "EMCalPhotonSelections"; // JSON group name + Configurable definition{"definition", 13, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; + Configurable MinCells{"MinCells", 1, "Min number of cells in cluster"}; + Configurable MinEnergy{"MinEnergy", 0.0, "Minimum energy of selected clusters (GeV)"}; + Configurable MaxEnergy{"MaxEnergy", 5, "Max energy of selected clusters (GeV)"}; + Configurable MaxEta{"MaxEta", 1.0, "Max absolute cluster Eta"}; + Configurable MinTime{"MinTime", -50, "Minimum time of selected clusters (ns)"}; + Configurable MaxTime{"MaxTime", 50, "Max time of selected clusters (ns)"}; + Configurable RemoveExotic{"RemoveExotic", false, "Flag to enable the removal of exotic clusters"}; + Configurable MinM02{"MinM02", -1., "Minimum shower shape long axis"}; + Configurable MaxM02{"MaxM02", 5., "Max shower shape long axis"}; + Configurable RemoveMatchedTrack{"RemoveMatchedTrack", true, "Flag to enable the removal of clusters matched to tracks"}; + + } EMCalPhotonSelections; + struct : ConfigurableGroup { std::string prefix = "sigma0Selections"; // JSON group name Configurable Sigma0MinRapidity{"Sigma0MinRapidity", -0.5, "sigma0 min rapidity"}; @@ -277,6 +292,13 @@ struct sigmaanalysis { ConfigurableAxis axisPhi{"axisPhi", {200, 0, 2 * o2::constants::math::PI}, "Phi for photons"}; ConfigurableAxis axisZ{"axisZ", {120, -120.0f, 120.0f}, "V0 Z position (cm)"}; + // EMCal-specifc + ConfigurableAxis axisClrDefinition{"axisClrDefinition", {51, -0.5, 50.5}, "Cluster Definition"}; + ConfigurableAxis axisClrNCells{"axisClrNCells", {25, 0.0, 25}, "N cells per cluster"}; + ConfigurableAxis axisClrEnergy{"axisClrEnergy", {400, 0.0, 10}, "Energy per cluster"}; + ConfigurableAxis axisClrTime{"axisClrTime", {300, -30.0, 30.0}, "cluster time (ns)"}; + ConfigurableAxis axisClrShape{"axisClrShape", {100, 0.0, 1.0}, "cluster shape"}; + ConfigurableAxis axisCandSel{"axisCandSel", {20, 0.5f, +20.5f}, "Candidate Selection"}; // ML @@ -286,7 +308,7 @@ struct sigmaanalysis { void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); - if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || + if ((doprocessRealData + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithEMCal + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || (doprocessGeneratedRun3 + doprocessPi0GeneratedRun3 > 1)) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -333,33 +355,52 @@ struct sigmaanalysis { histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2D, {axisCentrality, axisIRBinning}); } - if (doprocessRealData || doprocessMonteCarlo) { + if (doprocessRealData || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { for (const auto& histodir : DirList) { if (fillSelhistos) { - histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); - histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - - histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); - histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); - histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); - histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); - histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); - histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); - histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); - histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); + + if (doprocessRealData || doprocessMonteCarlo) { + + histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); + histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); + histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + + // PCM photons + histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); + histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); + histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); + histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); + histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); + histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); + histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); + histos.add(histodir + "/Photon/h3dPhotonYSigma0Mass", "h3dPhotonYSigma0Mass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); + histos.add(histodir + "/Photon/h3dPhotonRadiusSigma0Mass", "h3dPhotonRadiusSigma0Mass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); + } + + if (doprocessRealDataWithEMCal || doprocessMonteCarloWithEMCal) { + // EMCal photons + histos.add(histodir + "/EMCalPhotonSel/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/EMCalPhotonSel/hDefinition", "hDefinition", kTH1D, {axisClrDefinition}); + histos.add(histodir + "/EMCalPhotonSel/hNCells", "hNCells", kTH1D, {axisClrNCells}); + histos.add(histodir + "/EMCalPhotonSel/hEnergy", "hEnergy", kTH1D, {axisClrEnergy}); + histos.add(histodir + "/EMCalPhotonSel/h2dEtaVsPhi", "h2dEtaVsPhi", kTH2D, {axisRapidity, axisPhi}); + histos.add(histodir + "/EMCalPhotonSel/hTime", "hTime", kTH1D, {axisClrTime}); + histos.add(histodir + "/EMCalPhotonSel/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); + histos.add(histodir + "/EMCalPhotonSel/hShape", "hShape", kTH1D, {axisClrShape}); + } histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); @@ -400,8 +441,6 @@ struct sigmaanalysis { histos.add(histodir + "/Sigma0/h2dRadiusVspT", "h2dRadiusVspT", kTH2D, {axisV0PairRadius, axisPt}); histos.add(histodir + "/Sigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); histos.add(histodir + "/Sigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); - histos.add(histodir + "/Sigma0/h3dPhotonYMass", "h3dPhotonYMass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); - histos.add(histodir + "/Sigma0/h3dPhotonRadiusMass", "h3dPhotonRadiusMass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); histos.add(histodir + "/Sigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); histos.add(histodir + "/ASigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); @@ -411,22 +450,21 @@ struct sigmaanalysis { histos.add(histodir + "/ASigma0/h2dRadiusVspT", "h2dRadiusVspT", kTH2D, {axisV0PairRadius, axisPt}); histos.add(histodir + "/ASigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); histos.add(histodir + "/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); - histos.add(histodir + "/ASigma0/h3dPhotonYMass", "h3dPhotonYMass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); - histos.add(histodir + "/ASigma0/h3dPhotonRadiusMass", "h3dPhotonRadiusMass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); histos.add(histodir + "/ASigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); // Process MC - if (doprocessMonteCarlo) { + if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { if (fillSelhistos) { histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); - histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); + + if (doprocessMonteCarlo) { + histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); + histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); + } histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); @@ -441,8 +479,6 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); } - histos.add(histodir + "/MC/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); - histos.add(histodir + "/MC/Sigma0/hPt", "hPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); @@ -465,11 +501,10 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); - // 1/pT Resolution: + // pT Resolution: if (fillResoQAhistos && histodir == "BeforeSel") { - histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); @@ -477,6 +512,7 @@ struct sigmaanalysis { histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); @@ -751,12 +787,21 @@ struct sigmaanalysis { std::vector getListOfRecoCollIndices(TMCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); int biggestNContribs = -1; int bestCollisionIndex = -1; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { // consider event selections in the recoed <-> gen collision association, for the denominator (or numerator) of the efficiency (or signal loss)? + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.useEvtSelInDenomEff) { if (!IsEventAccepted(collision, false)) { continue; @@ -781,6 +826,14 @@ struct sigmaanalysis { void fillGeneratedEventProperties(TMCCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { // Apply selections on MC collisions if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { @@ -798,14 +851,14 @@ struct sigmaanalysis { histos.fill(HIST("Gen/hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); // Check if there is at least one of the reconstructed collisions associated to this MC collision // If so, we consider it bool atLeastOne = false; int biggestNContribs = -1; float centrality = 100.5f; int nCollisions = 0; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); if (!IsEventAccepted(collision, false)) { continue; @@ -926,14 +979,16 @@ struct sigmaanalysis { int TrkCode = 10; // 1: TPC-only, 2: TPC+Something, 3: ITS-Only, 4: ITS+TPC + Something, 10: anything else if (isGamma) { - if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) - TrkCode = 1; - if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) - TrkCode = 2; - if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) - TrkCode = 3; - if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) - TrkCode = 4; + if constexpr (requires { sigma.photonV0Type(); }) { + if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) + TrkCode = 1; + if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) + TrkCode = 2; + if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) + TrkCode = 3; + if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) + TrkCode = 4; + } } else { if (sigma.lambdaPosTrackCode() == 1 && sigma.lambdaNegTrackCode() == 1) TrkCode = 1; @@ -956,9 +1011,8 @@ struct sigmaanalysis { // Gamma MC association if (sigma.photonPDGCode() == 22) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.photonNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.photonPosTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), sigma.photonPt() - sigma.photonmcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } @@ -986,8 +1040,10 @@ struct sigmaanalysis { // Sigma and AntiSigma MC association if (sigma.isSigma0()) { histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution - if (sigma.mcpt() > 0) - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + if (sigma.mcpt() > 0) { + histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), sigma.pt() - sigma.mcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + } } if (sigma.isAntiSigma0()) { histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution @@ -1044,39 +1100,61 @@ struct sigmaanalysis { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; - // Get V0trackCode - int GammaTrkCode = retrieveV0TrackCode(sigma); - int LambdaTrkCode = retrieveV0TrackCode(sigma); - - float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; float centrality = getCentralityRun3(collision); if (fillSelhistos) { - //_______________________________________ - // Photon - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); - - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); + + // Get V0trackCode + int LambdaTrkCode = retrieveV0TrackCode(sigma); + + if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon + + // Base properties + int GammaTrkCode = retrieveV0TrackCode(sigma); + float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; + + //_______________________________________ + // Photon + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); + + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); + + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonYSigma0Mass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonRadiusSigma0Mass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); + } + + if constexpr (requires { sigma.photonDefinition(); }) { // Processing EMCal photon + + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hDefinition"), sigma.photonDefinition()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hNCells"), sigma.photonNCells()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hEnergy"), sigma.photonEnergy()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/h2dEtaVsPhi"), sigma.photonEMCEta(), sigma.photonEMCPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hTime"), sigma.photonTime()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hExotic"), sigma.photonIsExotic()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hShape"), sigma.photonM02()); + } //_______________________________________ // Lambdas @@ -1094,13 +1172,12 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosChi2PerNc"), sigma.lambdaPosChi2PerNcl()); histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegChi2PerNc"), sigma.lambdaNegChi2PerNcl()); histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLifeTime"), sigma.lambdaLifeTime()); + + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); } //_______________________________________ // Sigmas and Lambdas - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - if (sigma.lambdaAlpha() > 0) { if (fillSelhistos) { histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); @@ -1119,8 +1196,6 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h2dRadiusVspT"), sigma.radius(), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hDCAPairDau"), sigma.dcadaughters()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dPhotonYMass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dPhotonRadiusMass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } else { if (fillSelhistos) { @@ -1140,8 +1215,6 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h2dRadiusVspT"), sigma.radius(), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hDCAPairDau"), sigma.dcadaughters()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dPhotonYMass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dPhotonRadiusMass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } @@ -1154,17 +1227,18 @@ struct sigmaanalysis { //_______________________________________ // Gamma MC association if (sigma.photonPDGCode() == 22) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); - if (!sigma.photonIsCorrectlyAssoc()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + if (!sigma.photonIsCorrectlyAssoc()) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + } } } @@ -1191,9 +1265,6 @@ struct sigmaanalysis { //_______________________________________ // Sigma0 MC association if (sigma.isSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCPt"), sigma.mcpt()); @@ -1211,9 +1282,6 @@ struct sigmaanalysis { //_______________________________________ // AntiSigma0 MC association if (sigma.isAntiSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMCPt"), sigma.mcpt()); @@ -1382,6 +1450,48 @@ struct sigmaanalysis { return true; } + // Apply specific selections for photons + template + bool selectEMCalPhoton(TClusterObject const& cand) + { + // Clusterizer + if (cand.photonDefinition() != EMCalPhotonSelections.definition && EMCalPhotonSelections.definition > -1) + return false; + + // Number of Cells + if (cand.photonNCells() < EMCalPhotonSelections.MinCells) + return false; + + // Energy + if (cand.photonEnergy() < EMCalPhotonSelections.MinEnergy || cand.photonEnergy() > EMCalPhotonSelections.MaxEnergy) + return false; + + // Eta + if (TMath::Abs(cand.photonEMCEta()) > EMCalPhotonSelections.MaxEta) + return false; + + // Timing + if (cand.photonTime() < EMCalPhotonSelections.MinTime || cand.photonTime() > EMCalPhotonSelections.MaxTime) + return false; + + // Exotic Clusters + if (cand.photonIsExotic() && EMCalPhotonSelections.RemoveExotic) { + return false; + } + + // Shower shape long axis + if (cand.photonNCells() > 1) { // Only if we have more than one + if (cand.photonM02() < EMCalPhotonSelections.MinM02 || cand.photonM02() > EMCalPhotonSelections.MaxM02) { + return false; + } + } + // Has matched track? + if (cand.photonHasAssocTrk() && EMCalPhotonSelections.RemoveMatchedTrack) + return false; + + return true; + } + // Apply specific selections for lambdas template bool selectLambda(TV0Object const& cand) @@ -1492,8 +1602,15 @@ struct sigmaanalysis { bool processSigma0Candidate(TSigma0Object const& cand) { // Photon specific selections - if (!selectPhoton(cand)) - return false; + if constexpr (requires { cand.photonV0Type(); }) { // Processing PCM photon + if (!selectPhoton(cand)) + return false; + } + + if constexpr (requires { cand.photonDefinition(); }) { // Processing EMCal photon + if (!selectEMCalPhoton(cand)) + return false; + } // Lambda specific selections if (!selectLambda(cand)) @@ -1539,7 +1656,7 @@ struct sigmaanalysis { for (const auto& coll : collisions) { // Event selection - if (!IsEventAccepted(coll, true)) + if (!IsEventAccepted(coll, true)) // TODO: Should I Add event selection for events without EMCal? continue; // Sigma0s loop @@ -1721,11 +1838,21 @@ struct sigmaanalysis { analyzeRecoeSigma0s(collisions, fullSigma0s); } + void processRealDataWithEMCal(soa::Join const& collisions, Sigma0sWithEMCal const& fullSigma0s) + { + analyzeRecoeSigma0s(collisions, fullSigma0s); + } + void processMonteCarlo(soa::Join const& collisions, MCSigma0s const& fullSigma0s) { analyzeRecoeSigma0s(collisions, fullSigma0s); } + void processMonteCarloWithEMCal(soa::Join const& collisions, MCSigma0sWithEMCal const& fullSigma0s) + { + analyzeRecoeSigma0s(collisions, fullSigma0s); + } + // Simulated processing in Run 3 void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Sigma0Gens) { @@ -1751,7 +1878,9 @@ struct sigmaanalysis { // _____________________________________________________ PROCESS_SWITCH(sigmaanalysis, processRealData, "Do real data analysis", true); + PROCESS_SWITCH(sigmaanalysis, processRealDataWithEMCal, "Do real data analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processMonteCarlo, "Do Monte-Carlo-based analysis", false); + PROCESS_SWITCH(sigmaanalysis, processMonteCarloWithEMCal, "Do Monte-Carlo-based analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processGeneratedRun3, "process MC generated Run 3", false); PROCESS_SWITCH(sigmaanalysis, processPi0RealData, "Do real data analysis for pi0 QA", false); PROCESS_SWITCH(sigmaanalysis, processPi0MonteCarlo, "Do Monte-Carlo-based analysis for pi0 QA", false); From 64cd5f78673ff71ee59c2f723afa1c95956cef2e Mon Sep 17 00:00:00 2001 From: Joachim Carlo Kristian Bjerg Hansen <50103987+joachimckh@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:47:06 +0200 Subject: [PATCH 105/282] [PWGJE] tracking efficiency - fixes (#15572) --- PWGJE/Tasks/jetSpectraEseTask.cxx | 53 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index b0b2b638fb4..e9e445861e0 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -155,7 +155,6 @@ struct JetSpectraEseTask { Preslice mcdjetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; Preslice mcdTracksPerJCollision = o2::aod::jtrack::collisionId; - Preslice particlesPerJMcCollision = o2::aod::jmcparticle::mcCollisionId; SliceCache cache; using BinningType = ColumnBinningPolicy; @@ -351,6 +350,8 @@ struct JetSpectraEseTask { registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Collision size < 1"); registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(3, "MCD size != 1"); registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(4, "Occupancy cut"); + registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(5, "Vtx z cut"); + registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(6, "Event selection"); } if (doprocessMCDetectorLevel) { LOGF(info, "JetSpectraEseTask::init() - MC Detector level"); @@ -363,8 +364,9 @@ struct JetSpectraEseTask { // registry.add("mcd/hJetPhi", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{phiAxis}}}); registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(1, "Input event"); - registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Collision size < 1"); - registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(3, "Occupancy cut"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(1, "Event selection"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Occupancy cut"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(3, "Vtx z cut"); } if (doprocessMCChargedMatched) { LOGF(info, "JetSpectraEseTask::init() - MC Charged Matched"); @@ -408,19 +410,20 @@ struct JetSpectraEseTask { } if (doprocessMCGenTrack) { LOGF(info, "JetSpectraEseTask::init() - MCGen track"); - registry.add("hTrackPtGen", "", {HistType::kTH1F, {{assocTrackPt}}}); - registry.add("hTrackEtaGen", "", {HistType::kTH1F, {{etaAxis}}}); - registry.add("hTrackPhiGen", "", {HistType::kTH1F, {{phiAxis}}}); + registry.add("mcgen/hTrackPtGen", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("mcgen/hTrackEtaGen", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("mcgen/hTrackPhiGen", "", {HistType::kTH1F, {{phiAxis}}}); } if (doprocessMCRecoTrack) { LOGF(info, "JetSpectraEseTask::init() - MCRec track"); - registry.add("hTrackPtReco", "", {HistType::kTH1F, {{assocTrackPt}}}); - registry.add("hTrackEtaReco", "", {HistType::kTH1F, {{etaAxis}}}); - registry.add("hTrackPhiReco", "", {HistType::kTH1F, {{phiAxis}}}); + registry.add("mcrec/hTrackPtReco", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("mcrec/hTrackEtaReco", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("mcrec/hTrackPhiReco", "", {HistType::kTH1F, {{phiAxis}}}); } } - void loadEfficiency(aod::BCsWithTimestamps::iterator const& bc) + template + void loadEfficiency(TBC const& bc) { uint64_t timestamp = bc.timestamp(); if (cfg.isLoaded) { @@ -555,7 +558,7 @@ struct JetSpectraEseTask { Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, jets1, c2, tracks2] : pairData) { - auto bc = c2.template bc_as(); + auto bc = c2.template bc_as(); loadEfficiency(bc); auto c1Tracks = tracks.sliceBy(tracksPerJCollision, c1.globalIndex()); registry.fill(HIST("eventQA/before/hVtxZMixed"), c1.posZ()); @@ -646,7 +649,7 @@ struct JetSpectraEseTask { void processESEDataCharged(soa::Join::iterator const& collision, soa::Filtered> const& jets, - aod::JetTracks const& tracks, aod::BCsWithTimestamps const&) + aod::JetTracks const& tracks, aod::JBCs const&) { registry.fill(HIST("eventQA/hEventCounter"), kFilteredInputEv); registry.fill(HIST("eventQA/before/hVtxZ"), collision.posZ()); @@ -658,7 +661,7 @@ struct JetSpectraEseTask { return; registry.fill(HIST("eventQA/hEventCounter"), kOccupancyCut); - auto bc = collision.bc_as(); + auto bc = collision.bc_as(); loadEfficiency(bc); jetSpectra(collision, jets, tracks); } @@ -666,7 +669,7 @@ struct JetSpectraEseTask { void processESEDataChargedMixed(soa::Join const& collisions, soa::Filtered> const& jets, - aod::JetTracks const& tracks, aod::BCsWithTimestamps const&) + aod::JetTracks const& tracks, aod::JBCs const&) { jetMixed(collisions, jets, tracks); } @@ -753,12 +756,13 @@ struct JetSpectraEseTask { } if (cfgEvSelOccupancy && !fOccupancy) return; + registry.fill(HIST("mcp/hEventCounter"), counter++); if (!(std::abs(mcCollision.posZ()) < vertexZCut)) { return; } + registry.fill(HIST("mcp/hEventCounter"), counter++); if (!eventSel) return; - registry.fill(HIST("mcp/hEventCounter"), counter++); registry.fill(HIST("mcp/hCentralitySel"), centrality); @@ -783,6 +787,7 @@ struct JetSpectraEseTask { if (!(std::abs(collision.posZ()) < vertexZCut)) { return; } + registry.fill(HIST("mcd/hEventCounter"), counter++); auto centrality = cfgisPbPb ? collision.centFT0M() : -1; @@ -881,8 +886,10 @@ struct JetSpectraEseTask { return; } - auto particlesInCollision = particles.sliceBy(particlesPerJMcCollision, mcCollision.globalIndex()); - for (const auto& particle : particlesInCollision) { + for (const auto& particle : particles) { + if (particle.mcCollisionId() != mcCollision.globalIndex()) { + continue; + } if (!isChargedParticle(particle.pdgCode())) { continue; } @@ -896,9 +903,9 @@ struct JetSpectraEseTask { continue; } - registry.fill(HIST("hTrackPtGen"), particle.pt()); - registry.fill(HIST("hTrackEtaGen"), particle.eta()); - registry.fill(HIST("hTrackPhiGen"), particle.phi()); + registry.fill(HIST("mcgen/hTrackPtGen"), particle.pt()); + registry.fill(HIST("mcgen/hTrackEtaGen"), particle.eta()); + registry.fill(HIST("mcgen/hTrackPhiGen"), particle.phi()); } } PROCESS_SWITCH(JetSpectraEseTask, processMCGenTrack, "jet MC process: Generated track", false); @@ -961,9 +968,9 @@ struct JetSpectraEseTask { } seenMcParticles.push_back(particle.globalIndex()); - registry.fill(HIST("hTrackPtReco"), track.pt()); - registry.fill(HIST("hTrackEtaReco"), track.eta()); - registry.fill(HIST("hTrackPhiReco"), track.phi()); + registry.fill(HIST("mcrec/hTrackPtReco"), track.pt()); + registry.fill(HIST("mcrec/hTrackEtaReco"), track.eta()); + registry.fill(HIST("mcrec/hTrackPhiReco"), track.phi()); } } } From 748be3f0c47ad6b327135d9baae5d4fff92269fd Mon Sep 17 00:00:00 2001 From: yakparo Date: Mon, 30 Mar 2026 18:12:04 +0200 Subject: [PATCH 106/282] [PWGLF] Add experimental evsels, rapidity histos to strangeCascTrack (#15581) --- PWGLF/Tasks/Strangeness/strangeCascTrack.cxx | 188 +++++++++++-------- 1 file changed, 106 insertions(+), 82 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx index 44eb59d507e..de8e38ecbfb 100644 --- a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx +++ b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx @@ -87,24 +87,33 @@ struct StrangeCascTrack { // axes struct : ConfigurableGroup { + std::string prefix = "axes"; ConfigurableAxis axisEta{"axisEta", {102, -2.01, 2.01}, "#eta"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {500, 0., 0.5}, "cm"}; ConfigurableAxis axisDCAz{"axisDCAz", {500, 0., 0.5}, "cm"}; - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 10.0}, "p_{T} (GeV/c)"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 10}, "p_{T} (GeV/c)"}; ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0.0f, 5.0, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 70.0f, 100.0f}, "FT0 mult %"}; ConfigurableAxis axisOmegaMass{"axisOmegaMass", {2000, 1.6, 1.8}, "#Omega M_{inv} (GeV/c^{2})"}; ConfigurableAxis axisXiMass{"axisXiMass", {2000, 1.2, 1.4}, "#Xi M_{inv} (GeV/c^{2})"}; } axesConfig; - // event and dau track selection + // event selections struct : ConfigurableGroup { - // event cuts + std::string prefix = "eventSelections"; Configurable cutDoINEL{"cutDoINEL", true, "choose events with INEL>0"}; Configurable cutZVertex{"cutZVertex", 10.0f, "max Z-vertex position"}; Configurable cutDoSel8{"cutDoSel8", true, "choose events with sel8"}; Configurable cutDoNoPileup{"cutDoNoPileup", true, "choose events with no bunch pileup"}; Configurable cutDoGoodFT0{"cutDoGoodFT0", true, "choose events with IsGoodZvtxFT0VsPV"}; - // cascade cuts + Configurable doINELMCGen{"doINELMCGen", true, "apply INEL>0 for gen MC events"}; + Configurable doITSTPCVertexEventCut{"doITSTPCVertexEventCut", true, ">=1 ITS-TPC track"}; + Configurable doNoCollInRofStandardCut{"doNoCollInRofStandardCut", true, "rejects if there are other events within the same ITS ROF with mult above threshold"}; + Configurable doTimeRangeStandardCut{"doTimeRangeStandardCut", true, "rejects if there are events nearby in dtime +/- 2 μs, or mult above some threshold in -4..-2 μs"}; + } eventCuts; + + // cascade selections + struct : ConfigurableGroup { + std::string prefix = "cascadeSelections"; Configurable cutDoPropagateDCA{"cutDoPropagateDCA", false, "choose events with sel8"}; Configurable cutPropDCAtoPVxy{"cutPropDCAtoPVxy", 0.02f, "max cascade dca to PV in xy - propagated"}; Configurable cutPropDCAtoPVz{"cutPropDCAtoPVz", 0.02f, "max cascade dca to PV in z - propagated"}; @@ -115,7 +124,7 @@ struct StrangeCascTrack { Configurable cutMaxBachCosPA{"cutMaxBachCosPA", 1.1f, "max Bachelor cosPA"}; Configurable> cutMinCascCosPaVsPt{ "cutMinCascCosPaVsPt", - {0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 0.999, 0.999}, + {0.993, 0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 0.999}, "Min Casc CosPA per pT bin (same binning as axisPt)"}; Configurable cutRapidity{"cutRapidity", 0.5f, "max rapidity"}; Configurable cutDauEta{"cutDauEta", 1.0f, "max eta of dau tracks"}; @@ -136,7 +145,7 @@ struct StrangeCascTrack { // TOF PID selection Configurable cutNSigmaTOFXi{"cutNSigmaTOFXi", 3, "cutNSigmaTOFXi"}; Configurable cutNSigmaTOFOmega{"cutNSigmaTOFOmega", 3, "cutNSigmaTOFOmega"}; - } selCuts; + } cascCuts; // cascade reconstruction Types static constexpr std::string_view TypeNames[] = {"Standard", "Tracked"}; @@ -160,44 +169,65 @@ struct StrangeCascTrack { { bool passedAllSels = true; //* inel>0 cut - if (!selCuts.cutDoINEL || collision.multNTracksPVeta1() > 0) { + if (!eventCuts.cutDoINEL || collision.multNTracksPVeta1() > 0) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 0.5); } else { passedAllSels = false; } //* pvz cut - if (std::abs(collision.posZ()) < selCuts.cutZVertex) { + if (std::abs(collision.posZ()) < eventCuts.cutZVertex) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 1.5); } else { passedAllSels = false; } //* sel8 cut - if (!selCuts.cutDoSel8 || collision.sel8()) { + if (!eventCuts.cutDoSel8 || collision.sel8()) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 2.5); } else { passedAllSels = false; } //* pileup cut - if (!selCuts.cutDoNoPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + if (!eventCuts.cutDoNoPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 3.5); } else { passedAllSels = false; } //* good ft0 z-vertex vs pv cut - if (!selCuts.cutDoGoodFT0 || collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (!eventCuts.cutDoGoodFT0 || collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 4.5); } else { passedAllSels = false; } + //* + if (!eventCuts.doITSTPCVertexEventCut || collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + if (fillHists) + histos.fill(HIST("Rec-Events/EvFilter"), 5.5); + } else { + passedAllSels = false; + } + //* + if (!eventCuts.doNoCollInRofStandardCut || collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + if (fillHists) + histos.fill(HIST("Rec-Events/EvFilter"), 6.5); + } else { + passedAllSels = false; + } + //* + if (!eventCuts.doTimeRangeStandardCut || collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + if (fillHists) + histos.fill(HIST("Rec-Events/EvFilter"), 7.5); + } else { + passedAllSels = false; + } //* all cuts if (passedAllSels) { if (fillHists) - histos.fill(HIST("Rec-Events/EvFilter"), 5.5); + histos.fill(HIST("Rec-Events/EvFilter"), 8.5); } return passedAllSels; } @@ -209,20 +239,20 @@ struct StrangeCascTrack { double ptMin = 0.0; double ptMax = 0.0; if (Type == 1 && particle == "Xi") { - ptMin = selCuts.cutMinPtXiTra; - ptMax = selCuts.cutMaxPtXiTra; + ptMin = cascCuts.cutMinPtXiTra; + ptMax = cascCuts.cutMaxPtXiTra; } if (Type == 1 && particle == "Omega") { - ptMin = selCuts.cutMinPtOmegaTra; - ptMax = selCuts.cutMaxPtOmegaTra; + ptMin = cascCuts.cutMinPtOmegaTra; + ptMax = cascCuts.cutMaxPtOmegaTra; } if (Type == 0 && particle == "Xi") { - ptMin = selCuts.cutMinPtXiStd; - ptMax = selCuts.cutMaxPtXiStd; + ptMin = cascCuts.cutMinPtXiStd; + ptMax = cascCuts.cutMaxPtXiStd; } if (Type == 0 && particle == "Omega") { - ptMin = selCuts.cutMinPtOmegaStd; - ptMax = selCuts.cutMaxPtOmegaStd; + ptMin = cascCuts.cutMinPtOmegaStd; + ptMax = cascCuts.cutMaxPtOmegaStd; } if (cascade.pt() < ptMin || cascade.pt() > ptMax) passedSel = false; @@ -240,7 +270,7 @@ struct StrangeCascTrack { y = std::abs(cascade.yXi()); else y = std::abs(cascade.yOmega()); - if (y > selCuts.cutRapidity) { + if (y > cascCuts.cutRapidity) { passedRapidity = false; passedAllSels = false; } @@ -249,7 +279,7 @@ struct StrangeCascTrack { double bachEta = std::abs(cascade.bacheloreta()); double negEta = std::abs(cascade.negativeeta()); double posEta = std::abs(cascade.positiveeta()); - if (bachEta > selCuts.cutDauEta || negEta > selCuts.cutDauEta || posEta > selCuts.cutDauEta) { + if (bachEta > cascCuts.cutDauEta || negEta > cascCuts.cutDauEta || posEta > cascCuts.cutDauEta) { passedDauEta = false; passedAllSels = false; } @@ -261,21 +291,21 @@ struct StrangeCascTrack { double posCls = posTrack.tpcClusters(); double negCls = negTrack.tpcClusters(); double bachCls = bachTrack.tpcClusters(); - if (posCls < selCuts.cutNClsTPC || negCls < selCuts.cutNClsTPC || bachCls < selCuts.cutNClsTPC) { + if (posCls < cascCuts.cutNClsTPC || negCls < cascCuts.cutNClsTPC || bachCls < cascCuts.cutNClsTPC) { passedTPCCls = false; passedAllSels = false; } // V0 cosPA bool passedV0CosPA = true; double v0cospa = cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - if (v0cospa < selCuts.cutMinV0CosPA || v0cospa > selCuts.cutMaxV0CosPA) { + if (v0cospa < cascCuts.cutMinV0CosPA || v0cospa > cascCuts.cutMaxV0CosPA) { passedV0CosPA = false; passedAllSels = false; } // Bachelor cosPA bool passedBachCosPA = true; double bachcospa = stdcasc.bachBaryonCosPA(); - if (bachcospa < selCuts.cutMinBachCosPA || bachcospa > selCuts.cutMaxBachCosPA) { + if (bachcospa < cascCuts.cutMinBachCosPA || bachcospa > cascCuts.cutMaxBachCosPA) { passedBachCosPA = false; passedAllSels = false; } @@ -284,22 +314,22 @@ struct StrangeCascTrack { double casccospa = cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()); const auto& edges = axesConfig.axisPt.value; int ptBin = std::upper_bound(edges.begin(), edges.end(), cascade.pt()) - edges.begin() - 1; - if (ptBin < 0 || ptBin >= static_cast(selCuts.cutMinCascCosPaVsPt->size())) { + if (ptBin < 0 || ptBin >= static_cast(cascCuts.cutMinCascCosPaVsPt->size())) { ptBin = 1; } // safety check - if pt bin not determined, default to loosest cut - if (casccospa < selCuts.cutMinCascCosPaVsPt->at(ptBin)) { + if (casccospa < cascCuts.cutMinCascCosPaVsPt->at(ptBin)) { passedCascCosPA = false; passedAllSels = false; } // Propagated cacade DCAxy to PV bool passedPropDCAxy = true; - if (selCuts.cutDoPropagateDCA && cascade.dcaXYCascToPV() > selCuts.cutPropDCAtoPVxy) { + if (cascCuts.cutDoPropagateDCA && cascade.dcaXYCascToPV() > cascCuts.cutPropDCAtoPVxy) { passedPropDCAxy = false; passedAllSels = false; } // Propagated cacade DCAz to PV bool passedPropDCAz = true; - if (selCuts.cutDoPropagateDCA && cascade.dcaZCascToPV() > selCuts.cutPropDCAtoPVz) { + if (cascCuts.cutDoPropagateDCA && cascade.dcaZCascToPV() > cascCuts.cutPropDCAtoPVz) { passedPropDCAz = false; passedAllSels = false; } @@ -314,25 +344,25 @@ struct StrangeCascTrack { const auto& negTrack = cascade.template negTrackExtra_as(); const auto& bachTrack = cascade.template bachTrackExtra_as(); if (cascade.sign() < 0) { - if (std::abs(posTrack.tpcNSigmaPr()) > selCuts.cutNSigmaTPCProton) { + if (std::abs(posTrack.tpcNSigmaPr()) > cascCuts.cutNSigmaTPCProton) { passedSel = false; } - if (std::abs(negTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) { + if (std::abs(negTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) { passedSel = false; } - if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) || - (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > selCuts.cutNSigmaTPCKaon)) { + if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) || + (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > cascCuts.cutNSigmaTPCKaon)) { passedSel = false; } } else { - if (std::abs(negTrack.tpcNSigmaPr()) > selCuts.cutNSigmaTPCProton) { + if (std::abs(negTrack.tpcNSigmaPr()) > cascCuts.cutNSigmaTPCProton) { passedSel = false; } - if (std::abs(posTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) { + if (std::abs(posTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) { passedSel = false; } - if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) || - (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > selCuts.cutNSigmaTPCKaon)) { + if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) || + (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > cascCuts.cutNSigmaTPCKaon)) { passedSel = false; } } @@ -344,9 +374,9 @@ struct StrangeCascTrack { { bool passedSel = true; if (particle == "Xi") - passedSel = cascade.tofXiCompatibility(selCuts.cutNSigmaTOFXi); + passedSel = cascade.tofXiCompatibility(cascCuts.cutNSigmaTOFXi); if (particle == "Omega") - passedSel = cascade.tofOmegaCompatibility(selCuts.cutNSigmaTOFOmega); + passedSel = cascade.tofOmegaCompatibility(cascCuts.cutNSigmaTOFOmega); return passedSel; } // checks whether gen cascade corresponds to PDG code @@ -375,18 +405,6 @@ struct StrangeCascTrack { } return false; } - // applies purities and efficiencies - void fillHist(std::shared_ptr hist, double binFillThn[], float efficiency, float effUncert, float purity, float purityUncert) - { - float previousContent, previousError2, currentContent, currentError2; - int bin = hist->GetBin(binFillThn); - previousContent = hist->GetBinContent(bin); - previousError2 = hist->GetBinError2(bin); - currentContent = previousContent + purity / (efficiency); - currentError2 = previousError2 + std::pow(purity / (efficiency), 2) + std::pow(purityUncert / (efficiency), 2) + std::pow(effUncert * purity, 2) / std::pow(efficiency, 4); - hist->SetBinContent(bin, currentContent); - hist->SetBinError2(bin, currentError2); - } // applies selections for and fills histograms template @@ -422,15 +440,6 @@ struct StrangeCascTrack { } }(); - float efficiencyOmega = 1.0f; - float efficiencyXi = 1.0f; - float efficiencyOmegaErr = 0.0f; - float efficiencyXiErr = 0.0f; - float purityOmega = 1.0f; - float purityXi = 1.0f; - float purityOmegaErr = 0.0f; - float purityXiErr = 0.0f; - double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); // ion collisions use FT0C for multiplicity, pp uses both // fill multiplicity for events with >=1 cascade @@ -599,7 +608,7 @@ struct StrangeCascTrack { } // apply competing mass rej if (doCompetingMassRej) { - if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > selCuts.cutCompMassRej)) { + if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > cascCuts.cutCompMassRej)) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 4.5); if (fillTruthOmega) histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 4.5); @@ -643,46 +652,49 @@ struct StrangeCascTrack { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/RapidityOmega"), cascade.yOmega()); } } - double binFillXi[3] = {massXi, pt, mult}; if (passedAllSelsXi) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 4.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXi"), massXi); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/Xi")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); // fill for particle-antiparticle type if (cascade.sign() < 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiMinus"), massXi); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/XiMinus")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiMinus"), massXi, pt, mult); } if (cascade.sign() > 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiPlus"), massXi); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/XiPlus")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiPlus"), massXi, pt, mult); } // fill truth if (fillTruthXi) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 4.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassXi"), massXi); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Xi"), massXi, pt, mult); + // + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Xi"), pt, mult, cascade.yXi()); } } - double binFillOmega[3] = {massOmega, pt, mult}; if (passedAllSelsOmega) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 5.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmega"), massOmega); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/Omega")), binFillOmega, efficiencyOmega, efficiencyOmegaErr, purityOmega, purityOmegaErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Omega"), massOmega, pt, mult); // fill for particle-antiparticle type if (cascade.sign() < 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaMinus"), massOmega); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/OmegaMinus")), binFillOmega, efficiencyOmega, efficiencyOmegaErr, purityOmega, purityOmegaErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaMinus"), massOmega, pt, mult); } if (cascade.sign() > 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaPlus"), massOmega); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/OmegaPlus")), binFillOmega, efficiencyOmega, efficiencyOmegaErr, purityOmega, purityOmegaErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaPlus"), massOmega, pt, mult); } // fill truth if (fillTruthOmega) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 5.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassOmega"), massOmega); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Omega"), massOmega, pt, mult); + // + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Omega"), pt, mult, cascade.yOmega()); } } @@ -725,7 +737,7 @@ struct StrangeCascTrack { void init(InitContext const&) { // check if cut configuration is valid - if (selCuts.cutMinCascCosPaVsPt->size() != axesConfig.axisPt.value.size() - 1) { + if (cascCuts.cutMinCascCosPaVsPt->size() != axesConfig.axisPt.value.size() - 1) { LOGF(fatal, "cutMinCascCosPaVsPt size does not match axisPt binning"); } // for all events processing @@ -738,13 +750,16 @@ struct StrangeCascTrack { histos.add("Rec-Events/PVxy", "PV xy position", kTH2D, {{200, -0.1, 0.1}, {200, -0.1, 0.1}}); histos.add("Rec-Events/PVz", "PV z position", kTH1D, {{100, -20, 20}}); histos.add("Rec-Events/Mult", "Multiplicity", kTH1D, {axesConfig.axisMult}); - histos.add("Rec-Events/EvFilter", "Event Filter", kTH1D, {{6, 0, 6}}); + histos.add("Rec-Events/EvFilter", "Event Filter", kTH1D, {{9, 0, 9}}); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(1, "INEL>0"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(2, "PVz cut"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(3, "sel8"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(4, "NoSameBunchPileup"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(5, "IsGoodZvtxFT0VsPV"); - histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(6, "all"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(6, "ITSTPCVertexEventCut"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(7, "NoCollInRofStandardCut"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(8, "TimeRangeStandardCut"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(9, "all"); // for cascade processing static_for<0, 1>([&](auto Type) { // no selections applied @@ -800,18 +815,18 @@ struct StrangeCascTrack { histos.add(Form("%s/Rec/MassXi", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); histos.add(Form("%s/Rec/MassXiMinus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); histos.add(Form("%s/Rec/MassXiPlus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); - histos.add(Form("%s/Rec/Xi", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/XiMinus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/XiPlus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/Xi", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/XiMinus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/XiPlus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); // selected omega histos.add(Form("%s/Rec/FiltersOmega", TypeNames[Type].data()), "main cascade filters for Omega", kTH1D, {{6, 0, 6}}); histos.add(Form("%s/Rec/GenFiltersOmega", TypeNames[Type].data()), "general cascade filters for Omega", kTH1D, {{9, 0, 9}}); histos.add(Form("%s/Rec/MassOmega", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); histos.add(Form("%s/Rec/MassOmegaMinus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); histos.add(Form("%s/Rec/MassOmegaPlus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); - histos.add(Form("%s/Rec/Omega", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/OmegaMinus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/OmegaPlus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/Omega", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/OmegaMinus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/OmegaPlus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); // mc truth for all passed selections // xi and omega truth selection statistics histos.add(Form("%s/Rec-Truth/Filters/PropDCAxy", TypeNames[Type].data()), "DCA to xy (propagated)", kTH1D, {axesConfig.axisDCAxy}); @@ -834,6 +849,9 @@ struct StrangeCascTrack { histos.add(Form("%s/Rec-Truth/GenFiltersOmega", TypeNames[Type].data()), "general cascade filters for Omega", kTH1D, {{9, 0, 9}}); histos.add(Form("%s/Rec-Truth/MassOmega", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); histos.add(Form("%s/Rec-Truth/Omega", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + /// + histos.add(Form("%s/Rec-Truth/RapCheck_TH3_Truth_Xi", TypeNames[Type].data()), "Rapidity check (pt, mult, y)", kTHnD, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); + histos.add(Form("%s/Rec-Truth/RapCheck_TH3_Truth_Omega", TypeNames[Type].data()), "Rapidity check (pt, mult, y)", kTHnD, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); }); // for MC-specific processing // all generated events: @@ -866,6 +884,8 @@ struct StrangeCascTrack { histos.add("MC/EvRec/PrimaryOmegaRapidity", "Omega primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omegas in selected rapidity range in reco>=1 histos.add("MC/EvRec/PrimaryOmegaMinusRapidity", "Omega- primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omega-minus in selected rapidity range in reco>=1 histos.add("MC/EvRec/PrimaryOmegaPlusRapidity", "Omega+ primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omega-plus in selected rapidity range in reco>=1 + histos.add("MC/EvRec/RapCheck_TH3_Gen_Xi", "Xi (primary, y<0.5) from pt, cent, rapidity", kTH3D, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); + histos.add("MC/EvRec/RapCheck_TH3_Gen_Omega", "Omega (primary, y<0.5) from pt, cent, rapidity", kTH3D, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); // label filter statistic bins for standard cascs histos.get(HIST("Standard/Rec/FiltersXi"))->GetXaxis()->SetBinLabel(1, "p_{T}"); histos.get(HIST("Standard/Rec/FiltersXi"))->GetXaxis()->SetBinLabel(2, "gen"); @@ -1003,6 +1023,8 @@ struct StrangeCascTrack { void processDerivedMCGen(soa::Join const& genColls, DerMCGenCascades const& genCascs, DerMCRecCollisions const& recColls) { for (auto const& genColl : genColls) { + if (eventCuts.doINELMCGen && genColl.multMCNParticlesEta10() <= 0) + continue; // skip zero gen mult events histos.fill(HIST("MC/Gen/EvCounter"), 0.5); // generated events statistics double genMult = genColl.multMCNParticlesEta05(); histos.fill(HIST("MC/Gen/Mult"), genMult); @@ -1024,7 +1046,7 @@ struct StrangeCascTrack { if (isValidPDG(casc, "Omega")) histos.fill(HIST("MC/Gen/PrimaryOmega"), genMult, cascPt); // fill generated primary Xi within rapidity for corrections - if (isValidPDG(casc, "Xi") && std::abs(casc.rapidityMC(0)) < selCuts.cutRapidity) { + if (isValidPDG(casc, "Xi") && std::abs(casc.rapidityMC(0)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/Gen/PrimaryXiRapidity"), genMult, cascPt); if (casc.pdgCode() == PDG_t::kXiMinus) histos.fill(HIST("MC/Gen/PrimaryXiMinusRapidity"), genMult, cascPt); @@ -1032,7 +1054,7 @@ struct StrangeCascTrack { histos.fill(HIST("MC/Gen/PrimaryXiPlusRapidity"), genMult, cascPt); } // fill generated primary Omega within rapidity for corrections - if (isValidPDG(casc, "Omega") && std::abs(casc.rapidityMC(2)) < selCuts.cutRapidity) { + if (isValidPDG(casc, "Omega") && std::abs(casc.rapidityMC(2)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/Gen/PrimaryOmegaRapidity"), genMult, cascPt); if (casc.pdgCode() == PDG_t::kOmegaMinus) histos.fill(HIST("MC/Gen/PrimaryOmegaMinusRapidity"), genMult, cascPt); @@ -1078,8 +1100,9 @@ struct StrangeCascTrack { if (casc.isPhysicalPrimary()) { if (isValidPDG(casc, "Xi")) { histos.fill(HIST("MC/EvRec/PrimaryXi"), cascPt, bestCentrality); - if (std::abs(casc.rapidityMC(0)) < selCuts.cutRapidity) { + if (std::abs(casc.rapidityMC(0)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/EvRec/PrimaryXiRapidity"), cascPt, bestCentrality); + histos.fill(HIST("MC/EvRec/RapCheck_TH3_Gen_Xi"), cascPt, bestCentrality, casc.rapidityMC(0)); if (casc.pdgCode() == PDG_t::kXiMinus) histos.fill(HIST("MC/EvRec/PrimaryXiMinusRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kXiPlusBar) @@ -1088,8 +1111,9 @@ struct StrangeCascTrack { } if (isValidPDG(casc, "Omega")) { histos.fill(HIST("MC/EvRec/PrimaryOmega"), cascPt, bestCentrality); - if (std::abs(casc.rapidityMC(2)) < selCuts.cutRapidity) { + if (std::abs(casc.rapidityMC(2)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/EvRec/PrimaryOmegaRapidity"), cascPt, bestCentrality); + histos.fill(HIST("MC/EvRec/RapCheck_TH3_Gen_Omega"), cascPt, bestCentrality, casc.rapidityMC(2)); if (casc.pdgCode() == PDG_t::kOmegaMinus) histos.fill(HIST("MC/EvRec/PrimaryOmegaMinusRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kOmegaPlusBar) From a8d82e94a722d341d89e564e91e026883906ed43 Mon Sep 17 00:00:00 2001 From: aimeric-landou <46970521+aimeric-landou@users.noreply.github.com> Date: Mon, 30 Mar 2026 17:15:51 +0100 Subject: [PATCH 107/282] [PWGJE] jetFinderQA: QcMultCutCheck add histograms (#15578) --- PWGJE/Tasks/jetFinderQA.cxx | 52 ++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 40956d71038..6c5984cb424 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -100,6 +100,8 @@ struct JetFinderQATask { std::vector eventSelectionBits; int trackSelection = -1; + float simPtRef = 10.; + std::vector jetPtBins; std::vector jetPtBinsRhoAreaSub; @@ -406,13 +408,15 @@ struct JetFinderQATask { AxisSpec jetPtAxisRhoAreaSub = {400, -200., 200., "#it{p}_{T} (GeV/#it{c})"}; AxisSpec jetEtaAxis = {nBinsEta, -1.0, 1.0, "#eta"}; + registry.add("h_fakecollisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); + registry.add("h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h2_centrality_collisions", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {centAxis, {4, 0.0, 4.0}}}); - // registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}); + registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}); registry.add("h_collisions_weighted", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}, doSumw2); registry.add("h2_centrality_collisions_weighted", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {centAxis, {4, 0.0, 4.0}}}, doSumw2); - // registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}, doSumw2); + registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}, doSumw2); registry.add("h_collisions_zvertex", "position of collision ;#it{Z} (cm)", {HistType::kTH1F, {{300, -15.0, 15.0}}}, doSumw2); registry.add("h_collisions_ntracks", "N_{tracks};", {HistType::kTH1F, {{10000, 0.0, 10000.0}}}, doSumw2); @@ -430,6 +434,12 @@ struct JetFinderQATask { registry.add("h2_track_pt_track_sigma1overpt", "#sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 10.}, {10000, 0.0, 1.0}}}); registry.add("h2_track_pt_high_track_sigma1overpt", "#sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{90, 10., 100.}, {10000, 0.0, 1.0}}}); + registry.add("h_particle_pdgcode", "particle pdgcode;particle pdgcode;entries", {HistType::kTH1D, {{3000, 0.0, 3000.0}}}); + registry.add("h_particle_genstatuscode", "particle gen status code;particle gen status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); + registry.add("h_particle_hepmcstatuscode", "particle hep mc status code;particle hep mc status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); + registry.add("h_particle_process", "particle process;particle process;entries", {HistType::kTH1D, {{50, 0.0, 50.0}}}); + registry.add("h_particle_producedbygenerator", "particle producedByGenerator status;particle producedByGenerator status;entries", {HistType::kTH1D, {{2, 0.0, 2}}}); + registry.add("h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxis}}, doSumw2); registry.add("h_jet_eta", "jet eta;#eta; counts", {HistType::kTH1F, {jetEtaAxis}}, doSumw2); registry.add("h_jet_phi", "jet phi;#phi; counts", {HistType::kTH1F, {phiAxis}}, doSumw2); @@ -444,6 +454,7 @@ struct JetFinderQATask { } Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); + Filter particleCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta > trackEtaMin && aod::jmcparticle::eta < trackEtaMax); Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) >= centralityMin) && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) < centralityMax)); @@ -1471,17 +1482,13 @@ struct JetFinderQATask { } PROCESS_SWITCH(JetFinderQATask, processOccupancyQA, "occupancy QA on jet derived data", false); - void processQcMultCutCheck(soa::Filtered>::iterator const& collision, + void processQcMultCutCheck(soa::Filtered>::iterator const& collision, + aod::JetMcCollisions const&, soa::Join const& mcdjets, - soa::Filtered> const& tracks) + soa::Filtered> const& tracks, + soa::Filtered const& mcparticles) { - bool fillHistograms = true; - bool isWeighted = true; float eventWeight = collision.weight(); - if (!applyCollisionCuts_multCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { - return; - } - registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); bool hasJetAboveMultCut = false; for (auto const& mcdjet : mcdjets) { @@ -1493,6 +1500,20 @@ struct JetFinderQATask { return; } + bool fillHistograms = true; + bool isWeighted = true; + if (!applyCollisionCuts_multCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { + return; + } + registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); + + if (collision.has_mcCollision()) { // the collision is fake and has no associated mc coll; skip as .mccollision() cannot be called + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), collision.mcCollision().ptHard()); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), collision.mcCollision().ptHard(), eventWeight); + } else { + registry.fill(HIST("h_fakecollisions"), 0.5); + } + registry.fill(HIST("h_collisions_ntracks"), tracks.size(), eventWeight); registry.fill(HIST("h2_centrality_ntracks"), collision.centFT0M(), tracks.size(), eventWeight); registry.fill(HIST("h_collisions_njets"), mcdjets.size(), eventWeight); @@ -1501,6 +1522,9 @@ struct JetFinderQATask { registry.fill(HIST("h2_centrality_rho"), collision.centFT0M(), collision.rho(), eventWeight); for (auto const& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } registry.fill(HIST("h2_centrality_track_pt"), collision.centFT0M(), track.pt(), eventWeight); registry.fill(HIST("h2_centrality_track_eta"), collision.centFT0M(), track.eta(), eventWeight); registry.fill(HIST("h2_track_pt_track_sigma1overpt"), track.pt(), track.sigma1Pt(), eventWeight); @@ -1509,6 +1533,14 @@ struct JetFinderQATask { registry.fill(HIST("h2_track_pt_high_track_sigmapt"), track.pt(), track.sigma1Pt() * track.pt(), eventWeight); } + for (auto const& mcparticle : mcparticles) { + registry.fill(HIST("h_particle_pdgcode"), mcparticle.pdgCode()); + registry.fill(HIST("h_particle_genstatuscode"), mcparticle.getGenStatusCode()); + registry.fill(HIST("h_particle_hepmcstatuscode"), mcparticle.getHepMCStatusCode()); + registry.fill(HIST("h_particle_process"), mcparticle.getProcess()); + registry.fill(HIST("h_particle_producedbygenerator"), mcparticle.producedByGenerator()); + } + for (auto const& mcdjet : mcdjets) { registry.fill(HIST("h_jet_pt"), mcdjet.pt(), eventWeight); registry.fill(HIST("h_jet_eta"), mcdjet.eta(), eventWeight); From 1bf0789949feb440530e13062c20cc410c21c767 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Mon, 30 Mar 2026 18:32:05 +0200 Subject: [PATCH 108/282] [PWGHF] Cut variation script enhancement (#15342) --- PWGHF/D2H/Macros/compute_fraction_cutvar.py | 65 +++++++++++++++------ PWGHF/D2H/Macros/config_cutvar_example.json | 14 +++++ PWGHF/D2H/Macros/cut_variation.py | 13 +++-- 3 files changed, 69 insertions(+), 23 deletions(-) diff --git a/PWGHF/D2H/Macros/compute_fraction_cutvar.py b/PWGHF/D2H/Macros/compute_fraction_cutvar.py index 35f751419fd..0099185472b 100644 --- a/PWGHF/D2H/Macros/compute_fraction_cutvar.py +++ b/PWGHF/D2H/Macros/compute_fraction_cutvar.py @@ -37,8 +37,8 @@ def main(config): infile_rawy = ROOT.TFile.Open(os.path.join(cfg["rawyields"]["inputdir"], filename_rawy)) hist_rawy_name = cfg["rawyields"]["histoname"] hist_rawy.append(infile_rawy.Get(hist_rawy_name)) - if(hist_rawy[-1] is None): - sys.exit(f"Fatal error: Histogram with raw yield \"{hist_rawy_name}\" is absent. Exit.") + if not isinstance(hist_rawy[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with raw yield \"{hist_rawy_name}\" is absent. Exit.\33[0m") hist_rawy[-1].SetDirectory(0) infile_rawy.Close() @@ -47,31 +47,43 @@ def main(config): hist_effnp_name = cfg["efficiencies"]["histonames"]["nonprompt"] hist_effp.append(infile_eff.Get(hist_effp_name)) hist_effnp.append(infile_eff.Get(hist_effnp_name)) - if(hist_effp[-1] is None): - sys.exit(f"Fatal error: Histogram with efficiency for prompt \"{hist_effp_name}\" is absent. Exit.") - if(hist_effnp[-1] is None): - sys.exit(f"Fatal error: Histogram with efficiency for nonprompt \"{hist_effnp}\" is absent. Exit.") + if not isinstance(hist_effp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with efficiency for prompt \"{hist_effp_name}\" is absent. Exit.\33[0m") + if not isinstance(hist_effnp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with efficiency for nonprompt \"{hist_effnp}\" is absent. Exit.\33[0m") hist_effp[-1].SetDirectory(0) hist_effnp[-1].SetDirectory(0) infile_eff.Close() pt_bin_to_process = cfg.get("pt_bin_to_process", -1) if not isinstance(pt_bin_to_process, int): - sys.exit("Fatal error: pt_bin_to_process must be an integer value. Exit.") + sys.exit("\33[31mFatal error: pt_bin_to_process must be an integer value. Exit.") if (pt_bin_to_process != -1 and pt_bin_to_process < 1) or pt_bin_to_process > hist_rawy[0].GetNbinsX(): - sys.exit("Fatal error: pt_bin_to_process must be a positive value up to number of bins in raw yield histogram. Exit.") + sys.exit("\33[31mFatal error: pt_bin_to_process must be a positive value up to number of bins in raw yield histogram. Exit.") + + is_draw_title_rawy = cfg.get("is_draw_title", {}).get("rawy", True) + is_draw_title_eff = cfg.get("is_draw_title", {}).get("eff", False) + is_draw_title_frac = cfg.get("is_draw_title", {}).get("frac", False) + is_draw_title_cov = cfg.get("is_draw_title", {}).get("cov", False) + is_draw_title_unc = cfg.get("is_draw_title", {}).get("unc", True) + + is_save_canvas_as_macro_rawy = cfg.get("is_save_canvas_as_macro", {}).get("rawy", False) + is_save_canvas_as_macro_eff = cfg.get("is_save_canvas_as_macro", {}).get("eff", False) + is_save_canvas_as_macro_frac = cfg.get("is_save_canvas_as_macro", {}).get("frac", False) + is_save_canvas_as_macro_cov = cfg.get("is_save_canvas_as_macro", {}).get("cov", False) + is_save_canvas_as_macro_unc = cfg.get("is_save_canvas_as_macro", {}).get("unc", False) if cfg["central_efficiency"]["computerawfrac"]: infile_name = os.path.join(cfg["central_efficiency"]["inputdir"], cfg["central_efficiency"]["inputfile"]) infile_central_eff = ROOT.TFile.Open(infile_name) hist_central_effp_name = cfg["central_efficiency"]["histonames"]["prompt"] hist_central_effp = infile_central_eff.Get(hist_central_effp_name) - if(hist_central_effp is None): - sys.exit(f"Fatal error: Histogram with central efficiency for prompt \"{hist_central_effp_name}\" is absent. Exit.") + if not isinstance(hist_central_effp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with central efficiency for prompt \"{hist_central_effp_name}\" is absent. Exit.\33[0m") hist_central_effnp_name = cfg["central_efficiency"]["histonames"]["nonprompt"] hist_central_effnp = infile_central_eff.Get(hist_central_effnp_name) - if(hist_central_effnp is None): - sys.exit(f"Fatal error: Histogram with central efficiency for nonprompt \"{hist_central_effnp_name}\" is absent. Exit.") + if not isinstance(hist_central_effnp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with central efficiency for nonprompt \"{hist_central_effnp_name}\" is absent. Exit.\33[0m") hist_central_effp.SetDirectory(0) hist_central_effnp.SetDirectory(0) infile_central_eff.Close() @@ -171,10 +183,10 @@ def main(config): if cfg["minimisation"]["correlated"]: if not (np.all(rawy[1:] > rawy[:-1]) or np.all(rawy[1:] < rawy[:-1])): - print("WARNING! main(): the raw yield vector is not monotonous. Check the input for stability.") + print("\0\33[33mWARNING! main(): the raw yield vector is not monotonous. Check the input for stability.\0\33[0m") print(f"raw yield vector elements = {rawy}\n") if not (np.all(unc_rawy[1:] > unc_rawy[:-1]) or np.all(unc_rawy[1:] < unc_rawy[:-1])): - print("WARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.") + print("\0\33[33mWARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.\0\33[0m") print(f"raw yield uncertainties vector elements = {unc_rawy}\n") minimiser = CutVarMinimiser(rawy, effp, effnp, unc_rawy, unc_effp, unc_effnp) @@ -211,34 +223,49 @@ def main(config): hist_bin_title = f"bin # {ipt+1}; {pt_axis_title}#in ({pt_min}; {pt_max})" - canv_rawy, histos_rawy, leg_r = minimiser.plot_result(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_rawy = hist_bin_title if is_draw_title_rawy else "" + canv_rawy, histos_rawy, leg_r = minimiser.plot_result(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_rawy) output.cd() canv_rawy.Write() for _, hist in histos_rawy.items(): hist.Write() + if (is_save_canvas_as_macro_rawy): + canv_rawy.SaveAs(f"canv_rawy_{ipt+1}.C") - canv_unc, histos_unc, leg_unc = minimiser.plot_uncertainties(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_unc = hist_bin_title if is_draw_title_unc else "" + canv_unc, histos_unc, leg_unc = minimiser.plot_uncertainties(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_unc) output.cd() canv_unc.Write() for _, hist in histos_unc.items(): hist.Write() + if (is_save_canvas_as_macro_unc): + canv_unc.SaveAs(f"canv_unc_{ipt+1}.C") - canv_eff, histos_eff, leg_e = minimiser.plot_efficiencies(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_eff = hist_bin_title if is_draw_title_eff else "" + canv_eff, histos_eff, leg_e = minimiser.plot_efficiencies(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_eff) output.cd() canv_eff.Write() for _, hist in histos_eff.items(): hist.Write() + if (is_save_canvas_as_macro_eff): + canv_eff.SaveAs(f"canv_eff_{ipt+1}.C") - canv_frac, histos_frac, leg_f = minimiser.plot_fractions(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_frac = hist_bin_title if is_draw_title_frac else "" + canv_frac, histos_frac, leg_f = minimiser.plot_fractions(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_frac) output.cd() canv_frac.Write() for _, hist in histos_frac.items(): hist.Write() + if (is_save_canvas_as_macro_frac): + canv_frac.SaveAs(f"canv_frac_{ipt+1}.C") - canv_cov, histo_cov = minimiser.plot_cov_matrix(True, f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_cov = hist_bin_title if is_draw_title_cov else "" + canv_cov, histo_cov = minimiser.plot_cov_matrix(True, f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_cov) output.cd() canv_cov.Write() histo_cov.Write() + if (is_save_canvas_as_macro_cov): + canv_cov.SaveAs(f"canv_cov_{ipt+1}.C") else: print(f"Minimization for pT {pt_min}, {pt_max} not successful") canv_rawy = ROOT.TCanvas("c_rawy_minimization_error", "Minimization error", 500, 500) diff --git a/PWGHF/D2H/Macros/config_cutvar_example.json b/PWGHF/D2H/Macros/config_cutvar_example.json index 20466b37044..e1b768b807d 100644 --- a/PWGHF/D2H/Macros/config_cutvar_example.json +++ b/PWGHF/D2H/Macros/config_cutvar_example.json @@ -57,6 +57,20 @@ "minimisation": { "correlated": true }, + "is_draw_title": { + "rawy": true, + "frac": false, + "eff": false, + "cov": false, + "unc": true + }, + "is_save_canvas_as_macro": { + "rawy": false, + "frac": false, + "eff": false, + "cov": false, + "unc": false + }, "central_efficiency": { "computerawfrac": true, "inputdir": "path/to/central/efficiency", diff --git a/PWGHF/D2H/Macros/cut_variation.py b/PWGHF/D2H/Macros/cut_variation.py index 3d862589836..f9b49f15710 100644 --- a/PWGHF/D2H/Macros/cut_variation.py +++ b/PWGHF/D2H/Macros/cut_variation.py @@ -79,15 +79,15 @@ def __check_input_consistency(self): """ if len(self.eff_prompt) != self.n_sets or len(self.eff_nonprompt) != self.n_sets: - print("ERROR: number of raw yields and efficiencies not consistent! Exit") + print("33[31mERROR: number of raw yields and efficiencies not consistent! Exit\033[0m") sys.exit() if len(self.unc_raw_yields) != self.n_sets: - print("ERROR: number of raw yields and raw-yield uncertainties not consistent! Exit") + print("33[31mERROR: number of raw yields and raw-yield uncertainties not consistent! Exit\033[0m") sys.exit() if len(self.unc_eff_prompt) != self.n_sets or len(self.unc_eff_nonprompt) != self.n_sets: - print("ERROR: number of raw yields and efficiency uncertainties not consistent! Exit") + print("33[31mERROR: number of raw yields and efficiency uncertainties not consistent! Exit\033[0m") sys.exit() def __initialise_objects(self): @@ -199,7 +199,7 @@ def minimise_system(self, correlated=True, precision=1.0e-8, max_iterations=100) if correlated: m_cov_sets_diag = np.diag(self.m_cov_sets) if not (np.all(m_cov_sets_diag[1:] > m_cov_sets_diag[:-1]) or np.all(m_cov_sets_diag[1:] < m_cov_sets_diag[:-1])): - print("WARNING! minimise_system(): the residual vector uncertainties elements are not monotonous. Check the input for stability.") + print("\033[33mWARNING! minimise_system(): the residual vector uncertainties elements are not monotonous. Check the input for stability.\033[0m") print(f"residual vector uncertainties elements = {np.sqrt(m_cov_sets_diag)}\n") # chi2 @@ -484,6 +484,7 @@ def plot_result(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.16, padbottommargin=0.12, padtopmargin=0.075, titleoffsety=1.6) @@ -604,6 +605,7 @@ def plot_cov_matrix(self, correlated=True, suffix="", title=""): - hist_corr_matrix: ROOT.TH2F histogram of correlation matrix """ + suffix = suffix.replace(".", "_") set_global_style( padleftmargin=0.14, @@ -667,6 +669,7 @@ def plot_efficiencies(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.14, padbottommargin=0.12, titleoffset=1.2, padtopmargin = 0.075) @@ -758,6 +761,7 @@ def plot_fractions(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.14, padbottommargin=0.12, titleoffset=1.2, padtopmargin = 0.075) @@ -844,6 +848,7 @@ def plot_uncertainties(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.16, padbottommargin=0.12, padtopmargin=0.075, titleoffsety=1.6) From d219424da688119771b3cfee0a488561540b90c5 Mon Sep 17 00:00:00 2001 From: ariedel-cern <85537041+ariedel-cern@users.noreply.github.com> Date: Mon, 30 Mar 2026 18:51:44 +0200 Subject: [PATCH 109/282] [PWGCF] Update femto framework (#15579) --- PWGCF/Femto/Core/baseSelection.h | 6 ++- PWGCF/Femto/Core/cascadeBuilder.h | 10 ++-- PWGCF/Femto/Core/cascadeHistManager.h | 13 +++-- PWGCF/Femto/Core/closePairRejection.h | 14 ++++-- PWGCF/Femto/Core/closeTripletRejection.h | 4 +- PWGCF/Femto/Core/collisionBuilder.h | 18 +++---- PWGCF/Femto/Core/collisionHistManager.h | 8 +-- PWGCF/Femto/Core/femtoUtils.h | 26 +++++----- PWGCF/Femto/Core/histManager.h | 2 +- PWGCF/Femto/Core/kinkBuilder.h | 12 ++--- PWGCF/Femto/Core/kinkHistManager.h | 13 +++-- PWGCF/Femto/Core/mcBuilder.h | 7 +-- PWGCF/Femto/Core/modes.h | 14 ------ PWGCF/Femto/Core/pairBuilder.h | 7 ++- PWGCF/Femto/Core/pairCleaner.h | 2 +- PWGCF/Femto/Core/pairHistManager.h | 45 ++++++----------- PWGCF/Femto/Core/pairProcessHelpers.h | 4 +- PWGCF/Femto/Core/particleCleaner.h | 2 +- PWGCF/Femto/Core/partitions.h | 6 +++ PWGCF/Femto/Core/selectionContainer.h | 8 +-- PWGCF/Femto/Core/trackBuilder.h | 24 ++++++--- PWGCF/Femto/Core/trackHistManager.h | 28 ++++++++--- PWGCF/Femto/Core/tripletBuilder.h | 9 ++-- PWGCF/Femto/Core/tripletCleaner.h | 2 +- PWGCF/Femto/Core/tripletHistManager.h | 24 ++++----- PWGCF/Femto/Core/tripletProcessHelpers.h | 4 +- PWGCF/Femto/Core/twoTrackResonanceBuilder.h | 19 +++---- .../Femto/Core/twoTrackResonanceHistManager.h | 12 +++-- PWGCF/Femto/Core/v0Builder.h | 10 ++-- PWGCF/Femto/Core/v0HistManager.h | 13 +++-- PWGCF/Femto/DataModel/FemtoTables.h | 32 ++++++------ PWGCF/Femto/TableProducer/femtoProducer.cxx | 37 +++++++------- .../femtoProducerDerivedToDerived.cxx | 14 +++--- .../femtoProducerKinkPtConverter.cxx | 19 +++++-- PWGCF/Femto/Tasks/femtoCascadeQa.cxx | 21 ++++---- PWGCF/Femto/Tasks/femtoKinkQa.cxx | 21 ++++---- PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx | 21 ++++---- PWGCF/Femto/Tasks/femtoPairTrackKink.cxx | 21 ++++---- PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx | 50 +++++++++++++------ .../Tasks/femtoPairTrackTwoTrackResonance.cxx | 20 ++++---- PWGCF/Femto/Tasks/femtoPairTrackV0.cxx | 21 ++++---- PWGCF/Femto/Tasks/femtoPairV0V0.cxx | 21 ++++---- PWGCF/Femto/Tasks/femtoTrackQa.cxx | 20 ++++---- .../Tasks/femtoTripletTrackTrackTrack.cxx | 22 ++++---- .../Femto/Tasks/femtoTripletTrackTrackV0.cxx | 23 +++++---- .../Femto/Tasks/femtoTwotrackresonanceQa.cxx | 23 ++++----- PWGCF/Femto/Tasks/femtoV0Qa.cxx | 21 ++++---- 47 files changed, 425 insertions(+), 348 deletions(-) diff --git a/PWGCF/Femto/Core/baseSelection.h b/PWGCF/Femto/Core/baseSelection.h index fcce0c11c13..5bc9a598c1f 100644 --- a/PWGCF/Femto/Core/baseSelection.h +++ b/PWGCF/Femto/Core/baseSelection.h @@ -18,9 +18,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include -#include "fairlogger/Logger.h" +#include #include #include diff --git a/PWGCF/Femto/Core/cascadeBuilder.h b/PWGCF/Femto/Core/cascadeBuilder.h index f787543f945..2de7099ee6f 100644 --- a/PWGCF/Femto/Core/cascadeBuilder.h +++ b/PWGCF/Femto/Core/cascadeBuilder.h @@ -23,11 +23,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/cascadeHistManager.h b/PWGCF/Femto/Core/cascadeHistManager.h index 3944dcd761a..d1218ec4e8e 100644 --- a/PWGCF/Femto/Core/cascadeHistManager.h +++ b/PWGCF/Femto/Core/cascadeHistManager.h @@ -20,12 +20,17 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include + +#include +#include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/closePairRejection.h b/PWGCF/Femto/Core/closePairRejection.h index 63a707f9ad8..3edc198aba9 100644 --- a/PWGCF/Femto/Core/closePairRejection.h +++ b/PWGCF/Femto/Core/closePairRejection.h @@ -16,20 +16,24 @@ #ifndef PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ #define PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ -#include "RecoDecay.h" - #include "PWGCF/Femto/Core/histManager.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include + +#include +#include +#include +#include +#include #include #include #include #include +#include #include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/closeTripletRejection.h b/PWGCF/Femto/Core/closeTripletRejection.h index 5bb006e04ab..dd1bd0182c0 100644 --- a/PWGCF/Femto/Core/closeTripletRejection.h +++ b/PWGCF/Femto/Core/closeTripletRejection.h @@ -18,8 +18,8 @@ #include "PWGCF/Femto/Core/closePairRejection.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include #include #include diff --git a/PWGCF/Femto/Core/collisionBuilder.h b/PWGCF/Femto/Core/collisionBuilder.h index 2d0aa6b532d..e6b77102023 100644 --- a/PWGCF/Femto/Core/collisionBuilder.h +++ b/PWGCF/Femto/Core/collisionBuilder.h @@ -23,15 +23,15 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/Zorro.h" - -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include + +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/collisionHistManager.h b/PWGCF/Femto/Core/collisionHistManager.h index 5233c4799e0..a4bbda81b6f 100644 --- a/PWGCF/Femto/Core/collisionHistManager.h +++ b/PWGCF/Femto/Core/collisionHistManager.h @@ -19,11 +19,13 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include #include +#include +#include #include #include #include diff --git a/PWGCF/Femto/Core/femtoUtils.h b/PWGCF/Femto/Core/femtoUtils.h index 26e7649776d..000850f3be9 100644 --- a/PWGCF/Femto/Core/femtoUtils.h +++ b/PWGCF/Femto/Core/femtoUtils.h @@ -16,22 +16,19 @@ #ifndef PWGCF_FEMTO_CORE_FEMTOUTILS_H_ #define PWGCF_FEMTO_CORE_FEMTOUTILS_H_ -#include "Common/Core/TableHelper.h" +#include -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/InitContext.h" +#include +#include +#include -#include "TPDGCode.h" - -#include "fairlogger/Logger.h" +#include #include +#include #include -#include #include #include -#include namespace o2::analysis::femto { @@ -209,11 +206,16 @@ inline bool enableTable(const char* tableName, int userSetting, o2::framework::I return required; } -template -using HasMass = decltype(std::declval().mass()); +// template +// using HasMass = decltype(std::declval().mass()); +// +// template +// using HasSign = decltype(std::declval().sign()); template -using HasSign = decltype(std::declval().sign()); +concept HasMass = requires(T t) { + { t.mass() } -> std::convertible_to; // or double, whatever mass() returns +}; template inline int signum(T x) diff --git a/PWGCF/Femto/Core/histManager.h b/PWGCF/Femto/Core/histManager.h index 19b1b0ce502..ceadf18f38a 100644 --- a/PWGCF/Femto/Core/histManager.h +++ b/PWGCF/Femto/Core/histManager.h @@ -16,7 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_HISTMANAGER_H_ #define PWGCF_FEMTO_CORE_HISTMANAGER_H_ -#include "Framework/HistogramSpec.h" +#include #include #include diff --git a/PWGCF/Femto/Core/kinkBuilder.h b/PWGCF/Femto/Core/kinkBuilder.h index acf74690337..728197f049f 100644 --- a/PWGCF/Femto/Core/kinkBuilder.h +++ b/PWGCF/Femto/Core/kinkBuilder.h @@ -24,13 +24,13 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Common/Core/RecoDecay.h" +#include -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/kinkHistManager.h b/PWGCF/Femto/Core/kinkHistManager.h index f6c672c3200..b3f27e3f4e0 100644 --- a/PWGCF/Femto/Core/kinkHistManager.h +++ b/PWGCF/Femto/Core/kinkHistManager.h @@ -21,12 +21,17 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include + +#include +#include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/mcBuilder.h b/PWGCF/Femto/Core/mcBuilder.h index 038ad432df8..30f6210c027 100644 --- a/PWGCF/Femto/Core/mcBuilder.h +++ b/PWGCF/Femto/Core/mcBuilder.h @@ -21,10 +21,11 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" +#include +#include +#include -#include "fairlogger/Logger.h" +#include #include #include diff --git a/PWGCF/Femto/Core/modes.h b/PWGCF/Femto/Core/modes.h index bf337fab232..45c0db54f63 100644 --- a/PWGCF/Femto/Core/modes.h +++ b/PWGCF/Femto/Core/modes.h @@ -118,20 +118,6 @@ constexpr const char* mcOriginToString(McOrigin origin) } } -constexpr bool - hasMass(Particle p) -{ - switch (p) { - case Particle::kV0: - case Particle::kTwoTrackResonance: - case Particle::kKink: - case Particle::kCascade: - return true; - default: - return false; - } -} - enum class Track : o2::aod::femtodatatypes::TrackType { kTrack, kV0Daughter, diff --git a/PWGCF/Femto/Core/pairBuilder.h b/PWGCF/Femto/Core/pairBuilder.h index 34c360f4943..0a44ba639fc 100644 --- a/PWGCF/Femto/Core/pairBuilder.h +++ b/PWGCF/Femto/Core/pairBuilder.h @@ -30,10 +30,9 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" - -#include "fairlogger/Logger.h" +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/pairCleaner.h b/PWGCF/Femto/Core/pairCleaner.h index 506a9dbc9a4..0d66be6721f 100644 --- a/PWGCF/Femto/Core/pairCleaner.h +++ b/PWGCF/Femto/Core/pairCleaner.h @@ -18,7 +18,7 @@ #include "PWGCF/Femto/Core/modes.h" -#include "fairlogger/Logger.h" +#include namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/pairHistManager.h b/PWGCF/Femto/Core/pairHistManager.h index 30c0916b67e..c0695ef3614 100644 --- a/PWGCF/Femto/Core/pairHistManager.h +++ b/PWGCF/Femto/Core/pairHistManager.h @@ -20,12 +20,14 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include #include #include @@ -126,8 +128,8 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis centrality{"centrality", {{10, 0, 100}}, "centrality (mult. percentile)"}; o2::framework::ConfigurableAxis pt1{"pt1", {{100, 0, 6}}, "Pt binning for particle 1"}; o2::framework::ConfigurableAxis pt2{"pt2", {{100, 0, 6}}, "Pt binning for particle 2"}; - o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter)"}; - o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter)"}; + o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter, otherwise PDG mass)"}; o2::framework::Configurable transverseMassType{"transverseMassType", static_cast(modes::TransverseMassType::kAveragePdgMass), "Type of transverse mass (0-> Average Pdg Mass, 1-> Reduced Pdg Mass, 2-> Mt from combined 4 vector)"}; }; @@ -353,11 +355,11 @@ class PairHistManager // if one of the particles has a mass getter (like lambda), we cache the value for the filling later // otherwise we continue to use the pdg mass mMass1 = mPdgMass1; - if constexpr (modes::hasMass(particleType1)) { + if constexpr (utils::HasMass) { mMass1 = particle1.mass(); } mMass2 = mPdgMass2; - if constexpr (modes::hasMass(particleType2)) { + if constexpr (utils::HasMass) { mMass2 = particle2.mass(); } } @@ -478,17 +480,9 @@ class PairHistManager mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMt, HistTable), getHistDesc(kKstarVsMt, HistTable), getHistType(kKstarVsMt, HistTable), {Specs.at(kKstarVsMt)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMult, HistTable), getHistDesc(kKstarVsMult, HistTable), getHistType(kKstarVsMult, HistTable), {Specs.at(kKstarVsMult)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsCent, HistTable), getHistDesc(kKstarVsCent, HistTable), getHistType(kKstarVsCent, HistTable), {Specs.at(kKstarVsCent)}); - - // special care for mass plots since not all particles have "mass" - if constexpr (modes::hasMass(particleType1)) { - mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass1, HistTable), getHistDesc(kKstarVsMass1, HistTable), getHistType(kKstarVsMass1, HistTable), {Specs.at(kKstarVsMass1)}); - } - if constexpr (modes::hasMass(particleType2)) { - mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass2, HistTable), getHistDesc(kKstarVsMass2, HistTable), getHistType(kKstarVsMass2, HistTable), {Specs.at(kKstarVsMass2)}); - } - if constexpr (modes::hasMass(particleType1) && modes::hasMass(particleType2)) { - mHistogramRegistry->add(analysisDir + getHistNameV2(kMass1VsMass2, HistTable), getHistDesc(kMass1VsMass2, HistTable), getHistType(kMass1VsMass2, HistTable), {Specs.at(kMass1VsMass2)}); - } + mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass1, HistTable), getHistDesc(kKstarVsMass1, HistTable), getHistType(kKstarVsMass1, HistTable), {Specs.at(kKstarVsMass1)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass2, HistTable), getHistDesc(kKstarVsMass2, HistTable), getHistType(kKstarVsMass2, HistTable), {Specs.at(kKstarVsMass2)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kMass1VsMass2, HistTable), getHistDesc(kMass1VsMass2, HistTable), getHistType(kMass1VsMass2, HistTable), {Specs.at(kMass1VsMass2)}); } // higher dimensional histograms @@ -559,16 +553,9 @@ class PairHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMult, HistTable)), mKstar, mMult); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsCent, HistTable)), mKstar, mCent); - // // special care for mass plots since not all particles have "mass" - if constexpr (modes::hasMass(particleType1)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass1, HistTable)), mKstar, mMass1); - } - if constexpr (modes::hasMass(particleType2)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass2, HistTable)), mKstar, mMass2); - } - if constexpr (modes::hasMass(particleType1) && modes::hasMass(particleType2)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass1VsMass2, HistTable)), mMass1, mMass2); - } + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass1, HistTable)), mKstar, mMass1); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass2, HistTable)), mKstar, mMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass1VsMass2, HistTable)), mMass1, mMass2); } // n-D histograms are only filled if enabled diff --git a/PWGCF/Femto/Core/pairProcessHelpers.h b/PWGCF/Femto/Core/pairProcessHelpers.h index 8a70283e9c6..50d00196341 100644 --- a/PWGCF/Femto/Core/pairProcessHelpers.h +++ b/PWGCF/Femto/Core/pairProcessHelpers.h @@ -19,7 +19,9 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoAHelpers.h" +#include + +#include namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index 8c158198192..045f3dea785 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -16,7 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ #define PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ -#include "Framework/Configurable.h" +#include #include #include diff --git a/PWGCF/Femto/Core/partitions.h b/PWGCF/Femto/Core/partitions.h index ae2ee46a3f9..52f2d7bb135 100644 --- a/PWGCF/Femto/Core/partitions.h +++ b/PWGCF/Femto/Core/partitions.h @@ -44,6 +44,12 @@ ncheckbit(o2::aod::femtotracks::mask, selection.maskHighMomentum) && \ (o2::aod::femtotracks::mask & selection.rejectionMaskHighMomentum) == static_cast(0)) +// track partition with optional mass cut +#define MAKE_TRACK_PARTITION_WITH_MASS(selection) \ + MAKE_TRACK_PARTITION(selection) && \ + (o2::aod::femtobase::stored::mass > selection.massMin) && \ + (o2::aod::femtobase::stored::mass < selection.massMax) + // partition for phis and rhos, i.e. resonance that are their own antiparticle #define MAKE_RESONANCE_0_PARTITON(selection) \ (o2::aod::femtobase::stored::pt > selection.ptMin) && \ diff --git a/PWGCF/Femto/Core/selectionContainer.h b/PWGCF/Femto/Core/selectionContainer.h index d67819b6f8d..fe5616f8302 100644 --- a/PWGCF/Femto/Core/selectionContainer.h +++ b/PWGCF/Femto/Core/selectionContainer.h @@ -16,11 +16,10 @@ #ifndef PWGCF_FEMTO_CORE_SELECTIONCONTAINER_H_ #define PWGCF_FEMTO_CORE_SELECTIONCONTAINER_H_ -#include "CommonConstants/MathConstants.h" +#include +#include -#include "TF1.h" - -#include "fairlogger/Logger.h" +#include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/trackBuilder.h b/PWGCF/Femto/Core/trackBuilder.h index ffb5df80c37..7971c7fe34e 100644 --- a/PWGCF/Femto/Core/trackBuilder.h +++ b/PWGCF/Femto/Core/trackBuilder.h @@ -23,11 +23,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include @@ -143,6 +143,8 @@ struct ConfTrackSelection : public o2::framework::ConfigurableGroup { o2::framework::Configurable etaMax{"etaMax", 0.9f, "Maximum eta"}; o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; + o2::framework::Configurable massMin{"massMin", 0.f, "Minimum TOF mass (only used if enabled)"}; + o2::framework::Configurable massMax{"massMax", 2.f, "Maximum TOF mass (only used if enabled)"}; // track selection masks o2::framework::Configurable maskLowMomentum{"maskLowMomentum", 1ul, "Bitmask for selections below momentum threshold"}; o2::framework::Configurable maskHighMomentum{"maskHighMomentum", 2ul, "Bitmask for selections above momentum threshold"}; @@ -460,6 +462,7 @@ class TrackSelection : public BaseSelection producedTracks; + o2::framework::Produces producedTrackMass; o2::framework::Produces producedTrackMasks; o2::framework::Produces producedTrackDcas; o2::framework::Produces producedTrackExtras; @@ -476,6 +479,7 @@ struct ConfTrackTables : o2::framework::ConfigurableGroup { std::string prefix = std::string("TrackTables"); o2::framework::Configurable produceTracks{"produceTracks", -1, "Produce Tracks (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceTrackMasks{"produceTrackMasks", -1, "Produce TrackMasks (-1: auto; 0 off; 1 on)"}; + o2::framework::Configurable produceTrackMass{"produceTrackMass", -1, "Produce TrackMass (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceTrackDcas{"produceTrackDcas", -1, "Produce TrackDcas (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceTrackExtras{"produceTrackExtras", -1, "Produce TrackExtras (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceElectronPids{"produceElectronPids", -1, "Produce ElectronPids (-1: auto; 0 off; 1 on)"}; @@ -501,6 +505,7 @@ class TrackBuilder mProduceTracks = utils::enableTable("FTracks_001", table.produceTracks.value, initContext); mProduceTrackMasks = utils::enableTable("FTrackMasks_001", table.produceTrackMasks.value, initContext); + mProduceTrackMass = utils::enableTable("FTrackMass_001", table.produceTrackMass.value, initContext); mProduceTrackDcas = utils::enableTable("FTrackDcas_001", table.produceTrackDcas.value, initContext); mProduceTrackExtras = utils::enableTable("FTrackExtras_001", table.produceTrackExtras.value, initContext); mProduceElectronPids = utils::enableTable("FElectronPids_001", table.produceElectronPids.value, initContext); @@ -511,7 +516,7 @@ class TrackBuilder mProduceTritonPids = utils::enableTable("FTritonPids_001", table.produceTritonPids.value, initContext); mProduceHeliumPids = utils::enableTable("FHeliumPids_001", table.produceHeliumPids.value, initContext); - if (mProduceTracks || mProduceTrackMasks || mProduceTrackDcas || mProduceTrackExtras || mProduceElectronPids || mProducePionPids || mProduceKaonPids || mProduceProtonPids || mProduceDeuteronPids || mProduceTritonPids || mProduceHeliumPids) { + if (mProduceTracks || mProduceTrackMasks || mProduceTrackMass || mProduceTrackDcas || mProduceTrackExtras || mProduceElectronPids || mProducePionPids || mProduceKaonPids || mProduceProtonPids || mProduceDeuteronPids || mProduceTritonPids || mProduceHeliumPids) { mFillAnyTable = true; } else { LOG(info) << "No tables configured, Selection object will not be configured..."; @@ -560,6 +565,9 @@ class TrackBuilder trackProducts.producedTrackMasks(static_cast(0u)); } } + if (mProduceTrackMass) { + trackProducts.producedTrackMass(track.mass()); + } if (mProduceTrackDcas) { trackProducts.producedTrackDcas(track.dcaXY(), track.dcaZ()); } @@ -574,8 +582,7 @@ class TrackBuilder track.tpcNClsFound(), track.tpcNClsCrossedRows(), track.tpcNClsShared(), - track.beta(), - track.mass()); + track.beta()); } if (mProduceElectronPids) { trackProducts.producedElectronPids(track.itsNSigmaEl(), track.tpcNSigmaEl(), track.tofNSigmaEl()); @@ -670,6 +677,7 @@ class TrackBuilder bool mFillAnyTable = false; bool mProduceTracks = false; bool mProduceTrackMasks = false; + bool mProduceTrackMass = false; bool mProduceTrackDcas = false; bool mProduceTrackExtras = false; bool mProduceElectronPids = false; diff --git a/PWGCF/Femto/Core/trackHistManager.h b/PWGCF/Femto/Core/trackHistManager.h index a0eb858e07a..12f69af380b 100644 --- a/PWGCF/Femto/Core/trackHistManager.h +++ b/PWGCF/Femto/Core/trackHistManager.h @@ -20,14 +20,16 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include -#include "TH1.h" +#include #include +#include #include #include #include @@ -45,6 +47,7 @@ enum TrackHist { kEta, kPhi, kSign, + kMass, // qa variables kPAtPv, kPTpc, @@ -145,6 +148,7 @@ struct ConfTrackBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; + o2::framework::ConfigurableAxis mass{"mass", {{200, 0.f, 2.f}}, "Mass (if enabled, plot TOF mass, otherwise PDG mass)"}; o2::framework::ConfigurableAxis pdgCodes{"pdgCodes", {{8001, -4000.5, 4000.5}}, "MC ONLY: PDG codes of selected tracks"}; }; @@ -268,7 +272,8 @@ constexpr std::array, kTrackHistLast> {kPt, o2::framework::kTH1F, "hPt", "Transverse Momentum; p_{T} (GeV/#it{c}); Entries"}, {kEta, o2::framework::kTH1F, "hEta", "Pseudorapidity; #eta; Entries"}, {kPhi, o2::framework::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"}, - {kSign, o2::framework::kTH1F, "hSign", "Sign of charge ; Sign; Entries"}, + {kSign, o2::framework::kTH1F, "hSign", "Sign of charge; Sign; Entries"}, + {kMass, o2::framework::kTH1F, "hMass", "Mass; m (GeV/#it{c}^{2}); Entries"}, {kPAtPv, o2::framework::kTH1F, "hPAtPv", "Momentum at Primary vertex; p_{vertex}; Entries"}, {kPTpc, o2::framework::kTH1F, "hPTpc", "Momentum at inner wall of TPC; p_{TPC}; Entries"}, {kItsCluster, o2::framework::kTH1F, "hItsCluster", "ITS cluster; ITS cluster; Entries"}, @@ -353,7 +358,8 @@ constexpr std::array, kTrackHistLast> {kPt, {conf.pt}}, \ {kEta, {conf.eta}}, \ {kPhi, {conf.phi}}, \ - {kSign, {conf.sign}}, + {kSign, {conf.sign}}, \ + {kMass, {conf.mass}}, #define TRACK_HIST_QA_MAP(confAnalysis, confQa) \ {kPAtPv, {confQa.p}}, \ @@ -637,6 +643,7 @@ class TrackHistManager mHistogramRegistry->add(analysisDir + getHistNameV2(kEta, HistTable), getHistDesc(kEta, HistTable), getHistType(kEta, HistTable), {Specs.at(kEta)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {Specs.at(kPhi)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {Specs.at(kSign)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {Specs.at(kMass)}); } void initQa(std::map> const& Specs) @@ -784,6 +791,11 @@ class TrackHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kEta, HistTable)), track.eta()); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), track.phi()); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), track.sign()); + if constexpr (utils::HasMass) { + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), track.mass()); + } else { + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), utils::getMass(mPdgCode)); + } } template @@ -831,7 +843,7 @@ class TrackHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kItsSignal, HistTable)), momentum, o2::analysis::femto::utils::itsSignal(track)); mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTpcSignal, HistTable)), momentum, track.tpcSignal()); mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofBeta, HistTable)), momentum, track.tofBeta()); - mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofMass, HistTable)), momentum, track.tofMass()); + mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofMass, HistTable)), momentum, track.mass()); if (mPlotElectronPid) { mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kItsElectron, HistTable)), momentum, track.itsNSigmaEl()); diff --git a/PWGCF/Femto/Core/tripletBuilder.h b/PWGCF/Femto/Core/tripletBuilder.h index 26b618441f9..1857f6a3996 100644 --- a/PWGCF/Femto/Core/tripletBuilder.h +++ b/PWGCF/Femto/Core/tripletBuilder.h @@ -19,16 +19,17 @@ #include "PWGCF/Femto/Core/closeTripletRejection.h" #include "PWGCF/Femto/Core/collisionHistManager.h" #include "PWGCF/Femto/Core/modes.h" +#include "PWGCF/Femto/Core/pairHistManager.h" #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/Core/tripletCleaner.h" #include "PWGCF/Femto/Core/tripletHistManager.h" #include "PWGCF/Femto/Core/tripletProcessHelpers.h" +#include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" - -#include "fairlogger/Logger.h" +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/tripletCleaner.h b/PWGCF/Femto/Core/tripletCleaner.h index 690c9d526b7..d6f38c78709 100644 --- a/PWGCF/Femto/Core/tripletCleaner.h +++ b/PWGCF/Femto/Core/tripletCleaner.h @@ -16,7 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_TRIPLETCLEANER_H_ #define PWGCF_FEMTO_CORE_TRIPLETCLEANER_H_ -#include "PWGCF/Femto/Core/pairBuilder.h" +#include "PWGCF/Femto/Core/pairCleaner.h" namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/tripletHistManager.h b/PWGCF/Femto/Core/tripletHistManager.h index 1af18cd8783..8eca807c5aa 100644 --- a/PWGCF/Femto/Core/tripletHistManager.h +++ b/PWGCF/Femto/Core/tripletHistManager.h @@ -20,14 +20,14 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include -#include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include -#include #include #include #include @@ -109,9 +109,9 @@ struct ConfTripletBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis pt1{"pt1", {{100, 0, 6}}, "Pt binning for particle 1"}; o2::framework::ConfigurableAxis pt2{"pt2", {{100, 0, 6}}, "Pt binning for particle 2"}; o2::framework::ConfigurableAxis pt3{"pt3", {{100, 0, 6}}, "Pt binning for particle 3"}; - o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter)"}; - o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter)"}; - o2::framework::ConfigurableAxis mass3{"mass3", {{100, 0, 2}}, "Mass binning for particle 3 (if particle has mass getter)"}; + o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis mass3{"mass3", {{100, 0, 2}}, "Mass binning for particle 3 (if particle has mass getter, otherwise PDG mass)"}; o2::framework::Configurable transverseMassType{"transverseMassType", static_cast(modes::TransverseMassType::kAveragePdgMass), "Type of transverse mass (0-> Average Pdg Mass, 1-> Reduced Pdg Mass, 2-> Mt from combined 4 vector)"}; }; @@ -279,13 +279,13 @@ class TripletHistManager mQ3 = getQ3(mParticle1, mParticle2, mParticle3); // if one of the particles has a mass getter, we cache the value for the filling later - if constexpr (modes::hasMass(particleType1)) { + if constexpr (utils::HasMass) { mMass1 = particle1.mass(); } - if constexpr (modes::hasMass(particleType2)) { + if constexpr (utils::HasMass) { mMass2 = particle2.mass(); } - if constexpr (modes::hasMass(particleType3)) { + if constexpr (utils::HasMass) { mMass3 = particle3.mass(); } } diff --git a/PWGCF/Femto/Core/tripletProcessHelpers.h b/PWGCF/Femto/Core/tripletProcessHelpers.h index fc52c62da0e..75538ae024d 100644 --- a/PWGCF/Femto/Core/tripletProcessHelpers.h +++ b/PWGCF/Femto/Core/tripletProcessHelpers.h @@ -19,7 +19,9 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoAHelpers.h" +#include + +#include namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h index 9183527b890..3a5aca2c5e6 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h +++ b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h @@ -16,8 +16,6 @@ #ifndef PWGCF_FEMTO_CORE_TWOTRACKRESONANCEBUILDER_H_ #define PWGCF_FEMTO_CORE_TWOTRACKRESONANCEBUILDER_H_ -#include "RecoDecay.h" - #include "PWGCF/Femto/Core/baseSelection.h" #include "PWGCF/Femto/Core/dataTypes.h" #include "PWGCF/Femto/Core/femtoUtils.h" @@ -25,15 +23,18 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" +#include -#include +#include +#include +#include +#include +#include +#include +#include -#include "fairlogger/Logger.h" +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include #include #include diff --git a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h index 7de7d7c3c04..de5317ff34c 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h +++ b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h @@ -20,10 +20,14 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include +#include + +#include #include #include diff --git a/PWGCF/Femto/Core/v0Builder.h b/PWGCF/Femto/Core/v0Builder.h index 16de0ea04cc..91465cb99ab 100644 --- a/PWGCF/Femto/Core/v0Builder.h +++ b/PWGCF/Femto/Core/v0Builder.h @@ -23,11 +23,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/v0HistManager.h b/PWGCF/Femto/Core/v0HistManager.h index 1fd7eba0b5c..b6cb832579f 100644 --- a/PWGCF/Femto/Core/v0HistManager.h +++ b/PWGCF/Femto/Core/v0HistManager.h @@ -20,12 +20,17 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include + +#include +#include #include +#include #include #include #include diff --git a/PWGCF/Femto/DataModel/FemtoTables.h b/PWGCF/Femto/DataModel/FemtoTables.h index 4c890bdb4e6..080e014ba30 100644 --- a/PWGCF/Femto/DataModel/FemtoTables.h +++ b/PWGCF/Femto/DataModel/FemtoTables.h @@ -18,13 +18,13 @@ #include "PWGCF/Femto/Core/dataTypes.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/Expressions.h" +#include +#include +#include #include #include @@ -58,7 +58,7 @@ using FCol = FCols::iterator; using StoredFCols = StoredFCols_001; // table for collisions selections -DECLARE_SOA_TABLE_STAGED_VERSIONED(FColMasks_001, "FCOLMASK", 1, //! track masks +DECLARE_SOA_TABLE_STAGED_VERSIONED(FColMasks_001, "FCOLMASK", 1, //! collision masks femtocollisions::Mask); using FColMasks = FColMasks_001; using StoredFColMasks = StoredFColMasks_001; @@ -106,7 +106,6 @@ DECLARE_SOA_COLUMN(Pt, pt, float); //! pt DECLARE_SOA_COLUMN(Eta, eta, float); //! eta DECLARE_SOA_COLUMN(Phi, phi, float); //! phi DECLARE_SOA_COLUMN(Mass, mass, float); //! mass of particle -DECLARE_SOA_COLUMN(MassAnti, massAnti, float); //! mass of antiparticle } // namespace stored namespace dynamic @@ -175,7 +174,7 @@ DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //! Tpc chi2 // tof related information DECLARE_SOA_COLUMN(TofBeta, tofBeta, float); //! Tof beta -DECLARE_SOA_COLUMN(TofMass, tofMass, float); //! Tof mass +// tof mass will be stored in mass column // PID information // ITS PID information @@ -247,6 +246,11 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackMasks_001, "FTRACKMASK", 1, //! track m using FTrackMasks = FTrackMasks_001; using StoredFTrackMasks = StoredFTrackMasks_001; +// table for track mass (using tof mass +DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackMass_001, "FTRACKMASS", 1, //! track mass + femtobase::stored::Mass); +using FTrackMass = FTrackMass_001; + // table for track DCA DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackDcas_001, "FTRACKDCAS", 1, //! track dcas femtotracks::DcaXY, @@ -267,7 +271,6 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackExtras_001, "FTRACKEXTRA", 1, //! track femtotracks::TpcNClsCrossedRows, femtotracks::TpcNClsShared, femtotracks::TofBeta, - femtotracks::TofMass, femtotracks::TpcCrossedRowsOverFound, femtotracks::TpcSharedOverFound); using FTrackExtras = FTrackExtras_001; @@ -401,9 +404,10 @@ namespace femtov0s DECLARE_SOA_COLUMN(Mask, mask, femtodatatypes::V0MaskType); //! Bitmask for v0 selections // columns for debug information -DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Mass of Lambda -DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Mass of AntiLambda -DECLARE_SOA_COLUMN(MassK0short, massK0short, float); //! Mass of K0short +DECLARE_SOA_COLUMN(MassAnti, massAnti, float); //! mass of particle using antiparticle hypothesis (for Lambda/AntiLambda extra table) +DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Mass of Lambda (for k0short table) +DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Mass of AntiLambda (for k0short table) +DECLARE_SOA_COLUMN(MassK0short, massK0short, float); //! Mass of K0short (for lambda/antitlambda table) DECLARE_SOA_COLUMN(CosPa, cosPa, float); //! Lambda daughter DCA at decay vertex DECLARE_SOA_COLUMN(DauDca, dauDca, float); //! Lambda daughter DCA at decay vertex DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Lambda transvers radius @@ -447,7 +451,7 @@ using FLambdaMasks = FLambdaMasks_001; using StoredFLambdaMasks = StoredFLambdaMasks_001; DECLARE_SOA_TABLE_STAGED_VERSIONED(FLambdaExtras_001, "FLAMBDAEXTRA", 1, //! lambda extra information - femtobase::stored::MassAnti, // put mass of antiparticle, i.e. antilambda mass for lambdas and vice versa + femtov0s::MassAnti, // put mass of antiparticle, i.e. antilambda mass for lambdas and vice versa femtov0s::MassK0short, femtov0s::CosPa, femtov0s::DauDca, diff --git a/PWGCF/Femto/TableProducer/femtoProducer.cxx b/PWGCF/Femto/TableProducer/femtoProducer.cxx index 2bfe13acdbf..8d47b4a3730 100644 --- a/PWGCF/Femto/TableProducer/femtoProducer.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducer.cxx @@ -24,25 +24,24 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseITS.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx index 42fd008417c..64a3ede4696 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx @@ -20,13 +20,13 @@ #include "PWGCF/Femto/Core/v0Builder.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/InitContext.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include using namespace o2::analysis::femto; diff --git a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx index e8642fe53a4..f710e4ac194 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx @@ -16,11 +16,20 @@ #include "PWGCF/Femto/Core/femtoUtils.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include using namespace o2::analysis::femto; diff --git a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx index 74bedd879d7..ea60ae07ab2 100644 --- a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx +++ b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx @@ -23,15 +23,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,7 +51,7 @@ struct FemtoCascadeQa { using FemtoXis = o2::soa::Join; using FemtoOmegas = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoXisWithLabel = o2::soa::Join; using FemtoOmegasWithLabel = o2::soa::Join; diff --git a/PWGCF/Femto/Tasks/femtoKinkQa.cxx b/PWGCF/Femto/Tasks/femtoKinkQa.cxx index fa1c977c494..82ba5c380c8 100644 --- a/PWGCF/Femto/Tasks/femtoKinkQa.cxx +++ b/PWGCF/Femto/Tasks/femtoKinkQa.cxx @@ -25,15 +25,16 @@ #include "PWGCF/Femto/DataModel/FemtoTables.h" #include "PWGLF/DataModel/LFKinkDecayTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,7 +55,7 @@ struct FemtoKinkQa { // Define kink/sigma tables (joining tables for comprehensive information) using FemtoSigmas = o2::soa::Join; using FemtoSigmaPlus = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoSigmasWithLabel = o2::soa::Join; using FemtoSigmaPlusWithLabel = o2::soa::Join; diff --git a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx index 9181a00d20d..9430fa71eef 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx @@ -27,16 +27,17 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx index df79897eefc..2132de4073e 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx @@ -28,16 +28,17 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx index 48c4fed92aa..deb7c1164d8 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx @@ -25,16 +25,17 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,7 +55,10 @@ struct FemtoPairTrackTrack { using FemtoTracks = o2::soa::Join; - using FemtoTracksWithLabel = o2::soa::Join; + // for analysis which require particles at high pt, add tof mass so sidebands can be used + using FemtoTracksWithMass = o2::soa::Join; + + using FemtoTracksWithLabel = o2::soa::Join; o2::framework::SliceCache cache; @@ -76,8 +80,12 @@ struct FemtoPairTrackTrack { o2::framework::Partition trackPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); o2::framework::Preslice perColtracks = o2::aod::femtobase::stored::fColId; - o2::framework::Partition trackWithLabelPartition1 = MAKE_TRACK_PARTITION(confTrackSelections1); - o2::framework::Partition trackWithLabelPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); + o2::framework::Partition trackWithMassPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections1); + o2::framework::Partition trackWithMassPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections2); + o2::framework::Preslice perColtracksWithMass = o2::aod::femtobase::stored::fColId; + + o2::framework::Partition trackWithLabelPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections1); + o2::framework::Partition trackWithLabelPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections2); o2::framework::Preslice perColtracksWithLabel = o2::aod::femtobase::stored::fColId; // setup pairs @@ -108,10 +116,10 @@ struct FemtoPairTrackTrack { void init(o2::framework::InitContext&) { - if ((doprocessSameEvent + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventMc) > 1) { + if ((doprocessSameEvent + doprocessSameEventWithMass + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventWithMass + doprocessMixedEventMc) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } - bool processData = doprocessSameEvent || doprocessMixedEvent; + bool processData = doprocessSameEvent || doprocessMixedEvent || doprocessSameEventWithMass || doprocessMixedEventWithMass; bool processMc = doprocessSameEventMc || doprocessMixedEventMc; if (processData && processMc) { LOG(fatal) << "Both data and mc processing is activated. Breaking..."; @@ -152,6 +160,12 @@ struct FemtoPairTrackTrack { } PROCESS_SWITCH(FemtoPairTrackTrack, processSameEvent, "Enable processing same event processing", true); + void processSameEventWithMass(FilteredFemtoCollision const& col, FemtoTracksWithMass const& tracks) + { + pairTrackTrackBuilder.processSameEvent(col, tracks, trackWithMassPartition1, trackWithMassPartition2, cache); + } + PROCESS_SWITCH(FemtoPairTrackTrack, processSameEventWithMass, "Enable processing same event processing (with track masses)", false); + void processSameEventMc(FilteredFemtoCollisionWithLabel const& col, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, o2::aod::FMcParticles const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { pairTrackTrackBuilder.processSameEvent(col, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, mcParticles, mcMothers, mcPartonicMothers, cache); @@ -164,6 +178,12 @@ struct FemtoPairTrackTrack { } PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEvent, "Enable processing mixed event processing", true); + void processMixedEventWithMass(FilteredFemtoCollisions const& cols, FemtoTracksWithMass const& tracks) + { + pairTrackTrackBuilder.processMixedEvent(cols, tracks, trackWithMassPartition1, trackWithMassPartition2, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); + } + PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEventWithMass, "Enable processing mixed event processing (with track masses)", false); + void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, o2::aod::FMcParticles const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { pairTrackTrackBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx index 1bf895ffb4f..db7e18ba53b 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx @@ -26,16 +26,16 @@ #include "PWGCF/Femto/Core/twoTrackResonanceHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx index f6891b3b670..f112f60b973 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx @@ -27,16 +27,17 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx index d1783be7075..1cf6ffaf677 100644 --- a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx @@ -26,16 +26,17 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoTrackQa.cxx b/PWGCF/Femto/Tasks/femtoTrackQa.cxx index ca196b85185..25916affb95 100644 --- a/PWGCF/Femto/Tasks/femtoTrackQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTrackQa.cxx @@ -22,14 +22,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -47,7 +49,7 @@ struct FemtoTrackQa { using FilteredFemtoCollisionsWithLabel = o2::soa::Filtered; using FilteredFemtoCollisionWithLabel = FilteredFemtoCollisionsWithLabel::iterator; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoTracksWithLabel = o2::soa::Join; diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx index 8ab8dc46d2d..05dcdd5b153 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx @@ -13,6 +13,7 @@ /// \brief Tasks that computes correlation between three tracks /// \author Anton Riedel, TU München, anton.riedel@cern.ch +#include "PWGCF/Femto/Core/closePairRejection.h" #include "PWGCF/Femto/Core/closeTripletRejection.h" #include "PWGCF/Femto/Core/collisionBuilder.h" #include "PWGCF/Femto/Core/collisionHistManager.h" @@ -24,16 +25,17 @@ #include "PWGCF/Femto/Core/tripletHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx index ccbe794f3c1..370cee244a3 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx @@ -13,6 +13,7 @@ /// \brief Tasks that computes correlation between two tracks /// \author Anton Riedel, TU München, anton.riedel@cern.ch +#include "PWGCF/Femto/Core/closePairRejection.h" #include "PWGCF/Femto/Core/closeTripletRejection.h" #include "PWGCF/Femto/Core/collisionBuilder.h" #include "PWGCF/Femto/Core/collisionHistManager.h" @@ -26,16 +27,17 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -90,7 +92,6 @@ struct FemtoTripletTrackTrackV0 { // setup lambdas v0builder::ConfLambdaSelection1 confLambdaSelection; v0histmanager::ConfLambdaBinning1 confLambdaBinning; - particlecleaner::ConfLambdaCleaner1 confLambdaCleaner; o2::framework::Partition lambdaPartition = MAKE_LAMBDA_PARTITION(confLambdaSelection); o2::framework::Preslice perColLambdas = o2::aod::femtobase::stored::fColId; diff --git a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx index 7faff356fd2..5d2e3348c16 100644 --- a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx @@ -22,17 +22,16 @@ #include "PWGCF/Femto/Core/twoTrackResonanceHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -53,7 +52,7 @@ struct FemtoTwotrackresonanceQa { using FemtoPhis = o2::soa::Join; using FemtoRho0s = o2::soa::Join; using FemtoKstar0s = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; SliceCache cache; diff --git a/PWGCF/Femto/Tasks/femtoV0Qa.cxx b/PWGCF/Femto/Tasks/femtoV0Qa.cxx index a3587aaca95..5ed29d305ba 100644 --- a/PWGCF/Femto/Tasks/femtoV0Qa.cxx +++ b/PWGCF/Femto/Tasks/femtoV0Qa.cxx @@ -23,15 +23,16 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -51,7 +52,7 @@ struct FemtoV0Qa { using FemtoLambdas = o2::soa::Join; using FemtoK0shorts = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoLambdasWithLabel = o2::soa::Join; using FemtoK0shortsWithLabel = o2::soa::Join; From effa781a2be2731bb5107c736436194cf4f48755 Mon Sep 17 00:00:00 2001 From: mapalhares <165794118+mapalhares@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:49:14 +0100 Subject: [PATCH 110/282] [PWGLF/NuSpEx] Add QA plots for eta = 0.8 for evt. loss and minor changes (#15574) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 43 ++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 25aa3e94e7e..1928dbdbc45 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -89,12 +89,22 @@ std::shared_ptr hImpactParamGen; std::shared_ptr hImpactParamReco; std::shared_ptr hGen3HLBeforeEvtSel; std::shared_ptr hGen3HLAfterSel; +std::shared_ptr hGenEventsNchEta05; +std::shared_ptr hGenEventsNchEta08; +std::shared_ptr hGenCentralityColvsMultiplicityGenEta05; +std::shared_ptr hGenCentralityColvsMultiplicityGenEta08; +std::shared_ptr hGenCentralityColvsImpactParamGen; +std::shared_ptr hGenCentralityColvsFT0Cmultiplicity; std::shared_ptr hRecoCentralityColvsMultiplicityRecoEta05; +std::shared_ptr hRecoCentralityColvsMultiplicityRecoEta08; std::shared_ptr hRecoCentralityColvsImpactParamReco; +std::shared_ptr hRecoCentralityColvsFT0Cmultiplicity; std::shared_ptr hGen3HLvsImpactParameterBeforeEvtSel; std::shared_ptr hGen3HLvsImpactParameterAfterSel; std::shared_ptr hGen3HLvsMultiplicityGenEta05BeforeEvtSel; std::shared_ptr hGen3HLvsMultiplicityGenEta05AfterSel; +std::shared_ptr hGen3HLvsMultiplicityGenEta08BeforeEvtSel; +std::shared_ptr hGen3HLvsMultiplicityGenEta08AfterSel; std::shared_ptr hGen3HLvsMultiplicityFT0CBeforeEvtSel; std::shared_ptr hGen3HLvsMultiplicityFT0CAfterSel; @@ -329,21 +339,35 @@ struct hyperRecoTask { hEvtMC->GetXaxis()->SetBinLabel(1, "All gen evts"); hEvtMC->GetXaxis()->SetBinLabel(2, "Gen evts with al least one reconstructed"); hEvtMC->GetXaxis()->SetBinLabel(3, "Gen evts with no reconstructed collisions"); + hGenEventsNchEta05 = qaRegistry.add("QAEvent/hGenEventsNchEta05", ";;", HistType::kTH2D, {{multAxis}, {2, -0.5f, +1.5f}}); + hGenEventsNchEta05->GetYaxis()->SetBinLabel(1, "All gen. events"); + hGenEventsNchEta05->GetYaxis()->SetBinLabel(2, "Gen evts with at least 1 rec. collisions"); + hGenEventsNchEta08 = qaRegistry.add("QAEvent/hGenEventsNchEta08", ";;", HistType::kTH2D, {{multAxis}, {2, -0.5f, +1.5f}}); + hGenEventsNchEta08->GetYaxis()->SetBinLabel(1, "All gen. events"); + hGenEventsNchEta08->GetYaxis()->SetBinLabel(2, "Gen evts with at least 1 rec. collisions"); // Infomation for all generated collisions collisions hImpactParamGen = qaRegistry.add("QAEvent/McColAll/hImpactParamGen", "Impact parameter of generated MC events; Impact Parameter (b); Counts", HistType::kTH1D, {impactParamAxis}); + hGenCentralityColvsMultiplicityGenEta05 = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsMultiplicityGenEta05", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events; Multiplicity #eta <0.5; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); + hGenCentralityColvsMultiplicityGenEta08 = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsMultiplicityGenEta08", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events; Multiplicity #eta <0.8; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); + hGenCentralityColvsImpactParamGen = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsImpactParamGen", "Correlation between FT0C centrality and impact parameter in generated MC events; Multiplicity #eta <0.8; Counts", HistType::kTH2D, {centFT0CAxis, impactParamAxis}); + hGenCentralityColvsFT0Cmultiplicity = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsFT0Cmultiplicity", "Correlation between FT0C centrality and FT0C multiplicity in generated MC events; FT0c multiplicity", HistType::kTH2D, {centFT0CAxis, binsFT0CMultAxis}); // Infomation for generated collisions collisions with at least one rec. event hImpactParamReco = qaRegistry.add("QAEvent/McColAll/hImpactParamReco", "Impact parameter of generated MC events with at least one rec. evt; Impact Parameter (b); Counts", HistType::kTH1D, {impactParamAxis}); hRecoCentralityColvsMultiplicityRecoEta05 = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsMultiplicityRecoEta05", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events with at least one rec. evt; Multiplicity #eta <0.5; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); + hRecoCentralityColvsMultiplicityRecoEta08 = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsMultiplicityRecoEta08", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events with at least one rec. evt; Multiplicity #eta <0.8; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); hRecoCentralityColvsImpactParamReco = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsImpactParamReco", "Correlation between FT0C centrality and impact parameter in generated MC events with at least one rec. evt; Impact Parameter (b); Counts", HistType::kTH2D, {centFT0CAxis, impactParamAxis}); + hRecoCentralityColvsFT0Cmultiplicity = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsFT0Cmultiplicity", "Correlation between FT0C centrality and FT0C multiplicity in generated MC events with at least one rec. evt; FT0C (%); FT0c multiplicity", HistType::kTH2D, {centFT0CAxis, binsFT0CMultAxis}); // Information of generated 3HL in generated events hGen3HLBeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLBeforeEvtSel", "3HL generated #it{p}_{T} distribution in all gen evt;#it{p}_{T} (GeV/#it{c}); Counts", HistType::kTH1D, {ptAxis}); hGen3HLvsImpactParameterBeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsImpactParameterBeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and impact parameter in all gen evt;#it{p}_{T} (GeV/#it{c}); Impact parameter (b)", HistType::kTH2D, {ptAxis, impactParamAxis}); hGen3HLvsMultiplicityGenEta05BeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta05BeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in all gen evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.5", HistType::kTH2D, {ptAxis, multAxis}); + hGen3HLvsMultiplicityGenEta08BeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta08BeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in all gen evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.8", HistType::kTH2D, {ptAxis, multAxis}); hGen3HLvsMultiplicityFT0CBeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityFT0CBeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and FT0C multiplicity in all gen evt;#it{p}_{T} (GeV/#it{c}); FT0C Multiplicity", HistType::kTH2D, {ptAxis, binsFT0CMultAxis}); // Information of generated 3HL in generated events with at least one rec. event hGen3HLAfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLAfterSel", "3HL generated #it{p}_{T} distribution in gen. evts with at least one rec. evt; #it{p}_{T} (GeV/#it{c}); Counts", HistType::kTH1D, {ptAxis}); hGen3HLvsImpactParameterAfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsImpactParameterAfterSel", "Correlation 3HL generated #it{p}_{T} and impact parameter in gen. evts with at least one rec. evt;#it{p}_{T} (GeV/#it{c}); Impact parameter (b)", HistType::kTH2D, {ptAxis, impactParamAxis}); hGen3HLvsMultiplicityGenEta05AfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta05AfterSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in gen. evts with at least one rec. evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.5", HistType::kTH2D, {ptAxis, multAxis}); + hGen3HLvsMultiplicityGenEta08AfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta08AfterSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in gen. evts with at least one rec. evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.8", HistType::kTH2D, {ptAxis, multAxis}); hGen3HLvsMultiplicityFT0CAfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityFT0CAfterSel", "Correlation 3HL generated #it{p}_{T} and FT0C multiplicity in gen. evts with at least one rec;#it{p}_{T} (GeV/#it{c}); FT0C Multiplicity", HistType::kTH2D, {ptAxis, binsFT0CMultAxis}); } } @@ -435,9 +459,9 @@ struct hyperRecoTask { hEvents->Fill(1.); if (std::abs(collision.posZ()) > 10) { - hEvents->Fill(2.); continue; } + hEvents->Fill(2.); if (zorroSelected) { hEventsZorro->Fill(1.); @@ -480,9 +504,9 @@ struct hyperRecoTask { hEvents->Fill(1.); if (std::abs(collision.posZ()) > 10) { - hEvents->Fill(2.); continue; } + hEvents->Fill(2.); if (cfgEvSelkNoSameBunchPileup) { if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { @@ -666,7 +690,7 @@ struct hyperRecoTask { if (std::abs(posTrack.eta()) > etaMax || std::abs(negTrack.eta()) > etaMax) continue; - // temporary fix: tpcInnerParam() returns the momentum in all the software tags before: https://github.com/AliceO2Group/AliceO2/pull/12521 + // temporary fix: tpcInnhRecoCentralityColvsFT0CmultiplicityerParam() returns the momentum in all the software tags before: https://github.com/AliceO2Group/AliceO2/pull/12521 auto nSigmaTPCpos = computeNSigmaHe3(posTrack); auto nSigmaTPCneg = computeNSigmaHe3(negTrack); // ITS only tracks do not have TPC information. TPCnSigma: only lower cut to allow for both hypertriton and hyperhydrogen4 reconstruction @@ -1033,6 +1057,8 @@ struct hyperRecoTask { // Fill all generated events hEvtMC->Fill(0); hImpactParamGen->Fill(mcCollision.impactParameter()); + hGenEventsNchEta05->Fill(mcCollision.multMCNParticlesEta05(), 0); + hGenEventsNchEta08->Fill(mcCollision.multMCNParticlesEta08(), 0); // Fill generated events with no reconstructed collisions if (collisions.size() == 0) { @@ -1051,11 +1077,20 @@ struct hyperRecoTask { atLeastOneRecoEvt = true; } + hGenCentralityColvsMultiplicityGenEta05->Fill(centralityFT0C, mcCollision.multMCNParticlesEta05()); + hGenCentralityColvsMultiplicityGenEta08->Fill(centralityFT0C, mcCollision.multMCNParticlesEta08()); + hGenCentralityColvsImpactParamGen->Fill(centralityFT0C, mcCollision.impactParameter()); + hGenCentralityColvsFT0Cmultiplicity->Fill(centralityFT0C, mcCollision.multMCFT0C()); + if (atLeastOneRecoEvt) { hEvtMC->Fill(2); + hGenEventsNchEta05->Fill(mcCollision.multMCNParticlesEta05(), 1); + hGenEventsNchEta08->Fill(mcCollision.multMCNParticlesEta08(), 1); hImpactParamReco->Fill(mcCollision.impactParameter()); hRecoCentralityColvsMultiplicityRecoEta05->Fill(centralityFT0C, mcCollision.multMCNParticlesEta05()); + hRecoCentralityColvsMultiplicityRecoEta08->Fill(centralityFT0C, mcCollision.multMCNParticlesEta08()); hRecoCentralityColvsImpactParamReco->Fill(centralityFT0C, mcCollision.impactParameter()); + hRecoCentralityColvsFT0Cmultiplicity->Fill(centralityFT0C, mcCollision.multMCFT0C()); } // Construct the H3L 4-vector based on the generated daugthers identification by PDG ROOT::Math::PxPyPzMVector daugh1, daugh2, mother; @@ -1096,6 +1131,7 @@ struct hyperRecoTask { hGen3HLBeforeEvtSel->Fill(mother.pt()); hGen3HLvsImpactParameterBeforeEvtSel->Fill(mother.pt(), mcCollision.impactParameter()); hGen3HLvsMultiplicityGenEta05BeforeEvtSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta05()); + hGen3HLvsMultiplicityGenEta08BeforeEvtSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta08()); hGen3HLvsMultiplicityFT0CBeforeEvtSel->Fill(mother.pt(), mcCollision.multMCFT0C()); // Fill informations for generated 3HL in generated events with at least one reconstructed event @@ -1103,6 +1139,7 @@ struct hyperRecoTask { hGen3HLAfterSel->Fill(mother.pt()); hGen3HLvsImpactParameterAfterSel->Fill(mother.pt(), mcCollision.impactParameter()); hGen3HLvsMultiplicityGenEta05AfterSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta05()); + hGen3HLvsMultiplicityGenEta08AfterSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta08()); hGen3HLvsMultiplicityFT0CAfterSel->Fill(mother.pt(), mcCollision.multMCFT0C()); } } From 550437c0da4437cc16a163c1241457088063177c Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Mon, 30 Mar 2026 21:57:28 +0200 Subject: [PATCH 111/282] [PWGHF] Update in MC Gen Analysis (Old vs New Approach) (#15567) Co-authored-by: ALICE Action Bot --- .../TableProducer/correlatorDplusHadrons.cxx | 256 ++++++++++++------ 1 file changed, 174 insertions(+), 82 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index 2005cd9261e..3f7f48f84d3 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -186,6 +186,11 @@ struct HfCorrelatorDplusHadrons { Configurable selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for Dplus"}; // 7 corresponds to topo+PID cuts Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; + Configurable removeUnreconstructedGenCollisions{"removeUnreconstructedGenCollisions", true, "Remove generator-level collisions that were not reconstructed"}; + Configurable removeCollWSplitVtx{"removeCollWSplitVtx", true, "Flag for rejecting the splitted collisions"}; + Configurable useSel8{"useSel8", true, "Flag for applying sel8 for collision selection"}; + Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing"}; + Configurable zVtxMax{"zVtxMax", 10., "max. position-z of the reconstructed collision"}; Configurable applyEfficiency{"applyEfficiency", true, "Flag for applying D-meson efficiency weights"}; Configurable removeDaughters{"removeDaughters", true, "Flag for removing D-meson daughters from correlations"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; @@ -210,6 +215,7 @@ struct HfCorrelatorDplusHadrons { // Event Mixing for the Data Mode using SelCollisionsWithDplus = soa::Filtered>; using SelCollisionsWithDplusMc = soa::Filtered>; // collisionFilter applied + using CollisionsMc = soa::Join; using CandidatesDplusData = soa::Filtered>; // Event Mixing for the MCRec Mode using CandidatesDplusMcRec = soa::Filtered>; @@ -226,6 +232,8 @@ struct HfCorrelatorDplusHadrons { Filter dplusFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) != static_cast(0)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); Preslice presliceMc{aod::mcparticle::mcCollisionId}; + Preslice candMcGenPerMcCollision = o2::aod::mcparticle::mcCollisionId; + PresliceUnsorted> recoCollisionsPerMcCollision = o2::aod::mccollisionlabel::mcCollisionId; // Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 411 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); 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"}; @@ -308,9 +316,129 @@ struct HfCorrelatorDplusHadrons { registry.add("hEtaMcGen", "D+,Hadron particles - MC Gen", {HistType::kTH1F, {axisEta}}); registry.add("hPhiMcGen", "D+,Hadron particles - MC Gen", {HistType::kTH1F, {axisPhi}}); registry.add("hMultFT0AMcGen", "D+,Hadron multiplicity FT0A - MC Gen", {HistType::kTH1F, {axisMultiplicity}}); + registry.add("hFakeCollision", "Fake collision counter", {HistType::kTH1F, {{1, -0.5, 0.5, "n fake coll"}}}); corrBinning = {{binsZVtx, binsMultiplicity}, true}; } + template + void runMcGenDplusHadronAnalysis(const ParticleContainer& particlesToLoop, const AssocContainer& groupedMcParticles, int poolBin, int& counterDplusHadron) + { + for (const auto& particle : particlesToLoop) { + + if (std::abs(particle.pdgCode()) != Pdg::kDPlus) { + continue; + } + + if (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { + continue; + } + + double yD = RecoDecay::y(particle.pVector(), MassDPlus); + + if (std::abs(yD) > yCandGenMax || + particle.pt() < ptCandMin || + particle.pt() > ptCandMax) { + continue; + } + + std::vector listDaughters{}; + std::array const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; + std::array prongsId{}; + + RecoDecay::getDaughters(particle, &listDaughters, arrDaughDplusPDG, 2); + + if (listDaughters.size() != NDaughters) { + continue; + } + + bool isDaughtersOk = true; + int counterDaughters = 0; + + for (const auto& dauIdx : listDaughters) { + auto daughI = particlesToLoop.rawIteratorAt(dauIdx - particlesToLoop.offset()); + + if (std::abs(daughI.eta()) >= EtaDaughtersMax) { + isDaughtersOk = false; + break; + } + + prongsId[counterDaughters++] = daughI.globalIndex(); + } + + if (!isDaughtersOk) { // Skip this D+ candidate if any daughter fails eta cut + continue; + } + counterDplusHadron++; + + registry.fill(HIST("hDplusBin"), poolBin); + registry.fill(HIST("hPtCandMCGen"), particle.pt()); + registry.fill(HIST("hEtaMcGen"), particle.eta()); + registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -PIHalf)); + registry.fill(HIST("hYMCGen"), yD); + + // Prompt / Non-prompt separation + bool isDplusPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; + bool isDplusNonPrompt = particle.originMcGen() == RecoDecay::OriginType::NonPrompt; + + if (isDplusPrompt) { + registry.fill(HIST("hPtCandMcGenPrompt"), particle.pt()); + } else if (isDplusNonPrompt) { + registry.fill(HIST("hPtCandMcGenNonPrompt"), particle.pt()); + } + + // Count triggers + registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle.pt()); + + for (const auto& particleAssoc : groupedMcParticles) { + + if (std::abs(particleAssoc.eta()) > etaTrackMax || + particleAssoc.pt() < ptTrackMin || + particleAssoc.pt() > ptTrackMax) { + continue; + } + + // Remove daughters if requested + if (removeDaughters) { + if (particleAssoc.globalIndex() == prongsId[0] || + particleAssoc.globalIndex() == prongsId[1] || + particleAssoc.globalIndex() == prongsId[2]) { + continue; + } + } + + // Particle species selection + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && + (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && + (std::abs(particleAssoc.pdgCode()) != kPiPlus) && + (std::abs(particleAssoc.pdgCode()) != kKPlus) && + (std::abs(particleAssoc.pdgCode()) != kProton)) { + continue; + } + + if (!particleAssoc.isPhysicalPrimary()) { + continue; + } + + int trackOrigin = RecoDecay::getCharmHadronOrigin(groupedMcParticles, + particleAssoc, + true); + + registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); + entryDplusHadronPair( + getDeltaPhi(particleAssoc.phi(), particle.phi()), + particleAssoc.eta() - particle.eta(), + particle.pt(), + particleAssoc.pt(), + poolBin); + + entryDplusHadronRecoInfo(MassDPlus, true); + entryDplusHadronGenInfo(isDplusPrompt, + particleAssoc.isPhysicalPrimary(), + trackOrigin); + } + } + } + /// Dplus-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(SelCollisionsWithDplus::iterator const& collision, TracksData const& tracks, @@ -536,101 +664,65 @@ struct HfCorrelatorDplusHadrons { PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcRec, "Process MC Reco mode", true); /// Dplus-Hadron correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) - void processMcGen(SelCollisionsWithDplusMc::iterator const& mcCollision, + void processMcGen(CollisionsMc const& mcCollisions, + soa::Join const& collisions, CandDplusMcGen const& mcParticles) { - int counterDplusHadron = 0; - registry.fill(HIST("hMCEvtCount"), 0); - BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); - registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); - // MC gen level - for (const auto& particle1 : mcParticles) { - // check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { - continue; - } - if (std::abs(particle1.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { - continue; - } - double const yD = RecoDecay::y(particle1.pVector(), MassDPlus); - if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) { - continue; - } - std::vector listDaughters{}; - std::array const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; - std::array prongsId{}; - listDaughters.clear(); - RecoDecay::getDaughters(particle1, &listDaughters, arrDaughDplusPDG, 2); - int counterDaughters = 0; - if (listDaughters.size() != NDaughters) { - continue; - } - bool isDaughtersOk = true; - for (const auto& dauIdx : listDaughters) { - auto daughI = mcParticles.rawIteratorAt(dauIdx - mcParticles.offset()); - if (std::abs(daughI.eta()) >= EtaDaughtersMax) { - isDaughtersOk = false; - break; - } - counterDaughters += 1; - prongsId[counterDaughters - 1] = daughI.globalIndex(); - } - if (!isDaughtersOk) { - continue; // Skip this D+ candidate if any daughter fails eta cut - } - counterDplusHadron++; + for (const auto& mcCollision : mcCollisions) { - registry.fill(HIST("hDplusBin"), poolBin); - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMcGen"), particle1.eta()); - registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle1.phi(), -PIHalf)); - registry.fill(HIST("hYMCGen"), yD); + int counterDplusHadron = 0; + registry.fill(HIST("hMCEvtCount"), 0); - // prompt and non-prompt division - bool isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt; - bool isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt; - if (isDplusPrompt) { - registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt()); - } else if (isDplusNonPrompt) { - registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt()); - } + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); + registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); - // Dplus Hadron correlation dedicated section - // if it's a Dplus particle, search for Hadron and evaluate correlations - registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation) - for (const auto& particleAssoc : mcParticles) { - if (std::abs(particleAssoc.eta()) > etaTrackMax || particleAssoc.pt() < ptTrackMin || particleAssoc.pt() > ptTrackMax) { + const auto groupedMcParticles = mcParticles.sliceBy(candMcGenPerMcCollision, mcCollision.globalIndex()); + const auto groupedCollisions = collisions.sliceBy(recoCollisionsPerMcCollision, mcCollision.globalIndex()); + + if (removeUnreconstructedGenCollisions) { + + if (groupedCollisions.size() < 1) { continue; } - if (removeDaughters) { - 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(particleAssoc.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { + + if (groupedCollisions.size() > 1 && removeCollWSplitVtx) { continue; } - if (!particleAssoc.isPhysicalPrimary()) { - continue; + + for (const auto& collision : groupedCollisions) { + + if (useSel8 && !collision.sel8()) { + continue; + } + + if (std::abs(collision.posZ()) > zVtxMax) { + continue; + } + + if (selNoSameBunchPileUpColl && + !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + continue; + } + + if (!collision.has_mcCollision()) { + registry.fill(HIST("hFakeCollision"), 0.); + continue; + } + + // MC particles with reconstructed-collision selection + runMcGenDplusHadronAnalysis(groupedMcParticles, groupedMcParticles, poolBin, counterDplusHadron); } - int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); - registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); - entryDplusHadronPair(getDeltaPhi(particleAssoc.phi(), particle1.phi()), - particleAssoc.eta() - particle1.eta(), - particle1.pt(), - particleAssoc.pt(), - poolBin); - entryDplusHadronRecoInfo(MassDPlus, true); - entryDplusHadronGenInfo(isDplusPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin); - } // end associated loop - } // end trigger - registry.fill(HIST("hcountDplusHadronPerEvent"), counterDplusHadron); - registry.fill(HIST("hZvtx"), mcCollision.posZ()); - // registry.fill(HIST("hMultiplicity"), getTracksSize(mcCollision)); + } else { + // MC particles without reconstructed-collision selection (preliminary approval approach) + runMcGenDplusHadronAnalysis(groupedMcParticles, groupedMcParticles, poolBin, counterDplusHadron); + } + + registry.fill(HIST("hcountDplusHadronPerEvent"), counterDplusHadron); + registry.fill(HIST("hZvtx"), mcCollision.posZ()); + } } PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcGen, "Process MC Gen mode", false); From 012825039b2fd313b21a5a65f3507e7b06d6520c Mon Sep 17 00:00:00 2001 From: nepeivodaRS <94179174+nepeivodaRS@users.noreply.github.com> Date: Mon, 30 Mar 2026 22:15:15 +0200 Subject: [PATCH 112/282] [PWGLF] UPC timing QA/cuts in derived UPC analysis and clean up cascade QA/postprocessing in pp (#15585) --- .../Strangeness/cascqaanalysis.cxx | 128 +++++----- .../Tasks/Strangeness/cascpostprocessing.cxx | 2 + .../Tasks/Strangeness/derivedupcanalysis.cxx | 240 ++++++++++++++++-- 3 files changed, 280 insertions(+), 90 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx b/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx index e32ebd8a9db..81293bcebf2 100644 --- a/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx +++ b/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx @@ -34,7 +34,9 @@ #include #include +#include #include +#include #include using namespace o2; @@ -122,7 +124,7 @@ struct Cascqaanalysis { SliceCache cache; // Random number generator for event scaling - TRandom2* fRand = new TRandom2(); + TRandom2 fRand; // Struct to select on event type typedef struct CollisionIndexAndType { @@ -130,6 +132,41 @@ struct Cascqaanalysis { uint8_t typeFlag; } CollisionIndexAndType; + template + static int countITSHits(TTrack const& track) + { + int nHits = 0; + for (unsigned int i = 0; i < 7; ++i) { + if (track.itsClusterMap() & (1 << i)) { + ++nHits; + } + } + return nHits; + } + + template + static uint8_t buildRecoEventFlags(TCollision const& collision) + { + uint8_t evFlag = o2::aod::mycascades::EvFlags::EvINEL; + if (collision.isInelGt0()) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; + } + if (collision.isInelGt1()) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; + } + return evFlag; + } + + template + static std::pair computeCascadeCtau(TCascade const& casc, TCollision const& collision) + { + const float decayLength = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); + const float totalMomentum = std::hypot(casc.px(), casc.py(), casc.pz()); + const float invMomentum = 1.f / (totalMomentum + 1.e-13f); + return {o2::constants::physics::MassXiMinus * decayLength * invMomentum, + o2::constants::physics::MassOmegaMinus * decayLength * invMomentum}; + } + void init(InitContext const&) { TString hCandidateCounterLabels[4] = {"All candidates", "passed topo cuts", "has associated MC particle", "associated with Xi(Omega)"}; @@ -210,17 +247,13 @@ struct Cascqaanalysis { auto bachelor = cascCand.template bachelor_as(); // Basic set of selections - if (cascCand.cascradius() > cascradius && - cascCand.v0radius() > v0radius && - cascCand.casccosPA(pvx, pvy, pvz) > casccospa && - cascCand.v0cosPA(pvx, pvy, pvz) > v0cospa && - std::fabs(posdau.eta()) < etadau && - std::fabs(negdau.eta()) < etadau && - std::fabs(bachelor.eta()) < etadau) { - return true; - } else { - return false; - } + return cascCand.cascradius() > cascradius && + cascCand.v0radius() > v0radius && + cascCand.casccosPA(pvx, pvy, pvz) > casccospa && + cascCand.v0cosPA(pvx, pvy, pvz) > v0cospa && + std::fabs(posdau.eta()) < etadau && + std::fabs(negdau.eta()) < etadau && + std::fabs(bachelor.eta()) < etadau; } template @@ -419,39 +452,16 @@ struct Cascqaanalysis { registry.fill(HIST("hCandidateCounter"), 1.5); // passed topo cuts nCandSel++; // Fill table - if (fRand->Rndm() < lEventScale) { + if (fRand.Rndm() < lEventScale) { auto posdau = casc.posTrack_as(); auto negdau = casc.negTrack_as(); auto bachelor = casc.bachelor_as(); - // ITS N hits - int posITSNhits = 0, negITSNhits = 0, bachITSNhits = 0; - for (unsigned int i = 0; i < 7; i++) { - if (posdau.itsClusterMap() & (1 << i)) { - posITSNhits++; - } - if (negdau.itsClusterMap() & (1 << i)) { - negITSNhits++; - } - if (bachelor.itsClusterMap() & (1 << i)) { - bachITSNhits++; - } - } - - uint8_t evFlag = 0; - evFlag |= o2::aod::mycascades::EvFlags::EvINEL; - if (collision.multNTracksPVeta1() > 0) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; - } - if (collision.multNTracksPVeta1() > 1) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; - } - - // c x tau - float cascpos = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); - float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); - float ctauXi = o2::constants::physics::MassXiMinus * cascpos / (cascptotmom + 1e-13); - float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / (cascptotmom + 1e-13); + const int posITSNhits = countITSHits(posdau); + const int negITSNhits = countITSHits(negdau); + const int bachITSNhits = countITSHits(bachelor); + const uint8_t evFlag = buildRecoEventFlags(collision); + const auto [ctauXi, ctauOmega] = computeCascadeCtau(casc, collision); mycascades(collision.posZ(), collision.centFT0M(), collision.centFV0A(), @@ -563,41 +573,17 @@ struct Cascqaanalysis { genY = cascmc.y(); } } - if (fRand->Rndm() < lEventScale) { + if (fRand.Rndm() < lEventScale) { // Fill table auto posdau = casc.posTrack_as(); auto negdau = casc.negTrack_as(); auto bachelor = casc.bachelor_as(); - // ITS N hits - int posITSNhits = 0, negITSNhits = 0, bachITSNhits = 0; - for (unsigned int i = 0; i < 7; i++) { - if (posdau.itsClusterMap() & (1 << i)) { - posITSNhits++; - } - if (negdau.itsClusterMap() & (1 << i)) { - negITSNhits++; - } - if (bachelor.itsClusterMap() & (1 << i)) { - bachITSNhits++; - } - } - - // Event type flag - uint8_t evFlag = 0; - evFlag |= o2::aod::mycascades::EvFlags::EvINEL; - if (collision.multNTracksPVeta1() > 0) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; - } - if (collision.multNTracksPVeta1() > 1) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; - } - - // c x tau - float cascpos = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); - float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); - float ctauXi = o2::constants::physics::MassXiMinus * cascpos / (cascptotmom + 1e-13); - float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / (cascptotmom + 1e-13); + const int posITSNhits = countITSHits(posdau); + const int negITSNhits = countITSHits(negdau); + const int bachITSNhits = countITSHits(bachelor); + const uint8_t evFlag = buildRecoEventFlags(collision); + const auto [ctauXi, ctauOmega] = computeCascadeCtau(casc, collision); mycascades(collision.posZ(), mcCollision.centFT0M(), 0, // mcCollision.centFV0A() to be added diff --git a/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx b/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx index 098251faf28..0cf6ba274e5 100644 --- a/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx +++ b/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx @@ -243,6 +243,8 @@ struct cascpostprocessing { bool isCorrectlyRec = 0; for (auto& candidate : mycascades) { + isCandidate = false; + isCorrectlyRec = false; switch (evSelFlag) { case 1: { diff --git a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx index 6b43f823c12..9f340ebbf6c 100644 --- a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx @@ -65,18 +65,17 @@ using NeutronsMC = soa::Join; using CascMCCoresFull = soa::Join; -using StraCollisonsFull = soa::Join; -using StraCollisonFull = soa::Join::iterator; +using StraCollisonsFull = soa::Join; +using StraCollisonFull = soa::Join::iterator; -using StraCollisonsFullMC = soa::Join; -using StraCollisonFullMC = soa::Join::iterator; +using StraCollisonsFullMC = soa::Join; +using StraCollisonFullMC = soa::Join::iterator; using StraMCCollisionsFull = soa::Join; using V0MCCoresFull = soa::Join; struct Derivedupcanalysis { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // master analysis switches Configurable analyseK0Short{"analyseK0Short", true, "process K0Short-like candidates"}; Configurable analyseLambda{"analyseLambda", true, "process Lambda-like candidates"}; @@ -168,6 +167,13 @@ struct Derivedupcanalysis { Configurable ft0a{"ft0a", 100., "FT0A threshold"}; Configurable ft0c{"ft0c", 50., "FT0C threshold"}; Configurable zdc{"zdc", 1., "ZDC threshold"}; + Configurable fddaTimeCut{"fddaTimeCut", -1., "FDDA timing cut (ns); negative: no cut"}; + Configurable fddcTimeCut{"fddcTimeCut", -1., "FDDC timing cut (ns); negative: no cut"}; + Configurable fv0aTimeCut{"fv0aTimeCut", -1., "FV0A timing cut (ns); negative: no cut"}; + Configurable ft0aTimeCut{"ft0aTimeCut", -1., "FT0A timing cut (ns); negative: no cut"}; + Configurable ft0cTimeCut{"ft0cTimeCut", -1., "FT0C timing cut (ns); negative: no cut"}; + Configurable zdcTimeCut{"zdcTimeCut", 2., "ZDC timing cut (ns)"}; + Configurable requireZDCTiming{"requireZDCTiming", true, "require valid ZDC timing for gap-side selection"}; Configurable genGapSide{"genGapSide", 0, "0 -- A, 1 -- C, 2 -- double"}; } upcCuts; @@ -213,6 +219,8 @@ struct Derivedupcanalysis { ConfigurableAxis axisFDDCampl{"axisFDDCampl", {100, 0.0f, 2000.0f}, "FDDCamplitude"}; ConfigurableAxis axisZNAampl{"axisZNAampl", {100, 0.0f, 250.0f}, "ZNAamplitude"}; ConfigurableAxis axisZNCampl{"axisZNCampl", {100, 0.0f, 250.0f}, "ZNCamplitude"}; + ConfigurableAxis axisFitTime{"axisFitTime", {166, -42.5f, 40.5f}, "FIT time (ns)"}; + ConfigurableAxis axisZdcTime{"axisZdcTime", {110, -12.5f, 10.0f}, "ZDC time (ns)"}; } axisDetectors; // for MC @@ -268,7 +276,7 @@ struct Derivedupcanalysis { ConfigurableAxis axisOccupancy{"axisOccupancy", {VARIABLE_WIDTH, 0.0f, 250.0f, 500.0f, 750.0f, 1000.0f, 1500.0f, 2000.0f, 3000.0f, 4500.0f, 6000.0f, 8000.0f, 10000.0f, 50000.0f}, "Occupancy"}; // UPC axes - ConfigurableAxis axisSelGap{"axisSelGap", {4, -1.5, 2.5}, "Gap side"}; + ConfigurableAxis axisSelGap{"axisSelGap", {7, -1.5, 5.5}, "Gap side"}; // AP plot axes ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; @@ -297,6 +305,8 @@ struct Derivedupcanalysis { ConfigurableAxis axisCtau{"axisCtau", {200, 0.0f, 20.0f}, "c x tau (cm)"}; static constexpr std::string_view kParticlenames[] = {"K0Short", "Lambda", "AntiLambda", "Xi", "AntiXi", "Omega", "AntiOmega"}; + static constexpr uint8_t kFT0TriggerBitIsActiveA = 5; + static constexpr uint8_t kFT0TriggerBitIsActiveC = 6; void setBits(std::bitset& mask, std::initializer_list selections) { @@ -931,6 +941,22 @@ struct Derivedupcanalysis { histos.add("eventQA/hFT0", "hFT0", kTH3D, {axisDetectors.axisFT0Aampl, axisDetectors.axisFT0Campl, axisSelGap}); histos.add("eventQA/hFDD", "hFDD", kTH3D, {axisDetectors.axisFDDAampl, axisDetectors.axisFDDCampl, axisSelGap}); histos.add("eventQA/hZN", "hZN", kTH3D, {axisDetectors.axisZNAampl, axisDetectors.axisZNCampl, axisSelGap}); + histos.add("eventQA/hTimeFT0A", "hTimeFT0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFT0C", "hTimeFT0C", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFV0A", "hTimeFV0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFDDA", "hTimeFDDA", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFDDC", "hTimeFDDC", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFT0APreSel", "hTimeFT0APreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFT0CPreSel", "hTimeFT0CPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFV0APreSel", "hTimeFV0APreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFDDAPreSel", "hTimeFDDAPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFDDCPreSel", "hTimeFDDCPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hFT0Time", "hFT0Time", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hFDDTime", "hFDDTime", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hZNTime", "hZNTime", kTH3D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime, axisSelGap}); + histos.add("eventQA/hFT0TimePreSel", "hFT0TimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); + histos.add("eventQA/hFDDTimePreSel", "hFDDTimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); + histos.add("eventQA/hZNTimePreSel", "hZNTimePreSel", kTH2D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime}); if (doprocessGenerated) { histos.add("eventQA/mc/hEventSelectionMC", "hEventSelectionMC", kTH3D, {{3, -0.5, 2.5}, axisNTracksPVeta1, axisGeneratorIds}); @@ -955,7 +981,7 @@ struct Derivedupcanalysis { histos.add("eventQA/mc/hNTracksPVeta1vsMCNParticlesEta10rec", "hNTracksPVeta1vsMCNParticlesEta10rec", kTH2D, {axisNTracksPVeta1, axisNTracksPVeta1}); histos.add("eventQA/mc/hNTracksGlobalvstotalMultMCParticles", "hNTracksGlobalvstotalMultMCParticles", kTH2D, {axisNTracksGlobal, axisNchInvMass}); histos.add("eventQA/mc/hNTracksPVeta1vstotalMultMCParticles", "hNTracksPVeta1vstotalMultMCParticles", kTH2D, {axisNTracksPVeta1, axisNchInvMass}); - histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {{5, -0.5, 4.5}}); + histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {axisSelGap}); } if (doprocessV0sMC) { @@ -1050,12 +1076,164 @@ struct Derivedupcanalysis { } template - int getGapSide(TCollision const& collision) + int applyZDCTiming(int selGapSide, TCollision const& collision) { - int selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + if (!upcCuts.requireZDCTiming) { + return selGapSide; + } + if (selGapSide == o2::aod::sgselector::SingleGapA || + selGapSide == o2::aod::sgselector::SingleGapC || + selGapSide == o2::aod::sgselector::DoubleGap) { + + const float timeZNA = collision.timeZNA(); + const float timeZNC = collision.timeZNC(); + const float cut = upcCuts.zdcTimeCut; + + auto isInvalidTime = [](float time) { + return !std::isfinite(time) || (std::abs(time) == 999.f); + }; + + const bool gapA = isInvalidTime(timeZNA) || (std::abs(timeZNA) > cut); + const bool gapC = isInvalidTime(timeZNC) || (std::abs(timeZNC) > cut); + const bool neutronA = !isInvalidTime(timeZNA) && (std::abs(timeZNA) < cut); + const bool neutronC = !isInvalidTime(timeZNC) && (std::abs(timeZNC) < cut); + + if (selGapSide == o2::aod::sgselector::SingleGapA) { // 0nXn + if (!(gapA && neutronC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::SingleGapC) { // Xn0n + if (!(neutronA && gapC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::DoubleGap) { + if (!(gapA && gapC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } + } + return selGapSide; } + bool isInvalidTime(float time) const + { + return !std::isfinite(time) || (std::abs(time) >= 998.f); + } + + bool isTimingCutEnabled(float cut) const + { + return cut >= 0.f; + } + + bool isTimingGap(float time, float cut) const + { + return isInvalidTime(time) || (std::abs(time) > cut); + } + + bool isTimingActivity(float time, float cut) const + { + return !isInvalidTime(time) && (std::abs(time) < cut); + } + + bool hasFT0Activity(uint8_t triggerMask, uint8_t bit) const + { + return (triggerMask & (static_cast(1u) << bit)) != 0; + } + + template + int applyFITTiming(int selGapSide, TCollision const& collision) + { + if (selGapSide != o2::aod::sgselector::SingleGapA && + selGapSide != o2::aod::sgselector::SingleGapC && + selGapSide != o2::aod::sgselector::DoubleGap) { + return selGapSide; + } + + const bool useFDDA = isTimingCutEnabled(upcCuts.fddaTimeCut); + const bool useFDDC = isTimingCutEnabled(upcCuts.fddcTimeCut); + const bool useFV0A = isTimingCutEnabled(upcCuts.fv0aTimeCut); + const bool useFT0A = isTimingCutEnabled(upcCuts.ft0aTimeCut); + const bool useFT0C = isTimingCutEnabled(upcCuts.ft0cTimeCut); + + if (!(useFDDA || useFDDC || useFV0A || useFT0A || useFT0C)) { + return selGapSide; + } + + const bool ft0ActiveA = hasFT0Activity(collision.triggerMaskFT0(), kFT0TriggerBitIsActiveA); + const bool ft0ActiveC = hasFT0Activity(collision.triggerMaskFT0(), kFT0TriggerBitIsActiveC); + + const bool gapFDDA = !useFDDA || isTimingGap(collision.timeFDDA(), upcCuts.fddaTimeCut); + const bool actFDDA = !useFDDA || isTimingActivity(collision.timeFDDA(), upcCuts.fddaTimeCut); + const bool gapFDDC = !useFDDC || isTimingGap(collision.timeFDDC(), upcCuts.fddcTimeCut); + const bool actFDDC = !useFDDC || isTimingActivity(collision.timeFDDC(), upcCuts.fddcTimeCut); + const bool gapFV0A = !useFV0A || isTimingGap(collision.timeFV0A(), upcCuts.fv0aTimeCut); + const bool actFV0A = !useFV0A || isTimingActivity(collision.timeFV0A(), upcCuts.fv0aTimeCut); + const bool gapFT0A = !useFT0A || !ft0ActiveA || isTimingGap(collision.timeFT0A(), upcCuts.ft0aTimeCut); + const bool actFT0A = !useFT0A || (ft0ActiveA && isTimingActivity(collision.timeFT0A(), upcCuts.ft0aTimeCut)); + const bool gapFT0C = !useFT0C || !ft0ActiveC || isTimingGap(collision.timeFT0C(), upcCuts.ft0cTimeCut); + const bool actFT0C = !useFT0C || (ft0ActiveC && isTimingActivity(collision.timeFT0C(), upcCuts.ft0cTimeCut)); + + if (selGapSide == o2::aod::sgselector::SingleGapA) { + if (!(gapFV0A && gapFDDA && gapFT0A && actFDDC && actFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::SingleGapC) { + if (!(actFV0A && actFDDA && actFT0A && gapFDDC && gapFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::DoubleGap) { + if (!(gapFV0A && gapFDDA && gapFT0A && gapFDDC && gapFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } + + return selGapSide; + } + + template + int getGapSide(TCollision const& collision) + { + int selGapSide = o2::aod::sgselector::NoGap; + selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + selGapSide = applyZDCTiming(selGapSide, collision); + return applyFITTiming(selGapSide, collision); + } + float sanitizeZdcTime(float time) const + { + if (!std::isfinite(time)) { + return -12.f; + } + if (std::abs(time) >= 998.f) { + return -11.f; + } + return time; + } + + float sanitizeFITTime(float time) const + { + if (!std::isfinite(time)) { + return -42.f; + } + if (std::abs(time) >= 998.f) { + return -41.f; + } + return time; + } + + template + void fillPreSelTimingHistograms(TCollision const& collision) + { + histos.fill(HIST("eventQA/hFT0TimePreSel"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C())); + histos.fill(HIST("eventQA/hFDDTimePreSel"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC())); + histos.fill(HIST("eventQA/hZNTimePreSel"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC())); + histos.fill(HIST("eventQA/hTimeFT0APreSel"), sanitizeFITTime(collision.timeFT0A())); + histos.fill(HIST("eventQA/hTimeFT0CPreSel"), sanitizeFITTime(collision.timeFT0C())); + histos.fill(HIST("eventQA/hTimeFV0APreSel"), sanitizeFITTime(collision.timeFV0A())); + histos.fill(HIST("eventQA/hTimeFDDAPreSel"), sanitizeFITTime(collision.timeFDDA())); + histos.fill(HIST("eventQA/hTimeFDDCPreSel"), sanitizeFITTime(collision.timeFDDC())); + } + template void fillHistogramsQA(TCollision const& collision, int const& gap) { @@ -1091,14 +1269,26 @@ struct Derivedupcanalysis { auto znc = collision.energyCommonZNC(); constexpr float inf_f = std::numeric_limits::infinity(); - if (zna == -inf_f) + if (zna == -inf_f) { histos.fill(HIST("eventQA/hZN"), -1, znc, gap); - else if (znc == -inf_f) + } else if (znc == -inf_f) { histos.fill(HIST("eventQA/hZN"), zna, -1, gap); - else if (zna == -999 && znc == -999) + } else if (zna == -999 && znc == -999) { histos.fill(HIST("eventQA/hZN"), -2, -2, gap); - else if (zna == -999 || znc == -999) + } else if (zna == -999 || znc == -999) { LOG(warning) << "Only one ZDC signal is -999"; + } else { + histos.fill(HIST("eventQA/hZN"), zna, znc, gap); + } + + histos.fill(HIST("eventQA/hFT0Time"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C()), gap); + histos.fill(HIST("eventQA/hFDDTime"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC()), gap); + histos.fill(HIST("eventQA/hZNTime"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC()), gap); + histos.fill(HIST("eventQA/hTimeFT0A"), sanitizeFITTime(collision.timeFT0A()), gap); + histos.fill(HIST("eventQA/hTimeFT0C"), sanitizeFITTime(collision.timeFT0C()), gap); + histos.fill(HIST("eventQA/hTimeFV0A"), sanitizeFITTime(collision.timeFV0A()), gap); + histos.fill(HIST("eventQA/hTimeFDDA"), sanitizeFITTime(collision.timeFDDA()), gap); + histos.fill(HIST("eventQA/hTimeFDDC"), sanitizeFITTime(collision.timeFDDC()), gap); } template @@ -1868,13 +2058,13 @@ struct Derivedupcanalysis { } } - if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) - continue; - - ++nCollisions; - atLeastOne = true; + const bool passStd = !evSels.studyUPConly || (selGapSide == static_cast(upcCuts.genGapSide)); + if (passStd) { + ++nCollisions; + atLeastOne = true; + } - if (biggestNContribs < collision.multPVTotalContributors()) { + if (passStd && biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); if (static_cast(upcCuts.genGapSide) == 0) { ft0ampl = collision.totalFT0AmplitudeC(); @@ -1946,6 +2136,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; @@ -2002,6 +2195,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; @@ -2087,6 +2283,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; @@ -2139,6 +2338,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; From 5ce2a7f013a6726722bc1ca9d7b7e1f6fbf7a9c3 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 30 Mar 2026 22:54:22 +0200 Subject: [PATCH 113/282] [PWGLF] Fix table subscription (#15588) --- PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 499514add65..8bc8a962984 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -707,23 +707,23 @@ struct strangederivedbuilder { } } - void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&) + void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) { populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) + void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) { populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); From 03a7a288989b3fd999548432ca30cdebf3383125 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Tue, 31 Mar 2026 00:47:37 +0200 Subject: [PATCH 114/282] [PWGCF] FemtoUniverse: Fix bug in filtering, add kT dependent CPR cut with radial separation (#15587) Co-authored-by: ALICE Action Bot --- .../Core/FemtoUniverseDetaDphiStar.h | 125 ++++++++++-------- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 20 +-- 2 files changed, 82 insertions(+), 63 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index f1a76754cd0..05e0cfb5682 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -66,31 +66,31 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { std::string dirName = static_cast(DirNames[0]); - histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpiqlcmssame = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpiqlcmsmixed = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiqlcmssame = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiqlcmsmixed = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int i = 0; i < 9; i++) { - histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[1]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -99,13 +99,13 @@ class FemtoUniverseDetaDphiStar /// V0-V0 combination for (int k = 0; k < 2; k++) { std::string dirName = static_cast(DirNames[2]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -114,13 +114,13 @@ class FemtoUniverseDetaDphiStar /// Cascade-Cascade combination for (int k = 0; k < 7; k++) { std::string dirName = static_cast(DirNames[5]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -129,13 +129,13 @@ class FemtoUniverseDetaDphiStar /// Track-Cascade combination for (int k = 0; k < 3; k++) { std::string dirName = static_cast(DirNames[6]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -144,13 +144,13 @@ class FemtoUniverseDetaDphiStar /// V0-Cascade combination for (int k = 0; k < 3; k++) { std::string dirName = static_cast(DirNames[7]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -165,7 +165,7 @@ class FemtoUniverseDetaDphiStar if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -173,14 +173,14 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[4]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -204,10 +204,10 @@ class FemtoUniverseDetaDphiStar std::string histSuffixkT1 = std::to_string(static_cast(ktBins[j] * 100.0)); std::string histSuffixkT2 = std::to_string(static_cast(ktBins[j + 1] * 100.0)); std::string histFolderkT = "kT_" + histSuffixkT1 + "_" + histSuffixkT2 + "/"; - histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -643,7 +643,7 @@ class FemtoUniverseDetaDphiStar /// Check if pair is close or not template - bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut) + bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut, bool IsDphiAvgOrDist, float lmagfield, float DistMax, float FracMax) { /// Track-Track combination // check if provided particles are in agreement with the class instantiation @@ -663,8 +663,11 @@ class FemtoUniverseDetaDphiStar ktbinval = 4; } + magfield = lmagfield; + auto deta = part1.eta() - part2.eta(); auto dphiAvg = averagePhiStar(part1, part2, 0); + auto distfrac = averagePhiStarFrac(part1, part2, DistMax); auto DeltaPhiStarMax = static_cast(cutDeltaPhiStarMaxVector[ktbinval]); auto DeltaPhiStarMin = static_cast(cutDeltaPhiStarMinVector[ktbinval]); auto DeltaEtaMax = static_cast(cutDeltaEtaMaxVector[ktbinval]); @@ -678,19 +681,35 @@ class FemtoUniverseDetaDphiStar LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if (CircCut && (std::pow(dphiAvg, 2) / std::pow(DeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(DeltaEtaMax, 2) < 1.)) { - return true; - } else if (!CircCut && (dphiAvg > DeltaPhiStarMin) && (dphiAvg < DeltaPhiStarMax) && (deta > DeltaEtaMin) && (deta < DeltaEtaMax)) { - return true; + if (IsDphiAvgOrDist) { + if (CircCut && (std::pow(dphiAvg, 2) / std::pow(DeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(DeltaEtaMax, 2) < 1.)) { + // std::cout<<"1 "< DeltaPhiStarMin) && (dphiAvg < DeltaPhiStarMax) && (deta > DeltaEtaMin) && (deta < DeltaEtaMax)) { + return true; + } else { + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadphimixedafterkT[ktbinval]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; + } } else { - if (ChosenEventType == femto_universe_container::EventType::same) { - histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femto_universe_container::EventType::mixed) { - histdetadphimixedafterkT[ktbinval]->Fill(deta, dphiAvg); + if (((deta > DeltaEtaMin) && (deta < DeltaEtaMax)) && (distfrac > FracMax)) { + return true; } else { - LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadphimixedafterkT[ktbinval]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; } - return false; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 2955e47a58c..0aa8752ddfc 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -113,6 +113,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confCPRDistMax{"confCPRDistMax", 0.0, "Max. radial seperation between two closed-pairs"}; Configurable confCPRFracMax{"confCPRFracMax", 0.0, "Max. allowed fraction bad to all TPC points of radial seperation between two closed-pairs"}; Configurable confCPRDphiAvgOrDist{"confCPRDphiAvgOrDist", true, "Close Pair Rejection by radial or angular seperation"}; + Configurable confIsCircularCut{"confIsCircularCut", true, "Close Pair Rejection within circular area"}; Configurable confIs1D{"confIs1D", true, "Filling 1D 2k* dist. in MC truth"}; Configurable confisIdenLCMS{"confisIdenLCMS", true, "Choosing identical or non-identical pairs in LCMS"}; Configurable confIsWeight{"confIsWeight", true, "Fill quantum weight"}; @@ -124,11 +125,10 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Filter trackAdditionalfilter = ((nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax) && (aod::track::dcaXY <= twotracksconfigs.confTrkDCAxyMax) && (aod::track::dcaZ <= twotracksconfigs.confTrkDCAzMax) && - (aod::femtouniverseparticle::tpcNClsCrossedRows >= twotracksconfigs.confTrkTPCcRowsMin) && + (aod::femtouniverseparticle::tpcNClsCrossedRows >= static_cast(twotracksconfigs.confTrkTPCcRowsMin)) && (aod::femtouniverseparticle::tpcFractionSharedCls <= twotracksconfigs.confTrkTPCfracsClsMax) && - (aod::femtouniverseparticle::tpcNClsFound >= twotracksconfigs.confTrkTPCnClsMin) && - ((aod::femtouniverseparticle::tpcNClsCrossedRows / aod::track::tpcNClsFindable) >= twotracksconfigs.confTrkTPCfClsMin) && - (aod::track::tpcNClsShared >= twotracksconfigs.confTrkTPCsClsMax)); + (aod::femtouniverseparticle::tpcNClsFound >= static_cast(twotracksconfigs.confTrkTPCnClsMin)) && + (aod::track::tpcNClsShared <= static_cast(twotracksconfigs.confTrkTPCsClsMax))); using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this optionconfIsCPRkT @@ -570,11 +570,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; } } @@ -628,11 +628,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(part1, part2, femto_universe_container::EventType::same, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; } } @@ -991,11 +991,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(part1, part2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; } } From c5d1739b73df439b13f1fe8c0a04e8d6cec61a8b Mon Sep 17 00:00:00 2001 From: rolavick Date: Tue, 31 Mar 2026 10:20:34 +0200 Subject: [PATCH 115/282] [PWGUD] Modifications to UpcCandProdcucerGlobalMuon (#15590) --- .../upcCandProducerGlobalMuon.cxx | 146 ++++++++++++------ 1 file changed, 95 insertions(+), 51 deletions(-) diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index 76c0a8b3e05..744b4e8523a 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -87,8 +88,6 @@ struct UpcCandProducerGlobalMuon { // NEW: MFT/Global track support configurables Configurable fEnableMFT{"fEnableMFT", true, "Enable MFT/global track processing"}; - Configurable fMinEtaMFT{"fMinEtaMFT", -3.6, "Minimum eta for MFT acceptance"}; - Configurable fMaxEtaMFT{"fMaxEtaMFT", -2.5, "Maximum eta for MFT acceptance"}; Configurable fSaveMFTClusters{"fSaveMFTClusters", true, "Save MFT cluster information"}; // Ambiguous track propagation configurables @@ -97,6 +96,8 @@ struct UpcCandProducerGlobalMuon { Configurable fManualZShift{"fManualZShift", 0.0f, "Manual z-shift for global muon propagation to PV"}; Configurable fMaxDCAxy{"fMaxDCAxy", 999.f, "Maximum DCAxy for global muon track selection (cm)"}; Configurable fBcWindowCollision{"fBcWindowCollision", 4, "BC window for collision search for DCA-based vertex assignment"}; + Configurable fMaxChi2MatchMCHMFT{"fMaxChi2MatchMCHMFT", 4.f, "Maximum chi2 for MCH-MFT matching quality filter"}; + Configurable fBcWindowMCHMFT{"fBcWindowMCHMFT", 20, "BC window for searching MCH-MFT tracks around MCH-MID-MFT anchors"}; using ForwardTracks = o2::soa::Join; @@ -140,7 +141,6 @@ struct UpcCandProducerGlobalMuon { histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(4, "GlobalFwd"); const AxisSpec axisEta{100, -4.0, -2.0, "#eta"}; - histRegistry.add("hEtaMFT", "MFT track eta", kTH1F, {axisEta}); histRegistry.add("hEtaGlobal", "Global track eta", kTH1F, {axisEta}); const AxisSpec axisDCAxy{200, 0., 10., "DCA_{xy} (cm)"}; @@ -148,6 +148,13 @@ struct UpcCandProducerGlobalMuon { histRegistry.add("hDCAxyGlobal", "DCAxy of global tracks to best collision", kTH1F, {axisDCAxy}); histRegistry.add("hDCAzGlobal", "DCAz of global tracks to best collision", kTH1F, {axisDCAz}); histRegistry.add("hNCompatColls", "Number of compatible collisions per global track", kTH1F, {{21, -0.5, 20.5}}); + + const AxisSpec axisChi2Match{200, 0., 100., "#chi^{2}_{MCH-MFT}"}; + histRegistry.add("hChi2MatchMCHMFT", "Chi2 of MCH-MFT matching (before cut)", kTH1F, {axisChi2Match}); + + const AxisSpec axisMass{500, 0., 10., "m_{inv} (GeV/c^{2})"}; + histRegistry.add("hMassGlobalMuon", "Invariant mass from MCH-MID-MFT tracks only", kTH1F, {axisMass}); + histRegistry.add("hMassGlobalMuonWithMCHMFT", "Invariant mass from MCH-MID-MFT + MCH-MFT tracks", kTH1F, {axisMass}); } } @@ -482,12 +489,6 @@ struct UpcCandProducerGlobalMuon { } } - // NEW: Check if track is in MFT acceptance - bool isInMFTAcceptance(float eta) - { - return (eta > fMinEtaMFT && eta < fMaxEtaMFT); - } - // Propagate global muon track to collision vertex using helix propagation // and compute DCA (adapted from ambiguousTrackPropagation) // Returns {DCAxy, DCAz, DCAx, DCAy} @@ -594,7 +595,8 @@ struct UpcCandProducerGlobalMuon { std::map> mapGlobalBcsWithMCHMIDTrackIds; std::map> mapGlobalBcsWithMCHTrackIds; - std::map> mapGlobalBcsWithGlobalTrackIds; // NEW: For global tracks + std::map> mapGlobalBcsWithGlobalMuonTrackIds; // MCH-MID-MFT (good timing from MID) + std::map> mapGlobalBcsWithMCHMFTTrackIds; // MCH-MFT only (poor timing) for (const auto& fwdTrack : fwdTracks) { auto trackType = fwdTrack.trackType(); @@ -614,8 +616,16 @@ struct UpcCandProducerGlobalMuon { mapGlobalBcsWithMCHMIDTrackIds[globalBC].push_back(trackId); } else if (trackType == MCHStandaloneTrack) { // MCH-only mapGlobalBcsWithMCHTrackIds[globalBC].push_back(trackId); - } else if (fEnableMFT && (trackType == GlobalMuonTrack || trackType == GlobalForwardTrack)) { // NEW: Global tracks - mapGlobalBcsWithGlobalTrackIds[globalBC].push_back(trackId); + } else if (fEnableMFT && trackType == GlobalMuonTrack) { // MCH-MID-MFT: good timing, used as anchor + histRegistry.fill(HIST("hChi2MatchMCHMFT"), fwdTrack.chi2MatchMCHMFT()); + if (fwdTrack.chi2MatchMCHMFT() > 0 && fwdTrack.chi2MatchMCHMFT() < fMaxChi2MatchMCHMFT) { + mapGlobalBcsWithGlobalMuonTrackIds[globalBC].push_back(trackId); + } + } else if (fEnableMFT && trackType == GlobalForwardTrack) { // MCH-MFT: poor timing, matched to anchors + histRegistry.fill(HIST("hChi2MatchMCHMFT"), fwdTrack.chi2MatchMCHMFT()); + if (fwdTrack.chi2MatchMCHMFT() > 0 && fwdTrack.chi2MatchMCHMFT() < fMaxChi2MatchMCHMFT) { + mapGlobalBcsWithMCHMFTTrackIds[globalBC].push_back(trackId); + } } } @@ -632,11 +642,13 @@ struct UpcCandProducerGlobalMuon { int32_t candId = 0; - // NEW: Process global tracks if MFT is enabled - if (fEnableMFT && !mapGlobalBcsWithGlobalTrackIds.empty()) { - for (const auto& gbc_globalids : mapGlobalBcsWithGlobalTrackIds) { - uint64_t globalBcGlobal = gbc_globalids.first; - auto itFv0Id = mapGlobalBcWithV0A.find(globalBcGlobal); + // Process global tracks: MCH-MID-MFT anchors + MCH-MFT in BC window + // MCH-MID-MFT tracks have good timing (from MID) and serve as anchors. + // MCH-MFT tracks have poor timing and are searched in a BC window around anchors. + if (fEnableMFT && !mapGlobalBcsWithGlobalMuonTrackIds.empty()) { + for (const auto& gbc_anchorids : mapGlobalBcsWithGlobalMuonTrackIds) { + uint64_t globalBcAnchor = gbc_anchorids.first; + auto itFv0Id = mapGlobalBcWithV0A.find(globalBcAnchor); if (itFv0Id != mapGlobalBcWithV0A.end()) { auto fv0Id = itFv0Id->second; const auto& fv0 = fv0s.iteratorAt(fv0Id); @@ -647,17 +659,28 @@ struct UpcCandProducerGlobalMuon { continue; } - auto& vGlobalIds = gbc_globalids.second; + auto& vAnchorIds = gbc_anchorids.second; // MCH-MID-MFT tracks at this BC + + // Search MCH-MFT tracks in BC window around anchor (analogous to MCH-only matching) + std::map mapMchMftIdBc{}; + getMchTrackIds(globalBcAnchor, mapGlobalBcsWithMCHMFTTrackIds, fBcWindowMCHMFT, mapMchMftIdBc); + + // Collect all track IDs for vertex finding (anchors + matched MCH-MFT) + std::vector allTrackIds; + allTrackIds.reserve(vAnchorIds.size() + mapMchMftIdBc.size()); + for (const auto& id : vAnchorIds) + allTrackIds.push_back(id); + for (const auto& [id, gbc] : mapMchMftIdBc) + allTrackIds.push_back(id); // Step 1: Find best collision vertex using DCA-based propagation - // (adapted from ambiguousTrackPropagation processMFTReassoc3D) float bestVtxX = 0., bestVtxY = 0., bestVtxZ = 0.; double bestAvgDCA = 999.; bool hasVertex = false; int nCompatColls = 0; for (int dbc = -static_cast(fBcWindowCollision); dbc <= static_cast(fBcWindowCollision); dbc++) { - uint64_t searchBC = globalBcGlobal + dbc; + uint64_t searchBC = globalBcAnchor + dbc; auto itCol = mapGlobalBCtoCollisions.find(searchBC); if (itCol == mapGlobalBCtoCollisions.end()) continue; @@ -666,7 +689,7 @@ struct UpcCandProducerGlobalMuon { const auto& col = collisions.iteratorAt(colIdx); double sumDCAxy = 0.; int nTracks = 0; - for (const auto& iglobal : vGlobalIds) { + for (const auto& iglobal : allTrackIds) { const auto& trk = fwdTracks.iteratorAt(iglobal); auto dca = propagateGlobalToDCA(trk, col.posX(), col.posY(), col.posZ()); sumDCAxy += dca[0]; @@ -685,60 +708,80 @@ struct UpcCandProducerGlobalMuon { histRegistry.fill(HIST("hNCompatColls"), nCompatColls); - // Step 2: Select tracks with DCA quality cut - std::vector tracksToSave; - for (const auto& iglobal : vGlobalIds) { - const auto& trk = fwdTracks.iteratorAt(iglobal); - - // Apply DCA cut using best collision vertex + // Step 2: Write anchor tracks (MCH-MID-MFT) with DCA quality cut + constexpr double kMuonMass = o2::constants::physics::MassMuon; + uint16_t numContrib = 0; + double sumPx = 0., sumPy = 0., sumPz = 0., sumE = 0.; + for (const auto& ianchor : vAnchorIds) { if (hasVertex) { + const auto& trk = fwdTracks.iteratorAt(ianchor); auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); if (dca[0] > static_cast(fMaxDCAxy)) continue; } + if (!addToFwdTable(candId, ianchor, globalBcAnchor, 0., fwdTracks, mcFwdTrackLabels)) + continue; + const auto& trk = fwdTracks.iteratorAt(ianchor); + double p2 = trk.px() * trk.px() + trk.py() * trk.py() + trk.pz() * trk.pz(); + sumPx += trk.px(); + sumPy += trk.py(); + sumPz += trk.pz(); + sumE += std::sqrt(p2 + kMuonMass * kMuonMass); + numContrib++; + selTrackIds.push_back(ianchor); + } - // Check MFT acceptance and decide which track to use - if (isInMFTAcceptance(trk.eta())) { - // Inside MFT acceptance - use global track - tracksToSave.push_back(iglobal); - histRegistry.fill(HIST("hEtaMFT"), trk.eta()); - } else { - // Outside MFT acceptance - look for MCH-MID counterpart - auto itMid = mapGlobalBcsWithMCHMIDTrackIds.find(globalBcGlobal); - if (itMid != mapGlobalBcsWithMCHMIDTrackIds.end()) { - if (!itMid->second.empty()) { - tracksToSave.push_back(itMid->second[0]); - itMid->second.erase(itMid->second.begin()); - } - } - } + // Fill invariant mass from MCH-MID-MFT anchors only + uint16_t numContribAnch = numContrib; + if (numContribAnch >= 2) { + double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; + histRegistry.fill(HIST("hMassGlobalMuon"), mass2 > 0. ? std::sqrt(mass2) : 0.); } - // Step 3: Write tracks and event candidate with actual vertex position - uint16_t numContrib = 0; - for (const auto& trkId : tracksToSave) { - if (!addToFwdTable(candId, trkId, globalBcGlobal, 0., fwdTracks, mcFwdTrackLabels)) + // Step 3: Write matched MCH-MFT tracks with DCA quality cut and adjusted track time + for (const auto& [imchMft, gbc] : mapMchMftIdBc) { + if (hasVertex) { + const auto& trk = fwdTracks.iteratorAt(imchMft); + auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); + histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); + histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); + if (dca[0] > static_cast(fMaxDCAxy)) + continue; + } + if (!addToFwdTable(candId, imchMft, gbc, (gbc - globalBcAnchor) * o2::constants::lhc::LHCBunchSpacingNS, fwdTracks, mcFwdTrackLabels)) continue; + const auto& trk = fwdTracks.iteratorAt(imchMft); + double p2 = trk.px() * trk.px() + trk.py() * trk.py() + trk.pz() * trk.pz(); + sumPx += trk.px(); + sumPy += trk.py(); + sumPz += trk.pz(); + sumE += std::sqrt(p2 + kMuonMass * kMuonMass); numContrib++; - selTrackIds.push_back(trkId); + selTrackIds.push_back(imchMft); + } + + // Fill invariant mass including MCH-MFT tracks (only if MCH-MFT tracks were added) + if (numContrib > numContribAnch && numContrib >= 2) { + double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; + histRegistry.fill(HIST("hMassGlobalMuonWithMCHMFT"), mass2 > 0. ? std::sqrt(mass2) : 0.); } if (numContrib < 1) continue; - eventCandidates(globalBcGlobal, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); + eventCandidates(globalBcAnchor, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); std::vector amplitudesV0A{}; std::vector relBCsV0A{}; std::vector amplitudesT0A{}; std::vector relBCsT0A{}; if (nFV0s > 0) { - getFV0Amplitudes(globalBcGlobal, fv0s, fBcWindowFITAmps, mapGlobalBcWithV0A, amplitudesV0A, relBCsV0A); + getFV0Amplitudes(globalBcAnchor, fv0s, fBcWindowFITAmps, mapGlobalBcWithV0A, amplitudesV0A, relBCsV0A); } eventCandidatesSelsFwd(0., 0., amplitudesT0A, relBCsT0A, amplitudesV0A, relBCsV0A); if (nZdcs > 0) { - auto itZDC = mapGlobalBcWithZdc.find(globalBcGlobal); + auto itZDC = mapGlobalBcWithZdc.find(globalBcAnchor); if (itZDC != mapGlobalBcWithZdc.end()) { const auto& zdc = zdcs.iteratorAt(itZDC->second); float timeZNA = zdc.timeZNA(); @@ -821,7 +864,8 @@ struct UpcCandProducerGlobalMuon { vAmbFwdTrackIndexBCs.clear(); mapGlobalBcsWithMCHMIDTrackIds.clear(); mapGlobalBcsWithMCHTrackIds.clear(); - mapGlobalBcsWithGlobalTrackIds.clear(); + mapGlobalBcsWithGlobalMuonTrackIds.clear(); + mapGlobalBcsWithMCHMFTTrackIds.clear(); mapGlobalBCtoCollisions.clear(); selTrackIds.clear(); } From 3ab77c2b57ac21cc5b3e32f5c8d96319bafdca37 Mon Sep 17 00:00:00 2001 From: JaeyoonCho Date: Tue, 31 Mar 2026 18:21:44 +0900 Subject: [PATCH 116/282] [PWGHF] Add table for ML study to treeCreator (#15591) --- .../TableProducer/treeCreatorXicToXiPiPi.cxx | 165 ++++++++++++++++-- 1 file changed, 153 insertions(+), 12 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index 47748b4c30d..a21218a5eed 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -78,6 +78,9 @@ DECLARE_SOA_COLUMN(PtPi1, ptPi1, float); DECLARE_SOA_COLUMN(ImpactParameterPi1, impactParameterPi1, float); //! Normalised impact parameter of Pi1 (prong2) DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi1, impactParameterNormalisedPi1, float); //! Normalised impact parameter of Pi1 (prong2) DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs +DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class +DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt signal class +DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt signal class (3-class model only, -1 otherwise) } // namespace full DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", @@ -186,6 +189,37 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", hf_cand_xic_to_xi_pi_pi::DcaXYPi0Xi, hf_cand_xic_to_xi_pi_pi::DcaXYPi1Xi); +DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteMLs, "AOD", "HFXICXI2PIMLITE", + full::ParticleFlag, + hf_cand_mc_flag::OriginMcRec, + full::CandidateSelFlag, + full::Y, + full::Eta, + full::Phi, + full::P, + full::Pt, + full::M, + hf_cand_xic_to_xi_pi_pi::InvMassXi, + hf_cand_xic_to_xi_pi_pi::InvMassLambda, + full::DecayLength, + full::DecayLengthXY, + full::Cpa, + full::CpaXY, + hf_cand_xic_to_xi_pi_pi::CpaXi, + hf_cand_xic_to_xi_pi_pi::CpaXYXi, + hf_cand_xic_to_xi_pi_pi::CpaLambda, + hf_cand_xic_to_xi_pi_pi::CpaXYLambda, + full::ImpactParameterXi, + full::ImpactParameterNormalisedXi, + full::ImpactParameterPi0, + full::ImpactParameterNormalisedPi0, + full::ImpactParameterPi1, + full::ImpactParameterNormalisedPi1, + full::MaxNormalisedDeltaIP, + full::MlScoreBkg, + full::MlScorePrompt, + full::MlScoreNonPrompt); + DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", full::ParticleFlag, hf_cand_mc_flag::OriginMcRec, @@ -343,6 +377,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP", struct HfTreeCreatorXicToXiPiPi { Produces rowCandidateLite; Produces rowCandidateLiteKf; + Produces rowCandidateLiteMl; Produces rowCandidateFull; Produces rowCandidateFullKf; Produces rowCandidateFullParticles; @@ -356,10 +391,14 @@ struct HfTreeCreatorXicToXiPiPi { Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + static constexpr int kNumBinaryClasses = 2; + using SelectedCandidates = soa::Filtered>; using SelectedCandidatesKf = soa::Filtered>; + using SelectedCandidatesML = soa::Filtered>; using SelectedCandidatesMc = soa::Filtered>; using SelectedCandidatesKfMc = soa::Filtered>; + using SelectedCandidatesMcML = soa::Filtered>; using MatchedGenXicToXiPiPi = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= selectionFlagXic; @@ -372,9 +411,13 @@ struct HfTreeCreatorXicToXiPiPi { void init(InitContext const&) { + std::array doprocess{doprocessData, doprocessDataKf, doprocessDataWithML, doprocessMc, doprocessMcKf, doprocessMcWithML}; + if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { + LOGP(fatal, "Only one process function can be enabled at a time."); + } } - template + template void fillCandidateTable(const T& candidate) { int8_t particleFlag = candidate.sign(); @@ -383,7 +426,7 @@ struct HfTreeCreatorXicToXiPiPi { particleFlag = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } - if constexpr (!DoKf) { + if constexpr (!DoKf && !DoMl) { if (fillCandidateLiteTable) { rowCandidateLite( particleFlag, @@ -484,7 +527,7 @@ struct HfTreeCreatorXicToXiPiPi { candidate.nSigTofPiFromLambda(), candidate.nSigTofPrFromLambda()); } - } else { + } else if constexpr (DoKf) { if (fillCandidateLiteTable) { rowCandidateLiteKf( particleFlag, @@ -636,6 +679,47 @@ struct HfTreeCreatorXicToXiPiPi { candidate.dcaXYPi1Xi()); } } + if constexpr (DoMl) { + float mlScoreBkg = -1.f, mlScorePrompt = -1.f, mlScoreNonPrompt = -1.f; + const int scoreSize = static_cast(candidate.mlProbXicToXiPiPi().size()); + if (scoreSize > 0) { + mlScoreBkg = candidate.mlProbXicToXiPiPi()[0]; + mlScorePrompt = candidate.mlProbXicToXiPiPi()[1]; + if (scoreSize > kNumBinaryClasses) { + mlScoreNonPrompt = candidate.mlProbXicToXiPiPi()[2]; + } + } + rowCandidateLiteMl( + particleFlag, + originMc, + candidate.isSelXicToXiPiPi(), + candidate.y(o2::constants::physics::MassXiCPlus), + candidate.eta(), + candidate.phi(), + candidate.p(), + candidate.pt(), + candidate.invMassXicPlus(), + candidate.invMassXi(), + candidate.invMassLambda(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.cpa(), + candidate.cpaXY(), + candidate.cpaXi(), + candidate.cpaXYXi(), + candidate.cpaLambda(), + candidate.cpaXYLambda(), + candidate.impactParameter0(), + candidate.impactParameterNormalised0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised1(), + candidate.impactParameter2(), + candidate.impactParameterNormalised2(), + candidate.maxNormalisedDeltaIP(), + mlScoreBkg, + mlScorePrompt, + mlScoreNonPrompt); + } } void processData(SelectedCandidates const& candidates) @@ -653,10 +737,10 @@ struct HfTreeCreatorXicToXiPiPi { continue; } } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } - PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data with DCAFitter reconstruction", true); + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data with DCAFitter reconstruction", false); void processDataKf(SelectedCandidatesKf const& candidates) { @@ -673,11 +757,22 @@ struct HfTreeCreatorXicToXiPiPi { continue; } } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processDataKf, "Process data with KFParticle reconstruction", false); + void processDataWithML(SelectedCandidatesML const& candidates) + { + // Filling candidate properties + rowCandidateLiteMl.reserve(candidates.size()); + + for (const auto& candidate : candidates) { + fillCandidateTable(candidate); + } + } + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processDataWithML, "Process data with DCAFitter reconstruction and ML", false); + void processMc(SelectedCandidatesMc const& candidates, MatchedGenXicToXiPiPi const& particles) { @@ -689,7 +784,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recSig.size()); } for (const auto& candidate : recSig) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else if (fillOnlyBackground) { if (fillCandidateLiteTable) { @@ -702,7 +797,7 @@ struct HfTreeCreatorXicToXiPiPi { if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else { if (fillCandidateLiteTable) { @@ -711,7 +806,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(candidates.size()); } for (const auto& candidate : candidates) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } @@ -743,7 +838,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recSigKf.size()); } for (const auto& candidate : recSigKf) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else if (fillOnlyBackground) { if (fillCandidateLiteTable) { @@ -756,7 +851,7 @@ struct HfTreeCreatorXicToXiPiPi { if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else { if (fillCandidateLiteTable) { @@ -765,7 +860,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(candidates.size()); } for (const auto& candidate : candidates) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } @@ -785,6 +880,52 @@ struct HfTreeCreatorXicToXiPiPi { } } PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processMcKf, "Process MC with KF Particle reconstruction", false); + + void processMcWithML(SelectedCandidatesMcML const& candidates, + MatchedGenXicToXiPiPi const& particles) + { + // Filling candidate properties + rowCandidateLiteMl.reserve(candidates.size()); + if (fillOnlySignal) { + for (const auto& candidate : candidates) { + if (candidate.flagMcMatchRec() == int8_t(0)) { + continue; + } + fillCandidateTable(candidate); + } + } else if (fillOnlyBackground) { + for (const auto& candidate : candidates) { + if (candidate.flagMcMatchRec() != int8_t(0)) { + continue; + } + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { + continue; + } + fillCandidateTable(candidate); + } + } else { + for (const auto& candidate : candidates) { + fillCandidateTable(candidate); + } + } + + if (fillGenParticleTable) { + rowCandidateFullParticles.reserve(particles.size()); + for (const auto& particle : particles) { + rowCandidateFullParticles( + particle.flagMcMatchGen(), + particle.originMcGen(), + particle.pdgBhadMotherPart(), + particle.pt(), + particle.eta(), + particle.phi(), + RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus), + particle.decayLengthMcGen()); + } + } + } + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processMcWithML, "Process MC with DCAFitter reconstruction and ML", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 1ea9817f4c15e6f05acb2b009182fa5ac8b8af99 Mon Sep 17 00:00:00 2001 From: MattOckleton <149105337+MattOckleton@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:11:43 +0100 Subject: [PATCH 117/282] [PWGJE] Adding Matched MC function + dPhi fixes (#15551) --- PWGJE/Tasks/jetCorrelationD0.cxx | 200 +++++++++++++++++++------------ 1 file changed, 124 insertions(+), 76 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 44a912e7221..bba4f0273aa 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -14,24 +14,18 @@ /// \author Matthew Ockleton matthew.ockleton@cern.ch, University of Liverpool #include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGJE/Core/JetHFUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" #include "Common/Core/RecoDecay.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Logger.h" +#include "Framework/runDataProcessing.h" + #include #include #include @@ -58,12 +52,15 @@ DECLARE_SOA_TABLE(McCollisionTables, "AOD", "MCCOLLINFOTABLE", o2::soa::Index<>, d0collisionInfo::PosZ); +DECLARE_SOA_TABLE(MatchCollTables, "AOD", "MATCHCOLLTABLE", + o2::soa::Index<>, + d0collisionInfo::PosZ); + namespace collisionInfo { -// DECLARE_SOA_INDEX_COLUMN(CollisionTable, collisionTable); DECLARE_SOA_INDEX_COLUMN_CUSTOM(CollisionTable, collisionTable, "COLLINFOTABLES"); -// DECLARE_SOA_INDEX_COLUMN(McCollisionTable, mcCollisionTable); DECLARE_SOA_INDEX_COLUMN_CUSTOM(McCollisionTable, mcCollisionTable, "MCCOLLINFOTABLES"); +DECLARE_SOA_INDEX_COLUMN_CUSTOM(MatchCollTable, matchCollTable, "MATCHCOLLTABLES"); } // namespace collisionInfo namespace d0Info { @@ -84,7 +81,7 @@ DECLARE_SOA_COLUMN(D0PhiD, d0PhiD, float); DECLARE_SOA_COLUMN(D0Reflection, d0Reflection, int); } // namespace d0Info -DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0DATATABLE", +DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0TABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, d0Info::D0PromptBDT, @@ -114,11 +111,15 @@ DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0McPTable); DECLARE_SOA_COLUMN(JetPt, jetPt, float); DECLARE_SOA_COLUMN(JetEta, jetEta, float); DECLARE_SOA_COLUMN(JetPhi, jetPhi, float); +DECLARE_SOA_COLUMN(PJetPt, pJetPt, float); +DECLARE_SOA_COLUMN(PJetEta, pJetEta, float); +DECLARE_SOA_COLUMN(PJetPhi, pJetPhi, float); // D0-jet DECLARE_SOA_COLUMN(D0JetDeltaPhi, d0JetDeltaPhi, float); +DECLARE_SOA_COLUMN(D0JetDeltaPhiP, d0JetDeltaPhiP, float); } // namespace jetInfo -DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", +DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETTABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, jetInfo::D0DataTableId, @@ -127,37 +128,52 @@ DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", jetInfo::JetPhi, jetInfo::D0JetDeltaPhi); -DECLARE_SOA_TABLE_STAGED(JetMCPTables, "JETMCPTABLE", +DECLARE_SOA_TABLE_STAGED(JetMcPTables, "JETMCPTABLE", o2::soa::Index<>, collisionInfo::McCollisionTableId, jetInfo::D0McPTableId, jetInfo::JetPt, jetInfo::JetEta, jetInfo::JetPhi, - jetInfo::D0JetDeltaPhi); + jetInfo::D0JetDeltaPhiP); + +DECLARE_SOA_TABLE_STAGED(JetMatchedTables, "JETMATCHEDTABLE", + o2::soa::Index<>, + collisionInfo::MatchCollTableId, + jetInfo::JetPt, + jetInfo::JetEta, + jetInfo::JetPhi, + jetInfo::PJetPt, + jetInfo::PJetEta, + jetInfo::PJetPhi, + jetInfo::D0JetDeltaPhi, + jetInfo::D0JetDeltaPhiP); } // namespace o2::aod struct JetCorrelationD0 { // Define new table Produces tableCollision; + Produces tableMatchedCollision; Produces tableMcCollision; Produces tableD0; - Produces tableD0MCParticle; + Produces tableD0McParticle; Produces tableJet; - Produces tableJetMCParticle; + Produces tableJetMcParticle; + Produces tableJetMatched; // Configurables Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable skipMBGapEvents{"skipMBGapEvents", false, "decide to run over MB gap events or not"}; Configurable applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"}; - // 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"}; Configurable jetPtCutMin{"jetPtCutMin", 5.0, "minimum value of jet pt"}; Configurable d0PtCutMin{"d0PtCutMin", 1.0, "minimum value of d0 pt"}; + Configurable jetMcPtCutMin{"jetMcPtCutMin", 3.0, "minimum value of jet pt particle level"}; + Configurable d0McPtCutMin{"d0McPtCutMin", 0.5, "minimum value of d0 pt particle level"}; Configurable vertexZCut{"vertexZCut", 10.0, "Accepted z-vertex range"}; 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 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 pTHatAbsoluteMin{"pTHatAbsoluteMin", -99.0, "minimum value of pTHat"}; // Filters @@ -179,13 +195,14 @@ struct JetCorrelationD0 { registry.fill(HIST("hD0Phi"), d0.phi()); } template - void fillJetHistograms(T const& jet, U const& dphi) + void fillJetHistograms(T const& jet, U const& dPhi) { registry.fill(HIST("hJetPt"), jet.pt()); registry.fill(HIST("hJetEta"), jet.eta()); registry.fill(HIST("hJetPhi"), jet.phi()); registry.fill(HIST("hJet3D"), jet.pt(), jet.eta(), jet.phi()); - registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dphi); + registry.fill(HIST("h_Jet_D0_Jet_dPhi"), dPhi); + registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dPhi); } template @@ -199,26 +216,6 @@ struct JetCorrelationD0 { registry.fill(HIST("hZvtxSelected"), collision.posZ()); return true; } - - template - // Jetbase is an MCD jet. We then loop through jettagv(MCP jets) to test if they match - // void fillMatchedHistograms(T const& jetBase, float weight = 1.0) // float leadingTrackPtBase, - void fillMatchedHistograms(T const& jetsBase, U const&, float weight = 1.0, float rho = 0.0) - { - for (const auto& jetBase : jetsBase) { - if (jetBase.has_matchedJetGeo()) { // geometric matching - for (auto const& jetTag : jetBase.template matchedJetGeo_as>()) { - registry.fill(HIST("hPtMatched"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), weight); - registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight); - registry.fill(HIST("hPhiMatched"), jetBase.phi(), jetTag.phi(), weight); - registry.fill(HIST("hEtaMatched"), jetBase.eta(), jetTag.eta(), weight); - registry.fill(HIST("hPtResolution"), jetTag.pt(), (jetTag.pt() - (jetBase.pt() - (rho * jetBase.area()))) / jetTag.pt(), weight); - registry.fill(HIST("hPhiResolution"), jetTag.pt(), jetTag.phi() - jetBase.phi(), weight); - registry.fill(HIST("hEtaResolution"), jetTag.pt(), jetTag.eta() - jetBase.eta(), weight); - } - } - } - } void init(InitContext const&) { eventSelectionBits = jetderiveddatautilities::initialiseEventSelectionBits(static_cast(eventSelections)); @@ -246,6 +243,7 @@ struct JetCorrelationD0 { registry.add("hJetEta", "jet #eta;#eta_{jet};entries", HistType::kTH1F, {axisEta}); registry.add("hJetPhi", "jet #phi;#phi_{jet};entries", HistType::kTH1F, {axisPhi}); registry.add("hJet3D", "3D jet distribution;p_{T};#eta;#phi", {HistType::kTH3F, {{500, -100, 400}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}}); + registry.add("h_Jet_D0_Jet_dPhi", "#Delta #phi _{D^{0}, jet}", kTH1F, {{100, 0, o2::constants::math::TwoPI}}); registry.add("h_Jet_pT_D0_Jet_dPhi", "p_{T, jet} vs #Delta #phi _{D^{0}, jet}", kTH2F, {{100, 0, 100}, {100, 0, o2::constants::math::TwoPI}}); // Matching histograms @@ -284,23 +282,23 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // this is quite loose instead of pi/2 could do 0.6 + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); + fillJetHistograms(jet, dPhi); tableJet(tableCollision.lastIndex(), tableD0.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } PROCESS_SWITCH(JetCorrelationD0, processData, "charged particle level jet analysis", true); - void processMCDetector(soa::Filtered::iterator const& collision, + void processMcDetector(soa::Filtered::iterator const& collision, aod::CandidatesD0MCD const& d0Candidates, soa::Join const& jets) { @@ -327,60 +325,110 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // this is quite loose instead of pi/2 could do 0.6 + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); + fillJetHistograms(jet, dPhi); tableJet(tableCollision.lastIndex(), tableD0.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } - PROCESS_SWITCH(JetCorrelationD0, processMCDetector, "charged particle level jet analysis", false); + PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged detector level jet analysis", false); - void processMCParticle(aod::JetMcCollision const& collision, - aod::CandidatesD0MCP const& d0MCPCandidates, - soa::Filtered> const& jets) + void processMcParticle(aod::JetMcCollision const& collision, + aod::CandidatesD0MCP const& d0McPCandidates, + soa::Join const& jets) { - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // build without this + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { return; } tableMcCollision(collision.posZ()); - for (const auto& d0MCPCandidate : d0MCPCandidates) { - if (d0MCPCandidate.pt() < d0PtCutMin) { + for (const auto& d0McPCandidate : d0McPCandidates) { + if (d0McPCandidate.pt() < d0McPtCutMin) { continue; } - tableD0MCParticle(tableCollision.lastIndex(), - d0MCPCandidate.originMcGen(), - d0MCPCandidate.pt(), - d0MCPCandidate.eta(), - d0MCPCandidate.phi(), - d0MCPCandidate.y()); + tableD0McParticle(tableMcCollision.lastIndex(), + d0McPCandidate.originMcGen(), + d0McPCandidate.pt(), + d0McPCandidate.eta(), + d0McPCandidate.phi(), + d0McPCandidate.y()); for (const auto& jet : jets) { - if (jet.pt() < jetPtCutMin) { + if (jet.pt() < jetMcPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0MCPCandidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); - tableJetMCParticle(tableCollision.lastIndex(), - tableD0MCParticle.lastIndex(), + fillJetHistograms(jet, dPhi); + tableJetMcParticle(tableMcCollision.lastIndex(), + tableD0McParticle.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); + } + } + } + PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "charged MC Particle jets", false); + + void processMcMatched(soa::Filtered::iterator const& collision, + aod::CandidatesD0MCD const& d0Candidates, + aod::JetTracksMCD const& tracks, + aod::JetParticles const& particles, + soa::Join const& McDJets, + aod::ChargedMCParticleLevelJets const&) + { + if (!applyCollisionSelections(collision)) { + return; + } + tableMatchedCollision(collision.posZ()); + for (const auto& d0Candidate : d0Candidates) { + if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here + continue; + } + bool isMatched = false; + const auto& d0Particle = jethfutilities::matchedHFParticle(d0Candidate, tracks, particles, isMatched); + if (!isMatched) { + continue; + } + for (const auto& McDJet : McDJets) { + if (McDJet.pt() < jetPtCutMin) { + continue; + } + float dPhiD = RecoDecay::constrainAngle(McDJet.phi() - d0Candidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + continue; + } + if (McDJet.has_matchedJetGeo()) { // geometric matching + for (auto const& McPJet : McDJet.template matchedJetGeo_as()) { + float dPhiP = RecoDecay::constrainAngle(McPJet.phi() - d0Particle.phi(), -o2::constants::math::PI); + // if (std::abs(dPhiP - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + // continue; + // } + tableJetMatched(tableMatchedCollision.lastIndex(), + McDJet.pt(), + McDJet.eta(), + McDJet.phi(), + McPJet.pt(), + McPJet.eta(), + McPJet.phi(), + dPhiD, + dPhiP); + } + } } } } - PROCESS_SWITCH(JetCorrelationD0, processMCParticle, "process MC Particle jets", false); + PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of particle level jets to detector level jets", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 707c89c05b63d5609d9d353ca4a26308ed6ca4c0 Mon Sep 17 00:00:00 2001 From: pravatp98 <158029188+pravatp98@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:12:27 +0530 Subject: [PATCH 118/282] [PWGCF] Efficiency Correction added (#15568) --- .../EbyEFluctuations/Tasks/nchCumulantsId.cxx | 1097 +++++++++++++++-- 1 file changed, 1007 insertions(+), 90 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx index 3f683b99589..3cfea59e573 100644 --- a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx @@ -20,6 +20,7 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "CCDB/BasicCCDBManager.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -28,7 +29,10 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" +#include + #include +#include #include using namespace o2; @@ -37,9 +41,59 @@ using namespace o2::framework::expressions; using namespace o2::constants::physics; // for constants using namespace std; +#define ID_BIT_PI 0 // Identificationi bits for PID checks +#define ID_BIT_KA 1 +#define ID_BIT_PR 2 +#define ID_BIT_EL 3 +#define ID_BIT_DE 4 + +#define BITSET(mask, ithBit) ((mask) |= (1 << (ithBit))) // avoid name bitset as std::bitset is already there +#define BITCHECK(mask, ithBit) ((mask) & (1 << (ithBit))) // bit check will return int value, not bool, use BITCHECK != 0 in Analysi + +enum PidEnum { + kCh = 0, + kPi, // dont use kPion, kKaon, as these enumeration + kKa, // are already defined in $ROOTSYS/root/include/TPDGCode.h + kPr, + kEl, + kDe +}; + +enum ChargeEnum { + kPos = 0, + kNeg = 1 +}; + +static constexpr std::string_view PidDire[] = { + "Ch/", + "Pi/", + "Ka/", + "Pr/", + "El/", + "De/"}; + +static constexpr std::string_view ChargeDire[] = { + "Pos/", + "Neg/"}; + +std::string getModifiedStr(const std::string& myString) +{ + size_t pos = myString.rfind('/'); + if (pos != std::string::npos) { + std::string subString = myString.substr(0, pos); // remove "/" from end of the string + return subString; + } else { + return myString; + } +} + struct NchCumulantsId { HistogramRegistry hist{"hist", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry recoTracks{"recoTracks", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry genAnalysis{"genAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry recoAnalysis{"recoAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry purityAnalysis{"purityAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject}; // PDG data base Service pdgDB; @@ -50,6 +104,17 @@ struct NchCumulantsId { Configurable cfgCutEta{"cfgCutEta", 0.8, "cut for eta"}; Configurable cfgCutPtMax{"cfgCutPtMax", 3.0, "max cut for pT"}; Configurable cfgCutPtMin{"cfgCutPtMin", 0.15, "min cut for pT"}; + Configurable netChBin{"netChBin", 160, "bins for netch"}; + Configurable netChMax{"netChMax", 80.0, "max for netch"}; + Configurable netChMin{"netChMin", -80.0, "min for netch"}; + Configurable chBins{"chBins", 501, "bins for ch"}; + Configurable chMax{"chMax", 500.0, "max for ch"}; + Configurable chMin{"chMin", -1.0, "min for ch"}; + Configurable midRapMax{"midRapMax", 1000.0, "max for midrapmult"}; + Configurable midRapBins{"midRapBins", 1001, "bins for midrapmult"}; + + Configurable checkCollPosZMc{"checkCollPosZMc", false, "checkCollPosZMc"}; + Configurable flagUnusedVariableError{"flagUnusedVariableError", false, "flagUnusedVariableError"}; // Configurables for particle Identification Configurable cfgId01CheckVetoCut{"cfgId01CheckVetoCut", false, "cfgId01CheckVetoCut"}; @@ -101,12 +166,60 @@ struct NchCumulantsId { Configurable cfgVetoId10DeTOF{"cfgVetoId10DeTOF", 3.0, "cfgVetoId10DeTOF"}; } cfgVetoIdCut; + struct : ConfigurableGroup { + Configurable cfgCCDB01URL{"cfgCCDB01URL", "http://ccdb-test.cern.ch:8080", "cfgCCDB01URL"}; + Configurable cfgCCDB02Path{"cfgCCDB02Path", "Users/p/ppanigra/NchCumulants/correctionWeights/", "cfgCCDB02Path"}; + Configurable cfgCCDB03SOR{"cfgCCDB03SOR", 1, "cfgCCDB03SOR"}; + Configurable cfgCCDB04StrHistP{"cfgCCDB04StrHistP", "h01_p", "cfgCCDB04StrHistP"}; + Configurable cfgCCDB05StrHistPt{"cfgCCDB05StrHistPt", "h02_pt", "cfgCCDB05StrHistPt"}; + Configurable cfgCCDB06StrHistPtEta{"cfgCCDB06StrHistPtEta", "h20_pt_eta", "cfgCCDB06StrHistPtEta"}; + } cfgCCDB; + + struct : ConfigurableGroup { + Configurable printDebugMessages{"printDebugMessages", false, "printDebugMessages"}; + Configurable resetHistograms{"resetHistograms", false, "resetHistograms"}; + } cfgDebug; + + // Efficieny containing Histograms. + TH2F* hPtEtaForBinSearch = nullptr; + std::vector> hPtEtaForEffCorrection{kDe + 1, std::array{}}; + void init(InitContext const&) { + auto& mgr = o2::ccdb::BasicCCDBManager::instance(); + mgr.setURL(cfgCCDB.cfgCCDB01URL); + mgr.setCaching(true); + auto ccdbObj = mgr.getForTimeStamp(cfgCCDB.cfgCCDB02Path, cfgCCDB.cfgCCDB03SOR); + if (!ccdbObj) { + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: CCDB OBJECT NOT FOUND"; + } else { + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: CCDB OBJECT FOUND"; + } + + ccdbObj->Print(); + + hPtEtaForBinSearch = reinterpret_cast(ccdbObj->FindObject("hPtEta")); + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: Obj Name = " << hPtEtaForBinSearch->GetName() << " :: entries = " << hPtEtaForBinSearch->GetEntries(); + std::string name = ""; + for (int i = 0; i <= kDe; i++) { + for (int j = 0; j < (kNeg + 1); j++) { + name = "hPtEta" + getModifiedStr(static_cast(PidDire[i])) + getModifiedStr(static_cast(ChargeDire[j])); + hPtEtaForEffCorrection[i][j] = reinterpret_cast(ccdbObj->FindObject(name.c_str())); + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: Obj Name = " << hPtEtaForEffCorrection[i][j]->GetName() << " :: entries = " << hPtEtaForBinSearch->GetEntries(); + } + } + + mgr.setURL("http://alice-ccdb.cern.ch"); // RESET the URL otherwise the other process functions which contains ccdb lookups will fail + // QA check axes const AxisSpec axisEvents{1, 0, 1, "Counts"}; const AxisSpec axisEta{100, -1., +1., "#eta"}; - const AxisSpec axisPt{100, 0., 3., "p_{T} (GeV/c)"}; + const AxisSpec axisRapidity{200, -5, 5, "Rapidity (y)"}; + const AxisSpec axisPt{100, 0., 5., "p_{T} (GeV/c)"}; const AxisSpec axisP{100, 0., 5., "p (GeV/c)"}; const AxisSpec axisTPCInnerParam{100, 0, 3, "P_innerParam_Gev"}; const AxisSpec axisdEdx(100, 20, 500, {"#frac{dE}{dx}"}); @@ -123,16 +236,16 @@ struct NchCumulantsId { const AxisSpec axisTOFNSigma = {200, -10.0, 10.0, "n#sigma_{TOF}"}; const AxisSpec axisTOFExpMom = {200, 0.0f, 10.0f, "#it{p}_{tofExpMom} (GeV/#it{c})"}; - const AxisSpec axisNch(100, -50, 50, "Net_charge_dN"); - const AxisSpec axisPosCh(1001, -1, 1000, "Pos_charge"); - const AxisSpec axisNegCh(1001, -1, 1000, "Neg_charge"); - const AxisSpec axisNt(5001, -1, 5000, "Mult_midRap_Nch"); - const AxisSpec axisPrCh(101, -1, 100, "Pr_charge"); - const AxisSpec axisAPrCh(101, -1, 100, "APr_charge"); - const AxisSpec axisKaCh(101, -1, 100, "Ka_charge"); - const AxisSpec axisAKaCh(101, -1, 100, "AKa_charge"); - const AxisSpec axisPiCh(1001, -1, 1000, "Pion_Positive"); - const AxisSpec axisAPiCh(1001, -1, 1000, "Pion_Negative"); + const AxisSpec axisNch(netChBin, netChMin, netChMax, "Net_charge_dN"); + const AxisSpec axisPosCh(chBins, chMin, chMax, "Pos_charge"); + const AxisSpec axisNegCh(chBins, chMin, chMax, "Neg_charge"); + const AxisSpec axisNt(midRapBins, chMin, midRapMax, "Mult_midRap_Nch"); + const AxisSpec axisPrCh(chBins, chMin, chMax, "Pr_charge"); + const AxisSpec axisAPrCh(chBins, chMin, chMax, "APr_charge"); + const AxisSpec axisKaCh(chBins, chMin, chMax, "Ka_charge"); + const AxisSpec axisAKaCh(chBins, chMin, chMax, "AKa_charge"); + const AxisSpec axisPiCh(chBins, chMin, chMax, "Pion_Positive"); + const AxisSpec axisAPiCh(chBins, chMin, chMax, "Pion_Negative"); HistogramConfigSpec qnHist1({HistType::kTHnSparseD, {axisNch, axisPosCh, axisNegCh, axisPrCh, axisAPrCh, axisKaCh, axisAKaCh, axisNt, axisCent}}); HistogramConfigSpec qnHist2({HistType::kTHnSparseD, {axisNch, axisPosCh, axisNegCh, axisPiCh, axisAPiCh, axisKaCh, axisAKaCh, axisNt, axisCent}}); @@ -153,6 +266,8 @@ struct NchCumulantsId { HistogramConfigSpec histTofExpMomTofNSigma({HistType::kTH2F, {axisTOFExpMom, axisTOFNSigma}}); HistogramConfigSpec histTpcNSigmaTofNSigma({HistType::kTH2F, {axisTPCNSigma, axisTOFNSigma}}); + HistogramConfigSpec histPtMc({HistType::kTH1F, {axisPt}}); + // QA check histos hist.add("QA/events/preSel/h_VtxZ", "V_{Z}", kTH1D, {axisVtxZ}); @@ -222,8 +337,137 @@ struct NchCumulantsId { hist.add("sparse1", "sparse1", qnHist1); hist.add("sparse2", "sparse2", qnHist2); + + hist.add("sim/gen/sparse1", "sparse1", qnHist1); + hist.add("sim/gen/sparse2", "sparse2", qnHist2); + + hist.add("sim/reco/sparse1", "sparse1", qnHist1); + hist.add("sim/reco/sparse2", "sparse2", qnHist2); + + hist.add("sim/purity/sparse1", "sparse1", qnHist1); + hist.add("sim/purity/sparse2", "sparse2", qnHist2); + + recoAnalysis.add("recoAnalysis/Pi/Pos/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/Ka/"); + recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/Pr/"); + // recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/El/"); + // recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/De/"); + recoAnalysis.add("recoAnalysis/Charge/Pos/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + genAnalysis.add("genAnalysis/Pi/Pos/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Pi/Pos/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Pi/Pos/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Pi/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Pi/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Pi/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + genAnalysis.add("genAnalysis/Pi/Neg/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Pi/Neg/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Pi/Neg/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Pi/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Pi/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Pi/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/Ka/"); + genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/Pr/"); + // genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/El/"); + // genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/De/"); + + genAnalysis.add("genAnalysis/Charge/Pos/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Charge/Pos/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Charge/Pos/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Charge/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Charge/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Charge/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + genAnalysis.add("genAnalysis/Charge/Neg/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Charge/Neg/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Charge/Neg/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Charge/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Charge/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Charge/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + purityAnalysis.add("purityAnalysis/Charge/Pos/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + purityAnalysis.add("purityAnalysis/Pi/Pos/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/Ka/"); + purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/Pr/"); + // purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/El/"); + // purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/De/"); + } // init ends + static constexpr std::string_view HistRegDire2[] = { + "v0Table/Full/", + "v0Table/postK0sCheck/", + "v0Table/postMassCut/", + "v0Table/postSelectionCut/", + "recoK0s/PreSel/", + "recoK0s/PostSel/", + "recoTracks/PreSel/", + "recoTracks/PostSel/", + "recoAnalysis/", + "genAnalysis/", + "purityAnalysis/"}; + + enum HistRegEnum2 { + v0Full = 0, + v0PostK0sCheck, + v0PostMassCut, + v0PostSelectionCut, + recoK0sPreSel, + recoK0sPostSel, + recoTracksPreSel, + recoTracksPostSel, + recoAnalysisDir, + genAnalysisDir, + purityAnalysisDir + }; + enum IdentificationType { kTPCidentified = 0, kTOFidentified, @@ -255,7 +499,7 @@ struct NchCumulantsId { qaEventPostSel, qaTracksPreSel, qaTracksPostSel, - qaTracksIdfd + qaTracksIdfd, }; static constexpr std::string_view HistRegDire[] = { @@ -265,21 +509,14 @@ struct NchCumulantsId { "QA/tracks/postSel/", "QA/tracks/Idfd/"}; - enum PidEnum { - kPi = 0, // dont use kPion, kKaon, as these enumeration - kKa, // are already defined in $ROOTSYS/root/include/TPDGCode.h - kPr, - kEl, - kDe + enum ProcessTypeEnum { + doDataProcessing = 0, + doRecoProcessing, + doPurityProcessing, + doGenProcessing, + doSimProcessing }; - static constexpr std::string_view PidDire[] = { - "Pi/", - "Ka/", - "Pr/", - "El/", - "De/"}; - // particle identifications // tpc Selections @@ -648,10 +885,145 @@ struct NchCumulantsId { fillIdentificationQA(hist, track); // Look at Proton } - using MyAllTracks = soa::Join; + template + void fillGenTrackQA(HistogramRegistry& r, const TrackType& t) + { + auto base = + HIST(HistRegDire2[DIR]) + + HIST(PidDire[P]) + + HIST(ChargeDire[C]); + r.fill(base + HIST("h12_p"), t.p()); + r.fill(base + HIST("h13_pt"), t.pt()); + r.fill(base + HIST("h14_eta"), t.eta()); + r.fill(base + HIST("h15_phi"), t.phi()); + r.fill(base + HIST("h16_rapidity"), t.y()); + r.fill(base + HIST("h20_pt_eta"), t.pt(), t.eta()); + } + + template + void fillRecoTrackQA(HistogramRegistry& r, const TrackType& t) + { + auto base = + HIST(HistRegDire2[DIR]) + + HIST(PidDire[P]) + + HIST(ChargeDire[C]); + r.fill(base + HIST("h12_p"), t.p()); + r.fill(base + HIST("h13_pt"), t.pt()); + r.fill(base + HIST("h14_eta"), t.eta()); + r.fill(base + HIST("h15_phi"), t.phi()); + r.fill(base + HIST("h16_rapidity"), t.y()); + r.fill(base + HIST("h20_pt_eta"), t.pt(), t.eta()); + } + + template + void fillPurityTrackQA(HistogramRegistry& r, const TrackType& t) + { + auto base = + HIST(HistRegDire2[DIR]) + + HIST(PidDire[P]) + + HIST(ChargeDire[C]); + r.fill(base + HIST("h12_p"), t.p()); + r.fill(base + HIST("h13_pt"), t.pt()); + r.fill(base + HIST("h14_eta"), t.eta()); + r.fill(base + HIST("h15_phi"), t.phi()); + r.fill(base + HIST("h16_rapidity"), t.y()); + r.fill(base + HIST("h20_pt_eta"), t.pt(), t.eta()); + } + + template + void executeTrackAnalysisPart(const T& track, const int& trackIdTag, float& nP, float& nM, + const int& idMethodPi, const bool& trackIsPion, float& nAPi, float& nPi, + const int& idMethodKa, const bool& trackIsKaon, float& nAKa, float& nKa, + const int& idMethodPr, const bool& trackIsProton, float& nPr, float& nAPr, H& recoAnalysis) + { + if (flagUnusedVariableError) + LOG(info) << trackIdTag << idMethodPi << ":" << idMethodKa << ":" << idMethodPr; + if (track.sign() > 0) { + // fillRecoTrackQA(recoAnalysis, track); + nP++; + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h20_pt_eta"), track.pt(), track.eta()); + } + if (track.sign() < 0) { + // fillRecoTrackQA(recoAnalysis, track); + nM++; + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h20_pt_eta"), track.pt(), track.eta()); + } + + if (trackIsPion) { + // if (idMethodPi == kTPCidentified) { + // fillIdentificationQA(hist, track); // set hist as recoAnalysis after tpcId etc add true + // } else if (idMethodPi == kTPCTOFidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodPi == kUnidentified) { + // fillIdentificationQA(hist, track); + // } + if (track.sign() > 0) { + nPi++; + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPi++; + fillRecoTrackQA(recoAnalysis, track); + } + // fillRecoTrackQA(recoAnalysis, track); + } + if (trackIsKaon) { + // if (idMethodKa == kTPCidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodKa == kTPCTOFidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodKa == kUnidentified) { + // fillIdentificationQA(hist, track); + // } + if (track.sign() > 0) { + nKa++; + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAKa++; + fillRecoTrackQA(recoAnalysis, track); + } + // fillRecoTrackQA(recoAnalysis, track); + } + if (trackIsProton) { + // if (idMethodPr == kTPCidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodPr == kTPCTOFidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodPr == kUnidentified) { + // fillIdentificationQA(hist, track); + // } + if (track.sign() > 0) { + nPr++; + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPr++; + fillRecoTrackQA(recoAnalysis, track); + } + // fillRecoTrackQA(recoAnalysis, track); + } + + // recoAnalysis.fill(HIST("recoAnalysis/SelectedTrack_IdentificationTag"), trackIdTag); + } + + using MyAllTracks = soa::Join; using MyCollisions = soa::Join; + + using MyTracksWithMclabels = soa::Join; + using MyCollisionsWithMcLabels = soa::Join; + // tracks and collision filters Filter col = aod::evsel::sel8 == true; Filter colFilter = nabs(aod::collision::posZ) < cfgCutPosZ; @@ -664,94 +1036,639 @@ struct NchCumulantsId { using MyFilteredCol = soa::Filtered; using MyFilteredTracks = soa::Filtered; + using MyFilteredColsWithMcLabels = soa::Filtered; + using MyFilteredTracksWithMcLabels = soa::Filtered; + // manual sliceby SliceCache cache; + Preslice tracksPerCollisionPreslice = o2::aod::track::collisionId; + Preslice mctracksPerCollisionPreslice = o2::aod::track::collisionId; - void process(MyFilteredCol const& collisions, MyFilteredTracks const& tracks) + template + void executeAnalysis(const C& collisions, const T& tracks) { - for (const auto& col : collisions) { - - int nP = 0; - int nM = 0; - int nCh = 0; - int nT = 0; - int nPr = 0; - int nAPr = 0; - int nKa = 0; - int nAKa = 0; - int nPi = 0; - int nAPi = 0; - // group tracks manually with corresponding collision using col id; - const uint64_t collIdx = col.globalIndex(); - const auto tracksTablePerColl = tracks.sliceBy(tracksPerCollisionPreslice, collIdx); - - for (const auto& track : tracksTablePerColl) { - - fillTrackQA(track); - - if (track.sign() == 1) { - nP++; - } - if (track.sign() == -1) { - nM++; - } + float nP = 0; + float nM = 0; + float nCh = 0; + float nT = 0; + float nPr = 0; + float nAPr = 0; + float nKa = 0; + float nAKa = 0; + float nPi = 0; + float nAPi = 0; + + bool trackIsPion = false; + bool trackIsKaon = false; + bool trackIsProton = false; + + int trackIdTag = 0; + int idMethodPi = kUnidentified; + int idMethodKa = kUnidentified; + int idMethodPr = kUnidentified; + + int ptEtaBin = -1; + + if constexpr (analysisType == doDataProcessing) { + for (const auto& col : collisions) { + nP = 0; + nM = 0; + nCh = 0; + nT = 0; + nPr = 0; + nAPr = 0; + nKa = 0; + nAKa = 0; + nPi = 0; + nAPi = 0; + + // group tracks manually with corresponding collision using col id; + const uint64_t collIdx = col.globalIndex(); + const auto tracksTablePerColl = tracks.sliceBy(tracksPerCollisionPreslice, collIdx); + + for (const auto& track : tracksTablePerColl) { + + ptEtaBin = hPtEtaForBinSearch->FindBin(track.pt(), track.eta()); // Find Track Bin for efficiency correction + + fillTrackQA(track); - int idMethod; - // pion - if (selPion(track, idMethod)) { if (track.sign() == 1) { - nPi++; + // nP++; + nP += hPtEtaForEffCorrection[kCh][kPos]->GetBinContent(ptEtaBin); } if (track.sign() == -1) { - nAPi++; + nM += hPtEtaForEffCorrection[kCh][kNeg]->GetBinContent(ptEtaBin); } - if (idMethod == kTPCidentified) - fillIdentificationQA(hist, track); - if (idMethod == kTPCTOFidentified) - fillIdentificationQA(hist, track); - } - // kaon - if (selKaon(track, idMethod)) { - if (track.sign() == 1) { - nKa++; + int idMethod; + // pion + if (selPion(track, idMethod)) { + if (track.sign() == 1) { + nPi += hPtEtaForEffCorrection[kPi][kPos]->GetBinContent(ptEtaBin); + } + if (track.sign() == -1) { + nAPi += hPtEtaForEffCorrection[kPi][kNeg]->GetBinContent(ptEtaBin); + } + + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); } - if (track.sign() == -1) { - nAKa++; + // kaon + if (selKaon(track, idMethod)) { + if (track.sign() == 1) { + nKa += hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); + } + if (track.sign() == -1) { + nAKa += hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); + } + + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); } + // proton + if (selProton(track, idMethod)) { + if (track.sign() == 1) { + nPr += hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); + } + if (track.sign() == -1) { + nAPr += hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); + } + + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); + } + } // track loop ends + nCh = nP - nM; + nT = nP + nM; + + fillCollQA(col, nCh, nT); - if (idMethod == kTPCidentified) - fillIdentificationQA(hist, track); - if (idMethod == kTPCTOFidentified) - fillIdentificationQA(hist, track); + hist.fill(HIST("sparse1"), nCh, nP, nM, nPr, nAPr, nKa, nAKa, nT, col.centFT0M()); + hist.fill(HIST("sparse2"), nCh, nP, nM, nPi, nAPi, nKa, nAKa, nT, col.centFT0M()); + + } // collision loop ends + } else if constexpr (analysisType == doRecoProcessing || analysisType == doPurityProcessing) { + + for (const auto& col : collisions) { + + if (!col.has_mcCollision()) { + LOG(warning) << "No MC collision for this collision, skip..."; + continue; } - // proton - if (selProton(track, idMethod)) { - if (track.sign() == 1) { - nPr++; + float nP = 0; + float nM = 0; + float nCh = 0; + float nT = 0; + float nPr = 0; + float nAPr = 0; + float nKa = 0; + float nAKa = 0; + float nPi = 0; + float nAPi = 0; + // group tracks manually with corresponding collision using col id; + const uint64_t collIdx = col.globalIndex(); + const auto tracksTablePerColl = tracks.sliceBy(mctracksPerCollisionPreslice, collIdx); + + for (const auto& track : tracksTablePerColl) { + + if (!track.has_mcParticle()) { + LOG(warning) << "No MC Particle for this track, skip..."; + continue; } - if (track.sign() == -1) { - nAPr++; + + auto mcPart = track.mcParticle(); + + fillTrackQA(track); + + // Do Proper Track Identification + trackIsPion = false; + trackIsKaon = false; + trackIsProton = false; + + trackIdTag = 0; + idMethodPi = kUnidentified; + idMethodKa = kUnidentified; + idMethodPr = kUnidentified; + + if (selPion(track, idMethodPi)) { + trackIsPion = true; + BITSET(trackIdTag, ID_BIT_PI); } + if (selKaon(track, idMethodKa)) { + trackIsKaon = true; + BITSET(trackIdTag, ID_BIT_KA); + } + if (selProton(track, idMethodPr)) { + trackIsProton = true; + BITSET(trackIdTag, ID_BIT_PR); + } + + if constexpr (analysisType == doPurityProcessing) { + if (trackIsPion) { + if (track.sign() > 0 && mcPart.pdgCode() != kPiPlus) { + trackIsPion = false; + } + if (track.sign() < 0 && mcPart.pdgCode() != kPiMinus) { + trackIsPion = false; + } + } + if (trackIsKaon) { + if (track.sign() > 0 && mcPart.pdgCode() != kKPlus) { + trackIsKaon = false; + } + if (track.sign() < 0 && mcPart.pdgCode() != kKMinus) { + trackIsKaon = false; + } + } + if (trackIsProton) { + if (track.sign() > 0 && mcPart.pdgCode() != kProton) { + trackIsProton = false; + } + if (track.sign() < 0 && mcPart.pdgCode() != kProtonBar) { + trackIsProton = false; + } + } + } + + executeTrackAnalysisPart(track, trackIdTag, nP, nM, + idMethodPi, trackIsPion, nAPi, nPi, + idMethodKa, trackIsKaon, nAKa, nKa, + idMethodPr, trackIsProton, nPr, nAPr, recoAnalysis); - if (idMethod == kTPCidentified) - fillIdentificationQA(hist, track); - if (idMethod == kTPCTOFidentified) - fillIdentificationQA(hist, track); + } // track itteration ends + + nCh = nP - nM; + nT = nP + nM; + + fillCollQA(col, nCh, nT); + + hist.fill(HIST("sparse1"), nCh, nP, nM, nPr, nAPr, nKa, nAKa, nT, col.centFT0M()); + hist.fill(HIST("sparse2"), nCh, nP, nM, nPi, nAPi, nKa, nAKa, nT, col.centFT0M()); + + } // collision ends + } + } + + void processRun3(MyFilteredCol const& collisions, MyFilteredTracks const& tracks) + { + executeAnalysis(collisions, tracks); + } + PROCESS_SWITCH(NchCumulantsId, processRun3, "Process for Run-3", false); + + void processMcRecco(MyFilteredColsWithMcLabels const& collisions, MyFilteredTracksWithMcLabels const& tracks, aod::McParticles const&) + { + executeAnalysis(collisions, tracks); + } + PROCESS_SWITCH(NchCumulantsId, processMcRecco, "Process for MC Recco", false); + + void processPurity(MyFilteredColsWithMcLabels const& collisions, MyFilteredTracksWithMcLabels const& tracks, aod::McParticles const&) + { + executeAnalysis(collisions, tracks); + } + PROCESS_SWITCH(NchCumulantsId, processPurity, "Process for MC generated purity", false); + // process fun is over + + // process for truth and response matrix starts now + + Preslice mcTracksPerMcCollisionPreslice = o2::aod::mcparticle::mcCollisionId; + + using MyMcCollisions = aod::McCollisions; + + void processGen(MyMcCollisions const&, MyFilteredColsWithMcLabels const& collisions, aod::McParticles const& mcParticles) + { + for (const auto& col : collisions) { + if (!col.has_mcCollision()) { + LOG(warning) << "No MC collision for this event, skip..."; + continue; + } + const auto& mcColl = col.mcCollision(); + + // ---- apply same Vz cut as data/reco ---- + if (std::abs(mcColl.posZ()) > cfgCutPosZ) { + continue; // reject GEN events outside acceptance + } + // slice MCParticles for this MC collision + const auto mcTracksTablePerMcColl = mcParticles.sliceBy(mcTracksPerMcCollisionPreslice, mcColl.globalIndex()); + + float nP = 0; + float nM = 0; + float nCh = 0; + float nT = 0; + float nPr = 0; + float nAPr = 0; + float nKa = 0; + float nAKa = 0; + float nPi = 0; + float nAPi = 0; + for (const auto& mcTrack : mcTracksTablePerMcColl) { + if (!mcTrack.isPhysicalPrimary()) { + continue; + } + // pt / eta acceptance (same as RECO acceptance) + if (mcTrack.pt() <= cfgCutPtMin || + mcTrack.pt() >= cfgCutPtMax || + std::abs(mcTrack.eta()) >= cfgCutEta) { + continue; } - } // track itteration ends + int pdg = mcTrack.pdgCode(); + + if (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron) { + nP++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } else if (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron) { + nM++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } + // ----- Pions ----- + if (pdg == kPiPlus) { + nPi++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kPiMinus) { + nAPi++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKPlus) { + nKa++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKMinus) { + nAKa++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProton) { + nPr++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProtonBar) { + nAPr++; + fillGenTrackQA(genAnalysis, mcTrack); + } + } nCh = nP - nM; nT = nP + nM; - fillCollQA(col, nCh, nT); - hist.fill(HIST("sparse1"), nCh, nP, nM, nPr, nAPr, nKa, nAKa, nT, col.centFT0M()); hist.fill(HIST("sparse2"), nCh, nP, nM, nPi, nAPi, nKa, nAKa, nT, col.centFT0M()); - } // collision ends - } // process ends + } + PROCESS_SWITCH(NchCumulantsId, processGen, "Process for MC generated or truth", false); + + void processSim(MyFilteredColsWithMcLabels const& collisions, MyFilteredTracksWithMcLabels const& tracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + if (flagUnusedVariableError) + LOG(info) << mcCollisions.size(); + bool trackIsPion = false; + bool trackIsKaon = false; + bool trackIsProton = false; + + int trackIdTag = 0; + int idMethodPi = kUnidentified; + int idMethodKa = kUnidentified; + int idMethodPr = kUnidentified; + + int ptEtaBin = -1; + + for (auto const& col : collisions) { + + if (!col.has_mcCollision()) { + LOG(warning) << "No MC collision for this collision, skip..."; + continue; + } + auto mcCollision = col.mcCollision(); + + if (checkCollPosZMc && std::abs(mcCollision.posZ()) > cfgCutPosZ) + continue; + + // slice reco tracks to this collision + const uint64_t collIdx = col.globalIndex(); + const auto tracksTablePerColl = tracks.sliceBy(mctracksPerCollisionPreslice, collIdx); + + // slice mc particles to mc collisions + const auto mcTracksTablePerMcColl = mcParticles.sliceBy(mcTracksPerMcCollisionPreslice, mcCollision.globalIndex()); + + // Denominator -- Generator level(truth) + + float nPGen = 0, nMGen = 0, nChGen = 0, nTGen = 0; + float nPrGen = 0, nAPrGen = 0; + float nKaGen = 0, nAKaGen = 0; + float nPiGen = 0, nAPiGen = 0; + + for (const auto& mcTrack : mcTracksTablePerMcColl) { + if (!mcTrack.isPhysicalPrimary()) + continue; + if (mcTrack.pt() <= cfgCutPtMin || + mcTrack.pt() >= cfgCutPtMax || + std::abs(mcTrack.eta()) >= cfgCutEta) + continue; + + int pdg = mcTrack.pdgCode(); + + if (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron) { + nPGen++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } else if (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron) { + nMGen++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } + + if (pdg == kPiPlus) { + nPiGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kPiMinus) { + nAPiGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKPlus) { + nKaGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKMinus) { + nAKaGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProton) { + nPrGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProtonBar) { + nAPrGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } + + } // particle/track loop for gen ends + nChGen = nPGen - nMGen; + nTGen = nPGen + nMGen; + + // ── Fill GEN sparse (denominator) ──────────────────────── + hist.fill(HIST("sim/gen/sparse1"), nChGen, nPGen, nMGen, + nPrGen, nAPrGen, nKaGen, nAKaGen, nTGen, + col.centFT0M()); + hist.fill(HIST("sim/gen/sparse2"), nChGen, nPGen, nMGen, + nPiGen, nAPiGen, nKaGen, nAKaGen, nTGen, + col.centFT0M()); + // + // Numerator - Reconstructed + truth matched + // reco->selFunc passed, no pdg + // purity -> selFunc matched with pdg matched + // + float nPRec = 0, nMRec = 0, nChRec = 0, nTRec = 0; + float nPrRec = 0, nAPrRec = 0; + float nKaRec = 0, nAKaRec = 0; + float nPiRec = 0, nAPiRec = 0; + + // purity counters — separate from reco + float nPPur = 0, nMPur = 0, nChPur = 0, nTPur = 0; + float nPrPur = 0, nAPrPur = 0; + float nKaPur = 0, nAKaPur = 0; + float nPiPur = 0, nAPiPur = 0; + + for (const auto& track : tracksTablePerColl) { + + if (!track.has_mcParticle()) { + LOG(warning) << "No MC Particle for this track, skip..."; + continue; + } + auto mcPart = track.mcParticle(); + if (!mcPart.isPhysicalPrimary()) + continue; + int pdg = mcPart.pdgCode(); + + fillTrackQA(track); + + trackIsPion = false; + trackIsKaon = false; + trackIsProton = false; + trackIdTag = 0; + idMethodPi = kUnidentified; + idMethodKa = kUnidentified; + idMethodPr = kUnidentified; + + if (selPion(track, idMethodPi)) { + trackIsPion = true; + BITSET(trackIdTag, ID_BIT_PI); + } + if (selKaon(track, idMethodKa)) { + trackIsKaon = true; + BITSET(trackIdTag, ID_BIT_KA); + } + if (selProton(track, idMethodPr)) { + trackIsProton = true; + BITSET(trackIdTag, ID_BIT_PR); + } + + // bool isKnownCharged = (std::abs(pdg) == kPiPlus || + // std::abs(pdg) == kKPlus || + // std::abs(pdg) == kProton || + // std::abs(pdg) == kElectron || + // std::abs(pdg) == kMuonMinus || + // std::abs(pdg) == kDeuteron); + + ptEtaBin = hPtEtaForBinSearch->FindBin(track.pt(), track.eta()); // Find Track Bin for efficiency correction + + if (track.sign() > 0) { + nPRec += hPtEtaForEffCorrection[kCh][kPos]->GetBinContent(ptEtaBin); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h20_pt_eta"), track.pt(), track.eta()); + } else if (track.sign() < 0) { + nMRec += hPtEtaForEffCorrection[kCh][kNeg]->GetBinContent(ptEtaBin); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h20_pt_eta"), track.pt(), track.eta()); + } + + // species reco — sel passes, PDG not checked (raw reco) + if (trackIsPion) { + if (track.sign() > 0) { + nPiRec += hPtEtaForEffCorrection[kPi][kPos]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPiRec += hPtEtaForEffCorrection[kPi][kNeg]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } + } else if (trackIsKaon) { + if (track.sign() > 0) { + nKaRec += hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAKaRec += hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } + } else if (trackIsProton) { + if (track.sign() > 0) { + nPrRec += hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPrRec += hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } + } + // purity check - check pdg aginst sign + bool purityPion = false; + if (trackIsPion) { + if (track.sign() > 0 && pdg == kPiPlus) + purityPion = true; + if (track.sign() < 0 && pdg == kPiMinus) + purityPion = true; + } + + bool purityKaon = false; + if (trackIsKaon) { + if (track.sign() > 0 && pdg == kKPlus) + purityKaon = true; + if (track.sign() < 0 && pdg == kKMinus) + purityKaon = true; + } + + bool purityProton = false; + if (trackIsProton) { + if (track.sign() > 0 && pdg == kProton) + purityProton = true; + if (track.sign() < 0 && pdg == kProtonBar) + purityProton = true; + } + + // charge purity — track.sign() + isKnownCharged + PDG sign consistency + bool pdgPositive = (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || + pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron); + bool pdgNegative = (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || + pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron); + + if (track.sign() > 0 && pdgPositive) { + nPPur++; + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h12_p"), track.p()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h13_pt"), track.pt()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h14_eta"), track.eta()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h15_phi"), track.phi()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h16_rapidity"), track.y()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h20_pt_eta"), track.pt(), track.eta()); + } else if (track.sign() < 0 && pdgNegative) { + nMPur++; + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h12_p"), track.p()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h13_pt"), track.pt()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h14_eta"), track.eta()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h15_phi"), track.phi()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h16_rapidity"), track.y()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h20_pt_eta"), track.pt(), track.eta()); + } + + // species purity fill + if (purityPion) { + if (track.sign() > 0) { + nPiPur++; + fillPurityTrackQA(purityAnalysis, track); + } else { + nAPiPur++; + fillPurityTrackQA(purityAnalysis, track); + } + } else if (purityKaon) { + if (track.sign() > 0) { + nKaPur++; + fillPurityTrackQA(purityAnalysis, track); + } else { + nAKaPur++; + fillPurityTrackQA(purityAnalysis, track); + } + } else if (purityProton) { + if (track.sign() > 0) { + nPrPur++; + fillPurityTrackQA(purityAnalysis, track); + } else { + nAPrPur++; + fillPurityTrackQA(purityAnalysis, track); + } + } + } + nChRec = nPRec - nMRec; + nTRec = nPRec + nMRec; + nChPur = nPPur - nMPur; + nTPur = nPPur + nMPur; + + // ── fill reco histos ───────────────────────────────────── + hist.fill(HIST("sim/reco/sparse1"), nChRec, nPRec, nMRec, + nPrRec, nAPrRec, nKaRec, nAKaRec, nTRec, col.centFT0M()); + hist.fill(HIST("sim/reco/sparse2"), nChRec, nPRec, nMRec, + nPiRec, nAPiRec, nKaRec, nAKaRec, nTRec, col.centFT0M()); + + // ── fill purity histos ─────────────────────────────────── + hist.fill(HIST("sim/purity/sparse1"), nChPur, nPPur, nMPur, + nPrPur, nAPrPur, nKaPur, nAKaPur, nTPur, col.centFT0M()); + hist.fill(HIST("sim/purity/sparse2"), nChPur, nPPur, nMPur, + nPiPur, nAPiPur, nKaPur, nAKaPur, nTPur, col.centFT0M()); + + } // common collision loop ends + } // process sim ends + PROCESS_SWITCH(NchCumulantsId, processSim, "Process Sim: Gen + Reco + Purity", true); }; // structure ends WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From bbdccfa44df3823b5b5c486edeac5869f09216c0 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 31 Mar 2026 19:23:12 +0530 Subject: [PATCH 119/282] [PWGLF] Added QA histos (#15583) --- .../Resonances/lambda1520analysisinpp.cxx | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index fada8bbc6e4..6c6d0a66b25 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -428,6 +428,11 @@ struct Lambda1520analysisinpp { histos.add("Result/MC/h3lambda1520Recoinvmass", "Invariant mass of Reconstructed MC #Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); histos.add("Result/MC/h3antilambda1520Recoinvmass", "Invariant mass of Reconstructed MC Anti-#Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); } + if (doprocessdummy) { + histos.add("Result/dummy/Genprotonpt", "pT distribution of #Lambda(1520) from Proton", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/Genlambdapt", "pT distribution of #Lambda(1520) from #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/Genxipt", "pT distribution of #Lambda(1520) from #Xi^{-}", kTH3F, {axisMClabel, axisPt, axisMult}); + } // Print output histograms statistics LOG(info) << "Size of the histograms in Lambda1520analysisinpp:"; @@ -1284,6 +1289,119 @@ struct Lambda1520analysisinpp { } } PROCESS_SWITCH(Lambda1520analysisinpp, processME, "Process EventMixing light without partition", false); + + void processdummy(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) + { + bool isInAfterAllCuts = colCuts.isSelected(collision, false); + bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; + bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); + bool isSel8 = collision.sel8(); + + auto mcPartsAll = mcParticles.sliceBy(perMcCollision, collision.mcCollision().globalIndex()); + + bool isTrueINELgt0 = pwglf::isINELgt0mc(mcPartsAll, pdg); + // bool isTrueINELgt0 = collision.isInelGt0(); + + auto centrality = centEst(collision); + + auto computePtL = [&](float pt, float m_ref) { + float ptL2 = pt * pt + m_ref * m_ref - MassLambda1520 * MassLambda1520; + return (ptL2 > 0) ? std::sqrt(ptL2) : -1.f; + }; + + for (auto& part : mcPartsAll) { + + if (!part.isPhysicalPrimary()) + continue; + + float pt = part.pt(); + + if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) // rapidity cut + continue; + + if (std::abs(part.pdgCode()) == kProton) { + + float ptL = computePtL(pt, massPr); + if (ptL < 0) + continue; + + histos.fill(HIST("Result/dummy/Genprotonpt"), 0, ptL, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/Genprotonpt"), 1, ptL, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/Genprotonpt"), 2, ptL, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/Genprotonpt"), 3, ptL, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/Genprotonpt"), 4, ptL, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/Genprotonpt"), 5, ptL, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/Genprotonpt"), 6, ptL, centrality); + } + + if (std::abs(part.pdgCode()) == kLambda0) { + + float ptL = computePtL(pt, MassLambda0); + if (ptL < 0) + continue; + + histos.fill(HIST("Result/dummy/Genlambdapt"), 0, ptL, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/Genlambdapt"), 1, ptL, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/Genlambdapt"), 2, ptL, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/Genlambdapt"), 3, ptL, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/Genlambdapt"), 4, ptL, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/Genlambdapt"), 5, ptL, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/Genlambdapt"), 6, ptL, centrality); + } + + if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { + + float ptL = computePtL(pt, MassXiMinus); + if (ptL < 0) + continue; + + histos.fill(HIST("Result/dummy/Genxipt"), 0, ptL, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/Genxipt"), 1, ptL, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/Genxipt"), 2, ptL, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/Genxipt"), 3, ptL, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/Genxipt"), 4, ptL, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/Genxipt"), 5, ptL, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/Genxipt"), 6, ptL, centrality); + } + } + } + PROCESS_SWITCH(Lambda1520analysisinpp, processdummy, "Process dummy", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 9dc271a06d3ee6f21901b24ddf909991334757e3 Mon Sep 17 00:00:00 2001 From: navneetkumar231295 <71565461+navneetkumar231295@users.noreply.github.com> Date: Tue, 31 Mar 2026 20:36:35 +0530 Subject: [PATCH 120/282] [PWGLF] Remove the phi axis and additional histogram and add the MC task (#15586) Co-authored-by: Navneet --- .../Tasks/Resonances/chargedkstaranalysis.cxx | 1192 +++++++++-------- 1 file changed, 646 insertions(+), 546 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index 71eaafc4209..6081e136eec 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -17,6 +17,7 @@ /// \author Navneet Kumar , Protay #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" @@ -69,6 +70,8 @@ #include #include #include +#include +#include #include using namespace o2; @@ -84,6 +87,9 @@ struct Chargedkstaranalysis { FT0C = 1, FT0M = 2 }; + SliceCache cache; + Preslice perCollision = aod::track::collisionId; + struct : ConfigurableGroup { 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 cfgmultbins{"cfgmultbins", {VARIABLE_WIDTH, 0., 1., 5., 10., 30., 50., 70., 100., 110.}, "Mixing bins - multiplicity"}; @@ -106,7 +112,7 @@ struct Chargedkstaranalysis { Configurable activateProductionFrame{"activateProductionFrame", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; Configurable activateBeamAxisFrame{"activateBeamAxisFrame", false, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateRandomFrame{"activateRandomFrame", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; - Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; + Configurable cRotations{"cRotations", 5, "Number of random rotations in the rotational background"}; Configurable cBoostKShot{"cBoostKShot", true, "Boost the Kshot in Charged Kstar frame of reference"}; // Other cuts on Ks Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; @@ -125,9 +131,15 @@ struct Chargedkstaranalysis { using TrackCandidates = soa::Join; using V0Candidates = aod::V0Datas; + // for MC reco using MCEventCandidates = soa::Join; using MCTrackCandidates = soa::Join; using MCV0Candidates = soa::Join; + // for MC truth + using MCTrueEventCandidates = aod::McCollisions; + using MCTrueTrackCandidates = aod::McParticles; + + using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry hChaKstar{"hChaKstar", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -158,7 +170,7 @@ struct Chargedkstaranalysis { Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; struct RCTCut : ConfigurableGroup { - Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"}; Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; @@ -273,14 +285,7 @@ struct Chargedkstaranalysis { Configurable cKstarMinRap{"cKstarMinRap", -0.5, "Kstar minimum rapidity"}; } kstarCutCfgs; - struct : ConfigurableGroup { - // For rotational background - Configurable cFillRotBkg{"cFillRotBkg", true, "Fill rotated background"}; - Configurable confMinRot{"confMinRot", 5.0 * o2::constants::math::PI / 6.0, "Minimum of rotation"}; - Configurable confMaxRot{"confMaxRot", 7.0 * o2::constants::math::PI / 6.0, "Maximum of rotation"}; - Configurable nBkgRotations{"nBkgRotations", 9, "Number of rotated copies (background) per each original candidate"}; - } rotBkgEstCfgs; - + Configurable isQaRequired{"isQaRequired", false, "Fill QA plots"}; float centrality; // PDG code @@ -341,224 +346,235 @@ struct Chargedkstaranalysis { // THnSparse AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{5, 0, 5.0}}); - auto hCutFlow = histos.get(HIST("hEvtSelInfo")); - hCutFlow->GetXaxis()->SetBinLabel(1, "All Events"); - hCutFlow->GetXaxis()->SetBinLabel(2, "coll cuts"); - hCutFlow->GetXaxis()->SetBinLabel(3, "rctChecker"); - hCutFlow->GetXaxis()->SetBinLabel(4, "Multiplicity"); - hCutFlow->GetXaxis()->SetBinLabel(5, "IsINELgt0"); - - constexpr int kNTrackCuts = 22; - - histos.add("QA/hTrackCutFlow", "Track cut flow", kTH1I, {{kNTrackCuts, 0.5, kNTrackCuts + 0.5}}); - - auto hTrackCutFlow = histos.get(HIST("QA/hTrackCutFlow")); - - int bin = 1; - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "All tracks"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT min"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "|eta| max"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS clusters"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC clusters"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC crossed rows ratio"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS chi2/Ncl"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC chi2/Ncl"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has ITS"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TPC"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TOF"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS refit"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC refit"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "PV contributor"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global w/o DCA"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global track"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Primary track"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAxy max"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAz max"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAxy"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAz"); - - constexpr int kNK0sCuts = 14; - int iK0sbin = 1; - histos.add("QA/K0sCutCheck", "K0s cut flow", kTH1I, {{kNK0sCuts, 0.5, kNK0sCuts + 0.5}}); - auto hK0sCut = histos.get(HIST("QA/K0sCutCheck")); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "All PASS"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DauDCA>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "PosDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "NegDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "pTGetXaxis()->SetBinLabel(iK0sbin++, "|y|>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "Rmax"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DCAtoPV>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cosPAGetXaxis()->SetBinLabel(iK0sbin++, "ctau>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "qtarmGetXaxis()->SetBinLabel(iK0sbin++, "|M(K0s)-m0|>win"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cross-mass veto"); - - histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); - histos.add("QA/before/CentDist1", "Centrality distribution", o2::framework::kTH1F, {{110, 0, 110}}); - histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); - histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - - histos.add("QA/trkbpionTPCPIDME", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - - // Bachelor pion - histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - - histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary pion 2 - histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // K0s - histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // Kstar - // Invariant mass nSparse - histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - histos.add("hInvmass_KstarME", "Invariant mass of unlike-sign chK(892)ME", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - histos.add("hInvmass_KstarRotated", "Invariant mass of unlike-sign chK(892)Rota", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - - // Mass QA (quick check) - histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); - - histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); - - if (!helicityCfgs.qAOptimisation) { - hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - hChaKstar.add("h3ChaKstarInvMassME", "h3ChaKstarInvMassME", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - } + if (!doprocessMC) { + histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{5, 0, 5.0}}); + auto hCutFlow = histos.get(HIST("hEvtSelInfo")); + hCutFlow->GetXaxis()->SetBinLabel(1, "All Events"); + hCutFlow->GetXaxis()->SetBinLabel(2, "coll cuts"); + hCutFlow->GetXaxis()->SetBinLabel(3, "rctChecker"); + hCutFlow->GetXaxis()->SetBinLabel(4, "Multiplicity"); + hCutFlow->GetXaxis()->SetBinLabel(5, "IsINELgt0"); + if (isQaRequired) { + constexpr int kNTrackCuts = 22; + + histos.add("QA/hTrackCutFlow", "Track cut flow", kTH1I, {{kNTrackCuts, 0.5, kNTrackCuts + 0.5}}); + + auto hTrackCutFlow = histos.get(HIST("QA/hTrackCutFlow")); + + int bin = 1; + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "All tracks"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT min"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "|eta| max"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS clusters"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC clusters"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC crossed rows ratio"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS chi2/Ncl"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC chi2/Ncl"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has ITS"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TPC"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TOF"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS refit"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC refit"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "PV contributor"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global w/o DCA"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global track"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Primary track"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAxy max"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAz max"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAxy"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAz"); + + constexpr int kNK0sCuts = 14; + int iK0sbin = 1; + histos.add("QA/K0sCutCheck", "K0s cut flow", kTH1I, {{kNK0sCuts, 0.5, kNK0sCuts + 0.5}}); + auto hK0sCut = histos.get(HIST("QA/K0sCutCheck")); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "All PASS"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DauDCA>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "PosDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "NegDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "pTGetXaxis()->SetBinLabel(iK0sbin++, "|y|>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "Rmax"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DCAtoPV>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cosPAGetXaxis()->SetBinLabel(iK0sbin++, "ctau>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "qtarmGetXaxis()->SetBinLabel(iK0sbin++, "|M(K0s)-m0|>win"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cross-mass veto"); + + histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); + histos.add("QA/before/CentDist1", "Centrality distribution", o2::framework::kTH1F, {{110, 0, 110}}); + histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); + histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + + histos.add("QA/trkbpionTPCPIDME", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + + // Bachelor pion + histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary pion 2 + histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // K0s + histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // Kstar + // Invariant mass nSparse + histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + // Mass QA (quick check) + histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + + histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + } + if (!helicityCfgs.qAOptimisation) { + hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); + hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); - if (rotBkgEstCfgs.cFillRotBkg) { - histos.add("hRotation", "hRotation", kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); + // hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); + // hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); + } } // MC if (doprocessMC) { + if (isQaRequired) { + histos.add("QA/MC/QACent_woCut", "Centrality without cut", HistType::kTH1F, {centAxis}); + histos.add("QA/MC/QACent_woCentCut", "Centrality without cent cut", HistType::kTH1F, {centAxis}); + histos.add("QA/MC/QACent_wCentCut", "Centrality with cent cut", HistType::kTH1F, {centAxis}); + histos.add("QA/MC/QAvtxz_woCut", "z-vertex without cut", HistType::kTH1F, {vtxzAxis}); + histos.add("QA/MC/QAvtxz_wVtxzCut", "z-vertex with vtxz cut", HistType::kTH1F, {vtxzAxis}); + + histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + // Bachelor pion + histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 2 + histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary Resonance (K0s cand) + histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + + histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // K892 + histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); + histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); + } + histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis}); + histos.add("EffKstar/genKstar_pri", "Gen primary Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis}); - histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - // Bachelor pion - histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 2 - histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary Resonance (K0s cand) - histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - - histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // K892 - histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); - histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - - histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); - - histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - - ccdb->setURL(cfgURL); - ccdbApi.init("http://alice-ccdb.cern.ch"); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + histos.add("EffKstar/recoKstar", "Kstar Reco matched (final all)", HistType::kTH2F, {ptAxis, centAxis}); + histos.add("MCReco/hInvmass_Kstar_true", "MC-reco truth-tagged chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); } + ccdb->setURL(cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + // Print output histograms statistics LOG(info) << "Size of the histograms in chK(892) Analysis Task"; histos.print(); } + + std::unordered_set allowedMcIds; + std::unordered_map centTruthByAllowed; + float lMultiplicity; template float getCentrality(CollisionType const& collision) @@ -575,107 +591,86 @@ struct Chargedkstaranalysis { } } - // Track selection template bool trackCut(TrackType const& track) { int ibin = 1; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - // basic track cuts - if (std::abs(track.pt()) < trackCutCfgs.cMinPtcut) - return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + auto applyCut = [&](bool condition) -> bool { + if (!condition) + return false; + if (!doprocessMC && isQaRequired) + histos.fill(HIST("QA/hTrackCutFlow"), ibin); + ibin++; + return true; + }; - if (std::abs(track.eta()) > trackCutCfgs.cMaxEtacut) - return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + // First bin (before any cuts) + if (!doprocessMC && isQaRequired) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (track.itsNCls() < trackCutCfgs.cfgITScluster) + // Cuts + if (!applyCut(std::abs(track.pt()) >= trackCutCfgs.cMinPtcut)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.tpcNClsFound() < trackCutCfgs.cfgTPCcluster) + if (!applyCut(std::abs(track.eta()) <= trackCutCfgs.cMaxEtacut)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.tpcCrossedRowsOverFindableCls() < trackCutCfgs.cfgRatioTPCRowsOverFindableCls) + if (!applyCut(track.itsNCls() >= trackCutCfgs.cfgITScluster)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.itsChi2NCl() >= trackCutCfgs.cfgITSChi2NCl) + if (!applyCut(track.tpcNClsFound() >= trackCutCfgs.cfgTPCcluster)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.tpcChi2NCl() >= trackCutCfgs.cfgTPCChi2NCl) + if (!applyCut(track.tpcCrossedRowsOverFindableCls() >= trackCutCfgs.cfgRatioTPCRowsOverFindableCls)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgHasITS && !track.hasITS()) + if (!applyCut(track.itsChi2NCl() < trackCutCfgs.cfgITSChi2NCl)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgHasTPC && !track.hasTPC()) + if (!applyCut(track.tpcChi2NCl() < trackCutCfgs.cfgTPCChi2NCl)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (trackCutCfgs.cfgHasTOF && !track.hasTOF()) + if (!applyCut(!trackCutCfgs.cfgHasITS || track.hasITS())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgUseITSRefit && !track.passedITSRefit()) + if (!applyCut(!trackCutCfgs.cfgHasTPC || track.hasTPC())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgUseTPCRefit && !track.passedTPCRefit()) + if (!applyCut(!trackCutCfgs.cfgHasTOF || track.hasTOF())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (trackCutCfgs.cfgPVContributor && !track.isPVContributor()) + if (!applyCut(!trackCutCfgs.cfgUseITSRefit || track.passedITSRefit())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + if (!applyCut(!trackCutCfgs.cfgUseTPCRefit || track.passedTPCRefit())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (trackCutCfgs.cfgGlobalTrack && !track.isGlobalTrack()) + if (!applyCut(!trackCutCfgs.cfgPVContributor || track.isPVContributor())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgPrimaryTrack && !track.isPrimaryTrack()) + if (!applyCut(!trackCutCfgs.cfgGlobalWoDCATrack || track.isGlobalTrackWoDCA())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (std::abs(track.dcaXY()) > trackCutCfgs.cMaxbDCArToPVcut) + if (!applyCut(!trackCutCfgs.cfgGlobalTrack || track.isGlobalTrack())) + return false; + if (!applyCut(!trackCutCfgs.cfgPrimaryTrack || track.isPrimaryTrack())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (std::abs(track.dcaZ()) > trackCutCfgs.cMaxbDCAzToPVcut) + if (!applyCut(std::abs(track.dcaXY()) <= trackCutCfgs.cMaxbDCArToPVcut)) + return false; + if (!applyCut(std::abs(track.dcaZ()) <= trackCutCfgs.cMaxbDCAzToPVcut)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + // pT dependent DCA XY if (trackCutCfgs.cfgpTdepDCAxyCut) { - if (std::abs(track.dcaXY()) > (0.004 + (0.013 / track.pt()))) + if (!applyCut(std::abs(track.dcaXY()) <= (0.004 + (0.013 / track.pt())))) return false; } else { - if (std::abs(track.dcaXY()) > trackCutCfgs.cfgMaxbDCArToPVcut) + if (!applyCut(std::abs(track.dcaXY()) <= trackCutCfgs.cfgMaxbDCArToPVcut)) return false; } - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + // pT dependent DCA Z if (trackCutCfgs.cfgpTdepDCAzCut) { - // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution - if (std::abs(track.dcaZ()) > (0.004 + (0.013 / track.pt()))) + if (!applyCut(std::abs(track.dcaZ()) <= (0.004 + (0.013 / track.pt())))) return false; } else { - if (std::abs(track.dcaZ()) > trackCutCfgs.cfgMaxbDCAzToPVcut) + if (!applyCut(std::abs(track.dcaZ()) <= trackCutCfgs.cfgMaxbDCAzToPVcut)) return false; } - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + return true; } - // PID selection tools template bool selectionPIDPion(TrackType const& candidate) @@ -703,6 +698,19 @@ struct Chargedkstaranalysis { bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { int ibin = 1; + bool returnFlag = true; + + auto applyCut = [&](bool condition) { + if (!condition) { + returnFlag = false; + } + if (returnFlag && (!doprocessMC && isQaRequired)) { + histos.fill(HIST("QA/K0sCutCheck"), ibin); + } + ibin++; + }; + + // Precompute variables auto dauDCA = std::fabs(candidate.dcaV0daughters()); auto dauPosDCAtoPV = std::fabs(candidate.dcapostopv()); auto dauNegDCAtoPV = std::fabs(candidate.dcanegtopv()); @@ -716,95 +724,25 @@ struct Chargedkstaranalysis { auto mLambda = candidate.mLambda(); auto mALambda = candidate.mAntiLambda(); - bool returnFlag = true; - histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (std::fabs(dauDCA) > secondaryCutsCfgs.cSecondaryDauDCAMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (std::fabs(dauPosDCAtoPV) < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (std::fabs(dauNegDCAtoPV) < secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (pT < secondaryCutsCfgs.cSecondaryPtMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (std::fabs(rapidity) > secondaryCutsCfgs.cSecondaryRapidityMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (v0Radius < secondaryCutsCfgs.cSecondaryRadiusMin || v0Radius > secondaryCutsCfgs.cSecondaryRadiusMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (dcaToPV > secondaryCutsCfgs.cSecondaryDCAtoPVMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (cosPA < secondaryCutsCfgs.cSecondaryCosPAMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (propTauK0s > secondaryCutsCfgs.cSecondaryProperLifetimeMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) + if (!doprocessMC && isQaRequired) histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (candidate.qtarm() < secondaryCutsCfgs.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); + applyCut(dauDCA <= secondaryCutsCfgs.cSecondaryDauDCAMax); + applyCut(dauPosDCAtoPV >= secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin); + applyCut(dauNegDCAtoPV >= secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin); + applyCut(pT >= secondaryCutsCfgs.cSecondaryPtMin); + applyCut(std::fabs(rapidity) <= secondaryCutsCfgs.cSecondaryRapidityMax); + applyCut(v0Radius >= secondaryCutsCfgs.cSecondaryRadiusMin && v0Radius <= secondaryCutsCfgs.cSecondaryRadiusMax); + applyCut(dcaToPV <= secondaryCutsCfgs.cSecondaryDCAtoPVMax); + applyCut(cosPA >= secondaryCutsCfgs.cSecondaryCosPAMin); + applyCut(propTauK0s <= secondaryCutsCfgs.cSecondaryProperLifetimeMax); + applyCut(candidate.qtarm() >= secondaryCutsCfgs.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())); + applyCut(std::fabs(mK0s - MassK0Short) <= secondaryCutsCfgs.cSecondaryMassWindow); - if (std::fabs(mK0s - MassK0Short) > secondaryCutsCfgs.cSecondaryMassWindow) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); + applyCut(!secondaryCutsCfgs.cfgSecondaryCrossMassHypothesisCut || ((std::fabs(mLambda - MassLambda0) >= secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow) && (std::fabs(mALambda - MassLambda0Bar) >= secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow))); - if (secondaryCutsCfgs.cfgSecondaryCrossMassHypothesisCut && - ((std::fabs(mLambda - MassLambda0) < secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow) || (std::fabs(mALambda - MassLambda0Bar) < secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow))) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); return returnFlag; - - } // selectionK0s - + } template bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) { @@ -843,6 +781,53 @@ struct Chargedkstaranalysis { double massPi = o2::constants::physics::MassPionCharged; double massK0s = o2::constants::physics::MassK0Short; + template + bool matchRecoToTruthKstar(V0T const& v0, TrkT const& trk) + { + if (!v0.has_mcParticle() || !trk.has_mcParticle()) + return false; + + auto mcK0s = v0.template mcParticle_as(); + auto mcPi = trk.template mcParticle_as(); + + if (std::abs(mcK0s.pdgCode()) != kPDGK0s) + return false; + if (std::abs(mcPi.pdgCode()) != kPiPlus) + return false; + + MCTrueTrackCandidates::iterator kstarFromPi; + bool havePiKstar = false; + for (const auto& m1 : mcPi.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kKstarPlus) { + kstarFromPi = m1; + havePiKstar = true; + break; + } + } + if (!havePiKstar) { + return false; + } + + bool shareSameKstar = false; + for (const auto& m1 : mcK0s.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kPDGK0) { + for (const auto& m2 : m1.template mothers_as()) { + if (m2.globalIndex() == kstarFromPi.globalIndex()) { + shareSameKstar = true; + break; + } + } + if (shareSameKstar) + break; + } + } + if (!shareSameKstar) { + return false; + } + + return true; + } // matchRecoToTruthKstar + template void fillInvMass(const T& mother, float multiplicity, const T& daughter1, const T& daughter2, bool isMix) { @@ -896,7 +881,7 @@ struct Chargedkstaranalysis { auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2())); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); //, anglePhi); } for (int i = 0; i < helicityCfgs.cRotations; i++) { @@ -912,18 +897,14 @@ struct Chargedkstaranalysis { auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2())); auto phiHelicityRot = std::atan2(yaxisHE.Dot(daughterRotCM.Vect().Unit()), xaxisHE.Dot(daughterRotCM.Vect().Unit())); phiHelicityRot = RecoDecay::constrainAngle(phiHelicityRot, 0.0); - if (motherRot.Rapidity() < helicityCfgs.rapidityMotherData) - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot, phiHelicityRot); - } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity, anglePhi); + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot); //, phiHelicityRot); } } } else if (helicityCfgs.activateCollinsSoperFrame) { if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS, phiCS); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS); //, phiCS); } for (int i = 0; i < helicityCfgs.cRotations; i++) { @@ -940,12 +921,8 @@ struct Chargedkstaranalysis { auto phiCSrot = std::atan2(yAxisCS.Dot(daughterRotCM.Vect().Unit()), xAxisCS.Dot(daughterRotCM.Vect().Unit())); phiCSrot = RecoDecay::constrainAngle(phiCSrot, 0.0); - if (motherRot.Rapidity() < helicityCfgs.rapidityMotherData) - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarCSrot, phiCSrot); - } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS, phiCS); + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarCSrot); //, phiCSrot); } } } else if (helicityCfgs.activateProductionFrame) { @@ -953,38 +930,30 @@ struct Chargedkstaranalysis { auto cosThetaProduction = normalVec.Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(normalVec.Mag2())); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction); //, anglePhi); } for (int i = 0; i < helicityCfgs.cRotations; i++) { theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaProduction, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaProduction); //, anglePhi); } } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction, anglePhi); - } } } else if (helicityCfgs.activateBeamAxisFrame) { beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); //, anglePhi); } for (int i = 0; i < helicityCfgs.cRotations; i++) { theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam); //, anglePhi); } } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam, anglePhi); - } } } else if (helicityCfgs.activateRandomFrame) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); @@ -994,19 +963,15 @@ struct Chargedkstaranalysis { auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom, phiRandom); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); //, phiRandom); } for (int i = 0; i < helicityCfgs.cRotations; i++) { theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom, phiRandom); + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom); //, phiRandom); } } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom, phiRandom); - } } } // } @@ -1015,69 +980,82 @@ struct Chargedkstaranalysis { template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) { - histos.fill(HIST("QA/before/CentDist"), collision.centFT0M()); - histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M()); - ROOT::Math::PxPyPzMVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, chargeKstarrot; - std::vector trackIndicies = {}; - std::vector k0sIndicies = {}; + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/before/CentDist"), collision.centFT0M()); + histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M()); + } + + ROOT::Math::PxPyPzMVector lResoSecondary, lDecayDaughter_bach, lResoKstar, chargeKstarrot; + std::vector trackIndicies; + std::vector k0sIndicies; + + // ========================= + // Bachelor tracks + // ========================= for (const auto& bTrack : dTracks1) { + auto trkbpt = bTrack.pt(); auto istrkbhasTOF = bTrack.hasTOF(); auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); - auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; + auto trkbNSigmaPiTOF = istrkbhasTOF ? bTrack.tofNSigmaPi() : -999.; if constexpr (!IsMix) { - // Bachelor pion QA plots - histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) { - histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); - histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); } - histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); - histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); - histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); } else { - - histos.fill(HIST("QA/trkbpionTPCPIDME"), trkbpt, trkbNSigmaPiTPC); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/trkbpionTPCPIDME"), trkbpt, trkbNSigmaPiTPC); + } } - if (!trackCut(bTrack)) - continue; - if (!selectionPIDPion(bTrack)) + if (!trackCut(bTrack) || !selectionPIDPion(bTrack)) continue; if constexpr (!IsMix) { - // Bachelor pion QA plots after applying cuts - histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) { - histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); - histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); } - histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); - histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); - histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); } + trackIndicies.push_back(bTrack.index()); } + // ========================= + // K0s loop + // ========================= for (const auto& K0scand : dTracks2) { - auto posDauTrack = K0scand.template posTrack_as(); - auto negDauTrack = K0scand.template negTrack_as(); - - /// Daughters - // Positve pion - auto trkppt = posDauTrack.pt(); - auto istrkphasTOF = posDauTrack.hasTOF(); - auto trkpNSigmaPiTPC = posDauTrack.tpcNSigmaPi(); - auto trkpNSigmaPiTOF = (istrkphasTOF) ? posDauTrack.tofNSigmaPi() : -999.; - // Negative pion - auto trknpt = negDauTrack.pt(); - auto istrknhasTOF = negDauTrack.hasTOF(); - auto trknNSigmaPiTPC = negDauTrack.tpcNSigmaPi(); - auto trknNSigmaPiTOF = (istrknhasTOF) ? negDauTrack.tofNSigmaPi() : -999.; - - /// K0s + + auto pos = K0scand.template posTrack_as(); + auto neg = K0scand.template negTrack_as(); + + auto trkppt = pos.pt(); + auto trknpt = neg.pt(); + + auto istrkphasTOF = pos.hasTOF(); + auto istrknhasTOF = neg.hasTOF(); + + auto trkpNSigmaPiTPC = pos.tpcNSigmaPi(); + auto trknNSigmaPiTPC = neg.tpcNSigmaPi(); + + auto trkpNSigmaPiTOF = istrkphasTOF ? pos.tofNSigmaPi() : -999.; + auto trknNSigmaPiTOF = istrknhasTOF ? neg.tofNSigmaPi() : -999.; + auto trkkDauDCA = K0scand.dcaV0daughters(); auto trkkDauDCAPostoPV = K0scand.dcapostopv(); auto trkkDauDCANegtoPV = K0scand.dcanegtopv(); @@ -1089,139 +1067,99 @@ struct Chargedkstaranalysis { auto trkkMass = K0scand.mK0Short(); if constexpr (!IsMix) { - // Seconddary QA plots - histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) { - histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); - histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); - } - histos.fill(HIST("QA/before/trkppionpT"), trkppt); - histos.fill(HIST("QA/before/trkppionDCAxy"), posDauTrack.dcaXY()); - histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); - - histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) { - histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); - histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + // positive pion + histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + + // negative pion + histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + + // K0s + histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/before/hy_Secondary"), trkky); + histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); } - histos.fill(HIST("QA/before/trknpionpT"), trknpt); - histos.fill(HIST("QA/before/trknpionDCAxy"), negDauTrack.dcaXY()); - histos.fill(HIST("QA/before/trknpionDCAz"), negDauTrack.dcaZ()); - - histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); - histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); - histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); - - histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); - histos.fill(HIST("QA/before/hy_Secondary"), trkky); - histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); - histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); - histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); - histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); } - if (!secondaryCutsCfgs.cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) // Perhaps it's already applied in trackCut (need to check QA plots) - continue; - if (!secondaryCutsCfgs.cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) - continue; - if (!selectionK0s(collision, K0scand)) + if ((!secondaryCutsCfgs.cfgByPassDauPIDSelection && + (!selectionPIDPion(pos) || !selectionPIDPion(neg))) || + !selectionK0s(collision, K0scand)) continue; if constexpr (!IsMix) { - // Seconddary QA plots after applying cuts - - histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) { - histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); - histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); - } - histos.fill(HIST("QA/after/trkppionpT"), trkppt); - histos.fill(HIST("QA/after/trkppionDCAxy"), posDauTrack.dcaXY()); - histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); - - histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) { - histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); - histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/after/hy_Secondary"), trkky); + histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); } - histos.fill(HIST("QA/after/trknpionpT"), trknpt); - histos.fill(HIST("QA/after/trknpionDCAxy"), negDauTrack.dcaXY()); - histos.fill(HIST("QA/after/trknpionDCAz"), negDauTrack.dcaZ()); - - histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); - histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); - histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); - - histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); - histos.fill(HIST("QA/after/hy_Secondary"), trkky); - histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); - histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); - histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); - histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); } + k0sIndicies.push_back(K0scand.index()); } - for (const auto& trackIndex : trackIndicies) { - for (const auto& k0sIndex : k0sIndicies) { - auto bTrack = dTracks1.rawIteratorAt(trackIndex); - auto k0Scand = dTracks2.rawIteratorAt(k0sIndex); - lDecayDaughter_bach = ROOT::Math::PxPyPzMVector(bTrack.px(), bTrack.py(), bTrack.pz(), massPi); - lResoSecondary = ROOT::Math::PxPyPzMVector(k0Scand.px(), k0Scand.py(), k0Scand.pz(), massK0s); + // ========================= + // Pairing + // ========================= + for (auto tIdx : trackIndicies) { + for (auto kIdx : k0sIndicies) { + + auto bTrack = dTracks1.rawIteratorAt(tIdx); + auto k0s = dTracks2.rawIteratorAt(kIdx); + + lDecayDaughter_bach = {bTrack.px(), bTrack.py(), bTrack.pz(), massPi}; + lResoSecondary = {k0s.px(), k0s.py(), k0s.pz(), massK0s}; lResoKstar = lResoSecondary + lDecayDaughter_bach; - // QA plots if constexpr (!IsMix) { - histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + } } - if (lResoKstar.Rapidity() > kstarCutCfgs.cKstarMaxRap || lResoKstar.Rapidity() < kstarCutCfgs.cKstarMinRap) + if (lResoKstar.Rapidity() > kstarCutCfgs.cKstarMaxRap || + lResoKstar.Rapidity() < kstarCutCfgs.cKstarMinRap) continue; if constexpr (!IsMix) { + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); + } - histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); - histos.fill(HIST("hInvmass_Kstar"), collision.centFT0M(), lResoKstar.Pt(), lResoKstar.M()); if (helicityCfgs.cBoostKShot) { fillInvMass(lResoKstar, collision.centFT0M(), lResoSecondary, lDecayDaughter_bach, IsMix); } else { fillInvMass(lResoKstar, collision.centFT0M(), lDecayDaughter_bach, lResoSecondary, IsMix); } } else { - - histos.fill(HIST("hInvmass_KstarME"), collision.centFT0M(), lResoKstar.Pt(), lResoKstar.M()); fillInvMass(lResoKstar, collision.centFT0M(), lResoSecondary, lDecayDaughter_bach, IsMix); } - if constexpr (!IsMix) { - if (rotBkgEstCfgs.cFillRotBkg) { - for (int nrotbkg = 0; nrotbkg < rotBkgEstCfgs.nBkgRotations; nrotbkg++) { - auto rotangle = o2::constants::math::PI; // If there is only one rotation then it should be pi ): - if (rotBkgEstCfgs.nBkgRotations > 1) { - auto anglestart = rotBkgEstCfgs.confMinRot; - auto angleend = rotBkgEstCfgs.confMaxRot; - auto anglestep = (angleend - anglestart) / (1.0 * (rotBkgEstCfgs.nBkgRotations - 1)); - rotangle = anglestart + nrotbkg * anglestep; - } - histos.fill(HIST("hRotation"), rotangle); - auto rotpionPx = lDecayDaughter_bach.Px() * std::cos(rotangle) - lDecayDaughter_bach.Py() * std::sin(rotangle); - auto rotpionPy = lDecayDaughter_bach.Px() * std::sin(rotangle) + lDecayDaughter_bach.Py() * std::cos(rotangle); - ROOT::Math::PtEtaPhiMVector pionrot; - pionrot = ROOT::Math::PxPyPzMVector(rotpionPx, rotpionPy, lDecayDaughter_bach.Pz(), massPi); - chargeKstarrot = pionrot + lResoSecondary; - if (chargeKstarrot.Rapidity() > kstarCutCfgs.cKstarMaxRap || chargeKstarrot.Rapidity() < kstarCutCfgs.cKstarMinRap) - continue; - histos.fill(HIST("hInvmass_KstarRotated"), collision.centFT0M(), chargeKstarrot.Pt(), chargeKstarrot.M()); - } - } - } - } // K0scand - } // bTrack + } + } count++; - - } // fillHistograms + } // process data void processDataSE(EventCandidates::iterator const& collision, @@ -1250,7 +1188,6 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataSE, "Process Event for data without Partitioning", true); - SliceCache cache; using BinningTypeVertexContributor = ColumnBinningPolicy; BinningTypeVertexContributor binningOnPositions{{axisCfgs.cfgvtxbins, axisCfgs.cfgmultbins}, true}; Pair pair{binningOnPositions, nEvtMixing, -1, &cache}; @@ -1296,15 +1233,178 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataME, "Process Event for data without Partitioning", true); - // process MC reconstructed level - void processMC(MCEventCandidates::iterator const& collision, - MCTrackCandidates const& tracks, - MCV0Candidates const& v0s) + void processMC(soa::Join const&, aod::McParticles& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) { + allowedMcIds.clear(); + centTruthByAllowed.clear(); + + // To apply event selection and store the collision IDs of reconstructed tracks that pass the selection criteria + for (const auto& coll : events) { - // histos.fill(HIST("QAMC/hEvent"), 1.0); + if (!coll.has_mcCollision()) + continue; + + const auto mcid = coll.mcCollisionId(); + + const auto mccoll = coll.template mcCollision_as>(); + const float lCentrality = mccoll.centFT0M(); + + if (doprocessMC && isQaRequired) { + histos.fill(HIST("QA/MC/QACent_woCut"), lCentrality); + histos.fill(HIST("QA/MC/QAvtxz_woCut"), coll.posZ()); + } + + if (!colCuts.isSelected(coll)) + continue; + if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker(coll)) + continue; + if (!coll.isInelGt0()) + continue; + + if (doprocessMC && isQaRequired) { + histos.fill(HIST("QA/MC/QACent_woCentCut"), lCentrality); + histos.fill(HIST("QA/MC/QAvtxz_wVtxzCut"), coll.posZ()); + } + + if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) + continue; - fillHistograms(collision, tracks, v0s); + if (doprocessMC && isQaRequired) { + histos.fill(HIST("QA/MC/QACent_wCentCut"), lCentrality); + } + allowedMcIds.insert(mcid); + centTruthByAllowed.emplace(mcid, lCentrality); + } + + // Calculating the generated Kstar + for (const auto& part : mcParticles) { + if (!part.has_mcCollision()) + continue; + if (std::abs(part.pdgCode()) != kKstarPlus) + continue; + if (std::abs(part.y()) > kstarCutCfgs.cKstarMaxRap) + continue; + + const int pionWanted = (part.pdgCode() > 0) ? +kPiPlus : -kPiPlus; + bool hasRightPion = false; + bool hasK0sToPipi = false; + + for (const auto& d1 : part.template daughters_as()) { + const int pdg1 = d1.pdgCode(); + if (pdg1 == pionWanted) { + hasRightPion = true; + } else if (std::abs(pdg1) == kPDGK0) { + for (const auto& d2 : d1.template daughters_as()) { + if (std::abs(d2.pdgCode()) == kPDGK0s) { + bool seenPip = false, seenPim = false; + for (const auto& d3 : d2.template daughters_as()) { + if (d3.pdgCode() == +kPiPlus) + seenPip = true; + else if (d3.pdgCode() == -kPiPlus) + seenPim = true; + } + if (seenPip && seenPim) { + hasK0sToPipi = true; + break; + } + } + } + } + if (hasRightPion && hasK0sToPipi) + break; + } + + if (!(hasRightPion && hasK0sToPipi)) + continue; + + const auto mcid = part.mcCollisionId(); + if (allowedMcIds.count(mcid) == 0) + continue; + + auto iter = centTruthByAllowed.find(mcid); + if (iter == centTruthByAllowed.end()) + continue; + + const float lCentrality = iter->second; + + histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality); + + if (part.vt() == 0) { + histos.fill(HIST("EffKstar/genKstar_pri"), part.pt(), lCentrality); // To check the primary particle + } + } + // To store the recoKstar + for (const auto& v0 : v0s) { + auto coll = v0.template collision_as(); + + if (!coll.has_mcCollision()) + continue; + + const auto mcid = coll.mcCollisionId(); + + if (allowedMcIds.count(mcid) == 0) + continue; // To check the event is allowed or not + + const auto mccoll = coll.template mcCollision_as>(); + const float lCentrality = mccoll.centFT0M(); + + if (!secondaryCutsCfgs.cfgByPassDauPIDSelection) { + auto posDauTrack = v0.template posTrack_as(); + auto negDauTrack = v0.template negTrack_as(); + if (!selectionPIDPion(posDauTrack)) + continue; + if (!selectionPIDPion(negDauTrack)) + continue; + } + if (!selectionK0s(coll, v0)) + continue; + + auto trks = tracks.sliceBy(perCollision, v0.collisionId()); // Grouping the tracks with the v0s, means only those tracks that belong to the same collision as v0 + for (const auto& bTrack : trks) { + if (bTrack.collisionId() != v0.collisionId()) + continue; + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) + continue; + + LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot; + + lResoSecondary = LorentzVectorSetXYZM(v0.px(), v0.py(), v0.pz(), MassK0Short); + lDecayDaughter_bach = LorentzVectorSetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoKstar = lResoSecondary + lDecayDaughter_bach; + + const double ptreco = lResoKstar.Pt(); + const double yreco = lResoKstar.Rapidity(); + if (std::abs(yreco) > kstarCutCfgs.cKstarMaxRap) + continue; + + // Since we are doing the MC study and we know about the PDG code of each particle let's try to check the things which we have + if (!v0.has_mcParticle() || !bTrack.has_mcParticle()) + continue; + auto mcK0s = v0.template mcParticle_as(); // To get the MC truth particle corressponds to the V0 candidate + auto mcPi = bTrack.template mcParticle_as(); + if (std::abs(mcK0s.pdgCode()) != kPDGK0s) + continue; + if (std::abs(mcPi.pdgCode()) != kPiPlus) + continue; + MCTrueTrackCandidates::iterator kstarFromPi; + bool havePiKstar = false; + // Loops over all the mother's of pions and check if this pion comming from a kstar + for (const auto& m1 : mcPi.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kKstarPlus) { + kstarFromPi = m1; + havePiKstar = true; + break; + } + } + if (!havePiKstar) { + continue; + } + histos.fill(HIST("EffKstar/recoKstar"), ptreco, lCentrality); + histos.fill(HIST("MCReco/hInvmass_Kstar_true"), lCentrality, ptreco, lResoKstar.M()); + } + } } PROCESS_SWITCH(Chargedkstaranalysis, processMC, "Process Event for MC", false); }; From 7409d38bf5c031dbcb937fea4e3f8ab68effc21e Mon Sep 17 00:00:00 2001 From: Andrea Giovanni Riffero Date: Tue, 31 Mar 2026 17:36:54 +0200 Subject: [PATCH 121/282] [PWGUD] Fix ambiguous-track BC handling in UPCCandProducer (#15463) Co-authored-by: ALICE Action Bot --- PWGUD/TableProducer/UPCCandidateProducer.cxx | 54 +++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index ac0058c11dd..d58c98ac587 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -11,6 +11,8 @@ /// \author Nazar Burmasov, nazar.burmasov@cern.ch /// \author Diana Krupova, diana.krupova@cern.ch /// \since 04.06.2024 +/// \author Andrea Riffero, andrea.giovanni.riffero@cern.ch +/// \since 19.03.2026 #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" @@ -622,17 +624,25 @@ struct UpcCandProducer { // "uncorrected" bcs template void collectAmbTrackBCs(std::unordered_map& ambTrIds, + TBCs const& bcs, TAmbTracks ambTracks) { for (const auto& ambTrk : ambTracks) { auto trkId = getAmbTrackId(ambTrk); - const auto& bcSlice = ambTrk.template bc_as(); - uint64_t trackBC = -1; - if (bcSlice.size() != 0) { - auto first = bcSlice.begin(); - trackBC = first.globalBC(); + + const auto& bcIds = ambTrk.bcIds(); + if (bcIds.size() == 0) + continue; + + const auto firstBcId = static_cast(*bcIds.begin()); + if (firstBcId < 0 || firstBcId >= static_cast(bcs.size())) { + LOGP(debug, + "Skipping ambiguous track {}: invalid first bcId {} (nBCs = {})", + trkId, firstBcId, bcs.size()); + continue; } - ambTrIds[trkId] = trackBC; + + ambTrIds[trkId] = bcs.iteratorAt(firstBcId).globalBC(); } } @@ -668,16 +678,22 @@ struct UpcCandProducer { continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; + bool hasTrackBC = false; uint64_t trackBC = 0; if (trk.has_collision()) { const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); + hasTrackBC = true; } else { auto ambIter = ambBarrelTrBCs.find(trkId); - if (ambIter != ambBarrelTrBCs.end()) + if (ambIter != ambBarrelTrBCs.end()) { trackBC = ambIter->second; + hasTrackBC = true; + } } + if (!hasTrackBC) + continue; int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fBarrelTrackTShift)); uint64_t bc = trackBC + tint; if (nContrib > upcCuts.getMaxNContrib()) @@ -702,15 +718,22 @@ struct UpcCandProducer { continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; + bool hasTrackBC = false; uint64_t trackBC = 0; auto ambIter = ambFwdTrBCs.find(trkId); if (ambIter == ambFwdTrBCs.end()) { + if (!trk.has_collision()) + continue; const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); + hasTrackBC = true; } else { trackBC = ambIter->second; + hasTrackBC = true; } + if (!hasTrackBC) + continue; int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fMuonTrackTShift)); uint64_t bc = trackBC + tint; if (nContrib > upcCuts.getMaxNContrib()) @@ -735,9 +758,12 @@ struct UpcCandProducer { continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; + bool hasTrackBC = false; uint64_t trackBC = 0; auto ambIter = ambFwdTrBCs.find(trkId); if (ambIter == ambFwdTrBCs.end()) { + if (!trk.has_collision()) + continue; const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); @@ -748,9 +774,13 @@ struct UpcCandProducer { if (fRequireNoITSROFrameBorder && !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { continue; // skip this track if the kNoITSROFrameBorder bit is required but not set } + hasTrackBC = true; } else { trackBC = ambIter->second; + hasTrackBC = true; } + if (!hasTrackBC) + continue; int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fMuonTrackTShift)); uint64_t bc = trackBC + tint; if (nContrib > upcCuts.getMaxNContrib()) @@ -819,7 +849,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; if (upcCuts.getAmbigSwitch() != 1) - collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, ambBarrelTracks); + collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, bcs, ambBarrelTracks); collectBarrelTracks(bcsMatchedTrIdsTOF, 0, @@ -1120,10 +1150,10 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; - collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, ambBarrelTracks); + collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, bcs, ambBarrelTracks); std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, @@ -1320,7 +1350,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, @@ -1575,7 +1605,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, From 7a7b55e69bba625fa60cb37655a0ad82b4eb2ef9 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: Tue, 31 Mar 2026 19:40:10 +0200 Subject: [PATCH 122/282] [PWGHF] Set the UPC setting of ZNC time to false in the D0 task. (#15599) --- PWGHF/D2H/Tasks/taskD0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 03da2e17f43..16dbff833e4 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -95,7 +95,7 @@ struct HfTaskD0 { Configurable storeOccupancyAndIR{"storeOccupancyAndIR", false, "Flag to store occupancy information and interaction rate"}; Configurable storeTrackQuality{"storeTrackQuality", false, "Flag to store track quality information"}; Configurable storeZdcEnergy{"storeZdcEnergy", false, "Flag to store ZDC energy info"}; - Configurable storeZdcTime{"storeZdcTime", true, "Flag to store ZDC time info"}; + Configurable storeZdcTime{"storeZdcTime", false, "Flag to store ZDC time info"}; // ML inference Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; From 01be94d70621cf2802125e2460dc9897b906fe05 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:46:45 +0200 Subject: [PATCH 123/282] [PWGCF] FemtoUniverse: Fix bug in flag switch for ITS and TPC CPR (#15597) --- ...mtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 0aa8752ddfc..b7a4cacfca7 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -86,6 +86,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confIsCPRatITS{"confIsCPRatITS", false, "Close Pair check at ITS"}; 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., "Delta Phi min cut for Close Pair Rejection"}; @@ -564,7 +565,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(p1, p2, magFieldTesla, femto_universe_container::EventType::same)) { continue; } @@ -622,7 +623,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(part1, part2, magFieldTesla, femto_universe_container::EventType::same)) { continue; } @@ -985,7 +986,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } From 4c34ef3c726a415f8a15d9ad19eba43705cb9f42 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Tue, 31 Mar 2026 22:17:00 +0200 Subject: [PATCH 124/282] [PWGLF] Add NUA correction (#15601) --- .../Strangeness/lambdaspincorrderived.cxx | 437 ++++-------------- 1 file changed, 82 insertions(+), 355 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index e5f7a59e3d4..bb7e91da1f0 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -195,25 +195,22 @@ struct lambdaspincorrderived { TH3D* hweight22; TH3D* hweight32; TH3D* hweight42; - TH2D* hweightCentPair = nullptr; - Configurable ConfWeightPathCentPair{"ConfWeightPathCentPair", "", "Centrality x pair-type weight path"}; + // ---------- NUA single-particle weights in (phi, eta) ---------- + TH2D* hNUALambda = nullptr; + TH2D* hNUAAntiLambda = nullptr; + Configurable ConfWeightPathLL{"ConfWeightPathLL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathALAL{"ConfWeightPathALAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathLAL{"ConfWeightPathLAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathALL{"ConfWeightPathALL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; - Configurable ConfWeightPathLL2{"ConfWeightPathLL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathALAL2{"ConfWeightPathALAL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathLAL2{"ConfWeightPathLAL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathALL2{"ConfWeightPathALL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; - - // Mixing ///////// - struct : ConfigurableGroup { - Configurable nKinematicPt{"nKinematicPt", 1.0, "Number of pT buffer bins"}; - Configurable nKinematicEta{"nKinematicEta", 1.0, "Number of eta buffer bins"}; - Configurable nKinematicPhi{"nKinematicPhi", 1.0, "Number of phi buffer bins"}; - } cfgKinematicBins; + Configurable useNUA{"useNUA", false, "Apply single-candidate NUA weight in (phi,eta)"}; + Configurable ConfNUAPathLambda{"ConfNUAPathLambda", "", "CCDB path for Lambda NUA TH2D(phi,eta)"}; + Configurable ConfNUAPathAntiLambda{"ConfNUAPathAntiLambda", "", "CCDB path for AntiLambda NUA TH2D(phi,eta)"}; Configurable> massMixEdges{"massMixEdges", {1.09f, 1.108f, 1.122f, 1.14f}, "Mass-mixing region edges: [SB low | signal | SB high]"}; Configurable cfgMixLegMode{"cfgMixLegMode", 0, "0=replace leg-1 only, 1=replace leg-2 only, 2=do both one-leg replacements"}; Configurable cfgV5MassBins{"cfgV5MassBins", 5, "Number of fixed mass bins for V5 mixing"}; @@ -240,8 +237,6 @@ struct lambdaspincorrderived { Configurable harmonic{"harmonic", 1, "Harmonic phi"}; Configurable harmonicDphi{"harmonicDphi", 2, "Harmonic delta phi"}; Configurable useweight{"useweight", 0, "Use weight"}; - Configurable usebothweight{"usebothweight", 1, "Use both weight"}; - // Configurable useNUA{"useNUA", 0, "Use NUA weight"}; Configurable usePDGM{"usePDGM", 1, "Use PDG mass"}; Configurable useAdditionalHisto{"useAdditionalHisto", 0, "Use additional histogram"}; Configurable checkDoubleStatus{"checkDoubleStatus", 0, "Check Double status"}; @@ -286,14 +281,21 @@ struct lambdaspincorrderived { histos.add("hPtRadiusV0", "V0 QA;#it{p}_{T}^{V0} (GeV/#it{c});V0 decay radius (cm)", kTH2F, {{100, 0.0, 10.0}, {120, 0.0, 45.0}}); histos.add("hPtYSame", "hPtYSame", kTH2F, {{100, 0.0, 10.0}, {200, -1.0, 1.0}}); histos.add("hPtYMix", "hPtYMix", kTH2F, {{100, 0.0, 10.0}, {200, -1.0, 1.0}}); + histos.add("hPhiEtaSame", "hPhiEtaSame", kTH2F, {{720, 0.0, 2.0 * TMath::Pi()}, {200, -1.0, 1.0}}); + histos.add("hPhiEtaMix", "hPhiEtaMix", kTH2F, {{720, 0.0, 2.0 * TMath::Pi()}, {200, -1.0, 1.0}}); histos.add("hCentrality", "Centrality distribution", kTH1F, {{configThnAxisCentrality}}); histos.add("deltaPhiSame", "deltaPhiSame", HistType::kTH1D, {{72, -TMath::Pi(), TMath::Pi()}}, true); histos.add("deltaPhiMix", "deltaPhiMix", HistType::kTH1D, {{72, -TMath::Pi(), TMath::Pi()}}, true); histos.add("ptCent", "ptCent", HistType::kTH2D, {{100, 0.0, 10.0}, {8, 0.0, 80.0}}, true); histos.add("etaCent", "etaCent", HistType::kTH2D, {{32, -0.8, 0.8}, {8, 0.0, 80.0}}, true); - histos.add("hCentPairTypeSE", "SE pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); - histos.add("hCentPairTypeME", "ME pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); + histos.add("hEtaPhiLambdaRaw", "Lambda raw;#phi;#eta", kTH2D, + {{360, 0.0, 2.0 * TMath::Pi()}, {32, -0.8, 0.8}}); + histos.add("hEtaPhiAntiLambdaRaw", "AntiLambda raw;#phi;#eta", kTH2D, + {{360, 0.0, 2.0 * TMath::Pi()}, {32, -0.8, 0.8}}); + + histos.add("hNUAWeightLambda", "Lambda NUA weight", kTH1D, {{200, 0.0, 5.0}}); + histos.add("hNUAWeightAntiLambda", "AntiLambda NUA weight", kTH1D, {{200, 0.0, 5.0}}); // --- target/replacement single-leg occupancy maps for replacement correction histos.add("TGT_LL_leg1", "Target LL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); @@ -316,27 +318,6 @@ struct lambdaspincorrderived { histos.add("REP_ALL_leg2", "Repl ALL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); histos.add("REP_ALAL_leg2", "Repl ALAL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - // --- 3D SE/ME pair-space maps per category (LL, LAL, ALL, ALAL) - histos.add("SE_LL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_LAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - - histos.add("ME_LL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_LAL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALAL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - - histos.add("SE_LL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_LAL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALAL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - - histos.add("ME_LL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_LAL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALAL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("hSparseLambdaLambda", "hSparseLambdaLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisR}, true); histos.add("hSparseLambdaAntiLambda", "hSparseLambdaAntiLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisR}, true); histos.add("hSparseAntiLambdaLambda", "hSparseAntiLambdLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisR}, true); @@ -406,8 +387,16 @@ struct lambdaspincorrderived { hweight32 = ccdb->getForTimeStamp(ConfWeightPathALL2.value, cfgCcdbParam.nolaterthan.value); hweight42 = ccdb->getForTimeStamp(ConfWeightPathALAL2.value, cfgCcdbParam.nolaterthan.value); } - if (!ConfWeightPathCentPair.value.empty()) { - hweightCentPair = ccdb->getForTimeStamp(ConfWeightPathCentPair.value, cfgCcdbParam.nolaterthan.value); + if (useNUA) { + hNUALambda = ccdb->getForTimeStamp(ConfNUAPathLambda.value, cfgCcdbParam.nolaterthan.value); + hNUAAntiLambda = ccdb->getForTimeStamp(ConfNUAPathAntiLambda.value, cfgCcdbParam.nolaterthan.value); + + if (!hNUALambda) { + LOGF(fatal, "NUA enabled but Lambda NUA histogram not found at path: %s", ConfNUAPathLambda.value.data()); + } + if (!hNUAAntiLambda) { + LOGF(fatal, "NUA enabled but AntiLambda NUA histogram not found at path: %s", ConfNUAPathAntiLambda.value.data()); + } } } @@ -485,6 +474,26 @@ struct lambdaspincorrderived { return true; } + double getNUAWeight(int v0Status, double phi, double eta) + { + if (!useNUA) { + return 1.0; + } + + TH2D* h = (v0Status == 0) ? hNUALambda : hNUAAntiLambda; + if (!h) { + return 1.0; + } + + const double phiWrap = RecoDecay::constrainAngle(phi, 0.0F, harmonic); // [0,2pi) + const int bin = h->FindBin(phiWrap, eta); // assumes axes are (phi, eta) + const double w = h->GetBinContent(bin); + + if (!std::isfinite(w) || w <= 0.0) { + return 1.0; + } + return w; + } void fillHistograms(int tag1, int tag2, const ROOT::Math::PtEtaPhiMVector& particle1, const ROOT::Math::PtEtaPhiMVector& particle2, @@ -559,6 +568,10 @@ struct lambdaspincorrderived { double dphi2 = RecoDecay::constrainAngle(particle2.Phi(), 0.0F, harmonic); double deta2 = particle2.Eta(); + double nuaWeight1 = getNUAWeight(tag1, particle1.Phi(), particle1.Eta()); + double nuaWeight2 = getNUAWeight(tag2, particle2.Phi(), particle2.Eta()); + const double pairNUAWeight = nuaWeight1 * nuaWeight2; + double dphi_pair = RecoDecay::constrainAngle(dphi1 - dphi2, -TMath::Pi(), harmonicDphi); double deltaRap = std::abs(particle1.Rapidity() - particle2.Rapidity()); double deltaR = TMath::Sqrt(deltaRap * deltaRap + dphi_pair * dphi_pair); @@ -583,18 +596,10 @@ struct lambdaspincorrderived { } if (datatype == 0) { - const double weight = 1.0; - + const double weight = pairNUAWeight; if (tag1 == 0 && tag2 == 0) { - if (!userapidity) { - histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("SE_LL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_LL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("SE_LL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_LL2"), dphi2, particle2.Rapidity(), pt2, weight); - } + histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), nuaWeight1); + histos.fill(HIST("hPhiEtaSame"), dphi1, particle1.Eta(), nuaWeight1); histos.fill(HIST("hSparseLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -603,13 +608,6 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePairMassLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } } else if (tag1 == 0 && tag2 == 1) { - if (!userapidity) { - histos.fill(HIST("SE_LAL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_LAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("SE_LAL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_LAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } histos.fill(HIST("hSparseLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaAntiLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -618,13 +616,6 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePairMassLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } } else if (tag1 == 1 && tag2 == 0) { - if (!userapidity) { - histos.fill(HIST("SE_ALL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_ALL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("SE_ALL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_ALL2"), dphi2, particle2.Rapidity(), pt2, weight); - } histos.fill(HIST("hSparseAntiLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -633,13 +624,6 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePairMassAntiLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } } else if (tag1 == 1 && tag2 == 1) { - if (!userapidity) { - histos.fill(HIST("SE_ALAL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_ALAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("SE_ALAL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_ALAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } histos.fill(HIST("hSparseAntiLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaAntiLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -659,26 +643,15 @@ struct lambdaspincorrderived { } weight = mixpairweight / epsWeightReplaced; } - + weight *= pairNUAWeight; if (!std::isfinite(weight) || weight <= 0.0) { return; } if (tag1 == 0 && tag2 == 0) { if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("ME_LL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("ME_LL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_LL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_LL2"), dphi2, particle2.Rapidity(), pt2, weight); - } + histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), nuaWeight1 * mixpairweight); + histos.fill(HIST("hPhiEtaMix"), dphi1, particle1.Eta(), nuaWeight1 * mixpairweight); } histos.fill(HIST("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); @@ -689,19 +662,6 @@ struct lambdaspincorrderived { } } else if (tag1 == 0 && tag2 == 1) { - if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("ME_LAL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("ME_LAL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_LAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_LAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } - } histos.fill(HIST("hSparseLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaAntiLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -709,21 +669,7 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePhiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, dphi_pair, weight); histos.fill(HIST("hSparsePairMassLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } - } else if (tag1 == 1 && tag2 == 0) { - if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("ME_ALL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("ME_ALL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_ALL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_ALL2"), dphi2, particle2.Rapidity(), pt2, weight); - } - } histos.fill(HIST("hSparseAntiLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -731,21 +677,7 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePhiAntiLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, dphi_pair, weight); histos.fill(HIST("hSparsePairMassAntiLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } - } else if (tag1 == 1 && tag2 == 1) { - if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("ME_ALAL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("ME_ALAL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_ALAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_ALAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } - } histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -808,7 +740,14 @@ struct lambdaspincorrderived { histos.fill(HIST("etaCent"), v0.lambdaEta(), centrality); proton = ROOT::Math::PtEtaPhiMVector(v0.protonPt(), v0.protonEta(), v0.protonPhi(), o2::constants::physics::MassProton); lambda = ROOT::Math::PtEtaPhiMVector(v0.lambdaPt(), v0.lambdaEta(), v0.lambdaPhi(), v0.lambdaMass()); + const double phi = RecoDecay::constrainAngle(v0.lambdaPhi(), 0.0F, harmonic); + const double eta = v0.lambdaEta(); + if (v0.v0Status() == 0) { + histos.fill(HIST("hEtaPhiLambdaRaw"), phi, eta, getNUAWeight(0, v0.lambdaPhi(), v0.lambdaEta())); + } else { + histos.fill(HIST("hEtaPhiAntiLambdaRaw"), phi, eta, getNUAWeight(1, v0.lambdaPhi(), v0.lambdaEta())); + } for (const auto& v02 : V0s) { if (v02.index() <= v0.index()) { continue; @@ -821,8 +760,7 @@ struct lambdaspincorrderived { proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton); lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass()); histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi)); - const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status()); - histos.fill(HIST("hCentPairTypeSE"), collision.cent(), ptype, 1.0); + // const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status()); if (v0.v0Status() == 0 && v02.v0Status() == 0) { fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0); } @@ -1339,6 +1277,11 @@ struct lambdaspincorrderived { o2::constants::physics::MassProton); lambda = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(v0), mcacc::lamEta(v0), mcacc::lamPhi(v0), mcacc::lamMass(v0)); + if (mcacc::v0Status(v0) == 0) { + histos.fill(HIST("hEtaPhiLambdaRaw"), lambda.Phi(), lambda.Eta(), getNUAWeight(0, lambda.Phi(), lambda.Eta())); + } else { + histos.fill(HIST("hEtaPhiAntiLambdaRaw"), lambda.Phi(), lambda.Eta(), getNUAWeight(1, lambda.Phi(), lambda.Eta())); + } for (const auto& v02 : V0sMC) { if (v02.index() <= v0.index()) { @@ -1358,8 +1301,7 @@ struct lambdaspincorrderived { RecoDecay::constrainAngle(mcacc::lamPhi(v0) - mcacc::lamPhi(v02), -TMath::Pi(), harmonicDphi)); - const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); - histos.fill(HIST("hCentPairTypeSE"), mcacc::cent(collision), ptype, 1.0); + // const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); // datatype=0 (same event) fillHistograms(mcacc::v0Status(v0), mcacc::v0Status(v02), lambda, lambda2, proton, proton2, @@ -1369,175 +1311,6 @@ struct lambdaspincorrderived { } PROCESS_SWITCH(lambdaspincorrderived, processMC, "Process MC (SE)", false); - void processMCMEV3(EventCandidatesMC const& collisions, AllTrackCandidatesMC const& V0sMC) - { - auto nBins = colBinning.getAllBinsCount(); - std::vector>> eventPools(nBins); - - for (auto& collision1 : collisions) { - const int bin = colBinning.getBin(std::make_tuple(mcacc::posz(collision1), mcacc::cent(collision1))); - if (bin < 0) { - continue; - } - - auto poolA = V0sMC.sliceBy(tracksPerCollisionV0mc, collision1.index()); - - if (eventPools[bin].empty()) { - eventPools[bin].emplace_back(collision1.index(), std::move(poolA)); - if ((int)eventPools[bin].size() > nEvtMixing) { - eventPools[bin].pop_front(); - } - continue; - } - - for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(poolA, poolA))) { - if (!selectionV0MC(t1) || !selectionV0MC(t2)) { - continue; - } - if (t2.index() <= t1.index()) { - continue; - } - if (hasSharedDaughtersMC(t1, t2)) - continue; - const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); - const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); - - if (doMixLeg1) { - fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 1, true, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), mcacc::lamMass(t1)), - 1.0f); - } - if (doMixLeg2) { - fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 2, true, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)), - 1.0f); - } - - struct PV { - AllTrackCandidatesMC* pool; - int nRepl1 = 0; - int nRepl2 = 0; - }; - - std::vector usable; - int totalRepl = 0; - - int mixes = 0; - for (auto it = eventPools[bin].rbegin(); it != eventPools[bin].rend() && mixes < nEvtMixing; ++it, ++mixes) { - const int collision2idx = it->first; - auto& poolB = it->second; - - if (collision2idx == collision1.index()) { - continue; - } - - int nRepl1 = 0; - int nRepl2 = 0; - - for (auto& tX : poolB) { - if (!selectionV0MC(tX)) { - continue; - } - - if (doMixLeg1) { - if (checkKinematicsMC(t1, tX)) { - ++nRepl1; - } - } - - if (doMixLeg2) { - if (checkKinematicsMC(t2, tX)) { - ++nRepl2; - } - } - } - - if (nRepl1 > 0 || nRepl2 > 0) { - usable.push_back(PV{&poolB, nRepl1, nRepl2}); - totalRepl += nRepl1 + nRepl2; - } - } - - if (totalRepl <= 0) { - continue; - } - - const float wBase = 1.0f / static_cast(totalRepl); - - for (auto& pv : usable) { - auto& poolB = *pv.pool; - - for (auto& tX : poolB) { - if (!selectionV0MC(tX)) { - continue; - } - - // -------- leg-1 replacement: (tX, t2) - if (doMixLeg1) { - if (checkKinematicsMC(t1, tX)) { - fillReplacementControlMap(mcacc::v0Status(tX), mcacc::v0Status(t2), 1, false, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), - wBase); - auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), - o2::constants::physics::MassProton); - auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), - mcacc::lamMass(tX)); - auto p2 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t2), mcacc::prEta(t2), mcacc::prPhi(t2), - o2::constants::physics::MassProton); - auto l2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), - mcacc::lamMass(t2)); - - const float dPhi = RecoDecay::constrainAngle( - RecoDecay::constrainAngle(lX.Phi(), 0.0F, harmonic) - - RecoDecay::constrainAngle(l2.Phi(), 0.0F, harmonic), - -TMath::Pi(), harmonicDphi); - - histos.fill(HIST("deltaPhiMix"), dPhi, wBase); - fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2), - lX, l2, pX, p2, - 1, wBase, 1); - } - } - - // -------- leg-2 replacement: (t1, tX) - if (doMixLeg2) { - if (checkKinematicsMC(t2, tX)) { - fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(tX), 2, false, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), - wBase); - auto p1 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t1), mcacc::prEta(t1), mcacc::prPhi(t1), - o2::constants::physics::MassProton); - auto l1 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), - mcacc::lamMass(t1)); - auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), - o2::constants::physics::MassProton); - auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), - mcacc::lamMass(tX)); - - const float dPhi = RecoDecay::constrainAngle( - RecoDecay::constrainAngle(l1.Phi(), 0.0F, harmonic) - - RecoDecay::constrainAngle(lX.Phi(), 0.0F, harmonic), - -TMath::Pi(), harmonicDphi); - - histos.fill(HIST("deltaPhiMix"), dPhi, wBase); - fillHistograms(mcacc::v0Status(t1), mcacc::v0Status(tX), - l1, lX, p1, pX, - 1, wBase, 2); - } - } - } - } - } - - auto sliced = V0sMC.sliceBy(tracksPerCollisionV0mc, collision1.index()); - eventPools[bin].emplace_back(collision1.index(), std::move(sliced)); - if ((int)eventPools[bin].size() > nEvtMixing) { - eventPools[bin].pop_front(); - } - } - } - PROCESS_SWITCH(lambdaspincorrderived, processMCMEV3, "Process MC ME v3 FIFO", false); - static inline float phi0To2Pi(float phi) { // harmonic=1, min=0 => [0, 2pi) @@ -1555,19 +1328,16 @@ struct lambdaspincorrderived { { return std::abs(deltaPhiMinusPiToPi(phiA, phiB)); } - - // symmetric neighbors for phi: periodic wrap + // symmetric neighbors for phi: no wrap at edge static inline void collectNeighborBinsPhi(int b, int nPhi, int nNeighbor, std::vector& out) { out.clear(); out.reserve(2 * nNeighbor + 1); for (int d = -nNeighbor; d <= nNeighbor; ++d) { - int bb = b + d; - bb %= nPhi; - if (bb < 0) { - bb += nPhi; + const int bb = b + d; + if (bb >= 0 && bb < nPhi) { + out.push_back(bb); } - out.push_back(bb); } std::sort(out.begin(), out.end()); out.erase(std::unique(out.begin(), out.end()), out.end()); @@ -1978,21 +1748,11 @@ struct lambdaspincorrderived { auto proton2 = ROOT::Math::PtEtaPhiMVector(t2.protonPt(), t2.protonEta(), t2.protonPhi(), o2::constants::physics::MassProton); auto lambda2 = ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass()); - const int ptype = pairTypeCode(tX.v0Status(), t2.v0Status()); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(col1.cent(), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } + // const int ptype = pairTypeCode(tX.v0Status(), t2.v0Status()); - const float meWeight = wSE * centPairWeight; + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), col1.cent(), ptype, wSE); - fillHistograms(tX.v0Status(), t2.v0Status(), lambda, lambda2, proton, proton2, 1, meWeight, 1); } } @@ -2021,21 +1781,10 @@ struct lambdaspincorrderived { auto proton2 = ROOT::Math::PtEtaPhiMVector(tY.protonPt(), tY.protonEta(), tY.protonPhi(), o2::constants::physics::MassProton); auto lambda2 = ROOT::Math::PtEtaPhiMVector(tY.lambdaPt(), tY.lambdaEta(), tY.lambdaPhi(), tY.lambdaMass()); - const int ptype = pairTypeCode(t1.v0Status(), tY.v0Status()); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(col1.cent(), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } - - const float meWeight = wSE * centPairWeight; + // const int ptype = pairTypeCode(t1.v0Status(), tY.v0Status()); + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), col1.cent(), ptype, wSE); - fillHistograms(t1.v0Status(), tY.v0Status(), lambda, lambda2, proton, proton2, 1, meWeight, 2); } } @@ -2371,21 +2120,10 @@ struct lambdaspincorrderived { auto l2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)); - const int ptype = pairTypeCode(mcacc::v0Status(tX), mcacc::v0Status(t2)); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(mcacc::cent(col1), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } - - const float meWeight = wSE * centPairWeight; + // const int ptype = pairTypeCode(mcacc::v0Status(tX), mcacc::v0Status(t2)); + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)lX.Phi(), (float)l2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), mcacc::cent(col1), ptype, wSE); - fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2), lX, l2, pX, p2, 1, meWeight, 1); @@ -2420,21 +2158,10 @@ struct lambdaspincorrderived { auto lY = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tY), mcacc::lamEta(tY), mcacc::lamPhi(tY), mcacc::lamMass(tY)); - const int ptype = pairTypeCode(mcacc::v0Status(t1), mcacc::v0Status(tY)); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(mcacc::cent(col1), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } - - const float meWeight = wSE * centPairWeight; + // const int ptype = pairTypeCode(mcacc::v0Status(t1), mcacc::v0Status(tY)); + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)l1.Phi(), (float)lY.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), mcacc::cent(col1), ptype, wSE); - fillHistograms(mcacc::v0Status(t1), mcacc::v0Status(tY), l1, lY, p1, pY, 1, meWeight, 2); From b50f81ff257b2e5a67efb23f47066d76d41850e6 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 31 Mar 2026 22:39:09 +0200 Subject: [PATCH 125/282] [PWGLF] Add new centralities in StraCents table (#15589) Co-authored-by: ALICE Builder --- PWGLF/DataModel/LFStrangenessTables.h | 9 +++- .../Strangeness/Converters/CMakeLists.txt | 5 +++ .../Converters/stracentconverter2.cxx | 44 +++++++++++++++++++ PWGLF/TableProducer/Strangeness/stracents.cxx | 9 +++- .../Strangeness/strangederivedbuilder.cxx | 12 ++--- 5 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 6303ac2351e..33d06f159d9 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -82,6 +82,11 @@ DECLARE_SOA_TABLE_VERSIONED(StraCents_001, "AOD", "STRACENTS", 1, //! centrality cent::CentFT0C, cent::CentFV0A, cent::CentFT0CVariant1, cent::CentMFT, cent::CentNGlobal); +DECLARE_SOA_TABLE_VERSIONED(StraCents_002, "AOD", "STRACENTS", 2, //! centrality percentiles in Run 3 + cent::CentFT0M, cent::CentFT0A, + cent::CentFT0C, cent::CentFV0A, + cent::CentFT0CVariant1, cent::CentFT0CVariant2, + cent::CentMFT, cent::CentNGlobal, cent::CentNTPV); DECLARE_SOA_TABLE(StraCentsRun2, "AOD", "STRACENTSRUN2", //! centrality percentiles in Run 2 cent::CentRun2V0M, cent::CentRun2V0A, @@ -325,11 +330,11 @@ DECLARE_SOA_TABLE(StraEvTimes, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) stracollision::EventTime); using StraRawCents = StraRawCents_004; -using StraCents = StraCents_001; +using StraCents = StraCents_002; using StraEvSels = StraEvSels_005; using StraStamps = StraStamps_001; using StraCollision = StraCollisions::iterator; -using StraCent = StraCents_001::iterator; +using StraCent = StraCents::iterator; namespace stramccollision { diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 83dfdaa3a36..8239715863d 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -124,6 +124,11 @@ o2physics_add_dpl_workflow(stracentconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stracentconverter2 + SOURCES stracentconverter2.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stramccollmultconverter SOURCES stramccollmultconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx new file mode 100644 index 00000000000..febbb451be9 --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx @@ -0,0 +1,44 @@ +// 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 "PWGLF/DataModel/LFStrangenessTables.h" + +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; + +// Converts Stra Cents from 001 to 002 +struct stracentconverter2 { + Produces straCents_002; + + void process(aod::StraCents_001 const& straCents_001) + { + for (auto& values : straCents_001) { + straCents_002(values.centFT0M(), + values.centFT0A(), + values.centFT0C(), + values.centFV0A(), + values.centFT0CVariant1(), + -999.0 /*dummy FT0C Variant 2*/, + values.centMFT(), + values.centNGlobal(), + -999.0 /*dummy NTPV value*/); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/stracents.cxx b/PWGLF/TableProducer/Strangeness/stracents.cxx index ce5597563da..96ca0a745c8 100644 --- a/PWGLF/TableProducer/Strangeness/stracents.cxx +++ b/PWGLF/TableProducer/Strangeness/stracents.cxx @@ -131,6 +131,7 @@ struct straCents { CalibrationInfo ft0aInfo = CalibrationInfo("FT0A"); CalibrationInfo ft0cInfo = CalibrationInfo("FT0C"); CalibrationInfo ft0cVariant1Info = CalibrationInfo("FT0Cvar1"); + CalibrationInfo ft0cVariant2Info = CalibrationInfo("FT0Cvar2"); CalibrationInfo fddmInfo = CalibrationInfo("FDD"); CalibrationInfo ntpvInfo = CalibrationInfo("NTracksPV"); CalibrationInfo nGlobalInfo = CalibrationInfo("NGlobal"); @@ -243,6 +244,7 @@ struct straCents { ft0aInfo.mCalibrationStored = false; ft0cInfo.mCalibrationStored = false; ft0cVariant1Info.mCalibrationStored = false; + ft0cVariant2Info.mCalibrationStored = false; fddmInfo.mCalibrationStored = false; ntpvInfo.mCalibrationStored = false; nGlobalInfo.mCalibrationStored = false; @@ -371,6 +373,7 @@ struct straCents { getccdb(ft0aInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(ft0cInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(ft0cVariant1Info, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); + getccdb(ft0cVariant2Info, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(fddmInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(ntpvInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(nGlobalInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); @@ -533,12 +536,14 @@ struct straCents { float centFT0C = getCentrality(ft0cInfo, multZeqFT0C); float centFV0A = getCentrality(fv0aInfo, multZeqFV0A); float centFT0CVariant1 = getCentrality(ft0cVariant1Info, multZeqFT0C); + float centFT0CVariant2 = getCentrality(ft0cVariant2Info, multZeqFT0C); float centMFT = 100.5f; // missing mftNtracks in strangeness data model float centNGlobal = getCentrality(nGlobalInfo, collision.multNTracksGlobal()); + float centNTPV = 100.5f; // missing multNContribs in strangeness data model strangeCents(centFT0M, centFT0A, - centFT0C, centFV0A, centFT0CVariant1, - centMFT, centNGlobal); + centFT0C, centFV0A, centFT0CVariant1, centFT0CVariant2, + centMFT, centNGlobal, centNTPV); if (produceHistograms.value) { histos.fill(HIST("FT0M/Mult"), multZeqFT0A + multZeqFT0C); diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 8bc8a962984..7be69eeca47 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -555,8 +555,8 @@ struct strangederivedbuilder { } products.strangeCents(collision.centFT0M(), collision.centFT0A(), - centrality, collision.centFV0A(), collision.centFT0CVariant1(), - collision.centMFT(), collision.centNGlobal()); + centrality, collision.centFV0A(), collision.centFT0CVariant1(), collision.centFT0CVariant2(), + collision.centMFT(), collision.centNGlobal(), collision.centNTPV()); products.strangeEvSels(collision.sel8(), collision.selection_raw(), collision.multFT0A() * static_cast(fillTruncationOptions.fillRawFT0A), collision.multFT0C() * static_cast(fillTruncationOptions.fillRawFT0C), @@ -707,23 +707,23 @@ struct strangederivedbuilder { } } - void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) + void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&) { populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) + void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) { populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::FV0As const&, aod::FDDs const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); From 178513315e18aa7f39908abfc8674ff8d278d191 Mon Sep 17 00:00:00 2001 From: ariedel-cern <85537041+ariedel-cern@users.noreply.github.com> Date: Wed, 1 Apr 2026 09:43:03 +0200 Subject: [PATCH 126/282] [PWGCF] Bugfix in femto framework (#15603) --- PWGCF/Femto/Core/pairHistManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Femto/Core/pairHistManager.h b/PWGCF/Femto/Core/pairHistManager.h index c0695ef3614..2e431427f9c 100644 --- a/PWGCF/Femto/Core/pairHistManager.h +++ b/PWGCF/Femto/Core/pairHistManager.h @@ -646,7 +646,7 @@ class PairHistManager auto sum = part1 + part2; // Boost particle 1 to the pair rest frame (Prf) and calculate k* (would be equivalent using particle 2) // make a copy of particle 1 - auto particle1Prf = ROOT::Math::PtEtaPhiMVector(mParticle1); + auto particle1Prf = ROOT::Math::PtEtaPhiMVector(part1); // get lorentz boost into pair rest frame ROOT::Math::Boost boostPrf(sum.BoostToCM()); // boost particle 1 into pair rest frame and calculate its momentum, which has the same value as k* From 7f603159db426b5f6f919e7e8143875d4612e8de Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:36:40 +0200 Subject: [PATCH 127/282] [PWGDQ] Configurable to check ZDC quality in RCT checker (#15573) Co-authored-by: Maurice Coquet --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 3 ++- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 3 ++- PWGDQ/Tasks/tableReader_withAssoc_direct.cxx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index f9e22bd4308..39cee24788c 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -194,6 +194,7 @@ struct TableMakerMC { // RCT selection struct : ConfigurableGroup { Configurable fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"}; + Configurable fCheckZDC{"cfgCheckZDC", false, "Check ZDC quality in the RCT flag checker"}; Configurable fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"}; } fConfigRCT; @@ -454,7 +455,7 @@ struct TableMakerMC { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel); + rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); } } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 25c81606e27..3a32c5ca24a 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -221,6 +221,7 @@ struct TableMaker { // RCT selection struct : ConfigurableGroup { Configurable fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"}; + Configurable fCheckZDC{"cfgCheckZDC", false, "Check ZDC quality in the RCT flag checker"}; Configurable fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"}; } fConfigRCT; @@ -524,7 +525,7 @@ struct TableMaker { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel); + rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); } } diff --git a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx index ecd087c6b16..3fa16a5d80d 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx @@ -281,6 +281,7 @@ struct AnalysisEventSelection { // RCT selection struct : ConfigurableGroup { Configurable fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"}; + Configurable fCheckZDC{"cfgCheckZDC", false, "Check ZDC quality in the RCT flag checker"}; Configurable fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"}; } fConfigRCT; @@ -404,7 +405,7 @@ struct AnalysisEventSelection { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel); + rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); } cout << "AnalysisEventSelection::init() completed" << endl; From b0b242d2b421808cb8583bfba2a78a5b0125f9ea Mon Sep 17 00:00:00 2001 From: Peter Hristov Date: Wed, 1 Apr 2026 10:41:03 +0200 Subject: [PATCH 128/282] [PWGCF] Fix for Xcode 26.4 (#15596) Co-authored-by: ALICE Action Bot --- PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h index 63d9646cdde..5bee5c8940b 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h @@ -101,7 +101,7 @@ class FemtoUniverseSelection /// \param cutContainer Bit-wise container for the systematic variations /// \param counter Position in the bit-wise container for the systematic variations to be modified template - void checkSelectionSetBit(selValDataType observable, T& cutContainer, size_t& counter) + void checkSelectionSetBit(selValDataType observable, T& cutContainer, std::size_t& counter) { /// If the selection is fulfilled the bit at the specified position (counter) within the bit-wise container is set to 1 if (isSelected(observable)) { From 00146e52d1fab2d6e8ca18ebadb1aa630d579809 Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Wed, 1 Apr 2026 10:46:35 +0200 Subject: [PATCH 129/282] [PWGLF] Omegahm (#15604) --- PWGLF/DataModel/LFNonPromptCascadeTables.h | 11 ++-- PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 59 +++++++++++++++++--- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index 7d0a9c156a8..da4a1495602 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -438,7 +438,6 @@ DECLARE_SOA_TABLE(NPCascTableMCNT, "AOD", "NPCASCTABLEMCNT", NPCascadeTable::MultNTracksGlobal, NPCascadeTable::ToiMask, NPCascadeTable::NoSameBunchPileup) - DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::gPt, NPCascadeTable::gEta, @@ -451,18 +450,22 @@ DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::IsFromBeauty, NPCascadeTable::IsFromCharm, NPCascadeTable::MotherDecayDaughters) -DECLARE_SOA_TABLE(NPPileUpTable, "AOD", "NPPileUpTABLE", +DECLARE_SOA_TABLE(NPCollisionTable, "AOD", "NPCollisionTABLE", NPCascadeTable::RunNumber, NPCascadeTable::GlobalBC, aod::collision::NumContrib, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::CentFT0M, - NPCascadeTable::MultFT0M) -DECLARE_SOA_TABLE(NPMCNegativesTable, "AOD", "NPMCNegativesTABLE", + NPCascadeTable::MultFT0M); +DECLARE_SOA_TABLE(NPMCChargedTable, "AOD", "NPMCChargedTABLE", NPCascadeTable::PtGen, NPCascadeTable::PtRec, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::MultGen); +DECLARE_SOA_INDEX_COLUMN_FULL(NPCollision, npCollision, int32_t, NPCollisionTable, ""); +DECLARE_SOA_TABLE(NPRecoChargedCandidate, "AOD", "NPRecoChargedCandidate", + NPCollisionId, + NPCascadeTable::PtRec); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFNONPROMPTCASCADETABLES_H_ diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 6639404d334..2085067c176 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -182,14 +182,17 @@ struct NonPromptCascadeTask { Produces NPCTableNT; Produces NPCTableMCNT; Produces NPCTableGen; - Produces NPPUTable; - Produces NPMCNTable; + // + Produces NPCollsTable; + Produces NPMCNTable; + Produces NPRecoCandTable; using TracksExtData = soa::Join; using TracksExtMC = soa::Join; using CollisionCandidatesRun3 = soa::Join; using CollisionCandidatesRun3MC = soa::Join; using TracksWithLabel = soa::Join; + using TracksWithSel = soa::Join; Preslice perCollision = aod::track::collisionId; Preslice perCollisionMC = aod::track::collisionId; @@ -417,12 +420,10 @@ struct NonPromptCascadeTask { for (const auto& coll : collisions) { float centFT0M = coll.centFT0M(); float multFT0M = coll.multFT0M(); - // float centFV0A = coll.centFV0A(); - // float multFV0A = coll.multFV0A(); float multNTracks = coll.multNTracksGlobal(); - float run = mRunNumber; + float runNumber = mRunNumber; float numContrib = coll.numContrib(); - mRegistryMults.fill(HIST("hCentMultsRuns"), centFT0M, multFT0M, numContrib, multNTracks, run); + mRegistryMults.fill(HIST("hCentMultsRuns"), centFT0M, multFT0M, numContrib, multNTracks, runNumber); } }; @@ -981,6 +982,50 @@ struct NonPromptCascadeTask { } PROCESS_SWITCH(NonPromptCascadeTask, processdNdetaMC, "process mc dN/deta", false); + // + void processdNdeta(CollisionCandidatesRun3 const& collisions, TracksWithSel const& tracks) + { + int ds = 1; + uint32_t orbitO = 0; + bool writeFlag = 0; + for (const auto& coll : collisions) { + auto bc = coll.template bc_as(); + uint64_t globalBC = bc.globalBC(); + uint32_t orbit = globalBC / 3564; + if (orbitO != orbit) { + orbitO = orbit; + if ((ds % cfgDownscaleMB) == 0) { + writeFlag = 1; + } else { + writeFlag = 0; + } + ds++; + } + if (writeFlag) { + if (mRunNumber != bc.runNumber()) { + mRunNumber = bc.runNumber(); + } + NPCollsTable(mRunNumber, + coll.bc().globalBC(), + coll.numContrib(), + coll.multNTracksGlobal(), + coll.centFT0M(), + coll.multFT0M()); + + auto collIdx = NPCollsTable.lastIndex(); + auto tracksThisColl = tracks.sliceBy(perCollision, coll.globalIndex()); + for (auto const& track : tracksThisColl) { + if (std::fabs(track.eta()) < 0.8 && track.tpcNClsFound() >= 80 && track.tpcNClsCrossedRows() >= 100) { + if (track.isGlobalTrack()) { + // mults.multGlobalTracks++; + NPRecoCandTable(collIdx, track.pt()); + } + } + } + } + } + } + PROCESS_SWITCH(NonPromptCascadeTask, processdNdeta, "process dN/deta", false); void processPileUp(CollisionCandidatesRun3 const& collisions, aod::BCsWithTimestamps const&) { @@ -1007,7 +1052,7 @@ struct NonPromptCascadeTask { } float centFT0M = coll.centFT0M(); float multFT0M = coll.multFT0M(); - NPPUTable(mRunNumber, globalBC, coll.numContrib(), coll.multNTracksGlobal(), centFT0M, multFT0M); + NPCollsTable(mRunNumber, globalBC, coll.numContrib(), coll.multNTracksGlobal(), centFT0M, multFT0M); } } }; From 25dcd418c683e84a8af34478c3e1ce48ba55f7cb Mon Sep 17 00:00:00 2001 From: JBae <110481228+joonsukbae@users.noreply.github.com> Date: Wed, 1 Apr 2026 11:40:06 +0200 Subject: [PATCH 130/282] [PWGJE] Add hybrid response matrix (UE-sub reco x raw truth) to jetSpectraCharged (#15600) Co-authored-by: Claude Opus 4.6 (1M context) --- PWGJE/Tasks/jetSpectraCharged.cxx | 19 +++++++++++-------- PWGJE/Tasks/trackEfficiency.cxx | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 0d2644ef287..bd055c36f2a 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -63,6 +63,7 @@ struct JetSpectraCharged { 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 pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; + Configurable simPtRef{"simPtRef", 10.0, "reference pT for the back-calculation of pTHat from the event weight"}; Configurable pTHatAbsoluteMin{"pTHatAbsoluteMin", -99.0, "minimum value of pTHat"}; Configurable jetPtMax{"jetPtMax", 200., "set jet pT bin max"}; Configurable jetEtaMin{"jetEtaMin", -0.7, "minimum jet pseudorapidity"}; @@ -261,6 +262,7 @@ struct JetSpectraCharged { if (doprocessJetsMatchedAreaSub || doprocessJetsMatchedAreaSubWeighted) { registry.add("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcdetaconstraint", "corr pT mcd vs. corr cpT mcp;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, jetPtAxisRhoAreaSub}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcpetaconstraint", "corr pT mcd vs. corr cpT mcp;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, jetPtAxisRhoAreaSub}}, doSumw2); + registry.add("h2_jet_pt_mcd_rhoareasubtracted_jet_pt_mcp_matchedgeo_mcdetaconstraint", "UEsub pT mcd vs. raw pT mcp;#it{p}_{T,jet}^{mcd} - #rho#it{A} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, jetPtAxis}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedgeo_rhoareasubtracted", "jet mcp corr pT vs. corr delta pT / jet mcp corr pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcp} (GeV/#it{c}) - #it{p}_{T,jet}^{mcd} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_rhoareasubtracted", "jet mcd corr pT vs. corr delta pT / jet mcd corr pt;#it{p}_{T,jet}^{mcd} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcd} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo_rhoareasubtracted", "jet mcp corr pT vs. jet mcd corr pT / jet mcp corr pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); #it{p}_{T,jet}^{mcd} (GeV/#it{c}) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {1000, -5.0, 5.0}}}, doSumw2); @@ -676,6 +678,7 @@ struct JetSpectraCharged { double dcorrpt = corrBasejetpt - corrTagjetpt; if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); + registry.fill(HIST("h2_jet_pt_mcd_rhoareasubtracted_jet_pt_mcp_matchedgeo_mcdetaconstraint"), corrBasejetpt, jetMCP.pt(), weight); registry.fill(HIST("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_rhoareasubtracted"), corrBasejetpt, dcorrpt / corrBasejetpt, weight); } if (jetfindingutilities::isInEtaAcceptance(jetMCP, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -715,7 +718,7 @@ struct JetSpectraCharged { registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); - float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_coll_phat"), pTHat); registry.fill(HIST("h_coll_phat_weighted"), pTHat, eventWeight); } @@ -744,7 +747,7 @@ struct JetSpectraCharged { registry.fill(HIST("h_mccollisions_zvertex"), mccollision.posZ(), eventWeight); - float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccoll_phat"), pTHat); registry.fill(HIST("h_mccoll_phat_weighted"), pTHat, eventWeight); } @@ -853,7 +856,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -880,7 +883,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -1123,7 +1126,7 @@ struct JetSpectraCharged { if (!applyMCCollisionCuts(mccollision, collisions, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (auto const& jet : jets) { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; @@ -1155,7 +1158,7 @@ struct JetSpectraCharged { if (!applyMCCollisionCuts(mccollision, collisions, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccollisions_rho"), mccollision.rho(), eventWeight); for (auto const& jet : jets) { @@ -1246,7 +1249,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (const auto& mcdjet : mcdjets) { if (!isAcceptedJet(mcdjet)) { continue; @@ -1289,7 +1292,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); double mcrho = collision.has_mcCollision() ? collision.mcCollision_as().rho() : -1; diff --git a/PWGJE/Tasks/trackEfficiency.cxx b/PWGJE/Tasks/trackEfficiency.cxx index 6c3fb2460f3..c1da7482405 100644 --- a/PWGJE/Tasks/trackEfficiency.cxx +++ b/PWGJE/Tasks/trackEfficiency.cxx @@ -86,6 +86,7 @@ struct TrackEfficiency { Configurable ptHatMin{"ptHatMin", -999, "min pT hat of collisions"}; Configurable ptHatMax{"ptHatMax", 999, "max pT hat of collisions"}; Configurable pTHatExponent{"pTHatExponent", 4.0, "exponent of the event weight for the calculation of pTHat"}; + Configurable simPtRef{"simPtRef", 10.0, "reference pT for the back-calculation of pTHat from the event weight"}; Configurable pTHatMaxFractionMCD{"pTHatMaxFractionMCD", 999.0, "maximum fraction of hard scattering for reconstructed track acceptance in MC"}; Configurable pTHatMaxFractionMCP{"pTHatMaxFractionMCP", 999.0, "maximum fraction of hard scattering for particle acceptance in MC"}; @@ -105,7 +106,6 @@ struct TrackEfficiency { std::vector eventSelectionBits; int trackSelection = -1; - float simPtRef = 10.; enum AcceptSplitCollisionsOptions { NonSplitOnly = 0, @@ -476,7 +476,7 @@ struct TrackEfficiency { } registry.fill(HIST("hMcCollCutsCounts"), 5.5); // at least one of the reconstructed collisions associated with this mcCollision is selected with regard to centrality - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -819,7 +819,7 @@ struct TrackEfficiency { return; } - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -848,7 +848,7 @@ struct TrackEfficiency { return; } - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -873,7 +873,7 @@ struct TrackEfficiency { return; } - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -936,7 +936,7 @@ struct TrackEfficiency { return; } - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -1030,7 +1030,7 @@ struct TrackEfficiency { registry.fill(HIST("h_collisions"), 3.5); registry.fill(HIST("h2_centrality_collisions"), centrality, 3.5); - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -1067,7 +1067,7 @@ struct TrackEfficiency { registry.fill(HIST("h_collisions"), 3.5); registry.fill(HIST("h_collisions_weighted"), 3.5, eventWeight); - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -1082,8 +1082,8 @@ struct TrackEfficiency { // float centrality = checkCentFT0M ? mcCollision.centFT0M() : mcCollision.centFT0C(); mcCollision.centFT0C() isn't filled at the moment; can be added back when it is float eventWeight = mcCollision.weight(); - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); float centrality = -1; bool hasSel8Coll = false; @@ -1154,9 +1154,9 @@ struct TrackEfficiency { // float centrality = checkCentFT0M ? mcCollision.centFT0M() : mcCollision.centFT0C(); mcCollision.centFT0C() isn't filled at the moment; can be added back when it is float eventWeight = mcCollision.weight(); - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard(), eventWeight); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard(), eventWeight); float centrality = -1; bool hasSel8Coll = false; From 4b451d20531f6e5078ba47eb21591029ddc11e26 Mon Sep 17 00:00:00 2001 From: swapneshkhade <107178389+swapneshkhade@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:22:19 +0530 Subject: [PATCH 131/282] [PWGHF] fix event mixing binning setup in D0-h correlator (#15595) --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index a53cbd6c862..85ec82b5ed9 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -254,7 +254,7 @@ struct HfCorrelatorD0Hadrons { Preslice perTrueCollision = o2::aod::mcparticle::mcCollisionId; ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; - ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 1100.0f, 1900.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks ConfigurableAxis binsMassD{"binsMassD", {200, 1.3848, 2.3848}, "inv. mass (#pi K) (GeV/#it{c}^{2});entries"}; ConfigurableAxis binsEta{"binsEta", {100, -5., 5.}, "#it{#eta}"}; @@ -265,8 +265,6 @@ struct HfCorrelatorD0Hadrons { ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; ConfigurableAxis binsCentFt0m{"binsCentFt0m", {100, 0., 100.}, "Centrality percentile (FT0M)"}; - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; - HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -363,6 +361,7 @@ struct HfCorrelatorD0Hadrons { SelectedTracks const& tracks, SelectedCandidatesDataMl const& candidates) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, etaTrackMax.value); @@ -529,6 +528,7 @@ struct HfCorrelatorD0Hadrons { SelectedCandidatesMcRecMl const& candidates, aod::McParticles const& mcParticles) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, etaTrackMax.value); @@ -864,6 +864,7 @@ struct HfCorrelatorD0Hadrons { SelectedCandidatesDataMl const& candidates, SelectedTracks const& tracks) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; for (const auto& collision : collisions) { registry.fill(HIST("hMultFT0M"), collision.multFT0M()); registry.fill(HIST("hZvtx"), collision.posZ()); @@ -952,6 +953,7 @@ struct HfCorrelatorD0Hadrons { SelectedTracksMcRec const& tracks, aod::McParticles const& mcParticles) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; auto tracksTuple = std::make_tuple(candidates, tracks); Pair const pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; bool isD0Prompt = false; From 4796e376d940633b7a453e2825b65455ff612e08 Mon Sep 17 00:00:00 2001 From: Zoltan Varga <91464454+zovarga@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:08:43 +0200 Subject: [PATCH 132/282] [PWGJE] Add Lund jet plane task (#15536) Co-authored-by: ALICE Action Bot --- PWGJE/Tasks/CMakeLists.txt | 4 + PWGJE/Tasks/jetLundPlane.cxx | 799 +++++++++++++++++++++++++++++++++++ 2 files changed, 803 insertions(+) create mode 100644 PWGJE/Tasks/jetLundPlane.cxx diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 55ec23b2c44..0275a7a66ed 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -317,6 +317,10 @@ if(FastJet_FOUND) SOURCES jetLundReclustering.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore FastJet::FastJet FastJet::Contrib COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-lund-plane + SOURCES jetLundPlane.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore FastJet::FastJet FastJet::Contrib + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(hf-fragmentation-function SOURCES hfFragmentationFunction.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/jetLundPlane.cxx b/PWGJE/Tasks/jetLundPlane.cxx new file mode 100644 index 00000000000..6b8bd423622 --- /dev/null +++ b/PWGJE/Tasks/jetLundPlane.cxx @@ -0,0 +1,799 @@ +// 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. + +/// \file jetLundPlane.cxx +/// \brief Task for jet Lund plane. Creates histograms for offline unfolding (including QA histos), and optionally tables. +/// \author Zoltan Varga + +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" + +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/MathConstants.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// Mini-AOD (tables) +namespace o2::aod +{ +// Parent table: one row per collision stored in the MiniAOD +DECLARE_SOA_COLUMN(MiniCollTag, miniCollTag, uint8_t); +DECLARE_SOA_TABLE(MiniCollisions, "AOD", "MINICOLL", + MiniCollTag); + +// MiniJets -> MiniCollisions +DECLARE_SOA_INDEX_COLUMN(MiniCollision, miniCollision); + +// Jet payload +DECLARE_SOA_COLUMN(Level, level, uint8_t); // JetLevel::Det=reco(det), JetLevel::Part=truth(part) +DECLARE_SOA_COLUMN(JetRint, jetRint, int32_t); // jet.r() as stored (int R*100) +DECLARE_SOA_COLUMN(JetPt, jetPt, float); +DECLARE_SOA_COLUMN(JetEta, jetEta, float); +DECLARE_SOA_COLUMN(JetPhi, jetPhi, float); + +DECLARE_SOA_TABLE(MiniJets, "AOD", "MINIJET", + MiniCollisionId, Level, JetRint, JetPt, JetEta, JetPhi); + +// MiniSplittings -> MiniJets +DECLARE_SOA_INDEX_COLUMN(MiniJet, miniJet); + +// Per-splitting observables (primary branch) +DECLARE_SOA_COLUMN(SplitId, splitId, uint16_t); +DECLARE_SOA_COLUMN(DeltaR, deltaR, float); +DECLARE_SOA_COLUMN(PtSoft, ptSoft, float); +DECLARE_SOA_COLUMN(PtHard, ptHard, float); +DECLARE_SOA_COLUMN(SoftEta, softEta, float); +DECLARE_SOA_COLUMN(SoftPhi, softPhi, float); + +DECLARE_SOA_TABLE(MiniSplittings, "AOD", "MINISPL", + MiniJetId, SplitId, DeltaR, PtSoft, PtHard, SoftEta, SoftPhi, JetPt); + +// Jet-jet matching (MC) +DECLARE_SOA_COLUMN(MatchDR, matchDR, float); +DECLARE_SOA_COLUMN(MatchRelPt, matchRelPt, float); + +DECLARE_SOA_INDEX_COLUMN_FULL(DetMiniJet, detMiniJet, int, MiniJets, "_Det"); +DECLARE_SOA_INDEX_COLUMN_FULL(PartMiniJet, partMiniJet, int, MiniJets, "_Part"); + +DECLARE_SOA_TABLE(MiniJetMatches, "AOD", "MINIMCH", + DetMiniJetId, + PartMiniJetId, + MatchDR, + MatchRelPt); +} // namespace o2::aod + +namespace +{ +constexpr float kTiny = 1e-12f; + +struct JetLevel { + enum Type : uint8_t { + Det = 0, + Part = 1 + }; +}; + +template +float jetRfromTable(const JetT& jet) +{ + return static_cast(jet.r()) * 0.01f; +} + +struct SplittingObs { + float deltaR{}; + float ptSoft{}; + float ptHard{}; + float kT{}; + float lnRoverDR{}; + float lnkt{}; + float z{}; + float softEta{}; + float softPhi{}; +}; + +struct SplitMatchPair { + size_t recoIdx{}; + size_t truthIdx{}; + float dR{}; +}; + +struct JetMatchInfo { + uint64_t otherKey{}; + float dR{1e9f}; + float relPt{-1.f}; + float otherPt{}; +}; + +inline float deltaPhi(float phi1, float phi2) +{ + return RecoDecay::constrainAngle(phi1 - phi2, -o2::constants::math::PI); +} + +inline float splittingMatchDistance(const SplittingObs& a, const SplittingObs& b) +{ + return std::hypot(a.softEta - b.softEta, deltaPhi(a.softPhi, b.softPhi)); +} + +std::vector buildUniqueSplittingMatches(const std::vector& recoSpl, + const std::vector& truthSpl, + float maxDR) +{ + std::vector matches; + matches.reserve(std::min(recoSpl.size(), truthSpl.size())); + + if (recoSpl.empty() || truthSpl.empty()) { + return matches; + } + + // Mutual-nearest-neighbor matching in the soft-prong (eta,phi) coordinates: + // 1) for each truth splitting, find the closest reco splitting within maxDR + // 2) for that reco splitting, find the closest truth splitting within maxDR + // 3) keep the pair only if the reco splitting points back to the original truth splitting + for (size_t truthIdx = 0; truthIdx < truthSpl.size(); ++truthIdx) { + float bestRecoDR = maxDR; + size_t bestRecoIdx = recoSpl.size(); + + for (size_t recoIdx = 0; recoIdx < recoSpl.size(); ++recoIdx) { + const float dR = splittingMatchDistance(recoSpl[recoIdx], truthSpl[truthIdx]); + if (dR < bestRecoDR) { + bestRecoDR = dR; + bestRecoIdx = recoIdx; + } + } + + if (bestRecoIdx == recoSpl.size()) { + continue; + } + + float bestTruthDR = maxDR; + size_t reverseTruthIdx = truthSpl.size(); + for (size_t candTruthIdx = 0; candTruthIdx < truthSpl.size(); ++candTruthIdx) { + const float dR = splittingMatchDistance(recoSpl[bestRecoIdx], truthSpl[candTruthIdx]); + if (dR < bestTruthDR) { + bestTruthDR = dR; + reverseTruthIdx = candTruthIdx; + } + } + + if (reverseTruthIdx == truthIdx) { + matches.push_back({bestRecoIdx, truthIdx, bestRecoDR}); + } + } + + return matches; +} + +template +std::vector buildFastJetInputs(ConstituentRangeT&& constituents, float trackPtMin) +{ + std::vector fjInputs; + fjInputs.reserve(64); + for (auto const& c : constituents) { + if (c.pt() < trackPtMin) { + continue; + } + const float mPi = o2::constants::physics::MassPiPlus; + const float e = std::sqrt(c.p() * c.p() + mPi * mPi); + fjInputs.emplace_back(c.px(), c.py(), c.pz(), e); + } + return fjInputs; +} + +std::vector primaryDeclusteringSplittings(fastjet::PseudoJet jetCA, float jetR) +{ + std::vector out; + out.reserve(32); + + fastjet::PseudoJet p1, p2; + while (jetCA.has_parents(p1, p2)) { + if (p2.perp() > p1.perp()) { + std::swap(p1, p2); + } + const float pt1 = p1.perp(); + const float pt2 = p2.perp(); + const float pt = pt1 + pt2; + if (pt <= kTiny) { + break; + } + const float z = pt2 / pt; + const float dR = p1.delta_R(p2); + const float kT = pt2 * std::sin(dR); + + if (dR > kTiny && kT > kTiny && z > kTiny) { + SplittingObs s; + s.deltaR = dR; + s.ptSoft = pt2; + s.ptHard = pt1; + s.kT = kT; + s.lnRoverDR = std::log(jetR / dR); + s.lnkt = std::log(kT); + s.z = z; + s.softEta = p2.eta(); + s.softPhi = p2.phi_std(); + out.push_back(s); + } + jetCA = p1; // follow hard branch (primary Lund) + } + return out; +} + +} // namespace + +struct JetLundPlaneUnfolding { + // Config + Configurable vertexZCut{"vertexZCut", 10.f, "|z_vtx| cut"}; + Configurable jetPtMin{"jetPtMin", 20.f, "min reco jet pT"}; + Configurable jetEtaMin{"jetEtaMin", -0.5f, "min jet eta"}; + Configurable jetEtaMax{"jetEtaMax", 0.5f, "max jet eta"}; + Configurable jetR{"jetR", 0.4f, "jet radius (must match derived tables)"}; + Configurable trackPtMin{"trackPtMin", 0.15f, "min constituent pT"}; + + Configurable nBinsJetPt{"nBinsJetPt", 200, "jet pT bins"}; + Configurable jetPtMax{"jetPtMax", 200.f, "jet pT max"}; + + Configurable nBinsLund{"nBinsLund", 120, "lund bins (lnR/DR and lnkt)"}; + Configurable lnRoverDRMin{"lnRoverDRMin", -1.f, "min ln(R/DR)"}; + Configurable lnRoverDRMax{"lnRoverDRMax", 6.f, "max ln(R/DR)"}; + Configurable lnKtMin{"lnKtMin", -6.f, "min ln(kT)"}; + Configurable lnKtMax{"lnKtMax", 6.f, "max ln(kT)"}; + + // switches (runtime) + Configurable writeMiniAOD{"writeMiniAOD", true, "write mini-AOD tables (jets, splittings, matching)"}; + + // matching knobs (applied on top of matching relations) + Configurable matchMaxDR{"matchMaxDR", 0.2f, "max ΔR between det and part jet"}; + Configurable splitMatchMaxDR{"splitMatchMaxDR", 0.1f, "max ΔR between reco and truth splittings (soft prong)"}; + Configurable matchUseRelPt{"matchUseRelPt", true, "apply relative pT compatibility cut"}; + Configurable matchMaxRelPtDiff{"matchMaxRelPtDiff", 0.5f, "max |pTdet-pTpart|/pTpart"}; + + // Registry + HistogramRegistry registry{"registry"}; + + // Mini-AOD outputs (optional) + Produces outMiniCollisions; + Produces outMiniJets; + Produces outMiniSplittings; + Produces outMiniJetMatches; + + // FastJet reclustering setup (C/A) + JetFinder reclusterer; + std::vector jetReclustered; + + void init(InitContext const&) + { + const int nbPt = nBinsJetPt.value; + const float ptMax = jetPtMax.value; + const int nbL = nBinsLund.value; + + registry.add("hEventCount", "Event counter;step;counts", HistType::kTH1F, {{10, 0.f, 10.f}}); + registry.add("hJetCountSummary", "Jet count summary;category;counts", HistType::kTH1F, {{6, 0.5f, 6.5f}}); + + // Jet spectra / matching QA + registry.add("hJetPtRecoAll", "Reco jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtRecoMatched", "Reco matched jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtRecoFake", "Reco unmatched (fake) jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + + registry.add("hJetPtTruthAll", "Truth jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtTruthMatched", "Truth matched jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtTruthMiss", "Truth unmatched (miss) jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + + // Jet pT response (1D unfolding) + registry.add("hJetPtResponse", "Jet pT response;p_{T}^{det};p_{T}^{part}", HistType::kTH2F, + {{nbPt, 0.f, ptMax}, {nbPt, 0.f, ptMax}}); + + // Lund reco / truth (3D) + registry.add("hLundReco3D", "Primary Lund (reco);ln(R/#DeltaR);ln(k_{T});p_{T}^{jet}", + HistType::kTH3F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}}); + + registry.add("hLundTruth3D", "Primary Lund (truth);ln(R/#DeltaR);ln(k_{T});p_{T}^{jet}", + HistType::kTH3F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}}); + + // 6D response for 3D unfolding: + // (det lnR/DR, det lnkt, det jetpt, part lnR/DR, part lnkt, part jetpt) + registry.add("hLundResponse6D", + "Lund response 6D;" + "ln(R/#DeltaR)_{det};ln(k_{T})_{det};p_{T}^{det};" + "ln(R/#DeltaR)_{part};ln(k_{T})_{part};p_{T}^{part}", + HistType::kTHnSparseF, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}, + {nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}}); + + // Early QA histograms for declustering and matching + registry.add("hNSplittingsReco", "Number of primary splittings (reco);N_{split};counts", HistType::kTH1F, {{40, -0.5f, 39.5f}}); + registry.add("hNSplittingsTruth", "Number of primary splittings (truth);N_{split};counts", HistType::kTH1F, {{40, -0.5f, 39.5f}}); + registry.add("hNSplittingsVsJetPtReco", "Reco primary splittings;#it{p}_{T}^{jet} (GeV/#it{c});N_{split}", HistType::kTH2F, {{nbPt, 0.f, ptMax}, {40, -0.5f, 39.5f}}); + registry.add("hNSplittingsVsJetPtTruth", "Truth primary splittings;#it{p}_{T}^{jet} (GeV/#it{c});N_{split}", HistType::kTH2F, {{nbPt, 0.f, ptMax}, {40, -0.5f, 39.5f}}); + + registry.add("hDeltaRReco", "Reco splitting #DeltaR;#DeltaR;counts", HistType::kTH1F, {{120, 0.f, 1.2f}}); + registry.add("hDeltaRTruth", "Truth splitting #DeltaR;#DeltaR;counts", HistType::kTH1F, {{120, 0.f, 1.2f}}); + registry.add("hLnRoverDRReco", "Reco splitting ln(R/#DeltaR);ln(R/#DeltaR);counts", HistType::kTH1F, {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}}); + registry.add("hLnRoverDRTruth", "Truth splitting ln(R/#DeltaR);ln(R/#DeltaR);counts", HistType::kTH1F, {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}}); + registry.add("hLnKtReco", "Reco splitting ln(k_{T});ln(k_{T});counts", HistType::kTH1F, {{nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hLnKtTruth", "Truth splitting ln(k_{T});ln(k_{T});counts", HistType::kTH1F, {{nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hKtReco", "Reco splitting k_{T};k_{T};counts", HistType::kTH1F, {{200, 0.f, 20.f}}); + registry.add("hKtTruth", "Truth splitting k_{T};k_{T};counts", HistType::kTH1F, {{200, 0.f, 20.f}}); + + registry.add("hJetMatchDR", "Matched jet #DeltaR;#DeltaR(det,part);counts", HistType::kTH1F, {{100, 0.f, 1.f}}); + registry.add("hJetMatchRelPt", "Matched jet relative #it{p}_{T} difference;|#it{p}_{T}^{det}-#it{p}_{T}^{part}|/#it{p}_{T}^{part};counts", HistType::kTH1F, {{100, 0.f, 2.f}}); + registry.add("hJetPtResidual", "Jet #it{p}_{T} residual;(#it{p}_{T}^{det}-#it{p}_{T}^{part})/#it{p}_{T}^{part};counts", HistType::kTH1F, {{160, -2.f, 2.f}}); + registry.add("hLnRoverDRResidual", "Splitting ln(R/#DeltaR) residual;ln(R/#DeltaR)_{det}-ln(R/#DeltaR)_{part};counts", HistType::kTH1F, {{160, -4.f, 4.f}}); + registry.add("hLnKtResidual", "Splitting ln(k_{T}) residual;ln(k_{T})_{det}-ln(k_{T})_{part};counts", HistType::kTH1F, {{160, -6.f, 6.f}}); + registry.add("hSplitMatchDR", "Matched splitting #DeltaR (soft prong);#DeltaR_{match};counts", HistType::kTH1F, {{120, 0.f, 1.2f}}); + + registry.add("hSplitTruthDen", "Truth splitting denominator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitTruthMatched", "Truth matched splitting numerator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitTruthMiss", "Truth missed splittings;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + + registry.add("hSplitRecoDen", "Reco splitting denominator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitRecoMatched", "Reco matched splitting numerator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitRecoFake", "Reco fake splittings;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + + // reclusterer config + reclusterer.isReclustering = true; + reclusterer.algorithm = fastjet::cambridge_algorithm; + reclusterer.jetR = 1.0; // recluster radius for declustering tree + reclusterer.recombScheme = fastjet::E_scheme; + reclusterer.strategy = fastjet::Best; + reclusterer.areaType = fastjet::active_area; + } + + // Filters for reco jets (data or MC reco) + Filter collisionFilter = (nabs(aod::jcollision::posZ) < vertexZCut.node()); + Filter jetFilter = (aod::jet::pt > jetPtMin.node()) && + (aod::jet::eta > jetEtaMin.node()) && + (aod::jet::eta < jetEtaMax.node()) && + (aod::jet::r == nround(jetR.node() * 100.f)); + + // Type aliases + using RecoJets = soa::Join; + using DetJetsMatched = soa::Join; + using PartJetsMatched = soa::Join; + + template + bool passJetFiducial(JetT const& jet, int rWanted) const + { + return (jet.r() == rWanted) && (jet.pt() > jetPtMin.value) && (jet.eta() > jetEtaMin.value) && (jet.eta() < jetEtaMax.value); + } + + void fillJetCountSummary(int bin) + { + registry.fill(HIST("hJetCountSummary"), static_cast(bin)); + } + + // Helpers to fill Lund from a jet row + template + std::vector getPrimarySplittings(JetRowT const& jet, ConstituentTableT const&) + { + auto fjInputs = buildFastJetInputs(jet.template tracks_as(), trackPtMin.value); + if (fjInputs.size() < 2) { + return {}; + } + + jetReclustered.clear(); + fastjet::ClusterSequenceArea cs(reclusterer.findJets(fjInputs, jetReclustered)); + jetReclustered = sorted_by_pt(jetReclustered); + if (jetReclustered.empty()) { + return {}; + } + + const float rjet = jetRfromTable(jet); + return primaryDeclusteringSplittings(jetReclustered[0], rjet); + } + + void fillPrimaryLund3DFromSplittings(std::vector const& spl, float jetPt, bool isTruth, float weight = 1.f) + { + for (auto const& s : spl) { + if (isTruth) { + registry.fill(HIST("hLundTruth3D"), s.lnRoverDR, s.lnkt, jetPt, weight); + } else { + registry.fill(HIST("hLundReco3D"), s.lnRoverDR, s.lnkt, jetPt, weight); + } + } + } + + template + void fillPrimaryLund3D(JetRowT const& jet, ConstituentTableT const& constituents, bool isTruth, float weight = 1.f) + { + fillPrimaryLund3DFromSplittings(getPrimarySplittings(jet, constituents), jet.pt(), isTruth, weight); + } + + void fillSplittingQAHists(std::vector const& splittings, bool isTruth, float jetPt) + { + if (isTruth) { + registry.fill(HIST("hNSplittingsTruth"), static_cast(splittings.size())); + registry.fill(HIST("hNSplittingsVsJetPtTruth"), jetPt, static_cast(splittings.size())); + } else { + registry.fill(HIST("hNSplittingsReco"), static_cast(splittings.size())); + registry.fill(HIST("hNSplittingsVsJetPtReco"), jetPt, static_cast(splittings.size())); + } + + for (auto const& s : splittings) { + if (isTruth) { + registry.fill(HIST("hDeltaRTruth"), s.deltaR); + registry.fill(HIST("hLnRoverDRTruth"), s.lnRoverDR); + registry.fill(HIST("hLnKtTruth"), s.lnkt); + registry.fill(HIST("hKtTruth"), s.kT); + } else { + registry.fill(HIST("hDeltaRReco"), s.deltaR); + registry.fill(HIST("hLnRoverDRReco"), s.lnRoverDR); + registry.fill(HIST("hLnKtReco"), s.lnkt); + registry.fill(HIST("hKtReco"), s.kT); + } + } + } + + std::vector fillSplittingCorrectionHists(std::vector const& recoSpl, std::vector const& truthSpl) + { + for (auto const& s : truthSpl) { + registry.fill(HIST("hSplitTruthDen"), s.lnRoverDR, s.lnkt); + } + for (auto const& s : recoSpl) { + registry.fill(HIST("hSplitRecoDen"), s.lnRoverDR, s.lnkt); + } + + const auto matches = buildUniqueSplittingMatches(recoSpl, truthSpl, splitMatchMaxDR.value); + std::vector recoUsed(recoSpl.size(), false); + std::vector truthUsed(truthSpl.size(), false); + + for (const auto& m : matches) { + recoUsed[m.recoIdx] = true; + truthUsed[m.truthIdx] = true; + registry.fill(HIST("hSplitRecoMatched"), recoSpl[m.recoIdx].lnRoverDR, recoSpl[m.recoIdx].lnkt); + registry.fill(HIST("hSplitTruthMatched"), truthSpl[m.truthIdx].lnRoverDR, truthSpl[m.truthIdx].lnkt); + registry.fill(HIST("hSplitMatchDR"), m.dR); + } + + for (size_t i = 0; i < truthSpl.size(); ++i) { + if (!truthUsed[i]) { + registry.fill(HIST("hSplitTruthMiss"), truthSpl[i].lnRoverDR, truthSpl[i].lnkt); + } + } + for (size_t i = 0; i < recoSpl.size(); ++i) { + if (!recoUsed[i]) { + registry.fill(HIST("hSplitRecoFake"), recoSpl[i].lnRoverDR, recoSpl[i].lnkt); + } + } + return matches; + } + + // DATA / RECO PROCESSING + void processData(soa::Filtered::iterator const&, + soa::Filtered const& jets, + aod::JetTracks const& tracks) + { + registry.fill(HIST("hEventCount"), 0.5); + + int miniCollIdx = -1; + if (writeMiniAOD.value) { + outMiniCollisions(static_cast(0)); + miniCollIdx = outMiniCollisions.lastIndex(); + } + for (auto const& jet : jets) { + registry.fill(HIST("hJetPtRecoAll"), jet.pt()); + auto spl = getPrimarySplittings(jet, tracks); + fillPrimaryLund3DFromSplittings(spl, jet.pt(), /*isTruth*/ false); + fillSplittingQAHists(spl, /*isTruth*/ false, jet.pt()); + + if (writeMiniAOD.value) { + outMiniJets(miniCollIdx, /*level*/ JetLevel::Det, jet.r(), jet.pt(), jet.eta(), jet.phi()); + const int miniJetIdx = outMiniJets.lastIndex(); + + uint16_t sid = 0; + for (auto const& s : spl) { + outMiniSplittings(miniJetIdx, sid++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, jet.pt()); + } + } + } + } + PROCESS_SWITCH(JetLundPlaneUnfolding, processData, "Reco/data Lund + jet spectra", true); + + // MC PROCESSING (det + part + response) + + void processMC(DetJetsMatched const& detJets, + PartJetsMatched const& partJets, + aod::JetCollisions const&, + aod::JetTracks const& tracks, + aod::JetParticles const& particles) + { + registry.fill(HIST("hEventCount"), 1.5); + + const int rWanted = static_cast(std::lround(jetR.value * 100.f)); + std::unordered_map truthMatchedById; + std::unordered_map> truthSplittingsById; + std::unordered_map truthBestDet; + std::unordered_set detSplittingsWritten; + std::unordered_set truthSplittingsWritten; + auto h6 = registry.get(HIST("hLundResponse6D")); + + // Transient maps used only during this task execution to avoid duplicating + // MiniCollision / MiniJet rows and to translate framework-local indices into + // merge-safe MiniAOD row indices. + std::unordered_map detMiniCollByKey; + std::unordered_map partMiniCollByKey; + std::unordered_map detJetToMiniJetIdx; + std::unordered_map partJetToMiniJetIdx; + + // --- Truth pass --- + // Fill inclusive truth histograms, cache truth splittings, write all accepted + // truth jets to MiniJets, and determine the best detector candidate for each truth jet. + for (auto const& partJet : partJets) { + if (!passJetFiducial(partJet, rWanted)) { + continue; + } + + registry.fill(HIST("hJetPtTruthAll"), partJet.pt()); + fillJetCountSummary(4); + + const uint64_t truthJetKey = partJet.globalIndex(); + auto spl = getPrimarySplittings(partJet, particles); + truthSplittingsById[truthJetKey] = spl; + + fillPrimaryLund3DFromSplittings(spl, partJet.pt(), /*isTruth*/ true); + fillSplittingQAHists(spl, /*isTruth*/ true, partJet.pt()); + + if (writeMiniAOD.value) { + const uint64_t partCollKey = (static_cast(partJet.mcCollisionId()) << 1U) | 1ULL; + int partMiniCollIdx = -1; + auto collIt = partMiniCollByKey.find(partCollKey); + if (collIt == partMiniCollByKey.end()) { + outMiniCollisions(static_cast(0)); + partMiniCollIdx = outMiniCollisions.lastIndex(); + partMiniCollByKey.emplace(partCollKey, partMiniCollIdx); + } else { + partMiniCollIdx = collIt->second; + } + + outMiniJets(partMiniCollIdx, /*level*/ JetLevel::Part, partJet.r(), partJet.pt(), partJet.eta(), partJet.phi()); + partJetToMiniJetIdx[truthJetKey] = outMiniJets.lastIndex(); + } + + if (!partJet.has_matchedJetGeo()) { + continue; + } + + JetMatchInfo bestDet{}; + bool foundDet = false; + for (auto const& candDetJet : partJet.template matchedJetGeo_as()) { + if (!passJetFiducial(candDetJet, rWanted)) { + continue; + } + + const float dR = std::hypot(candDetJet.eta() - partJet.eta(), + deltaPhi(candDetJet.phi(), partJet.phi())); + if (dR > matchMaxDR.value) { + continue; + } + + const float rel = std::abs(candDetJet.pt() - partJet.pt()) / std::max(partJet.pt(), kTiny); + if (matchUseRelPt.value && rel > matchMaxRelPtDiff.value) { + continue; + } + + if (!foundDet || dR < bestDet.dR) { + bestDet.otherKey = candDetJet.globalIndex(); + bestDet.dR = dR; + bestDet.relPt = rel; + bestDet.otherPt = candDetJet.pt(); + foundDet = true; + } + } + if (foundDet) { + truthBestDet[truthJetKey] = bestDet; + } + } + + // --- Detector loop --- + // Write all accepted detector jets to MiniJets. A final matched pair is accepted only + // if the detector jet and truth jet are mutual best matches under the same cuts. + for (auto const& detJet : detJets) { + if (!passJetFiducial(detJet, rWanted)) { + continue; + } + + registry.fill(HIST("hJetPtRecoAll"), detJet.pt()); + fillJetCountSummary(1); + + const uint64_t detJetKey = detJet.globalIndex(); + auto detSpl = getPrimarySplittings(detJet, tracks); + fillPrimaryLund3DFromSplittings(detSpl, detJet.pt(), /*isTruth*/ false); + fillSplittingQAHists(detSpl, /*isTruth*/ false, detJet.pt()); + + if (writeMiniAOD.value) { + const uint64_t detCollKey = (static_cast(detJet.collisionId()) << 1U); + int detMiniCollIdx = -1; + auto collIt = detMiniCollByKey.find(detCollKey); + if (collIt == detMiniCollByKey.end()) { + outMiniCollisions(static_cast(0)); + detMiniCollIdx = outMiniCollisions.lastIndex(); + detMiniCollByKey.emplace(detCollKey, detMiniCollIdx); + } else { + detMiniCollIdx = collIt->second; + } + + outMiniJets(detMiniCollIdx, /*level*/ JetLevel::Det, detJet.r(), detJet.pt(), detJet.eta(), detJet.phi()); + detJetToMiniJetIdx[detJetKey] = outMiniJets.lastIndex(); + } + + if (!detJet.has_matchedJetGeo()) { + registry.fill(HIST("hJetPtRecoFake"), detJet.pt()); + fillJetCountSummary(3); + continue; + } + + JetMatchInfo bestTruth{}; + bool foundMatch = false; + std::vector bestPartSpl; + + for (auto const& candPartJet : detJet.template matchedJetGeo_as()) { + if (!passJetFiducial(candPartJet, rWanted)) { + continue; + } + + const float dR = std::hypot(detJet.eta() - candPartJet.eta(), + deltaPhi(detJet.phi(), candPartJet.phi())); + if (dR > matchMaxDR.value) { + continue; + } + + const float rel = std::abs(detJet.pt() - candPartJet.pt()) / std::max(candPartJet.pt(), kTiny); + if (matchUseRelPt.value && rel > matchMaxRelPtDiff.value) { + continue; + } + + if (!foundMatch || dR < bestTruth.dR) { + const uint64_t candTruthKey = candPartJet.globalIndex(); + bestTruth.otherKey = candTruthKey; + bestTruth.dR = dR; + bestTruth.relPt = rel; + bestTruth.otherPt = candPartJet.pt(); + + auto splIt = truthSplittingsById.find(candTruthKey); + if (splIt != truthSplittingsById.end()) { + bestPartSpl = splIt->second; + } else { + bestPartSpl = getPrimarySplittings(candPartJet, particles); + truthSplittingsById[candTruthKey] = bestPartSpl; + } + foundMatch = true; + } + } + + if (!foundMatch) { + registry.fill(HIST("hJetPtRecoFake"), detJet.pt()); + fillJetCountSummary(3); + continue; + } + + const auto reverseIt = truthBestDet.find(bestTruth.otherKey); + if (reverseIt == truthBestDet.end() || reverseIt->second.otherKey != detJetKey) { + registry.fill(HIST("hJetPtRecoFake"), detJet.pt()); + fillJetCountSummary(3); + continue; + } + + const float bestDR = bestTruth.dR; + const float bestRelPt = bestTruth.relPt; + const uint64_t bestPartId = bestTruth.otherKey; + const float bestPartPt = bestTruth.otherPt; + + registry.fill(HIST("hJetPtRecoMatched"), detJet.pt()); + fillJetCountSummary(2); + registry.fill(HIST("hJetPtTruthMatched"), bestPartPt); + fillJetCountSummary(5); + registry.fill(HIST("hJetPtResponse"), detJet.pt(), bestPartPt); + registry.fill(HIST("hJetMatchDR"), bestDR); + registry.fill(HIST("hJetMatchRelPt"), bestRelPt); + registry.fill(HIST("hJetPtResidual"), (detJet.pt() - bestPartPt) / std::max(bestPartPt, kTiny)); + truthMatchedById[bestPartId] = true; + + if (writeMiniAOD.value) { + auto detIdxIt = detJetToMiniJetIdx.find(detJetKey); + auto partIdxIt = partJetToMiniJetIdx.find(bestPartId); + if (detIdxIt != detJetToMiniJetIdx.end() && partIdxIt != partJetToMiniJetIdx.end()) { + const int detMiniJetIdx = detIdxIt->second; + const int partMiniJetIdx = partIdxIt->second; + + outMiniJetMatches(detMiniJetIdx, partMiniJetIdx, bestDR, bestRelPt); + + if (detSplittingsWritten.insert(detJetKey).second) { + uint16_t sidTmp = 0; + for (auto const& s : detSpl) { + outMiniSplittings(detMiniJetIdx, sidTmp++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, detJet.pt()); + } + } + + if (truthSplittingsWritten.insert(bestPartId).second) { + uint16_t sid = 0; + for (auto const& s : bestPartSpl) { + outMiniSplittings(partMiniJetIdx, sid++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, bestPartPt); + } + } + } + } + + const auto splitMatches = fillSplittingCorrectionHists(detSpl, bestPartSpl); + + // Fill the 6D response and residual QA using the unique geometric splitting matches + for (const auto& m : splitMatches) { + const auto& detS = detSpl[m.recoIdx]; + const auto& partS = bestPartSpl[m.truthIdx]; + double x[6] = {detS.lnRoverDR, detS.lnkt, detJet.pt(), + partS.lnRoverDR, partS.lnkt, bestPartPt}; + h6->Fill(x); + registry.fill(HIST("hLnRoverDRResidual"), detS.lnRoverDR - partS.lnRoverDR); + registry.fill(HIST("hLnKtResidual"), detS.lnkt - partS.lnkt); + } + } + + // --- Final truth pass for misses --- + for (auto const& partJet : partJets) { + if (!passJetFiducial(partJet, rWanted)) { + continue; + } + + const uint64_t truthJetKey = partJet.globalIndex(); + if (!truthMatchedById[truthJetKey]) { + registry.fill(HIST("hJetPtTruthMiss"), partJet.pt()); + fillJetCountSummary(6); + } + } + } + PROCESS_SWITCH(JetLundPlaneUnfolding, processMC, "MC det+part + responses", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"jet-lund-plane"})}; +} From a267346e2ecd16a2fec9e3be0339c3fd445a6983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:32:08 +0200 Subject: [PATCH 133/282] [Trigger,PWGCF,PWGEM,PWGHF,PWGJE,PWGLF,PWGMM,PWGUD] Fix includes and using statements (#15382) --- EventFiltering/PWGCF/CFFilterAll.cxx | 47 +++++++++----- EventFiltering/PWGEM/EMPhotonFilter.cxx | 28 ++++++--- EventFiltering/PWGEM/EMPhotonFilterQC.cxx | 33 +++++++--- .../PWGEM/HeavyNeutralMesonFilter.cxx | 3 +- EventFiltering/PWGEM/globalDimuonFilter.cxx | 48 +++++++++----- EventFiltering/PWGHF/H2fromLbFilter.cxx | 34 +++++----- EventFiltering/PWGHF/HFFilter.cxx | 3 +- EventFiltering/PWGHF/HFFilterHelpers.h | 2 +- EventFiltering/PWGJE/fullJetFilter.cxx | 63 ++++++++++++------- EventFiltering/PWGJE/jetFilter.cxx | 33 +++++----- EventFiltering/PWGJE/jetHFFilter.cxx | 33 ++++------ EventFiltering/PWGLF/filterdoublephi.cxx | 34 +++++----- EventFiltering/PWGLF/filterf1proton.cxx | 47 +++++++------- EventFiltering/PWGLF/nucleiFilter.cxx | 53 ++++++++++------ EventFiltering/PWGLF/strangenessFilter.cxx | 51 +++++++++------ EventFiltering/PWGMM/multFilter.cxx | 39 +++++++++--- EventFiltering/PWGUD/diffractionBCFilter.cxx | 30 +++++++-- EventFiltering/PWGUD/diffractionFilter.cxx | 31 +++++++-- EventFiltering/cefpTask.cxx | 48 +++++++++----- EventFiltering/filterTables.h | 11 ++-- EventFiltering/macros/cefpOutputChecker.C | 7 ++- EventFiltering/macros/checkBCRange.C | 15 +++-- EventFiltering/macros/checkBCrangesSkimming.C | 27 +++++--- EventFiltering/macros/checkSkimming.C | 10 +-- EventFiltering/macros/getMenu.C | 7 ++- EventFiltering/macros/selectivityPlot.C | 14 +++++ EventFiltering/macros/splitFile.C | 11 ++-- EventFiltering/macros/uploadOTSobjects.C | 25 +++++--- EventFiltering/selectBCRange.cxx | 27 +++++--- 29 files changed, 517 insertions(+), 297 deletions(-) diff --git a/EventFiltering/PWGCF/CFFilterAll.cxx b/EventFiltering/PWGCF/CFFilterAll.cxx index 8e0bfe2e119..3f2540f27b0 100644 --- a/EventFiltering/PWGCF/CFFilterAll.cxx +++ b/EventFiltering/PWGCF/CFFilterAll.cxx @@ -18,7 +18,9 @@ #include "PWGLF/Utils/strangenessBuilderHelper.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseITS.h" @@ -26,22 +28,35 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" -#include "TMath.h" - -#include "fairlogger/Logger.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include +#include +#include +#include #include #include diff --git a/EventFiltering/PWGEM/EMPhotonFilter.cxx b/EventFiltering/PWGEM/EMPhotonFilter.cxx index 3e88524a89b..7a78c6485b1 100644 --- a/EventFiltering/PWGEM/EMPhotonFilter.cxx +++ b/EventFiltering/PWGEM/EMPhotonFilter.cxx @@ -14,17 +14,29 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.h" #include "EventFiltering/filterTables.h" -#include "DataFormatsPHOS/TriggerRecord.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::soa; diff --git a/EventFiltering/PWGEM/EMPhotonFilterQC.cxx b/EventFiltering/PWGEM/EMPhotonFilterQC.cxx index de4d59f00da..d805ac673cf 100644 --- a/EventFiltering/PWGEM/EMPhotonFilterQC.cxx +++ b/EventFiltering/PWGEM/EMPhotonFilterQC.cxx @@ -12,18 +12,31 @@ // \brief Quick QC task for CEFP for EM photon // \author daiki.sekihata@cern.ch -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/CaloClusters.h" -#include "DataFormatsPHOS/TriggerRecord.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include "PWGEM/PhotonMeson/Core/CutsLibrary.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.h" #include "EventFiltering/filterTables.h" -#include "Framework/HistogramRegistry.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::soa; diff --git a/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx b/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx index ff6a7f9e833..763b3a70bb2 100644 --- a/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx +++ b/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx @@ -14,6 +14,7 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt; Maximilian Korwieser (maximilian.korwieser@cern.ch) - Technical University Munich /// +#include "Common/CCDB/EventSelectionParams.h" #include "EventFiltering/filterTables.h" // #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" @@ -44,7 +45,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/EventFiltering/PWGEM/globalDimuonFilter.cxx b/EventFiltering/PWGEM/globalDimuonFilter.cxx index d58faa6fc3f..be71fc72cd6 100644 --- a/EventFiltering/PWGEM/globalDimuonFilter.cxx +++ b/EventFiltering/PWGEM/globalDimuonFilter.cxx @@ -12,37 +12,51 @@ // \brief software trigger for global dimuons // \author daiki.sekihata@cern.ch -#include "Common/Core/TableHelper.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include #include +#include #include +#include #include #include #include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::aod; diff --git a/EventFiltering/PWGHF/H2fromLbFilter.cxx b/EventFiltering/PWGHF/H2fromLbFilter.cxx index f99e0f3cde7..85fc65df1fa 100644 --- a/EventFiltering/PWGHF/H2fromLbFilter.cxx +++ b/EventFiltering/PWGHF/H2fromLbFilter.cxx @@ -16,8 +16,7 @@ #include "../filterTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" @@ -26,20 +25,23 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/TrackParametrization.h" - -#include "TVector3.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include struct H2fromLbFilter { diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index beb55ae8fd9..aedd6d3c7ce 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -19,6 +19,7 @@ /// \author Federica Zanone , Heidelberg University /// \author Antonio Palasciano , INFN Bari +#include "Common/CCDB/EventSelectionParams.h" #include "EventFiltering/PWGHF/HFFilterHelpers.h" #include "EventFiltering/filterTables.h" // @@ -301,7 +302,7 @@ struct HfFilter { // Main struct for HF triggers helper.setPtRangeSoftPiSigmaC(ptCuts->get(0u, 4u), ptCuts->get(1u, 4u)); helper.setPtDeltaMassRangeSigmaC(cutsPtDeltaMassCharmReso->get(0u, 6u), cutsPtDeltaMassCharmReso->get(1u, 6u), cutsPtDeltaMassCharmReso->get(0u, 7u), cutsPtDeltaMassCharmReso->get(1u, 7u), cutsPtDeltaMassCharmReso->get(0u, 8u), cutsPtDeltaMassCharmReso->get(1u, 8u), cutsPtDeltaMassCharmReso->get(0u, 9u), cutsPtDeltaMassCharmReso->get(1u, 9u), cutsPtDeltaMassCharmReso->get(2u, 6u), cutsPtDeltaMassCharmReso->get(2u, 7u), cutsPtDeltaMassCharmReso->get(2u, 8u), cutsPtDeltaMassCharmReso->get(2u, 9u)); helper.setPtRangeSoftKaonXicResoToSigmaC(ptCuts->get(0u, 5u), ptCuts->get(1u, 5u)); - helper.setVtxConfiguration(dfStrangeness, true); // (DCAFitterN, useAbsDCA) + helper.setVtxConfiguration(dfStrangeness, true); // (DCAFitterN, useAbsDCA) helper.setVtxConfiguration(dfStrangeness3, true); // (DCAFitterN, useAbsDCA) helper.setParSigmaCPr( cutsPtDeltaMassCharmReso->get(0u, 13u), // min ΔM diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 639f4c2619e..d215fb0df8d 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include #include #include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) diff --git a/EventFiltering/PWGJE/fullJetFilter.cxx b/EventFiltering/PWGJE/fullJetFilter.cxx index 25096b7bb7a..b47b9354eb3 100644 --- a/EventFiltering/PWGJE/fullJetFilter.cxx +++ b/EventFiltering/PWGJE/fullJetFilter.cxx @@ -12,35 +12,50 @@ // Full Jet Filter // Author: Gijs van Weelden -#include -#include -#include -#include -#include +#include "../filterTables.h" -#include +#include "PWGJE/DataModel/EMCALClusterDefinition.h" +#include "PWGJE/DataModel/EMCALClusters.h" +#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCTP/Configuration.h" -#include "EMCALBase/Geometry.h" -#include "ReconstructionDataFormats/Track.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" - -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/CCDB/TriggerAliases.h" -#include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/FastJetUtilities.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include -#include "../filterTables.h" +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGJE/jetFilter.cxx b/EventFiltering/PWGJE/jetFilter.cxx index 47761d62c1e..d9f9f153333 100644 --- a/EventFiltering/PWGJE/jetFilter.cxx +++ b/EventFiltering/PWGJE/jetFilter.cxx @@ -13,26 +13,23 @@ #include "../filterTables.h" -#include "PWGJE/Core/FastJetUtilities.h" -#include "PWGJE/Core/JetBkgSubUtils.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetFinder.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" - -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include diff --git a/EventFiltering/PWGJE/jetHFFilter.cxx b/EventFiltering/PWGJE/jetHFFilter.cxx index 6657e785751..f5a3aebdf40 100644 --- a/EventFiltering/PWGJE/jetHFFilter.cxx +++ b/EventFiltering/PWGJE/jetHFFilter.cxx @@ -11,31 +11,24 @@ // Author: Nima Zardoshti -#include -#include -#include +#include "../filterTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include "PWGJE/DataModel/Jet.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/FastJetUtilities.h" -#include "PWGJE/Core/JetBkgSubUtils.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/DataModel/Jet.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "../filterTables.h" - -#include "Framework/HistogramRegistry.h" +#include +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGLF/filterdoublephi.cxx b/EventFiltering/PWGLF/filterdoublephi.cxx index 7671402b5c5..ac4b0fe5327 100644 --- a/EventFiltering/PWGLF/filterdoublephi.cxx +++ b/EventFiltering/PWGLF/filterdoublephi.cxx @@ -16,36 +16,30 @@ #include "../filterTables.h" -#include "PWGLF/DataModel/ReducedDoublePhiTables.h" - -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/BetheBlochAleph.h" +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include -#include -#include -#include //FIXME +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include // FIXME - -#include -#include +#include #include #include #include diff --git a/EventFiltering/PWGLF/filterf1proton.cxx b/EventFiltering/PWGLF/filterf1proton.cxx index 64fe2761e18..9d345cc9194 100644 --- a/EventFiltering/PWGLF/filterf1proton.cxx +++ b/EventFiltering/PWGLF/filterf1proton.cxx @@ -16,44 +16,43 @@ #include "../filterTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "MathUtils/BetheBlochAleph.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/TrackParametrization.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include -#include - -#include +#include +#include +#include #include +#include #include #include diff --git a/EventFiltering/PWGLF/nucleiFilter.cxx b/EventFiltering/PWGLF/nucleiFilter.cxx index c336bf381c6..0a50f17cd0a 100644 --- a/EventFiltering/PWGLF/nucleiFilter.cxx +++ b/EventFiltering/PWGLF/nucleiFilter.cxx @@ -8,41 +8,54 @@ // 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. -// O2 includes #include "../filterTables.h" #include "PWGLF/DataModel/LFPIDTOFGenericTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/Vtx3BodyTables.h" #include "PWGLF/Utils/pidTOFGeneric.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/MetadataHelper.h" #include "Common/Core/PID/PIDTOF.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsTOF/ParameterContainers.h" -#include "MathUtils/BetheBlochAleph.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include + +#include #include +#include +#include #include #include #include diff --git a/EventFiltering/PWGLF/strangenessFilter.cxx b/EventFiltering/PWGLF/strangenessFilter.cxx index 07e36121586..dde0d18f4c8 100644 --- a/EventFiltering/PWGLF/strangenessFilter.cxx +++ b/EventFiltering/PWGLF/strangenessFilter.cxx @@ -21,33 +21,48 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.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 "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/TrackParametrization.h" - -#include "TVector3.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include +#include #include +#include +#include + +#include +#include #include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGMM/multFilter.cxx b/EventFiltering/PWGMM/multFilter.cxx index fe641438a43..7ab341b4591 100644 --- a/EventFiltering/PWGMM/multFilter.cxx +++ b/EventFiltering/PWGMM/multFilter.cxx @@ -8,23 +8,42 @@ // 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 "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "DataFormatsFT0/Digit.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include #include +#include +#include +#include #include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGUD/diffractionBCFilter.cxx b/EventFiltering/PWGUD/diffractionBCFilter.cxx index c6ce85ec845..a2c8f8c2ed9 100644 --- a/EventFiltering/PWGUD/diffractionBCFilter.cxx +++ b/EventFiltering/PWGUD/diffractionBCFilter.cxx @@ -8,19 +8,39 @@ // 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. -// O2 includes // // \brief A filter task for diffractive BCs // \author P. Buehler, paul.buehler@oeaw.ac.at // \since December, 2022 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/TableProducer/DGBCCandProducer.h" +#include "../filterTables.h" + #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.h" -#include "../filterTables.h" +#include "PWGUD/TableProducer/DGBCCandProducer.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGUD/diffractionFilter.cxx b/EventFiltering/PWGUD/diffractionFilter.cxx index c5adfcf90c5..946f95026e0 100644 --- a/EventFiltering/PWGUD/diffractionFilter.cxx +++ b/EventFiltering/PWGUD/diffractionFilter.cxx @@ -8,20 +8,39 @@ // 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. -// O2 includes // // \brief A filter task for diffractive events // \author P. Buehler, paul.buehler@oeaw.ac.at // \since June 1, 2021 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Common/DataModel/EventSelection.h" +#include "../filterTables.h" + #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.h" -#include "../filterTables.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/cefpTask.cxx b/EventFiltering/cefpTask.cxx index 64cf4435b85..eb64a60db54 100644 --- a/EventFiltering/cefpTask.cxx +++ b/EventFiltering/cefpTask.cxx @@ -8,31 +8,47 @@ // 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. -// O2 includes -#include +#include "filterTables.h" + +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include #include #include +#include + +#include +#include #include +#include #include #include #include -#include #include #include - -#include "filterTables.h" - -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsCTP/Scalers.h" +#include // we need to add workflow options before including Framework/runDataProcessing void customize(std::vector& workflowOptions) @@ -43,7 +59,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include using namespace o2; using namespace o2::aod; diff --git a/EventFiltering/filterTables.h b/EventFiltering/filterTables.h index c814c5d871f..cd4ad719297 100644 --- a/EventFiltering/filterTables.h +++ b/EventFiltering/filterTables.h @@ -8,14 +8,19 @@ // 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. + #ifndef EVENTFILTERING_FILTERTABLES_H_ #define EVENTFILTERING_FILTERTABLES_H_ +#include + #include -#include +#include +#include #include +#include +#include #include -#include namespace o2::aod { @@ -23,8 +28,6 @@ template struct Hash; } -#include "Framework/ASoA.h" - namespace o2::soa { template diff --git a/EventFiltering/macros/cefpOutputChecker.C b/EventFiltering/macros/cefpOutputChecker.C index d053cedf866..48295a1746e 100644 --- a/EventFiltering/macros/cefpOutputChecker.C +++ b/EventFiltering/macros/cefpOutputChecker.C @@ -8,11 +8,16 @@ // 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. -// O2 includes #include +#include +#include #include +#include + +#include + void cefpOutputChecker(std::string histoFile = "AnalysisResults.root", std::string treeFile = "AO2D.root") { TFile referenceFile(histoFile.data()); diff --git a/EventFiltering/macros/checkBCRange.C b/EventFiltering/macros/checkBCRange.C index 9bcc14981f4..413e223bdff 100644 --- a/EventFiltering/macros/checkBCRange.C +++ b/EventFiltering/macros/checkBCRange.C @@ -8,14 +8,21 @@ // 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. -// O2 includes -#include +#include +#include + +#include #include +#include +#include #include -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonDataFormat/IRFrame.h" +#include + +#include +#include +#include using o2::InteractionRecord; using o2::dataformats::IRFrame; diff --git a/EventFiltering/macros/checkBCrangesSkimming.C b/EventFiltering/macros/checkBCrangesSkimming.C index f71212238c3..db58d7d9848 100644 --- a/EventFiltering/macros/checkBCrangesSkimming.C +++ b/EventFiltering/macros/checkBCrangesSkimming.C @@ -8,18 +8,25 @@ // 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. -// O2 includes -#include -#include -#include -#include +#include +#include + #include #include #include #include -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonDataFormat/IRFrame.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include using o2::InteractionRecord; using o2::dataformats::IRFrame; @@ -187,7 +194,7 @@ std::string getRunNumber(std::string fileName) } // Detailed checks for specific trigger, not enabled by default -void checkBCForSelectedTrg(std::vector& originalFrames, std::vector& skimmedFrames, string runNumber, string triggerLabel) +void checkBCForSelectedTrg(std::vector& originalFrames, std::vector& skimmedFrames, std::string runNumber, std::string triggerLabel) { TH1D hTriggerCounter("hTriggerCounter", (runNumber + " " + triggerLabel + ";;Total number of trigger").data(), 2, -0.5, 1.5); @@ -328,7 +335,7 @@ void checkBCForSelectedTrg(std::vector& originalFrames, std::vec void checkBCForSelectedTrg(std::string AnaFileName = "AnalysisResults.root", std::string originalFileName = "bcRanges_fullrun.root", std::string skimmedFileName = "bcRanges_fullrun_skimmed.root", int triggerID = 1, bool useAlien = true) { - string runNumber = getRunNumber(originalFileName); + std::string runNumber = getRunNumber(originalFileName); if (useAlien) { TGrid::Connect("alien://"); AnaFileName = "alien://" + AnaFileName; @@ -365,7 +372,7 @@ void checkBCForSelectedTrg(std::string AnaFileName = "AnalysisResults.root", std void checkBCrangesSkimming(std::string AnaFileName = "AnalysisResults.root", std::string originalFileName = "bcRanges_fullrun.root", std::string skimmedFileName = "bcRanges_fullrun_skimmed.root", bool useAlien = true) { - string runNumber = getRunNumber(originalFileName); + std::string runNumber = getRunNumber(originalFileName); if (useAlien) { TGrid::Connect("alien://"); AnaFileName = "alien://" + AnaFileName; diff --git a/EventFiltering/macros/checkSkimming.C b/EventFiltering/macros/checkSkimming.C index 5496f303873..a69f9d5d129 100644 --- a/EventFiltering/macros/checkSkimming.C +++ b/EventFiltering/macros/checkSkimming.C @@ -10,15 +10,17 @@ // or submit itself to any jurisdiction. #include -#include +#include #include +#include #include +#include #include #include -#include -#include #include +#include +#include void checkSkimming(std::string original_path = "AnalysisResults.root", std::string skimmed_path = "AnalysisResults_skimmed.root", TFile* outputFile = nullptr, bool skipDownscaled = true) { @@ -129,4 +131,4 @@ void checkSkimming(std::string listName = "period.txt", bool skipDownscaled = tr counter++; } outputFile->Close(); -} \ No newline at end of file +} diff --git a/EventFiltering/macros/getMenu.C b/EventFiltering/macros/getMenu.C index 02386a68870..f1674d14539 100644 --- a/EventFiltering/macros/getMenu.C +++ b/EventFiltering/macros/getMenu.C @@ -9,17 +9,20 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CCDB/BasicCCDBManager.h" +#include #include #include #include #include +#include #include +#include +#include #include +#include #include -#include #include #include #include diff --git a/EventFiltering/macros/selectivityPlot.C b/EventFiltering/macros/selectivityPlot.C index 56215bcd3e6..344101a0984 100644 --- a/EventFiltering/macros/selectivityPlot.C +++ b/EventFiltering/macros/selectivityPlot.C @@ -9,6 +9,20 @@ // 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 + +#include + +#include + void selectivityPlot(int runNumber = 550781, TString inputfile = "AnalysisResults_550781.root", TString outputfolder = "") { TCanvas* Canvas_1 = new TCanvas("Canvas_1", "Canvas_1", 928, 592); diff --git a/EventFiltering/macros/splitFile.C b/EventFiltering/macros/splitFile.C index b38149dca42..b3c182e3c82 100644 --- a/EventFiltering/macros/splitFile.C +++ b/EventFiltering/macros/splitFile.C @@ -8,13 +8,14 @@ // 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. -// O2 includes + +#include +#include +#include +#include +#include #include -#include -#include "TFile.h" -#include "TDirectory.h" -#include "TTree.h" void splitFile(const char* inputFileName = "bcSelection.root", const char* outputFileName1 = "bcRanges.root") { diff --git a/EventFiltering/macros/uploadOTSobjects.C b/EventFiltering/macros/uploadOTSobjects.C index ec60c44ec0a..b1703a6ba45 100644 --- a/EventFiltering/macros/uploadOTSobjects.C +++ b/EventFiltering/macros/uploadOTSobjects.C @@ -12,22 +12,29 @@ #include "Common/Core/ZorroHelper.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" +#include +#include +#include -#include "TFile.h" -#include "TGrid.h" -#include "TH1.h" -#include "TKey.h" -#include "TSystem.h" -#include "TTree.h" +#include +#include +#include +#include +#include +#include +#include -#include +#include + +#include #include +#include #include #include #include +#include #include +#include #include constexpr uint32_t chunkSize = 1000000; diff --git a/EventFiltering/selectBCRange.cxx b/EventFiltering/selectBCRange.cxx index 8a2d200e8e6..a52127fe32e 100644 --- a/EventFiltering/selectBCRange.cxx +++ b/EventFiltering/selectBCRange.cxx @@ -9,15 +9,28 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "filterTables.h" + #include "Common/DataModel/EventSelection.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonDataFormat/IRFrame.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -#include "filterTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; From 30d21cf9a84435c1bd9e1e94fed7559e05dc9bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:49:49 +0200 Subject: [PATCH 134/282] [Infrastructure] O2 linter: Re-enable workflow. Fix branch names. Print commit and branch. (#15582) --- .github/workflows/o2-linter.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml index 0ab7211d487..f5a1b39a950 100644 --- a/.github/workflows/o2-linter.yml +++ b/.github/workflows/o2-linter.yml @@ -2,7 +2,7 @@ # Find issues in O2 code name: O2 linter -#"on": [pull_request_target, push] +"on": [pull_request_target, push] permissions: {} env: BRANCH_MAIN: master @@ -20,12 +20,12 @@ jobs: steps: - name: Set branches run: | - if [[ "${{ github.event_name }}" == "push" ]]; then + if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "pull_request" ]]; then branch_head="${{ github.ref }}" - branch_base="${{ env.BRANCH_MAIN }}" + branch_base="origin/${{ env.BRANCH_MAIN }}" else branch_head="refs/pull/${{ github.event.pull_request.number }}/merge" - branch_base="${{ github.event.pull_request.base.ref }}" + branch_base="origin/${{ github.event.pull_request.base.ref }}" fi echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV" echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV" @@ -37,9 +37,10 @@ jobs: - name: Run tests id: linter run: | + git log -n 1 --pretty='format:%ci %h %s %d%n' # Diff against the common ancestor of the source (head) branch and the target (base) branch. echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}." - readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...) + readarray -t files < <(git diff --diff-filter d --name-only ${{ env.BRANCH_BASE }}...) if [ ${#files[@]} -eq 0 ]; then echo "::notice::No files to lint." echo "linter_ran=0" >> "$GITHUB_OUTPUT" From 232b05ab17ffd8055a01f6fa9fd04217e0ad5867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:15:56 +0200 Subject: [PATCH 135/282] [PWGLF,PWGMM] Fix includes and using statements (#15389) --- PWGMM/Lumi/Tasks/LumiFDDFT0.cxx | 51 +++++++-------- PWGMM/Lumi/Tasks/fitLumi.cxx | 38 ++++++----- PWGMM/Lumi/Tasks/lumi.cxx | 55 +++++++--------- PWGMM/Lumi/Tasks/lumiStability.cxx | 40 +++++++----- PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx | 30 ++++++--- PWGMM/Lumi/Tasks/lumiStabilityPP.cxx | 38 ++++++----- PWGMM/Lumi/macros/merger.C | 9 +++ PWGMM/Lumi/macros/non_fac.C | 17 ++++- PWGMM/Mult/Core/include/Axes.h | 49 ++++++++------- PWGMM/Mult/Core/include/Histograms.h | 3 +- PWGMM/Mult/Core/include/Selections.h | 24 +++---- PWGMM/Mult/DataModel/Gencentralities.h | 2 +- PWGMM/Mult/DataModel/Index.h | 10 +-- PWGMM/Mult/DataModel/ReducedTables.h | 9 +-- PWGMM/Mult/DataModel/bestCollisionTable.h | 4 +- .../ambiguousTrackPropagation.cxx | 40 +++++++----- PWGMM/Mult/TableProducer/particles2tracks.cxx | 13 ++-- PWGMM/Mult/TableProducer/percentiles.cxx | 21 +++++-- PWGMM/Mult/TableProducer/reducer.cxx | 32 ++++++++-- .../Mult/TableProducer/reducerPostprocess.cxx | 9 ++- PWGMM/Mult/Tasks/assessment-mft.cxx | 14 +++-- PWGMM/Mult/Tasks/dndeta-hi.cxx | 55 +++++++--------- PWGMM/Mult/Tasks/dndeta-mft.cxx | 41 +++++++----- PWGMM/Mult/Tasks/dndeta.cxx | 46 +++++++++----- PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx | 63 ++++++++++++------- PWGMM/Mult/Tasks/effpt-mft.cxx | 41 ++++++------ PWGMM/Mult/Tasks/flatenicityFV0.cxx | 36 ++++++----- PWGMM/Mult/Tasks/flattenicty-chrg.cxx | 45 +++++++------ PWGMM/Mult/Tasks/heavy-ion-mult.cxx | 38 ++++++----- PWGMM/Mult/Tasks/mcdata_split_test.cxx | 22 ++++--- .../Mult/Tasks/mftReassociationValidation.cxx | 13 +--- PWGMM/Mult/Tasks/multiplicityPbPb.cxx | 22 ++++--- PWGMM/Mult/Tasks/pseudoEffMFT.cxx | 43 +++++++------ PWGMM/Mult/Tasks/puremc-dndeta.cxx | 29 ++++++--- PWGMM/Mult/Tasks/run2dndeta.cxx | 35 ++++++----- PWGMM/Mult/Tasks/vertexing-fwd.cxx | 31 +++++---- PWGMM/UE/Tasks/dedxAnalysis.cxx | 40 ++++++------ PWGMM/UE/Tasks/ue-zdc-analysys.cxx | 27 ++++---- PWGMM/UE/Tasks/uecharged.cxx | 26 ++++---- 39 files changed, 681 insertions(+), 480 deletions(-) diff --git a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx index c5609cbbd9a..629c2a7078d 100644 --- a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx +++ b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx @@ -10,36 +10,33 @@ // or submit itself to any jurisdiction. // author: akhuntia@cern.ch -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/GeomConstants.h" -#include "CommonUtils/NameConf.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexer.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/Vertex.h" - -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include +#include +#include #include using namespace o2; diff --git a/PWGMM/Lumi/Tasks/fitLumi.cxx b/PWGMM/Lumi/Tasks/fitLumi.cxx index a62771cda66..4bcc73496c9 100644 --- a/PWGMM/Lumi/Tasks/fitLumi.cxx +++ b/PWGMM/Lumi/Tasks/fitLumi.cxx @@ -11,21 +11,25 @@ // author: arvind.khuntia@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFIT/Triggers.h" -#include "Common/DataModel/FT0Corrected.h" - -#include "CCDB/CcdbApi.h" -#include "CommonDataFormat/BunchFilling.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "TH1F.h" -#include "TH2F.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -111,7 +115,7 @@ struct VdMAO2D { registry.get(HIST("FT0/bcVertexCollBC"))->Fill(localBC); } } // vertex - } // ft0 + } // ft0 nTF++; } // process @@ -174,7 +178,7 @@ struct VdMAO2D { } } // vertex - } // fdd + } // fdd } PROCESS_SWITCH(VdMAO2D, processFDD, "Process FDD trigger rates for VdM", true); diff --git a/PWGMM/Lumi/Tasks/lumi.cxx b/PWGMM/Lumi/Tasks/lumi.cxx index cc0149dbde7..b1fcd5910d5 100644 --- a/PWGMM/Lumi/Tasks/lumi.cxx +++ b/PWGMM/Lumi/Tasks/lumi.cxx @@ -15,43 +15,30 @@ // o2-analysis-trackselection -b --isRun3 0 | o2-analysis-mm-lumi -b // --configuration json://./config.json -#include -#include -#include -#include - -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonUtils/NameConf.h" - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" - -#include "DetectorsVertexing/PVertexer.h" - -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/Vertex.h" - -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" - -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" - -#include "CommonConstants/GeomConstants.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" - -#include "DataFormatsCalibration/MeanVertexObject.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include namespace o2::aod { diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 976fd6d351a..ab1dca52f6e 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -16,22 +16,32 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsFV0/Digit.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include #include #include diff --git a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx index 8ad19ef30a6..d267dbfb83f 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx @@ -15,25 +15,39 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt /// \author Stefanie Mrozinski (stefanie.mrozinski@cern.ch) - Goethe University Frankfurt +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/MetadataHelper.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include +#include +#include #include #include #include #include +#include #include using namespace o2; diff --git a/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx b/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx index 2962148c4dc..bf0cae99e81 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx @@ -17,25 +17,33 @@ #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/MetadataHelper.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include +#include +#include +#include +#include #include #include - -#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include #include #include #include +#include #include o2::common::core::MetadataHelper metadataInfo; // Metadata helper @@ -213,7 +221,7 @@ struct LumiStabilityPP { std::array totalLeadingBCs = {0, 0}; for (int iBC = 0; iBC < o2::constants::lhc::LHCMaxBunches; iBC++) { - if (bcPatternB[iBC]) { // Check if current BC is of type B + if (bcPatternB[iBC]) { // Check if current BC is of type B int nonBtypeBCsBefore{0}, emptyBCsBefore{0}; // Count how many consecutive BCs before this one are non-B for (int j = 1; j <= numEmptyBCsBeforeLeadingBC->get(0u, 0u); j++) { int prevBC = (iBC - j + o2::constants::lhc::LHCMaxBunches) % o2::constants::lhc::LHCMaxBunches; // Protection for BCs at small indices to check the end of the orbit diff --git a/PWGMM/Lumi/macros/merger.C b/PWGMM/Lumi/macros/merger.C index f3759a277ef..1ad2cd5f920 100644 --- a/PWGMM/Lumi/macros/merger.C +++ b/PWGMM/Lumi/macros/merger.C @@ -13,6 +13,15 @@ // merge all trees into one tree to construct event by event log-likelihood // function. +#include +#include +#include +#include +#include +#include + +#include + void merger() { TFile* fin = new TFile("../data/PbPb_NF/AnalysisResults_trees.root", "read"); diff --git a/PWGMM/Lumi/macros/non_fac.C b/PWGMM/Lumi/macros/non_fac.C index 34022f82f8b..ea858e409f0 100644 --- a/PWGMM/Lumi/macros/non_fac.C +++ b/PWGMM/Lumi/macros/non_fac.C @@ -12,6 +12,21 @@ /// \since November 2021 // code for fitting the luminous region for each step +#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include +#include +#include +#include + +#include + +#include +#include + TFile* fin = new TFile("mergedOutput.root", "read"); TTree* tin; @@ -193,7 +208,7 @@ void non_fac() FunMinuit[i]->mnexcm("MIGRAD", arglist, 2, ierflg); for (int p = 0; p < 10; p++) { FunMinuit[i]->GetParameter(p, FitRes_cntl[i][p], FitRes_stat[i][p]); - cout << FitRes_cntl[i][p] << ", " << FitRes_stat[i][p] << endl; + std::cout << FitRes_cntl[i][p] << ", " << FitRes_stat[i][p] << std::endl; } hResults[i] = new TH1D(Form("hResults%d", i), "", 12, 0, 12); for (int p = 0; p < 10; p++) { diff --git a/PWGMM/Mult/Core/include/Axes.h b/PWGMM/Mult/Core/include/Axes.h index c215a8ba357..9528e5a84ac 100644 --- a/PWGMM/Mult/Core/include/Axes.h +++ b/PWGMM/Mult/Core/include/Axes.h @@ -11,35 +11,39 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_AXES_H_ #define PWGMM_MULT_CORE_INCLUDE_AXES_H_ -#include "Framework/HistogramSpec.h" -#include "CommonConstants/MathConstants.h" + +#include +#include + +#include +#include +#include namespace pwgmm::mult { -using namespace o2::framework; static constexpr std::string_view ptAxisName = "p_{T} (GeV/c)"; // common axis definitions -AxisSpec ZAxis = {301, -30.1, 30.1, "Z_{vtx} (cm)"}; // Z vertex in cm -AxisSpec DeltaZAxis = {61, -6.1, 6.1, "#Delta Z (cm)"}; // Z vertex difference in cm -AxisSpec DCAAxis = {601, -3.01, 3.01}; // DCA in cm -AxisSpec EtaAxis = {22, -2.2, 2.2, "#eta"}; // Eta +o2::framework::AxisSpec ZAxis = {301, -30.1, 30.1, "Z_{vtx} (cm)"}; // Z vertex in cm +o2::framework::AxisSpec DeltaZAxis = {61, -6.1, 6.1, "#Delta Z (cm)"}; // Z vertex difference in cm +o2::framework::AxisSpec DCAAxis = {601, -3.01, 3.01}; // DCA in cm +o2::framework::AxisSpec EtaAxis = {22, -2.2, 2.2, "#eta"}; // Eta -AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "#phi"}; // Phi (azimuthal angle) -AxisSpec PtAxis = {2401, -0.005, 24.005, ptAxisName.data()}; // Large fine-binned Pt +o2::framework::AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "#phi"}; // Phi (azimuthal angle) +o2::framework::AxisSpec PtAxis = {2401, -0.005, 24.005, ptAxisName.data()}; // Large fine-binned Pt // Large wide-binned Pt (for efficiency) -AxisSpec PtAxisEff = {{0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 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.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, - ptAxisName.data()}; -AxisSpec PtAxis_wide = {1041, -0.05, 104.05, ptAxisName.data()}; // Smaller wider-binned Pt -AxisSpec FT0CAxis = {1001, -0.5, 1000.5, "FT0C amplitude (arb. units)"}; // FT0C amplitudes -AxisSpec FT0AAxis = {3001, -0.5, 3000.5, "FT0A amplitude (arb. units)"}; // FT0A amplitudes -AxisSpec FDAAxis = {3001, -0.5, 3000.5, "FDA amplitude (arb. units)"}; // FDD amplitudes -AxisSpec FDCAxis = {3001, -0.5, 3000.5, "FDC amplitude (arb. units)"}; // FDD amplitudes -AxisSpec RapidityAxis = {102, -10.2, 10.2, "Y"}; // Rapidity -AxisSpec ScaleAxis = {121, -0.5, 120.5, "Event scale (GeV)"}; // Event scale -AxisSpec MPIAxis = {51, -0.5, 50.5, "N_{MPI}"}; // N_{MPI} -AxisSpec ProcAxis = {21, 89.5, 110.5}; // Process flag -AxisSpec SpeciesAxis = {5, 0.5, 5.5}; // Particle species +o2::framework::AxisSpec PtAxisEff = {{0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 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.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, + ptAxisName.data()}; +o2::framework::AxisSpec PtAxis_wide = {1041, -0.05, 104.05, ptAxisName.data()}; // Smaller wider-binned Pt +o2::framework::AxisSpec FT0CAxis = {1001, -0.5, 1000.5, "FT0C amplitude (arb. units)"}; // FT0C amplitudes +o2::framework::AxisSpec FT0AAxis = {3001, -0.5, 3000.5, "FT0A amplitude (arb. units)"}; // FT0A amplitudes +o2::framework::AxisSpec FDAAxis = {3001, -0.5, 3000.5, "FDA amplitude (arb. units)"}; // FDD amplitudes +o2::framework::AxisSpec FDCAxis = {3001, -0.5, 3000.5, "FDC amplitude (arb. units)"}; // FDD amplitudes +o2::framework::AxisSpec RapidityAxis = {102, -10.2, 10.2, "Y"}; // Rapidity +o2::framework::AxisSpec ScaleAxis = {121, -0.5, 120.5, "Event scale (GeV)"}; // Event scale +o2::framework::AxisSpec MPIAxis = {51, -0.5, 50.5, "N_{MPI}"}; // N_{MPI} +o2::framework::AxisSpec ProcAxis = {21, 89.5, 110.5}; // Process flag +o2::framework::AxisSpec SpeciesAxis = {5, 0.5, 5.5}; // Particle species // event selection/efficiency binning enum struct EvSelBins : int { @@ -78,4 +82,5 @@ std::array(EvEffBins::kSelectedPVgt0) + 1> "Selected INEL>0", "Selected INEL>0 (PV)"}; } // namespace pwgmm::mult + #endif // PWGMM_MULT_CORE_INCLUDE_AXES_H_ diff --git a/PWGMM/Mult/Core/include/Histograms.h b/PWGMM/Mult/Core/include/Histograms.h index 2b41c9ecefe..17828d1edcb 100644 --- a/PWGMM/Mult/Core/include/Histograms.h +++ b/PWGMM/Mult/Core/include/Histograms.h @@ -11,7 +11,8 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_HISTOGRAMS_H_ #define PWGMM_MULT_CORE_INCLUDE_HISTOGRAMS_H_ -#include "TPDGCode.h" +#include + #include #include diff --git a/PWGMM/Mult/Core/include/Selections.h b/PWGMM/Mult/Core/include/Selections.h index 2532da6ccce..8240410c462 100644 --- a/PWGMM/Mult/Core/include/Selections.h +++ b/PWGMM/Mult/Core/include/Selections.h @@ -11,30 +11,30 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_SELECTIONS_H_ #define PWGMM_MULT_CORE_INCLUDE_SELECTIONS_H_ + #include "Common/DataModel/TrackSelectionTables.h" namespace pwgmm::mult { -using namespace o2::aod::track; // default quality criteria for tracks with ITS contribution -static constexpr TrackSelectionFlags::flagtype trackSelectionITS = - TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | - TrackSelectionFlags::kITSHits; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionITS = + o2::aod::track::TrackSelectionFlags::kITSNCls | o2::aod::track::TrackSelectionFlags::kITSChi2NDF | + o2::aod::track::TrackSelectionFlags::kITSHits; // default quality criteria for tracks with TPC contribution -static constexpr TrackSelectionFlags::flagtype trackSelectionTPC = - TrackSelectionFlags::kTPCNCls | - TrackSelectionFlags::kTPCCrossedRowsOverNCls | - TrackSelectionFlags::kTPCChi2NDF; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionTPC = + o2::aod::track::TrackSelectionFlags::kTPCNCls | + o2::aod::track::TrackSelectionFlags::kTPCCrossedRowsOverNCls | + o2::aod::track::TrackSelectionFlags::kTPCChi2NDF; // default standard DCA cuts -static constexpr TrackSelectionFlags::flagtype trackSelectionDCA = - TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCA = + o2::aod::track::TrackSelectionFlags::kDCAz | o2::aod::track::TrackSelectionFlags::kDCAxy; // default standard transversal-only DCA cuts -static constexpr TrackSelectionFlags::flagtype trackSelectionDCAXYonly = - TrackSelectionFlags::kDCAxy; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCAXYonly = + o2::aod::track::TrackSelectionFlags::kDCAxy; } // namespace pwgmm::mult #endif // PWGMM_MULT_CORE_INCLUDE_SELECTIONS_H_ diff --git a/PWGMM/Mult/DataModel/Gencentralities.h b/PWGMM/Mult/DataModel/Gencentralities.h index 112072fa2c8..fb7de9da0e8 100644 --- a/PWGMM/Mult/DataModel/Gencentralities.h +++ b/PWGMM/Mult/DataModel/Gencentralities.h @@ -12,7 +12,7 @@ #ifndef PWGMM_MULT_DATAMODEL_GENCENTRALITIES_H_ #define PWGMM_MULT_DATAMODEL_GENCENTRALITIES_H_ -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { namespace gencents diff --git a/PWGMM/Mult/DataModel/Index.h b/PWGMM/Mult/DataModel/Index.h index b3c71f534a2..ba4c29ef606 100644 --- a/PWGMM/Mult/DataModel/Index.h +++ b/PWGMM/Mult/DataModel/Index.h @@ -9,10 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef O2_ANALYSIS_INDEX_H_ -#define O2_ANALYSIS_INDEX_H_ +#ifndef PWGMM_MULT_DATAMODEL_INDEX_H_ +#define PWGMM_MULT_DATAMODEL_INDEX_H_ + +#include -#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace idx @@ -23,4 +24,5 @@ DECLARE_SOA_ARRAY_INDEX_COLUMN(MFTTrack, mfttracks); DECLARE_SOA_TABLE(ParticlesToTracks, "AOD", "P2T", idx::TrackIds); DECLARE_SOA_TABLE(ParticlesToMftTracks, "AOD", "P2MFTT", idx::MFTTrackIds); } // namespace o2::aod -#endif // O2_ANALYSIS_INDEX_H_ + +#endif // PWGMM_MULT_DATAMODEL_INDEX_H_ diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index fbdd68b89db..60eb29ac659 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -11,13 +11,14 @@ #ifndef PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ #define PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ -#include - -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" +#include + +#include + namespace o2::aod { diff --git a/PWGMM/Mult/DataModel/bestCollisionTable.h b/PWGMM/Mult/DataModel/bestCollisionTable.h index 0b4ee5440bc..27b524b5b89 100644 --- a/PWGMM/Mult/DataModel/bestCollisionTable.h +++ b/PWGMM/Mult/DataModel/bestCollisionTable.h @@ -19,7 +19,9 @@ #ifndef PWGMM_MULT_DATAMODEL_BESTCOLLISIONTABLE_H_ #define PWGMM_MULT_DATAMODEL_BESTCOLLISIONTABLE_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx b/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx index dc958a3cd02..af3a895eec3 100644 --- a/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx +++ b/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx @@ -25,20 +25,32 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/GeomConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include #include #include diff --git a/PWGMM/Mult/TableProducer/particles2tracks.cxx b/PWGMM/Mult/TableProducer/particles2tracks.cxx index 6b7e7db6a17..662bd34dd69 100644 --- a/PWGMM/Mult/TableProducer/particles2tracks.cxx +++ b/PWGMM/Mult/TableProducer/particles2tracks.cxx @@ -16,12 +16,17 @@ /// \brief A task to create a reverse index from McParticles to Tracks /// -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" - #include "Index.h" +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/percentiles.cxx b/PWGMM/Mult/TableProducer/percentiles.cxx index c11fca858f8..d34802ab2ae 100644 --- a/PWGMM/Mult/TableProducer/percentiles.cxx +++ b/PWGMM/Mult/TableProducer/percentiles.cxx @@ -8,19 +8,30 @@ // 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 "Gencentralities.h" #include "Selections.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include #include +#include #include #include -#include -#include "Common/DataModel/Centrality.h" -#include +#include +#include +#include +#include #include -#include #include -#include "Gencentralities.h" +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/reducer.cxx b/PWGMM/Mult/TableProducer/reducer.cxx index de9d516703b..6d290692e55 100644 --- a/PWGMM/Mult/TableProducer/reducer.cxx +++ b/PWGMM/Mult/TableProducer/reducer.cxx @@ -9,14 +9,34 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" - -#include "Selections.h" #include "ReducedTables.h" +#include "Selections.h" -#include "Framework/runDataProcessing.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/reducerPostprocess.cxx b/PWGMM/Mult/TableProducer/reducerPostprocess.cxx index d05f5534eb0..29bfecf43e4 100644 --- a/PWGMM/Mult/TableProducer/reducerPostprocess.cxx +++ b/PWGMM/Mult/TableProducer/reducerPostprocess.cxx @@ -9,11 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/AnalysisTask.h" - #include "ReducedTables.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/assessment-mft.cxx b/PWGMM/Mult/Tasks/assessment-mft.cxx index 70304229e1e..735e95e9a6c 100644 --- a/PWGMM/Mult/Tasks/assessment-mft.cxx +++ b/PWGMM/Mult/Tasks/assessment-mft.cxx @@ -15,11 +15,15 @@ // \brief This code loops over MFT tracks and fills basic histograms // close to the QC ones -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include -#include "MathUtils/Utils.h" -#include "CommonConstants/LHCConstants.h" +#include using namespace o2; using namespace o2::framework; @@ -35,7 +39,7 @@ struct AssessmentMFT { {"TracksChi2", "; #chi^{2}; tracks", {HistType::kTH1F, {{600, 0, 20}}}}, // {"TracksNclustersEta", "; nClusters; #eta; tracks", {HistType::kTH2F, {{7, 4, 10}, {100, -8, 8}}}}, // {"TracksTime", "; time; #count", {HistType::kTH1D, {{6000000, 0, 60000}}}}, // - } // + } // }; void process(aod::Collisions::iterator const& collision, aod::MFTTracks const& tracks, aod::BCs const& bcs) diff --git a/PWGMM/Mult/Tasks/dndeta-hi.cxx b/PWGMM/Mult/Tasks/dndeta-hi.cxx index d479a3138e3..630922994cb 100644 --- a/PWGMM/Mult/Tasks/dndeta-hi.cxx +++ b/PWGMM/Mult/Tasks/dndeta-hi.cxx @@ -10,47 +10,41 @@ // or submit itself to any jurisdiction. #include "Index.h" -#include "bestCollisionTable.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/RecoDecay.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 "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "ReconstructionDataFormats/Track.h" - -#include -#include -#include -#include -#include -#include - -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include #include +#include #include -#include +#include +#include + +#include using namespace o2; using namespace o2::framework; @@ -58,7 +52,6 @@ using namespace o2::framework::expressions; using namespace o2::aod::track; using namespace o2::aod; -using namespace o2::analysis; using BCsRun3 = soa::Join; using MyCollisions = soa::Join; diff --git a/PWGMM/Mult/Tasks/dndeta-mft.cxx b/PWGMM/Mult/Tasks/dndeta-mft.cxx index f70cc1d638a..e7ff487021d 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft.cxx @@ -15,27 +15,34 @@ // \brief This code loops over MFT tracks and collisions and fills histograms // useful to compute dNdeta -#include -#include - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" +#include "bestCollisionTable.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "TDatabasePDG.h" -#include "bestCollisionTable.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; @@ -108,7 +115,7 @@ struct PseudorapidityDensityMFT { {"EventSelection", ";status;events", {HistType::kTH1F, {{7, 0.5, 7.5}}}}, // - } // + } // }; void init(InitContext&) diff --git a/PWGMM/Mult/Tasks/dndeta.cxx b/PWGMM/Mult/Tasks/dndeta.cxx index 220bdbdebb8..df1ebc63cd8 100644 --- a/PWGMM/Mult/Tasks/dndeta.cxx +++ b/PWGMM/Mult/Tasks/dndeta.cxx @@ -9,26 +9,40 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include -#include - +#include "Axes.h" +#include "Functions.h" #include "Gencentralities.h" +#include "Histograms.h" #include "Index.h" +#include "Selections.h" #include "bestCollisionTable.h" -#include "Axes.h" -#include "Functions.h" -#include "Selections.h" -#include "Histograms.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include using namespace o2; using namespace o2::aod::track; diff --git a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx index 3b060924ad7..97425d586c6 100644 --- a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx +++ b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx @@ -19,42 +19,57 @@ #include "Index.h" #include "bestCollisionTable.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/GeomConstants.h" -#include "CommonConstants/MathConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" -#include "TMCProcess.h" -#include "TPDGCode.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include +#include #include #include +#include +#include +#include +#include #include #include +#include #include #include diff --git a/PWGMM/Mult/Tasks/effpt-mft.cxx b/PWGMM/Mult/Tasks/effpt-mft.cxx index 2d3a9919922..c34dea1def2 100644 --- a/PWGMM/Mult/Tasks/effpt-mft.cxx +++ b/PWGMM/Mult/Tasks/effpt-mft.cxx @@ -9,25 +9,26 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include "Framework/Configurable.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RuntimeError.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "TDatabasePDG.h" -#include "MathUtils/Utils.h" #include "Index.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -219,9 +220,9 @@ struct EffPtMFT { registry.fill(HIST("TracksPhiEtaGenDuplicates"), particle.phi(), particle.eta()); } } // the particle has a track - } // loop on particlesI - } // loop on collisions - } // end of processTrackEfficiencyIndexed + } // loop on particlesI + } // loop on collisions + } // end of processTrackEfficiencyIndexed PROCESS_SWITCH(EffPtMFT, processTrackEfficiencyIndexed, "Calculate tracking efficiency vs pt (indexed)", false); }; diff --git a/PWGMM/Mult/Tasks/flatenicityFV0.cxx b/PWGMM/Mult/Tasks/flatenicityFV0.cxx index 3a403d9ea1b..0c7c3565676 100644 --- a/PWGMM/Mult/Tasks/flatenicityFV0.cxx +++ b/PWGMM/Mult/Tasks/flatenicityFV0.cxx @@ -8,24 +8,32 @@ // 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 - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/flattenicty-chrg.cxx b/PWGMM/Mult/Tasks/flattenicty-chrg.cxx index fbfa4ab578d..2f84c6603bb 100644 --- a/PWGMM/Mult/Tasks/flattenicty-chrg.cxx +++ b/PWGMM/Mult/Tasks/flattenicty-chrg.cxx @@ -17,28 +17,37 @@ // // \since 2024 +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include #include +#include +#include #include -#include #include -#include "EventFiltering/filterTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "DataFormatsFT0/Digit.h" -#include "ReconstructionDataFormats/Track.h" +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/heavy-ion-mult.cxx b/PWGMM/Mult/Tasks/heavy-ion-mult.cxx index 9d8fdf30a2a..d281fb37ac7 100644 --- a/PWGMM/Mult/Tasks/heavy-ion-mult.cxx +++ b/PWGMM/Mult/Tasks/heavy-ion-mult.cxx @@ -18,38 +18,42 @@ // 3. https://github.com/AliceO2Group/O2Physics/blob/master/PWGMM/Mult/Tasks/puremc-dndeta.cxx // 4. O2 analysis tutorial: https://indico.cern.ch/event/1267433/ -#include "Index.h" -#include "bestCollisionTable.h" - #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.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 "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include + +#include +#include #include +#include #include -#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGMM/Mult/Tasks/mcdata_split_test.cxx b/PWGMM/Mult/Tasks/mcdata_split_test.cxx index 5d5194be4be..32f85d3e946 100644 --- a/PWGMM/Mult/Tasks/mcdata_split_test.cxx +++ b/PWGMM/Mult/Tasks/mcdata_split_test.cxx @@ -13,20 +13,24 @@ /// /// \author hhesouno -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" - #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx index 2afc211b4b3..f527b61329c 100644 --- a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx +++ b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx @@ -17,45 +17,36 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" #include #include #include #include -#include #include #include #include -#include -#include #include #include -#include #include #include #include #include #include #include -#include #include -#include #include -#include - -#include +#include #include #include #include #include #include +#include #include #include #include diff --git a/PWGMM/Mult/Tasks/multiplicityPbPb.cxx b/PWGMM/Mult/Tasks/multiplicityPbPb.cxx index 367b7e991a6..70f62629b54 100644 --- a/PWGMM/Mult/Tasks/multiplicityPbPb.cxx +++ b/PWGMM/Mult/Tasks/multiplicityPbPb.cxx @@ -13,17 +13,21 @@ /// /// \author hhesouno -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" - #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/pseudoEffMFT.cxx b/PWGMM/Mult/Tasks/pseudoEffMFT.cxx index d8dc1990329..7a47c760094 100644 --- a/PWGMM/Mult/Tasks/pseudoEffMFT.cxx +++ b/PWGMM/Mult/Tasks/pseudoEffMFT.cxx @@ -16,40 +16,47 @@ /// \since OCT 2025 #include "Functions.h" -#include "Index.h" #include "bestCollisionTable.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" + +#include +#include #include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include +#include -#include "TPDGCode.h" +#include #include +#include #include #include -#include +#include #include #include +#include #include #include diff --git a/PWGMM/Mult/Tasks/puremc-dndeta.cxx b/PWGMM/Mult/Tasks/puremc-dndeta.cxx index 86e52b38850..f634755a3dd 100644 --- a/PWGMM/Mult/Tasks/puremc-dndeta.cxx +++ b/PWGMM/Mult/Tasks/puremc-dndeta.cxx @@ -9,17 +9,30 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include -#include - #include "Axes.h" #include "Histograms.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGMM/Mult/Tasks/run2dndeta.cxx b/PWGMM/Mult/Tasks/run2dndeta.cxx index 9db9fd291d9..84e7fca4123 100644 --- a/PWGMM/Mult/Tasks/run2dndeta.cxx +++ b/PWGMM/Mult/Tasks/run2dndeta.cxx @@ -8,24 +8,29 @@ // 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/Configurable.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RuntimeError.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "TDatabasePDG.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; @@ -56,7 +61,7 @@ struct PseudorapidityDensity { {"TracksEtaZvtx_gt0", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{21, -2.1, 2.1}, {201, -20.1, 20.1}}}}, // {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}, // {"EventSelection", ";status;events", {HistType::kTH1F, {{4, 0.5, 4.5}}}} // - } // + } // }; void init(InitContext&) diff --git a/PWGMM/Mult/Tasks/vertexing-fwd.cxx b/PWGMM/Mult/Tasks/vertexing-fwd.cxx index aecb9e7cd9c..f5dd786acc7 100644 --- a/PWGMM/Mult/Tasks/vertexing-fwd.cxx +++ b/PWGMM/Mult/Tasks/vertexing-fwd.cxx @@ -16,18 +16,27 @@ // \brief This code loops over every ambiguous MFT tracks and associates // them to a collision that has the smallest DCAxy +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include #include -#include "ReconstructionDataFormats/TrackFwd.h" -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "MathUtils/Utils.h" -#include "Framework/Configurable.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/runDataProcessing.h" - -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/LHCConstants.h" +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/dedxAnalysis.cxx b/PWGMM/UE/Tasks/dedxAnalysis.cxx index a4ea4bb22ac..cb8e1cbbc0d 100644 --- a/PWGMM/UE/Tasks/dedxAnalysis.cxx +++ b/PWGMM/UE/Tasks/dedxAnalysis.cxx @@ -16,29 +16,33 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/V0.h" - -#include "TF1.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/ue-zdc-analysys.cxx b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx index ec5294f7248..bf632017ee4 100644 --- a/PWGMM/UE/Tasks/ue-zdc-analysys.cxx +++ b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx @@ -12,22 +12,21 @@ /// \brief Task for ZDC /// \author /// \since -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/Core/TrackSelection.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "ReconstructionDataFormats/Track.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TObjArray.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 9af0eb3cc2a..5f8908db124 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -15,31 +15,35 @@ /// \since November 2021 /// \last update: March 2026 -#include "PWGLF/DataModel/mcCentrality.h" -#include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" -#include "PWGLF/Utils/mcParticle.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include #include #include #include +#include #include using namespace o2; From 055320e76ca7a868d8c3636b211d97e759a0fddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:20:21 +0200 Subject: [PATCH 136/282] [PWGEM] Fix includes and using statements (#15385) --- PWGEM/Dilepton/Core/DielectronCut.cxx | 6 +- PWGEM/Dilepton/Core/DielectronCut.h | 30 +- PWGEM/Dilepton/Core/Dilepton.h | 702 +++++++------- PWGEM/Dilepton/Core/DileptonHadronMPC.h | 664 +++++++------- PWGEM/Dilepton/Core/DileptonMC.h | 868 +++++++++--------- PWGEM/Dilepton/Core/DileptonProducer.h | 522 ++++++----- PWGEM/Dilepton/Core/DimuonCut.cxx | 5 +- PWGEM/Dilepton/Core/DimuonCut.h | 33 +- PWGEM/Dilepton/Core/EMEventCut.cxx | 4 +- PWGEM/Dilepton/Core/EMEventCut.h | 7 +- PWGEM/Dilepton/Core/EMTrackCut.cxx | 6 +- PWGEM/Dilepton/Core/EMTrackCut.h | 6 +- PWGEM/Dilepton/Core/SingleTrackQC.h | 543 +++++------ PWGEM/Dilepton/Core/SingleTrackQCMC.h | 607 ++++++------ PWGEM/Dilepton/DataModel/dileptonTables.h | 139 ++- PWGEM/Dilepton/DataModel/lmeeMLTables.h | 6 +- .../TableProducer/Converters/bcConverter1.cxx | 6 +- .../Converters/electronConverter2.cxx | 6 +- .../Converters/electronConverter3.cxx | 6 +- .../Converters/electronConverter4.cxx | 8 +- .../Converters/electronConverter5.cxx | 8 +- .../Converters/electronConverter6.cxx | 6 +- .../Converters/eventCentConverter1.cxx | 6 +- .../Converters/eventConverter2.cxx | 6 +- .../Converters/eventConverter3.cxx | 6 +- .../Converters/eventConverter4.cxx | 7 +- .../Converters/eventConverter5.cxx | 7 +- .../Converters/eventMultConverter1.cxx | 6 +- .../Converters/eventNormConverter1.cxx | 8 +- .../Converters/eventNormConverter2.cxx | 8 +- .../Converters/mcParticleConverter1.cxx | 6 +- .../Converters/muonConverter1.cxx | 6 +- .../Converters/muonConverter2.cxx | 6 +- .../Converters/muonSelfIdConverter1.cxx | 8 +- .../Converters/qvec2Converter0.cxx | 6 +- .../Converters/qvec3Converter0.cxx | 6 +- .../Converters/trackConverter1.cxx | 6 +- .../TableProducer/associateMCinfoDilepton.cxx | 19 +- .../TableProducer/createEMEventDilepton.cxx | 3 +- .../TableProducer/dielectronProducer.cxx | 8 +- .../Dilepton/TableProducer/dimuonProducer.cxx | 8 +- .../Dilepton/TableProducer/eventSelection.cxx | 23 +- PWGEM/Dilepton/TableProducer/filterEoI.cxx | 19 +- .../TableProducer/prefilterDimuon.cxx | 33 +- .../TableProducer/qVector2DummyOTF.cxx | 7 +- .../TableProducer/qVector3DummyOTF.cxx | 7 +- .../TableProducer/qVectorDummyOTF.cxx | 7 +- PWGEM/Dilepton/TableProducer/skimmerOTS.cxx | 22 +- .../TableProducer/skimmerPrimaryElectron.cxx | 51 +- .../skimmerPrimaryElectronQC.cxx | 48 +- .../TableProducer/skimmerPrimaryMFTTrack.cxx | 46 +- .../TableProducer/skimmerPrimaryMuon.cxx | 53 +- .../TableProducer/skimmerPrimaryMuonQC.cxx | 51 +- .../TableProducer/skimmerPrimaryTrack.cxx | 43 +- .../TableProducer/treeCreatorElectronML.cxx | 44 +- .../treeCreatorElectronMLDDA.cxx | 50 +- .../TableProducer/treeCreatorMuonML.cxx | 49 +- PWGEM/Dilepton/Tasks/MCtemplates.cxx | 52 +- PWGEM/Dilepton/Tasks/associateMCcollision.cxx | 16 +- PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx | 57 +- PWGEM/Dilepton/Tasks/checkMCTemplate.cxx | 58 +- PWGEM/Dilepton/Tasks/createResolutionMap.cxx | 56 +- .../Tasks/createResolutionMapDerived.cxx | 25 +- PWGEM/Dilepton/Tasks/dielectron.cxx | 10 +- PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx | 8 +- PWGEM/Dilepton/Tasks/dielectronMC.cxx | 10 +- PWGEM/Dilepton/Tasks/dileptonPolarization.cxx | 42 +- PWGEM/Dilepton/Tasks/dimuon.cxx | 10 +- PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx | 8 +- PWGEM/Dilepton/Tasks/dimuonMC.cxx | 10 +- PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx | 46 +- PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx | 35 +- PWGEM/Dilepton/Tasks/eventQC.cxx | 32 +- PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx | 34 +- PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx | 37 +- PWGEM/Dilepton/Tasks/matchingMFT.cxx | 49 +- .../Tasks/mcParticlePredictionsOTF.cxx | 16 +- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 46 +- PWGEM/Dilepton/Tasks/singleElectronQC.cxx | 10 +- PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx | 10 +- PWGEM/Dilepton/Tasks/singleMuonQC.cxx | 10 +- PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx | 10 +- PWGEM/Dilepton/Tasks/smearing.cxx | 25 +- PWGEM/Dilepton/Tasks/studyDCAFitter.cxx | 43 +- PWGEM/Dilepton/Tasks/studyMCTruth.cxx | 37 +- PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx | 39 +- PWGEM/Dilepton/Tasks/taggingHFE.cxx | 45 +- PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx | 50 +- PWGEM/Dilepton/Utils/EMFwdTrack.h | 3 + PWGEM/Dilepton/Utils/EMTrack.h | 8 +- PWGEM/Dilepton/Utils/EMTrackUtilities.h | 8 +- PWGEM/Dilepton/Utils/EventHistograms.h | 182 ++-- PWGEM/Dilepton/Utils/EventMixingHandler.h | 1 - PWGEM/Dilepton/Utils/MCUtilities.h | 5 +- .../Utils/MlResponseDielectronSingleTrack.h | 4 +- PWGEM/Dilepton/Utils/MlResponseO2Track.h | 4 +- PWGEM/Dilepton/Utils/MomentumSmearer.h | 21 +- PWGEM/Dilepton/Utils/PairUtilities.h | 16 +- PWGEM/PhotonMeson/Core/CutsLibrary.cxx | 4 +- PWGEM/PhotonMeson/Core/CutsLibrary.h | 7 +- PWGEM/PhotonMeson/Core/DalitzEECut.cxx | 2 +- PWGEM/PhotonMeson/Core/DalitzEECut.h | 6 +- PWGEM/PhotonMeson/Core/EMCPhotonCut.h | 9 +- PWGEM/PhotonMeson/Core/EMNonLin.h | 5 +- PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx | 5 +- PWGEM/PhotonMeson/Core/EMPhotonEventCut.h | 4 +- PWGEM/PhotonMeson/Core/EmMlResponsePCM.h | 1 + .../PhotonMeson/Core/MaterialBudgetWeights.h | 7 +- PWGEM/PhotonMeson/Core/PairCut.cxx | 5 +- PWGEM/PhotonMeson/Core/PairCut.h | 10 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 4 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 8 +- PWGEM/PhotonMeson/Core/TaggingPi0.h | 312 +++---- PWGEM/PhotonMeson/Core/TaggingPi0MC.h | 320 ++++--- PWGEM/PhotonMeson/Core/V0PhotonCandidate.h | 3 + PWGEM/PhotonMeson/Core/V0PhotonCut.cxx | 5 +- PWGEM/PhotonMeson/Core/V0PhotonCut.h | 9 +- PWGEM/PhotonMeson/DataModel/EventTables.h | 1 - .../PhotonMeson/DataModel/GammaTablesRedux.h | 3 +- PWGEM/PhotonMeson/DataModel/bcWiseTables.h | 4 +- PWGEM/PhotonMeson/DataModel/gammaTables.h | 2 +- PWGEM/PhotonMeson/DataModel/mcV0Tables.h | 4 +- .../Converters/converterEmeventPmevent.cxx | 2 +- .../Converters/emcIdConverter1.cxx | 6 +- .../Converters/phosIdConverter1.cxx | 6 +- .../Converters/v0photonIdConverter1.cxx | 6 +- .../TableProducer/associateMCinfoPhoton.cxx | 20 +- .../TableProducer/bcWiseClusterSkimmer.cxx | 21 +- .../TableProducer/createEMEventPhoton.cxx | 3 - PWGEM/PhotonMeson/TableProducer/createPCM.cxx | 10 + .../TableProducer/materialBudgetWeights.cxx | 3 +- .../TableProducer/nonLinProducer.cxx | 3 +- .../TableProducer/photonconversionbuilder.cxx | 2 +- .../TableProducer/pmQvectorDummyOtf.cxx | 3 +- .../TableProducer/skimmerDalitzEE.cxx | 14 +- .../TableProducer/skimmerGammaConversion.cxx | 58 +- .../skimmerGammaConversionTruthOnlyMc.cxx | 14 +- .../PhotonMeson/TableProducer/skimmerPHOS.cxx | 19 +- .../skimmerPrimaryElectronFromDalitzEE.cxx | 47 +- PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx | 15 + .../electronFromDalitzConverter1.cxx | 6 +- .../Tasks/Converters/pcmConverter1.cxx | 6 +- PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx | 44 +- PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx | 2 +- PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx | 5 +- PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx | 41 +- .../Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx | 1 - PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx | 1 + .../Tasks/TaggingPi0MCPCMDalitzEE.cxx | 9 +- .../Tasks/TaggingPi0PCMDalitzEE.cxx | 13 +- PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx | 7 +- PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx | 1 + PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx | 44 +- PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx | 46 +- .../Tasks/emcalBcWiseGammaGamma.cxx | 18 +- PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx | 1 - .../Tasks/gammaConversionsTruthOnlyMc.cxx | 5 +- .../PhotonMeson/Tasks/mcGeneratorStudies.cxx | 15 +- PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 11 +- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 12 +- PWGEM/PhotonMeson/Tasks/phosQC.cxx | 6 +- PWGEM/PhotonMeson/Tasks/photonResoTask.cxx | 2 +- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 5 +- PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx | 2 +- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 2 +- PWGEM/PhotonMeson/Utils/ClusterHistograms.h | 1 + PWGEM/PhotonMeson/Utils/EventHistograms.h | 1 + PWGEM/PhotonMeson/Utils/HNMUtilities.h | 3 +- PWGEM/PhotonMeson/Utils/NMHistograms.h | 1 + PWGEM/PhotonMeson/Utils/PairUtilities.h | 2 +- .../PhotonMeson/Utils/gammaConvDefinitions.h | 42 +- PWGEM/Tasks/phosAlign.cxx | 42 +- PWGEM/Tasks/phosCalibration.cxx | 57 +- PWGEM/Tasks/phosCellQA.cxx | 38 +- PWGEM/Tasks/phosCluQA.cxx | 42 +- PWGEM/Tasks/phosElId.cxx | 46 +- PWGEM/Tasks/phosNbar.cxx | 53 +- PWGEM/Tasks/phosNonlin.cxx | 29 +- PWGEM/Tasks/phosPi0.cxx | 34 +- PWGEM/Tasks/phosTrigQA.cxx | 44 +- 180 files changed, 4308 insertions(+), 3489 deletions(-) diff --git a/PWGEM/Dilepton/Core/DielectronCut.cxx b/PWGEM/Dilepton/Core/DielectronCut.cxx index 85172723058..64d564cf36a 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.cxx +++ b/PWGEM/Dilepton/Core/DielectronCut.cxx @@ -15,8 +15,12 @@ #include "PWGEM/Dilepton/Core/DielectronCut.h" -#include "Framework/Logger.h" +#include +#include + +#include +#include #include #include diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index b9179122279..feba64b0410 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -19,21 +19,27 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/DataTypes.h" -#include "Framework/Logger.h" +#include "Common/Core/RecoDecay.h" -#include "Math/Vector4D.h" -#include "TNamed.h" +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include #include +#include +#include +#include #include -#include #include #include -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include class DielectronCut : public TNamed { @@ -108,9 +114,9 @@ class DielectronCut : public TNamed ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - float dca_ee_3d = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); - float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); - float opAng = getOpeningAngle(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz()); + float dca_ee_3d = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); + float opAng = o2::aod::pwgem::dilepton::utils::pairutil::getOpeningAngle(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz()); if (v12.M() < mMinMee || mMaxMee < v12.M()) { return false; @@ -457,7 +463,7 @@ class DielectronCut : public TNamed return mMinChi2PerClusterTPC < track.tpcChi2NCl() && track.tpcChi2NCl() < mMaxChi2PerClusterTPC; case DielectronCuts::kDCA3Dsigma: - return mMinDca3D < dca3DinSigma(track) && dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg + return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg case DielectronCuts::kDCAxy: return std::fabs(track.dcaXY()) < ((mMaxDcaXYPtDep) ? mMaxDcaXYPtDep(track.pt()) : mMaxDcaXY); diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 5238c549445..46a4a8718e6 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -31,273 +31,289 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include + +#include #include #include -#include +#include +#include +#include #include #include #include +#include #include #include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; -using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; -using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMFwdTrack>; +using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; +using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMFwdTrack>; template struct Dilepton { // Configurables - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - Configurable cfgApplySPresolution{"cfgApplySPresolution", false, "flag to apply resolution correction for flow analysis"}; - Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; - Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; - - Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5"}; - Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; - Configurable ndepth{"ndepth", 1000, "depth for event mixing"}; - Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; - 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, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - Configurable cfgUseSignedDCA{"cfgUseSignedDCA", false, "flag to use signs in the DCA calculation"}; - Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; - - ConfigurableAxis ConfMllBins{"ConfMllBins", {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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; - ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; - ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 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.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; - ConfigurableAxis ConfYllBins{"ConYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity - - // ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {VARIABLE_WIDTH, 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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. - - ConfigurableAxis ConfSPBins{"ConfSPBins", {200, -5, 5}, "SP bins for flow analysis"}; - ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {20, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; - ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; - ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {15, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + o2::framework::Configurable cfgApplySPresolution{"cfgApplySPresolution", false, "flag to apply resolution correction for flow analysis"}; + o2::framework::Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; + o2::framework::Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; + + o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5"}; + o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; + o2::framework::Configurable ndepth{"ndepth", 1000, "depth for event mixing"}; + o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; + o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::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"}; + o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::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, 999.f}, "Mixing bins - centrality"}; + o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; + o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgUseSignedDCA{"cfgUseSignedDCA", false, "flag to use signs in the DCA calculation"}; + o2::framework::Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; + + o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 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.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfYllBins{"ConYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity + + // o2::framework::ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {o2::framework::VARIABLE_WIDTH, 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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. + + o2::framework::ConfigurableAxis ConfSPBins{"ConfSPBins", {200, -5, 5}, "SP bins for flow analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {20, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {15, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - 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"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time 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 cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; - Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; - // 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 prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - // Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - // Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; + o2::framework::Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; + // o2::framework::Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + // o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + // o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task + o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; Zorro zorro; @@ -307,11 +323,11 @@ struct Dilepton { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; @@ -333,7 +349,7 @@ struct Dilepton { float beamP2 = 0.f; // beam momentum TH2D* h2sp_resolution = nullptr; - void init(InitContext& /*context*/) + void init(o2::framework::InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -347,11 +363,11 @@ struct Dilepton { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - if (ConfVtxBins.value[0] == VARIABLE_WIDTH) { + if (ConfVtxBins.value[0] == o2::framework::VARIABLE_WIDTH) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); for (const auto& edge : zvtx_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfVtxBins.value[0]); @@ -364,11 +380,11 @@ struct Dilepton { } } - if (ConfCentBins.value[0] == VARIABLE_WIDTH) { + if (ConfCentBins.value[0] == o2::framework::VARIABLE_WIDTH) { cent_bin_edges = std::vector(ConfCentBins.value.begin(), ConfCentBins.value.end()); cent_bin_edges.erase(cent_bin_edges.begin()); for (const auto& edge : cent_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: cent_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: cent_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfCentBins.value[0]); @@ -381,11 +397,11 @@ struct Dilepton { } } - if (ConfEPBins.value[0] == VARIABLE_WIDTH) { + if (ConfEPBins.value[0] == o2::framework::VARIABLE_WIDTH) { ep_bin_edges = std::vector(ConfEPBins.value.begin(), ConfEPBins.value.end()); ep_bin_edges.erase(ep_bin_edges.begin()); for (const auto& edge : ep_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: ep_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfEPBins.value[0]); @@ -399,11 +415,11 @@ struct Dilepton { } LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value); - if (ConfOccupancyBins.value[0] == VARIABLE_WIDTH) { + if (ConfOccupancyBins.value[0] == o2::framework::VARIABLE_WIDTH) { occ_bin_edges = std::vector(ConfOccupancyBins.value.begin(), ConfOccupancyBins.value.end()); occ_bin_edges.erase(occ_bin_edges.begin()); for (const auto& edge : occ_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: occ_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: occ_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfOccupancyBins.value[0]); @@ -431,23 +447,23 @@ struct Dilepton { leptonM2 = o2::constants::physics::MassMuon; } - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); if (doprocessTriggerAnalysis) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data()); - fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 } if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); - fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false); + fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -580,27 +596,27 @@ struct Dilepton { } // pair info - const AxisSpec axis_mass{ConfMllBins, mass_axis_title}; - const AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; - const AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; - const AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; + const o2::framework::AxisSpec axis_mass{ConfMllBins, mass_axis_title}; + const o2::framework::AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; + const o2::framework::AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; 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, axis_y}, true); - fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {400, -2, +2}}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", o2::framework::kTH2D, {{180, -M_PI, M_PI}, {400, -2, +2}}, 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, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", kTH2D, {{200, -10, 10.0}, {200, -10, 10}}, true); + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::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})", o2::framework::kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", o2::framework::kTH2D, {{200, -10, 10.0}, {200, -10, 10}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kUPC)) { - const AxisSpec axis_aco{10, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; - const AxisSpec axis_asym_pt{10, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; - const AxisSpec axis_dphi_e_ee{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; + const o2::framework::AxisSpec axis_aco{10, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; + const o2::framework::AxisSpec axis_asym_pt{10, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; + const o2::framework::AxisSpec axis_dphi_e_ee{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -610,8 +626,8 @@ struct Dilepton { } else { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - const AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_cos_theta}, true); + const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_cos_theta}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -622,13 +638,13 @@ struct Dilepton { nmod = 3; } - const AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; + const o2::framework::AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); - fRegistry.add("Pair/mix/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); @@ -642,23 +658,23 @@ struct Dilepton { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - const AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; - const AxisSpec axis_phi{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; - const AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true); + const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; + const o2::framework::AxisSpec axis_phi{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; + const o2::framework::AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kHFll)) { - const AxisSpec axis_dphi_ee{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll - const AxisSpec axis_deta_ee{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ee, axis_deta_ee}, true); + const o2::framework::AxisSpec axis_dphi_ee{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll + const o2::framework::AxisSpec axis_deta_ee{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ee, axis_deta_ee}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); } else { // same as kQC to avoid seg. fault - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -672,8 +688,8 @@ struct Dilepton { } else { o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); } - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); } void DefineEMEventCut() @@ -883,25 +899,25 @@ struct Dilepton { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (cfgUseSignedDCA) { - pair_dca = pairDCASignQuadSum(dca3DinSigma(t1), dca3DinSigma(t2), t1.sign(), t2.sign()); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCASignQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2), t1.sign(), t2.sign()); } else { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); } if (cfgDCAType == 1) { if (cfgUseSignedDCA) { - pair_dca = pairDCASignQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2), t1.sign(), t2.sign()); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCASignQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), t1.sign(), t2.sign()); } else { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } } else if (cfgDCAType == 2) { if (cfgUseSignedDCA) { - pair_dca = pairDCASignQuadSum(dcaZinSigma(t1), dcaZinSigma(t2), t1.sign(), t2.sign()); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCASignQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), t1.sign(), t2.sign()); } else { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { @@ -919,9 +935,9 @@ struct Dilepton { 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/hMvsOpAng"), opAng, v12.M(), weight); if (cfgDCAType == 1) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), weight); } } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ @@ -931,9 +947,9 @@ struct Dilepton { 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/hMvsOpAng"), opAng, v12.M(), weight); if (cfgDCAType == 1) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), weight); } } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- @@ -943,9 +959,9 @@ struct Dilepton { 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/hMvsOpAng"), opAng, v12.M(), weight); if (cfgDCAType == 1) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), weight); } } } @@ -1074,9 +1090,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } } } @@ -1084,9 +1100,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } } } @@ -1095,9 +1111,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } } } @@ -1105,9 +1121,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } } } @@ -1116,48 +1132,48 @@ struct Dilepton { return true; } - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - 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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); TEMH* emh_pos = nullptr; TEMH* emh_neg = nullptr; @@ -1269,19 +1285,19 @@ struct Dilepton { used_trackIds_per_col.reserve(posTracks_per_coll.size() + negTracks_per_coll.size()); int nuls = 0, nlspp = 0, nlsmm = 0; - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillPairInfo<0>(collision, pos, neg, cut, tracks); if (is_pair_ok) { nuls++; } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ bool is_pair_ok = fillPairInfo<0>(collision, pos1, pos2, cut, tracks); if (is_pair_ok) { nlspp++; } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks); if (is_pair_ok) { nlsmm++; @@ -1494,17 +1510,17 @@ struct Dilepton { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -1556,7 +1572,7 @@ struct Dilepton { runPairing(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1578,7 +1594,7 @@ struct Dilepton { runPairing(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1590,7 +1606,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processTriggerAnalysis, "run dilepton analysis on triggered data", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { if (collision.centFT0C() < eventcuts.cfgCentMin || eventcuts.cfgCentMax < collision.centFT0C()) { @@ -1664,7 +1680,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index e6d7eb0960e..d93d829ecdb 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -32,281 +32,291 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include #include -#include +#include +#include +#include #include -#include #include #include +#include #include #include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; -using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; -using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMFwdTrack>; -using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; // for charged track +using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; +using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMFwdTrack>; +using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; // for charged track template struct DileptonHadronMPC { // Configurables - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation), "kAzimuthalCorrelation:0, kCumulant:1"}; - Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"}; - Configurable ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"}; - Configurable ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"}; - Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; - 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, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation), "kAzimuthalCorrelation:0, kCumulant:1"}; + o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"}; + o2::framework::Configurable ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"}; + o2::framework::Configurable ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"}; + o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; + o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::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"}; + o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::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, 999.f}, "Mixing bins - centrality"}; + o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; + o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; // Configurable cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"}; // Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - ConfigurableAxis ConfMllBins{"ConfMllBins", {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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; - ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.15, 0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; - ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.15, 0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; - ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {50, 0, 5}, "pT,h bins for output histograms"}; - ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity - ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {120, -6, 6}, "deta bins for output histograms"}; - Configurable cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"}; - Configurable cfgNbinsCosNDPhi{"cfgNbinsCosNDPhi", 200, "nbins in cos(n(dphi)) for output histograms"}; - Configurable cfgNmod{"cfgNmod", 2, "n-th harmonics"}; + o2::framework::ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {50, 0, 5}, "pT,h bins for output histograms"}; + o2::framework::ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity + o2::framework::ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {120, -6, 6}, "deta bins for output histograms"}; + o2::framework::Configurable cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"}; + o2::framework::Configurable cfgNbinsCosNDPhi{"cfgNbinsCosNDPhi", 200, "nbins in cos(n(dphi)) for output histograms"}; + o2::framework::Configurable cfgNmod{"cfgNmod", 2, "n-th harmonics"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time 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 cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_apply_detadphiposition{"cfg_apply_detadphiposition", false, "flag to apply deta-dphi elliptic cut at certain radius"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfgRefR{"cfgRefR", 0.5, "reference R (in m) for extrapolation"}; // https://cds.cern.ch/record/1419204 - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_apply_detadphiposition{"cfg_apply_detadphiposition", false, "flag to apply deta-dphi elliptic cut at certain radius"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.5, "reference R (in m) for extrapolation"}; // https://cds.cern.ch/record/1419204 + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; EMTrackCut fEMTrackCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "trackcut_group"; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for ref. track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 3.0, "max pT for ref. track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for ref. track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for ref. track"}; - // Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.0, "min phi for ref. track"}; - // Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for ref. track"}; - Configurable cfg_track_bits{"cfg_track_bits", 0, "required track bits"}; - Configurable cfg_reftrack_type{"cfg_reftrack_type", 0, "ref. track type for 2PC. 0:kCB, 1:kMFTsa"}; // this is unique in the derived data. Check which track type you store as aod::EMPrimaryTracks. + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for ref. track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 3.0, "max pT for ref. track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for ref. track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for ref. track"}; + // o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.0, "min phi for ref. track"}; + // o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for ref. track"}; + o2::framework::Configurable cfg_track_bits{"cfg_track_bits", 0, "required track bits"}; + o2::framework::Configurable cfg_reftrack_type{"cfg_reftrack_type", 0, "ref. track type for 2PC. 0:kCB, 1:kMFTsa"}; // this is unique in the derived data. Check which track type you store as aod::EMPrimaryTracks. } trackcuts; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task + o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; Zorro zorro; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; @@ -317,7 +327,7 @@ struct DileptonHadronMPC { float leptonM1 = 0.f; float leptonM2 = 0.f; - void init(InitContext& /*context*/) + void init(o2::framework::InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -328,11 +338,11 @@ struct DileptonHadronMPC { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - if (ConfVtxBins.value[0] == VARIABLE_WIDTH) { + if (ConfVtxBins.value[0] == o2::framework::VARIABLE_WIDTH) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); for (const auto& edge : zvtx_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfVtxBins.value[0]); @@ -345,11 +355,11 @@ struct DileptonHadronMPC { } } - if (ConfCentBins.value[0] == VARIABLE_WIDTH) { + if (ConfCentBins.value[0] == o2::framework::VARIABLE_WIDTH) { cent_bin_edges = std::vector(ConfCentBins.value.begin(), ConfCentBins.value.end()); cent_bin_edges.erase(cent_bin_edges.begin()); for (const auto& edge : cent_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: cent_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: cent_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfCentBins.value[0]); @@ -362,11 +372,11 @@ struct DileptonHadronMPC { } } - if (ConfEPBins.value[0] == VARIABLE_WIDTH) { + if (ConfEPBins.value[0] == o2::framework::VARIABLE_WIDTH) { ep_bin_edges = std::vector(ConfEPBins.value.begin(), ConfEPBins.value.end()); ep_bin_edges.erase(ep_bin_edges.begin()); for (const auto& edge : ep_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: ep_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfEPBins.value[0]); @@ -380,11 +390,11 @@ struct DileptonHadronMPC { } LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value); - if (ConfOccupancyBins.value[0] == VARIABLE_WIDTH) { + if (ConfOccupancyBins.value[0] == o2::framework::VARIABLE_WIDTH) { occ_bin_edges = std::vector(ConfOccupancyBins.value.begin(), ConfOccupancyBins.value.end()); occ_bin_edges.erase(occ_bin_edges.begin()); for (const auto& edge : occ_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: occ_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: occ_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfOccupancyBins.value[0]); @@ -416,10 +426,10 @@ struct DileptonHadronMPC { if (doprocessTriggerAnalysis) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value); - fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); + fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); + fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); + fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); + auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); } @@ -494,7 +504,7 @@ struct DileptonHadronMPC { static constexpr std::string_view qvec_det_names[7] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg", "FV0A"}; // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); - fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); + fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", o2::framework::kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; std::string pair_pt_axis_title = "p_{T,ll} (GeV/c)"; @@ -528,59 +538,59 @@ struct DileptonHadronMPC { } // dilepton info - const AxisSpec axis_mass{ConfMllBins, mass_axis_title}; - const AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; - const AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; - const AxisSpec axis_y{ConfYllBins, pair_rapidity_axis_title}; + const o2::framework::AxisSpec axis_mass{ConfMllBins, mass_axis_title}; + const o2::framework::AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; + const o2::framework::AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_y{ConfYllBins, pair_rapidity_axis_title}; // dilepton-hadron info - const AxisSpec axis_deta{ConfDEtaBins, deta_axis_title}; + const o2::framework::AxisSpec axis_deta{ConfDEtaBins, deta_axis_title}; // hadron-hadron info - const AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"}; + const o2::framework::AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"}; - const AxisSpec axis_pt_trg{ConfPtHadronBins, "p_{T,h} (GeV/c)"}; - const AxisSpec axis_eta_trg{40, -2, +2, "#eta_{h}"}; - const AxisSpec axis_phi_trg{36, 0, 2 * M_PI, "#varphi_{h} (rad.)"}; - fRegistry.add("Hadron/hs", "hadron", kTHnSparseD, {axis_pt_trg, axis_eta_trg, axis_phi_trg}, false); - fRegistry.add("Hadron/hTrackBit", "track bit", kTH1D, {{65536, -0.5, 65535.5}}, false); + const o2::framework::AxisSpec axis_pt_trg{ConfPtHadronBins, "p_{T,h} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta_trg{40, -2, +2, "#eta_{h}"}; + const o2::framework::AxisSpec axis_phi_trg{36, 0, 2 * M_PI, "#varphi_{h} (rad.)"}; + fRegistry.add("Hadron/hs", "hadron", o2::framework::kTHnSparseD, {axis_pt_trg, axis_eta_trg, axis_phi_trg}, false); + fRegistry.add("Hadron/hTrackBit", "track bit", o2::framework::kTH1D, {{65536, -0.5, 65535.5}}, false); - fRegistry.add("Dilepton/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Dilepton/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Dilepton/same/uls/", "Dilepton/same/lspp/"); fRegistry.addClone("Dilepton/same/uls/", "Dilepton/same/lsmm/"); fRegistry.addClone("Dilepton/same/", "Dilepton/mix/"); if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { - const AxisSpec axis_dphi{cfgNbinsDPhi, -M_PI / 2, 3 * M_PI / 2, dphi_axis_title}; + const o2::framework::AxisSpec axis_dphi{cfgNbinsDPhi, -M_PI / 2, 3 * M_PI / 2, dphi_axis_title}; // dilepton-hadron - fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); + fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); - fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); // hadron-hadron - const AxisSpec axis_dphi_hh{90, -M_PI / 2, 3 * M_PI / 2, "#Delta#varphi = #varphi_{h}^{ref1} - #varphi_{h}^{ref2} (rad.)"}; - fRegistry.add("HadronHadron/same/hDEtaDPhi", "hadron-hadron 2PC", kTH2D, {axis_dphi_hh, axis_deta_hh}, true); + const o2::framework::AxisSpec axis_dphi_hh{90, -M_PI / 2, 3 * M_PI / 2, "#Delta#varphi = #varphi_{h}^{ref1} - #varphi_{h}^{ref2} (rad.)"}; + fRegistry.add("HadronHadron/same/hDEtaDPhi", "hadron-hadron 2PC", o2::framework::kTH2D, {axis_dphi_hh, axis_deta_hh}, true); fRegistry.addClone("HadronHadron/same/", "HadronHadron/mix/"); - fRegistry.add("HadronHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("HadronHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kCumulant)) { - const AxisSpec axis_cos_ndphi{cfgNbinsCosNDPhi, -1, +1, cosndphi_axis_title}; + const o2::framework::AxisSpec axis_cos_ndphi{cfgNbinsCosNDPhi, -1, +1, cosndphi_axis_title}; // dilepton-hadron - fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_cos_ndphi}, true); + fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_cos_ndphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); // hadron-hadron - const AxisSpec axis_cosndphi_hh{cfgNbinsCosNDPhi, -1, +1, std::format("cos({0:d}(#varphi_{{h}}^{{ref1}} - #varphi_{{h}}^{{ref2}}))", cfgNmod.value)}; - fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true); + const o2::framework::AxisSpec axis_cosndphi_hh{cfgNbinsCosNDPhi, -1, +1, std::format("cos({0:d}(#varphi_{{h}}^{{ref1}} - #varphi_{{h}}^{{ref2}}))", cfgNmod.value)}; + fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", o2::framework::kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true); } - fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); } void DefineEMEventCut() @@ -762,14 +772,14 @@ struct DileptonHadronMPC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } if (t1.sign() * t2.sign() < 0) { // ULS @@ -789,9 +799,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } } } @@ -799,9 +809,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } } } @@ -810,9 +820,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } } } @@ -820,9 +830,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } } } @@ -902,14 +912,14 @@ struct DileptonHadronMPC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { @@ -995,53 +1005,53 @@ struct DileptonHadronMPC { return true; } - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - 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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); - - using RefTracks = soa::Join; + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); + + using RefTracks = o2::soa::Join; using RefTrack = RefTracks::iterator; - Preslice perCollision_track = aod::emprimarytrack::emeventId; - Filter refTrackFilter = trackcuts.cfg_min_pt_track < 1 / nabs(o2::aod::emprimarytrack::signed1Pt) && 1 / nabs(o2::aod::emprimarytrack::signed1Pt) < trackcuts.cfg_max_pt_track && trackcuts.cfg_min_eta_track < o2::aod::emprimarytrack::eta && o2::aod::emprimarytrack::eta < trackcuts.cfg_max_eta_track; - using FilteredRefTracks = soa::Filtered; + o2::framework::Preslice perCollision_track = o2::aod::emprimarytrack::emeventId; + o2::framework::expressions::Filter refTrackFilter = trackcuts.cfg_min_pt_track < 1 / nabs(o2::aod::emprimarytrack::signed1Pt) && 1 / nabs(o2::aod::emprimarytrack::signed1Pt) < trackcuts.cfg_max_pt_track && trackcuts.cfg_min_eta_track < o2::aod::emprimarytrack::eta && o2::aod::emprimarytrack::eta < trackcuts.cfg_max_eta_track; + using FilteredRefTracks = o2::soa::Filtered; using FilteredRefTrack = FilteredRefTracks::iterator; TEMH* emh_pos = nullptr; @@ -1096,7 +1106,7 @@ struct DileptonHadronMPC { used_trackIds_per_col.reserve(posTracks_per_coll.size() + negTracks_per_coll.size()); int nuls = 0, nlspp = 0, nlsmm = 0; - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillDilepton<0>(collision, pos, neg, cut); if (is_pair_ok) { nuls++; @@ -1105,7 +1115,7 @@ struct DileptonHadronMPC { } } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut); if (is_pair_ok) { nlspp++; @@ -1114,7 +1124,7 @@ struct DileptonHadronMPC { } } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut); if (is_pair_ok) { nlsmm++; @@ -1137,13 +1147,13 @@ struct DileptonHadronMPC { // store ref tracks for mixed event in case of kAzimuthalCorrelation if (cfgDoMix && cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { - emh_ref->AddTrackToEventPool(key_df_collision, EMTrack(track.pt(), track.eta(), track.phi(), 0.139)); + emh_ref->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(track.pt(), track.eta(), track.phi(), 0.139)); } // store ref tracks } } // LOGF(info, "collision.globalIndex() = %d, collision.centFT0M() = %f, refTracks_per_coll.size() = %d", collision.globalIndex(), collision.centFT0M(), refTracks_per_coll.size()); - for (const auto& [ref1, ref2] : combinations(CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { + for (const auto& [ref1, ref2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { // TODO: remove lepton candidates from reference track sample in case of kCB. fillHadronHadron<0>(ref1, ref2, posTracks_per_coll, negTracks_per_coll, cut); } @@ -1437,17 +1447,17 @@ struct DileptonHadronMPC { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS if (isPairOK(pos, neg, cut)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ if (isPairOK(pos1, pos2, cut)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -1501,7 +1511,7 @@ struct DileptonHadronMPC { run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, refTracks); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1523,7 +1533,7 @@ struct DileptonHadronMPC { run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, refTracks); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 219645bdb58..83a56821628 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -28,60 +28,78 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include #include #include +#include +#include +#include +#include #include #include #include +#include #include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCCollisions = soa::Join; +using MyMCCollisions = o2::soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = o2::soa::Join; using MyMCElectron = MyMCElectrons::iterator; -using FilteredMyMCElectrons = soa::Filtered; +using FilteredMyMCElectrons = o2::soa::Filtered; using FilteredMyMCElectron = FilteredMyMCElectrons::iterator; -using MyMCMuons = soa::Join; +using MyMCMuons = o2::soa::Join; using MyMCMuon = MyMCMuons::iterator; -using FilteredMyMCMuons = soa::Filtered; +using FilteredMyMCMuons = o2::soa::Filtered; using FilteredMyMCMuon = FilteredMyMCMuons::iterator; -using MySmearedElectrons = soa::Join; +using MySmearedElectrons = o2::soa::Join; using MySmearedElectron = MySmearedElectrons::iterator; -using MySmearedMuons = soa::Join; +using MySmearedMuons = o2::soa::Join; using MySmearedMuon = MySmearedMuons::iterator; // template @@ -89,230 +107,230 @@ template 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - Configurable cfgFillUnfolding{"cfgFillUnfolding", false, "flag to fill histograms for unfolding"}; - Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; - Configurable cfgFillSeparateCharmHadronPairs{"cfgFillSeparateCharmHadronPairs", false, "flag to fill different ccbar pairs separately"}; - - ConfigurableAxis ConfMllBins{"ConfMllBins", {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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; - ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; - ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 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.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; - - ConfigurableAxis ConfDPtBins{"ConfDPtBins", {220, -1.0, +10.0}, "dpt bins for output histograms"}; - ConfigurableAxis ConfDCAllNarrowBins{"ConfDCAllNarrowBins", {200, 0.0, 10.0}, "narrow DCAll bins for output histograms"}; - ConfigurableAxis ConfTrackDCA{"ConfTrackDCA", {VARIABLE_WIDTH, -10, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.5, 3, 3.5, 4, 4.5, 5, 6, 7, 8, 9, 10}, "DCA binning for single tacks"}; - - ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, +1.f}, "yll bins for output histograms"}; - - // ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {VARIABLE_WIDTH, 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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. - - Configurable cfg_nbin_dphi_ee{"cfg_nbin_dphi_ee", 1, "number of bins for dphi_ee"}; // 36 - Configurable cfg_nbin_deta_ee{"cfg_nbin_deta_ee", 1, "number of bins for deta_ee"}; // 40 - // Configurable cfg_nbin_cos_theta_cs{"cfg_nbin_cos_theta_cs", 1, "number of bins for cos theta cs"}; // 10 - // Configurable cfg_nbin_phi_cs{"cfg_nbin_phi_cs", 1, "number of bins for phi cs"}; // 10 - Configurable cfg_nbin_aco{"cfg_nbin_aco", 1, "number of bins for acoplanarity"}; // 10 - Configurable cfg_nbin_asym_pt{"cfg_nbin_asym_pt", 1, "number of bins for pt asymmetry"}; // 10 - Configurable cfg_nbin_dphi_e_ee{"cfg_nbin_dphi_e_ee", 1, "number of bins for dphi_ee_e"}; // 18 - ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {1, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; - ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; - Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; - ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {1, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgFillUnfolding{"cfgFillUnfolding", false, "flag to fill histograms for unfolding"}; + o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + o2::framework::Configurable cfgFillSeparateCharmHadronPairs{"cfgFillSeparateCharmHadronPairs", false, "flag to fill different ccbar pairs separately"}; + + o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 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.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; + + o2::framework::ConfigurableAxis ConfDPtBins{"ConfDPtBins", {220, -1.0, +10.0}, "dpt bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllNarrowBins{"ConfDCAllNarrowBins", {200, 0.0, 10.0}, "narrow DCAll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfTrackDCA{"ConfTrackDCA", {o2::framework::VARIABLE_WIDTH, -10, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.5, 3, 3.5, 4, 4.5, 5, 6, 7, 8, 9, 10}, "DCA binning for single tacks"}; + + o2::framework::ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, +1.f}, "yll bins for output histograms"}; + + // o2::framework::ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {o2::framework::VARIABLE_WIDTH, 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.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 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.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. + + o2::framework::Configurable cfg_nbin_dphi_ee{"cfg_nbin_dphi_ee", 1, "number of bins for dphi_ee"}; // 36 + o2::framework::Configurable cfg_nbin_deta_ee{"cfg_nbin_deta_ee", 1, "number of bins for deta_ee"}; // 40 + // o2::framework::Configurable cfg_nbin_cos_theta_cs{"cfg_nbin_cos_theta_cs", 1, "number of bins for cos theta cs"}; // 10 + // o2::framework::Configurable cfg_nbin_phi_cs{"cfg_nbin_phi_cs", 1, "number of bins for phi cs"}; // 10 + o2::framework::Configurable cfg_nbin_aco{"cfg_nbin_aco", 1, "number of bins for acoplanarity"}; // 10 + o2::framework::Configurable cfg_nbin_asym_pt{"cfg_nbin_asym_pt", 1, "number of bins for pt asymmetry"}; // 10 + o2::framework::Configurable cfg_nbin_dphi_e_ee{"cfg_nbin_dphi_e_ee", 1, "number of bins for dphi_ee_e"}; // 18 + o2::framework::ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {1, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; + o2::framework::Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; + o2::framework::ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {1, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - 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", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; - Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; - // 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 prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - // Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - // Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; + o2::framework::Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; + // o2::framework::Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply phiv cut inherited from prefilter"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + // o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + // o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; - Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. - Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; int mRunNumber; float d_bz; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "mctrackcut_group"; - Configurable min_mcPt{"min_mcPt", 0.1, "min. MC pT for generated single lepton"}; - Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT for generated single lepton"}; - Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta for generated single lepton"}; - Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta for generated single lepton"}; + o2::framework::Configurable min_mcPt{"min_mcPt", 0.1, "min. MC pT for generated single lepton"}; + o2::framework::Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT for generated single lepton"}; + o2::framework::Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta for generated single lepton"}; + o2::framework::Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta for generated single lepton"}; } mctrackcuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view pair_sign_types[3] = {"uls/", "lspp/", "lsmm/"}; static constexpr std::string_view dilepton_source_types[20] = { @@ -345,8 +363,8 @@ struct DileptonMC { { // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms(&fRegistry); - fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); - fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; @@ -371,17 +389,17 @@ struct DileptonMC { } // pair info - const AxisSpec axis_mass{ConfMllBins, mass_axis_title}; - const AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; - const AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; - const AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; - const AxisSpec axis_pt_meson{ConfPtllBins, "p_{T}^{VM} (GeV/c)"}; // for omega, phi meson pT spectra - const AxisSpec axis_y_meson{ConfYllBins, "y^{VM}"}; // for omega, phi meson pT spectra - - const AxisSpec axis_dca_narrow{ConfDCAllNarrowBins, pair_dca_axis_title}; - const AxisSpec axis_dpt{ConfDPtBins, "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)"}; - const AxisSpec axis_dca_track1{ConfTrackDCA, "DCA_{e,1}^{Z} (#sigma)"}; - const AxisSpec axis_dca_track2{ConfTrackDCA, "DCA_{e,2}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_mass{ConfMllBins, mass_axis_title}; + const o2::framework::AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; + const o2::framework::AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; + const o2::framework::AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_pt_meson{ConfPtllBins, "p_{T}^{VM} (GeV/c)"}; // for omega, phi meson pT spectra + const o2::framework::AxisSpec axis_y_meson{ConfYllBins, "y^{VM}"}; // for omega, phi meson pT spectra + + const o2::framework::AxisSpec axis_dca_narrow{ConfDCAllNarrowBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_dpt{ConfDPtBins, "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)"}; + const o2::framework::AxisSpec axis_dca_track1{ConfTrackDCA, "DCA_{e,1}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_dca_track2{ConfTrackDCA, "DCA_{e,2}^{Z} (#sigma)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -392,17 +410,17 @@ struct DileptonMC { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - const AxisSpec axis_dphi_ee{cfg_nbin_dphi_ee, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll - const AxisSpec axis_deta_ee{cfg_nbin_deta_ee, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; // for kHFll - const AxisSpec axis_cos_theta_pol{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; // for kPolarization, kUPC - const AxisSpec axis_phi_pol{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; // for kPolarization - const AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; // for kPolarization - const AxisSpec axis_aco{cfg_nbin_aco, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; // for kUPC - const AxisSpec axis_asym_pt{cfg_nbin_asym_pt, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; // for kUPC - const AxisSpec axis_dphi_e_ee{cfg_nbin_dphi_e_ee, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; // for kUPC + const o2::framework::AxisSpec axis_dphi_ee{cfg_nbin_dphi_ee, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll + const o2::framework::AxisSpec axis_deta_ee{cfg_nbin_deta_ee, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; // for kHFll + const o2::framework::AxisSpec axis_cos_theta_pol{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; // for kPolarization, kUPC + const o2::framework::AxisSpec axis_phi_pol{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; // for kPolarization + const o2::framework::AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; // for kPolarization + const o2::framework::AxisSpec axis_aco{cfg_nbin_aco, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; // for kUPC + const o2::framework::AxisSpec axis_asym_pt{cfg_nbin_asym_pt, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; // for kUPC + const o2::framework::AxisSpec axis_dphi_e_ee{cfg_nbin_dphi_e_ee, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; // for kUPC // generated info - fRegistry.add("Generated/sm/PromptPi0/uls/hs", "gen. dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); + fRegistry.add("Generated/sm/PromptPi0/uls/hs", "gen. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); fRegistry.addClone("Generated/sm/PromptPi0/uls/", "Generated/sm/PromptPi0/lspp/"); fRegistry.addClone("Generated/sm/PromptPi0/uls/", "Generated/sm/PromptPi0/lsmm/"); @@ -422,7 +440,7 @@ struct DileptonMC { // fRegistry.addClone("Generated/sm/PromptPi0/", "Generated/sm/Upsilon2S/"); // fRegistry.addClone("Generated/sm/PromptPi0/", "Generated/sm/Upsilon3S/"); - fRegistry.add("Generated/ccbar/c2l_c2l/uls/hs", "generated dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); + fRegistry.add("Generated/ccbar/c2l_c2l/uls/hs", "generated dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); fRegistry.addClone("Generated/ccbar/c2l_c2l/uls/", "Generated/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Generated/ccbar/c2l_c2l/uls/", "Generated/ccbar/c2l_c2l/lsmm/"); @@ -466,7 +484,7 @@ struct DileptonMC { } // evaluate acceptance for polarization - fRegistry.add("Generated/VM/All/Phi/hs", "gen. VM #rightarrow ll", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_cos_theta_pol, axis_phi_pol, axis_quadmom}, true); + fRegistry.add("Generated/VM/All/Phi/hs", "gen. VM #rightarrow ll", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_cos_theta_pol, axis_phi_pol, axis_quadmom}, true); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/Rho/"); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/Omega/"); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/PromptJPsi/"); @@ -474,7 +492,7 @@ struct DileptonMC { fRegistry.addClone("Generated/VM/All/", "Generated/VM/Acc/"); // reconstructed pair info - fRegistry.add("Pair/sm/Photon/uls/hs", "rec. dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/sm/Photon/uls/hs", "rec. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/sm/Photon/uls/", "Pair/sm/Photon/lspp/"); fRegistry.addClone("Pair/sm/Photon/uls/", "Pair/sm/Photon/lsmm/"); @@ -496,25 +514,25 @@ struct DileptonMC { // fRegistry.addClone("Pair/sm/Photon/", "Pair/sm/Upsilon3S/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/sm/Photon/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/sm/Photon/uls/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/uls/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); for (const auto& strSign : pair_sign_types) { - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); } } - fRegistry.add("Pair/ccbar/c2l_c2l/uls/hs", "rec. dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/ccbar/c2l_c2l/uls/hs", "rec. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lsmm/"); @@ -548,26 +566,26 @@ struct DileptonMC { } // for correlated bkg due to mis-identified hadrons, and true combinatorial bkg - fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lspp/"); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lsmm/"); fRegistry.addClone("Pair/corr_bkg_lh/", "Pair/corr_bkg_hh/"); fRegistry.addClone("Pair/corr_bkg_lh/", "Pair/comb_bkg/"); if (doprocessGen_VM) { - fRegistry.add("Generated/VM/Omega/hPtY", "pT vs. y of #omega", kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum - fRegistry.add("Generated/VM/Phi/hPtY", "pT vs. y of #phi", kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum + fRegistry.add("Generated/VM/Omega/hPtY", "pT vs. y of #omega", o2::framework::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum + fRegistry.add("Generated/VM/Phi/hPtY", "pT vs. y of #phi", o2::framework::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum } if (cfgFillUnfolding) { // for 2D unfolding - const AxisSpec axis_mass_gen{ConfMllBins, "m_{ll}^{gen} (GeV/c^{2})"}; - const AxisSpec axis_pt_gen{ConfPtllBins, "p_{T,ll}^{gen} (GeV/c)"}; - const AxisSpec axis_mass_rec{ConfMllBins, "m_{ll}^{rec} (GeV/c^{2})"}; - const AxisSpec axis_pt_rec{ConfPtllBins, "p_{T,ll}^{rec} (GeV/c)"}; - fRegistry.add("Unfold/sm/uls/hsRM", "response matrix", kTHnSparseD, {axis_mass_gen, axis_pt_gen, axis_mass_rec, axis_pt_rec}, true); - fRegistry.add("Unfold/sm/uls/hMiss", "missing dilepton", kTH2D, {axis_mass_gen, axis_pt_gen}, true); // e.g. true eta is in acceptance, but reconstructed eta is out of acceptance. - fRegistry.add("Unfold/sm/uls/hFake", "fake dilepton", kTH2D, {axis_mass_rec, axis_pt_rec}, true); // e.g. true eta is out of acceptance, but reconstructed eta is in acceptance. + const o2::framework::AxisSpec axis_mass_gen{ConfMllBins, "m_{ll}^{gen} (GeV/c^{2})"}; + const o2::framework::AxisSpec axis_pt_gen{ConfPtllBins, "p_{T,ll}^{gen} (GeV/c)"}; + const o2::framework::AxisSpec axis_mass_rec{ConfMllBins, "m_{ll}^{rec} (GeV/c^{2})"}; + const o2::framework::AxisSpec axis_pt_rec{ConfPtllBins, "p_{T,ll}^{rec} (GeV/c)"}; + fRegistry.add("Unfold/sm/uls/hsRM", "response matrix", o2::framework::kTHnSparseD, {axis_mass_gen, axis_pt_gen, axis_mass_rec, axis_pt_rec}, true); + fRegistry.add("Unfold/sm/uls/hMiss", "missing dilepton", o2::framework::kTH2D, {axis_mass_gen, axis_pt_gen}, true); // e.g. true eta is in acceptance, but reconstructed eta is out of acceptance. + fRegistry.add("Unfold/sm/uls/hFake", "fake dilepton", o2::framework::kTH2D, {axis_mass_rec, axis_pt_rec}, true); // e.g. true eta is out of acceptance, but reconstructed eta is in acceptance. fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lspp/"); fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lsmm/"); fRegistry.addClone("Unfold/sm/", "Unfold/ccbar/"); @@ -585,7 +603,7 @@ struct DileptonMC { float leptonM1 = 0.f; float leptonM2 = 0.f; int pdg_lepton = 0; - void init(InitContext&) + void init(o2::framework::InitContext&) { if (doprocessAnalysis && doprocessAnalysis_Smeared) { LOGF(fatal, "Cannot enable doprocessAnalysis and doprocessAnalysis_Smeared at the same time. Please choose one."); @@ -618,7 +636,7 @@ struct DileptonMC { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -801,18 +819,18 @@ struct DileptonMC { int FindSMULS(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 22, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 111, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 221, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 331, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 113, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 223, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 333, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 443, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100443, mcparticles) - // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 553, mcparticles), - // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100553, mcparticles), - // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 200553, mcparticles) + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 22, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 111, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 221, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 331, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 113, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 223, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 333, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 443, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100443, mcparticles) + // o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 553, mcparticles), + // o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100553, mcparticles), + // o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 200553, mcparticles) }; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); @@ -823,12 +841,12 @@ struct DileptonMC { int FindSMLSPP(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 111, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 221, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 331, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 113, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 223, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 333, mcparticles)}; + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 111, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 221, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 331, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 113, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 223, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 333, mcparticles)}; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); return max; @@ -838,12 +856,12 @@ struct DileptonMC { int FindSMLSMM(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 111, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 221, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 331, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 113, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 223, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 333, mcparticles)}; + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 111, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 221, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 331, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 113, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 223, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 333, mcparticles)}; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); return max; @@ -1508,14 +1526,14 @@ struct DileptonMC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), d_bz); @@ -1540,10 +1558,10 @@ struct DileptonMC { o2::math_utils::bringToPMPi(phiPol); float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f; - if ((FindCommonMotherFrom2ProngsWithoutPDG(t1mc, t2mc) > 0 || IsHF(t1mc, t2mc, mcparticles) > 0) && is_pair_from_same_mcevent) { // for bkg study - if (std::abs(t1mc.pdgCode()) != pdg_lepton || std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh or lh correlated bkg - if (std::abs(t1mc.pdgCode()) != pdg_lepton && std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh correlated bkg - if (t1.sign() * t2.sign() < 0) { // ULS + if ((o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2ProngsWithoutPDG(t1mc, t2mc) > 0 || o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles) > 0) && is_pair_from_same_mcevent) { // for bkg study + if (std::abs(t1mc.pdgCode()) != pdg_lepton || std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh or lh correlated bkg + if (std::abs(t1mc.pdgCode()) != pdg_lepton && std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh correlated bkg + if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/corr_bkg_hh/uls/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/corr_bkg_hh/lspp/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); @@ -1581,7 +1599,7 @@ struct DileptonMC { return false; } int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)}); - int hfee_type = IsHF(t1mc, t2mc, mcparticles); + int hfee_type = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -1594,21 +1612,21 @@ struct DileptonMC { float deltaPt2 = t2mc.pt() - t2.pt(); switch (std::abs(mcmother.pdgCode())) { case 111: - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 fillRecHistograms<1>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // prompt pi0 if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } else { // non-prompt pi0 @@ -1617,15 +1635,15 @@ struct DileptonMC { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } @@ -1656,18 +1674,18 @@ struct DileptonMC { } break; case 443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillRecHistograms<9>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // non-prompt J/psi if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } else { @@ -1675,19 +1693,19 @@ struct DileptonMC { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } break; case 100443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillRecHistograms<11>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // non-prompt psi2S } else { fillRecHistograms<10>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // prompt psi2S @@ -1716,19 +1734,19 @@ struct DileptonMC { auto mp1 = mcparticles.iteratorAt(t1mc.mothersIds()[0]); auto mp2 = mcparticles.iteratorAt(t2mc.mothersIds()[0]); switch (hfee_type) { - case static_cast(EM_HFeeType::kCe_Ce): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): fillRecHistograms<15>(t1.sign(), t2.sign(), mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // c2l_c2l break; - case static_cast(EM_HFeeType::kBe_Be): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): fillRecHistograms<16>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2l_b2l break; - case static_cast(EM_HFeeType::kBCe_BCe): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): fillRecHistograms<17>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2c2l break; - case static_cast(EM_HFeeType::kBCe_Be_SameB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): fillRecHistograms<18>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2l_sameb break; - case static_cast(EM_HFeeType::kBCe_Be_DiffB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): fillRecHistograms<19>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2l_diffb break; default: @@ -1750,7 +1768,7 @@ struct DileptonMC { } int mother_id = std::max({FindSMULS(t1, t2, mcparticles), FindSMULS(t2, t1, mcparticles), FindSMLSPP(t1, t2, mcparticles), FindSMLSMM(t1, t2, mcparticles)}); - int hfee_type = IsHF(t1, t2, mcparticles); + int hfee_type = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1, t2, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -1851,10 +1869,10 @@ struct DileptonMC { if (mcmother.isPhysicalPrimary() || mcmother.producedByGenerator()) { switch (std::abs(mcmother.pdgCode())) { case 111: - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 - fillGenHistograms<1>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt pi0 - } else { // non-prompt pi0 - fillGenHistograms<2>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt pi0 + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 + fillGenHistograms<1>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt pi0 + } else { // non-prompt pi0 + fillGenHistograms<2>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt pi0 } break; case 221: @@ -1879,14 +1897,14 @@ struct DileptonMC { } break; case 443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillGenHistograms<9>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt J/psi } else { fillGenHistograms<8>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt J/psi } break; case 100443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillGenHistograms<11>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt psi2S } else { fillGenHistograms<10>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt psi2S @@ -1900,19 +1918,19 @@ struct DileptonMC { auto mp1 = mcparticles.iteratorAt(t1.mothersIds()[0]); auto mp2 = mcparticles.iteratorAt(t2.mothersIds()[0]); switch (hfee_type) { - case static_cast(EM_HFeeType::kCe_Ce): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): fillGenHistograms<15>(sign1, sign2, mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // c2l_c2l break; - case static_cast(EM_HFeeType::kBe_Be): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): fillGenHistograms<16>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2l_b2l break; - case static_cast(EM_HFeeType::kBCe_BCe): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): fillGenHistograms<17>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2c2l break; - case static_cast(EM_HFeeType::kBCe_Be_SameB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): fillGenHistograms<18>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2l_sameb break; - case static_cast(EM_HFeeType::kBCe_Be_DiffB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): fillGenHistograms<19>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2l_diffb break; default: @@ -2008,7 +2026,7 @@ struct DileptonMC { } break; case 443: - if (IsFromBeauty(mcParticle, mcParticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcParticle, mcParticles) > 0) { fRegistry.fill(HIST("Generated/VM/All/NonPromptJPsi/hs"), v12.M(), mcParticle.pt(), mcParticle.y(), cos_thetaPol, phiPol, quadmom, weight); if (isInAcceptance(v1.Pt(), v1.Eta()) && isInAcceptance(v2.Pt(), v2.Eta())) { fRegistry.fill(HIST("Generated/VM/Acc/NonPromptJPsi/hs"), v12.M(), mcParticle.pt(), mcParticle.y(), cos_thetaPol, phiPol, quadmom, weight); @@ -2054,15 +2072,15 @@ struct DileptonMC { auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); // LOGF(info, "centrality = %f , posTracks_per_coll.size() = %d, negTracks_per_coll.size() = %d", centralities[cfgCentEstimator], posTracks_per_coll.size(), negTracks_per_coll.size()); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillTruePairInfo(collision, mccollisions, pos, neg, cut, tracks, mcparticles); } // end of ULS pair loop - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillTruePairInfo(collision, mccollisions, pos1, pos2, cut, tracks, mcparticles); } // end of LS++ pair loop - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillTruePairInfo(collision, mccollisions, neg1, neg2, cut, tracks, mcparticles); } // end of LS-- pair loop @@ -2095,18 +2113,18 @@ struct DileptonMC { } fRegistry.fill(HIST("MCEvent/after/hZvtx"), mccollision.posZ()); - auto posTracks_per_coll = posTracksMC.sliceByCachedUnsorted(aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); - auto negTracks_per_coll = negTracksMC.sliceByCachedUnsorted(aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); + auto posTracks_per_coll = posTracksMC.sliceByCachedUnsorted(o2::aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); + auto negTracks_per_coll = negTracksMC.sliceByCachedUnsorted(o2::aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); - for (const auto& [t1, t2] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [t1, t2] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillGenPairInfo(t1, t2, mcparticles); } // end of true ULS pair loop - for (const auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [t1, t2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillGenPairInfo(t1, t2, mcparticles); } // end of true LS++ pair loop - for (const auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [t1, t2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillGenPairInfo(t1, t2, mcparticles); } // end of true LS-- pair loop @@ -2193,7 +2211,7 @@ struct DileptonMC { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS auto mcpos = mcparticles.iteratorAt(pos.emmcparticleId()); auto mccollision_from_pos = mcpos.template emmcevent_as(); if (cfgEventGeneratorType >= 0 && mccollision_from_pos.getSubGeneratorId() != cfgEventGeneratorType) { @@ -2209,7 +2227,7 @@ struct DileptonMC { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ auto mcpos1 = mcparticles.iteratorAt(pos1.emmcparticleId()); auto mccollision_from_pos1 = mcpos1.template emmcevent_as(); if (cfgEventGeneratorType >= 0 && mccollision_from_pos1.getSubGeneratorId() != cfgEventGeneratorType) { @@ -2225,7 +2243,7 @@ struct DileptonMC { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- auto mcneg1 = mcparticles.iteratorAt(neg1.emmcparticleId()); auto mccollision_from_neg1 = mcneg1.template emmcevent_as(); if (cfgEventGeneratorType >= 0 && mccollision_from_neg1.getSubGeneratorId() != cfgEventGeneratorType) { @@ -2383,7 +2401,7 @@ struct DileptonMC { return false; } int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)}); - int hfee_type = IsHF(t1mc, t2mc, mcparticles); + int hfee_type = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -2421,19 +2439,19 @@ struct DileptonMC { } } else if (hfee_type > -1) { switch (hfee_type) { - case static_cast(EM_HFeeType::kCe_Ce): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): fillHistogramsUnfolding<1>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBe_Be): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBCe_BCe): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBCe_Be_SameB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBCe_Be_DiffB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; default: @@ -2463,13 +2481,13 @@ struct DileptonMC { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); // reconstructed pos tracks auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); // reconstructed neg tracks - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillPairUnfolding(pos, neg, tracks, cut, mcCollisions, mcparticles); } // end of ULS pairing - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillPairUnfolding(pos1, pos2, tracks, cut, mcCollisions, mcparticles); } // end of LS++ pairing - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillPairUnfolding(neg1, neg2, tracks, cut, mcCollisions, mcparticles); } // end of LS-- pairing } // end of collision loop @@ -2477,57 +2495,57 @@ struct DileptonMC { std::unordered_map map_best_match_globalmuon; - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - 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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); // reconstructed tracks - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); // reconstructed tracks - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); // reconstructed tracks - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); // reconstructed tracks - - Partition positive_electronsMC = o2::aod::mcparticle::pdgCode == -11; // e+ - Partition negative_electronsMC = o2::aod::mcparticle::pdgCode == 11; // e- - Partition positive_muonsMC = o2::aod::mcparticle::pdgCode == -13; // mu+ - Partition negative_muonsMC = o2::aod::mcparticle::pdgCode == 13; // mu- - PresliceUnsorted perMcCollision = aod::emmcparticle::emmceventId; - PresliceUnsorted perMcCollision_vm = aod::emmcgenvectormeson::emmceventId; - // PresliceUnsorted recColperMcCollision = aod::emmceventlabel::emmceventId; - - void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, TLeptons const& leptons) + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); // reconstructed tracks + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); // reconstructed tracks + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); // reconstructed tracks + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); // reconstructed tracks + + o2::framework::Partition positive_electronsMC = o2::aod::mcparticle::pdgCode == -11; // e+ + o2::framework::Partition negative_electronsMC = o2::aod::mcparticle::pdgCode == 11; // e- + o2::framework::Partition positive_muonsMC = o2::aod::mcparticle::pdgCode == -13; // mu+ + o2::framework::Partition negative_muonsMC = o2::aod::mcparticle::pdgCode == 13; // mu- + o2::framework::PresliceUnsorted perMcCollision = o2::aod::emmcparticle::emmceventId; + o2::framework::PresliceUnsorted perMcCollision_vm = o2::aod::emmcgenvectormeson::emmceventId; + // o2::framework::PresliceUnsorted recColperMcCollision = o2::aod::emmceventlabel::emmceventId; + + void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, TLeptons const& leptons) { // LOGF(info, "collisions.size() = %d, mccollisions.size() = %d, mcparticles.size() = %d", collisions.size(), mccollisions.size(), mcparticles.size()); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -2540,7 +2558,7 @@ struct DileptonMC { fillUnfolding(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, leptons, mccollisions, mcparticles); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(leptons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(leptons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, leptons, mccollisions, mcparticles); } @@ -2555,10 +2573,10 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processAnalysis, "run dilepton mc analysis", true); - Partition positive_electronsMC_smeared = o2::aod::mcparticle::pdgCode == -11; // e+ - Partition negative_electronsMC_smeared = o2::aod::mcparticle::pdgCode == 11; // e- - Partition positive_muonsMC_smeared = o2::aod::mcparticle::pdgCode == -13; // mu+ - Partition negative_muonsMC_smeared = o2::aod::mcparticle::pdgCode == 13; // mu- + o2::framework::Partition positive_electronsMC_smeared = o2::aod::mcparticle::pdgCode == -11; // e+ + o2::framework::Partition negative_electronsMC_smeared = o2::aod::mcparticle::pdgCode == 11; // e- + o2::framework::Partition positive_muonsMC_smeared = o2::aod::mcparticle::pdgCode == -13; // mu+ + o2::framework::Partition negative_muonsMC_smeared = o2::aod::mcparticle::pdgCode == 13; // mu- void processAnalysis_Smeared(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, TLeptons const& leptons, TSmeardMCParitlces const& mcparticles_smeared) { @@ -2573,7 +2591,7 @@ struct DileptonMC { fillUnfolding(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, leptons, mccollisions, mcparticles_smeared); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(leptons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(leptons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, leptons, mccollisions, mcparticles_smeared); } @@ -2588,7 +2606,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processAnalysis_Smeared, "run dilepton mc analysis with smearing", false); - void processGen_VM(FilteredMyCollisions const& collisions, MyMCCollisions const&, aod::EMMCGenVectorMesons const& mcparticles) + void processGen_VM(FilteredMyCollisions const& collisions, MyMCCollisions const&, o2::aod::EMMCGenVectorMesons const& mcparticles) { // for oemga, phi efficiency for (const auto& collision : collisions) { @@ -2640,7 +2658,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processGen_VM, "process generated info for vector mesons", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -2709,7 +2727,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/Core/DileptonProducer.h b/PWGEM/Dilepton/Core/DileptonProducer.h index 69327c1b068..fd4eb783f89 100644 --- a/PWGEM/Dilepton/Core/DileptonProducer.h +++ b/PWGEM/Dilepton/Core/DileptonProducer.h @@ -21,266 +21,262 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "PWGEM/Dilepton/Utils/EMFwdTrack.h" -#include "PWGEM/Dilepton/Utils/EMTrack.h" #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" -#include "PWGEM/Dilepton/Utils/EventHistograms.h" #include "PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" -#include "Tools/ML/MlResponse.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include #include -#include -#include +#include +#include +#include #include #include -#include #include +#include #include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; - -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; template struct DileptonProducer { - Produces eventTable; - Produces normTable; - Produces dileptonTable; + o2::framework::Produces eventTable; + o2::framework::Produces normTable; + o2::framework::Produces dileptonTable; // Configurables - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; - Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - Configurable cfgStoreULS{"cfgStoreULS", true, "flag to store ULS pairs"}; - Configurable cfgStoreLS{"cfgStoreLS", true, "flag to store LS pairs"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgStoreULS{"cfgStoreULS", true, "flag to store ULS pairs"}; + o2::framework::Configurable cfgStoreLS{"cfgStoreLS", true, "flag to store LS pairs"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - 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"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time 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 cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; - Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; - // 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 prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - // Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - // Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; + o2::framework::Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; + // o2::framework::Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + // o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + // o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; std::mt19937 engine; float leptonM1 = 0.f; float leptonM2 = 0.f; - void init(InitContext& /*context*/) + void init(o2::framework::InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -516,18 +512,18 @@ struct DileptonProducer { float dca1 = 999.f, dca2 = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - dca1 = dca3DinSigma(t1); - dca2 = dca3DinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2); if (cfgDCAType == 1) { - dca1 = dcaXYinSigma(t1); - dca2 = dcaXYinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2); } else if (cfgDCAType == 2) { - dca1 = dcaZinSigma(t1); - dca2 = dcaZinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - dca1 = fwdDcaXYinSigma(t1); - dca2 = fwdDcaXYinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2); } // fill table here @@ -539,46 +535,46 @@ struct DileptonProducer { return true; } - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - 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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), o2::aod::emprimarymuon::isAssociatedToMPC == true || o2::aod::emprimarymuon::isAssociatedToMPC == false, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::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::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), o2::aod::emprimarymuon::isAssociatedToMPC == true || o2::aod::emprimarymuon::isAssociatedToMPC == false, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); int ndf = 0; template @@ -608,7 +604,7 @@ struct DileptonProducer { int nuls = 0, nlspp = 0, nlsmm = 0; if (cfgStoreULS) { - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillPairInfo(collision, pos, neg, cut, tracks); if (is_pair_ok) { nuls++; @@ -616,13 +612,13 @@ struct DileptonProducer { } } if (cfgStoreLS) { - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ bool is_pair_ok = fillPairInfo(collision, pos1, pos2, cut, tracks); if (is_pair_ok) { nlspp++; } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillPairInfo(collision, neg1, neg2, cut, tracks); if (is_pair_ok) { nlsmm++; @@ -698,17 +694,17 @@ struct DileptonProducer { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -771,7 +767,7 @@ struct DileptonProducer { } PROCESS_SWITCH(DileptonProducer, processAnalysis, "run dilepton analysis", true); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { if (collision.centFT0C() < eventcuts.cfgCentMin || eventcuts.cfgCentMax < collision.centFT0C()) { diff --git a/PWGEM/Dilepton/Core/DimuonCut.cxx b/PWGEM/Dilepton/Core/DimuonCut.cxx index c5e9743bf10..f3a67d06d4a 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.cxx +++ b/PWGEM/Dilepton/Core/DimuonCut.cxx @@ -15,8 +15,11 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" -#include "Framework/Logger.h" +#include +#include + +#include #include ClassImp(DimuonCut); diff --git a/PWGEM/Dilepton/Core/DimuonCut.h b/PWGEM/Dilepton/Core/DimuonCut.h index dd10561196d..4f009b456db 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.h +++ b/PWGEM/Dilepton/Core/DimuonCut.h @@ -18,21 +18,22 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/DataTypes.h" -#include "Framework/Logger.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TNamed.h" - -#include -#include -#include -#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include + +#include +#include +#include #include -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +#include class DimuonCut : public TNamed { @@ -92,8 +93,8 @@ class DimuonCut : public TNamed ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassMuon); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - float dca_xy_t1 = fwdDcaXYinSigma(t1); - float dca_xy_t2 = fwdDcaXYinSigma(t2); + float dca_xy_t1 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1); + float dca_xy_t2 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2); float pair_dca_xy = std::sqrt((dca_xy_t1 * dca_xy_t1 + dca_xy_t2 * dca_xy_t2) / 2.); if (v12.M() < mMinMass || mMaxMass < v12.M()) { @@ -228,7 +229,7 @@ class DimuonCut : public TNamed return mEnableTTCA ? true : track.isAssociatedToMPC(); case DimuonCuts::kMFTHitMap: { - std::vector mftHitMap{checkMFTHitMap<0, 1>(track), checkMFTHitMap<2, 3>(track), checkMFTHitMap<4, 5>(track), checkMFTHitMap<6, 7>(track), checkMFTHitMap<8, 9>(track)}; + std::vector mftHitMap{o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<0, 1>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<2, 3>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<4, 5>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<6, 7>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<8, 9>(track)}; for (const auto& iDisk : mRequiredMFTDisks) { if (!mftHitMap[iDisk]) { return false; diff --git a/PWGEM/Dilepton/Core/EMEventCut.cxx b/PWGEM/Dilepton/Core/EMEventCut.cxx index 58e3c5be4e8..fd418c45abb 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.cxx +++ b/PWGEM/Dilepton/Core/EMEventCut.cxx @@ -15,7 +15,9 @@ #include "PWGEM/Dilepton/Core/EMEventCut.h" -#include "Framework/Logger.h" +#include + +#include ClassImp(EMEventCut); diff --git a/PWGEM/Dilepton/Core/EMEventCut.h b/PWGEM/Dilepton/Core/EMEventCut.h index 3cc785e80a8..b0450f5b575 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.h +++ b/PWGEM/Dilepton/Core/EMEventCut.h @@ -18,12 +18,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" +#include -#include "TNamed.h" - -using namespace std; +#include class EMEventCut : public TNamed { diff --git a/PWGEM/Dilepton/Core/EMTrackCut.cxx b/PWGEM/Dilepton/Core/EMTrackCut.cxx index cd995e08836..fda35ac925f 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.cxx +++ b/PWGEM/Dilepton/Core/EMTrackCut.cxx @@ -15,7 +15,11 @@ #include "PWGEM/Dilepton/Core/EMTrackCut.h" -#include "Framework/Logger.h" +#include + +#include + +#include ClassImp(EMTrackCut); diff --git a/PWGEM/Dilepton/Core/EMTrackCut.h b/PWGEM/Dilepton/Core/EMTrackCut.h index 118c462cbf7..e338aaa2140 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.h +++ b/PWGEM/Dilepton/Core/EMTrackCut.h @@ -16,9 +16,11 @@ #ifndef PWGEM_DILEPTON_CORE_EMTRACKCUT_H_ #define PWGEM_DILEPTON_CORE_EMTRACKCUT_H_ -#include "Framework/Logger.h" +#include -#include "TNamed.h" +#include + +#include class EMTrackCut : public TNamed { diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 3aeb5f44893..fc716d7798e 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -21,200 +21,215 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/EventHistograms.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/Zorro.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - -#include +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include +#include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; template struct SingleTrackQC { // Configurables - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - - ConfigurableAxis ConfPtlBins{"ConfPtlBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; - ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; - ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; - ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + + o2::framework::ConfigurableAxis ConfPtlBins{"ConfPtlBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; + o2::framework::ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {o2::framework::VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - 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"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - 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, "min pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "min pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task + o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; Zorro zorro; @@ -224,11 +239,11 @@ struct SingleTrackQC { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber = 0; float d_bz = 0; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 o2::framework::HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; ~SingleTrackQC() {} @@ -239,91 +254,91 @@ struct SingleTrackQC { o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; - const AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; - const AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; - const AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; - const AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; + const o2::framework::AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; + const o2::framework::AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; // track info - fRegistry.add("Track/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true); - fRegistry.add("Track/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), kTH1F, {axis_phiposition}, false); - fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{4000, -20, 20}}, false); - fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); - fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); - fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); - fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); - - fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - - fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - - fRegistry.add("Track/positive/hPIDForTracking", "PID for trackng", kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h - fRegistry.add("Track/positive/hProbElBDT", "probability to be e from BDT;p_{in} (GeV/c);BDT score;", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hs", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true); + fRegistry.add("Track/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::kTH1F, {axis_phiposition}, false); + fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{4000, -20, 20}}, false); + fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); + fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); + fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); + fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); + + fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/positive/hPIDForTracking", "PID for trackng", o2::framework::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h + fRegistry.add("Track/positive/hProbElBDT", "probability to be e from BDT;p_{in} (GeV/c);BDT score;", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; - const AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; + const o2::framework::AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; // track info - fRegistry.add("Track/positive/hs", "rec. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true); - fRegistry.add("Track/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); - fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -5, 5}}, false); - fRegistry.add("Track/positive/hTrackType", "track type", kTH1F, {{6, -0.5f, 5.5}}, false); - fRegistry.add("Track/positive/hDCAxy", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); - fRegistry.add("Track/positive/hDCAxySigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAx_PosZ", "DCAx vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAy_PosZ", "DCAy vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", kTH1F, {{21, -0.5, 20.5}}, false); - fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", kTH1F, {{11, -0.5, 10.5}}, false); - fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); - fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); + fRegistry.add("Track/positive/hs", "rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true); + fRegistry.add("Track/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); + fRegistry.add("Track/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); + fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); + fRegistry.add("Track/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); + fRegistry.add("Track/positive/hDCAxy", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); + fRegistry.add("Track/positive/hDCAxySigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAx_PosZ", "DCAx vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAy_PosZ", "DCAy vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); + fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); + fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); + fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); + fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } } - void init(InitContext&) + void init(o2::framework::InitContext&) { ccdb->setURL(ccdburl); ccdb->setCaching(true); @@ -343,18 +358,18 @@ struct SingleTrackQC { if (doprocessQC_TriggeredData) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data()); - fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 } if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -526,9 +541,9 @@ struct SingleTrackQC { weight = map_weight[track.globalIndex()]; } - float dca3D = dca3DinSigma(track); - float dcaXY = dcaXYinSigma(track); - float dcaZ = dcaZinSigma(track); + float dca3D = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track); + float dcaXY = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(track); + float dcaZ = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(track); float phiPosition = track.phi() + std::asin(-0.30282 * track.sign() * (d_bz * 0.1) * dielectroncuts.cfgRefR / (2.f * track.pt())); o2::math_utils::bringTo02Pi(phiPosition); @@ -538,9 +553,9 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/positive/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/positive/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/positive/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/positive/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/positive/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/positive/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/positive/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/positive/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -578,9 +593,9 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/negative/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/negative/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/negative/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/negative/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/negative/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/negative/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/negative/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/negative/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -622,7 +637,7 @@ struct SingleTrackQC { if (cfgApplyWeightTTCA) { weight = map_weight[track.globalIndex()]; } - float dca_xy = fwdDcaXYinSigma(track); + float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); float reldpt = (track.ptMatchedMCHMID() - track.pt()) / track.pt(); float deta = track.etaMatchedMCHMID() - track.eta(); @@ -639,7 +654,7 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/positive/hDCAxySigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/positive/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/positive/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/positive/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/positive/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/positive/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -663,7 +678,7 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/negative/hDCAxySigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/negative/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/negative/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/negative/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/negative/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/negative/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -847,21 +862,21 @@ struct SingleTrackQC { std::unordered_map map_best_match_globalmuon; - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; void processQC(FilteredMyCollisions const& collisions, Types const&... args) { @@ -873,7 +888,7 @@ struct SingleTrackQC { runQC(collisions, electrons, perCollision_electron, fDielectronCut); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, muons, perCollision_muon, fDimuonCut); } @@ -894,7 +909,7 @@ struct SingleTrackQC { runQC(collisions, electrons, perCollision_electron, fDielectronCut); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, muons, perCollision_muon, fDimuonCut); } @@ -905,7 +920,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processQC_TriggeredData, "run single track QC on triggered data", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -974,7 +989,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index b000ee4ba28..f202e0b94e5 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -21,221 +21,234 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/EventHistograms.h" #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - -#include +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include +#include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCCollisions = soa::Join; +using MyMCCollisions = o2::soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = o2::soa::Join; using MyMCElectron = MyMCElectrons::iterator; -using FilteredMyMCElectrons = soa::Filtered; +using FilteredMyMCElectrons = o2::soa::Filtered; -using MyMCMuons = soa::Join; +using MyMCMuons = o2::soa::Join; using MyMCMuon = MyMCMuons::iterator; -using FilteredMyMCMuons = soa::Filtered; +using FilteredMyMCMuons = o2::soa::Filtered; -using MySmearedElectrons = soa::Join; +using MySmearedElectrons = o2::soa::Join; using MySmearedElectron = MySmearedElectrons::iterator; -using MySmearedMuons = soa::Join; +using MySmearedMuons = o2::soa::Join; using MySmearedMuon = MySmearedMuons::iterator; template struct SingleTrackQCMC { // Configurables - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgFillQA{"cfgFillQA", false, "flag to fill QA histograms"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; - - ConfigurableAxis ConfPtlBins{"ConfPtlBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; - ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; - ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; - ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgFillQA{"cfgFillQA", false, "flag to fill QA histograms"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + + o2::framework::ConfigurableAxis ConfPtlBins{"ConfPtlBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; + o2::framework::ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {o2::framework::VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - 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", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable includeITSsa{"includeITSsa", false, "Flag to include ITSsa tracks only for MC. switch ON only if needed."}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable includeITSsa{"includeITSsa", false, "Flag to include ITSsa tracks only for MC. switch ON only if needed."}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - 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"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; - Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. - Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "mctrackcut_group"; - Configurable min_mcPt{"min_mcPt", 0.2, "min. MC pT for generated single lepton"}; - Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT single lepton"}; - Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta single lepton"}; - Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta single lepton"}; + o2::framework::Configurable min_mcPt{"min_mcPt", 0.2, "min. MC pT for generated single lepton"}; + o2::framework::Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT single lepton"}; + o2::framework::Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta single lepton"}; + o2::framework::Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta single lepton"}; } mctrackcuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 o2::framework::HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view lepton_source_types[8] = {"PromptLF/", "NonPromptLF/", "Photon/", "PromptJPsi/", "NonPromptJPsi/", "c2l/", "b2l/", "b2c2l/"}; @@ -245,22 +258,22 @@ struct SingleTrackQCMC { { // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); - fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); - fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; - const AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; - const AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; - const AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; - const AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; - const AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; + const o2::framework::AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; + const o2::framework::AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; + const o2::framework::AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; // generated info - fRegistry.add("Generated/PromptLF/hs", "gen. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.add("Generated/PromptLF/hs", "gen. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptLF/"); fRegistry.addClone("Generated/PromptLF/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptJPsi/"); @@ -269,33 +282,33 @@ struct SingleTrackQCMC { fRegistry.addClone("Generated/PromptLF/", "Generated/b2c2l/"); // track info - fRegistry.add("Track/PromptLF/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hs", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); if (fillGenValuesForRec) { - fRegistry.add("Track/PromptLF/positive/hsGenRec", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hsGenRec", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); } if (cfgFillQA) { - fRegistry.add("Track/PromptLF/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), kTH1F, {axis_phiposition}, false); - fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{4000, -20, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/PromptLF/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPIDForTracking", "PID for trackng", kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::kTH1F, {axis_phiposition}, false); + fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{4000, -20, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/PromptLF/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPIDForTracking", "PID for trackng", o2::framework::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -305,32 +318,32 @@ struct SingleTrackQCMC { fRegistry.addClone("Track/PromptLF/", "Track/c2l/"); fRegistry.addClone("Track/PromptLF/", "Track/b2l/"); fRegistry.addClone("Track/PromptLF/", "Track/b2c2l/"); - fRegistry.add("Track/Photon/positive/hProdVtx", "production vertex of e from #gamma;p_{T,e}^{rec} (GeV/c);r_{xy}^{gen} (cm);", kTH2F, {axis_pt, {100, 0, 100}}, false); + fRegistry.add("Track/Photon/positive/hProdVtx", "production vertex of e from #gamma;p_{T,e}^{rec} (GeV/c);r_{xy}^{gen} (cm);", o2::framework::kTH2F, {axis_pt, {100, 0, 100}}, false); fRegistry.addClone("Track/Photon/positive/hProdVtx", "Track/Photon/negative/hProdVtx"); if (cfgFillQA) { - fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.addClone("Track/PID/positive/", "Track/PID/negative/"); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; - const AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; - const AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; + const o2::framework::AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; // generated info - fRegistry.add("Generated/PromptLF/hs", "gen. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.add("Generated/PromptLF/hs", "gen. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptLF/"); fRegistry.addClone("Generated/PromptLF/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptJPsi/"); @@ -339,37 +352,37 @@ struct SingleTrackQCMC { fRegistry.addClone("Generated/PromptLF/", "Generated/b2c2l/"); // track info - fRegistry.add("Track/PromptLF/positive/hs", "rec. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hs", "rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); if (fillGenValuesForRec) { - fRegistry.add("Track/PromptLF/positive/hsGenRec", "gen. info of rec. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hsGenRec", "gen. info of rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); } if (cfgFillQA) { - fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/PromptLF/positive/hdEtadPhi", "#Delta#eta vs. #Delta#varphi between MFT-MCH-MID and MCH-MID;#varphi_{sa} - #varphi_{gl} (rad.);#eta_{sa} - #eta_{gl}", kTH2F, {{90, -M_PI / 4, M_PI / 4}, {100, -0.5, +0.5}}, false); - fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -5, 5}}, false); - fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", kTH1F, {{6, -0.5f, 5.5}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", kTH1F, {{100, 0.f, 1.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy2DinSigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAx_PosZ", "DCA_{x} vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAy_PosZ", "DCA_{y} vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", kTH1F, {{21, -0.5, 20.5}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", kTH1F, {{11, -0.5, 10.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); - fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); + fRegistry.add("Track/PromptLF/positive/hdEtadPhi", "#Delta#eta vs. #Delta#varphi between MFT-MCH-MID and MCH-MID;#varphi_{sa} - #varphi_{gl} (rad.);#eta_{sa} - #eta_{gl}", o2::framework::kTH2F, {{90, -M_PI / 4, M_PI / 4}, {100, -0.5, +0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); + fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", o2::framework::kTH1F, {{100, 0.f, 1.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy2DinSigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAx_PosZ", "DCA_{x} vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAy_PosZ", "DCA_{y} vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -384,7 +397,7 @@ struct SingleTrackQCMC { bool fillGenValuesForRec = false; int pdg_lepton = 0; - void init(InitContext&) + void init(o2::framework::InitContext&) { if (doprocessQCMC && doprocessQCMC_Smeared) { LOGF(fatal, "Cannot enable processQCMC and processQCMC_Smeared at the same time. Please choose one."); @@ -416,7 +429,7 @@ struct SingleTrackQCMC { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -613,9 +626,9 @@ struct SingleTrackQCMC { void fillElectronInfo(TTrack const& track) { auto mctrack = track.template emmcparticle_as(); - float dca3D = dca3DinSigma(track); - float dcaXY = dcaXYinSigma(track); - float dcaZ = dcaZinSigma(track); + float dca3D = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track); + float dcaXY = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(track); + float dcaZ = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(track); float phiPosition = track.phi() + std::asin(-0.30282 * track.sign() * (d_bz * 0.1) * dielectroncuts.cfgRefR / (2.f * track.pt())); o2::math_utils::bringTo02Pi(phiPosition); @@ -639,9 +652,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -685,9 +698,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -725,7 +738,7 @@ struct SingleTrackQCMC { void fillMuonInfo(TTrack const& track, TCollision const& collision) { auto mctrack = track.template emmcparticle_as(); - float dca_xy = fwdDcaXYinSigma(track); + float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); float deta = track.etaMatchedMCHMID() - track.eta(); float dphi = track.phiMatchedMCHMID() - track.phi(); o2::math_utils::bringToPMPi(dphi); @@ -751,7 +764,7 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxy2DinSigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -784,7 +797,7 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxy2DinSigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -883,21 +896,21 @@ struct SingleTrackQCMC { if (mctrack.isPhysicalPrimary() || mctrack.producedByGenerator()) { if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { fillTrackInfo<0, TMCParticles>(track, collision); // PromptLF } else { fillTrackInfo<1, TMCParticles>(track, collision); // NonPromptLF } } else if (pdg_mother == 443) { - if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. fillTrackInfo<4, TMCParticles>(track, collision); } else { fillTrackInfo<3, TMCParticles>(track, collision); } - } else if (isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain. + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain. fillTrackInfo<6, TMCParticles>(track, collision); - } else if (isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain. - if (IsFromBeauty(mcmother, mcparticles) > 0) { + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillTrackInfo<7, TMCParticles>(track, collision); // hb->hc->l is fond. } else { fillTrackInfo<5, TMCParticles>(track, collision); // prompt hc->l is found. @@ -983,21 +996,21 @@ struct SingleTrackQCMC { } if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { fRegistry.fill(HIST("Generated/PromptLF/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } else { fRegistry.fill(HIST("Generated/NonPromptLF/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } } else if (pdg_mother == 443) { - if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. fRegistry.fill(HIST("Generated/NonPromptJPsi/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } else { fRegistry.fill(HIST("Generated/PromptJPsi/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } - } else if (isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); - } else if (isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain. - if (IsFromBeauty(mcmother, mcparticles) > 0) { + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fRegistry.fill(HIST("Generated/b2c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // hb->hc->l is found in full decay chain. } else { fRegistry.fill(HIST("Generated/c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // prompt hc->l is found in full decay chain. @@ -1106,29 +1119,29 @@ struct SingleTrackQCMC { } std::unordered_map map_best_match_globalmuon; - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; - Partition electronsMC = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- - Partition muonsMC = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- - PresliceUnsorted perMcCollision = aod::emmcparticle::emmceventId; + o2::framework::Partition electronsMC = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- + o2::framework::Partition muonsMC = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- + o2::framework::PresliceUnsorted perMcCollision = o2::aod::emmcparticle::emmceventId; - // PresliceUnsorted recColperMcCollision = aod::emmceventlabel::emmceventId; + // o2::framework::PresliceUnsorted recColperMcCollision = o2::aod::emmceventlabel::emmceventId; - void processQCMC(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, TLeptons const& tracks) + void processQCMC(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, TLeptons const& tracks) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (cfgApplyWeightTTCA) { @@ -1137,7 +1150,7 @@ struct SingleTrackQCMC { runQCMC(collisions, tracks, perCollision_electron, fDielectronCut, mccollisions, mcparticles); runGenInfo(collisions, electronsMC, mccollisions, mcparticles); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(tracks, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(tracks, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, tracks, perCollision_muon, fDimuonCut, mccollisions, mcparticles); } @@ -1149,8 +1162,8 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processQCMC, "run single track QC MC", true); - Partition electronsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- - Partition muonsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- + o2::framework::Partition electronsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- + o2::framework::Partition muonsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- void processQCMC_Smeared(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, TLeptons const& tracks, TSmearedMCParticles const& mcparticles_smeared) { @@ -1161,7 +1174,7 @@ struct SingleTrackQCMC { runQCMC(collisions, tracks, perCollision_electron, fDielectronCut, mccollisions, mcparticles_smeared); runGenInfo(collisions, electronsMC_smeared, mccollisions, mcparticles_smeared); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(tracks, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(tracks, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, tracks, perCollision_muon, fDimuonCut, mccollisions, mcparticles_smeared); } @@ -1173,7 +1186,7 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processQCMC_Smeared, "run single track QC MC with smearing", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -1242,7 +1255,7 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 882f714188e..7768db5327c 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -16,7 +16,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" #include @@ -96,7 +95,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint32_t selection_bit) -> bool { retu template uint32_t reduceSelectionBit(TBC const& bc) { - // input should be aod::BcSels or aod::EvSels. + // input should be o2::aod::BcSels or o2::aod::EvSels. uint32_t bitMap = 0; if (bc.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { SETBIT(bitMap, o2::aod::emevsel::kIsTriggerTVX); @@ -157,8 +156,8 @@ uint32_t reduceSelectionBit(TBC const& bc) namespace emevent { DECLARE_SOA_COLUMN(CollisionId, collisionId, int); -DECLARE_SOA_BITMAP_COLUMN(SWTAliasTmp, swtaliastmp, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to aod::Collisions for skimming -DECLARE_SOA_BITMAP_COLUMN(SWTAlias, swtalias, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to aod::EMEvents for analysis +DECLARE_SOA_BITMAP_COLUMN(SWTAliasTmp, swtaliastmp, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to o2::aod::Collisions for skimming +DECLARE_SOA_BITMAP_COLUMN(SWTAlias, swtalias, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to o2::aod::EMEvents for analysis DECLARE_SOA_COLUMN(NInspectedTVX, nInspectedTVX, uint64_t); //! the number of inspected TVX bcs per run DECLARE_SOA_COLUMN(NScalars, nScalers, std::vector); //! the number of triggered bcs before down scaling per run DECLARE_SOA_COLUMN(NSelections, nSelections, std::vector); //! the number of triggered bcs after down scaling per run @@ -364,7 +363,7 @@ using EMEventCent = EMEventsCent::iterator; // using EMEventsCentBase = EMEventsCentBase_001; // using EMEventCentBase = EMEventsCentBase::iterator; // -// // Extended table with expression columns that can be used for Filter. +// // Extended table with expression columns that can be used for o2::framework::expressions::Filter. // DECLARE_SOA_EXTENDED_TABLE_USER(EMEventsCent, EMEventsCentBase, "EMCENTEXT", // emcent::CentFT0M, emcent::CentFT0A, emcent::CentFT0C, emcent::CentNTPV, emcent::CentNGlobal); // @@ -461,7 +460,7 @@ using EMSWTriggerATCounter = EMSWTriggerATCounters::iterator; DECLARE_SOA_TABLE(EMSWTriggerTOICounters, "AOD", "EMSWTTOI", emevent::IsAnalyzedToI, o2::soa::Marker<1>); //! independent table. Don't join anything. using EMSWTriggerTOICounter = EMSWTriggerTOICounters::iterator; -DECLARE_SOA_TABLE(EMSWTriggerBitsTMP, "AOD", "EMSWTBITTMP", emevent::SWTAliasTmp, o2::soa::Marker<2>); //! joinable to aod::Collisions +DECLARE_SOA_TABLE(EMSWTriggerBitsTMP, "AOD", "EMSWTBITTMP", emevent::SWTAliasTmp, o2::soa::Marker<2>); //! joinable to o2::aod::Collisions using EMSWTriggerBitTMP = EMSWTriggerBitsTMP::iterator; DECLARE_SOA_TABLE(EMSWTriggerInfosTMP, "AOD", "EMSWTINFOTMP", bc::RunNumber, emevent::NInspectedTVX, emevent::NScalars, emevent::NSelections, o2::soa::Marker<2>); @@ -477,14 +476,14 @@ DECLARE_SOA_TABLE(EMEventsProperty, "AOD", "EMEVENTPROP", //! joinable to EMEven emevent::SpherocityPtWeighted, emevent::SpherocityPtUnWeighted, emevent::NtrackSpherocity); using EMEventProperty = EMEventsProperty::iterator; -DECLARE_SOA_TABLE(EMEventsNee, "AOD", "EMEVENTNEE", emevent::NeeULS, emevent::NeeLSpp, emevent::NeeLSmm); // joinable to EMEvents or aod::Collisions +DECLARE_SOA_TABLE(EMEventsNee, "AOD", "EMEVENTNEE", emevent::NeeULS, emevent::NeeLSpp, emevent::NeeLSmm); // joinable to EMEvents or o2::aod::Collisions using EMEventNee = EMEventsNee::iterator; -DECLARE_SOA_TABLE(EMEvSels, "AOD", "EMEVSEL", //! joinable to aod::Collisions +DECLARE_SOA_TABLE(EMEvSels, "AOD", "EMEVSEL", //! joinable to o2::aod::Collisions emevent::IsSelected); using EMEvSel = EMEvSels::iterator; -DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to aod::Collisions in createEMEventDilepton.cxx +DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to o2::aod::Collisions in createEMEventDilepton.cxx emevent::IsEoI); using EMEoI = EMEoIs::iterator; @@ -536,8 +535,8 @@ using EMMCEventLabel = EMMCEventLabels::iterator; namespace emmcparticle { DECLARE_SOA_INDEX_COLUMN(EMMCEvent, emmcevent); -DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers); //! Mother tracks (possible empty) array. Iterate over mcParticle.mothers_as()) -DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Daughters, daughters); //! Daughter tracks (possibly empty) array. Check for non-zero with mcParticle.has_daughters(). Iterate over mcParticle.daughters_as()) +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers); //! Mother tracks (possible empty) array. Iterate over mcParticle.mothers_as()) +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Daughters, daughters); //! Daughter tracks (possibly empty) array. Check for non-zero with mcParticle.has_daughters(). Iterate over mcParticle.daughters_as()) DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); }); DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) -> float { return RecoDecay::eta(std::array{px, py, pz}); }); DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) -> float { return RecoDecay::phi(px, py); }); @@ -638,11 +637,11 @@ DECLARE_SOA_COLUMN(EfficiencyGLMuon, efficiency_gl_muon, float); DECLARE_SOA_COLUMN(DCAGLMuon, dca_gl_muon, float); } // namespace smearedtrack -DECLARE_SOA_TABLE(SmearedElectrons, "AOD", "SMEAREDEL", // usage Join +DECLARE_SOA_TABLE(SmearedElectrons, "AOD", "SMEAREDEL", // usage Join smearedtrack::PtSmeared, smearedtrack::EtaSmeared, smearedtrack::PhiSmeared, smearedtrack::Efficiency, smearedtrack::DCA); using SmearedElectron = SmearedElectrons::iterator; -DECLARE_SOA_TABLE(SmearedMuons, "AOD", "SMEAREDMU", // usage Join +DECLARE_SOA_TABLE(SmearedMuons, "AOD", "SMEAREDMU", // usage Join smearedtrack::PtSmearedSAMuon, smearedtrack::EtaSmearedSAMuon, smearedtrack::PhiSmearedSAMuon, smearedtrack::EfficiencySAMuon, smearedtrack::DCASAMuon, smearedtrack::PtSmearedGLMuon, smearedtrack::EtaSmearedGLMuon, smearedtrack::PhiSmearedGLMuon, smearedtrack::EfficiencyGLMuon, smearedtrack::DCAGLMuon); using SmearedMuon = SmearedMuons::iterator; @@ -849,7 +848,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_004, "AOD", "EMPRIMARYEL", 4, //! o2::soa::Index<>, emprimaryelectron::CollisionId, emprimaryelectron::TrackId, emprimaryelectron::Sign, track::Pt, track::Eta, track::Phi, - track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, aod::track::CZZ, + track::DcaXY, track::DcaZ, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, @@ -881,7 +880,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_005, "AOD", "EMPRIMARYEL", 5, //! o2::soa::Index<>, emprimaryelectron::CollisionId, emprimaryelectron::TrackId, emprimaryelectron::Sign, track::Pt, track::Eta, track::Phi, - track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, aod::track::CZZ, + track::DcaXY, track::DcaZ, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, @@ -914,7 +913,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_006, "AOD", "EMPRIMARYEL", 6, //! o2::soa::Index<>, emprimaryelectron::CollisionId, emprimaryelectron::TrackId, emprimaryelectron::Sign, track::Pt, track::Eta, track::Phi, - track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, aod::track::CZZ, + track::DcaXY, track::DcaZ, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, @@ -950,40 +949,40 @@ using EMPrimaryElectrons = EMPrimaryElectrons_006; using EMPrimaryElectron = EMPrimaryElectrons::iterator; DECLARE_SOA_TABLE(EMPrimaryElectronsCov_000, "AOD", "EMPRIMARYELCOV", //! - aod::track::CYY, - aod::track::CZY, - aod::track::CZZ, - aod::track::CSnpY, - aod::track::CSnpZ, - aod::track::CSnpSnp, - aod::track::CTglY, - aod::track::CTglZ, - aod::track::CTglSnp, - aod::track::CTglTgl, - aod::track::C1PtY, - aod::track::C1PtZ, - aod::track::C1PtSnp, - aod::track::C1PtTgl, - aod::track::C1Pt21Pt2, o2::soa::Marker<1>); + o2::aod::track::CYY, + o2::aod::track::CZY, + o2::aod::track::CZZ, + o2::aod::track::CSnpY, + o2::aod::track::CSnpZ, + o2::aod::track::CSnpSnp, + o2::aod::track::CTglY, + o2::aod::track::CTglZ, + o2::aod::track::CTglSnp, + o2::aod::track::CTglTgl, + o2::aod::track::C1PtY, + o2::aod::track::C1PtZ, + o2::aod::track::C1PtSnp, + o2::aod::track::C1PtTgl, + o2::aod::track::C1Pt21Pt2, o2::soa::Marker<1>); DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectronsCov_001, "AOD", "EMPRIMARYELCOV", 1, //! - aod::track::X, - aod::track::Alpha, - aod::track::Y, - aod::track::Z, - aod::track::Snp, - aod::track::CSnpY, - aod::track::CSnpZ, - aod::track::CSnpSnp, - aod::track::CTglY, - aod::track::CTglZ, - aod::track::CTglSnp, - aod::track::CTglTgl, - aod::track::C1PtY, - aod::track::C1PtZ, - aod::track::C1PtSnp, - aod::track::C1PtTgl, - aod::track::C1Pt21Pt2); // CYY, CZY, CZZ, Tgl are in the main electron table. + o2::aod::track::X, + o2::aod::track::Alpha, + o2::aod::track::Y, + o2::aod::track::Z, + o2::aod::track::Snp, + o2::aod::track::CSnpY, + o2::aod::track::CSnpZ, + o2::aod::track::CSnpSnp, + o2::aod::track::CTglY, + o2::aod::track::CTglZ, + o2::aod::track::CTglSnp, + o2::aod::track::CTglTgl, + o2::aod::track::C1PtY, + o2::aod::track::C1PtZ, + o2::aod::track::C1PtSnp, + o2::aod::track::C1PtTgl, + o2::aod::track::C1Pt21Pt2); // CYY, CZY, CZZ, Tgl are in the main electron table. using EMPrimaryElectronsCov = EMPrimaryElectronsCov_001; // iterators @@ -1012,13 +1011,13 @@ using EMPrimaryElectronPrefilterBitDerived = EMPrimaryElectronsPrefilterBitDeriv namespace emprimarymuon { -DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //! -DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! -DECLARE_SOA_COLUMN(FwdTrackId, fwdtrackId, int); //! -DECLARE_SOA_COLUMN(MFTTrackId, mfttrackId, int); //! -DECLARE_SOA_COLUMN(MCHTrackId, mchtrackId, int); //! +DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //! +DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! +DECLARE_SOA_COLUMN(FwdTrackId, fwdtrackId, int); //! +DECLARE_SOA_COLUMN(MFTTrackId, mfttrackId, int); //! +DECLARE_SOA_COLUMN(MCHTrackId, mchtrackId, int); //! DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(GlobalMuonsWithSameMCHMID, globalMuonsWithSameMCHMID); //! self indices to global muons that have the same MCHTrackId -DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(GlobalMuonsWithSameMFT, globalMuonsWithSameMFT); //! self indices to global muons that have the same MFTTrackId +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(GlobalMuonsWithSameMFT, globalMuonsWithSameMFT); //! self indices to global muons that have the same MFTTrackId DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(AmbiguousMuons, ambiguousMuons); DECLARE_SOA_COLUMN(CXXatDCA, cXXatDCA, float); //! DCAx resolution squared at DCA DECLARE_SOA_COLUMN(CYYatDCA, cYYatDCA, float); //! DCAy resolution squared at DCA @@ -1113,7 +1112,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryMuons_002, "AOD", "EMPRIMARYMU", 2, //! o2::soa::Index<>, emprimarymuon::CollisionId, emprimarymuon::FwdTrackId, emprimarymuon::MFTTrackId, emprimarymuon::MCHTrackId, fwdtrack::TrackType, fwdtrack::Pt, fwdtrack::Eta, fwdtrack::Phi, emprimarymuon::Sign, - fwdtrack::FwdDcaX, fwdtrack::FwdDcaY, aod::fwdtrack::CXX, aod::fwdtrack::CYY, aod::fwdtrack::CXY, + fwdtrack::FwdDcaX, fwdtrack::FwdDcaY, o2::aod::fwdtrack::CXX, o2::aod::fwdtrack::CYY, o2::aod::fwdtrack::CXY, emprimarymuon::PtMatchedMCHMID, emprimarymuon::EtaMatchedMCHMID, emprimarymuon::PhiMatchedMCHMID, // emprimarymuon::EtaMatchedMCHMIDatMP, emprimarymuon::PhiMatchedMCHMIDatMP, // emprimarymuon::EtaMatchedMFTatMP, emprimarymuon::PhiMatchedMFTatMP, @@ -1140,21 +1139,21 @@ using EMPrimaryMuon = EMPrimaryMuons::iterator; DECLARE_SOA_TABLE_VERSIONED(EMPrimaryMuonsCov_002, "AOD", "EMPRIMARYMUCOV", 2, //! fwdtrack::X, fwdtrack::Y, fwdtrack::Z, // at PV. Signed1Pt, Tgl and Phi are in EMPrimaryMuons table. - // aod::fwdtrack::CXX, - // aod::fwdtrack::CXY, - // aod::fwdtrack::CYY, - aod::fwdtrack::CPhiX, - aod::fwdtrack::CPhiY, - aod::fwdtrack::CPhiPhi, - aod::fwdtrack::CTglX, - aod::fwdtrack::CTglY, - aod::fwdtrack::CTglPhi, - aod::fwdtrack::CTglTgl, - aod::fwdtrack::C1PtX, - aod::fwdtrack::C1PtY, - aod::fwdtrack::C1PtPhi, - aod::fwdtrack::C1PtTgl, - aod::fwdtrack::C1Pt21Pt2); + // o2::aod::fwdtrack::CXX, + // o2::aod::fwdtrack::CXY, + // o2::aod::fwdtrack::CYY, + o2::aod::fwdtrack::CPhiX, + o2::aod::fwdtrack::CPhiY, + o2::aod::fwdtrack::CPhiPhi, + o2::aod::fwdtrack::CTglX, + o2::aod::fwdtrack::CTglY, + o2::aod::fwdtrack::CTglPhi, + o2::aod::fwdtrack::CTglTgl, + o2::aod::fwdtrack::C1PtX, + o2::aod::fwdtrack::C1PtY, + o2::aod::fwdtrack::C1PtPhi, + o2::aod::fwdtrack::C1PtTgl, + o2::aod::fwdtrack::C1Pt21Pt2); using EMPrimaryMuonsCov = EMPrimaryMuonsCov_002; // iterators using EMPrimaryMuonCov = EMPrimaryMuonsCov::iterator; diff --git a/PWGEM/Dilepton/DataModel/lmeeMLTables.h b/PWGEM/Dilepton/DataModel/lmeeMLTables.h index ebc5309fe00..6d877783a38 100644 --- a/PWGEM/Dilepton/DataModel/lmeeMLTables.h +++ b/PWGEM/Dilepton/DataModel/lmeeMLTables.h @@ -9,16 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" +#include -#include +#include #ifndef PWGEM_DILEPTON_DATAMODEL_LMEEMLTABLES_H_ #define PWGEM_DILEPTON_DATAMODEL_LMEEMLTABLES_H_ diff --git a/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx index 43c3cf43e24..33aed751377 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx index 4a3af5c4313..86ed8dde8bd 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx index 87e49f9fb5e..c543037fbd1 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx index dcca6b5edc1..e9bc1fd78b2 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx index 60ea4f0db2e..5367e71f597 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx index 4f4550cccc9..7506fe10688 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx index 559c871dd1a..ed040916f03 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx index 791876beb15..414241dea5c 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx index 77f3e070980..894d3d2984c 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx index 848c24a5c69..ff12b6a1405 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx index 59227518b1a..f4298c119c6 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx index 0682d607675..c1c8cd61a2a 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx index 2965c836239..f51122a77a2 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx index c782ef2cd4f..79dc86b136c 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx index 5f219f459ca..92df1709c3d 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx index 527faf7c723..d0f5596f445 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx index aea074131e3..7bc2a63916b 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx index abbbe47695a..031c853b12d 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx b/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx index 21342c4468b..340b74077c9 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx b/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx index cc35b94bec3..2775c7275f7 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx index 7ae8f3d47da..bcdce816813 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx b/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx index 86c8fff432a..2e95f21f5c2 100644 --- a/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx @@ -16,14 +16,21 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" +#include "Common/DataModel/EventSelection.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include #include #include diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index d35815b69f3..f268cdb066f 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -28,13 +28,12 @@ #include #include #include +#include #include #include -#include #include -#include #include #include diff --git a/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx b/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx index ed9b5047afc..945ac2853c9 100644 --- a/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx +++ b/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonProducer.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx b/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx index 32cd1bafa72..ed298d39c39 100644 --- a/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx +++ b/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonProducer.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/TableProducer/eventSelection.cxx b/PWGEM/Dilepton/TableProducer/eventSelection.cxx index 89acb23000c..7c857fd6743 100644 --- a/PWGEM/Dilepton/TableProducer/eventSelection.cxx +++ b/PWGEM/Dilepton/TableProducer/eventSelection.cxx @@ -14,13 +14,24 @@ // This code produces event selection table for PWG-EM. // Please write to: daiki.sekihata@cern.ch -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +// +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/filterEoI.cxx b/PWGEM/Dilepton/TableProducer/filterEoI.cxx index 2300cbfb458..31bf18c40a3 100644 --- a/PWGEM/Dilepton/TableProducer/filterEoI.cxx +++ b/PWGEM/Dilepton/TableProducer/filterEoI.cxx @@ -17,15 +17,26 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/Core/TableHelper.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; +using namespace o2::common::core; struct filterEoI { enum SubSystem { diff --git a/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx b/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx index d965dde3061..aa8ab7bdc85 100644 --- a/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx +++ b/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx @@ -17,19 +17,38 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx index 260c6233e79..3c892ed0e1a 100644 --- a/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx index 864c4605462..67f6d5f810c 100644 --- a/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx index 31dc12982d5..bfac1ecf3f3 100644 --- a/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx index d1836d97ad0..0dcca6318c1 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx @@ -16,15 +16,23 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include #include #include diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx index 34c20624a9f..e9fe1653412 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx @@ -19,35 +19,58 @@ #include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/PIDResponseITS.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include +#include +#include +#include #include #include #include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; +using namespace o2::common::core; using MyCollisions = soa::Join; using MyCollisionsWithSWT = soa::Join; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx index b50a0df8bab..3815e0bc335 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx @@ -16,28 +16,48 @@ #include "PWGEM/Dilepton/Utils/MlResponseO2Track.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include +#include +#include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx index ad27348ba7d..1cf936a061f 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx @@ -16,28 +16,42 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx index a64ae751244..382dc4a90df 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx @@ -14,36 +14,47 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "Math/Vector4D.h" -#include "TGeoGlobalMagField.h" - -#include +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include #include #include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx index 3ad5171301c..d5f410eafaa 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx @@ -14,30 +14,39 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "Math/Vector4D.h" -#include "TGeoGlobalMagField.h" - -#include +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include +#include #include +#include #include #include diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx index b7c6b98824f..bc8402d6e7a 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx @@ -16,28 +16,37 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" - +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include -#include -#include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx index f0aa4f1e9aa..63d41fe1424 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -18,8 +18,6 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.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" @@ -27,21 +25,33 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/Vector4D.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include + +#include +#include +#include +#include #include #include #include diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx index 622888f29ae..7e04ba0aa5e 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx @@ -17,35 +17,47 @@ #include "PWGEM/Dilepton/DataModel/lmeeMLTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" +#include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/Zorro.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/PID.h" -#include "ReconstructionDataFormats/Track.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include +#include +#include #include #include #include diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx index ed35f705f3a..9ece7b19407 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx @@ -16,37 +16,48 @@ #include "PWGEM/Dilepton/DataModel/lmeeMLTables.h" -#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include #include #include +#include #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/MCtemplates.cxx b/PWGEM/Dilepton/Tasks/MCtemplates.cxx index 3288bd2745e..d44dd156c62 100644 --- a/PWGEM/Dilepton/Tasks/MCtemplates.cxx +++ b/PWGEM/Dilepton/Tasks/MCtemplates.cxx @@ -13,29 +13,39 @@ // // Analysis task to generate Monte Carlo templates of different heavy-flavour dielectron sources // -#include -#include -#include -#include -#include -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/HistogramsLibrary.h" +#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" +#include "PWGDQ/Core/HistogramManager.h" +#include "PWGDQ/Core/HistogramsLibrary.h" #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" +#include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -using std::cout; -using std::endl; +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include + using std::string; using namespace o2; @@ -480,8 +490,8 @@ struct AnalysisSameEventPairing { } fBarrelHistNamesMCmatched.emplace_back(mcSigClasses); } // end loop over cuts - } // end if(cutNames.IsNull()) - } // end if processBarrel + } // end if(cutNames.IsNull()) + } // end if processBarrel // Add histogram classes for each specified MCsignal at the generator level // TODO: create a std::vector of hist classes to be used at Fill time, to avoid using Form in the process function @@ -577,7 +587,7 @@ struct AnalysisSameEventPairing { } } } // end loop over barrel track pairs - } // end runPairing + } // end runPairing template void runMCGenPair(TTracksMC const& groupedMCTracks) @@ -609,7 +619,7 @@ struct AnalysisSameEventPairing { } } } // end of true pairing loop - } // end runMCGen + } // end runMCGen // skimmed PresliceUnsorted perReducedMcEvent = aod::reducedtrackMC::reducedMCeventId; diff --git a/PWGEM/Dilepton/Tasks/associateMCcollision.cxx b/PWGEM/Dilepton/Tasks/associateMCcollision.cxx index eb0e7d3bf5c..9d66de55cd5 100644 --- a/PWGEM/Dilepton/Tasks/associateMCcollision.cxx +++ b/PWGEM/Dilepton/Tasks/associateMCcollision.cxx @@ -14,11 +14,21 @@ // This code produces a table with an index between mc collision and rec. collision. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx index 83777d2dbc1..91ec19cdacd 100644 --- a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx @@ -24,31 +24,56 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include #include #include +#include +#include +#include +#include #include #include #include +#include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx b/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx index 8d77e81d15f..ad299df81f7 100644 --- a/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx @@ -15,43 +15,55 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "TGeoGlobalMagField.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include -#include +#include +#include #include #include #include -#include #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx index 003b1b6bfa4..71d1d91139b 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -15,36 +15,46 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "TGeoGlobalMagField.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include +#include +#include +#include #include #include #include @@ -52,6 +62,8 @@ #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx b/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx index f0a35f7c814..a608e07d79a 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx @@ -20,18 +20,29 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" - -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include +#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/dielectron.cxx b/PWGEM/Dilepton/Tasks/dielectron.cxx index c8fa31b0e3b..042831bff30 100644 --- a/PWGEM/Dilepton/Tasks/dielectron.cxx +++ b/PWGEM/Dilepton/Tasks/dielectron.cxx @@ -14,11 +14,13 @@ // This code is for dielectron analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/Dilepton.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx b/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx index 42cfa2eac28..8e5d04d67c5 100644 --- a/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx +++ b/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonHadronMPC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dielectronMC.cxx b/PWGEM/Dilepton/Tasks/dielectronMC.cxx index 3c525c29c6e..794b8a48a45 100644 --- a/PWGEM/Dilepton/Tasks/dielectronMC.cxx +++ b/PWGEM/Dilepton/Tasks/dielectronMC.cxx @@ -14,11 +14,13 @@ // This code runs loop over dalitz ee table for dalitz QC. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/DileptonMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx index 3afec6f363a..3595dbf8354 100644 --- a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx +++ b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx @@ -19,30 +19,48 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include #include #include -#include +#include +#include #include #include #include #include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/dimuon.cxx b/PWGEM/Dilepton/Tasks/dimuon.cxx index 51b92ab81b7..be0a7d8386b 100644 --- a/PWGEM/Dilepton/Tasks/dimuon.cxx +++ b/PWGEM/Dilepton/Tasks/dimuon.cxx @@ -14,11 +14,13 @@ // This code is for dimuon analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/Dilepton.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx b/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx index 2e0cf5f5e59..c34d4ba1dbb 100644 --- a/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx +++ b/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonHadronMPC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dimuonMC.cxx b/PWGEM/Dilepton/Tasks/dimuonMC.cxx index f505c073dc3..58e003819ac 100644 --- a/PWGEM/Dilepton/Tasks/dimuonMC.cxx +++ b/PWGEM/Dilepton/Tasks/dimuonMC.cxx @@ -14,11 +14,13 @@ // This code runs loop over dalitz ee table for dalitz QC. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/DileptonMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx index 907161d9de2..d223c5d2c1c 100644 --- a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx +++ b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx @@ -23,38 +23,42 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include -#include #include -#include +#include + +#include +#include +#include +#include +#include +#include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx b/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx index 5ad4d765e25..6efc22b11c4 100644 --- a/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx +++ b/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx @@ -16,26 +16,35 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include #include -#include +#include #include +#include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index c21d08c6248..4d52520d119 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -14,6 +14,8 @@ // This code is for event QC for PWG-EM. // Please write to: daiki.sekihata@cern.ch +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/DataModel/Centrality.h" @@ -24,21 +26,35 @@ #include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "TString.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include +#include +#include +#include +#include #include #include +#include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx index 49d6a823d05..8a07ff873da 100644 --- a/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx @@ -18,14 +18,32 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MCUtilities.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Task.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include + +#include + +#include +#include +#include #include using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx index 1cac2727e98..56bd936d9f3 100644 --- a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx @@ -14,17 +14,38 @@ /// \analysis task for lmee light flavour cocktail /// \author Daniel Samitz, , SMI Vienna -#include -#include -#include - -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/matchingMFT.cxx b/PWGEM/Dilepton/Tasks/matchingMFT.cxx index ca2f912594e..d962d51b94d 100644 --- a/PWGEM/Dilepton/Tasks/matchingMFT.cxx +++ b/PWGEM/Dilepton/Tasks/matchingMFT.cxx @@ -13,8 +13,7 @@ /// \brief a task to study matching MFT-[MCH-MID] in MC /// \author daiki.sekihata@cern.ch -#include "TableHelper.h" - +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -22,27 +21,43 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "TGeoGlobalMagField.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include #include +#include #include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx b/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx index 9ec7f079712..e04151d9c35 100644 --- a/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx +++ b/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx @@ -15,9 +15,19 @@ /// \brief Task to build the predictions from the models based on the generated particles /// -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index c2ac0b75d80..b35ef08c80f 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -19,29 +19,49 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - -#include +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; +using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +using namespace o2::aod::pwgem::dilepton::utils::pairutil; struct prefilterDielectron { using MyCollisions = soa::Join; diff --git a/PWGEM/Dilepton/Tasks/singleElectronQC.cxx b/PWGEM/Dilepton/Tasks/singleElectronQC.cxx index 4a687e82217..e7dd129af66 100644 --- a/PWGEM/Dilepton/Tasks/singleElectronQC.cxx +++ b/PWGEM/Dilepton/Tasks/singleElectronQC.cxx @@ -14,11 +14,13 @@ // Analysis task for single electron QC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx b/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx index da2617158ec..a6a5ece732d 100644 --- a/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx @@ -14,11 +14,13 @@ // Analysis task for single electron QC in MC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleMuonQC.cxx b/PWGEM/Dilepton/Tasks/singleMuonQC.cxx index b9ccb722ea3..f0ebe6e2f23 100644 --- a/PWGEM/Dilepton/Tasks/singleMuonQC.cxx +++ b/PWGEM/Dilepton/Tasks/singleMuonQC.cxx @@ -14,11 +14,13 @@ // Analysis task for single muon QC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx b/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx index 7b7176238c1..55365013453 100644 --- a/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx @@ -14,11 +14,13 @@ // Analysis task for single muon QC in MC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/smearing.cxx b/PWGEM/Dilepton/Tasks/smearing.cxx index 03d0b272f46..3d5a8668244 100644 --- a/PWGEM/Dilepton/Tasks/smearing.cxx +++ b/PWGEM/Dilepton/Tasks/smearing.cxx @@ -16,17 +16,26 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MomentumSmearer.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include +#include +#include #include using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx b/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx index d1d6452a50a..7dc849507e2 100644 --- a/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx +++ b/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx @@ -17,7 +17,6 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -25,25 +24,35 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include +#include +#include #include +#include #include #include diff --git a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx index 4204a95a9c4..10c634aae02 100644 --- a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx +++ b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx @@ -14,20 +14,35 @@ // This code is to study MC truth. e.g. evet selection bias // Please write to: daiki.sekihata@cern.ch -#include -#include "Math/Vector4D.h" - -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TableHelper.h" -#include "Common/DataModel/EventSelection.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include + +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx index 9787a5bae04..47eab1ebafb 100644 --- a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx +++ b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx @@ -14,7 +14,6 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" #include "PWGDQ/Core/MixingHandler.h" @@ -24,34 +23,34 @@ #include "Common/CCDB/EventSelectionParams.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include -#include -#include +#include + +#include +#include +#include #include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/taggingHFE.cxx b/PWGEM/Dilepton/Tasks/taggingHFE.cxx index 02bce88073e..ea169455395 100644 --- a/PWGEM/Dilepton/Tasks/taggingHFE.cxx +++ b/PWGEM/Dilepton/Tasks/taggingHFE.cxx @@ -17,7 +17,6 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -25,29 +24,43 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include #include +#include +#include #include +#include #include +#include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx b/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx index f5f01ae4cfe..e7268360d74 100644 --- a/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx +++ b/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx @@ -13,45 +13,39 @@ // Analysis task to produce resolution mapfor electrons/muons in dilepton analysis // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Utils/MCUtilities.h" - -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/fwdtrackUtilities.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -#include -#include -#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; struct testBremsstrahlung { Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; diff --git a/PWGEM/Dilepton/Utils/EMFwdTrack.h b/PWGEM/Dilepton/Utils/EMFwdTrack.h index 510aa5f3533..3b8ec9ec18e 100644 --- a/PWGEM/Dilepton/Utils/EMFwdTrack.h +++ b/PWGEM/Dilepton/Utils/EMFwdTrack.h @@ -15,6 +15,9 @@ #ifndef PWGEM_DILEPTON_UTILS_EMFWDTRACK_H_ #define PWGEM_DILEPTON_UTILS_EMFWDTRACK_H_ +#include +#include + namespace o2::aod::pwgem::dilepton::utils { class EMFwdTrack diff --git a/PWGEM/Dilepton/Utils/EMTrack.h b/PWGEM/Dilepton/Utils/EMTrack.h index 1ac2f442f7e..8efb0c78226 100644 --- a/PWGEM/Dilepton/Utils/EMTrack.h +++ b/PWGEM/Dilepton/Utils/EMTrack.h @@ -15,7 +15,13 @@ #ifndef PWGEM_DILEPTON_UTILS_EMTRACK_H_ #define PWGEM_DILEPTON_UTILS_EMTRACK_H_ -#include "Math/Vector4D.h" +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include + +#include namespace o2::aod::pwgem::dilepton::utils { diff --git a/PWGEM/Dilepton/Utils/EMTrackUtilities.h b/PWGEM/Dilepton/Utils/EMTrackUtilities.h index 47e73e31f96..ba9953f48b1 100644 --- a/PWGEM/Dilepton/Utils/EMTrackUtilities.h +++ b/PWGEM/Dilepton/Utils/EMTrackUtilities.h @@ -15,15 +15,13 @@ #ifndef PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ -#include "Framework/DataTypes.h" -#include "Framework/Logger.h" +#include #include +#include +#include #include -#include -#include #include -#include //_______________________________________________________________________ namespace o2::aod::pwgem::dilepton::utils::emtrackutil diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index 74dd96bdb84..c24ba9b497c 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -15,20 +15,28 @@ #ifndef PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ #define PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" + #include "Common/Core/RecoDecay.h" -#include "Framework/HistogramRegistry.h" +#include +#include + +#include + +#include +#include -using namespace o2::framework; +#include namespace o2::aod::pwgem::dilepton::utils::eventhistogram { const int nbin_ev = 21; template -void addEventHistograms(HistogramRegistry* fRegistry) +void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", kTH1D, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "FT0AND"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No TF border"); @@ -51,101 +59,101 @@ void addEventHistograms(HistogramRegistry* fRegistry) hCollisionCounter->GetXaxis()->SetBinLabel(20, "Calibrated Q vector"); hCollisionCounter->GetXaxis()->SetBinLabel(21, "accepted"); - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", kTH1D, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", kTH2D, {{200, 0, 200000}, {60, 0, 60000}}, false); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentNTPV", "hCentNTPV;centrality NTPV (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", kTH2D, {{110, 0, 110}, {600, 0, 6000}}, false); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", kTH2D, {{60, 0, 60000}, {600, 0, 6000}}, false); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", kTH2D, {{60, 0, 60000}, {200, 0, 20000}}, false); - fRegistry->add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", kTH2D, {{600, 0, 6000}, {200, 0, 20000}}, false); - fRegistry->add("Event/before/hCorrOccupancy", "occupancy correlation;FT0C occupancy;track occupancy", kTH2D, {{200, 0, 200000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); + fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1D, {{6001, -0.5, 6000.5}}, false); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2D, {{200, 0, 200000}, {60, 0, 60000}}, false); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentNTPV", "hCentNTPV;centrality NTPV (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2D, {{110, 0, 110}, {600, 0, 6000}}, false); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2D, {{60, 0, 60000}, {600, 0, 6000}}, false); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2D, {{60, 0, 60000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", o2::framework::kTH2D, {{600, 0, 6000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hCorrOccupancy", "occupancy correlation;FT0C occupancy;track occupancy", o2::framework::kTH2D, {{200, 0, 200000}, {200, 0, 20000}}, false); if constexpr (nmod == 2) { - fRegistry->add("Event/before/hQ2xFT0M_CentFT0C", "hQ2xFT0M_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0M_CentFT0C", "hQ2yFT0M_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFT0A_CentFT0C", "hQ2xFT0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0A_CentFT0C", "hQ2yFT0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFT0C_CentFT0C", "hQ2xFT0C_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0C_CentFT0C", "hQ2yFT0C_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFV0A_CentFT0C", "hQ2xFV0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFV0A_CentFT0C", "hQ2yFV0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBPos_CentFT0C", "hQ2xBPos_CentFT0C;centrality FT0C (%);Q_{2,x}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBPos_CentFT0C", "hQ2yBPos_CentFT0C;centrality FT0C (%);Q_{2,y}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBNeg_CentFT0C", "hQ2xBNeg_CentFT0C;centrality FT0C (%);Q_{2,x}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBNeg_CentFT0C", "hQ2yBNeg_CentFT0C;centrality FT0C (%);Q_{2,y}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBTot_CentFT0C", "hQ2xBTot_CentFT0C;centrality FT0C (%);Q_{2,x}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBTot_CentFT0C", "hQ2yBTot_CentFT0C;centrality FT0C (%);Q_{2,y}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0M_CentFT0C", "hQ2xFT0M_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0M_CentFT0C", "hQ2yFT0M_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0A_CentFT0C", "hQ2xFT0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0A_CentFT0C", "hQ2yFT0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0C_CentFT0C", "hQ2xFT0C_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0C_CentFT0C", "hQ2yFT0C_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFV0A_CentFT0C", "hQ2xFV0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFV0A_CentFT0C", "hQ2yFV0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBPos_CentFT0C", "hQ2xBPos_CentFT0C;centrality FT0C (%);Q_{2,x}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBPos_CentFT0C", "hQ2yBPos_CentFT0C;centrality FT0C (%);Q_{2,y}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBNeg_CentFT0C", "hQ2xBNeg_CentFT0C;centrality FT0C (%);Q_{2,x}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBNeg_CentFT0C", "hQ2yBNeg_CentFT0C;centrality FT0C (%);Q_{2,y}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBTot_CentFT0C", "hQ2xBTot_CentFT0C;centrality FT0C (%);Q_{2,x}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBTot_CentFT0C", "hQ2yBTot_CentFT0C;centrality FT0C (%);Q_{2,y}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hEP2FT0M_CentFT0C", "2nd harmonics event plane FT0M;centrality FT0C (%);#Psi_{2}^{FT0M} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FT0A_CentFT0C", "2nd harmonics event plane FT0A;centrality FT0C (%);#Psi_{2}^{FT0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FT0C_CentFT0C", "2nd harmonics event plane FT0C;centrality FT0C (%);#Psi_{2}^{FT0C} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FV0A_CentFT0C", "2nd harmonics event plane FV0A;centrality FT0C (%);#Psi_{2}^{FV0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BPos_CentFT0C", "2nd harmonics event plane BPos;centrality FT0C (%);#Psi_{2}^{BPos} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BNeg_CentFT0C", "2nd harmonics event plane BNeg;centrality FT0C (%);#Psi_{2}^{BNeg} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BTot_CentFT0C", "2nd harmonics event plane BTot;centrality FT0C (%);#Psi_{2}^{BTot} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0M_CentFT0C", "2nd harmonics event plane FT0M;centrality FT0C (%);#Psi_{2}^{FT0M} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0A_CentFT0C", "2nd harmonics event plane FT0A;centrality FT0C (%);#Psi_{2}^{FT0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0C_CentFT0C", "2nd harmonics event plane FT0C;centrality FT0C (%);#Psi_{2}^{FT0C} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FV0A_CentFT0C", "2nd harmonics event plane FV0A;centrality FT0C (%);#Psi_{2}^{FV0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BPos_CentFT0C", "2nd harmonics event plane BPos;centrality FT0C (%);#Psi_{2}^{BPos} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BNeg_CentFT0C", "2nd harmonics event plane BNeg;centrality FT0C (%);#Psi_{2}^{BNeg} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BTot_CentFT0C", "2nd harmonics event plane BTot;centrality FT0C (%);#Psi_{2}^{BTot} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hPrfQ2FT0MQ2BPos_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0MQ2BNeg_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2BPosQ2BNeg_CentFT0C", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ2FT0CQ2BPos_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0CQ2BNeg_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0CQ2BTot_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BPos_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BNeg_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BTot_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2FT0C_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfQ2FV0AQ2BPos_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ2FT0MQ2BPos_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0MQ2BNeg_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2BPosQ2BNeg_CentFT0C", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfQ2FT0CQ2BPos_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0CQ2BNeg_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0CQ2BTot_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BPos_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BNeg_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BTot_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2FT0C_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ2FV0AQ2BPos_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } else if constexpr (nmod == 3) { - fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFT0A_CentFT0C", "hQ3xFT0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0A_CentFT0C", "hQ3yFT0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFT0C_CentFT0C", "hQ3xFT0C_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0C_CentFT0C", "hQ3yFT0C_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFV0A_CentFT0C", "hQ3xFV0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFV0A_CentFT0C", "hQ3yFV0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBPos_CentFT0C", "hQ3xBPos_CentFT0C;centrality FT0C (%);Q_{3,x}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBPos_CentFT0C", "hQ3yBPos_CentFT0C;centrality FT0C (%);Q_{3,y}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBNeg_CentFT0C", "hQ3xBNeg_CentFT0C;centrality FT0C (%);Q_{3,x}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBNeg_CentFT0C", "hQ3yBNeg_CentFT0C;centrality FT0C (%);Q_{3,y}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBTot_CentFT0C", "hQ3xBTot_CentFT0C;centrality FT0C (%);Q_{3,x}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBTot_CentFT0C", "hQ3yBTot_CentFT0C;centrality FT0C (%);Q_{3,y}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0A_CentFT0C", "hQ3xFT0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0A_CentFT0C", "hQ3yFT0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0C_CentFT0C", "hQ3xFT0C_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0C_CentFT0C", "hQ3yFT0C_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFV0A_CentFT0C", "hQ3xFV0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFV0A_CentFT0C", "hQ3yFV0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBPos_CentFT0C", "hQ3xBPos_CentFT0C;centrality FT0C (%);Q_{3,x}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBPos_CentFT0C", "hQ3yBPos_CentFT0C;centrality FT0C (%);Q_{3,y}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBNeg_CentFT0C", "hQ3xBNeg_CentFT0C;centrality FT0C (%);Q_{3,x}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBNeg_CentFT0C", "hQ3yBNeg_CentFT0C;centrality FT0C (%);Q_{3,y}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBTot_CentFT0C", "hQ3xBTot_CentFT0C;centrality FT0C (%);Q_{3,x}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBTot_CentFT0C", "hQ3yBTot_CentFT0C;centrality FT0C (%);Q_{3,y}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hEP3FT0M_CentFT0C", "3rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{3}^{FT0M} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FT0A_CentFT0C", "3rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{3}^{FT0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FT0C_CentFT0C", "3rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{3}^{FT0C} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FV0A_CentFT0C", "3rd harmonics event plane FV0A;centrality FT0C (%);#Psi_{3}^{FV0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BPos_CentFT0C", "3rd harmonics event plane BPos;centrality FT0C (%);#Psi_{3}^{BPos} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BNeg_CentFT0C", "3rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{3}^{BNeg} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BTot_CentFT0C", "3rd harmonics event plane BTot;centrality FT0C (%);#Psi_{3}^{BTot} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0M_CentFT0C", "3rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{3}^{FT0M} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0A_CentFT0C", "3rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{3}^{FT0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0C_CentFT0C", "3rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{3}^{FT0C} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FV0A_CentFT0C", "3rd harmonics event plane FV0A;centrality FT0C (%);#Psi_{3}^{FV0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BPos_CentFT0C", "3rd harmonics event plane BPos;centrality FT0C (%);#Psi_{3}^{BPos} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BNeg_CentFT0C", "3rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{3}^{BNeg} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BTot_CentFT0C", "3rd harmonics event plane BTot;centrality FT0C (%);#Psi_{3}^{BTot} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hPrfQ3FT0MQ3BPos_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0MQ3BNeg_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3BPosQ3BNeg_CentFT0C", "Q_{3}^{BPos} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{BPos} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ3FT0CQ3BPos_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0CQ3BNeg_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0CQ3BTot_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BPos_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfQ3FV0AQ3BPos_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ3FT0MQ3BPos_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0MQ3BNeg_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3BPosQ3BNeg_CentFT0C", "Q_{3}^{BPos} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{BPos} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfQ3FT0CQ3BPos_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0CQ3BNeg_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0CQ3BTot_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BPos_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ3FV0AQ3BPos_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } fRegistry->addClone("Event/before/", "Event/after/"); } template -void fillEventInfo(HistogramRegistry* fRegistry, TCollision const& collision, const float /*weight*/ = 1.f) +void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, const float /*weight*/ = 1.f) { static constexpr std::string_view event_types[2] = {"before/", "after/"}; fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 1.0); diff --git a/PWGEM/Dilepton/Utils/EventMixingHandler.h b/PWGEM/Dilepton/Utils/EventMixingHandler.h index 20b38399979..4698654be49 100644 --- a/PWGEM/Dilepton/Utils/EventMixingHandler.h +++ b/PWGEM/Dilepton/Utils/EventMixingHandler.h @@ -16,7 +16,6 @@ #define PWGEM_DILEPTON_UTILS_EVENTMIXINGHANDLER_H_ #include -#include #include namespace o2::aod::pwgem::dilepton::utils diff --git a/PWGEM/Dilepton/Utils/MCUtilities.h b/PWGEM/Dilepton/Utils/MCUtilities.h index f8937f7d1a2..d0a9a69df0e 100644 --- a/PWGEM/Dilepton/Utils/MCUtilities.h +++ b/PWGEM/Dilepton/Utils/MCUtilities.h @@ -15,10 +15,9 @@ #ifndef PWGEM_DILEPTON_UTILS_MCUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_MCUTILITIES_H_ -#include "Framework/AnalysisDataModel.h" -#include "Framework/Logger.h" +#include +#include -#include #include #include #include diff --git a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h index 5ec9756b5a9..e16ddd1b9c3 100644 --- a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h +++ b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h @@ -19,7 +19,9 @@ #include "Tools/ML/MlResponse.h" -#include +#include + +#include #include #include diff --git a/PWGEM/Dilepton/Utils/MlResponseO2Track.h b/PWGEM/Dilepton/Utils/MlResponseO2Track.h index e526eb9a3db..0b1bdbbe2be 100644 --- a/PWGEM/Dilepton/Utils/MlResponseO2Track.h +++ b/PWGEM/Dilepton/Utils/MlResponseO2Track.h @@ -18,7 +18,9 @@ #include "Tools/ML/MlResponse.h" -#include +#include + +#include #include #include diff --git a/PWGEM/Dilepton/Utils/MomentumSmearer.h b/PWGEM/Dilepton/Utils/MomentumSmearer.h index d0e73ee971f..59bb41f948c 100644 --- a/PWGEM/Dilepton/Utils/MomentumSmearer.h +++ b/PWGEM/Dilepton/Utils/MomentumSmearer.h @@ -15,12 +15,12 @@ #ifndef PWGEM_DILEPTON_UTILS_MOMENTUMSMEARER_H_ #define PWGEM_DILEPTON_UTILS_MOMENTUMSMEARER_H_ -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include #include #include #include @@ -28,15 +28,12 @@ #include #include #include +#include #include +#include #include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; - class MomentumSmearer { public: @@ -576,7 +573,7 @@ class MomentumSmearer void setCcdbPathRes(TString ccdbPathRes) { fCcdbPathRes = ccdbPathRes; } void setCcdbPathEff(TString ccdbPathEff) { fCcdbPathEff = ccdbPathEff; } void setCcdbPathDCA(TString ccdbPathDCA) { fCcdbPathDCA = ccdbPathDCA; } - void setCcdb(Service ccdb) + void setCcdb(o2::framework::Service ccdb) { fCcdb = ccdb; fFromCcdb = true; @@ -645,7 +642,7 @@ class MomentumSmearer std::vector fVecDCA; int64_t fTimestamp; bool fFromCcdb = false; - Service fCcdb; + o2::framework::Service fCcdb; float fMinPtGen = -1.f; }; diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index 0758289bbee..fd915c7fd0f 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -18,14 +18,20 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" -#include "ReconstructionDataFormats/TrackFwd.h" +#include -#include "Math/GenVector/Boost.h" -#include "Math/SMatrix.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" +#include +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h) +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include +#include +#include #include //_______________________________________________________________________ diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index aaf16551ba6..6aae90e5d3c 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -22,9 +22,9 @@ #include "PWGEM/PhotonMeson/Core/PairCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include +#include -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.h b/PWGEM/PhotonMeson/Core/CutsLibrary.h index bf4fcfe7037..5647908dd1a 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.h +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.h @@ -15,13 +15,12 @@ #ifndef PWGEM_PHOTONMESON_CORE_CUTSLIBRARY_H_ #define PWGEM_PHOTONMESON_CORE_CUTSLIBRARY_H_ -#include -#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/PairCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" namespace o2::aod { diff --git a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx index f129a1ba289..c0709362278 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx @@ -15,7 +15,7 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include "Framework/Logger.h" +#include #include diff --git a/PWGEM/PhotonMeson/Core/DalitzEECut.h b/PWGEM/PhotonMeson/Core/DalitzEECut.h index 9eb6b1a0801..293a52424c0 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.h +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.h @@ -22,7 +22,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include @@ -34,8 +34,6 @@ #include #include -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; - class DalitzEECut : public TNamed { public: @@ -256,7 +254,7 @@ class DalitzEECut : public TNamed return mMinChi2PerClusterTPC < track.tpcChi2NCl() && track.tpcChi2NCl() < mMaxChi2PerClusterTPC; case DalitzEECuts::kDCA3Dsigma: - return mMinDca3D < dca3DinSigma(track) && dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg + return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg case DalitzEECuts::kDCAxy: return std::fabs(track.dcaXY()) < ((mMaxDcaXYPtDep) ? mMaxDcaXYPtDep(track.pt()) : mMaxDcaXY); diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h index 3f10f83d55f..3c262fcb540 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -19,17 +19,24 @@ #include "PWGEM/PhotonMeson/Core/EMBitFlags.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include #include #include +#include +#include #include +#include + #include #include #include #include +#include #include +#include #include template @@ -280,7 +287,7 @@ class EMCPhotonCut : public TNamed /// \param cluster cluster table to check /// \param matchedTracks matched primary tracks table /// \param matchedSecondaries matched secondary tracks table - /// \param fRegistry HistogramRegistry pointer of the main task + /// \param fRegistry o2::framework::HistogramRegistry pointer of the main task void AreSelectedRunning(EMBitFlags& flags, o2::soa::is_table auto const& clusters, IsTrackContainer auto const& emcmatchedtracks, IsTrackContainer auto const& secondaries, o2::framework::HistogramRegistry* fRegistry = nullptr) const { if (clusters.size() <= 0) { diff --git a/PWGEM/PhotonMeson/Core/EMNonLin.h b/PWGEM/PhotonMeson/Core/EMNonLin.h index d272d9e5593..b6fa2594310 100644 --- a/PWGEM/PhotonMeson/Core/EMNonLin.h +++ b/PWGEM/PhotonMeson/Core/EMNonLin.h @@ -16,9 +16,8 @@ #ifndef PWGEM_PHOTONMESON_CORE_EMNONLIN_H_ #define PWGEM_PHOTONMESON_CORE_EMNONLIN_H_ -#include - -#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx index 253020c7d69..316b01d9563 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx @@ -13,9 +13,12 @@ // Class for em photon event selection // -#include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include + +#include + ClassImp(EMPhotonEventCut); void EMPhotonEventCut::SetRequireSel8(bool flag) diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h index 1121a6fd922..5b14aa8d2ef 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h @@ -19,9 +19,9 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include "TNamed.h" +#include -using namespace std; +#include class EMPhotonEventCut : public TNamed { diff --git a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h index b46e258353c..72e3b364a46 100644 --- a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h +++ b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h @@ -20,6 +20,7 @@ #include "Tools/ML/MlResponse.h" +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h index 094f86ceb8a..0b9cb24bbf5 100644 --- a/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h @@ -18,14 +18,15 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include -#include +#include #include -#include +#include #include #include #include +#include + #include #include diff --git a/PWGEM/PhotonMeson/Core/PairCut.cxx b/PWGEM/PhotonMeson/Core/PairCut.cxx index be8bee172c7..3ea3e06acec 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.cxx +++ b/PWGEM/PhotonMeson/Core/PairCut.cxx @@ -13,9 +13,12 @@ // Class for track selection // -#include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/PairCut.h" +#include + +#include + ClassImp(PairCut); const char* PairCut::mCutNames[static_cast(PairCut::PairCuts::kNCuts)] = {"Asym"}; diff --git a/PWGEM/PhotonMeson/Core/PairCut.h b/PWGEM/PhotonMeson/Core/PairCut.h index 19ba27c79bf..c514d8946c8 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.h +++ b/PWGEM/PhotonMeson/Core/PairCut.h @@ -16,15 +16,9 @@ #ifndef PWGEM_PHOTONMESON_CORE_PAIRCUT_H_ #define PWGEM_PHOTONMESON_CORE_PAIRCUT_H_ -#include -#include -#include -#include -#include "Framework/Logger.h" -#include "Framework/DataTypes.h" #include "Rtypes.h" -#include "TNamed.h" -#include "TMath.h" + +#include class PairCut : public TNamed { diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 1eb74391520..c89fc48990f 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -20,6 +20,7 @@ #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -46,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -56,7 +56,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 442cf9d13b6..ee823b4f4b0 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -20,6 +20,7 @@ #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -43,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -51,7 +51,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include @@ -939,7 +939,7 @@ struct Pi0EtaToGammaGammaMC { o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; o2::framework::expressions::Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - // using FilteredMyCollisions = o2::soa::Filtered>; + // using FilteredMyCollisions = o2::soa::Filtered>; o2::framework::expressions::Filter prefilter_pcm = ifnode(pcmcuts.cfg_apply_cuts_from_prefilter_derived.node(), o2::aod::v0photonkf::pfbderived == static_cast(0), true); o2::framework::expressions::Filter prefilter_primaryelectron = ifnode(dileptoncuts.cfg_apply_cuts_from_prefilter_derived.node(), o2::aod::emprimaryelectron::pfbderived == static_cast(0), true); @@ -979,7 +979,7 @@ struct Pi0EtaToGammaGammaMC { } PROCESS_SWITCH(Pi0EtaToGammaGammaMC, processAnalysis, "process pair analysis", true); - // using FilteredMyCollisionsWithJJMC = o2::soa::Filtered, aod::EMEventsWeight>>; + // using FilteredMyCollisionsWithJJMC = o2::soa::Filtered, o2::aod::EMEventsWeight>>; void processAnalysisJJMC(o2::soa::Filtered, o2::aod::EMEventsWeight>> const& collisions, o2::soa::Join const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPCM) { diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0.h b/PWGEM/PhotonMeson/Core/TaggingPi0.h index 71d7fb9f48b..ee4f8fc8083 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -21,7 +21,6 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -// #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -49,7 +48,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include @@ -64,163 +63,155 @@ #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::photonmeson::photonpair; -using namespace o2::aod::pwgem::photon; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils; - -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithJJMC = soa::Join; +using MyCollisionsWithJJMC = o2::soa::Join; using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator; -using MyV0Photons = soa::Join; +using MyV0Photons = o2::soa::Join; using MyV0Photon = MyV0Photons::iterator; -using MyPrimaryElectrons = soa::Join; +using MyPrimaryElectrons = o2::soa::Join; using MyPrimaryElectron = MyPrimaryElectrons::iterator; -using MyEMCClusters = soa::Join; +using MyEMCClusters = o2::soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -// using MyPHOSClusters = soa::Join; +// using MyPHOSClusters = o2::soa::Join; // using MyPHOSCluster = MyPHOSClusters::iterator; -template +template struct TaggingPi0 { - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; - - Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; - Configurable ndepth{"ndepth", 100, "depth for 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, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; + + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; + o2::framework::Configurable ndepth{"ndepth", 100, "depth for event mixing"}; + o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::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"}; + o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::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, 999.f}, "Mixing bins - centrality"}; + o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {o2::framework::VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; + o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + o2::framework::ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; + + using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; EMPhotonEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - 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"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time 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 cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; - Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; + o2::framework::Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; } eventcuts; V0PhotonCut fV0PhotonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "pcmcut_group"; - Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; - Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; - Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; - Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; - Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; - Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; - Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; - Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; - Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; - Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; - Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; - Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; - Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; - Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; - Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; - - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; - Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; - Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; + o2::framework::Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; + o2::framework::Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; + o2::framework::Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; + o2::framework::Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; + o2::framework::Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; + o2::framework::Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; + o2::framework::Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; + o2::framework::Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; + o2::framework::Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; + o2::framework::Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; + o2::framework::Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; + o2::framework::Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; + o2::framework::Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + o2::framework::Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; + o2::framework::Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; + + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; + o2::framework::Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; + o2::framework::Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; } pcmcuts; DalitzEECut fDileptonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dileptoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; - Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; } dileptoncuts; EMCPhotonCut fEMCCut; - struct : ConfigurableGroup { + struct : o2::framework::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"}; - 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 cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; + o2::framework::Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; + o2::framework::Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; + o2::framework::Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + o2::framework::Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + o2::framework::Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + o2::framework::Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + o2::framework::Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; } emccuts; // PHOSPhotonCut fPHOSCut; - // struct : ConfigurableGroup { + // struct : o2::framework::ConfigurableGroup { // std::string prefix = "phoscut_group"; - // Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; + // o2::framework::Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; // } phoscuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; @@ -230,11 +221,11 @@ struct TaggingPi0 { std::vector occ_bin_edges; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; - void init(InitContext&) + void init(o2::framework::InitContext&) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); @@ -326,20 +317,20 @@ struct TaggingPi0 { void addHistogrms() { TString mggTitle = "ee#gamma"; - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - const AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; - const AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; + const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; + const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); - fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); - fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", kTH2D, {axis_m, axis_pt}, true); + fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); + fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); + fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", o2::framework::kTH2D, {axis_m, axis_pt}, true); fRegistry.addClone("Pair/same/", "Pair/mix/"); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); } void DefineEMEventCut() @@ -442,16 +433,15 @@ struct TaggingPi0 { // fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); // } - SliceCache cache; - Preslice perCollision_pcm = aod::v0photonkf::pmeventId; - Preslice perCollision_emc = aod::emccluster::pmeventId; - // Preslice perCollision_phos = aod::phoscluster::pmeventId; + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_pcm = o2::aod::v0photonkf::pmeventId; + o2::framework::Preslice perCollision_emc = o2::aod::emccluster::pmeventId; + // o2::framework::Preslice perCollision_phos = o2::aod::phoscluster::pmeventId; - Preslice perCollision_electron = aod::emprimaryelectronda::pmeventId; - Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; + o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; MyEMH* emh1 = nullptr; MyEMH* emh2 = nullptr; std::vector used_photonIds_per_col; // @@ -534,7 +524,7 @@ struct TaggingPi0 { std::tuple key_bin = std::make_tuple(zbin, centbin, epbin, occbin); std::pair key_df_collision = std::make_pair(ndf, collision.globalIndex()); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); // PCM auto positrons_per_collision = positrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); // positrons auto electrons_per_collision = electrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); // electrons @@ -549,7 +539,7 @@ struct TaggingPi0 { fRegistry.fill(HIST("Photon/hPt"), v_gamma.Pt(), weight); fRegistry.fill(HIST("Photon/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); - for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { + for (const auto& [pos2, ele2] : combinations(o2::soa::CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; @@ -574,11 +564,11 @@ struct TaggingPi0 { std::pair tuple_tmp_id2 = std::make_pair(pos2.trackId(), ele2.trackId()); if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) { - emh1->AddTrackToEventPool(key_df_collision, EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); + emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); used_photonIds_per_col.emplace_back(g1.globalIndex()); } if (std::find(used_dileptonIds_per_col.begin(), used_dileptonIds_per_col.end(), tuple_tmp_id2) == used_dileptonIds_per_col.end()) { - emh2->AddTrackToEventPool(key_df_collision, EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M())); + emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M())); used_dileptonIds_per_col.emplace_back(tuple_tmp_id2); } ndiphoton++; @@ -588,7 +578,7 @@ struct TaggingPi0 { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); // PCM auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); // EMC or PHOS - for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(o2::soa::CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -599,11 +589,11 @@ struct TaggingPi0 { fRegistry.fill(HIST("Pair/same/hMvsPt"), v12.M(), v1.Pt(), weight); if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) { - emh1->AddTrackToEventPool(key_df_collision, EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); + emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); used_photonIds_per_col.emplace_back(g1.globalIndex()); } if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g2.globalIndex()) == used_photonIds_per_col.end()) { - emh2->AddTrackToEventPool(key_df_collision, EMTrack(g2.pt(), g2.eta(), g2.phi(), 0)); + emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g2.pt(), g2.eta(), g2.phi(), 0)); used_photonIds_per_col.emplace_back(g2.globalIndex()); } ndiphoton++; @@ -649,7 +639,7 @@ struct TaggingPi0 { 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) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { v2.SetM(g2.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; @@ -667,29 +657,29 @@ struct TaggingPi0 { } // end of collision loop } - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + o2::framework::expressions::Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + using FilteredMyCollisions = o2::soa::Filtered; int ndf = 0; void processAnalysis(FilteredMyCollisions const& collisions, Types const&... args) { // LOGF(info, "ndf = %d", ndf); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runPairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); @@ -699,24 +689,24 @@ struct TaggingPi0 { } PROCESS_SWITCH(TaggingPi0, processAnalysis, "process pair analysis", true); - using FilteredMyCollisionsWithJJMC = soa::Filtered; + using FilteredMyCollisionsWithJJMC = o2::soa::Filtered; void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, Types const&... args) { // LOGF(info, "ndf = %d", ndf); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runPairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index 9dda549dc79..17b92c44852 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -21,7 +21,6 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -// #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -50,7 +49,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include @@ -62,173 +61,164 @@ #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::photonmeson::photonpair; -using namespace o2::aod::pwgem::photonmeson::utils::mcutil; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; - -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithJJMC = soa::Join; +using MyCollisionsWithJJMC = o2::soa::Join; using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator; -using MyMCCollisions = soa::Join; +using MyMCCollisions = o2::soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyV0Photons = soa::Join; +using MyV0Photons = o2::soa::Join; using MyV0Photon = MyV0Photons::iterator; -using MyEMCClusters = soa::Join; +using MyEMCClusters = o2::soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -// using MyPHOSClusters = soa::Join; +// using MyPHOSClusters = o2::soa::Join; // using MyPHOSCluster = MyEMCClusters::iterator; -using MyMCV0Legs = soa::Join; +using MyMCV0Legs = o2::soa::Join; using MyMCV0Leg = MyMCV0Legs::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = o2::soa::Join; using MyMCElectron = MyMCElectrons::iterator; -template +template struct TaggingPi0MC { - 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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - Configurable fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"}; - Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + o2::framework::Configurable fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"}; + o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + o2::framework::ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; EMPhotonEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - 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"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time 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 cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; - Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; + o2::framework::Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; } eventcuts; V0PhotonCut fV0PhotonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "pcmcut_group"; - Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; - Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; - Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; - Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; - Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; - Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; - Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; - Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; - Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; - Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; - Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; - Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; - Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; - Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; - Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; - - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; - Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; - Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; + o2::framework::Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; + o2::framework::Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; + o2::framework::Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; + o2::framework::Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; + o2::framework::Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; + o2::framework::Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; + o2::framework::Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; + o2::framework::Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; + o2::framework::Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; + o2::framework::Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; + o2::framework::Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; + o2::framework::Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; + o2::framework::Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + o2::framework::Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; + o2::framework::Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; + + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; + o2::framework::Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; + o2::framework::Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; } pcmcuts; DalitzEECut fDileptonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dileptoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; - Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; } dileptoncuts; EMCPhotonCut fEMCCut; - struct : ConfigurableGroup { + struct : o2::framework::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"}; - 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"}; + o2::framework::Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; + o2::framework::Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; + o2::framework::Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + o2::framework::Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + o2::framework::Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + o2::framework::Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; } emccuts; // PHOSPhotonCut fPHOSCut; - // struct : ConfigurableGroup { + // struct : o2::framework::ConfigurableGroup { // std::string prefix = "phoscut_group"; - // Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; + // o2::framework::Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; // } phoscuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; static constexpr std::string_view parnames[2] = {"Pi0/", "Eta/"}; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; TF1* f1fd_k0s_to_pi0; - void init(InitContext&) + void init(o2::framework::InitContext&) { o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); addHistogrms(); @@ -296,26 +286,26 @@ struct TaggingPi0MC { void addHistogrms() { TString mggTitle = "ee#gamma"; - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - const AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; - const AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; + const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; + const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity - fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity - fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator + fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator - fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator - fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness - fRegistry.addClone("Pair/primary/", "Pair/fromHS/"); // only for completeness + fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", o2::framework::kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator + fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness + fRegistry.addClone("Pair/primary/", "Pair/fromHS/"); // only for completeness } void DefineEMEventCut() @@ -418,14 +408,14 @@ struct TaggingPi0MC { // fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); // } - SliceCache cache; - Preslice perCollision_pcm = aod::v0photonkf::pmeventId; - Preslice perCollision_emc = aod::emccluster::pmeventId; - // Preslice perCollision_phos = aod::phoscluster::pmeventId; + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_pcm = o2::aod::v0photonkf::pmeventId; + o2::framework::Preslice perCollision_emc = o2::aod::emccluster::pmeventId; + // o2::framework::Preslice perCollision_phos = o2::aod::phoscluster::pmeventId; - Preslice perCollision_electron = aod::emprimaryelectronda::pmeventId; - Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; + o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); template void runTruePairing(TCollisions const& collisions, @@ -460,7 +450,7 @@ struct TaggingPi0MC { fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, weight); // accepted fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, weight); // accepted - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto positrons_per_collision = positrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); auto electrons_per_collision = electrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); @@ -478,7 +468,7 @@ struct TaggingPi0MC { auto ele1 = g1.template negTrack_as(); auto pos1mc = pos1.template emmcparticle_as(); auto ele1mc = ele1.template emmcparticle_as(); - int photonid1 = FindCommonMotherFrom2Prongs(pos1mc, ele1mc, -11, 11, 22, mcparticles); + int photonid1 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(pos1mc, ele1mc, -11, 11, 22, mcparticles); if (photonid1 < 0) { continue; } @@ -498,8 +488,8 @@ struct TaggingPi0MC { fRegistry.fill(HIST("Photon/fromPi0/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); } } - } else if (IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles) > 0) { - int motherid_strhad = IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles); + } else if (o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles) > 0) { + int motherid_strhad = o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles); auto str_had = mcparticles.iteratorAt(motherid_strhad); float weight = 1.f; if (std::abs(str_had.pdgCode()) == 310 && f1fd_k0s_to_pi0 != nullptr) { @@ -512,8 +502,8 @@ struct TaggingPi0MC { fRegistry.fill(HIST("Photon/fromHS/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); } - for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { // ULS - if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. + for (const auto& [pos2, ele2] : combinations(o2::soa::CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { // ULS + if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; } if (pos1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) { @@ -530,7 +520,7 @@ struct TaggingPi0MC { auto pos2mc = mcparticles.iteratorAt(pos2.emmcparticleId()); auto ele2mc = mcparticles.iteratorAt(ele2.emmcparticleId()); - int pi0id = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); + int pi0id = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); if (pi0id < 0) { continue; } @@ -544,8 +534,8 @@ struct TaggingPi0MC { if (pi0mc.isPhysicalPrimary() || pi0mc.producedByGenerator()) { fRegistry.fill(HIST("Pair/primary/hMvsPt"), veeg.M(), v_gamma.Pt(), weight); - } else if (IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles) > 0) { - int motherid_strhad = IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles); + } else if (o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles) > 0) { + int motherid_strhad = o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles); auto str_had = mcparticles.iteratorAt(motherid_strhad); float weight = 1.f; if (std::abs(str_had.pdgCode()) == 310 && f1fd_k0s_to_pi0 != nullptr) { @@ -562,7 +552,7 @@ struct TaggingPi0MC { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); - for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(o2::soa::CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -578,27 +568,27 @@ struct TaggingPi0MC { } // end of collision loop } - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + o2::framework::expressions::Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + using FilteredMyCollisions = o2::soa::Filtered; - void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, Types const&... args) + void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) { - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runTruePairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, mccollisions, mcparticles); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); @@ -607,23 +597,23 @@ struct TaggingPi0MC { } PROCESS_SWITCH(TaggingPi0MC, processAnalysis, "process pair analysis", true); - using FilteredMyCollisionsWithJJMC = soa::Filtered; - void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, Types const&... args) + using FilteredMyCollisionsWithJJMC = o2::soa::Filtered; + void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) { - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runTruePairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, mccollisions, mcparticles); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h index 99c5afdc61b..af9acc7003a 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h @@ -22,6 +22,9 @@ #include +#include +#include + enum CentType : uint8_t { CentFT0M = 0, CentFT0A = 1, diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx index 0511e72d0c7..e38aed371f9 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx @@ -15,9 +15,12 @@ #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" + #include +#include + #include #include diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.h b/PWGEM/PhotonMeson/Core/V0PhotonCut.h index 664981df21e..7ea0be9beb3 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.h @@ -26,20 +26,21 @@ #include #include #include +#include +#include #include // IWYU pragma: keep -#include -#include -#include +#include #include -#include +#include #include #include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/EventTables.h b/PWGEM/PhotonMeson/DataModel/EventTables.h index d902e82562a..05e1541493b 100644 --- a/PWGEM/PhotonMeson/DataModel/EventTables.h +++ b/PWGEM/PhotonMeson/DataModel/EventTables.h @@ -16,7 +16,6 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" -#include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h b/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h index 15e66f8bd96..79219f35fa4 100644 --- a/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h +++ b/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h @@ -21,8 +21,7 @@ #include #include - -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/bcWiseTables.h b/PWGEM/PhotonMeson/DataModel/bcWiseTables.h index efd3f9a2007..4f64bf08fb0 100644 --- a/PWGEM/PhotonMeson/DataModel/bcWiseTables.h +++ b/PWGEM/PhotonMeson/DataModel/bcWiseTables.h @@ -19,8 +19,10 @@ #ifndef PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ #define PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include +#include +#include #include namespace o2::aod diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index afb88c6694a..9ef4b45727b 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -254,7 +254,7 @@ DECLARE_SOA_COLUMN(NgPCM, ngpcm, int); DECLARE_SOA_COLUMN(Weight, weight, float); //! Weight of the event (e.g. for JJ MCs). Set to 1 for data and non-weighted MCs. } // namespace emevent -DECLARE_SOA_TABLE(EMEventsNgPCM, "AOD", "EMEVENTNGPCM", emevent::NgPCM); // joinable to EMEvents or aod::Collisions +DECLARE_SOA_TABLE(EMEventsNgPCM, "AOD", "EMEVENTNGPCM", emevent::NgPCM); // joinable to EMEvents or o2::aod::Collisions using EMEventNgPCM = EMEventsNgPCM::iterator; DECLARE_SOA_TABLE(EMEventsWeight, "AOD", "EMEVENTWEIGHT", //! table contanint the weight for eache event (for JJ MCs), joinable to EMEvents diff --git a/PWGEM/PhotonMeson/DataModel/mcV0Tables.h b/PWGEM/PhotonMeson/DataModel/mcV0Tables.h index 16e8ee911ba..95b560a7501 100644 --- a/PWGEM/PhotonMeson/DataModel/mcV0Tables.h +++ b/PWGEM/PhotonMeson/DataModel/mcV0Tables.h @@ -15,7 +15,9 @@ #ifndef PWGEM_PHOTONMESON_DATAMODEL_MCV0TABLES_H_ #define PWGEM_PHOTONMESON_DATAMODEL_MCV0TABLES_H_ -#include "Framework/ASoA.h" +#include + +#include namespace o2::aod { diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx index 9147873fb71..cd159115d4f 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx @@ -16,7 +16,7 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx index bdfa1aac27c..9c7027076de 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx @@ -11,9 +11,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx index 102907e9547..d6d188abb96 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx @@ -11,9 +11,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx index 25230a2512e..c3b82a8b204 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx @@ -11,9 +11,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx index 685f5e886fa..0bfbe804e31 100644 --- a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx @@ -20,16 +20,32 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include "Common/DataModel/EventSelection.h" + #include -#include #include +#include #include +#include +#include +#include +#include #include -#include +#include +#include #include +#include + +#include +#include +#include +#include +#include +#include #include +#include #include using namespace o2; diff --git a/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx b/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx index dbc8c80c7d2..75838125d69 100644 --- a/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx +++ b/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx @@ -18,20 +18,39 @@ #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGJE/DataModel/EMCALClusters.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include +#include #include #include -#include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include +#include +#include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx index d9365251277..01965fc08ae 100644 --- a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx @@ -25,9 +25,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Qvectors.h" -#include -#include -#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx index 138a190f7cd..70457782ae6 100644 --- a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx @@ -22,20 +22,30 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/TrackSelectionTables.h" #include #include #include #include #include +#include #include #include #include +#include #include +#include +#include +#include +#include #include #include #include +#include +#include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx index 6d235b0db0c..a371d109e3e 100644 --- a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx +++ b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx @@ -17,7 +17,8 @@ #include "PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h" -#include "Framework/runDataProcessing.h" +#include +#include using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx b/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx index 3e8d6cb146f..57a551a40c1 100644 --- a/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx +++ b/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx @@ -30,7 +30,8 @@ #include #include -#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 9b2f9e0c411..1199b2415a2 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -54,7 +54,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx b/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx index b67aeb53d41..70a96f7ba8a 100644 --- a/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx +++ b/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx @@ -17,8 +17,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" -#include +#include #include +#include #include using namespace o2; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx index 0d7afd0a63e..f522e113386 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx @@ -16,18 +16,28 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/DataModel/PIDResponseTPC.h" + #include #include #include #include -#include +#include #include +#include #include +#include +#include +#include +#include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx index 0ebf6f374c8..c0b14051d74 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx @@ -22,38 +22,48 @@ // ************************** // runme like: o2-analysis-trackselection -b --aod-file ${sourceFile} --aod-writer-json ${writerFile} | o2-analysis-timestamp -b | o2-analysis-trackextension -b | o2-analysis-lf-lambdakzerobuilder -b | o2-analysis-pid-tpc -b | o2-analysis-em-skimmermc -b - -#include -#include -#include -#include - // todo: remove reduantant information in GammaConversionsInfoTrue + #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -// includes for the R recalculation -#include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Tools/KFparticle/KFUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "ReconstructionDataFormats/HelixHelper.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/Vector4D.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx index 509a949b0dd..e44600aafaa 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx @@ -20,11 +20,15 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" -#include "TVector3.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx index ef825ca5578..0d50b530c08 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx @@ -13,13 +13,22 @@ /// dependencies: o2-analysis-calo-cluster /// \author daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/CaloClusters.h" -#include "PHOSBase/Geometry.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/DataModel/CaloClusters.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx index cb3452dc177..5efa2817617 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx @@ -14,33 +14,46 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/TrackSelection.h" -#include "Common/Core/trackUtilities.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" - -#include +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include +#include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; -using namespace o2::pwgem::photonmeson; using MyCollisions = soa::Join; using MyCollisionsWithSWT = soa::Join; diff --git a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx index 5002de0a133..3caa5e5b5aa 100644 --- a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx +++ b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx @@ -24,19 +24,34 @@ #include #include #include +#include #include #include +#include #include +#include #include +#include +#include +#include #include #include #include #include +#include #include +#include +#include +#include +#include #include +#include +#include +#include #include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx b/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx index 961f8b0dfe7..cd54adedfb3 100644 --- a/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx +++ b/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx b/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx index 1607c30b94a..a8277d122db 100644 --- a/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx +++ b/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx b/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx index 4e345a26c02..a92e1888049 100644 --- a/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx +++ b/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx @@ -17,9 +17,11 @@ /// #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseITS.h" @@ -27,22 +29,30 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" -#include "TMath.h" -#include "TRandom3.h" - -#include "fairlogger/Logger.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include + +#include +#include +#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx index 0ee3d8e2f3e..2ecfd14711d 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx @@ -37,7 +37,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx index 7e5d8d80fc6..463bc9045a8 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx @@ -22,6 +22,8 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" + +#include "Common/Core/RecoDecay.h" // #include "PWGEM/Dilepton/Utils/MCUtilities.h" @@ -35,10 +37,9 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx b/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx index 556aa96bd6c..587546ff802 100644 --- a/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx @@ -19,28 +19,35 @@ #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" -#include "TMath.h" -#include "TRandom3.h" - -#include "fairlogger/Logger.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include +#include +#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx index aa9afe80489..810be128a00 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx @@ -18,7 +18,6 @@ #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx index ac3f50b594a..818eb101285 100644 --- a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx +++ b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx @@ -43,6 +43,7 @@ #include #include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx index ccdc4184568..89a84ccd2df 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx @@ -14,16 +14,19 @@ // This code loops over photons and makes pairs for neutral mesons analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" #include "PWGEM/PhotonMeson/Core/TaggingPi0MC.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" + +#include +#include using namespace o2; using namespace o2::aod; +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-mc-pcmdalitzee"}), + adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-mc-pcmdalitzee"}), }; } diff --git a/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx index 2292faef120..4b94c5b4f29 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx @@ -14,16 +14,19 @@ // This code loops over photons and makes pairs for neutral mesons analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/TaggingPi0.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" -using namespace o2; -using namespace o2::aod; +#include +#include + +using namespace o2::framework; +using namespace o2::aod::pwgem::photonmeson::photonpair; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-pcmdalitzee"}), + adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-pcmdalitzee"}), }; } diff --git a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx index 8d0b0ee7b3a..12b03c22cf4 100644 --- a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx +++ b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx @@ -48,17 +48,18 @@ #include #include -#include -#include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include +#include + #include #include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx b/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx index 22f05b2bec4..d7046d8832f 100644 --- a/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx +++ b/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx @@ -46,6 +46,7 @@ #include #include +using namespace std; using namespace o2; using namespace o2::framework; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index e42b30e99cc..c3f41633d9b 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -21,22 +21,40 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include +#include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index 7a32eddf6ab..084b866da50 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -21,30 +21,46 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" -#include "PWGEM/PhotonMeson/Utils/MCUtilities.h" - -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include +#include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; -using namespace o2::aod::pwgem::photonmeson::utils::mcutil; using namespace o2::aod::pwgem::dilepton::utils::mcutil; using MyCollisions = soa::Join; diff --git a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx index 93e89d45c54..1bc980ed4bc 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx @@ -19,16 +19,28 @@ #include #include +#include +#include +#include #include +#include +#include #include +#include +#include #include -#include -#include -#include // IWYU pragma: keep +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include +#include #include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx index 0f1d2103db5..ae6192a9dbb 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx index ae2ad0c548f..94ad627191a 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx @@ -20,10 +20,11 @@ #include #include +#include +#include +#include #include -#include - #include using namespace o2; diff --git a/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx b/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx index 889858359ed..fc390c4ce65 100644 --- a/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx +++ b/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx @@ -16,13 +16,16 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt /// -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "TDatabasePDG.h" +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index 7435451a3a6..9530c9401da 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -14,6 +14,7 @@ /// \author Daiki Sekihata, daiki.sekihata@cern.ch #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -22,22 +23,26 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include #include #include #include +#include +#include +#include #include #include #include #include #include +#include #include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index c7d269973be..264808e451a 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -15,6 +15,7 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -24,24 +25,29 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include #include #include #include +#include +#include +#include #include #include #include #include #include +#include #include #include #include +#include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/phosQC.cxx b/PWGEM/PhotonMeson/Tasks/phosQC.cxx index f98c5fcfba2..56c7adb50b6 100644 --- a/PWGEM/PhotonMeson/Tasks/phosQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/phosQC.cxx @@ -22,12 +22,12 @@ #include "Common/CCDB/TriggerAliases.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include #include +#include #include #include +#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index 7036c3a30de..a1ddbb8f3d7 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -42,7 +42,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 70285fbf054..36fc0d98ca9 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -16,7 +16,6 @@ #include "PWGEM/Dilepton/Utils/EMTrack.h" #include "PWGEM/Dilepton/Utils/EventMixingHandler.h" -#include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" @@ -40,9 +39,9 @@ #include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h) #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx index 996ce6abdda..4072a74e096 100644 --- a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx +++ b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx @@ -44,7 +44,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index ca6e5a02503..a6a6375cb4c 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -50,7 +50,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h index cc3f938e17d..dbaeebaf1a7 100644 --- a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h +++ b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h @@ -26,6 +26,7 @@ #include #include +#include namespace o2::aod::pwgem::photonmeson::utils::clusterhistogram { diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h index 249e56d516b..dd4c3ca4ac6 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -19,6 +19,7 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" +#include #include #include diff --git a/PWGEM/PhotonMeson/Utils/HNMUtilities.h b/PWGEM/PhotonMeson/Utils/HNMUtilities.h index 2df0680a76c..956529610a0 100644 --- a/PWGEM/PhotonMeson/Utils/HNMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/HNMUtilities.h @@ -23,9 +23,10 @@ #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include +#include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index 03c3dcc3f89..6eb784df2cf 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -18,6 +18,7 @@ #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include #include #include diff --git a/PWGEM/PhotonMeson/Utils/PairUtilities.h b/PWGEM/PhotonMeson/Utils/PairUtilities.h index 8110239c0ce..8a1ff20de88 100644 --- a/PWGEM/PhotonMeson/Utils/PairUtilities.h +++ b/PWGEM/PhotonMeson/Utils/PairUtilities.h @@ -15,7 +15,7 @@ #ifndef PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_ #define PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_ -#include +#include "Common/Core/RecoDecay.h" #include #include diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index 2eb11525278..0ef33364c80 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -19,28 +19,26 @@ #include #include -using namespace o2::framework; +o2::framework::AxisSpec const gAxis_zColl{800, -50.f, 50.f}; +o2::framework::AxisSpec const gAxis_pT{800, 0.f, 25.f}; +o2::framework::AxisSpec const gAxis_pT_armenteros{400, 0.f, 1.f}; +o2::framework::AxisSpec const gAxis_pT2d{400, 0.f, 25.f}; +o2::framework::AxisSpec const gAxis_eta{800, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; +o2::framework::AxisSpec const gAxis_eta2d{400, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; +o2::framework::AxisSpec const gAxis_phi{800, 0.f, o2::constants::math::TwoPI}; +o2::framework::AxisSpec const gAxis_r{800, 0.f, 200.f}; +o2::framework::AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; +o2::framework::AxisSpec const gAxis_dr{200, -100.f, 100.f}; +o2::framework::AxisSpec const gAxis_r2d{400, 0.f, 250.f}; +o2::framework::AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; +o2::framework::AxisSpec const gAxis_TPCdEdxSig{401, -10.025f, 10.025f}; +o2::framework::AxisSpec const gAxis_radRes{800, -o2::constants::math::PI, o2::constants::math::PI}; +o2::framework::AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; +o2::framework::AxisSpec const gAxis_chi2{501, -1.f, 500.f}; +o2::framework::AxisSpec gAxis_pT_log{800, 0.01f, 25.f}; -AxisSpec const gAxis_zColl{800, -50.f, 50.f}; -AxisSpec const gAxis_pT{800, 0.f, 25.f}; -AxisSpec const gAxis_pT_armenteros{400, 0.f, 1.f}; -AxisSpec const gAxis_pT2d{400, 0.f, 25.f}; -AxisSpec const gAxis_eta{800, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; -AxisSpec const gAxis_eta2d{400, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; -AxisSpec const gAxis_phi{800, 0.f, o2::constants::math::TwoPI}; -AxisSpec const gAxis_r{800, 0.f, 200.f}; -AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; -AxisSpec const gAxis_dr{200, -100.f, 100.f}; -AxisSpec const gAxis_r2d{400, 0.f, 250.f}; -AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; -AxisSpec const gAxis_TPCdEdxSig{401, -10.025f, 10.025f}; -AxisSpec const gAxis_radRes{800, -o2::constants::math::PI, o2::constants::math::PI}; -AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; -AxisSpec const gAxis_chi2{501, -1.f, 500.f}; -AxisSpec gAxis_pT_log{800, 0.01f, 25.f}; - -HistogramSpec const gHistoSpec_hCollisionZ_all_MCTrue{"hCollisionZ_all_MCTrue", "hCollisionZ_all_MCTrue;z (cm);counts", {HistType::kTH1F, {gAxis_zColl}}}; -HistogramSpec const gHistoSpec_hCollisionZ_MCTrue{"hCollisionZ_MCTrue", "hCollisionZ_MCTrue;z (cm);counts", {HistType::kTH1F, {gAxis_zColl}}}; -HistogramSpec const gHistoSpec_hCollisionZ_MCRec{"hCollisionZ_MCRec", "hCollisionZ_MCRec;z (cm);counts", {HistType::kTH1F, {gAxis_zColl}}}; +o2::framework::HistogramSpec const gHistoSpec_hCollisionZ_all_MCTrue{"hCollisionZ_all_MCTrue", "hCollisionZ_all_MCTrue;z (cm);counts", {o2::framework::HistType::kTH1F, {gAxis_zColl}}}; +o2::framework::HistogramSpec const gHistoSpec_hCollisionZ_MCTrue{"hCollisionZ_MCTrue", "hCollisionZ_MCTrue;z (cm);counts", {o2::framework::HistType::kTH1F, {gAxis_zColl}}}; +o2::framework::HistogramSpec const gHistoSpec_hCollisionZ_MCRec{"hCollisionZ_MCRec", "hCollisionZ_MCRec;z (cm);counts", {o2::framework::HistType::kTH1F, {gAxis_zColl}}}; #endif // PWGEM_PHOTONMESON_UTILS_GAMMACONVDEFINITIONS_H_ diff --git a/PWGEM/Tasks/phosAlign.cxx b/PWGEM/Tasks/phosAlign.cxx index 5e5856518af..4345280188c 100644 --- a/PWGEM/Tasks/phosAlign.cxx +++ b/PWGEM/Tasks/phosAlign.cxx @@ -9,33 +9,37 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" -#include "ReconstructionDataFormats/TrackParametrization.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include +#include +#include #include -#include #include #include diff --git a/PWGEM/Tasks/phosCalibration.cxx b/PWGEM/Tasks/phosCalibration.cxx index 1116f47f0f2..5e62addf7dc 100644 --- a/PWGEM/Tasks/phosCalibration.cxx +++ b/PWGEM/Tasks/phosCalibration.cxx @@ -9,35 +9,42 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + #include +#include #include -#include #include #include -#include "TFile.h" -#include "TGrid.h" -#include "TLorentzVector.h" - -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/CaloClusters.h" -#include "DataFormatsPHOS/Cell.h" -#include "DataFormatsPHOS/Cluster.h" -#include "DataFormatsPHOS/TriggerRecord.h" -#include "DataFormatsPHOS/BadChannelsMap.h" -#include "DataFormatsPHOS/CalibParams.h" -#include "PHOSBase/Geometry.h" -#include "PHOSReconstruction/Clusterer.h" - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" -#include "CommonUtils/NameConf.h" -#include "CCDB/BasicCCDBManager.h" - -#include "CommonDataFormat/InteractionRecord.h" using namespace o2; using namespace o2::aod::evsel; diff --git a/PWGEM/Tasks/phosCellQA.cxx b/PWGEM/Tasks/phosCellQA.cxx index 710244c1a6d..178c812750b 100644 --- a/PWGEM/Tasks/phosCellQA.cxx +++ b/PWGEM/Tasks/phosCellQA.cxx @@ -9,26 +9,30 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include +#include #include -#include -#include -#include #include - -#include "CCDB/BasicCCDBManager.h" -#include "Common/DataModel/EventSelection.h" -#include "DataFormatsPHOS/Cell.h" -#include "DataFormatsPHOS/CalibParams.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" - -#include "PHOSBase/Geometry.h" -#include "CommonDataFormat/InteractionRecord.h" +#include /// \struct PHOS QA /// \brief Monitoring task for PHOS related quantities diff --git a/PWGEM/Tasks/phosCluQA.cxx b/PWGEM/Tasks/phosCluQA.cxx index e563dc3aebe..62d171a7690 100644 --- a/PWGEM/Tasks/phosCluQA.cxx +++ b/PWGEM/Tasks/phosCluQA.cxx @@ -9,26 +9,38 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include #include +#include +#include #include #include #include #include -#include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/EventSelection.h" - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" -#include "CommonUtils/NameConf.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" - -#include "PHOSBase/Geometry.h" -#include "CommonDataFormat/InteractionRecord.h" /// \struct PHOS QA /// \brief Monitoring task for PHOS related quantities diff --git a/PWGEM/Tasks/phosElId.cxx b/PWGEM/Tasks/phosElId.cxx index 062bbb6271b..0334b4084e7 100644 --- a/PWGEM/Tasks/phosElId.cxx +++ b/PWGEM/Tasks/phosElId.cxx @@ -16,8 +16,8 @@ /// \author Yeghishe Hambardzumyan, MIPT /// \since Apr, 2024 -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" #include "Common/DataModel/Centrality.h" @@ -28,27 +28,33 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" -#include "ReconstructionDataFormats/TrackParametrization.h" - -#include "TF1.h" -#include "TPDGCode.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include #include #include diff --git a/PWGEM/Tasks/phosNbar.cxx b/PWGEM/Tasks/phosNbar.cxx index 51610ec9639..56447345bc0 100644 --- a/PWGEM/Tasks/phosNbar.cxx +++ b/PWGEM/Tasks/phosNbar.cxx @@ -8,30 +8,47 @@ // 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 "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonUtils/NameConf.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" -#include "ReconstructionDataFormats/Track.h" - -#include "TRandom.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include /// \struct phosNbar /// \brief account Nbar who's clusters appeared within PHOS diff --git a/PWGEM/Tasks/phosNonlin.cxx b/PWGEM/Tasks/phosNonlin.cxx index dd3ea3003fb..71abfb45208 100644 --- a/PWGEM/Tasks/phosNonlin.cxx +++ b/PWGEM/Tasks/phosNonlin.cxx @@ -14,31 +14,32 @@ /// \author Dmitri Peresunko /// +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" #include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include +#include #include -#include +#include #include #include #include diff --git a/PWGEM/Tasks/phosPi0.cxx b/PWGEM/Tasks/phosPi0.cxx index 74536648380..4ba0bc81b40 100644 --- a/PWGEM/Tasks/phosPi0.cxx +++ b/PWGEM/Tasks/phosPi0.cxx @@ -14,31 +14,35 @@ /// \author Dmitri Peresunko /// +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" #include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include #include +#include #include -#include +#include #include #include #include diff --git a/PWGEM/Tasks/phosTrigQA.cxx b/PWGEM/Tasks/phosTrigQA.cxx index b0b0949cfb5..6cea670f118 100644 --- a/PWGEM/Tasks/phosTrigQA.cxx +++ b/PWGEM/Tasks/phosTrigQA.cxx @@ -9,28 +9,38 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.h" +#include "EventFiltering/filterTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include #include +#include +#include #include #include #include #include -#include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/EventSelection.h" - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "CommonUtils/NameConf.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" - -#include "PHOSBase/Geometry.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "EventFiltering/filterTables.h" /// \struct PHOS trigger QA /// \brief Monitoring task for PHOS related quantities From 5b4e67f5301f534a96e6615ff4c59a8459e0844d Mon Sep 17 00:00:00 2001 From: ariedel-cern <85537041+ariedel-cern@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:48:06 +0200 Subject: [PATCH 137/282] [PWGCF] Add dalitz plot for track-v0 analysis in femto framework (#15605) --- PWGCF/Femto/Core/femtoUtils.h | 4 +- PWGCF/Femto/Core/pairBuilder.h | 21 ++- PWGCF/Femto/Core/pairHistManager.h | 228 +++++++++++++++++--------- PWGCF/Femto/Core/pairProcessHelpers.h | 20 +-- PWGCF/Femto/Core/trackHistManager.h | 2 +- PWGCF/Femto/Core/tripletHistManager.h | 6 +- 6 files changed, 181 insertions(+), 100 deletions(-) diff --git a/PWGCF/Femto/Core/femtoUtils.h b/PWGCF/Femto/Core/femtoUtils.h index 000850f3be9..1da7fde8635 100644 --- a/PWGCF/Femto/Core/femtoUtils.h +++ b/PWGCF/Femto/Core/femtoUtils.h @@ -63,7 +63,7 @@ float itsSignal(T const& track) return static_cast(signal); }; -inline double getMass(int pdgCode) +inline double getPdgMass(int pdgCode) { // use this function instead of TDatabasePDG to return masses defined in the PhysicsConstants.h header // this approach saves a lot of memory and important partilces like deuteron are missing in TDatabasePDG anyway @@ -119,7 +119,7 @@ inline double getMass(int pdgCode) mass = o2::constants::physics::MassOmegaMinus; break; default: - LOG(fatal) << "PDG code is not suppored"; + LOG(warn) << "PDG code is not suppored. Return 0..."; } return mass; } diff --git a/PWGCF/Femto/Core/pairBuilder.h b/PWGCF/Femto/Core/pairBuilder.h index 0a44ba639fc..af6e9aa51bb 100644 --- a/PWGCF/Femto/Core/pairBuilder.h +++ b/PWGCF/Femto/Core/pairBuilder.h @@ -34,6 +34,8 @@ #include #include +#include + #include #include #include @@ -595,13 +597,28 @@ class PairTrackV0Builder mTrackCleaner.init(confTrackCleaner); mV0Cleaner.init(confV0Cleaner); + int pdgCodePosDau = 0; + int pdgCodeNegDau = 0; + if (modes::isEqual(v0Type, modes::V0::kK0short)) { + pdgCodeNegDau = kPiPlus; + pdgCodeNegDau = kPiMinus; + } else if (modes::isEqual(v0Type, modes::V0::kLambda) || modes::isEqual(v0Type, modes::V0::kAntiLambda)) { + if (confV0Selection.sign.value > 0) { + pdgCodeNegDau = kProton; + pdgCodeNegDau = kPiMinus; + } else { + pdgCodeNegDau = kProtonBar; + pdgCodeNegDau = kPiPlus; + } + } + mPairHistManagerSe.template init(registry, pairHistSpec, confPairBinning, confPairCuts); - mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, confV0Selection.pdgCodeAbs.value); + mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, 0, 0, confV0Selection.pdgCodeAbs.value, pdgCodePosDau, pdgCodeNegDau); mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, 1); mCprSe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); mPairHistManagerMe.template init(registry, pairHistSpec, confPairBinning, confPairCuts); - mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, confV0Selection.pdgCodeAbs.value); + mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, 0, 0, confV0Selection.pdgCodeAbs.value, pdgCodePosDau, pdgCodeNegDau); mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1); mCprMe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); mPc.template init(confPairCuts); diff --git a/PWGCF/Femto/Core/pairHistManager.h b/PWGCF/Femto/Core/pairHistManager.h index 2e431427f9c..31efc4779a4 100644 --- a/PWGCF/Femto/Core/pairHistManager.h +++ b/PWGCF/Femto/Core/pairHistManager.h @@ -77,6 +77,8 @@ enum PairHist { kKstarVsMtVsMass1VsMass2VsPt1VsPt2, kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, + // dalitz plots + kDalitz, // between a track and pos/neg daughter of another particle // mc kTrueKstarVsKstar, kTrueKtVsKt, @@ -108,6 +110,7 @@ struct ConfMixing : o2::framework::ConfigurableGroup { struct ConfPairBinning : o2::framework::ConfigurableGroup { std::string prefix = std::string("PairBinning"); + o2::framework::Configurable usePdgMass{"usePdgMass", true, "Use PDF masses for 4-vectors. If false, use reconstructed mass (if available)"}; o2::framework::Configurable plot1D{"plot1D", true, "Enable 1D histograms"}; o2::framework::Configurable plot2D{"plot2D", true, "Enable 2D histograms"}; o2::framework::Configurable plotKstarVsMtVsMult{"plotKstarVsMtVsMult", false, "Enable 3D histogram (Kstar Vs Mt Vs Mult)"}; @@ -121,6 +124,7 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup { o2::framework::Configurable plotKstarVsMtVsMass1VsMass2VsPt1VsPt2{"plotKstarVsMtVsMass1VsMass2VsPt1VsPt2", false, "Enable 6D histogram (Kstar Vs Mt Vs Pt1 Vs Pt2 Vs Mass1 Vs Mass2)"}; o2::framework::Configurable plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult{"plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult", false, "Enable 7D histogram (Kstar Vs Mt Vs Pt1 Vs Pt2 Vs Mass1 Vs Mass2 Vs Mult)"}; o2::framework::Configurable plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent{"plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent", false, "Enable 8D histogram (Kstar Vs Mt Vs Pt1 Vs Pt2 Vs Mass1 Vs Mass2 Vs Mult Vs Cent)"}; + o2::framework::Configurable plotDalitz{"plotDalitz", false, "Enable dalitz plot"}; o2::framework::ConfigurableAxis kstar{"kstar", {{600, 0, 6}}, "kstar"}; o2::framework::ConfigurableAxis kt{"kt", {{600, 0, 6}}, "kt"}; o2::framework::ConfigurableAxis mt{"mt", {{500, 0.8, 5.8}}, "mt"}; @@ -130,6 +134,9 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis pt2{"pt2", {{100, 0, 6}}, "Pt binning for particle 2"}; o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter, otherwise PDG mass)"}; o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis dalitzMtot{"dalitzMtot", {{100, 0, 10}}, "Total invariant mass squared binning in darlitz plot"}; + o2::framework::ConfigurableAxis dalitzM12{"dalitzM12", {{100, 0, 10}}, "Mass12 binning of darlitz plot"}; + o2::framework::ConfigurableAxis dalitzM13{"dalitzM13", {{100, 0, 10}}, "Mass13 binning of darlitz plot"}; o2::framework::Configurable transverseMassType{"transverseMassType", static_cast(modes::TransverseMassType::kAveragePdgMass), "Type of transverse mass (0-> Average Pdg Mass, 1-> Reduced Pdg Mass, 2-> Mt from combined 4 vector)"}; }; @@ -170,20 +177,21 @@ constexpr std::array, kPairHistogramLast> {kKstarVsMass2, o2::framework::kTH2F, "hKstarVsMass2", "k* vs m_{2}; k* (GeV/#it{c}); m_{2} (GeV/#it{c}^{2})"}, {kMass1VsMass2, o2::framework::kTH2F, "hMass1VsMass2", "m_{1} vs m_{2}; m_{1} (GeV/#it{c}^{2}); m_{2} (GeV/#it{c}^{2})"}, // n-D - {kKstarVsMtVsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMult", "k* vs m_{T} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity"}, - {kKstarVsMtVsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMultVsCent", "k* vs m_{T} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity; Centrality (%)"}, + {kKstarVsMtVsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMult", "k* vs m_{T} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity;"}, + {kKstarVsMtVsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMultVsCent", "k* vs m_{T} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity; Centrality (%);"}, // n-D with pt - {kKstarVsMtVsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2", "k* vs m_{T} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c})"}, - {kKstarVsMtVsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMult", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity"}, - {kKstarVsMtVsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality"}, + {kKstarVsMtVsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2", "k* vs m_{T} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c});"}, + {kKstarVsMtVsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMult", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity;"}, + {kKstarVsMtVsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality;"}, // n-D with mass - {kKstarVsMtVsMass1VsMass2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2", "k* vs m_{T} vs m_{1} vs m_{2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2})"}, - {kKstarVsMtVsMass1VsMass2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity"}, - {kKstarVsMtVsMass1VsMass2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity; Centrality (%)"}, + {kKstarVsMtVsMass1VsMass2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2", "k* vs m_{T} vs m_{1} vs m_{2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2});"}, + {kKstarVsMtVsMass1VsMass2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity;"}, + {kKstarVsMtVsMass1VsMass2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity; Centrality (%);"}, // n-D with pt and mass - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c})"}, - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity"}, - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality (%)"}, + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c});"}, + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity;"}, + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality (%);"}, + {kDalitz, o2::framework::kTHnSparseF, "hDalitz", "Dalitz plot; k* (GeV/#it{c}); m^{2}_{123} (GeV/#it{c}^{2})^{2}; m^{2}_{12} (GeV/#it{c}^{2})^{2}; m^{2}_{13} (GeV/#it{c}^{2})^{2};"}, {kTrueKstarVsKstar, o2::framework::kTH2F, "hTrueKstarVsKstar", "k*_{True} vs k*; k*_{True} (GeV/#it{c}); k* (GeV/#it{c})"}, {kTrueKtVsKt, o2::framework::kTH2F, "hTrueKtVsKt", "k_{T,True} vs k_{T}; k_{T,True} (GeV/#it{c}); k_{T} (GeV/#it{c})"}, {kTrueMtVsMt, o2::framework::kTH2F, "hTrueMtVsMt", "m_{T,True} vs m_{T}; m_{T,True} (GeV/#it{c}^{2}); m_{T} (GeV/#it{c}^{2})"}, @@ -191,35 +199,36 @@ constexpr std::array, kPairHistogramLast> {kTrueCentVsCent, o2::framework::kTH2F, "hTrueCentVsCent", "Centrality_{True} vs Centrality; Centrality_{True} (%); Centrality (%)"}, }}; -#define PAIR_HIST_ANALYSIS_MAP(conf) \ - {kKstar, {conf.kstar}}, \ - {kKt, {conf.kt}}, \ - {kMt, {conf.mt}}, \ - {kPt1VsPt2, {conf.pt1, conf.pt2}}, \ - {kPt1VsKstar, {conf.pt1, conf.kstar}}, \ - {kPt2VsKstar, {conf.pt2, conf.kstar}}, \ - {kPt1VsKt, {conf.pt1, conf.kt}}, \ - {kPt2VsKt, {conf.pt2, conf.kt}}, \ - {kPt1VsMt, {conf.pt1, conf.mt}}, \ - {kPt2VsMt, {conf.pt2, conf.mt}}, \ - {kKstarVsKt, {conf.kstar, conf.kt}}, \ - {kKstarVsMt, {conf.kstar, conf.mt}}, \ - {kKstarVsMult, {conf.kstar, conf.multiplicity}}, \ - {kKstarVsCent, {conf.kstar, conf.centrality}}, \ - {kKstarVsMass1, {conf.kstar, conf.mass1}}, \ - {kKstarVsMass2, {conf.kstar, conf.mass2}}, \ - {kMass1VsMass2, {conf.mass1, conf.mass2}}, \ - {kKstarVsMtVsMult, {conf.kstar, conf.mt, conf.multiplicity}}, \ - {kKstarVsMtVsMultVsCent, {conf.kstar, conf.mt, conf.multiplicity, conf.centrality}}, \ - {kKstarVsMtVsPt1VsPt2, {conf.kstar, conf.mt, conf.pt1, conf.pt2}}, \ - {kKstarVsMtVsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity}}, \ - {kKstarVsMtVsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, \ - {kKstarVsMtVsMass1VsMass2, {conf.kstar, conf.mt, conf.mass1, conf.mass2}}, \ - {kKstarVsMtVsMass1VsMass2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity}}, \ - {kKstarVsMtVsMass1VsMass2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity, conf.centrality}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, +#define PAIR_HIST_ANALYSIS_MAP(conf) \ + {kKstar, {conf.kstar}}, \ + {kKt, {conf.kt}}, \ + {kMt, {conf.mt}}, \ + {kPt1VsPt2, {conf.pt1, conf.pt2}}, \ + {kPt1VsKstar, {conf.pt1, conf.kstar}}, \ + {kPt2VsKstar, {conf.pt2, conf.kstar}}, \ + {kPt1VsKt, {conf.pt1, conf.kt}}, \ + {kPt2VsKt, {conf.pt2, conf.kt}}, \ + {kPt1VsMt, {conf.pt1, conf.mt}}, \ + {kPt2VsMt, {conf.pt2, conf.mt}}, \ + {kKstarVsKt, {conf.kstar, conf.kt}}, \ + {kKstarVsMt, {conf.kstar, conf.mt}}, \ + {kKstarVsMult, {conf.kstar, conf.multiplicity}}, \ + {kKstarVsCent, {conf.kstar, conf.centrality}}, \ + {kKstarVsMass1, {conf.kstar, conf.mass1}}, \ + {kKstarVsMass2, {conf.kstar, conf.mass2}}, \ + {kMass1VsMass2, {conf.mass1, conf.mass2}}, \ + {kKstarVsMtVsMult, {conf.kstar, conf.mt, conf.multiplicity}}, \ + {kKstarVsMtVsMultVsCent, {conf.kstar, conf.mt, conf.multiplicity, conf.centrality}}, \ + {kKstarVsMtVsPt1VsPt2, {conf.kstar, conf.mt, conf.pt1, conf.pt2}}, \ + {kKstarVsMtVsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity}}, \ + {kKstarVsMtVsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, \ + {kKstarVsMtVsMass1VsMass2, {conf.kstar, conf.mt, conf.mass1, conf.mass2}}, \ + {kKstarVsMtVsMass1VsMass2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity}}, \ + {kKstarVsMtVsMass1VsMass2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity, conf.centrality}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, \ + {kDalitz, {conf.kstar, conf.dalitzMtot, conf.dalitzM12, conf.dalitzM13}}, #define PAIR_HIST_MC_MAP(conf) \ {kTrueKstarVsKstar, {conf.kstar, conf.kstar}}, \ @@ -285,6 +294,8 @@ class PairHistManager { mHistogramRegistry = registry; + mUsePdgMass = ConfPairBinning.usePdgMass.value; + // flags for histograms mPlot1d = ConfPairBinning.plot1D.value; mPlot2d = ConfPairBinning.plot2D.value; @@ -303,6 +314,8 @@ class PairHistManager mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult = ConfPairBinning.plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult.value; mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent = ConfPairBinning.plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent.value; + mPlotDalitz = ConfPairBinning.plotDalitz.value; + // transverse mass type mMtType = static_cast(ConfPairBinning.transverseMassType.value); @@ -325,8 +338,18 @@ class PairHistManager void setMass(int PdgParticle1, int PdgParticle2) { - mPdgMass1 = o2::analysis::femto::utils::getMass(PdgParticle1); - mPdgMass2 = o2::analysis::femto::utils::getMass(PdgParticle2); + mPdgMass1 = utils::getPdgMass(PdgParticle1); + mPdgMass2 = utils::getPdgMass(PdgParticle2); + } + + void setMass(int PdgParticle1, int PdgPosDauParticle1, int PdgNegDauParticle1, int PdgParticle2, int PdgPosDauParticle2, int PdgNegDauParticle2) + { + mPdgMass1 = utils::getPdgMass(PdgParticle1); + mPdgMassPosDau1 = utils::getPdgMass(PdgPosDauParticle1); + mPdgMassNegDau1 = utils::getPdgMass(PdgNegDauParticle1); + mPdgMass2 = utils::getPdgMass(PdgParticle2); + mPdgMassPosDau2 = utils::getPdgMass(PdgPosDauParticle2); + mPdgMassNegDau2 = utils::getPdgMass(PdgNegDauParticle2); } void setCharge(int chargeAbsParticle1, int chargeAbsParticle2) { @@ -335,13 +358,37 @@ class PairHistManager mAbsCharge2 = std::abs(chargeAbsParticle2); } - template - void setPair(const T1& particle1, const T2& particle2) + template + void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable) { + // if one of the particles has a mass getter (like lambda), we cache the value for the filling later + // otherwise set it to the pdg mass + if constexpr (utils::HasMass) { + mRecoMass1 = particle1.mass(); + } else { + mRecoMass1 = mPdgMass1; + } + if constexpr (utils::HasMass) { + mRecoMass2 = particle2.mass(); + } else { + mRecoMass2 = mPdgMass2; + } + + // get mass for 4-vectors + double mass1 = 0.f; + double mass2 = 0.f; + if (mUsePdgMass) { + mass1 = mPdgMass1; + mass2 = mPdgMass2; + } else { + mass1 = mRecoMass1; + mass2 = mRecoMass2; + } + // pt in track table is calculated from 1/signedPt from the original track table // in case of He with Z=2, we have to rescale the pt with the absolute charge - mParticle1 = ROOT::Math::PtEtaPhiMVector(mAbsCharge1 * particle1.pt(), particle1.eta(), particle1.phi(), mPdgMass1); - mParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * particle2.pt(), particle2.eta(), particle2.phi(), mPdgMass2); + mParticle1 = ROOT::Math::PtEtaPhiMVector(mAbsCharge1 * particle1.pt(), particle1.eta(), particle1.phi(), mass1); + mParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * particle2.pt(), particle2.eta(), particle2.phi(), mass2); // set kT mKt = getKt(mParticle1, mParticle2); @@ -352,36 +399,37 @@ class PairHistManager // set kstar mKstar = getKstar(mParticle1, mParticle2); - // if one of the particles has a mass getter (like lambda), we cache the value for the filling later - // otherwise we continue to use the pdg mass - mMass1 = mPdgMass1; - if constexpr (utils::HasMass) { - mMass1 = particle1.mass(); - } - mMass2 = mPdgMass2; - if constexpr (utils::HasMass) { - mMass2 = particle2.mass(); + if (mPlotDalitz) { + if constexpr (modes::isEqual(particleType1, modes::Particle::kTrack) && modes::isEqual(particleType2, modes::Particle::kV0)) { + auto posDaughter = trackTable.rawIteratorAt(particle2.posDauId() - trackTable.offset()); + auto negDaughter = trackTable.rawIteratorAt(particle2.negDauId() - trackTable.offset()); + ROOT::Math::PtEtaPhiMVector posDau4v = ROOT::Math::PtEtaPhiMVector(posDaughter.pt(), posDaughter.eta(), posDaughter.phi(), mPdgMassPosDau2); + ROOT::Math::PtEtaPhiMVector negDau4v = ROOT::Math::PtEtaPhiMVector(negDaughter.pt(), negDaughter.eta(), negDaughter.phi(), mPdgMassNegDau2); + mMassTot2 = (mParticle1 + posDau4v + negDau4v).M2(); + mMass12 = (mParticle1 + posDau4v).M2(); + mMass13 = (mParticle1 + negDau4v).M2(); + } } } - template - void setPair(const T1& particle1, const T2& particle2, const T3& col) + template + void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& col) { - setPair(particle1, particle2); + setPair(particle1, particle2, trackTable); mMult = col.mult(); mCent = col.cent(); } - template - void setPair(const T1& particle1, const T2& particle2, const T3& col1, const T4& col2) + template + void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& col1, T5 const& col2) { - setPair(particle1, particle2); + setPair(particle1, particle2, trackTable); mMult = 0.5f * (col1.mult() + col2.mult()); // if mixing with multiplicity, should be in the same mixing bin mCent = 0.5f * (col1.cent() + col2.cent()); // if mixing with centrality, should be in the same mixing bin } template - void setPairMc(const T1& particle1, const T2& particle2, const T3& /*mcParticles*/) + void setPairMc(T1 const& particle1, T2 const& particle2, const T3& /*mcParticles*/) { if (!particle1.has_fMcParticle() || !particle2.has_fMcParticle()) { mHasMcPair = false; @@ -404,33 +452,33 @@ class PairHistManager mTrueKstar = getKstar(mTrueParticle1, mTrueParticle2); } - template - void setPairMc(const T1& particle1, const T2& particle2, const T3& mcParticles, const T4& col, const T5& /*mcCols*/) + template + void setPairMc(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& mcParticles, T5 const& col, T6 const& /*mcCols*/) { - setPair(particle1, particle2, col); + setPair(particle1, particle2, trackTable, col); setPairMc(particle1, particle2, mcParticles); if (!col.has_fMcCol()) { mHasMcCol = false; return; } mHasMcCol = true; - auto mcCol = col.template fMcCol_as(); + auto mcCol = col.template fMcCol_as(); mTrueMult = mcCol.mult(); mTrueCent = mcCol.cent(); } - template - void setPairMc(const T1& particle1, const T2& particle2, const T3& mcParticles, const T4& col1, const T5& col2, const T6& /*mcCols*/) + template + void setPairMc(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& mcParticles, T5 const& col1, T6 const& col2, T7 const& /*mcCols*/) { - setPair(particle1, particle2, col1, col2); + setPair(particle1, particle2, trackTable, col1, col2); setPairMc(particle1, particle2, mcParticles); if (!col1.has_fMcCol() || !col2.has_fMcCol()) { mHasMcCol = false; return; } mHasMcCol = true; - auto mcCol1 = col1.template fMcCol_as(); - auto mcCol2 = col2.template fMcCol_as(); + auto mcCol1 = col1.template fMcCol_as(); + auto mcCol2 = col2.template fMcCol_as(); mTrueMult = 0.5f * (mcCol1.mult() + mcCol2.mult()); mTrueCent = 0.5f * (mcCol1.cent() + mcCol2.cent()); } @@ -521,6 +569,9 @@ class PairHistManager if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent) { mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable), getHistDesc(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable), getHistType(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable), {Specs.at(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent)}); } + if (mPlotDalitz) { + mHistogramRegistry->add(analysisDir + getHistNameV2(kDalitz, HistTable), getHistDesc(kDalitz, HistTable), getHistType(kDalitz, HistTable), {Specs.at(kDalitz)}); + } } void initMc(std::map> const& Specs) @@ -553,9 +604,9 @@ class PairHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMult, HistTable)), mKstar, mMult); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsCent, HistTable)), mKstar, mCent); - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass1, HistTable)), mKstar, mMass1); - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass2, HistTable)), mKstar, mMass2); - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass1VsMass2, HistTable)), mMass1, mMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass1, HistTable)), mKstar, mRecoMass1); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass2, HistTable)), mKstar, mRecoMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass1VsMass2, HistTable)), mRecoMass1, mRecoMass2); } // n-D histograms are only filled if enabled @@ -577,22 +628,25 @@ class PairHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); } if (mPlotKstarVsMtVsMass1VsMass2) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2, HistTable)), mKstar, mMt, mMass1, mMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2); } if (mPlotKstarVsMtVsMass1VsMass2VsMult) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMult, HistTable)), mKstar, mMt, mMass1, mMass2, mMult); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMult, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mMult); } if (mPlotKstarVsMtVsMass1VsMass2VsMultVsCent) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMultVsCent, HistTable)), mKstar, mMt, mMass1, mMass2, mMult, mCent); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMultVsCent, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mMult, mCent); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt()); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt()); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt(), mMult); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt(), mMult); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); + } + if (mPlotDalitz) { + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kDalitz, HistTable)), mKstar, mMassTot2, mMass12, mMass13); } } @@ -654,8 +708,13 @@ class PairHistManager } o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; + bool mUsePdgMass = true; double mPdgMass1 = 0.; + double mPdgMassPosDau1 = 0; + double mPdgMassNegDau1 = 0; double mPdgMass2 = 0.; + double mPdgMassPosDau2 = 0; + double mPdgMassNegDau2 = 0; modes::TransverseMassType mMtType = modes::TransverseMassType::kAveragePdgMass; @@ -663,13 +722,16 @@ class PairHistManager int mAbsCharge2 = 1; ROOT::Math::PtEtaPhiMVector mParticle1{}; ROOT::Math::PtEtaPhiMVector mParticle2{}; - float mMass1 = 0.f; - float mMass2 = 0.f; + float mRecoMass1 = 0.f; + float mRecoMass2 = 0.f; float mKstar = 0.f; float mKt = 0.f; float mMt = 0.f; float mMult = 0.f; float mCent = 0.f; + double mMass12 = 0.; + double mMass13 = 0.; + double mMassTot2 = 0.; // mc ROOT::Math::PtEtaPhiMVector mTrueParticle1{}; @@ -708,6 +770,8 @@ class PairHistManager bool mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2 = false; bool mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult = false; bool mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent = false; + + bool mPlotDalitz = false; }; }; // namespace pairhistmanager diff --git a/PWGCF/Femto/Core/pairProcessHelpers.h b/PWGCF/Femto/Core/pairProcessHelpers.h index 50d00196341..9279921b00b 100644 --- a/PWGCF/Femto/Core/pairProcessHelpers.h +++ b/PWGCF/Femto/Core/pairProcessHelpers.h @@ -67,13 +67,13 @@ void processSameEvent(T1 const& SliceParticle, // Randomize pair order if enabled switch (pairOrder) { case kOrder12: - PairHistManager.setPair(p1, p2, Collision); + PairHistManager.setPair(p1, p2, TrackTable, Collision); break; case kOrder21: - PairHistManager.setPair(p2, p1, Collision); + PairHistManager.setPair(p2, p1, TrackTable, Collision); break; default: - PairHistManager.setPair(p1, p2, Collision); + PairHistManager.setPair(p1, p2, TrackTable, Collision); } // fill deta-dphi histograms with kstar cutoff CprManager.fill(PairHistManager.getKstar()); @@ -136,13 +136,13 @@ void processSameEvent(T1 const& SliceParticle, // Randomize pair order if enabled switch (pairOrder) { case kOrder12: - PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); break; case kOrder21: - PairHistManager.setPairMc(p2, p1, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p2, p1, TrackTable, mcParticles, Collision, mcCollisions); break; default: - PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); } // fill deta-dphi histograms with kstar cutoff CprManager.fill(PairHistManager.getKstar()); @@ -191,7 +191,7 @@ void processSameEvent(T1 const& SliceParticle1, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPair(p1, p2, Collision); + PairHistManager.setPair(p1, p2, TrackTable, Collision); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -260,7 +260,7 @@ void processSameEvent(T1 const& SliceParticle1, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -311,7 +311,7 @@ void processMixedEvent(T1 const& Collisions, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPair(p1, p2, collision1, collision2); + PairHistManager.setPair(p1, p2, TrackTable, collision1, collision2); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -380,7 +380,7 @@ void processMixedEvent(T1 const& Collisions, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPairMc(p1, p2, mcParticles, collision1, collision2, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, collision1, collision2, mcCollisions); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); diff --git a/PWGCF/Femto/Core/trackHistManager.h b/PWGCF/Femto/Core/trackHistManager.h index 12f69af380b..dbff8bb2dd1 100644 --- a/PWGCF/Femto/Core/trackHistManager.h +++ b/PWGCF/Femto/Core/trackHistManager.h @@ -794,7 +794,7 @@ class TrackHistManager if constexpr (utils::HasMass) { mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), track.mass()); } else { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), utils::getMass(mPdgCode)); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), utils::getPdgMass(mPdgCode)); } } diff --git a/PWGCF/Femto/Core/tripletHistManager.h b/PWGCF/Femto/Core/tripletHistManager.h index 8eca807c5aa..672e9f68055 100644 --- a/PWGCF/Femto/Core/tripletHistManager.h +++ b/PWGCF/Femto/Core/tripletHistManager.h @@ -252,9 +252,9 @@ class TripletHistManager void setMass(int PdgParticle1, int PdgParticle2, int PdgParticle3) { - mPdgMass1 = o2::analysis::femto::utils::getMass(PdgParticle1); - mPdgMass2 = o2::analysis::femto::utils::getMass(PdgParticle2); - mPdgMass3 = o2::analysis::femto::utils::getMass(PdgParticle3); + mPdgMass1 = utils::getPdgMass(PdgParticle1); + mPdgMass2 = utils::getPdgMass(PdgParticle2); + mPdgMass3 = utils::getPdgMass(PdgParticle3); } void setCharge(int chargeAbsParticle1, int chargeAbsParticle2, int chargeAbsParticle3) { From 0f3d57d48356e2a45ba74bfb5944eae9f340e9d4 Mon Sep 17 00:00:00 2001 From: Rrantu <156880782+Rrantu@users.noreply.github.com> Date: Wed, 1 Apr 2026 18:00:13 +0200 Subject: [PATCH 138/282] [PWGHF] UPC Lc: add FV0 axes to THnSparse; fill multiplicity and vertex histograms (#15606) --- PWGHF/D2H/Tasks/taskLc.cxx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ecf59c918af..bd29b00c868 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -127,6 +127,7 @@ struct HfTaskLc { ConfigurableAxis thnConfigAxisOccupancy{"thnConfigAxisOccupancy", {14, 0, 14000}, "axis for centrality"}; ConfigurableAxis thnConfigAxisProperLifetime{"thnConfigAxisProperLifetime", {200, 0, 2}, "Proper lifetime, ps"}; ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {7, -1.5, 5.5}, "axis for UPC gap type (see TrueGap enum in o2::aod::sgselector)"}; + ConfigurableAxis thnConfigAxisFV0A{"thnConfigAxisFV0A", {1001, -1.5, 999.5}, "axis for FV0-A amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisFT0{"thnConfigAxisFT0", {1001, -1.5, 999.5}, "axis for FT0 amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisZN{"thnConfigAxisZN", {510, -1.5, 49.5}, "axis for ZN energy (a.u.)"}; ConfigurableAxis thnConfigAxisZNTime{"thnConfigAxisZNTime", {200, -10, 10}, "axis for ZN energy (a.u.)"}; @@ -269,6 +270,8 @@ struct HfTaskLc { qaRegistry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{100, 0., 10}, {100, 0., 10}}}); qaRegistry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{200, -10., 10}, {200, -10., 10}}}); qaRegistry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}}); + qaRegistry.add("Data/hUpcMulti", "Multiplicity of UPC events;Multiplicity;Counts", {HistType::kTH1F, {{200, -0.5, 199.5}}}); + qaRegistry.add("Data/hUpcVtz", "Vertex Z position of UPC events;Vz (cm);Counts", {HistType::kTH1F, {{200, -10., 10.}}}); } if (fillTHn) { const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; @@ -289,6 +292,7 @@ struct HfTaskLc { const AxisSpec thnAxisTracklets{thnConfigAxisNumPvContr, "Number of PV contributors"}; const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; const AxisSpec thnAxisProperLifetime{thnConfigAxisProperLifetime, "T_{proper} (ps)"}; + const AxisSpec thnAxisFV0A{thnConfigAxisFV0A, "FV0-A amplitude"}; const AxisSpec thnAxisFT0A{thnConfigAxisFT0, "FT0-A amplitude"}; const AxisSpec thnAxisFT0C{thnConfigAxisFT0, "FT0-C amplitude"}; const AxisSpec thnAxisZNA{thnConfigAxisZN, "ZNA energy"}; @@ -307,7 +311,7 @@ struct HfTaskLc { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets}; } if (isDataStd && isUpc) { - axesUpc = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; + axesUpc = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; } if (isMcStd) { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; @@ -319,7 +323,7 @@ struct HfTaskLc { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets}; } if (isDataWithMl && isUpc) { - axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; + axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; } if (isMcWithMl) { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; @@ -795,7 +799,10 @@ struct HfTaskLc { const auto decayLength = candidate.decayLength(); const auto chi2PCA = candidate.chi2PCA(); const auto cpa = candidate.cpa(); - const auto rapidity = HfHelper::yLc(candidate); + if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { + qaRegistry.fill(HIST("Data/hUpcMulti"), collision.multNTracksPV()); + qaRegistry.fill(HIST("Data/hUpcVtz"), collision.posZ()); + } if (fillTHn) { double outputBkg(-1), outputPrompt(-1), outputFD(-1); @@ -813,22 +820,22 @@ struct HfTaskLc { /// Fill the ML outputScores and variables of candidate if (fillUPCTHnLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { - std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVarsWithBdt"))->Fill(valuesToFill.data()); } } else { - std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVarsWithBdt"))->Fill(valuesToFill.data()); } } else { if (fillUPCTHnLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { - std::vector valuesToFill{massLc, pt, rapidity, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); } } else { - std::vector valuesToFill{massLc, pt, rapidity, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); } } @@ -908,7 +915,7 @@ struct HfTaskLc { } PROCESS_SWITCH(HfTaskLc, processDataWithMlWithFT0M, "Process real data with the ML method and with FT0M centrality", false); - void processDataWithMlWithUpc(soa::Join const& collisions, + void processDataWithMlWithUpc(soa::Join const& collisions, aod::BcFullInfos const& bcs, LcCandidatesMl const& selectedLcCandidatesMl, aod::Tracks const&, @@ -921,7 +928,7 @@ struct HfTaskLc { } PROCESS_SWITCH(HfTaskLc, processDataWithMlWithUpc, "Process real data with the ML method with UPC", false); - void processDataStdWithUpc(soa::Join const& collisions, + void processDataStdWithUpc(soa::Join const& collisions, aod::BcFullInfos const& bcs, LcCandidatesMl const& selectedLcCandidatesMl, aod::Tracks const&, From 674681984b2180397dccf9e8785dab8e7b000757 Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Wed, 1 Apr 2026 18:12:10 +0200 Subject: [PATCH 139/282] [PWGLF] Apply filter if both reco collisions and MC tracks belong to the same generated collision (#15609) --- .../heavyionMultiplicity.cxx | 411 +++++------------- 1 file changed, 106 insertions(+), 305 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index f24f2a28763..5dd2ed61719 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -52,13 +52,11 @@ using namespace o2::aod::track; using namespace o2::aod::evsel; using CollisionDataTable = soa::Join; -using ColDataTablepp = soa::Join; using TrackDataTable = soa::Join; using FilTrackDataTable = soa::Filtered; using CollisionMCTrueTable = aod::McCollisions; using TrackMCTrueTable = aod::McParticles; using CollisionMCRecTable = soa::SmallGroups>; -using ColMCRecTablepp = soa::SmallGroups>; using TrackMCRecTable = soa::Join; using FilTrackMCRecTable = soa::Filtered; using V0TrackCandidates = soa::Join; @@ -87,6 +85,7 @@ enum { kSpOther, kSpStrangeDecay, kBkg, + kFake, kSpNotPrimary, kSpAll, kSpeciesend @@ -128,7 +127,7 @@ static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = static constexpr TrackSelectionFlags::flagtype TrackSelectionDcaxyOnly = TrackSelectionFlags::kDCAxy; -AxisSpec axisEvent{10, 0.5, 10.5, "#Event", "EventAxis"}; +AxisSpec axisEvent{15, 0.5, 15.5, "#Event", "EventAxis"}; AxisSpec axisVtxZ{40, -20, 20, "Vertex Z", "VzAxis"}; AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"}; AxisSpec axisEtaExtended{100, -5, 5, "#eta", "EtaAxisExtended"}; @@ -190,15 +189,14 @@ struct HeavyionMultiplicity { ConfigurableAxis binsMult{"binsMult", {500, 0.0f, +500.0f}, ""}; ConfigurableAxis binsDCA{"binsDCA", {500, -10.0f, 10.0f}, ""}; + Configurable isApplyTFcut{"isApplyTFcut", true, "Enable TimeFrameBorder cut"}; + Configurable isApplyITSROcut{"isApplyITSROcut", true, "Enable ITS ReadOutFrameBorder cut"}; Configurable isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"}; Configurable isApplyGoodZvtxFT0vsPV{"isApplyGoodZvtxFT0vsPV", true, "Enable GoodZvtxFT0vsPV cut"}; - Configurable isApplyExtraCorrCut{"isApplyExtraCorrCut", false, "Enable extra NPVtracks vs FTOC correlation cut"}; - Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; - Configurable npvTracksCut{"npvTracksCut", 1.0f, "Apply extra NPVtracks cut"}; - Configurable ft0cCut{"ft0cCut", 1.0f, "Apply extra FT0C cut"}; Configurable isApplyNoCollInTimeRangeStandard{"isApplyNoCollInTimeRangeStandard", true, "Enable NoCollInTimeRangeStandard cut"}; Configurable isApplyNoCollInRofStandard{"isApplyNoCollInRofStandard", false, "Enable NoCollInRofStandard cut"}; Configurable isApplyNoHighMultCollInPrevRof{"isApplyNoHighMultCollInPrevRof", false, "Enable NoHighMultCollInPrevRof cut"}; + Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "Enable FT0CbasedOccupancy cut"}; Configurable isApplyCentFT0C{"isApplyCentFT0C", true, "Centrality based on FT0C"}; Configurable isApplyCentFV0A{"isApplyCentFV0A", false, "Centrality based on FV0A"}; @@ -207,9 +205,8 @@ struct HeavyionMultiplicity { Configurable isApplyCentFT0M{"isApplyCentFT0M", false, "Centrality based on FT0A + FT0C"}; Configurable isApplyCentNGlobal{"isApplyCentNGlobal", false, "Centrality based on global tracks"}; Configurable isApplyCentMFT{"isApplyCentMFT", false, "Centrality based on MFT tracks"}; - Configurable isApplySplitRecCol{"isApplySplitRecCol", false, "Split MC reco collisions"}; - Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; + Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; void init(InitContext const&) { @@ -232,14 +229,15 @@ struct HeavyionMultiplicity { auto hstat = histos.get(HIST("EventHist")); auto* x = hstat->GetXaxis(); x->SetBinLabel(1, "All events"); - x->SetBinLabel(2, "sel8"); - x->SetBinLabel(3, "kNoSameBunchPileup"); // reject collisions in case of pileup with another collision in the same foundBC - x->SetBinLabel(4, "kIsGoodZvtxFT0vsPV"); // small difference between z-vertex from PV and from FT0 - x->SetBinLabel(5, "ApplyExtraCorrCut"); - x->SetBinLabel(6, "ApplyNoCollInTimeRangeStandard"); - x->SetBinLabel(7, "ApplyNoCollInRofStandard"); - x->SetBinLabel(8, "ApplyNoHighMultCollInPrevRof"); - x->SetBinLabel(9, "INEL > 0"); + x->SetBinLabel(2, "kIsTriggerTVX"); + x->SetBinLabel(3, "kNoTimeFrameBorder"); + x->SetBinLabel(4, "kNoITSROFrameBorder"); + x->SetBinLabel(5, "kNoSameBunchPileup"); // reject collisions in case of pileup with another collision in the same foundBC + x->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); // small difference between z-vertex from PV and from FT0 + x->SetBinLabel(7, "ApplyNoCollInTimeRangeStandard"); + x->SetBinLabel(8, "ApplyNoCollInRofStandard"); + x->SetBinLabel(9, "ApplyNoHighMultCollInPrevRof"); + x->SetBinLabel(10, "INEL > 0"); if (doprocessData) { histos.add("hdcaxy", "dca to pv in the xy plane", kTH1D, {dcaAxis}, false); @@ -251,7 +249,7 @@ struct HeavyionMultiplicity { histos.add("hdatadndetaMB", "hdatadndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi}, false); } - if (doprocessMonteCarlo || doprocessMCpTefficiency || doprocessMCcheckFakeTracks) { + if (doprocessMonteCarlo || doprocessMCcheckFakeTracks) { histos.add("CentPercentileMCRecHist", "CentPercentileMCRecHist", kTH1D, {axisCent}, false); histos.add("hmczvtxcent", "hmczvtxcent", kTH3D, {axisVtxZ, centAxis, axisOccupancy}, false); } @@ -266,11 +264,6 @@ struct HeavyionMultiplicity { histos.add("hmcgendndetaMB", "hmcgendndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi, axisSpecies}, false); } - if (doprocessMCpTefficiency) { - histos.add("hmcrecdndpt", "hmcrecdndpt", kTHnSparseD, {centAxis, axisOccupancy, axisTrackType, axisPt}, false); - histos.add("hmcgendndpt", "hmcgendndpt", kTHnSparseD, {centAxis, axisPt, axisGenPtVary}, false); - } - if (doprocessMCcheckFakeTracks) { histos.add("hTracksCount", "hTracksCount", kTHnSparseD, {centAxis, axisTracks}, false); auto htrack = histos.get(HIST("hTracksCount")); @@ -300,21 +293,6 @@ struct HeavyionMultiplicity { histos.add("AntiLambdaCentEtaMass", "AntiLambdaCentEtaMass", kTH3D, {centAxis, axisEta, axisMassLambda}, false); } - if (doprocessppData) { - histos.add("MultPercentileHist", "MultPercentileHist", kTH1D, {axisCent}, false); - histos.add("hdatazvtxmultpp", "hdatazvtxmultpp", kTH2D, {axisVtxZ, centAxis}, false); - histos.add("PhiVsEtaHistpp", "PhiVsEtaHistpp", kTH2D, {axisPhi2, axisEta}, false); - histos.add("hdatadndetapp", "hdatadndetapp", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisTrackType}, false); - } - - if (doprocessppMonteCarlo) { - histos.add("MultPercentileMCRecHist", "MultPercentileMCRecHist", kTH1D, {axisCent}, false); - histos.add("hmczvtxmultpp", "hmczvtxmultpp", kTH2D, {axisVtxZ, centAxis}, false); - histos.add("MCrecPhiVsEtaHistpp", "MCrecPhiVsEtaHistpp", kTH2D, {axisPhi2, axisEta}, false); - histos.add("hmcrecdndetapp", "hmcrecdndetapp", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisSpecies, axisTrackType}, false); - histos.add("hmcgendndetapp", "hmcgendndetapp", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisSpecies, axisGenPtVary}, false); - } - if (doprocessGen) { histos.add("MultBarrelEta10_vs_FT0A", "MultBarrelEta10_vs_FT0A", kTH2F, {axisMult, axisFt0aMult}, true); histos.add("MultBarrelEta10_vs_FT0C", "MultBarrelEta10_vs_FT0C", kTH2F, {axisMult, axisFt0cMult}, true); @@ -385,50 +363,42 @@ struct HeavyionMultiplicity { bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - - if (!col.sel8()) { + if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } histos.fill(HIST("EventHist"), 2); - - if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - return false; - } - - if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + if (isApplyTFcut && !col.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { return false; } histos.fill(HIST("EventHist"), 3); - - if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (isApplyITSROcut && !col.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { return false; } histos.fill(HIST("EventHist"), 4); - - if (isApplyExtraCorrCut && col.multNTracksPV() > npvTracksCut && col.multFT0C() < (10 * col.multNTracksPV() - ft0cCut)) { + if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return false; } histos.fill(HIST("EventHist"), 5); - - if (isApplyNoCollInTimeRangeStandard && !col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } histos.fill(HIST("EventHist"), 6); - - if (isApplyNoCollInRofStandard && !col.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + if (isApplyNoCollInTimeRangeStandard && !col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } histos.fill(HIST("EventHist"), 7); - - if (isApplyNoHighMultCollInPrevRof && !col.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + if (isApplyNoCollInRofStandard && !col.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { return false; } histos.fill(HIST("EventHist"), 8); - - if (isApplyInelgt0 && !col.isInelGt0()) { + if (isApplyNoHighMultCollInPrevRof && !col.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { return false; } histos.fill(HIST("EventHist"), 9); + if (isApplyInelgt0 && !col.isInelGt0()) { + return false; + } + histos.fill(HIST("EventHist"), 10); return true; } @@ -580,17 +550,15 @@ struct HeavyionMultiplicity { histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), nchTracks); } - void processMonteCarlo(CollisionMCTrueTable::iterator const&, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMonteCarlo(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) { - - if (isApplySplitRecCol && (RecCols.size() == 0 || RecCols.size() > 1)) { - return; - } - for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } histos.fill(HIST("VtxZHist"), RecCol.posZ()); histos.fill(HIST("CentPercentileMCRecHist"), selColCent(RecCol)); histos.fill(HIST("hmczvtxcent"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol)); @@ -600,6 +568,15 @@ struct HeavyionMultiplicity { if (!isTrackSelected(Rectrack)) { continue; } + if (!Rectrack.has_mcParticle()) { + histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg), kGlobalplusITS); + histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg)); + continue; + } + auto mcpart = Rectrack.mcParticle(); + if (RecCol.mcCollisionId() != mcpart.mcCollisionId()) { + continue; + } histos.fill(HIST("hmcdcaxy"), Rectrack.dcaXY()); histos.fill(HIST("hmcdcaz"), Rectrack.dcaZ()); histos.fill(HIST("MCrecPhiVsEtaHist"), Rectrack.phi(), Rectrack.eta()); @@ -611,43 +588,37 @@ struct HeavyionMultiplicity { histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kITSonly); } - if (Rectrack.has_mcParticle()) { - int pid = kBkg; - auto mcpart = Rectrack.template mcParticle_as(); - if (mcpart.isPhysicalPrimary()) { - switch (std::abs(mcpart.pdgCode())) { - case PDG_t::kPiPlus: - pid = kSpPion; - break; - case PDG_t::kKPlus: - pid = kSpKaon; - break; - case PDG_t::kProton: - pid = kSpProton; - break; - default: - pid = kSpOther; - break; - } - } else { - pid = kSpNotPrimary; - } - if (mcpart.has_mothers()) { - auto mcpartMother = mcpart.template mothers_as().front(); - if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { - pid = kSpStrangeDecay; - } + int pid = kFake; + if (mcpart.isPhysicalPrimary()) { + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kSpPion; + break; + case PDG_t::kKPlus: + pid = kSpKaon; + break; + case PDG_t::kProton: + pid = kSpProton; + break; + default: + pid = kSpOther; + break; } - if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { - pid = kBkg; - } - mclabels.push_back(Rectrack.mcParticleId()); - histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(pid), kGlobalplusITS); - histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(pid)); } else { - histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg), kGlobalplusITS); - histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg)); + pid = kSpNotPrimary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kSpStrangeDecay; + } } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kFake; + } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(pid), kGlobalplusITS); + histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(pid)); } // track (mcrec) loop for (const auto& particle : GenParticles) { @@ -663,7 +634,6 @@ struct HeavyionMultiplicity { histos.fill(HIST("hmcgendndeta"), RecCol.posZ(), selColCent(RecCol), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTup); histos.fill(HIST("hmcgendndeta"), RecCol.posZ(), selColCent(RecCol), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTdown); } - int pid = 0; switch (std::abs(particle.pdgCode())) { case PDG_t::kPiPlus: @@ -685,53 +655,6 @@ struct HeavyionMultiplicity { } // collision loop } - void processMCpTefficiency(CollisionMCTrueTable::iterator const&, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; - } - if (std::abs(RecCol.posZ()) >= vtxRange) { - continue; - } - histos.fill(HIST("VtxZHist"), RecCol.posZ()); - histos.fill(HIST("CentPercentileMCRecHist"), selColCent(RecCol)); - histos.fill(HIST("hmczvtxcent"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol)); - - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - for (const auto& Rectrack : recTracksPart) { - if (std::abs(Rectrack.eta()) >= etaRange) { - continue; - } - if (Rectrack.has_mcParticle()) { - auto mcpart = Rectrack.mcParticle(); - if (mcpart.isPhysicalPrimary()) { - histos.fill(HIST("hmcrecdndpt"), selColCent(RecCol), selColOccu(RecCol), kGlobalplusITS, mcpart.pt()); - if (Rectrack.hasTPC()) { - histos.fill(HIST("hmcrecdndpt"), selColCent(RecCol), selColOccu(RecCol), kGlobalonly, mcpart.pt()); - } else { - histos.fill(HIST("hmcrecdndpt"), selColCent(RecCol), selColOccu(RecCol), kITSonly, mcpart.pt()); - } - } - } - } - - for (const auto& particle : GenParticles) { - if (!isGenTrackSelected(particle)) { - continue; - } - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kNoGenpTVar); - if (particle.pt() < KminPtCut) { - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTup, -10.0 * particle.pt() + 2); - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTdown, 5.0 * particle.pt() + 0.5); - } else { - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTup); - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTdown); - } - } - } - } - void processMCcheckFakeTracks(CollisionMCTrueTable::iterator const&, CollisionMCRecTable const& RecCols, FilTrackMCRecTable const& RecTracks) { for (const auto& RecCol : RecCols) { @@ -798,129 +721,6 @@ struct HeavyionMultiplicity { } } - void processppData(ColDataTablepp::iterator const& cols, FilTrackDataTable const& tracks) - { - if (!isEventSelected(cols)) { - return; - } - - histos.fill(HIST("VtxZHist"), cols.posZ()); - histos.fill(HIST("MultPercentileHist"), cols.centFT0M()); - histos.fill(HIST("hdatazvtxmultpp"), cols.posZ(), cols.centFT0M()); - - for (const auto& track : tracks) { - if (!isTrackSelected(track)) { - continue; - } - histos.fill(HIST("PhiVsEtaHistpp"), track.phi(), track.eta()); - histos.fill(HIST("hdatadndetapp"), cols.posZ(), cols.centFT0M(), track.eta(), track.phi(), kGlobalplusITS); - if (track.hasTPC()) { - histos.fill(HIST("hdatadndetapp"), cols.posZ(), cols.centFT0M(), track.eta(), track.phi(), kGlobalonly); - } else { - histos.fill(HIST("hdatadndetapp"), cols.posZ(), cols.centFT0M(), track.eta(), track.phi(), kITSonly); - } - } // track loop - } - - void processppMonteCarlo(CollisionMCTrueTable::iterator const&, ColMCRecTablepp const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - if (isApplySplitRecCol && (RecCols.size() == 0 || RecCols.size() > 1)) { - return; - } - - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; - } - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - std::vector mclabels; - - histos.fill(HIST("VtxZHist"), RecCol.posZ()); - histos.fill(HIST("MultPercentileMCRecHist"), RecCol.centFT0M()); - histos.fill(HIST("hmczvtxmultpp"), RecCol.posZ(), RecCol.centFT0M()); - - for (const auto& Rectrack : recTracksPart) { - if (!isTrackSelected(Rectrack)) { - continue; - } - histos.fill(HIST("MCrecPhiVsEtaHistpp"), Rectrack.phi(), Rectrack.eta()); - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kGlobalplusITS); - if (Rectrack.hasTPC()) { - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kGlobalonly); - } else { - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kITSonly); - } - - if (Rectrack.has_mcParticle()) { - int pid = kBkg; - auto mcpart = Rectrack.template mcParticle_as(); - if (mcpart.isPhysicalPrimary()) { - switch (std::abs(mcpart.pdgCode())) { - case PDG_t::kPiPlus: - pid = kSpPion; - break; - case PDG_t::kKPlus: - pid = kSpKaon; - break; - case PDG_t::kProton: - pid = kSpProton; - break; - default: - pid = kSpOther; - break; - } - } else { - pid = kSpNotPrimary; - } - if (mcpart.has_mothers()) { - auto mcpartMother = mcpart.template mothers_as().front(); - if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { - pid = kSpStrangeDecay; - } - } - if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { - pid = kBkg; - } - mclabels.push_back(Rectrack.mcParticleId()); - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(pid), kGlobalplusITS); - } else { - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg), kGlobalplusITS); - } - } // track (mcrec) loop - - for (const auto& particle : GenParticles) { - if (!isGenTrackSelected(particle)) { - continue; - } - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kNoGenpTVar); - if (particle.pt() < KminPtCut) { - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTup, -10.0 * particle.pt() + 2); - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTdown, 5.0 * particle.pt() + 0.5); - } else { - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTup); - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTdown); - } - - int pid = 0; - switch (std::abs(particle.pdgCode())) { - case PDG_t::kPiPlus: - pid = kSpPion; - break; - case PDG_t::kKPlus: - pid = kSpKaon; - break; - case PDG_t::kProton: - pid = kSpProton; - break; - default: - pid = kSpOther; - break; - } - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(pid), kNoGenpTVar); - } // track (mcgen) loop - } // collision loop - } - void processGen(aod::McCollisions::iterator const&, aod::McParticles const& GenParticles) { @@ -1125,44 +925,48 @@ struct HeavyionMultiplicity { if (!isTrackSelected(Rectrack)) { continue; } + if (!Rectrack.has_mcParticle()) { + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); + continue; + } + auto mcpart = Rectrack.mcParticle(); + if (RecCol.mcCollisionId() != mcpart.mcCollisionId()) { + continue; + } histos.fill(HIST("hRecMCphivseta"), Rectrack.phi(), Rectrack.eta()); histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoAll)); - if (Rectrack.has_mcParticle()) { - int pid = 0; - auto mcpart = Rectrack.mcParticle(); - histos.fill(HIST("etaResolution"), Rectrack.eta(), Rectrack.eta() - mcpart.eta()); - if (mcpart.isPhysicalPrimary()) { - switch (std::abs(mcpart.pdgCode())) { - case PDG_t::kPiPlus: - pid = kRecoPion; - break; - case PDG_t::kKPlus: - pid = kRecoKaon; - break; - case PDG_t::kProton: - pid = kRecoProton; - break; - default: - pid = kRecoOther; - break; - } - } else { - pid = kRecoSecondary; - } - if (mcpart.has_mothers()) { - auto mcpartMother = mcpart.template mothers_as().front(); - if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { - pid = kRecoWeakDecay; - } - } - if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { - pid = kRecoFake; + + int pid = 0; + histos.fill(HIST("etaResolution"), Rectrack.eta(), Rectrack.eta() - mcpart.eta()); + if (mcpart.isPhysicalPrimary()) { + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kRecoPion; + break; + case PDG_t::kKPlus: + pid = kRecoKaon; + break; + case PDG_t::kProton: + pid = kRecoProton; + break; + default: + pid = kRecoOther; + break; } - mclabels.push_back(Rectrack.mcParticleId()); - histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), mcpart.eta(), mcpart.phi(), static_cast(pid)); } else { - histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); + pid = kRecoSecondary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kRecoWeakDecay; + } + } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kRecoFake; } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), mcpart.eta(), mcpart.phi(), static_cast(pid)); } // track (mcrec) loop } // collision loop } @@ -1170,11 +974,8 @@ struct HeavyionMultiplicity { PROCESS_SWITCH(HeavyionMultiplicity, processData, "process data CentFT0C", false); PROCESS_SWITCH(HeavyionMultiplicity, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(HeavyionMultiplicity, processMonteCarlo, "process MC CentFT0C", false); - PROCESS_SWITCH(HeavyionMultiplicity, processMCpTefficiency, "process MC pTefficiency", false); PROCESS_SWITCH(HeavyionMultiplicity, processMCcheckFakeTracks, "Check Fake tracks", false); PROCESS_SWITCH(HeavyionMultiplicity, processStrangeYield, "Strange particle yield", false); - PROCESS_SWITCH(HeavyionMultiplicity, processppData, "process pp data", false); - PROCESS_SWITCH(HeavyionMultiplicity, processppMonteCarlo, "process pp MC", false); PROCESS_SWITCH(HeavyionMultiplicity, processGen, "process pure MC gen", false); PROCESS_SWITCH(HeavyionMultiplicity, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); PROCESS_SWITCH(HeavyionMultiplicity, processMCeff, "process extra efficiency function", false); From 9d12cea064f173ffebdc7a6b38124a4aa56c2228 Mon Sep 17 00:00:00 2001 From: MaolinZH <109225729+MaolinZH@users.noreply.github.com> Date: Wed, 1 Apr 2026 18:45:58 +0200 Subject: [PATCH 140/282] [PWGHF] Update HFL task taskSingleMuonSource.cxx with new function and parameter adjustment (#15580) --- PWGHF/HFL/Tasks/taskSingleMuonSource.cxx | 202 +++++++++++++++++++++-- 1 file changed, 184 insertions(+), 18 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index 20c3db63117..aea4ee26bea 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -14,7 +14,6 @@ // \author Maolin Zhang , CCNU #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include @@ -28,6 +27,7 @@ #include #include +#include #include #include #include @@ -41,7 +41,7 @@ using namespace o2; using namespace o2::aod; using namespace o2::framework; -using MyCollisions = soa::Join; +using MyCollisions = soa::Join; using McMuons = soa::Join; namespace @@ -74,15 +74,19 @@ struct HfTaskSingleMuonSource { Produces singleMuonSource; Configurable mcMaskSelection{"mcMaskSelection", 0, "McMask for correct match, valid values are 0 and 128"}; - Configurable trackType{"trackType", 0, "Muon track type, validated values are 0, 1, 2, 3 and 4"}; - Configurable charge{"charge", -1, "Muon track charge, validated values are 0, 1 and -1, 0 represents both 1 and -1"}; - - double pDcaMax = 594.0; // p*DCA maximum value for large Rabs - double rAbsMin = 26.5; // R at absorber end minimum value - double rAbsMax = 89.5; // R at absorber end maximum value - double etaLow = -3.6; // low edge of eta acceptance - double etaUp = -2.5; // up edge of eta acceptance - double edgeZ = 10.0; // edge of event position Z + Configurable trackType{"trackType", 3, "Muon track type, validated values are 0, 1, 2, 3 and 4"}; + Configurable charge{"charge", 0, "Muon track charge, validated values are 0, 1 and -1, 0 represents both 1 and -1"}; + Configurable pairSource{"pairSource", true, "check also the source of like-sign muon pairs"}; + + double pDcaMax = 594.0; // p*DCA maximum value for small Rab + double pDcaMax2 = 324.0; // p*DCA maximum value for large Rabs + double rAbsMid = 26.5; // R at absorber end minimum value + double rAbsMax = 89.5; // R at absorber end maximum value + double rAbsMin = 17.6; // R at absorber end maximum value + double etaLow = -4.0; // low edge of eta acceptance + double etaUp = -2.5; // up edge of eta acceptance + double edgeZ = 10.0; // edge of event position Z + double ptLow = 1.0; // low edge of pT for muon pairs HistogramRegistry registry{ "registry", @@ -108,14 +112,23 @@ struct HfTaskSingleMuonSource { AxisSpec const axisChi2{500, 0., 100., "#chi^{2} of MCH-MFT matching"}; AxisSpec const axisPt{200, 0., 100., "#it{p}_{T,reco} (GeV/#it{c})"}; AxisSpec const axisDeltaPt{1000, -50., 50., "#Delta #it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisMass{200, 0., 20., "Inv.Mass (GeV/#it{c}^2)"}; HistogramConfigSpec const h1ColNumber{HistType::kTH1F, {axisColNumber}}; HistogramConfigSpec const h1Pt{HistType::kTH1F, {axisPt}}; + HistogramConfigSpec h1Mass{HistType::kTH1F, {axisMass}}; HistogramConfigSpec const h2PtDCA{HistType::kTH2F, {axisPt, axisDCA}}; HistogramConfigSpec const h2PtChi2{HistType::kTH2F, {axisPt, axisChi2}}; HistogramConfigSpec const h2PtDeltaPt{HistType::kTH2F, {axisPt, axisDeltaPt}}; registry.add("h1ColNumber", "", h1ColNumber); + registry.add("h1MuBeforeCuts", "", h1Pt); + registry.add("h1MuonMass", "", h1Mass); + registry.add("h1BeautyMass", "", h1Mass); + registry.add("h1OtherMass", "", h1Mass); + registry.add("h1MuonMassGen", "", h1Mass); + registry.add("h1BeautyMassGen", "", h1Mass); + registry.add("h1OtherMassGen", "", h1Mass); for (const auto& src : muonSources) { registry.add(Form("h1%sPt", src.Data()), "", h1Pt); registry.add(Form("h2%sPtDCA", src.Data()), "", h2PtDCA); @@ -146,8 +159,8 @@ struct HfTaskSingleMuonSource { mcPart = *(mcPart.mothers_first_as()); const auto pdgAbs(std::abs(mcPart.pdgCode())); - if (pdgAbs < 10) { - break; // Quark + if (pdgAbs < 10 || pdgAbs == 21) { + break; // Quark and gluon } if (!mcPart.producedByGenerator()) { // Produced in transport code @@ -170,6 +183,9 @@ struct HfTaskSingleMuonSource { if ((pdgRem < 100) || (pdgRem >= 10000)) { continue; } + if ((pdgRem % 100 == 1 || pdgRem % 100 == 3) && pdgRem > 1000) { // diquarks + continue; + } // compute the flavor of constituent quark const int flv(pdgRem / std::pow(10, static_cast(std::log10(pdgRem)))); if (flv > 6) { @@ -325,9 +341,113 @@ struct HfTaskSingleMuonSource { } } + int traceAncestor(const McMuons::iterator& muon, aod::McParticles const& mctracks) + { + int mcNum = 0; + if (!muon.has_mcParticle()) { + return 0; + } + auto mcPart(muon.mcParticle()); + if (std::abs(mcPart.pdgCode()) != kMuonMinus) { + return 0; + } + while (mcPart.has_mothers()) { // the first hadron after hadronization + auto mother = mcPart.mothers_first_as(); + if (std::abs(mother.getGenStatusCode()) < 80) { + break; + } + mcPart = mother; + } + int flv = mcPart.pdgCode() / std::pow(10, static_cast(std::log10(std::abs(mcPart.pdgCode())))); + if (abs(flv) == 5 && mcPart.pdgCode() < 1000) + flv = -flv; + for (int i = (mcPart.mothers_first_as()).globalIndex(); i <= (mcPart.mothers_last_as()).globalIndex(); i++) { // loop over the lund string + for (auto mctrack : mctracks) { + if (mctrack.globalIndex() != i) { + continue; + } + if ((mctrack.pdgCode() != flv) && (abs(mctrack.pdgCode()) < abs(flv) * 1000)) { + continue; + } + while (mctrack.has_mothers()) { + int motherflv = (mctrack.mothers_first_as()).pdgCode() / std::pow(10, static_cast(std::log10(abs((mctrack.mothers_first_as()).pdgCode())))); // find the mother with same flavor + auto mother = (abs(motherflv) == abs(flv)) ? (mctrack.mothers_first_as()) : (mctrack.mothers_last_as()); + if ((mother.pdgCode() != mctrack.pdgCode()) && (abs(mctrack.pdgCode()) < 10)) { // both mother is not the the quark with same flavor + mcNum = mctrack.globalIndex(); + return mcNum; + } + mctrack = mother; + } + } + } + return 0; + } + bool Corr(const McMuons::iterator& muon1, const McMuons::iterator& muon2, aod::McParticles const& mcParts) + { + + int moth11(0), moth12(0), moth21(1), moth22(1); + int anc1 = traceAncestor(muon1, mcParts); + int anc2 = traceAncestor(muon2, mcParts); + if (anc1 == 0 || anc2 == 0) { + return false; + } + for (auto mcPart : mcParts) { + if (mcPart.globalIndex() == anc1) { + moth11 = (mcPart.mothers_first_as()).globalIndex(); + moth12 = (mcPart.mothers_last_as()).globalIndex(); + } + if (mcPart.globalIndex() == anc2) { + moth21 = (mcPart.mothers_first_as()).globalIndex(); + moth22 = (mcPart.mothers_last_as()).globalIndex(); + } + } + if ((moth11 == moth21) && (moth12 == moth22)) { + return true; + } + return false; // uncorrelated + } + void fillPairs(const McMuons::iterator& muon, const McMuons::iterator& muon2, aod::McParticles const& mcParts) + { + if (trackType != 3) { + return; + } + float mm = o2::constants::physics::MassMuon; + + const auto mask1(getMask(muon)); + const auto mask2(getMask(muon2)); + + ROOT::Math::PtEtaPhiMVector mu1Vec(muon.pt(), muon.eta(), muon.phi(), mm); + ROOT::Math::PtEtaPhiMVector mu2Vec(muon2.pt(), muon2.eta(), muon2.phi(), mm); + ROOT::Math::PtEtaPhiMVector dimuVec = mu1Vec + mu2Vec; + auto InvM = dimuVec.M(); + + if (!muon.has_mcParticle() || !muon2.has_mcParticle()) { + return; + } + auto mcPart1(muon.mcParticle()); + auto mcPart2(muon2.mcParticle()); + + ROOT::Math::PtEtaPhiMVector mu1VecGen(mcPart1.pt(), mcPart1.eta(), mcPart1.phi(), mm); + ROOT::Math::PtEtaPhiMVector mu2VecGen(mcPart2.pt(), mcPart2.eta(), mcPart2.phi(), mm); + ROOT::Math::PtEtaPhiMVector dimuVecGen = mu1VecGen + mu2VecGen; + auto InvMGen = dimuVecGen.M(); + + if (isMuon(mask1) && isMuon(mask2)) { + registry.fill(HIST("h1MuonMass"), InvM); + registry.fill(HIST("h1MuonMassGen"), InvMGen); + } + if (Corr(muon, muon2, mcParts) && isBeautyMu(mask1) && isBeautyMu(mask2)) { + registry.fill(HIST("h1BeautyMass"), InvM); + registry.fill(HIST("h1BeautyMassGen"), InvMGen); + } else { + registry.fill(HIST("h1OtherMass"), InvM); + registry.fill(HIST("h1OtherMassGen"), InvMGen); + } + } + void process(MyCollisions::iterator const& collision, McMuons const& muons, - aod::McParticles const&) + aod::McParticles const& mcParts) { // event selections if (std::abs(collision.posZ()) > edgeZ) { @@ -347,11 +467,15 @@ struct HfTaskSingleMuonSource { if ((eta >= etaUp) || (eta < etaLow)) { continue; } - if ((rAbs >= rAbsMax) || (rAbs < rAbsMin)) { - continue; + if ((rAbs >= rAbsMid) || (rAbs < rAbsMin)) { + if (pDca >= pDcaMax || pDca < 0) { + continue; + } } - if (pDca >= pDcaMax) { - continue; + if ((rAbs >= rAbsMax) || (rAbs < rAbsMid)) { + if (pDca >= pDcaMax2 || pDca < 0) { + continue; + } } if ((muon.chi2() >= 1e6) || (muon.chi2() < 0)) { continue; @@ -360,6 +484,48 @@ struct HfTaskSingleMuonSource { continue; } fillHistograms(muon); + if (pairSource) { + if (muon.pt() < ptLow) { + continue; + } + for (const auto& muon2 : muons) { + if (muon2.sign() != muon.sign()) { + continue; + } + if (muon2.globalIndex() <= muon.globalIndex()) { + continue; + } + // muon selections + if (muon2.trackType() != trackType) { + continue; + } + if (muon2.pt() < ptLow) { + continue; + } + const auto eta2(muon2.eta()), pDca2(muon2.pDca()), rAbs2(muon2.rAtAbsorberEnd()); + if ((eta2 >= etaUp) || (eta2 < etaLow)) { + continue; + } + if ((rAbs2 >= rAbsMid) || (rAbs2 < rAbsMin)) { + if (pDca2 >= pDcaMax || pDca2 < 0) { + continue; + } + } + if ((rAbs2 >= rAbsMax) || (rAbs2 < rAbsMid)) { + if (pDca2 >= pDcaMax2 || pDca2 < 0) { + continue; + } + } + + if ((muon2.chi2() >= 1e6) || (muon2.chi2() < 0)) { + continue; + } + if ((muon2.chi2MatchMCHMID() >= 1e6) || (muon2.chi2MatchMCHMID() < 0)) { + continue; + } + fillPairs(muon, muon2, mcParts); + } + } } // loop over muons } }; From 3f1700f4eb32867ad138264cb507579b27d6c65e Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Wed, 1 Apr 2026 19:15:21 +0200 Subject: [PATCH 141/282] [PWGLF] Reorganized mc process and selections (#15611) --- .../GlobalEventProperties/flattenictyPikp.cxx | 1218 ++++++++--------- 1 file changed, 587 insertions(+), 631 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index d3af036e6d2..f86828f6cea 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -50,10 +50,12 @@ #include "TEfficiency.h" #include "THashList.h" -#include "TPDGCode.h" #include #include #include +#include +#include +#include #include #include @@ -85,6 +87,10 @@ static constexpr float Cfv0IndexPhi[5] = {0., 8., 16., 24., 32.}; static constexpr float CmaxEtaFV0 = 5.1; static constexpr float CminEtaFV0 = 2.2; static constexpr float CdEtaFV0 = (CmaxEtaFV0 - CminEtaFV0) / CmaxRingsFV0; +auto static constexpr CminAccFT0A = 3.5f; +auto static constexpr CmaxAccFT0A = 4.9f; +auto static constexpr CminAccFT0C = -3.3f; +auto static constexpr CmaxAccFT0C = -2.1f; // PID names static constexpr int CprocessIdWeak = 4; static constexpr int Ncharges = 2; @@ -105,26 +111,30 @@ static constexpr std::string_view CprefixCleanV0 = "Tracks/CleanV0/"; static constexpr std::string_view CprefixV0qa = "Tracks/V0qa/"; static constexpr std::string_view Cstatus[] = {"preSel/", "postSel/"}; static constexpr std::string_view CstatCalib[] = {"preCalib/", "postCalib/"}; -static constexpr std::string_view CdEdxMcRecPrim = "/CdEdxMcRecPrim"; -static constexpr std::string_view CdEdxMcRecPrimF = "Tracks/{}/CdEdxMcRecPrim"; +static constexpr std::string_view CdEdxMcRecPrim = "/hdEdxMcRecPrim"; +static constexpr std::string_view CdEdxMcRecPrimF = "Tracks/{}/hdEdxMcRecPrim"; static constexpr std::string_view CpTvsDCAxy = "/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyF = "Tracks/{}/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyAll = "/hPtVsDCAxyAll"; static constexpr std::string_view CpTvsDCAxyAllF = "Tracks/{}/hPtVsDCAxyAll"; -static constexpr std::string_view CpTvsDCAxyPrimAll = "/hPtVsDCAxyPrimAll"; -static constexpr std::string_view CpTvsDCAxyPrimAllF = "Tracks/{}/hPtVsDCAxyPrimAll"; -static constexpr std::string_view CpTvsDCAxyWeakAll = "/hPtVsDCAxyWeakAll"; -static constexpr std::string_view CpTvsDCAxyWeakAllF = "Tracks/{}/hPtVsDCAxyWeakAll"; -static constexpr std::string_view CpTvsDCAxyMatAll = "/hPtVsDCAxyMatAll"; -static constexpr std::string_view CpTvsDCAxyMatAllF = "Tracks/{}/hPtVsDCAxyMatAll"; +static constexpr std::string_view CpTvsDCAxyPrimAll = "/hPtVsDCAxyRecPrimAll"; +static constexpr std::string_view CpTvsDCAxyPrimAllF = "Tracks/{}/hPtVsDCAxyRecPrimAll"; +static constexpr std::string_view CpTvsDCAxyWeakAll = "/hPtVsDCAxyRecWeakAll"; +static constexpr std::string_view CpTvsDCAxyWeakAllF = "Tracks/{}/hPtVsDCAxyRecWeakAll"; +static constexpr std::string_view CpTvsDCAxyMatAll = "/hPtVsDCAxyRecMatAll"; +static constexpr std::string_view CpTvsDCAxyMatAllF = "Tracks/{}/hPtVsDCAxyRecMatAll"; static constexpr std::string_view CpTgenPrimSgn = "/hPtGenPrimSgn"; static constexpr std::string_view CpTgenPrimSgnF = "Tracks/{}/hPtGenPrimSgn"; -static constexpr std::string_view CpTgenPrimSgnINEL = "/hPtGenPrimSgnINEL"; -static constexpr std::string_view CpTgenPrimSgnINELF = "Tracks/{}/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTrecCollPrimSgn = "/hPtRecCollPrimSgn"; static constexpr std::string_view CpTrecCollPrimSgnF = "Tracks/{}/hPtRecCollPrimSgn"; -static constexpr std::string_view CpTmcClosurePrim = "/hPtMCclosurePrim"; -static constexpr std::string_view CpTmcClosurePrimF = "Tracks/{}/hPtMCclosurePrim"; +static constexpr std::string_view CpTmcClosureGenPrim = "/hPtMCclosureGenPrim"; +static constexpr std::string_view CpTmcClosureGenPrimF = "Tracks/{}/hPtMCclosureGenPrim"; +static constexpr std::string_view CpTmcClosureRec = "/hPtMCclosureRec"; +static constexpr std::string_view CpTmcClosureRecF = "Tracks/{}/hPtMCclosureRec"; +static constexpr std::string_view CpTeffPrimRecEvt = "/hPtEffPrimRecEvt"; +static constexpr std::string_view CpTeffPrimRecEvtF = "Tracks/{}/hPtEffPrimRecEvt"; +static constexpr std::string_view CpTeffGenPrimRecEvt = "/hPtEffGenPrimRecEvt"; +static constexpr std::string_view CpTeffGenPrimRecEvtF = "Tracks/{}/hPtEffGenPrimRecEvt"; enum PidType { kEl = 0, @@ -198,27 +208,29 @@ struct MultE { std::array rhoLatticeFV0{0}; std::array fv0AmplitudeWoCalib{0}; - -std::array, NpartChrg> hPtEffRecPrim{}; -std::array, NpartChrg> hPtEffRecWeak{}; -std::array, NpartChrg> hPtEffRecMat{}; +std::array, NpartChrg> hPtGenRecEvt{}; +std::array, NpartChrg> hPtGenPrimRecEvt{}; std::array, NpartChrg> hPtEffRec{}; std::array, NpartChrg> hPtEffGen{}; -std::array, NpartChrg> hPtGenRecEvt{}; -std::array, NpartChrg> hPtGenPrimRecEvt{}; -std::array, NpartChrg> hPtEffGenPrim{}; -std::array, NpartChrg> hPtEffGenWeak{}; -std::array, NpartChrg> hPtEffGenMat{}; -std::array, NpartChrg> hPtVsDCAxyPrim{}; -std::array, NpartChrg> hPtVsDCAxyWeak{}; -std::array, NpartChrg> hPtVsDCAxyMat{}; -std::array, NpartChrg> hDCAxyBadCollPrim{}; -std::array, NpartChrg> hDCAxyBadCollWeak{}; -std::array, NpartChrg> hDCAxyBadCollMat{}; +std::array, NpartChrg> hPtEffRecGoodCollPrim{}; +std::array, NpartChrg> hPtEffRecGoodCollWeak{}; +std::array, NpartChrg> hPtEffRecGoodCollMat{}; +std::array, NpartChrg> hPtEffGenPrim{}; +std::array, NpartChrg> hPtEffGenWeak{}; +std::array, NpartChrg> hPtEffGenMat{}; +std::array, NpartChrg> hDCAxyRecBadCollPrim{}; +std::array, NpartChrg> hDCAxyRecBadCollWeak{}; +std::array, NpartChrg> hDCAxyRecBadCollMat{}; +std::array, NpartChrg> hPtVsDCAxyRecGoodCollPrim{}; +std::array, NpartChrg> hPtVsDCAxyRecGoodCollWeak{}; +std::array, NpartChrg> hPtVsDCAxyRecGoodCollMat{}; struct FlattenictyPikp { - HistogramRegistry flatchrg{"flatchrg", {}, OutputObjHandlingPolicy::AnalysisObject, true, false}; + HistogramRegistry registryData{"registryData", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry registryMC{"registryMC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry registryQC{"registryQC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + OutputObj listEfficiency{"Efficiency"}; Service pdg; @@ -265,20 +277,17 @@ struct FlattenictyPikp { Configurable cfgRemoveNoTimeFrameBorder{"cfgRemoveNoTimeFrameBorder", false, "Bunch crossing is far from Time Frame borders"}; Configurable cfgRemoveITSROFrameBorder{"cfgRemoveITSROFrameBorder", false, "Bunch crossing is far from ITS RO Frame border"}; Configurable cfgCutVtxZ{"cfgCutVtxZ", 10.0f, "Accepted z-vertex range"}; - Configurable cfgINELCut{"cfgINELCut", true, "INEL event selection"}; Configurable cfgRemoveNoSameBunchPileup{"cfgRemoveNoSameBunchPileup", true, "Reject collisions in case of pileup with another collision in the same foundBC"}; Configurable cfgRequireIsGoodZvtxFT0vsPV{"cfgRequireIsGoodZvtxFT0vsPV", true, "Small difference between z-vertex from PV and from FT0"}; Configurable cfgRequireIsVertexITSTPC{"cfgRequireIsVertexITSTPC", false, "At least one ITS-TPC track (reject vertices built from ITS-only tracks)"}; Configurable cfgRequirekIsVertexTOFmatched{"cfgRequirekIsVertexTOFmatched", false, "Require kIsVertexTOFmatched: at least one of vertex contributors is matched to TOF"}; + Configurable useMultMCmidrap{"useMultMCmidrap", true, "use generated Nch in ∣eta∣ < 0.8"}; + Configurable cfgUseInelgt0wTVX{"cfgUseInelgt0wTVX", true, "Use INEL > 0 condition with TVX trigger, i.e. FT0A and FT0C acceptance"}; } evtSelOpt; struct : ConfigurableGroup { - Configurable useFlatData{"useFlatData", true, "use flattenicity from rec collisions"}; - } flatSelOpt; - - struct : ConfigurableGroup { - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT binning"}; - ConfigurableAxis axisPtV0s{"axisPtV0s", {VARIABLE_WIDTH, 0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.5, 3.0, 3.5, 4, 5, 7, 9, 12, 15, 20}, "pT V0s binning"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.4, 4.8, 5.2, 5.6, 6, 6.5, 7, 7.5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}, "pT binning"}; + ConfigurableAxis axisPtV0s{"axisPtV0s", {VARIABLE_WIDTH, 0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.4, 4.8, 5.2, 5.6, 6, 6.4, 6.8, 7.2, 7.6, 8, 8.4, 8.8, 9.2, 9.6, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 20}, "pT V0s binning"}; ConfigurableAxis axisFlatPerc{"axisFlatPerc", {102, -0.01, 1.01}, "Flattenicity percentiles binning"}; ConfigurableAxis axisMultPerc{"axisMultPerc", {VARIABLE_WIDTH, 0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0 percentiles binning"}; ConfigurableAxis axisVertexZ{"axisVertexZ", {80, -20., 20.}, "Vertex z binning"}; @@ -326,8 +335,6 @@ struct FlattenictyPikp { // common selection Configurable cfgV0TypeSel{"cfgV0TypeSel", 1, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable cfgV0Ymax{"cfgV0Ymax", 0.5f, "Maximum rapidity of V0s"}; - Configurable cfgPtDaughterMin{"cfgPtDaughterMin", 0.1f, "minimum pT of the V0 daughter tracks"}; - Configurable cfgPtDaughterMax{"cfgPtDaughterMax", 20.0f, "maximum pT of the V0 daughter tracks"}; Configurable cfgRejectV0sAtTPCSector{"cfgRejectV0sAtTPCSector", true, "Reject V0s close to the TPC sector boundaries"}; Configurable cfgRequireITS{"cfgRequireITS", true, "Additional cut on the ITS requirement"}; Configurable cfgNsigmaElTPC{"cfgNsigmaElTPC", 5.0, "max nsigma of TPC for electorn"}; @@ -407,10 +414,12 @@ struct FlattenictyPikp { TrackSelection selTrkGlobal; Configurable isCustomTracks{"isCustomTracks", true, "Use custom track cuts"}; - Configurable minPt{"minPt", 0.15f, "Set minimum pT of tracks"}; - Configurable maxPt{"maxPt", 20.0f, "Set maximum pT of tracks"}; + Configurable minPt{"minPt", 0.1f, "Set minimum pT of tracks"}; + Configurable maxPt{"maxPt", 1e10f, "Set maximum pT of tracks"}; Configurable requireEta{"requireEta", 0.8f, "Set eta range of tracks"}; Configurable setITSreq{"setITSreq", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; + Configurable requireITSminCl{"requireITSminCl", false, "Require additional cut on ITS clusters"}; + Configurable setITSminCl{"setITSminCl", 7, "Additional cut on ITS clusters"}; Configurable requireITS{"requireITS", true, "Additional cut on the ITS requirement"}; Configurable requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"}; Configurable requireGoldenChi2{"requireGoldenChi2", true, "Additional cut on the GoldenChi2"}; @@ -506,7 +515,9 @@ struct FlattenictyPikp { selTrkGlobal.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); selTrkGlobal.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); selTrkGlobal.SetMinNClustersITS(minITSnClusters.value); - selTrkGlobal.SetRequireHitsInITSLayers(1, {0, 1, 2}); // GlobalTrackRun3ITSMatching::Run3ITSibAny + if (requireITSminCl.value) { + selTrkGlobal.SetRequireHitsInITSLayers(setITSminCl.value, {0, 1, 2, 3, 4, 5, 6}); + } selTrkGlobal.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); selTrkGlobal.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); // // selTrkGlobal.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); }); @@ -552,221 +563,255 @@ struct FlattenictyPikp { LOG(fatal) << "No valid option for mult estimator " << multEst; } - // Event counter - flatchrg.add("Events/hEvtSel", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{nEvtSel, 0, nEvtSel}}}); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelAll + 1, "Events read"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelSel8 + 1, "Evt. sel8"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelNoITSROFrameBorder + 1, "NoITSROFrameBorder"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoTimeFrameBorder + 1, "NoTimeFrameBorder"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoSameBunchPileup + 1, "NoSameBunchPileup"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsGoodZvtxFT0vsPV + 1, "IsGoodZvtxFT0vsPV"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexITSTPC + 1, "IsVertexITSTPC"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexTOFmatched + 1, "IsVertexTOFmatched"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelVtxZ + 1, "Vtx-z pos"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelINELgt0 + 1, "INEL>0"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelRCTFlagChecker + 1, "RCT Flag Checker"); - // Track counter - flatchrg.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {kTH1F, {{nTrkSel, 0, nTrkSel}}}); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelAll + 1, "All"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "Eta"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "Pt"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelDCA + 1, "DCA"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkNRowsTPC + 1, "trkNRowsTPC"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsFound + 1, "NClsTPCFound"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsPID + 1, "NClsTPCPid"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelTPCBndr + 1, "TPC Boundary"); - // V0 counter - flatchrg.add("Tracks/V0qa/hV0Sel", "Number of V0s; Cut; #Tracks Passed Cut", {kTH1F, {{nV0Sel, 0, nV0Sel}}}); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelAll + 1, "All"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectSameSign + 1, "Reject same sign"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectV0sAtTPCSector + 1, "Reject V0s at TPC sector"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelCosPA + 1, "Cos PA"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelV0radius + 1, "V0 radius"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAposToPV + 1, "DCA pos to PV"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDaughters + 1, "V0 daughters' sel."); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAv0daughter + 1, "DCA v0 daughter"); - if (trkSelOpt.cfgRejectTrkAtTPCSector || v0SelOpt.cfgRejectV0sAtTPCSector) { fPhiCutLow = new TF1("fPhiCutLow", trkSelOpt.cfgGeoTrkCutMin.value.c_str(), 0, 100); fPhiCutHigh = new TF1("fPhiCutHigh", trkSelOpt.cfgGeoTrkCutMax.value.c_str(), 0, 100); } + registryQC.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); + + // Event counter + registryQC.add("Events/hEvtSel", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{nEvtSel, 0, nEvtSel}}}); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelAll + 1, "Events read"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelSel8 + 1, "Evt. sel8"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelNoITSROFrameBorder + 1, "NoITSROFrameBorder"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoTimeFrameBorder + 1, "NoTimeFrameBorder"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoSameBunchPileup + 1, "NoSameBunchPileup"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsGoodZvtxFT0vsPV + 1, "IsGoodZvtxFT0vsPV"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexITSTPC + 1, "IsVertexITSTPC"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexTOFmatched + 1, "IsVertexTOFmatched"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelVtxZ + 1, "Vtx-z pos"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelINELgt0 + 1, "INEL>0"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelRCTFlagChecker + 1, "RCT Flag Checker"); + // FV0 QA + registryQC.add("FV0/hFV0AmplWCalib", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + registryQC.add("FV0/hFV0AmplvsVtxzWoCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); + registryQC.add("FV0/hFV0AmplvsVtxzCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); + registryQC.add("FV0/hFV0amp", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + registryQC.add("FV0/pFV0amp", "", kTProfile, {channelFV0Axis}); + registryQC.add("FV0/hFV0ampCorr", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + + LOG(info) << "Size of the QC histograms:"; + registryQC.print(); + if (doprocessFlat) { - flatchrg.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); - flatchrg.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); - flatchrg.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); + // Track counter + registryData.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {kTH1F, {{nTrkSel, 0, nTrkSel}}}); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelAll + 1, "All"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "Eta"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "Pt"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelDCA + 1, "DCA"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkNRowsTPC + 1, "trkNRowsTPC"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsFound + 1, "NClsTPCFound"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsPID + 1, "NClsTPCPid"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelTPCBndr + 1, "TPC Boundary"); + // V0 counter + registryData.add("Tracks/V0qa/hV0Sel", "Number of V0s; Cut; #Tracks Passed Cut", {kTH1F, {{nV0Sel, 0, nV0Sel}}}); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelAll + 1, "All"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectSameSign + 1, "Reject same sign"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectV0sAtTPCSector + 1, "Reject V0s at TPC sector"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelCosPA + 1, "Cos PA"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelV0radius + 1, "V0 radius"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAposToPV + 1, "DCA pos to PV"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDaughters + 1, "V0 daughters' sel."); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAv0daughter + 1, "DCA v0 daughter"); + + registryData.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); + registryData.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); if (cfgFillNclVsPhiCutQaHist || cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { if (cfgFillNclVsPhiCutQaHist) { - flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); - flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + registryData.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); + registryData.add("Tracks/postSel/hPtPhiNclTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryData.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryData.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); + registryData.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); } if (cfgFillTrackQaHist) { - flatchrg.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); - flatchrg.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); - flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); - flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); - flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); - flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); + registryData.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); + registryData.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); + registryData.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); + registryData.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); + registryData.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); + registryData.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); + registryData.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); + registryData.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); // tpc - flatchrg.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); - flatchrg.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); - flatchrg.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); + registryData.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); + registryData.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); + registryData.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); // its - flatchrg.add("Tracks/postSel/hITSnCls", " ; # ITS clusters", kTH1F, {{8, -0.5, 7.5}}); - flatchrg.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", kTH1F, {{100, -0.5, 99.5}}); + registryData.add("Tracks/postSel/hITSnCls", " ; # ITS clusters", kTH1F, {{8, -0.5, 7.5}}); + registryData.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", kTH1F, {{100, -0.5, 99.5}}); // tof - flatchrg.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {kTH2F, {pAxis, {120, 0.0, 1.2}}}); - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); + registryData.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {kTH2F, {pAxis, {120, 0.0, 1.2}}}); + registryData.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); } if (cfgFilldEdxQaHist) { if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postCalib/all/hMIP", "; mult; flat; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateau", "; mult; flat; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hMIP", "; mult; flat; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hPlateau", "; mult; flat; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); } else { - flatchrg.add("Tracks/postCalib/all/hMIP", "; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateau", "; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hMIP", "; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hPlateau", "; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); } - flatchrg.add("Tracks/postCalib/all/hMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/pMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTProfile, {phiAxis}}); - flatchrg.add("Tracks/postCalib/all/hMIPVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/pPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTProfile, {phiAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateauVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); - flatchrg.addClone("Tracks/postCalib/all/", "Tracks/preCalib/all/"); + registryData.add("Tracks/postCalib/all/hMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/pMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTProfile, {phiAxis}}); + registryData.add("Tracks/postCalib/all/hMIPVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); + registryData.add("Tracks/postCalib/all/hPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/pPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTProfile, {phiAxis}}); + registryData.add("Tracks/postCalib/all/hPlateauVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); + registryData.addClone("Tracks/postCalib/all/", "Tracks/preCalib/all/"); if (cfgFillChrgType) { - flatchrg.addClone("Tracks/postCalib/all/", "Tracks/postCalib/pos/"); - flatchrg.addClone("Tracks/postCalib/all/", "Tracks/postCalib/neg/"); - flatchrg.addClone("Tracks/preCalib/all/", "Tracks/preCalib/pos/"); - flatchrg.addClone("Tracks/preCalib/all/", "Tracks/preCalib/neg/"); + registryData.addClone("Tracks/postCalib/all/", "Tracks/postCalib/pos/"); + registryData.addClone("Tracks/postCalib/all/", "Tracks/postCalib/neg/"); + registryData.addClone("Tracks/preCalib/all/", "Tracks/preCalib/pos/"); + registryData.addClone("Tracks/preCalib/all/", "Tracks/preCalib/neg/"); } } if (cfgFillDCAxyHist) { for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTvsDCAxyF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + registryData.add({fmt::format(CpTvsDCAxyF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); } } } - flatchrg.addClone("Tracks/postSel/", "Tracks/preSel/"); - // FV0 QA - flatchrg.add("FV0/hFV0AmplWCalib", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); - flatchrg.add("FV0/hFV0AmplvsVtxzWoCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); - flatchrg.add("FV0/hFV0AmplvsVtxzCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); - flatchrg.add("FV0/hFV0amp", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); - flatchrg.add("FV0/pFV0amp", "", kTProfile, {channelFV0Axis}); - flatchrg.add("FV0/hFV0ampCorr", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + registryData.addClone("Tracks/postSel/", "Tracks/preSel/"); // V0's QA - flatchrg.add("Tracks/V0qa/hV0Pt", "pT", kTH1F, {ptAxisV0s}); - flatchrg.add("Tracks/V0qa/hV0ArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + registryData.add("Tracks/V0qa/hV0Pt", "pT", kTH1F, {ptAxisV0s}); + registryData.add("Tracks/V0qa/hV0ArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); // daughters' QA - flatchrg.add("Tracks/V0qa/el/Ga/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); - flatchrg.add("Tracks/V0qa/pi/K0s/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); - flatchrg.add("Tracks/V0qa/el/Ga/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); - flatchrg.add("Tracks/V0qa/pi/K0s/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); - flatchrg.add("Tracks/V0qa/el/Ga/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); - flatchrg.add("Tracks/V0qa/pi/K0s/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); - flatchrg.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/La/"); - flatchrg.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/ALa/"); - flatchrg.addClone("Tracks/V0qa/pi/La/", "Tracks/V0qa/pr/La/"); - flatchrg.addClone("Tracks/V0qa/pi/ALa/", "Tracks/V0qa/pr/ALa/"); + registryData.add("Tracks/V0qa/el/Ga/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + registryData.add("Tracks/V0qa/pi/K0s/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + registryData.add("Tracks/V0qa/el/Ga/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); + registryData.add("Tracks/V0qa/pi/K0s/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); + registryData.add("Tracks/V0qa/el/Ga/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); + registryData.add("Tracks/V0qa/pi/K0s/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); + registryData.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/La/"); + registryData.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/ALa/"); + registryData.addClone("Tracks/V0qa/pi/La/", "Tracks/V0qa/pr/La/"); + registryData.addClone("Tracks/V0qa/pi/ALa/", "Tracks/V0qa/pr/ALa/"); // dEdx PID - flatchrg.add({"Tracks/all/hdEdx", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/all/hdEdx", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); // Clean samples if (cfgFillV0Hist) { if (cfgStoreThnSparse) { - flatchrg.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); } else { - flatchrg.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); } - flatchrg.add("Tracks/CleanTof/all/hBetaVsP", ";Momentum (GeV/#it{c}); #beta", kTH2F, {{{ptAxisV0s}, {120, 0., 1.2}}}); - flatchrg.add("Tracks/CleanTof/all/hTofExpPi", ";Momentum (GeV/#it{c});#it{t}^{#pi}_{Exp}/#it{t}_{TOF}", kTH2F, {{{ptAxisV0s}, {100, 0.2, 1.2}}}); + registryData.add("Tracks/CleanTof/all/hBetaVsP", ";Momentum (GeV/#it{c}); #beta", kTH2F, {{{ptAxisV0s}, {120, 0., 1.2}}}); + registryData.add("Tracks/CleanTof/all/hTofExpPi", ";Momentum (GeV/#it{c});#it{t}^{#pi}_{Exp}/#it{t}_{TOF}", kTH2F, {{{ptAxisV0s}, {100, 0.2, 1.2}}}); if (cfgFillChrgType) { - flatchrg.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/pos/"); - flatchrg.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/neg/"); - flatchrg.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/pos/"); - flatchrg.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/neg/"); + registryData.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/pos/"); + registryData.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/neg/"); + registryData.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/pos/"); + registryData.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/neg/"); } } if (cfgFillChrgType) { - flatchrg.addClone("Tracks/all/", "Tracks/pos/"); - flatchrg.addClone("Tracks/all/", "Tracks/neg/"); + registryData.addClone("Tracks/all/", "Tracks/pos/"); + registryData.addClone("Tracks/all/", "Tracks/neg/"); } + LOG(info) << "Size of the Data histograms:"; + registryData.print(); } if (doprocessMC) { - auto h = flatchrg.add("hEvtGenRec", "Generated and Reconstructed MC Collisions", kTH1F, {{3, 0.5, 3.5}}); + registryMC.add({"Events/ResponseGen", ";N_{ch,FV0};1-#rho_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); + registryMC.add("Events/h1flatencityFV0MCGen", "", {kTH1F, {flatAxis}}); + registryMC.add("Events/hFlatMCGen", "Events/hFlatMCGen", {kTH1F, {flatAxis}}); + registryMC.add("Events/hFlatMCRec", "Events/hFlatMCRec", {kTH1F, {flatAxis}}); + // Event counter + auto h = registryMC.add("Events/hEvtGenRec", "Generated and Reconstructed MC Collisions", kTH1F, {{3, 0.5, 3.5}}); h->GetXaxis()->SetBinLabel(1, "Gen coll"); h->GetXaxis()->SetBinLabel(2, "Rec coll"); h->GetXaxis()->SetBinLabel(3, "INEL>0"); - - flatchrg.add("hEvtMcGenColls", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{5, 0.5, 5.5}}}); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(1, "Gen. coll"); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(2, "At least 1 reco"); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(3, "Reco. coll."); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(4, "Reco. good coll."); - - flatchrg.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); - flatchrg.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); - + registryMC.add("Events/hEvtMcGen", "Events/hEvtMcGen", {kTH1F, {{4, 0.f, 4.f}}}); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(1, "all"); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(2, "z-vtx"); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(4, "INELgt0TVX"); + registryMC.add("Events/hEvtMCRec", "Events/hEvtMCRec", {kTH1F, {{3, 0.f, 3.f}}}); + registryMC.get(HIST("Events/hEvtMCRec"))->GetXaxis()->SetBinLabel(1, "all"); + registryMC.get(HIST("Events/hEvtMCRec"))->GetXaxis()->SetBinLabel(2, "evt sel"); + registryMC.get(HIST("Events/hEvtMCRec"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + registryMC.add("Events/hEvtMcGenColls", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{4, 0.5, 4.5}}}); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(1, "Gen. coll"); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(2, "At least 1 reco"); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(3, "Reco. coll."); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(4, "Reco. good coll."); + // + registryMC.add("Events/hNchVsCent", "Gen Nch vs Cent; mult; Gen Nch (|#eta|<0.8)", {kTH2F, {multAxis, nChAxis}}); + registryMC.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); + registryMC.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); + registryMC.add("Events/hNchTVX", "Nch in FT0A+FT0C; Nch; status", {kTH2F, {nChAxis, {2, 0, 2}}}); + registryMC.add({"Tracks/hPtFakes", "Fake tracks; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + // Event loss + registryMC.add("Events/hNchVsFlatGenINELgt0", "Gen Nch w/o Evt sel; Gen Nch (|#eta|<0.8); flat", {kTH2F, {nChAxis, flatAxis}}); + registryMC.add("Events/hNchVsFlatGenINELgt0wRecEvtSel", "Gen Nch w/ Nrec > 0 + Evt sel; Gen Nch (|#eta|<0.8); flat", {kTH2F, {nChAxis, flatAxis}}); + // Event split + registryMC.add("Events/hCentVsFlatRecINELgt0", "Gen evt w/o Evt sel; mult; flat", {kTH2F, {multAxis, flatAxis}}); + registryMC.add("Events/hCentVsFlatRecINELgt0wRecEvt", "Gen evt w/ Nrec > 0; mult; flat", {kTH2F, {multAxis, flatAxis}}); + registryMC.add("Events/hCentVsFlatRecINELgt0wRecEvtSel", "Gen evt w/ Nrec > 0 + Evt sel; mult; flat", {kTH2F, {multAxis, flatAxis}}); + for (int i = 0; i < Npart; ++i) { + // Signal loss + registryMC.add({fmt::format(CpTgenPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTrecCollPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen Nch w/ Nrec > 0; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + // Closure test + registryMC.add({fmt::format(CpTmcClosureGenPrimF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTmcClosureRecF.data(), CspeciesAll[i]).c_str(), "Gen Nch w/ Nrec > 0 + Evt. sel; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + } if (cfgFillNclVsPhiCutQaHist) { - flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); - flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + registryMC.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); + registryMC.add("Tracks/postSel/hPtPhiNclTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryMC.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryMC.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryMC.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); + registryMC.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryMC.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); } - flatchrg.addClone("Tracks/postSel/", "Tracks/preSel/"); + registryMC.addClone("Tracks/postSel/", "Tracks/preSel/"); for (int i = 0; i < NpartChrg; i++) { const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); - hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); - hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtGenRecEvt[i] = registryMC.add("Tracks/hPtGenRecEvt" + strID, "Gen evt w/ Nrec > 0; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtGenPrimRecEvt[i] = registryMC.add("Tracks/hPtGenPrimRecEvt" + strID, "Gen evt w/ Nrec > 0 (primary); mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffGenPrim[i] = registryMC.add("Tracks/hPtEffGenPrim" + strID, "Gen evt w/o rec Evt; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffGenWeak[i] = registryMC.add("Tracks/hPtEffGenWeak" + strID, "Gen evt w/o rec Evt; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffGenMat[i] = registryMC.add("Tracks/hPtEffGenMat" + strID, "Gen evt w/o rec Evt; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffRecGoodCollPrim[i] = registryMC.add("Tracks/hPtEffRecGoodCollPrim" + strID, "; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffRecGoodCollWeak[i] = registryMC.add("Tracks/hPtEffRecGoodCollWeak" + strID, "; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffRecGoodCollMat[i] = registryMC.add("Tracks/hPtEffRecGoodCollMat" + strID, "; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hDCAxyRecBadCollPrim[i] = registryMC.add("Tracks/hDCAxyRecBadCollPrim" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyRecBadCollWeak[i] = registryMC.add("Tracks/hDCAxyRecBadCollWeak" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyRecBadCollMat[i] = registryMC.add("Tracks/hDCAxyRecBadCollMat" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyRecGoodCollPrim[i] = registryMC.add("Tracks/hPtVsDCAxyRecGoodCollPrim" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyRecGoodCollWeak[i] = registryMC.add("Tracks/hPtVsDCAxyRecGoodCollWeak" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyRecGoodCollMat[i] = registryMC.add("Tracks/hPtVsDCAxyRecGoodCollMat" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); } for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CdEdxMcRecPrimF.data(), CspeciesAll[i]).c_str(), "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryMC.add({fmt::format(CpTeffGenPrimRecEvtF.data(), CspeciesAll[i]).c_str(), "Gen evt w/ Nrec > 0; mult; flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTeffPrimRecEvtF.data(), CspeciesAll[i]).c_str(), "Gen evt w/ Nrec > 0 + Evt sel; mult; flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + registryMC.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + registryMC.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + registryMC.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + registryMC.add({fmt::format(CdEdxMcRecPrimF.data(), CspeciesAll[i]).c_str(), "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); } - flatchrg.add({"hPtOutNoEtaCut", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); - flatchrg.add({"PtOutFakes", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); - flatchrg.add({"ResponseGen", " ; N_{part}; F_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); - flatchrg.add("h1flatencityFV0MCGen", "", kTH1F, {{102, -0.01, 1.01, "1-flatencityFV0"}}); - // Hash list for efficiency listEfficiency.setObject(new THashList); static_for<0, 1>([&](auto pidSgn) { @@ -777,45 +822,10 @@ struct FlattenictyPikp { initEfficiency(); initEfficiency(); }); - } - if (doprocessMCclosure) { - for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); - } + LOG(info) << "Size of the MC histograms:"; + registryMC.print(); } - - if (doprocessSgnLoss) { - flatchrg.add("hFlatMCGenRecColl", "hFlatMCGenRecColl", {kTH1F, {flatAxis}}); - flatchrg.add("hFlatMCGen", "hFlatMCGen", {kTH1F, {flatAxis}}); - // Event counter - flatchrg.add("hEvtMcGen", "hEvtMcGen", {kTH1F, {{4, 0.f, 4.f}}}); - flatchrg.get(HIST("hEvtMcGen"))->GetXaxis()->SetBinLabel(1, "all"); - flatchrg.get(HIST("hEvtMcGen"))->GetXaxis()->SetBinLabel(2, "z-vtx"); - flatchrg.get(HIST("hEvtMcGen"))->GetXaxis()->SetBinLabel(3, "INELgt0"); - flatchrg.add("hEvtMCRec", "hEvtMCRec", {kTH1F, {{4, 0.f, 4.f}}}); - flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(1, "all"); - flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(2, "evt sel"); - flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(3, "INELgt0"); - - flatchrg.add("hNchVsCent", "Gen Nch vs Cent;;Gen Nch (|#eta|<0.8)", {kTH2F, {multAxis, nChAxis}}); - // Event loss - flatchrg.add("hNchVsFlatGenINELgt0", "Gen Nch w/o Evt sel;;", {kTH2F, {nChAxis, flatAxis}}); - flatchrg.add("hNchVsFlatRecGt0INELgt0", "Gen Nch w/ Nrec > 0 + Evt. sel;;", {kTH2F, {nChAxis, flatAxis}}); - // Event split - flatchrg.add("hCentVsFlatRecINELgt0", "Gen evt w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); - flatchrg.add("hCentVsFlatRecGt0INELgt0", "Gen evt w/ Nrec > 0 + Evt. sel;;", {kTH2F, {multAxis, flatAxis}}); - flatchrg.add("hCentVsFlatRecGt0", "Gen evt w/ Nrec > 0 w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); - // Signal loss - for (int i = 0; i < Npart; ++i) { - flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), CspeciesAll[i]).c_str(), "Gen evt w INELgt0 sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), CspeciesAll[i]).c_str(), " ;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); - } - } - - LOG(info) << "Size of the histograms:"; - flatchrg.print(); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -926,9 +936,9 @@ struct FlattenictyPikp { const float trkLength = track.length(); const float tExpPiTOF = track.tofExpSignalPi(tTOF); if (track.p() >= trkSelOpt.cfgMomSelPiTOF && trkLength > Cnull && tTOF > Cnull) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hTofExpPi"), track.p(), tExpPiTOF / tTOF); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hTofExpPi"), track.p(), tExpPiTOF / tTOF); if (std::abs((tExpPiTOF / tTOF) - Cone) < trkSelOpt.cfgTofBetaPiMax) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hBetaVsP"), track.p(), track.beta()); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hBetaVsP"), track.p(), track.beta()); // if (std::abs(track.tpcNSigmaPi()) < v0SelOpt.cfgNsigmaPiTPC && std::abs(track.tofNSigmaPi()) < v0SelOpt.cfgNsigmaPiTOF) { return true; // } @@ -973,7 +983,7 @@ struct FlattenictyPikp { continue; } if (track.hasTOF() && (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax))) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[id]) + HIST(CpTvsDCAxy), mult, flat, track.pt(), track.dcaXY()); + registryData.fill(HIST(Cprefix) + HIST(CspeciesAll[id]) + HIST(CpTvsDCAxy), mult, flat, track.pt(), track.dcaXY()); } } } @@ -992,7 +1002,7 @@ struct FlattenictyPikp { const float mult = getMult(collision); const float flat = fillFlat(collision); - flatchrg.fill(HIST("Events/hFlatVsMultEst"), flat, mult); + registryData.fill(HIST("Events/hFlatVsMultEst"), flat, mult); for (const auto& track : tracks) { float dEdx = track.tpcSignal(); @@ -1052,12 +1062,12 @@ struct FlattenictyPikp { // PID TPC dEdx if (cfgFillChrgType) { if (track.sign() * track.p() > Cnull) { - flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kPos]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(Ccharge[kPos]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kNeg]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(Ccharge[kNeg]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } } else { - flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kAll]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(Ccharge[kAll]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } // TOF pions @@ -1066,22 +1076,22 @@ struct FlattenictyPikp { if (cfgFillChrgType) { if (track.sign() * track.p() > Cnull) { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } else { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } } else { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } } @@ -1159,19 +1169,19 @@ struct FlattenictyPikp { } if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1180,19 +1190,19 @@ struct FlattenictyPikp { fillV0QA(v0, negTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1201,19 +1211,19 @@ struct FlattenictyPikp { fillV0QA(v0, posTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1222,19 +1232,19 @@ struct FlattenictyPikp { fillV0QA(v0, negTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1299,6 +1309,39 @@ struct FlattenictyPikp { return nCharged; } + template + bool isInelGt0wTVX(P const& particles) + { + int nChrgMc = 0; + int nChrgFT0A = 0; + int nChrgFT0C = 0; + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + // trigger TVX + if (particle.eta() > CminAccFT0A && particle.eta() < CmaxAccFT0A) { + nChrgFT0A++; + } + if (particle.eta() > CminAccFT0C && particle.eta() < CmaxAccFT0C) { + nChrgFT0C++; + } + nChrgMc++; + } + if (nChrgFT0A == CnullInt || nChrgFT0C == CnullInt) { + registryMC.fill(HIST("Events/hNchTVX"), nChrgMc, 0.5); + return false; + } + registryMC.fill(HIST("Events/hNchTVX"), nChrgMc, 1.5); + if (nChrgMc == CnullInt) { + return false; + } + return true; + } + void phiMod(float& phimodn, const int& mag, const int& charge) { if (mag < Cnull) // for negative polarity field @@ -1316,45 +1359,45 @@ struct FlattenictyPikp { inline void fillNclVsPhiCutQaHist(T const& track, const float phimodn) { if (cfgFillNclVsPhiCutQaHist) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhi"), track.pt(), phimodn); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclPIDTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhi"), track.pt(), phimodn); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclPIDTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclTPC"), track.pt(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclTPC"), track.pt(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); } } template bool isGoodTrack(T const& track, const int magfield) { - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelAll); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelAll); if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelEta); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelEta); if (track.pt() < trkSelOpt.cfgTrkPtMin) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelPt); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelPt); if (!isDCAxyCut(track)) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelDCA); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelDCA); if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); + registryData.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsFound); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelNClsFound); if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); float phimodn = track.phi(); phiMod(phimodn, magfield, track.sign()); @@ -1367,16 +1410,16 @@ struct FlattenictyPikp { if (cfgFillNclVsPhiCutQaHist) { fillNclVsPhiCutQaHist(track, phimodn); } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); return true; } template void fillV0QA(V const& v0, U const& track) { - flatchrg.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hArmPod"), v0.alpha(), v0.qtarm()); - flatchrg.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hNclVsEta"), track.eta(), track.tpcNClsPID()); - flatchrg.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hdEdxMIPVsEta"), track.eta(), track.tpcSignal()); + registryData.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hArmPod"), v0.alpha(), v0.qtarm()); + registryData.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hNclVsEta"), track.eta(), track.tpcNClsPID()); + registryData.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hdEdxMIPVsEta"), track.eta(), track.tpcSignal()); } template @@ -1479,11 +1522,11 @@ struct FlattenictyPikp { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelAll); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelAll); if (posTrack.sign() * negTrack.sign() > Cnull) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); float posTrackPhiModn = posTrack.phi(); float negTrackPhiModn = negTrack.phi(); @@ -1494,32 +1537,32 @@ struct FlattenictyPikp { return false; } } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectV0sAtTPCSector); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectV0sAtTPCSector); // V0 topological selections if (v0.v0cosPA() < v0SelOpt.cfgv0cospa) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelCosPA); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelCosPA); if (v0.v0radius() < v0SelOpt.cfgv0Rmin || v0.v0radius() > v0SelOpt.cfgv0Rmax) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelV0radius); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelV0radius); if (std::abs(v0.dcapostopv()) < v0SelOpt.cfgDCAposToPV || std::abs(v0.dcanegtopv()) < v0SelOpt.cfgDCAnegToPV) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAposToPV); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAposToPV); // selection of V0 daughters if (!(isGoodV0DaughterTrack(posTrack) && isGoodV0DaughterTrack(negTrack))) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDaughters); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDaughters); if (v0.dcaV0daughters() > v0SelOpt.cfgDCAv0daughter) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAv0daughter); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAv0daughter); if constexpr (fillHist) { - flatchrg.fill(HIST("Tracks/V0qa/hV0Pt"), v0.pt()); - flatchrg.fill(HIST("Tracks/V0qa/hV0ArmPod"), v0.alpha(), v0.qtarm()); + registryData.fill(HIST("Tracks/V0qa/hV0Pt"), v0.pt()); + registryData.fill(HIST("Tracks/V0qa/hV0ArmPod"), v0.alpha(), v0.qtarm()); } return true; } @@ -1530,9 +1573,6 @@ struct FlattenictyPikp { if (track.eta() < v0SelOpt.cfgV0etamin || track.eta() > v0SelOpt.cfgV0etamax) { return false; } - if (track.pt() < v0SelOpt.cfgPtDaughterMin || track.pt() > v0SelOpt.cfgPtDaughterMax) { - return false; - } if (!track.hasTPC()) { return false; } @@ -1571,38 +1611,38 @@ struct FlattenictyPikp { inline void fillTrackQA(T const& track) { if constexpr (fillHist) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPt"), track.pt()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPhi"), track.phi()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hEta"), track.eta()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAXYvsPt"), track.pt(), track.dcaXY()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAZvsPt"), track.pt(), track.dcaZ()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPt"), track.pt()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPhi"), track.phi()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hEta"), track.eta()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAXYvsPt"), track.pt(), track.dcaXY()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAZvsPt"), track.pt(), track.dcaZ()); if (track.hasTPC() && track.hasITS()) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCCluster"), track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsPt"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsPt"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsEta"), track.eta(), track.tpcNClsFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsEta"), track.eta(), track.tpcNClsPID()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCnClsShared"), track.tpcNClsShared()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hChi2ITSTrkSegment"), track.itsChi2NCl()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hITSnCls"), track.itsNCls()); - } - - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFPvsBeta"), track.p(), track.beta()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCCluster"), track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsPt"), track.pt(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsPt"), track.pt(), track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsEta"), track.eta(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsEta"), track.eta(), track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCnClsShared"), track.tpcNClsShared()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hChi2ITSTrkSegment"), track.itsChi2NCl()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hITSnCls"), track.itsNCls()); + } + + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFPvsBeta"), track.p(), track.beta()); if (track.beta() > trkSelOpt.cfgTOFBetaPion && track.beta() < trkSelOpt.cfgTOFBetaPion + 0.05) { // TOF pions - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFpi"), track.eta(), track.p(), track.tpcSignal()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFpi"), track.eta(), track.p(), track.tpcSignal()); } if (std::abs(track.eta()) < trkSelOpt.cfgTrkEtaMax) { if (isDCAxyWoCut(track)) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); } } } - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPVsPtEta"), track.p(), track.pt(), track.eta()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPVsPtEta"), track.p(), track.pt(), track.eta()); } template @@ -1614,24 +1654,24 @@ struct FlattenictyPikp { if (track.p() >= trkSelOpt.cfgMomMIPMin && track.p() <= trkSelOpt.cfgMomMIPMax) { if (dEdx > trkSelOpt.cfgDeDxMIPMin && dEdx < trkSelOpt.cfgDeDxMIPMax) { // MIP pions if (cfgStoreThnSparse) { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), mult, flat, track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), mult, flat, track.eta(), dEdx); } else { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), track.eta(), dEdx); } - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhi"), track.phi(), dEdx); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhiVsEta"), track.phi(), dEdx, track.eta()); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pMIPVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhiVsEta"), track.phi(), dEdx, track.eta()); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pMIPVsPhi"), track.phi(), dEdx); } if (dEdx > trkSelOpt.cfgDeDxMIPMax + 10. && dEdx < trkSelOpt.cfgDeDxMIPMax + 30.) { // Plateau electrons if (std::abs(track.beta() - 1) < trkSelOpt.cfgBetaPlateuMax) { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), mult, flat, track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), mult, flat, track.eta(), dEdx); } else { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), track.eta(), dEdx); } - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhi"), track.phi(), dEdx); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhiVsEta"), track.phi(), dEdx, track.eta()); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pPlateauVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhiVsEta"), track.phi(), dEdx, track.eta()); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pPlateauVsPhi"), track.phi(), dEdx); } } } @@ -1642,7 +1682,7 @@ struct FlattenictyPikp { bool isGoodEvent(C const& collision) { if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelAll); + registryQC.fill(HIST("Events/hEvtSel"), evtSelAll); } if (evtSelOpt.cfgCustomTVX) { if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) { @@ -1654,62 +1694,62 @@ struct FlattenictyPikp { } } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelSel8); + registryQC.fill(HIST("Events/hEvtSel"), evtSelSel8); } if (evtSelOpt.cfgRemoveITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelNoITSROFrameBorder); + registryQC.fill(HIST("Events/hEvtSel"), evtSelNoITSROFrameBorder); } if (evtSelOpt.cfgRemoveNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkNoTimeFrameBorder); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkNoTimeFrameBorder); } if (evtSelOpt.cfgRemoveNoSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkNoSameBunchPileup); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkNoSameBunchPileup); } if (evtSelOpt.cfgRequireIsGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsGoodZvtxFT0vsPV); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsGoodZvtxFT0vsPV); } if (evtSelOpt.cfgRequireIsVertexITSTPC && !collision.selection_bit(aod::evsel::kIsVertexITSTPC)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsVertexITSTPC); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsVertexITSTPC); } if (evtSelOpt.cfgRequirekIsVertexTOFmatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsVertexTOFmatched); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsVertexTOFmatched); } if (std::abs(collision.posZ()) > evtSelOpt.cfgCutVtxZ) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelVtxZ); - flatchrg.fill(HIST("Events/hVtxZ"), collision.posZ()); + registryQC.fill(HIST("Events/hEvtSel"), evtSelVtxZ); + registryQC.fill(HIST("Events/hVtxZ"), collision.posZ()); } - if (evtSelOpt.cfgINELCut && !collision.isInelGt0()) { + if (!collision.isInelGt0()) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelINELgt0); + registryQC.fill(HIST("Events/hEvtSel"), evtSelINELgt0); } if (rctCuts.requireRCTFlagChecker && !rctChecker(collision)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelRCTFlagChecker); + registryQC.fill(HIST("Events/hEvtSel"), evtSelRCTFlagChecker); } return true; } @@ -1819,7 +1859,11 @@ struct FlattenictyPikp { return val; break; case MultE::CmultFT0M: - return collision.centFT0M(); + if constexpr (!isMC) { + return collision.centFT0M(); + } else { + return collision.multMCFT0C() + collision.multMCFT0A(); + } break; case MultE::CmultTPC: if constexpr (!isMC) { @@ -1891,10 +1935,10 @@ struct FlattenictyPikp { int chv0 = fv0.channel()[ich]; int chv0phi = getFV0IndexPhi(chv0); if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0amp"), chv0, amplCh); - flatchrg.fill(HIST("FV0/pFV0amp"), chv0, amplCh); + registryQC.fill(HIST("FV0/hFV0amp"), chv0, amplCh); + registryQC.fill(HIST("FV0/pFV0amp"), chv0, amplCh); if (applyCalibGain) { - flatchrg.fill(HIST("FV0/hFV0ampCorr"), chv0, amplCh / fv0AmplCorr[chv0]); + registryQC.fill(HIST("FV0/hFV0ampCorr"), chv0, amplCh / fv0AmplCorr[chv0]); } } if (amplCh > Cnull) { @@ -1904,7 +1948,7 @@ struct FlattenictyPikp { if (chv0phi > Cnull) { fv0AmplitudeWoCalib[chv0phi] = amplCh; if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0AmplWCalib"), ich, fv0AmplitudeWoCalib[ich]); + registryQC.fill(HIST("FV0/hFV0AmplWCalib"), ich, fv0AmplitudeWoCalib[ich]); } if (chv0 < CinnerFV0) { rhoLatticeFV0[chv0phi] += amplCh; @@ -1912,12 +1956,12 @@ struct FlattenictyPikp { rhoLatticeFV0[chv0phi] += amplCh / 2.; } if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0AmplvsVtxzWoCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); + registryQC.fill(HIST("FV0/hFV0AmplvsVtxzWoCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); } if (applyCalibVtx) { rhoLatticeFV0[chv0phi] *= zVtxMap->GetBinContent(zVtxMap->GetXaxis()->FindBin(chv0phi), zVtxMap->GetYaxis()->FindBin(collision.posZ())); if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0AmplvsVtxzCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); + registryQC.fill(HIST("FV0/hFV0AmplvsVtxzCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); } } } @@ -2027,11 +2071,18 @@ struct FlattenictyPikp { rhoLatticeFV0.fill(0); std::vector vNch; - float nCharged{0}; + float nChFV0{0}; for (const auto& mcPart : mcparts) { if (!isChrgParticle(mcPart.pdgCode())) { continue; } + if (!mcPart.isPhysicalPrimary()) { + continue; + } + if (mcPart.pt() <= 0.) { + continue; + } + auto etaMc = mcPart.eta(); auto phiMc = mcPart.phi(); @@ -2051,22 +2102,22 @@ struct FlattenictyPikp { if (etaMc >= etaMinFV0bins[ieta] && etaMc < etaMaxFV0bins[ieta] && phiMc >= minPhi && phiMc < maxPhi) { rhoLatticeFV0[isegment] += 1. / std::abs(CdEtaFV0 * dPhi); + nChFV0++; } isegment++; } } - nCharged++; } - vNch.push_back(nCharged); - auto flatFV0 = calcFlatenicity(rhoLatticeFV0); + vNch.push_back(nChFV0); + auto flatFV0 = 1. - calcFlatenicity(rhoLatticeFV0); if constexpr (fillHist) { - flatchrg.fill(HIST("ResponseGen"), vNch[0], 1. - flatFV0); - flatchrg.fill(HIST("h1flatencityFV0MCGen"), 1. - flatFV0); + registryMC.fill(HIST("Events/ResponseGen"), vNch[0], flatFV0); + registryMC.fill(HIST("Events/h1flatencityFV0MCGen"), flatFV0); } vNch.clear(); - return 1. - flatFV0; + return flatFV0; } template @@ -2076,8 +2127,8 @@ struct FlattenictyPikp { constexpr int ChistIdx = id + pidSgn * Npart; auto idx = static_cast(id); const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]); - hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + hPtEffRec[ChistIdx] = registryMC.add("Tracks/hPtEffRec" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + hPtEffGen[ChistIdx] = registryMC.add("Tracks/hPtEffGen" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); } template @@ -2132,64 +2183,48 @@ struct FlattenictyPikp { { static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; - constexpr int Cidx = id; - LOG(debug) << "fillMCRecTrack for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; + // LOG(debug) << "fillMCRecTrack for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; const aod::McParticles::iterator& mcParticle = track.mcParticle(); const CollsGen::iterator& collision = track.collision_as(); - if (!isPID(mcParticle)) { + if (!isChrgParticle(mcParticle.pdgCode())) { return; } - flatchrg.fill(HIST("hPtOutNoEtaCut"), track.pt()); - if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { + if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { return; } - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + if (!isPID(mcParticle)) { return; } if ((collision.has_mcCollision() && (mcParticle.mcCollisionId() != collision.mcCollisionId())) || !collision.has_mcCollision()) { if (!mcParticle.isPhysicalPrimary()) { if (mcParticle.getProcess() == CprocessIdWeak) { - hDCAxyBadCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyRecBadCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); } else { - hDCAxyBadCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyRecBadCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } else { - hDCAxyBadCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyRecBadCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } if (collision.has_mcCollision() && (mcParticle.mcCollisionId() == collision.mcCollisionId())) { - if (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax)) { - if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { - if (!mcParticle.isPhysicalPrimary()) { - if (mcParticle.getProcess() == CprocessIdWeak) { - hPtEffRecWeak[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyWeakAll), mult, flat, track.pt(), track.dcaXY()); - } else { - hPtEffRecMat[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyMatAll), mult, flat, track.pt(), track.dcaXY()); - } - } else { - hPtEffRecPrim[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyPrimAll), mult, flat, track.pt(), track.dcaXY()); - } - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyAll), mult, flat, track.pt(), track.dcaXY()); + if (!mcParticle.isPhysicalPrimary()) { + if (mcParticle.getProcess() == CprocessIdWeak) { + hPtEffRecGoodCollWeak[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyRecGoodCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); + } else { + hPtEffRecGoodCollMat[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyRecGoodCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); } + } else { + hPtEffRecGoodCollPrim[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyRecGoodCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } - - if (!isDCAxyCut(track)) { - return; - } - if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { - if (mcParticle.isPhysicalPrimary()) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CdEdxMcRecPrim), track.eta(), mult, flat, track.p(), track.tpcSignal()); - } + if (isDCAxyCut(track)) { + hPtEffRec[ChistIdx]->Fill(mcParticle.pt()); } } @@ -2223,182 +2258,6 @@ struct FlattenictyPikp { } } - void processSgnLoss(MCColls::iterator const& mcCollision, - CollsGenSgn const& collisions, - aod::FV0As const& /*fv0s*/, - aod::McParticles const& particles) - { - float flat = 999.0; - if (flatSelOpt.useFlatData) { - float flatRec = 999.0; - for (const auto& collision : collisions) { - flatRec = fillFlat(collision); - } - flat = flatRec; - flatchrg.fill(HIST("hFlatMCGenRecColl"), flatRec); - } else { - float flatGen = fillFlatMC(particles); - flat = flatGen; - flatchrg.fill(HIST("hFlatMCGen"), flatGen); - } - - const float nCh08 = countPart(particles); // use generated Nch in ∣eta∣ < 0.8 - - flatchrg.fill(HIST("hEvtMcGen"), 0.5); - if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { - return; - } - flatchrg.fill(HIST("hEvtMcGen"), 1.5); - - bool isINELgt0mc = false; - if (pwglf::isINELgtNmc(particles, 0, pdg)) { - isINELgt0mc = true; - flatchrg.fill(HIST("hEvtMcGen"), 2.5); - flatchrg.fill(HIST("hNchVsFlatGenINELgt0"), nCh08, flat); // Evt loss den - } - - for (const auto& particle : particles) { - if (!isChrgParticle(particle.pdgCode())) { - continue; - } - if (!particle.isPhysicalPrimary()) { - continue; - } - if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { - continue; - } - if (particle.pt() < trkSelOpt.cfgTrkPtMin) { - continue; - } - static_for<0, 4>([&](auto i) { - constexpr int Cidx = i.value; - if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgn), nCh08, flat, particle.pt()); - if (isINELgt0mc) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgnINEL), nCh08, flat, particle.pt()); // Sgn loss den - } - } - }); - } - - const auto& nRecoColls = collisions.size(); - // Generated evets with >= 1 reco collisions - if (nRecoColls > CnullInt) { - auto maxNcontributors = -1; - auto bestCollIndex = -1; - auto multRecGt1 = -1; - for (auto const& collision : collisions) { - flatchrg.fill(HIST("hEvtMCRec"), 0.5); - if (!isGoodEvent(collision)) { - continue; - } - flatchrg.fill(HIST("hEvtMCRec"), 1.5); - if (collision.isInelGt0() && isINELgt0mc) { - flatchrg.fill(HIST("hEvtMCRec"), 2.5); - } - if (!collision.has_mcCollision()) { - continue; - } - if (maxNcontributors < collision.numContrib()) { - maxNcontributors = collision.numContrib(); - bestCollIndex = collision.globalIndex(); - multRecGt1 = getMultMC(mcCollision); // using McCentFT0Ms - } - flatchrg.fill(HIST("hCentVsFlatRecINELgt0"), multRecGt1, flat); // Evt split den - } - - for (const auto& collision : collisions) { - // Select collisions with the largest number of contributors - if (bestCollIndex != collision.globalIndex()) { - continue; - } - if (!collision.has_mcCollision()) { - continue; - } - const float multNpvMax = getMultMC(mcCollision); // using McCentFT0Ms - - flatchrg.fill(HIST("hCentVsFlatRecGt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 - if (!isGoodEvent(collision)) { - continue; - } - flatchrg.fill(HIST("hCentVsFlatRecGt0INELgt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + Evt. sel - flatchrg.fill(HIST("hNchVsCent"), multNpvMax, nCh08); - flatchrg.fill(HIST("hNchVsFlatRecGt0INELgt0"), nCh08, flat); // Evt loss num, w/ Nrec > 0 + Evt. sel - - for (const auto& particle : particles) { - if (!isChrgParticle(particle.pdgCode())) { - continue; - } - if (!particle.isPhysicalPrimary()) { - continue; - } - if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { - continue; - } - if (particle.pt() < trkSelOpt.cfgTrkPtMin) { - continue; - } - static_for<0, 4>([&](auto i) { - constexpr int Cidx = i.value; - if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTrecCollPrimSgn), nCh08, flat, particle.pt()); // Sgn loss num - } - }); - } - } - } - } - PROCESS_SWITCH(FlattenictyPikp, processSgnLoss, "process to calcuate signal/event lossses", false); - - // using Particles = soa::Filtered; - // expressions::Filter primaries = (aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; - void processMCclosure(Colls::iterator const& collision, - MyPIDTracks const& tracks, - MyLabeledTracks const& mcTrackLabels, - aod::McParticles const& particles, - // Particles const& particles, - aod::FV0As const& /*fv0s*/, - aod::BCsWithTimestamps const& /*bcs*/) - { - const float multRec = getMult(collision); - const float flatRec = fillFlat(collision); - for (const auto& track : tracks) { - if (!track.has_collision()) { - continue; - } - const auto& coll = track.collision_as(); - if (trkSelOpt.cfgRejectTrkAtTPCSector) { - auto bc = coll.template bc_as(); - int currentRun = bc.runNumber(); - if (runNumber != currentRun) { - initCCDB(bc); - runNumber = currentRun; - } - } - if (!isGoodEvent(coll)) { - continue; - } - if (!isGoodTrack(track, magField)) { - continue; - } - if (!isDCAxyCut(track)) { - continue; - } - const auto& mcLabel = mcTrackLabels.iteratorAt(track.globalIndex()); - const auto& mcParticle = particles.iteratorAt(mcLabel.mcParticleId()); - - static_for<0, 4>([&](auto i) { - constexpr int Cidx = i.value; - if ((std::abs(o2::aod::pidutils::tpcNSigma(track)) < trkSelOpt.cfgNsigmaMax) && std::abs(track.rapidity(o2::track::PID::getMass(Cidx))) <= trkSelOpt.cfgRapMax) { - if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTmcClosurePrim), multRec, flatRec, track.pt()); - } - } - }); - } - } - PROCESS_SWITCH(FlattenictyPikp, processMCclosure, "process MC closure test", false); - Preslice perCollTrk = aod::track::collisionId; PresliceUnsorted perCollMcLabel = aod::mccollisionlabel::mcCollisionId; Preslice perCollMcPart = aod::mcparticle::mcCollisionId; @@ -2407,60 +2266,94 @@ struct FlattenictyPikp { CollsGen const& collisions, aod::BCsWithTimestamps const& /*bcs*/, MyLabeledPIDTracks const& tracks, + aod::FV0As const& /*fv0s*/, aod::McParticles const& mcparticles) { - flatchrg.fill(HIST("hEvtGenRec"), 1.f, mcCollisions.size()); - flatchrg.fill(HIST("hEvtGenRec"), 2.f, collisions.size()); + registryMC.fill(HIST("Events/hEvtGenRec"), 1.f, mcCollisions.size()); + registryMC.fill(HIST("Events/hEvtGenRec"), 2.f, collisions.size()); + // Generated collisions for (const auto& mcCollision : mcCollisions) { if (mcCollision.isInelGt0()) { - flatchrg.fill(HIST("hEvtGenRec"), 3.f); + registryMC.fill(HIST("Events/hEvtGenRec"), 3.f); } - flatchrg.fill(HIST("hEvtMcGenColls"), 1); + registryMC.fill(HIST("Events/hEvtMcGenColls"), 1); const auto groupedColls = collisions.sliceBy(perCollMcLabel, mcCollision.globalIndex()); const auto groupedParts = mcparticles.sliceBy(perCollMcPart, mcCollision.globalIndex()); const float flatMC = fillFlatMC(groupedParts); - const float multMC = getMultMC(mcCollision); + registryMC.fill(HIST("Events/hFlatMCGen"), flatMC); - if (groupedColls.size() < 1) { // if MC events have no rec collisions + auto multMC = -1.; + if (evtSelOpt.useMultMCmidrap || multEst == 2) { // use generated Nch in ∣eta∣ < 0.8 + multMC = countPart(groupedParts); + } else { + multMC = getMultMC(mcCollision); // using McCentFT0Ms + } + + if (groupedColls.size() < ConeInt) { // if MC events have no rec collisions continue; } auto maxNcontributors = -1; auto bestCollIndex = -1; for (const auto& collision : groupedColls) { + registryMC.fill(HIST("Events/hEvtMCRec"), 0.5); + if (!isGoodEvent(collision)) { + continue; + } + registryMC.fill(HIST("Events/hEvtMCRec"), 1.5); + if (collision.isInelGt0()) { + registryMC.fill(HIST("Events/hEvtMCRec"), 2.5); + } + const float multRecGt1 = getMult(collision); + const float flatRec = fillFlat(collision); + registryMC.fill(HIST("Events/hFlatMCRec"), flatRec); if (maxNcontributors < collision.numContrib()) { maxNcontributors = collision.numContrib(); bestCollIndex = collision.globalIndex(); - } else { - continue; } + registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0"), multRecGt1, flatRec); // Evt split den } - - flatchrg.fill(HIST("hEvtMcGenColls"), 2); + registryMC.fill(HIST("Events/hEvtMcGenColls"), 2); + // + // Rec collisions w/ largest number of PV contributors for (const auto& collision : groupedColls) { - flatchrg.fill(HIST("hEvtMcGenColls"), 3); - if (!isGoodEvent(collision)) { - continue; + if (trkSelOpt.cfgRejectTrkAtTPCSector || applyCalibGain || applyCalibVtx) { + auto bc = collision.bc_as(); + int currentRun = bc.runNumber(); + if (runNumber != currentRun) { + initCCDB(bc); + runNumber = currentRun; + } } - // Select collisions with the largest number of contributors + const float multRecGt1 = getMult(collision); + const float flatRec = fillFlat(collision); + registryMC.fill(HIST("Events/hEvtMcGenColls"), 3); if (bestCollIndex != collision.globalIndex()) { continue; } - flatchrg.fill(HIST("hEvtMcGenColls"), 4); + registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0wRecEvt"), multRecGt1, flatRec); // Evt split num, w/ Nrec > 0 + if (!isGoodEvent(collision)) { + continue; + } + registryMC.fill(HIST("Events/hEvtMcGenColls"), 4); + registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0wRecEvtSel"), multRecGt1, flatRec); // Evt split num, w/ Nrec > 0 + Evt. sel + registryMC.fill(HIST("Events/hNchVsCent"), multRecGt1, multMC); + registryMC.fill(HIST("Events/hNchVsFlatGenINELgt0wRecEvtSel"), multMC, flatMC); // Evt loss num, w/ Nrec > 0 + Evt. sel + // + // Rec tracks; track selection w/ DCA open (for secondaries), w/ DCA close (for efficiency) + // Obtain here: DCAxy for sec contamination, closure const auto groupedTrks = tracks.sliceBy(perCollTrk, collision.globalIndex()); for (const auto& track : groupedTrks) { if (!track.has_collision()) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector) { - auto bc = collision.bc_as(); - int currentRun = bc.runNumber(); - if (runNumber != currentRun) { - initCCDB(bc); - runNumber = currentRun; - } + if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (track.pt() < trkSelOpt.cfgTrkPtMin) { + continue; } if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { continue; @@ -2477,35 +2370,66 @@ struct FlattenictyPikp { continue; } if (!track.has_mcParticle()) { - flatchrg.fill(HIST("PtOutFakes"), track.pt()); - continue; - } - const auto& mcParticle = track.mcParticle(); - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + registryMC.fill(HIST("Tracks/hPtFakes"), multMC, flatMC, track.pt()); continue; } + auto particle = track.mcParticle_as(); static_for<0, 1>([&](auto pidSgn) { fillMCRecTrack(track, multMC, flatMC); fillMCRecTrack(track, multMC, flatMC); fillMCRecTrack(track, multMC, flatMC); }); + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax)) { + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + if (!particle.isPhysicalPrimary()) { + if (particle.getProcess() == CprocessIdWeak) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyWeakAll), multMC, flatMC, track.pt(), track.dcaXY()); + } else { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyMatAll), multMC, flatMC, track.pt(), track.dcaXY()); + } + } else { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyPrimAll), multMC, flatMC, track.pt(), track.dcaXY()); + } + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyAll), multMC, flatMC, track.pt(), track.dcaXY()); + } + } + }); + if (isDCAxyCut(track)) { + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + if (particle.isPhysicalPrimary()) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CdEdxMcRecPrim), track.eta(), multMC, flatMC, track.p(), track.tpcSignal()); + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTeffPrimRecEvt), multRecGt1, flatRec, track.pt()); // Tracking eff. num + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTmcClosureRec), multMC, flatMC, track.pt()); + } + } + }); + } } if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { continue; } - - flatchrg.fill(HIST("Events/hVtxZRec"), collision.posZ()); - flatchrg.fill(HIST("Events/hVtxZGen"), mcCollision.posZ()); - - if (evtSelOpt.cfgINELCut.value) { - if (!o2::pwglf::isINELgt0mc(groupedParts, pdg)) { - continue; - } + registryMC.fill(HIST("Events/hVtxZRec"), collision.posZ()); + registryMC.fill(HIST("Events/hVtxZGen"), mcCollision.posZ()); + if (!pwglf::isINELgt0mc(groupedParts, pdg)) { + continue; } for (const auto& particle : groupedParts) { - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { continue; } static_for<0, 1>([&](auto pidSgn) { @@ -2513,17 +2437,41 @@ struct FlattenictyPikp { fillMCGen(particle, multMC, flatMC); fillMCGen(particle, multMC, flatMC); }); + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTrecCollPrimSgn), multMC, flatMC, particle.pt()); // Sgn loss num + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTeffGenPrimRecEvt), multRecGt1, flatRec, particle.pt()); // Tracking eff. den + } + }); } - } // reco collisions - - if (evtSelOpt.cfgINELCut.value) { - if (!o2::pwglf::isINELgt0mc(groupedParts, pdg)) { - continue; - } } + // Generated collisions without rec collision requirement + // Obtain here: signal loss den, event loss den, closure + // + registryMC.fill(HIST("Events/hEvtMcGen"), 0.5); + if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { + continue; + } + registryMC.fill(HIST("Events/hEvtMcGen"), 1.5); + if (!pwglf::isINELgt0mc(groupedParts, pdg)) { + continue; + } + registryMC.fill(HIST("Events/hEvtMcGen"), 2.5); + if (evtSelOpt.cfgUseInelgt0wTVX && !isInelGt0wTVX(groupedParts)) { // TVX trigger: FT0A + FT0C acceptance + continue; + } + registryMC.fill(HIST("Events/hEvtMcGen"), 3.5); + registryMC.fill(HIST("Events/hNchVsFlatGenINELgt0"), multMC, flatMC); // Evt loss den for (const auto& mcParticle : groupedParts) { - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + if (!isChrgParticle(mcParticle.pdgCode())) { + continue; + } + if (std::abs(mcParticle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (mcParticle.pt() < trkSelOpt.cfgTrkPtMin) { continue; } static_for<0, 1>([&](auto pidSgn) { @@ -2531,15 +2479,23 @@ struct FlattenictyPikp { fillMCGen(mcParticle, multMC, flatMC); fillMCGen(mcParticle, multMC, flatMC); }); + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + // LOG(debug) << "fillMCGen for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; + if (mcParticle.isPhysicalPrimary()) { + if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgn), multMC, flatMC, mcParticle.pt()); // Sgn loss den + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTmcClosureGenPrim), multMC, flatMC, mcParticle.pt()); + } + } + }); } - static_for<0, 1>([&](auto pidSgn) { fillEfficiency(); fillEfficiency(); fillEfficiency(); }); - - } // gen collisions + } } PROCESS_SWITCH(FlattenictyPikp, processMC, "process MC", false); From ae55c21fd9f3c5b3c42b14a454dffd7feceb6849 Mon Sep 17 00:00:00 2001 From: Gianni Shigeru Setoue Liveraro <81832939+gianniliveraro@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:45:54 -0300 Subject: [PATCH 142/282] [PWGLF] Sigma0 analysis: small fixes (#15592) Co-authored-by: ALICE Action Bot --- .../Strangeness/sigma0builder.cxx | 55 +++++++++++-------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index bad2b681d13..339088a311c 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -45,10 +45,8 @@ #include "Math/Vector3D.h" #include -#include #include #include -#include #include #include @@ -56,6 +54,7 @@ #include #include #include +#include #include using namespace o2; @@ -471,15 +470,17 @@ struct sigma0builder { histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(12, "TPCCR"); histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "TPC NSigma"); - histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); - histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + if (doprocessPCMVsEMCalQA) { + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + } } else { for (const auto& histodir : DirList2) { @@ -491,6 +492,16 @@ struct sigma0builder { histos.add(histodir + "/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); histos.add(histodir + "/h2dShape", "h2dShape", kTH2D, {axisPt, axisClrShape}); } + + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); } histos.add("LambdaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); @@ -863,7 +874,8 @@ struct sigma0builder { info.DCADau = (cross.Mag2() > 0) ? std::abs(posdiff.Dot(cross)) / cross.R() : 999.f; info.CosPA = v01momentumNorm.Dot(v02momentumNorm); - if (d < 1e-5f) { // Parallel or nearly parallel lines + float Min_threshold = 1e-5f; // Threshold to consider lines as parallel, can be tuned + if (d < Min_threshold) { // Parallel or nearly parallel lines info.X = info.Y = info.Z = 0.f; // should we use another dummy value? Perhaps 999.f? return info; } @@ -1527,7 +1539,7 @@ struct sigma0builder { auto v0MC = v0.template v0MCCore_as>(); - float V0MCpT = RecoDecay::pt(array{v0MC.pxMC(), v0MC.pyMC()}); + float V0MCpT = RecoDecay::pt(std::array{v0MC.pxMC(), v0MC.pyMC()}); float V0PA = TMath::ACos(v0.v0cosPA()); bool fIsV0CorrectlyAssigned = (v0MC.straMCCollisionId() == v0MCCollision.globalIndex()); bool isPrimary = v0MC.isPhysicalPrimary(); @@ -1591,7 +1603,7 @@ struct sigma0builder { histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); // Checking decay modes and getting daughter pTs - for (auto& daughter : daughters) { + for (auto const& daughter : daughters) { histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); if (GenInfo.NDaughters == 2) { @@ -1606,13 +1618,13 @@ struct sigma0builder { if ((GenInfo.IsKStar) && genSelections.doQA) { histos.fill(HIST("GenQA/h2dKStarMCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes + for (auto const& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dKStarNDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } if (GenInfo.IsPi0 && genSelections.doQA) { histos.fill(HIST("GenQA/h2dPi0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes + for (auto const& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dPi0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } } @@ -1722,7 +1734,7 @@ struct sigma0builder { template void genProcess(TMCParticles const& mcParticles) { - for (auto& mcParticle : mcParticles) { + for (auto const& mcParticle : mcParticles) { // Rapidity selection if ((mcParticle.y() < genSelections.mc_rapidityMin) || (mcParticle.y() > genSelections.mc_rapidityMax)) continue; @@ -1778,7 +1790,7 @@ struct sigma0builder { static constexpr std::string_view MainDir2[] = {"EMCalPhotonBeforeSel", "EMCalPhotonSel"}; // calculate pT for cluster assuming they are photons (so no mass) - float gammapT = sqrt(cluster.energy() * cluster.energy()) / std::cosh(cluster.eta()); + float gammapT = std::sqrt(cluster.energy() * cluster.energy()) / std::cosh(cluster.eta()); histos.fill(HIST(MainDir2[mode]) + HIST("/hDefinition"), cluster.definition()); histos.fill(HIST(MainDir2[mode]) + HIST("/h2dNCells"), gammapT, cluster.nCells()); @@ -2388,7 +2400,7 @@ struct sigma0builder { bool buildEMCalSigma0(TV0Object const& lambda, TEMCalClsObject const& gamma, TCollision const& collision, TMCParticles const& mcparticles, std::vector const& emcaltracksmatched) { // calculate pT for cluster assuming they are photons (so no mass) - float gammapT = sqrt(gamma.energy() * gamma.energy()) / std::cosh(gamma.eta()); + float gammapT = std::sqrt(gamma.energy() * gamma.energy()) / std::cosh(gamma.eta()); // Momentum components float gammapx = gammapT * std::cos(gamma.phi()); @@ -2720,7 +2732,6 @@ struct sigma0builder { //_______________________________________________ // Photon-V0 nested loop - int nSigma0Candidates = 0; for (size_t i = 0; i < bestGammasArray.size(); ++i) { //_______________________________________________ @@ -2739,8 +2750,6 @@ struct sigma0builder { if (!buildPCMSigma0(lambda, gamma1, coll, mcparticles)) continue; } - - nSigma0Candidates++; } } @@ -2774,8 +2783,6 @@ struct sigma0builder { } } } - - LOGF(info, "N. photons: %i, N. lambdas: %i, expected pairs: %i, got: %i", bestGammasArray.size(), bestLambdasArray.size(), bestGammasArray.size() * bestLambdasArray.size(), nSigma0Candidates); } } From 720506d2cdac28c289c3985b31b3ee4439addf20 Mon Sep 17 00:00:00 2001 From: Shirajum Monira <38348689+Eloviyo@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:43:21 +0200 Subject: [PATCH 143/282] [PWGCF] FemtoUniverse Cascade Task -- updated track NSigma PID to address hasTOF (#15607) Co-authored-by: Shirajum Monira --- ...toUniversePairTaskTrackCascadeExtended.cxx | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 6417529d529..715a3c1380a 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -58,10 +58,6 @@ struct femtoUniversePairTaskTrackCascadeExtended { Configurable confCascInvMassLowLimit{"confCascInvMassLowLimit", 1.315, "Lower limit of the Casc invariant mass"}; Configurable confCascInvMassUpLimit{"confCascInvMassUpLimit", 1.325, "Upper limit of the Casc invariant mass"}; - // TODO: Add seperate selection for daughter particles - // Configurable confNSigmaTPCPion{"confNSigmaTPCPion", 4, "NSigmaTPCPion"}; - // Configurable confNSigmaTPCProton{"confNSigmaTPCProton", 4, "NSigmaTPCProton"}; - /// applying narrow cut Configurable confZVertexCut{"confZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; Configurable confEta{"confEta", 0.8, "Eta cut for the global track"}; @@ -200,10 +196,24 @@ struct femtoUniversePairTaskTrackCascadeExtended { bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF) { - if (mom <= confmom || hasTOF == 0) { + if (mom <= confmom) { return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); - } else { + } else if (hasTOF == 1) { return (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); + } else { + return false; + } + } + + template + bool isNSigmaCombinedBitmask(float mom, const T& part) + { + if (mom <= confmom) { + return ((part.pidCut() & (1u << confTrackChoicePartOne)) != 0); + } else if ((part.pidCut() & 512u) != 0) { + return ((part.pidCut() & (64u << confTrackChoicePartOne)) != 0); + } else { + return false; } } @@ -481,10 +491,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { trackHistoPartOneNeg.fillQA(part); } } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & (64u << confTrackChoicePartOne)) == 0) - continue; - } else if ((part.pidCut() & (1u << confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) { continue; } if (part.mAntiLambda() > 0) { @@ -504,10 +511,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) { continue; } } @@ -751,10 +755,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) { continue; } } @@ -1168,10 +1169,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) { continue; } } @@ -1185,10 +1183,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) { continue; } } From 33200a0bf8f5ebcdf0bc8e0fea589b7b786fd1b9 Mon Sep 17 00:00:00 2001 From: Shirajum Monira <38348689+Eloviyo@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:43:39 +0200 Subject: [PATCH 144/282] [PWGCF] FemtoUniverse V0 Task -- updated track NSigma PID to address hasTOF (#15610) Co-authored-by: Shirajum Monira --- .../femtoUniversePairTaskTrackV0Extended.cxx | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 283f9b463d0..c317199d716 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -210,10 +210,24 @@ struct FemtoUniversePairTaskTrackV0Extended { bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF) { - if (mom <= confmom || hasTOF == 0) { + if (mom <= confmom) { return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); - } else { + } else if (hasTOF == 1) { return (std::hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); + } else { + return false; + } + } + + template + bool isNSigmaCombinedBitmask(float mom, const T& part) + { + if (mom <= confmom) { + return ((part.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) != 0); + } else if ((part.pidCut() & 512u) != 0) { + return ((part.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) != 0); + } else { + return false; } } @@ -488,12 +502,8 @@ struct FemtoUniversePairTaskTrackV0Extended { trackHistoPartOneNeg.fillQA(part); } } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) - continue; - } else if ((part.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) continue; - } if (ConfTrkSelection.confChargePart1 > 0) trackHistoPartOnePos.fillQA(part); if (ConfTrkSelection.confChargePart1 < 0) @@ -511,12 +521,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isParticleCombined(p1, ConfTrkSelection.confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) continue; - } } // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { @@ -986,12 +992,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isParticleCombined(p1, ConfTrkSelection.confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) continue; - } } const auto& posChild = parts.iteratorAt(p2.globalIndex() - 2 - parts.begin().globalIndex()); @@ -1684,12 +1686,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) // 64 for proton combined - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) continue; - } } registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt()); @@ -1715,12 +1713,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) // 64 for proton combined - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) continue; - } } registryMCreco.fill(HIST("minus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPrPt"), mcpart.pt()); From 29864e6df6b02de134635e0bb3cfe661729038fb Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:30:32 +0200 Subject: [PATCH 145/282] [PWGLF] Update v0cascadesqa.cxx (#15615) Co-authored-by: ALICE Builder --- PWGLF/Tasks/QC/CMakeLists.txt | 2 +- PWGLF/Tasks/QC/v0cascadesqa.cxx | 1878 +++++++++++++++++++++---------- 2 files changed, 1265 insertions(+), 615 deletions(-) diff --git a/PWGLF/Tasks/QC/CMakeLists.txt b/PWGLF/Tasks/QC/CMakeLists.txt index 319d21d9d96..e1618a43d06 100644 --- a/PWGLF/Tasks/QC/CMakeLists.txt +++ b/PWGLF/Tasks/QC/CMakeLists.txt @@ -11,7 +11,7 @@ o2physics_add_dpl_workflow(v0cascades-qa SOURCES v0cascadesqa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(track-checks diff --git a/PWGLF/Tasks/QC/v0cascadesqa.cxx b/PWGLF/Tasks/QC/v0cascadesqa.cxx index dc3d615cc57..962687d2869 100644 --- a/PWGLF/Tasks/QC/v0cascadesqa.cxx +++ b/PWGLF/Tasks/QC/v0cascadesqa.cxx @@ -9,15 +9,22 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // +/// \file v0cascadesqa.cxx /// \brief QA task for V0s and Cascades /// +/// /// In case of questions please write to: /// \author Aimeric Landou (aimeric.landou@cern.ch) /// \author Chiara De Martin (chiara.de.martin@cern.ch) /// \author Francesca Ercolessi (francesca.ercolessi@cern.ch) +/// \author Romain Schotter (romain.schotter@cern.ch) +#include +// #include +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -34,382 +41,1073 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Track.h" -#include +#include + +using namespace o2::aod::rctsel; using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using MyTracks = soa::Join; -using MyTracksMC = soa::Join; -using DaughterTracks = soa::Join; +enum ParticleType : uint8_t { kPhoton = 0, + kK0s, + kLambda, + kAntiLambda, + kXiM, + kXiP, + kOmegaM, + kOmegaP }; + +// using DaughterTracks = soa::Join; +using DaughterTracks = soa::Join; struct v0cascadesQA { - static constexpr float defaultLifetimeCuts[1][2] = {{25., 20.}}; + HistogramRegistry histos_event{"histos_event", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos_V0{"histos_V0", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos_Casc{"histos_Casc", {}, OutputObjHandlingPolicy::AnalysisObject}; // configurable event properties - Configurable isMC{"isMC", false, "does the data have MC info"}; - Configurable sel8{"sel8", 0, "Apply sel8 event selection"}; - Configurable doextraanalysis{"doextraanalysis", 0, "Add extra histograms"}; - - // configurable track properties - Configurable checkDauTPC{"checkDauTPC", false, "check if daughter tracks have TPC match"}; - - // configurable binning of histograms - ConfigurableAxis binPt{"binPt", {100, 0.0f, 10.0f}, ""}; - ConfigurableAxis binPtsmall{"binPtsmall", {50, 0.0f, 10.0f}, ""}; - ConfigurableAxis binV0CosPA{"binV0CosPA", {200, 0.8f, 1.0f}, ""}; - ConfigurableAxis binV0PA{"binV0PA", {1000, 0.f, 1.0f}, ""}; - ConfigurableAxis binV0Radius{"binV0Radius", {100, 0.0f, 10.0f}, ""}; - ConfigurableAxis binV0DecayLength{"binV0DecayLength", {100, 0.0f, 10.0f}, ""}; - ConfigurableAxis binV0DCANegToPV{"binV0DCANegToPV", {100, -1.0f, 1.0f}, ""}; - ConfigurableAxis binV0DCAPosToPV{"binV0DCAPosToPV", {100, -1.0f, 1.0f}, ""}; - ConfigurableAxis binV0DCAV0Dau{"binV0DCAV0Dau", {55, 0.0f, 2.20f}, ""}; - ConfigurableAxis binCtauK0s{"binCtauK0s", {65, 0.0f, 13.0f}, ""}; - ConfigurableAxis binCtauLambda{"binCtauLambda", {100, 0.0f, 40.0f}, ""}; - ConfigurableAxis binCtauAntiLambda{"binCtauAntiLambda", {100, 0.0f, 40.0f}, ""}; - ConfigurableAxis binDecayLengthK0s{"binDecayLengthK0s", {100, 0.0f, 40.0f}, ""}; - ConfigurableAxis binDecayLengthLambda{"binDecayLengthLambda", {100, 0.0f, 80.0f}, ""}; - ConfigurableAxis binDecayLengthAntiLambda{"binDecayLengthAntiLambda", {100, 0.0f, 80.0f}, ""}; - ConfigurableAxis binV0DCAV0ToPVK0S{"binV0DCAV0ToPVK0S", {250, 0.0f, 0.25f}, ""}; - ConfigurableAxis binV0DCAV0ToPVLambda{"binV0DCAV0ToPVLambda", {250, 0.0f, 0.25f}, ""}; - ConfigurableAxis binV0DCAV0ToPVAntiLambda{"binV0DCAV0ToPVAntiLambda", {250, 0.0f, 0.25f}, ""}; - ConfigurableAxis binInvMassK0S{"binInvMassK0S", {200, 0.4f, 0.6f}, ""}; - ConfigurableAxis binInvMassLambda{"binInvMassLambda", {200, 1.07f, 1.17f}, ""}; - ConfigurableAxis binInvMassAntiLambda{"binInvMassAntiLambda", {200, 1.07f, 1.17f}, ""}; - ConfigurableAxis binResponsePionFromLambda{"binResponsePionFromLambda", {200, -20.f, 20.f}, ""}; - ConfigurableAxis binResponseProtonFromLambda{"binResponseProtonFromLambda", {200, -20.f, 20.f}, ""}; - ConfigurableAxis binEtaFlag{"binEtaFlag", {3, -1.5f, 1.5f}, ""}; - ConfigurableAxis binEta{"binEta", {100, -1.0f, 1.0f}, ""}; - ConfigurableAxis binPhi{"binPhi", {static_cast(TMath::Pi()) * 10 / 2, 0.0f, 2. * static_cast(TMath::Pi())}, ""}; - ConfigurableAxis binRadius{"binRadius", {100, 0.0f, 50.0f}, ""}; - ConfigurableAxis binRadiussmall{"binRadiussmall", {30, 0.0f, 30.0f}, ""}; - ConfigurableAxis binITSMapDaughters{"binITSMapDaughters", {8, -0.5f, 7.5f}, ""}; - ConfigurableAxis binInvMassCasc{"binInvMassCasc", {1000, 0.f, 1.0f}, ""}; - - // configurables for V0s - Configurable V0_rapidity{"V0_rapidity", 0.5, "rapidity"}; - Configurable V0_cosPA{"V0_cosPA", 0.995, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable V0_dcav0dau{"V0_dcav0dau", 1, "DCA V0 Daughters"}; - Configurable V0_dcapostopv{"V0_dcapostopv", 0.1, "DCA Pos To PV"}; - Configurable V0_dcanegtopv{"V0_dcanegtopv", 0.1, "DCA Neg To PV"}; - Configurable V0_radius{"V0_radius", 5, "v0radius"}; - Configurable NSigmaV0Pion{"NSigmaV0Pion", 6, "NSigmaV0Pion"}; - Configurable NSigmaV0Proton{"NSigmaV0Proton", 6, "NSigmaV0Proton"}; - Configurable> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"}; - - // configurables for Cascades - Configurable Casc_rapidity{"Casc_rapidity", 0.5, "rapidity"}; - Configurable Casc_v0cospa{"Casc_V0cospa", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable Casc_casccospa{"Casc_casccospa", 0.98, "Cascade CosPA"}; // AliAnalysisTaskStrAODqa: 0.9992 //double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable Casc_dcav0dau{"Casc_dcav0dau", 1.0, "DCA V0 Daughters"}; // AliAnalysisTaskStrAODqa: 1. different scale - Configurable Casc_dcacascdau{"Casc_dcacascdau", 0.6, "DCA Casc Daughters"}; // AliAnalysisTaskStrAODqa: 0.3 different scale - Configurable Casc_dcav0topv{"Casc_dcav0topv", 0.1, "DCA Pos To PV"}; // AliAnalysisTaskStrAODqa: 0.15 different scale - Configurable Casc_dcabachtopv{"Casc_dcabachtopv", .1, "DCA Bach To PV"}; // AliAnalysisTaskStrAODqa: 0.17 different scale - Configurable Casc_dcapostopv{"Casc_dcapostopv", 0.1, "DCA V0 To PV"}; // AliAnalysisTaskStrAODqa: if( fCasc_charge>0 &&(fCasc_DcaPosToPV < 0.3 || fCasc_DcaNegToPV < 0.11)) return kFALSE; different scale - Configurable Casc_dcanegtopv{"Casc_dcanegtopv", 0.1, "DCA Neg To PV"}; // AliAnalysisTaskStrAODqa: if( fCasc_charge<0 &&(fCasc_DcaPosToPV < 0.11 || fCasc_DcaNegToPV < 0.3)) return kFALSE; different scale - Configurable Casc_v0radius{"Casc_v0radius", 0.9, "v0 radius"}; // AliAnalysisTaskStrAODqa: 5. - Configurable Casc_cascradius{"Casc_cascradius", 1.0, "cascade radius"}; // AliAnalysisTaskStrAODqa: 1. - Configurable NSigmaCascPion{"NSigmaCascPion", 6, "NSigmaCascPion"}; - Configurable NSigmaCascProton{"NSigmaCascProton", 6, "NSigmaCascProton"}; - Configurable NSigmaCascKaon{"NSigmaCascKaon", 6, "NSigmaCascKaon"}; - - OutputObj V0SelectionSummary{TH1F("V0SelectionSummary", "V0SelectionSummary; Selections; Cut", 10, 0., 10.)}; - HistogramRegistry histos_eve{"histos-eve", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry histos_V0{"histos-V0", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry histos_Casc{"histos-Casc", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + bool isMC = false; + Configurable doextraanalysis{"doextraanalysis", false, "Add extra histograms"}; + Configurable doTreatPiToMuon{"doTreatPiToMuon", true, "Take pi decay into muon into account in MC"}; + Configurable irSource{"irSource", "", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; + + struct : ConfigurableGroup { + std::string prefix = "eventSelections"; // JSON group name + Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; + Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; + Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border (Run 3 only)"}; + Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border (Run 3 only)"}; + Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "require events with at least one ITS-TPC track (Run 3 only)"}; + Configurable requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", false, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference (Run 3 only)"}; + Configurable requireIsVertexTOFmatched{"requireIsVertexTOFmatched", false, "require events with at least one of vertex contributors matched to TOF (Run 3 only)"}; + Configurable requireIsVertexTRDmatched{"requireIsVertexTRDmatched", false, "require events with at least one of vertex contributors matched to TRD (Run 3 only)"}; + Configurable rejectSameBunchPileup{"rejectSameBunchPileup", false, "reject collisions in case of pileup with another collision in the same foundBC (Run 3 only)"}; + Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds (Run 3 only)"}; + Configurable requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds (Run 3 only)"}; + Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds (Run 3 only)"}; + Configurable requireNoCollInROFStd{"requireNoCollInROFStd", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF with mult. above a certain threshold (Run 3 only)"}; + Configurable requireNoCollInROFStrict{"requireNoCollInROFStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF (Run 3 only)"}; + Configurable requireINEL0{"requireINEL0", false, "require INEL>0 event selection"}; + Configurable requireINEL1{"requireINEL1", false, "require INEL>1 event selection"}; + + Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"}; + + Configurable useEvtSelInDenomEff{"useEvtSelInDenomEff", false, "Consider event selections in the recoed <-> gen collision association for the denominator (or numerator) of the acc. x eff. (or signal loss)?"}; + Configurable applyZVtxSelOnMCPV{"applyZVtxSelOnMCPV", false, "Apply Z-vtx cut on the PV of the generated collision?"}; + Configurable useFT0CbasedOccupancy{"useFT0CbasedOccupancy", false, "Use sum of FT0-C amplitudes for estimating occupancy? (if not, use track-based definition)"}; + // fast check on occupancy + Configurable minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; + Configurable maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; + // fast check on interaction rate + Configurable minIR{"minIR", -1, "minimum IR collisions"}; + Configurable maxIR{"maxIR", -1, "maximum IR collisions"}; + } eventSelections; + + struct : ConfigurableGroup { + std::string prefix = "rctConfigurations"; // JSON group name + Configurable cfgRCTLabel{"cfgRCTLabel", "", "Which detector condition requirements? (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"}; + Configurable cfgCheckZDC{"cfgCheckZDC", false, "Include ZDC flags in the bit selection (for Pb-Pb only)"}; + Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + } rctConfigurations; + + RCTFlagsChecker rctFlagsChecker{rctConfigurations.cfgRCTLabel.value}; + + static constexpr float DefaultLifetimeCuts[1][2] = {{30., 20.}}; + + struct : ConfigurableGroup { + std::string prefix = "v0Selections"; // JSON group name + Configurable v0TypeSelection{"v0TypeSelection", 1, "select on a certain V0 type (leave negative if no selection desired)"}; + + // Selection criteria: acceptance + Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; + Configurable daughterEtaCut{"daughterEtaCut", 0.8, "max eta for daughters"}; + + // Standard 5 topological criteria + Configurable v0cospa{"v0cospa", 0.97, "min V0 CosPA"}; + Configurable dcav0dau{"dcav0dau", 1.0, "max DCA V0 Daughters (cm)"}; + Configurable dcanegtopv{"dcanegtopv", .05, "min DCA Neg To PV (cm)"}; + Configurable dcapostopv{"dcapostopv", .05, "min DCA Pos To PV (cm)"}; + Configurable v0radius{"v0radius", 1.2, "minimum V0 radius (cm)"}; + Configurable v0radiusMax{"v0radiusMax", 1E5, "maximum V0 radius (cm)"}; + Configurable> lifetimecut{"lifetimecut", {DefaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0s"}}, "lifetimecut"}; + + // invariant mass selection + Configurable compMassRejection{"compMassRejection", -1, "Competing mass rejection (GeV/#it{c}^{2})"}; + + // Additional selection on the AP plot (exclusive for K0Short) + // original equation: lArmPt*5>TMath::Abs(lArmAlpha) + Configurable armPodCut{"armPodCut", 5.0f, "pT * (cut) > |alpha|, AP cut. Negative: no cut"}; + + // Track quality + Configurable minTPCrows{"minTPCrows", 70, "minimum TPC crossed rows"}; + Configurable minITSclusters{"minITSclusters", -1, "minimum ITS clusters"}; + Configurable maxFractionTPCSharedClusters{"maxFractionTPCSharedClusters", 1e+09, "maximum fraction of TPC shared clusters"}; + Configurable maxITSchi2PerNcls{"maxITSchi2PerNcls", 1e+09, "maximum ITS chi2 per clusters"}; + Configurable maxTPCchi2PerNcls{"maxTPCchi2PerNcls", 1e+09, "maximum TPC chi2 per clusters"}; + Configurable skipTPConly{"skipTPConly", false, "skip V0s comprised of at least one TPC only prong"}; + Configurable requirePosITSonly{"requirePosITSonly", false, "require that positive track is ITSonly (overrides TPC quality)"}; + Configurable requireNegITSonly{"requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; + Configurable rejectPosITSafterburner{"rejectPosITSafterburner", false, "reject positive track formed out of afterburner ITS tracks"}; + Configurable rejectNegITSafterburner{"rejectNegITSafterburner", false, "reject negative track formed out of afterburner ITS tracks"}; + Configurable requirePosITSafterburnerOnly{"requirePosITSafterburnerOnly", false, "require positive track formed out of afterburner ITS tracks"}; + Configurable requireNegITSafterburnerOnly{"requireNegITSafterburnerOnly", false, "require negative track formed out of afterburner ITS tracks"}; + Configurable requireAtLeastOneHasTOF{"requireAtLeastOneHasTOF", false, "require that at least one of daughter tracks has an associated TOF signal"}; + Configurable requirePosHasTOF{"requirePosHasTOF", false, "require that positive track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requireNegHasTOF{"requireNegHasTOF", false, "require that negative track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requirePosHasTRD{"requirePosHasTRD", false, "require that positive track is formed out of TRD track."}; + Configurable requireNegHasTRD{"requireNegHasTRD", false, "require that negative track is formed out of TRD track."}; + Configurable minTRDclusters{"minTRDclusters", -1, "minimum TRD clusters IF track is formed out of a TRD track"}; + + // PID (TPC/TOF) + Configurable tpcPidNsigmaCutLaPr{"tpcPidNsigmaCutLaPr", 5, "tpcPidNsigmaCutLaPr"}; + Configurable tpcPidNsigmaCutLaPi{"tpcPidNsigmaCutLaPi", 5, "tpcPidNsigmaCutLaPi"}; + Configurable tpcPidNsigmaCutK0Pi{"tpcPidNsigmaCutK0Pi", 5, "tpcPidNsigmaCutK0Pi"}; + + // PID (TOF) + Configurable tofPidNsigmaCutLaPr{"tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutK0Pi{"tofPidNsigmaCutK0Pi", 1e+6, "tofPidNsigmaCutK0Pi"}; + } v0Selections; + + struct : ConfigurableGroup { + std::string prefix = "cascadeSelections"; // JSON group name + // Selection criteria: acceptance + Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; + Configurable daughterEtaCut{"daughterEtaCut", 0.8, "max eta for daughters"}; + + // Standard 6 topological criteria on V0 + Configurable v0cospa{"v0cospa", 0.97, "min V0 CosPA"}; + Configurable dcav0dau{"dcav0dau", 1.0, "max DCA V0 Daughters (cm)"}; + Configurable dcav0topv{"dcav0topv", .05, "min DCA V0 to PV (cm)"}; + Configurable dcapiontopv{"dcapiontopv", .05, "min DCA Pion To PV (cm)"}; + Configurable dcaprotontopv{"dcaprotontopv", .05, "min DCA Proton To PV (cm)"}; + Configurable v0radius{"v0radius", 1.2, "minimum V0 radius (cm)"}; + Configurable v0radiusMax{"v0radiusMax", 1E5, "maximum V0 radius (cm)"}; + + // Standard 6 topological criteria on cascades + Configurable casccospa{"casccospa", 0.97, "min Cascade CosPA"}; + Configurable dcacascdau{"dcacascdau", 1.0, "max DCA Cascade Daughters (cm)"}; + Configurable dcaxybachbaryontopv{"dcaxybachbaryontopv", -1, "DCAxy Bachelor-Baryon to PV (cm)"}; + Configurable bachbaryoncospa{"bachbaryoncospa", -1, "Bachelor-Baryon CosPA"}; + Configurable dcabachtopv{"dcabachtopv", .05, "min DCA Bachelor To PV (cm)"}; + Configurable cascradius{"cascradius", 0.5, "minimum Cascade radius (cm)"}; + Configurable cascradiusMax{"cascradiusMax", 1E5, "maximum Cascade radius (cm)"}; + Configurable cascProperLifeTime{"cascProperLifeTime", 3, "maximum lifetime (ctau)"}; + + // invariant mass selection + Configurable v0MassWindow{"v0MassWindow", 0.008, "#Lambda mass (GeV/#it{c}^{2})"}; + Configurable compMassRejection{"compMassRejection", 0.008, "Competing mass rejection (GeV/#it{c}^{2})"}; + + // Track quality + Configurable minTPCrows{"minTPCrows", 70, "minimum TPC crossed rows"}; + Configurable minITSclusters{"minITSclusters", -1, "minimum ITS clusters"}; + Configurable skipTPConly{"skipTPConly", false, "skip V0s comprised of at least one TPC only prong"}; + Configurable requireBachITSonly{"requireBachITSonly", false, "require that bachelor track is ITSonly (overrides TPC quality)"}; + Configurable requirePosITSonly{"requirePosITSonly", false, "require that positive track is ITSonly (overrides TPC quality)"}; + Configurable requireNegITSonly{"requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; + Configurable requireAtLeastOneHasTOF{"requireAtLeastOneHasTOF", false, "require that at least one of daughter tracks has an associated TOF signal"}; + Configurable requireBachHasTOF{"requireBachHasTOF", false, "require that bachelor track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requirePosHasTOF{"requirePosHasTOF", false, "require that positive track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requireNegHasTOF{"requireNegHasTOF", false, "require that negative track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requireBachHasTRD{"requireBachHasTRD", false, "require that bachelor track is formed out of TRD track."}; + Configurable requirePosHasTRD{"requirePosHasTRD", false, "require that positive track is formed out of TRD track."}; + Configurable requireNegHasTRD{"requireNegHasTRD", false, "require that negative track is formed out of TRD track."}; + Configurable minTRDclusters{"minTRDclusters", -1, "minimum TRD clusters IF track is formed out of a TRD track"}; + + // PID (TPC/TOF) + Configurable tpcPidNsigmaCut{"tpcPidNsigmaCut", 5, "tpcPidNsigmaCut"}; + Configurable tofPidNsigmaCutLaPr{"tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutXiPi{"tofPidNsigmaCutXiPi", 1e+6, "tofPidNsigmaCutXiPi"}; + Configurable tofPidNsigmaCutOmKa{"tofPidNsigmaCutOmKa", 1e+6, "tofPidNsigmaCutOmKa"}; + } cascSelections; + + // CCDB options + struct : ConfigurableGroup { + std::string prefix = "ccdbConfigurations"; // JSON group name + 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"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; + + // manual + Configurable useCustomMagField{"useCustomMagField", false, "Use custom magnetic field value"}; + Configurable customMagField{"customMagField", 5.0f, "Manually set magnetic field"}; + } ccdbConfigurations; + + o2::ccdb::CcdbApi ccdbApi; + Service ccdb; + ctpRateFetcher rateFetcher; + + struct : ConfigurableGroup { + std::string prefix = "axisConfigurations"; // JSON group name + // configurable binning of histograms + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis axisPtCoarse{"axisPtCoarse", {50, 0.0f, 10.0f}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis axisV0CosPA{"axisV0CosPA", {100, 0.95f, 1.0f}, "V0 cos(PA)"}; + ConfigurableAxis axisV0PA{"axisV0PA", {1000, 0.f, 1.0f}, "Pointing angle (rad)"}; + ConfigurableAxis axisV0Radius{"axisV0Radius", {100, 0.0f, 50.0f}, "V0 radius (cm)"}; + ConfigurableAxis axisV0RadiusCoarse{"axisV0RadiusCoarse", {30, 0.0f, 30.0f}, "V0 radius (cm)"}; + ConfigurableAxis axisV0DecayLength{"axisV0DecayLength", {100, 0.0f, 80.0f}, "Decay length (cm)"}; + ConfigurableAxis axisV0DCANegToPV{"axisV0DCANegToPV", {100, -1.0f, 1.0f}, "DCA neg. to PV (cm)"}; + ConfigurableAxis axisV0DCAPosToPV{"axisV0DCAPosToPV", {100, -1.0f, 1.0f}, "DCA pos. to PV (cm)"}; + ConfigurableAxis axisV0DCAV0Dau{"axisV0DCAV0Dau", {100, 0.0f, 2.f}, "DCA between V0 daughters (cm)"}; + ConfigurableAxis axisLifetimeK0s{"axisLifetimeK0s", {100, 0.0f, 40.0f}, "K^{0}_{S} lifetime (cm)"}; + ConfigurableAxis axisLifetimeLambda{"axisLifetimeLambda", {100, 0.0f, 80.0f}, "#Lambda lifetime (cm)"}; + ConfigurableAxis axisDecayLengthK0s{"axisDecayLengthK0s", {100, 0.0f, 40.0f}, "K^{0}_{S} decay length (cm)"}; + ConfigurableAxis axisDecayLengthLambda{"axisDecayLengthLambda", {100, 0.0f, 80.0f}, "#Lambda decay length (cm)"}; + ConfigurableAxis axisV0DCAV0ToPVK0s{"axisV0DCAV0ToPVK0s", {250, 0.0f, 0.25f}, "DCA V0 to PV (cm)"}; + ConfigurableAxis axisV0DCAV0ToPVLambda{"axisV0DCAV0ToPVLambda", {250, 0.0f, 0.25f}, "DCA V0 to PV (cm)"}; + ConfigurableAxis axisInvMassK0s{"axisInvMassK0s", {200, 0.4f, 0.6f}, "Inv. mass (GeV/#it{c}%{2})"}; + ConfigurableAxis axisInvMassLambda{"axisInvMassLambda", {200, 1.07f, 1.17f}, "Inv. mass (GeV/#it{c}%{2})"}; + ConfigurableAxis axisTPCPIDPion{"axisTPCPIDPion", {100, -10.f, 10.f}, "TPC PID Pion N_{#sigma}"}; + ConfigurableAxis axisTPCPIDProton{"axisTPCPIDProton", {100, -10.f, 10.f}, "TPC PID Proton N_{#sigma}"}; + ConfigurableAxis axisEtaFlag{"axisEtaFlag", {3, -1.5f, 1.5f}, "Pseudorapidity"}; + ConfigurableAxis axisEta{"axisEta", {100, -1.0f, 1.0f}, "Pseudorapidity"}; + ConfigurableAxis axisPhi{"axisPhi", {90, 0.0f, constants::math::TwoPI}, "Azimuthal angle (#rad)"}; + ConfigurableAxis axisITSMapDaughters{"axisITSMapDaughters", {8, -0.5f, 7.5f}, ""}; + + ConfigurableAxis axisPtCasc{"axisPtCasc", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis axisCascDecayLength{"axisCascDecayLength", {200, 0.0f, 20.0f}, "Decay length (cm)"}; + ConfigurableAxis axisCascRadius{"axisCascRadius", {100, 0.0f, 30.0f}, "Decay length (cm)"}; + ConfigurableAxis axisCascCosPA{"axisCascCosPA", {100, 0.95f, 1.0f}, "Casc cos(PA)"}; + ConfigurableAxis axisCascRapidity{"axisCascRapidity", {100, -1.0f, 1.0f}, "Rapidity"}; + ConfigurableAxis axisCascLifetimeXi{"axisLifetimeXi", {100, 0.0f, 40.0f}, "#Xi lifetime (cm)"}; + ConfigurableAxis axisCascLifetimeOmega{"axisLifetimeOmega", {100, 0.0f, 30.0f}, "#Omega lifetime (cm)"}; + ConfigurableAxis axisCascDCAV0Dau{"axisCascDCAV0Dau", {100, 0.0f, 2.f}, "DCA between casc. daughters (cm)"}; + ConfigurableAxis axisCascDCABachToPV{"axisCascDCABachToPV", {100, -1.0f, 1.0f}, "DCA bach. to PV (cm)"}; + ConfigurableAxis axisInvMassXi{"axisInvMassXi", {80, 1.28f, 1.36f}, "Inv. mass (GeV/#it{c}%{2})"}; + ConfigurableAxis axisInvMassOmega{"axisInvMassOmega", {80, 1.63f, 1.71f}, "Inv. mass (GeV/#it{c}%{2})"}; + + } axisConfigurations; + + int dauEtaFlag = 0; void init(InitContext const&) { - const AxisSpec axisPt{binPt, "p_{T} (GeV/c)"}; - const AxisSpec axisPtsmall{binPtsmall, "p_{T} (GeV/c)"}; - const AxisSpec axisV0CosPA{binV0CosPA, "V0 Cos(PA)"}; - const AxisSpec axisV0PA{binV0PA, "Pointing Angle"}; - const AxisSpec axisV0Radius{binV0Radius, "V0 Radius (cm)"}; - const AxisSpec axisV0DecayLength{binV0DecayLength, "V0 Decay Length (cm)"}; - const AxisSpec axisV0DCANegToPV{binV0DCANegToPV, "V0 DCA Neg To PV (cm)"}; - const AxisSpec axisV0DCAPosToPV{binV0DCAPosToPV, "V0 DCA Pos To PV (cm)"}; - const AxisSpec axisV0DCAV0Dau{binV0DCAV0Dau, "V0 DCA V0 Daughters (cm)"}; - const AxisSpec axisCtauK0s{binCtauK0s, "K0s c#tau (cm)"}; - const AxisSpec axisCtauLambda{binCtauLambda, "Lambda c#tau (cm)"}; - const AxisSpec axisCtauAntiLambda{binCtauAntiLambda, "AntiLambda c#tau (cm)"}; - const AxisSpec axisDecayLengthK0s{binDecayLengthK0s, "Decay length K0s (cm)"}; - const AxisSpec axisDecayLengthLambda{binDecayLengthLambda, "Decay length Lambda (cm)"}; - const AxisSpec axisDecayLengthAntiLambda{binDecayLengthAntiLambda, "Decay length AntiLambda (cm)"}; - const AxisSpec axisV0DCAV0ToPVK0S{binV0DCAV0ToPVK0S, "DCAV0ToPV K0s"}; - const AxisSpec axisV0DCAV0ToPVLambda{binV0DCAV0ToPVLambda, "DCAV0ToPV Lambda"}; - const AxisSpec axisV0DCAV0ToPVAntiLambda{binV0DCAV0ToPVAntiLambda, "DCAV0ToPV AntiLambda"}; - const AxisSpec axisInvMassK0S{binInvMassK0S, "InvMass K0s"}; - const AxisSpec axisInvMassLambda{binInvMassLambda, "InvMass Lambda"}; - const AxisSpec axisInvMassAntiLambda{binInvMassAntiLambda, "InvMass AntiLambda"}; - const AxisSpec axisInvMassCasc{binInvMassCasc, "InvMass Cascades"}; - const AxisSpec axisResponsePionFromLambda{binResponsePionFromLambda, "Response Pion From Lambda"}; - const AxisSpec axisResponseProtonFromLambda{binResponseProtonFromLambda, "Response Proton From Lambda"}; - const AxisSpec axisEta{binEta, "Eta"}; - const AxisSpec axisPhi{binPhi, "Phi"}; - const AxisSpec axisEtaFlag{binEtaFlag, "Eta"}; - const AxisSpec axisRadius{binRadius, "Radius"}; - const AxisSpec axisRadiussmall{binRadiussmall, "Radius"}; - const AxisSpec axisITSMapDaughters{binITSMapDaughters, "ITS Map Daughters"}; - - histos_eve.add("GeneratedParticles", "GeneratedParticles", {HistType::kTH3F, {{14, 0.0f, 14.0f}, {100, 0, 10}, {100, 0.f, 50.f}}}); - histos_eve.add("hEventCounter", "hEventCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); - histos_eve.add("hEventCounterMC", "hEventCounterMC", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); - histos_eve.add("GenK0sPtVsEta", "GenK0sPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenLambdaPtVsEta", "GenLambdaPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenAntiLambdaPtVsEta", "GenAntiLambdaPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenXiMinusPtVsEta", "GenXiMinusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenXiPlusPtVsEta", "GenXiPlusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenOmegaMinusPtVsEta", "GenOmegaMinusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenOmegaPlusPtVsEta", "GenOmegaPlusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - - histos_V0.add("CosPA", "CosPA", HistType::kTH1F, {axisV0CosPA}); - histos_V0.add("V0Radius", "V0Radius", HistType::kTH1F, {axisV0Radius}); - histos_V0.add("DecayLength", "DecayLength", HistType::kTH1F, {axisV0DecayLength}); - histos_V0.add("V0DCANegToPV", "V0DCANegToPV", HistType::kTH1F, {axisV0DCANegToPV}); - histos_V0.add("V0DCAPosToPV", "V0DCAPosToPV", HistType::kTH1F, {axisV0DCAPosToPV}); - histos_V0.add("V0DCAV0Daughters", "V0DCAV0Daughters", HistType::kTH1F, {axisV0DCAV0Dau}); - histos_V0.add("CtauK0s", "CtauK0s", HistType::kTH1F, {axisCtauK0s}); - histos_V0.add("CtauLambda", "CtauLambda", HistType::kTH1F, {axisCtauLambda}); - histos_V0.add("CtauAntiLambda", "CtauAntiLambda", HistType::kTH1F, {axisCtauAntiLambda}); - histos_V0.add("DecayLengthK0s", "DecayLengthK0s", HistType::kTH1F, {axisDecayLengthK0s}); - histos_V0.add("DecayLengthLambda", "DecayLengthLambda", HistType::kTH1F, {axisDecayLengthLambda}); - histos_V0.add("DecayLengthAntiLambda", "DecayLengthAntiLambda", HistType::kTH1F, {axisDecayLengthAntiLambda}); - histos_V0.add("V0DCAV0ToPVK0S", "V0DCAV0ToPVK0S", HistType::kTH1F, {axisV0DCAV0ToPVK0S}); - histos_V0.add("V0DCAV0ToPVLambda", "V0DCAV0ToPVLambda", HistType::kTH1F, {axisV0DCAV0ToPVLambda}); - histos_V0.add("V0DCAV0ToPVAntiLambda", "V0DCAV0ToPVAntiLambda", HistType::kTH1F, {axisV0DCAV0ToPVAntiLambda}); - histos_V0.add("InvMassK0S", "InvMassK0S", HistType::kTH3F, {axisPt, axisInvMassK0S, axisEtaFlag}); - histos_V0.add("InvMassLambda", "InvMassLambda", HistType::kTH3F, {axisPt, axisInvMassLambda, axisEtaFlag}); - histos_V0.add("InvMassAntiLambda", "InvMassAntiLambda", HistType::kTH3F, {axisPt, axisInvMassAntiLambda, axisEtaFlag}); - histos_V0.add("ResponsePionFromLambda", "ResponsePionFromLambda", HistType::kTH2F, {axisPt, axisResponsePionFromLambda}); - histos_V0.add("ResponseProtonFromLambda", "ResponseProtonFromLambda", HistType::kTH2F, {axisPt, axisResponseProtonFromLambda}); - histos_V0.add("InvMassK0SVsPtVsPA", "InvMassK0SVsPtVsPA", HistType::kTH3F, {axisPt, axisV0PA, axisInvMassK0S}); - histos_V0.add("InvMassK0STrue", "InvMassK0STrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 0.4f, 0.6f}}}); - histos_V0.add("InvMassLambdaTrue", "InvMassLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); - histos_V0.add("InvMassAntiLambdaTrue", "InvMassAntiLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); + if (doprocessGenerated || doprocessMonteCarlo) { + isMC = true; + } + // setting CCDB service + ccdb->setURL(ccdbConfigurations.ccdbUrl); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); + + // Event Counters + histos_event.add("hEventCounter", "hEventCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); + histos_event.add("hEventCounterMC", "hEventCounterMC", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); + histos_event.add("hEventSelection", "hEventSelection", kTH1D, {{24, -0.5f, +23.5f}}); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "posZ cut"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeStrict"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeNarrow"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "kNoCollInRofStd"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStrict"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "Below min occup."); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "Above max occup."); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(19, "Below min IR"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(20, "Above max IR"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(21, "INEL>0"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(22, "INEL>1"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(23, "RCT flags"); + + histos_V0.add("CosPA", "CosPA", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("Radius", "Radius", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("DecayLength", "DecayLength", kTH1F, {axisConfigurations.axisV0DecayLength}); + histos_V0.add("DCANegToPV", "DCANegToPV", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCAPosToPV", "DCAPosToPV", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAV0Daughters", "DCAV0Daughters", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("CosPAK0s", "CosPAK0s", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("CosPALambda", "CosPALambda", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("CosPAAntiLambda", "CosPAAntiLambda", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("RadiusK0s", "RadiusK0s", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("RadiusLambda", "RadiusLambda", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("RadiusAntiLambda", "RadiusAntiLambda", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("DCANegToPVK0s", "DCANegToPVK0s", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCANegToPVLambda", "DCANegToPVLambda", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCANegToPVAntiLambda", "DCANegToPVAntiLambda", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCAPosToPVK0s", "DCAPosToPVK0s", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAPosToPVLambda", "DCAPosToPVLambda", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAPosToPVAntiLambda", "DCAPosToPVAntiLambda", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAV0DaughtersK0s", "DCAV0DaughtersK0s", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("DCAV0DaughtersLambda", "DCAV0DaughtersLambda", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("DCAV0DaughtersAntiLambda", "DCAV0DaughtersAntiLambda", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("LifetimeK0s", "LifetimeK0s", kTH1F, {axisConfigurations.axisLifetimeK0s}); + histos_V0.add("LifetimeLambda", "LifetimeLambda", kTH1F, {axisConfigurations.axisLifetimeLambda}); + histos_V0.add("LifetimeAntiLambda", "LifetimeAntiLambda", kTH1F, {axisConfigurations.axisLifetimeLambda}); + histos_V0.add("DecayLengthK0s", "DecayLengthK0s", kTH1F, {axisConfigurations.axisDecayLengthK0s}); + histos_V0.add("DecayLengthLambda", "DecayLengthLambda", kTH1F, {axisConfigurations.axisDecayLengthLambda}); + histos_V0.add("DecayLengthAntiLambda", "DecayLengthAntiLambda", kTH1F, {axisConfigurations.axisDecayLengthLambda}); + histos_V0.add("DCAV0ToPVK0s", "DCAV0ToPVK0s", kTH1F, {axisConfigurations.axisV0DCAV0ToPVK0s}); + histos_V0.add("DCAV0ToPVLambda", "DCAV0ToPVLambda", kTH1F, {axisConfigurations.axisV0DCAV0ToPVLambda}); + histos_V0.add("DCAV0ToPVAntiLambda", "DCAV0ToPVAntiLambda", kTH1F, {axisConfigurations.axisV0DCAV0ToPVLambda}); + histos_V0.add("InvMassK0s", "InvMassK0s", kTH3F, {axisConfigurations.axisPt, axisConfigurations.axisInvMassK0s, axisConfigurations.axisEtaFlag}); + histos_V0.add("InvMassLambda", "InvMassLambda", kTH3F, {axisConfigurations.axisPt, axisConfigurations.axisInvMassLambda, axisConfigurations.axisEtaFlag}); + histos_V0.add("InvMassAntiLambda", "InvMassAntiLambda", kTH3F, {axisConfigurations.axisPt, axisConfigurations.axisInvMassLambda, axisConfigurations.axisEtaFlag}); + histos_V0.add("TPCPIDPosPionFromK0s", "TPCPIDPosPionFromK0s", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDPion}); + histos_V0.add("TPCPIDNegPionFromK0s", "TPCPIDNegPionFromK0s", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDProton}); + histos_V0.add("TPCPIDPionFromLambda", "TPCPIDPionFromLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDPion}); + histos_V0.add("TPCPIDProtonFromLambda", "TPCPIDProtonFromLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDProton}); + histos_V0.add("TPCPIDPionFromAntiLambda", "TPCPIDPionFromAntiLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDPion}); + histos_V0.add("TPCPIDProtonFromAntiLambda", "TPCPIDProtonFromAntiLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDProton}); if (doextraanalysis) { - histos_V0.add("InvMassK0S_Radius", "InvMassK0S_Radius", HistType::kTH2F, {axisRadius, axisInvMassK0S}); - histos_V0.add("InvMassLambda_Radius", "InvMassLambda_Radius", HistType::kTH2F, {axisRadius, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_Radius", "InvMassAntiLambda_Radius", HistType::kTH2F, {axisRadius, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_EtaDaughters", "InvMassK0S_EtaDaughters", HistType::kTH3F, {axisEta, axisEta, axisInvMassK0S}); - histos_V0.add("InvMassLambda_EtaDaughters", "InvMassLambda_EtaDaughters", HistType::kTH3F, {axisEta, axisEta, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_EtaDaughters", "InvMassAntiLambda_EtaDaughters", HistType::kTH3F, {axisEta, axisEta, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_Ctau", "InvMassK0S_Ctau", HistType::kTH2F, {axisCtauK0s, axisInvMassK0S}); - histos_V0.add("InvMassLambda_Ctau", "InvMassLambda_Ctau", HistType::kTH2F, {axisCtauLambda, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_Ctau", "InvMassAntiLambda_Ctau", HistType::kTH2F, {axisCtauAntiLambda, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_PhiDaughters", "InvMassK0S_PhiDaughters", HistType::kTH3F, {axisPhi, axisPhi, axisInvMassK0S}); - histos_V0.add("InvMassLambda_PhiDaughters", "InvMassLambda_PhiDaughters", HistType::kTH3F, {axisPhi, axisPhi, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_PhiDaughters", "InvMassAntiLambda_PhiDaughters", HistType::kTH3F, {axisPhi, axisPhi, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_ITSMapDaughters", "InvMassK0S_ITSMapDaughters", HistType::kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassK0S}); - histos_V0.add("InvMassLambda_ITSMapDaughters", "InvMassLambda_ITSMapDaughters", HistType::kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_ITSMapDaughters", "InvMassAntiLambda_ITSMapDaughters", HistType::kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_PtRadius", "InvMassK0S_PtRadius", HistType::kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassK0S}); - histos_V0.add("InvMassLambda_PtRadius", "InvMassLambda_PtRadius", HistType::kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_PtRadius", "InvMassAntiLambda_PtRadius", HistType::kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassAntiLambda}); - histos_V0.add("InvMassLambdaVsPtVsPA", "InvMassLambdaVsPtVsPA", HistType::kTH3F, {axisPt, axisV0PA, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambdaVsPtVsPA", "InvMassAntiLambdaVsPtVsPA", HistType::kTH3F, {axisPt, axisV0PA, axisInvMassAntiLambda}); - } - - histos_Casc.add("CascSelectionSummary", "CascSelectionSummary", HistType::kTH1F, {{10, 0.f, 10.f}}); - histos_Casc.add("QA_XiMinusCandidates", "QA_XiMinusCandidates", HistType::kTH1F, {{10, 0.f, 10.f}}); - histos_Casc.add("XiProgSelections", "XiProgSelections", HistType::kTH2F, {{30, 0.5f, 30.5f}, {2, -2, 2}}); - histos_Casc.add("OmegaProgSelections", "OmegaProgSelections", HistType::kTH2F, {{30, 0.5f, 30.5f}, {2, -2, 2}}); - histos_Casc.add("CascCosPA", "CascCosPA", HistType::kTH2D, {{200, 0.6f, 1.0f}, {2, -2, 2}}); - histos_Casc.add("V0CosPA", "V0CosPA", HistType::kTH2D, {{300, 0.7f, 1.0f}, {2, -2, 2}}); - histos_Casc.add("V0CosPAToXi", "V0CosPAToXi", HistType::kTH2D, {{100, 0.9f, 1.0f}, {2, -2, 2}}); - histos_Casc.add("CascDecayLength", "CascDecayLength", HistType::kTH2F, {{100, 0.0f, 10.0f}, {2, -2, 2}}); - histos_Casc.add("CascDecayLengthXi", "CascDecayLengthXi", HistType::kTH2F, {{200, 0.0f, 20.0f}, {2, -2, 2}}); - histos_Casc.add("CascDecayLengthOmega", "CascDecayLengthOmega", HistType::kTH2F, {{200, 0.0f, 20.0f}, {2, -2, 2}}); - histos_Casc.add("CascRadius", "CascRadius", HistType::kTH2F, {{100, 0.0f, 10.0f}, {2, -2, 2}}); - histos_Casc.add("CascV0Radius", "CascV0Radius", HistType::kTH2D, {{100, 0.0f, 10.0f}, {2, -2, 2}}); - histos_Casc.add("CascyXi", "CascyXi", HistType::kTH2F, {{200, -2.0f, 2.0f}, {2, -2, 2}}); - histos_Casc.add("CascyOmega", "CascyOmega", HistType::kTH2F, {{200, -2.0f, 2.0f}, {2, -2, 2}}); - histos_Casc.add("CascCtauXi", "CascCtauXi", HistType::kTH2F, {{100, 0.0f, 100.0f}, {2, -2, 2}}); - histos_Casc.add("CascCtauOmega", "CascCtauOmega", HistType::kTH2F, {{100, 0.0f, 100.0f}, {2, -2, 2}}); - histos_Casc.add("V0Ctau", "V0Ctau", HistType::kTH2F, {{100, 0.0f, 100.0f}, {2, -2, 2}}); - histos_Casc.add("CascPt", "CascPt", HistType::kTH2F, {{100, 0.0f, 25.0f}, {2, -2, 2}}); - histos_Casc.add("DcaV0Daughters", "DcaV0Daughters", HistType::kTH2F, {{110, 0.0f, 2.2f}, {2, -2, 2}}); - histos_Casc.add("DcaCascDaughters", "DcaCascDaughters", HistType::kTH2F, {{110, 0.0f, 2.2f}, {2, -2, 2}}); - histos_Casc.add("DcaV0ToPV", "DcaV0ToPV", HistType::kTH2F, {{200, 0.0f, 2.f}, {2, -2, 2}}); - histos_Casc.add("DcaBachToPV", "DcaBachToPV", HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}); - histos_Casc.add("DcaPosToPV", "DcaPosToPV", HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}); - histos_Casc.add("DcaNegToPV", "DcaNegToPV", HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}); - histos_Casc.add("InvMassLambdaDaughter", "InvMassLambdaDaughter", HistType::kTH2F, {{100, 1.1f, 1.13f}, {2, -2, 2}}); - histos_Casc.add("InvMassXiPlus", "InvMassXiPlus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassXiMinus", "InvMassXiMinus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassXiPlus_Radius", "InvMassXiPlus_Radius", HistType::kTH2F, {{100, 0.f, 50.f}, {80, 1.28f, 1.36f}}); - histos_Casc.add("InvMassXiMinus_Radius", "InvMassXiMinus_Radius", HistType::kTH2F, {{100, 0.f, 50.f}, {80, 1.28f, 1.36f}}); - histos_Casc.add("InvMassOmegaPlus", "InvMassOmegaPlus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassOmegaMinus", "InvMassOmegaMinus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassXiPlusTrue", "InvMassXiPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); - histos_Casc.add("InvMassXiMinusTrue", "InvMassXiMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); - histos_Casc.add("InvMassOmegaPlusTrue", "InvMassOmegaPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); - histos_Casc.add("InvMassOmegaMinusTrue", "InvMassOmegaMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); - - V0SelectionSummary->SetBinContent(1, V0_rapidity); - V0SelectionSummary->SetBinContent(2, V0_cosPA); - V0SelectionSummary->SetBinContent(3, V0_dcav0dau); - V0SelectionSummary->SetBinContent(4, V0_dcapostopv); - V0SelectionSummary->SetBinContent(5, V0_dcanegtopv); - V0SelectionSummary->SetBinContent(6, V0_radius); - V0SelectionSummary->SetBinContent(7, NSigmaV0Pion); - V0SelectionSummary->SetBinContent(8, NSigmaV0Proton); - V0SelectionSummary->SetBinContent(9, lifetimecut->get("lifetimecutLambda")); - V0SelectionSummary->SetBinContent(10, lifetimecut->get("lifetimecutK0S")); - - V0SelectionSummary->GetXaxis()->SetBinLabel(1, "rapidity"); - V0SelectionSummary->GetXaxis()->SetBinLabel(2, "cosPA"); - V0SelectionSummary->GetXaxis()->SetBinLabel(3, "dcav0dau"); - V0SelectionSummary->GetXaxis()->SetBinLabel(4, "dcapostopv"); - V0SelectionSummary->GetXaxis()->SetBinLabel(5, "dcanegtopv"); - V0SelectionSummary->GetXaxis()->SetBinLabel(6, "radius"); - V0SelectionSummary->GetXaxis()->SetBinLabel(7, "NSigmaV0Pion"); - V0SelectionSummary->GetXaxis()->SetBinLabel(8, "NSigmaV0Proton"); - V0SelectionSummary->GetXaxis()->SetBinLabel(9, "lifetimecutLambda"); - V0SelectionSummary->GetXaxis()->SetBinLabel(10, "lifetimecutK0S"); - } + histos_V0.add("InvMassK0s_Radius", "InvMassK0s_Radius", kTH2F, {axisConfigurations.axisV0Radius, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_Radius", "InvMassLambda_Radius", kTH2F, {axisConfigurations.axisV0Radius, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_Radius", "InvMassAntiLambda_Radius", kTH2F, {axisConfigurations.axisV0Radius, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_EtaDaughters", "InvMassK0s_EtaDaughters", kTH3F, {axisConfigurations.axisEta, axisConfigurations.axisEta, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_EtaDaughters", "InvMassLambda_EtaDaughters", kTH3F, {axisConfigurations.axisEta, axisConfigurations.axisEta, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_EtaDaughters", "InvMassAntiLambda_EtaDaughters", kTH3F, {axisConfigurations.axisEta, axisConfigurations.axisEta, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_Lifetime", "InvMassK0s_Lifetime", kTH2F, {axisConfigurations.axisLifetimeK0s, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_Lifetime", "InvMassLambda_Lifetime", kTH2F, {axisConfigurations.axisLifetimeLambda, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_Lifetime", "InvMassAntiLambda_Lifetime", kTH2F, {axisConfigurations.axisLifetimeLambda, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_PhiDaughters", "InvMassK0s_PhiDaughters", kTH3F, {axisConfigurations.axisPhi, axisConfigurations.axisPhi, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_PhiDaughters", "InvMassLambda_PhiDaughters", kTH3F, {axisConfigurations.axisPhi, axisConfigurations.axisPhi, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_PhiDaughters", "InvMassAntiLambda_PhiDaughters", kTH3F, {axisConfigurations.axisPhi, axisConfigurations.axisPhi, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_ITSMapDaughters", "InvMassK0s_ITSMapDaughters", kTH3F, {axisConfigurations.axisITSMapDaughters, axisConfigurations.axisITSMapDaughters, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_ITSMapDaughters", "InvMassLambda_ITSMapDaughters", kTH3F, {axisConfigurations.axisITSMapDaughters, axisConfigurations.axisITSMapDaughters, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_ITSMapDaughters", "InvMassAntiLambda_ITSMapDaughters", kTH3F, {axisConfigurations.axisITSMapDaughters, axisConfigurations.axisITSMapDaughters, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_PtRadius", "InvMassK0s_PtRadius", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0RadiusCoarse, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_PtRadius", "InvMassLambda_PtRadius", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0RadiusCoarse, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_PtRadius", "InvMassAntiLambda_PtRadius", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0RadiusCoarse, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0sVsPtVsPA", "InvMassK0sVsPtVsPA", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0PA, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambdaVsPtVsPA", "InvMassLambdaVsPtVsPA", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0PA, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambdaVsPtVsPA", "InvMassAntiLambdaVsPtVsPA", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0PA, axisConfigurations.axisInvMassLambda}); + } + + histos_Casc.add("QA_CascadeCandidates", "QA_CascadeCandidates", {HistType::kTH1F, {{10, 0.f, 10.f}}}); + histos_Casc.add("CascCosPA", "CascCosPA", kTH2D, {axisConfigurations.axisV0CosPA, {2, -2, 2}}); + histos_Casc.add("V0CosPA", "V0CosPA", kTH2D, {axisConfigurations.axisV0CosPA, {2, -2, 2}}); + histos_Casc.add("V0CosPAToXi", "V0CosPAToXi", kTH2D, {axisConfigurations.axisV0CosPA, {2, -2, 2}}); + histos_Casc.add("CascDecayLength", "CascDecayLength", kTH2D, {axisConfigurations.axisCascDecayLength, {2, -2, 2}}); + histos_Casc.add("CascRadius", "CascRadius", kTH2F, {axisConfigurations.axisCascRadius, {2, -2, 2}}); + histos_Casc.add("V0Radius", "V0Radius", kTH2F, {axisConfigurations.axisV0Radius, {2, -2, 2}}); + histos_Casc.add("CascRapidityXi", "CascRapidityXi", kTH2F, {axisConfigurations.axisCascRapidity, {2, -2, 2}}); + histos_Casc.add("CascRapidityOmega", "CascRapidityOmega", kTH2F, {axisConfigurations.axisCascRapidity, {2, -2, 2}}); + histos_Casc.add("CascLifetimeXi", "CascLifetimeXi", kTH2F, {axisConfigurations.axisCascLifetimeXi, {2, -2, 2}}); + histos_Casc.add("CascLifetimeOmega", "CascLifetimeOmega", kTH2F, {axisConfigurations.axisCascLifetimeOmega, {2, -2, 2}}); + histos_Casc.add("V0Lifetime", "V0Lifetime", kTH2F, {axisConfigurations.axisLifetimeLambda, {2, -2, 2}}); + histos_Casc.add("CascPt", "CascPt", kTH2F, {axisConfigurations.axisPtCasc, {2, -2, 2}}); + histos_Casc.add("DcaV0Daughters", "DcaV0Daughters", kTH2F, {axisConfigurations.axisV0DCAV0Dau, {2, -2, 2}}); + histos_Casc.add("DcaCascDaughters", "DcaCascDaughters", kTH2F, {axisConfigurations.axisCascDCAV0Dau, {2, -2, 2}}); + histos_Casc.add("DcaV0ToPV", "DcaV0ToPV", kTH2F, {axisConfigurations.axisV0DCAV0ToPVLambda, {2, -2, 2}}); + histos_Casc.add("DcaBachToPV", "DcaBachToPV", kTH2F, {axisConfigurations.axisCascDCABachToPV, {2, -2, 2}}); + histos_Casc.add("DcaPosToPV", "DcaPosToPV", kTH2F, {axisConfigurations.axisV0DCAPosToPV, {2, -2, 2}}); + histos_Casc.add("DcaNegToPV", "DcaNegToPV", kTH2F, {axisConfigurations.axisV0DCANegToPV, {2, -2, 2}}); + histos_Casc.add("InvMassLambda", "InvMassLambda", kTH2F, {axisConfigurations.axisInvMassLambda, {2, -2, 2}}); + histos_Casc.add("InvMassXiPlus", "InvMassXiPlus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassXi, {2, -1.f, 1.f}}); + histos_Casc.add("InvMassXiMinus", "InvMassXiMinus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassXi, {2, -1.f, 1.f}}); + histos_Casc.add("InvMassXiPlus_Radius", "InvMassXiPlus_Radius", kTH2F, {axisConfigurations.axisCascRadius, axisConfigurations.axisInvMassXi}); + histos_Casc.add("InvMassXiMinus_Radius", "InvMassXiMinus_Radius", kTH2F, {axisConfigurations.axisCascRadius, axisConfigurations.axisInvMassXi}); + histos_Casc.add("InvMassOmegaPlus", "InvMassOmegaPlus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassOmega, {2, -1.f, 1.f}}); + histos_Casc.add("InvMassOmegaMinus", "InvMassOmegaMinus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassOmega, {2, -1.f, 1.f}}); + + if (isMC) { + histos_event.add("GeneratedV0s", "GeneratedV0s", kTH3D, {{3, 0.0f, 3.0f}, axisConfigurations.axisPt, axisConfigurations.axisV0Radius}); + histos_event.get(HIST("GeneratedV0s"))->GetXaxis()->SetBinLabel(1, "K^{0}_{S}"); + histos_event.get(HIST("GeneratedV0s"))->GetXaxis()->SetBinLabel(2, "#Lambda"); + histos_event.get(HIST("GeneratedV0s"))->GetXaxis()->SetBinLabel(3, "#bar{#Lambda}"); + histos_event.add("GeneratedCascades", "GeneratedCascades", kTH3D, {{4, 0.0f, 4.0f}, axisConfigurations.axisPtCasc, axisConfigurations.axisCascRadius}); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(1, "#Xi^{#minus}"); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(2, "#bar{#Xi}^{+}"); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(3, "#Omega^{#minus}"); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(4, "#bar{#Omega}^{+}"); + + histos_V0.add("InvMassK0sTrue", "InvMassK0sTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 0.4f, 0.6f}}}); + histos_V0.add("InvMassLambdaTrue", "InvMassLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); + histos_V0.add("InvMassAntiLambdaTrue", "InvMassAntiLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); + + histos_Casc.add("InvMassXiPlusTrue", "InvMassXiPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); + histos_Casc.add("InvMassXiMinusTrue", "InvMassXiMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); + histos_Casc.add("InvMassOmegaPlusTrue", "InvMassOmegaPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); + histos_Casc.add("InvMassOmegaMinusTrue", "InvMassOmegaMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); + } - /////////////////////////////////////////////////// - ////////// Collisions QA - reconstructed ////////// - /////////////////////////////////////////////////// + // Initialise the RCTFlagsChecker + rctFlagsChecker.init(rctConfigurations.cfgRCTLabel.value, rctConfigurations.cfgCheckZDC, rctConfigurations.cfgTreatLimitedAcceptanceAsBad); + } - void processReconstructedEvent(soa::Join::iterator const& Collision) + template + bool isEventAccepted(TCollision collision, bool fillHists) + // check whether the collision passes our collision selections { - histos_eve.fill(HIST("hEventCounter"), 0.5); - if (sel8 && !Collision.sel8()) { - return; + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 0. /* all collisions */); } - histos_eve.fill(HIST("hEventCounter"), 1.5); - } - PROCESS_SWITCH(v0cascadesQA, processReconstructedEvent, "Process reconstructed level Event", true); - /////////////////////////////////////// - ////////// Collision QA - MC ////////// - /////////////////////////////////////// + if (eventSelections.requireSel8 && !collision.sel8()) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); + } + + if (eventSelections.requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */); + } + + if (eventSelections.rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */); + } + + if (eventSelections.rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + } + + if (std::abs(collision.posZ()) > eventSelections.maxZVtxPosition) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */); + } + + if (eventSelections.requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */); + } + + if (eventSelections.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 7 /* PV position consistency check */); + } - void processMcEvent(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups>& collisions) + if (eventSelections.requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */); + } + + if (eventSelections.requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */); + } + + if (eventSelections.rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */); + } + + if (eventSelections.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/); + } + + if (eventSelections.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 10 microseconds */); + } + + if (eventSelections.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 13 /* No other collision within +/- 2 microseconds */); + } + + if (eventSelections.requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */); + } + + if (eventSelections.requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */); + } + + float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); + if (eventSelections.minOccupancy >= 0 && collisionOccupancy < eventSelections.minOccupancy) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 16 /* Below min occupancy */); + } + + if (eventSelections.maxOccupancy >= 0 && collisionOccupancy > eventSelections.maxOccupancy) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 17 /* Above max occupancy */); + } + + // Fetch interaction rate only if required (in order to limit ccdb calls) + auto bc = collision.template bc_as(); + double interactionRate = ((eventSelections.minIR >= 0 || eventSelections.maxIR >= 0) && !irSource.value.empty()) ? rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource) * 1.e-3 : -1; + if (eventSelections.minIR >= 0 && interactionRate < eventSelections.minIR) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 18 /* Below min IR */); + } + + if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 19 /* Above max IR */); + } + + if (eventSelections.requireINEL0 && !collision.isInelGt0()) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 20 /* INEL > 0 */); + } + + if (eventSelections.requireINEL1 && !collision.isInelGt1()) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 21 /* INEL > 1 */); + } + + if (!rctConfigurations.cfgRCTLabel.value.empty() && !rctFlagsChecker(collision)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 22 /* Pass CBT condition */); + } + + return true; + } + + template + bool isV0Accepted(TV0 v0, TCollision collision, float rapidity, int v0Type) + // precalculate this information so that a check is one mask operation, not many { - histos_eve.fill(HIST("hEventCounterMC"), 0.5); + // Base topological variables + if (v0.v0radius() < v0Selections.v0radius) + return false; + if (v0.v0radius() > v0Selections.v0radiusMax) + return false; + if (std::abs(v0.dcapostopv()) < v0Selections.dcapostopv) + return false; + if (std::abs(v0.dcanegtopv()) < v0Selections.dcanegtopv) + return false; + if (v0.v0cosPA() < v0Selections.v0cospa) + return false; + if (v0.dcaV0daughters() > v0Selections.dcav0dau) + return false; + + // proper lifetime + if ((v0Type == kLambda || v0Type == kAntiLambda) && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 > v0Selections.lifetimecut->get("lifetimecutLambda")) + return false; + if (v0Type == kK0s && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short > v0Selections.lifetimecut->get("lifetimecutK0s")) + return false; + + // armenteros (for K0s only) + if (v0Type == kK0s && v0Selections.armPodCut > 1e-4 && v0.qtarm() * v0Selections.armPodCut < std::abs(v0.alpha())) + return false; + + // rapidity + if (std::abs(rapidity) > v0Selections.rapidityCut) + return false; + + // competing mass rejection + if ((v0Type == kLambda || v0Type == kAntiLambda) && std::fabs(v0.mK0Short() - o2::constants::physics::MassK0Short) < v0Selections.compMassRejection) + return false; + if (v0Type == kK0s && std::fabs(v0.mLambda() - o2::constants::physics::MassLambda0) < v0Selections.compMassRejection) + return false; + + auto posTrackExtra = v0.template posTrack_as(); + auto negTrackExtra = v0.template negTrack_as(); + + // ITS quality flags + bool posIsFromAfterburner = posTrackExtra.isITSAfterburner(); + bool negIsFromAfterburner = negTrackExtra.isITSAfterburner(); + + // reject afterburner track or not + if (v0Selections.rejectPosITSafterburner && posIsFromAfterburner) + return false; + if (v0Selections.rejectNegITSafterburner && negIsFromAfterburner) + return false; + + // keep afterburner track or not + if (v0Selections.requirePosITSafterburnerOnly && !posIsFromAfterburner) + return false; + if (v0Selections.requireNegITSafterburnerOnly && !negIsFromAfterburner) + return false; + + // check minium ITS clusters + if (posTrackExtra.itsNCls() < v0Selections.minITSclusters) + return false; + if (negTrackExtra.itsNCls() < v0Selections.minITSclusters) + return false; + + // check maximum ITS chi2 per clusters + if (posTrackExtra.itsChi2NCl() > v0Selections.maxITSchi2PerNcls) + return false; + if (negTrackExtra.itsChi2NCl() > v0Selections.maxITSchi2PerNcls) + return false; + + // ITS only tag + if (v0Selections.requirePosITSonly) { + if (posTrackExtra.tpcNClsCrossedRows() > 0) + return false; + } + if (v0Selections.requireNegITSonly) { + if (negTrackExtra.tpcNClsCrossedRows() > 0) + return false; + } - std::vector SelectedEvents(collisions.size()); - int nevts = 0; - for (const auto& collision : collisions) { - if (sel8 && !collision.sel8()) { - continue; + // check minimum TPC crossed rows + if (posTrackExtra.tpcNClsCrossedRows() < v0Selections.minTPCrows) + return false; + if (negTrackExtra.tpcNClsCrossedRows() < v0Selections.minTPCrows) + return false; + + // check maximum TPC chi2 per clusters + if (posTrackExtra.tpcChi2NCl() > v0Selections.maxTPCchi2PerNcls) + return false; + if (negTrackExtra.tpcChi2NCl() > v0Selections.maxTPCchi2PerNcls) + return false; + + // check the maximum fraction of allowed shared TPC + if (posTrackExtra.tpcFractionSharedCls() > v0Selections.maxFractionTPCSharedClusters) + return false; + if (negTrackExtra.tpcFractionSharedCls() > v0Selections.maxFractionTPCSharedClusters) + return false; + + // TPC only tag + if (v0Selections.skipTPConly) { + if (posTrackExtra.hasTPC()) + return false; + if (negTrackExtra.hasTPC()) + return false; + } + + // TPC PID + if (v0Type == kK0s) { + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutK0Pi) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutK0Pi) + return false; + } + if (v0Type == kLambda) { + if (std::fabs(posTrackExtra.tpcNSigmaPr()) > v0Selections.tpcPidNsigmaCutLaPr) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutLaPi) + return false; + } + if (v0Type == kAntiLambda) { + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutLaPi) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPr()) > v0Selections.tpcPidNsigmaCutLaPr) + return false; + } + + // TOF Requirement checks + if (v0Selections.requirePosHasTOF && !v0.positiveHasTOF()) { + return false; + } + if (v0Selections.requireNegHasTOF && !v0.negativeHasTOF()) { + return false; + } + + if (v0Selections.requireAtLeastOneHasTOF && !v0.positiveHasTOF() && !v0.negativeHasTOF()) { + return false; + } + + // TOF Nsigma + if (v0Type == kK0s) { + if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaK0PiPlus()) > v0Selections.tofPidNsigmaCutK0Pi) { + return false; } - SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5 && v0.negativeHasTOF() && std::fabs(v0.tofNSigmaK0PiMinus()) > v0Selections.tofPidNsigmaCutK0Pi) { + return false; + } + } + if (v0Type == kLambda) { + if (v0Selections.tofPidNsigmaCutLaPr < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaLaPr()) > v0Selections.tofPidNsigmaCutLaPr) { + return false; + } + if (v0Selections.tofPidNsigmaCutLaPi < 1e+5 && v0.negativeHasTOF() && std::fabs(v0.tofNSigmaLaPi()) > v0Selections.tofPidNsigmaCutLaPi) { + return false; + } + } + if (v0Type == kAntiLambda) { + if (v0Selections.tofPidNsigmaCutLaPi < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaLaPi()) > v0Selections.tofPidNsigmaCutLaPi) { + return false; + } + if (v0Selections.tofPidNsigmaCutLaPr < 1e+5 && v0.negativeHasTOF() && std::fabs(v0.tofNSigmaLaPr()) > v0Selections.tofPidNsigmaCutLaPr) { + return false; + } + } + + // TRD Requirement checks + if (v0Selections.requirePosHasTRD && !posTrackExtra.hasTRD()) { + return false; + } + if (v0Selections.requireNegHasTRD && !negTrackExtra.hasTRD()) { + return false; } - SelectedEvents.resize(nevts); - const auto evtReconstructedAndSelected = std::find(SelectedEvents.begin(), SelectedEvents.end(), mcCollision.globalIndex()) != SelectedEvents.end(); + int posTRDhits = 0, negTRDhits = 0; + for (unsigned int i = 0; i <= 5; i++) { + if (posTrackExtra.trdPattern() & (1 << i)) { + posTRDhits++; + } + if (negTrackExtra.trdPattern() & (1 << i)) { + negTRDhits++; + } + } - if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection - return; + if (posTrackExtra.hasTRD() && posTRDhits < v0Selections.minTRDclusters) { + return false; + } + if (negTrackExtra.hasTRD() && negTRDhits < v0Selections.minTRDclusters) { + return false; } - histos_eve.fill(HIST("hEventCounterMC"), 1.5); + return true; + } + + template + bool isCascadeSelected(TCascade casc, TCollision collision, float rapidity, int cascType) + // precalculate this information so that a check is one mask operation, not many + { + // + // Base topological variables + // + + // v0 radius min/max selections + if (casc.v0radius() < cascSelections.v0radius) + return false; + if (casc.v0radius() > cascSelections.v0radiusMax) + return false; + // DCA proton and pion to PV for Lambda and AntiLambda decay hypotheses + if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion + if (std::fabs(casc.dcapostopv()) < cascSelections.dcaprotontopv) + return false; + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcapiontopv) + return false; + } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton + if (std::fabs(casc.dcapostopv()) < cascSelections.dcapiontopv) + return false; + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcaprotontopv) + return false; + } + // V0 cosine of pointing angle + if (casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.v0cospa) + return false; + // DCA between v0 daughters + if (casc.dcaV0daughters() > cascSelections.dcav0dau) + return false; + // DCA V0 to prim vtx + if (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.dcav0topv) + return false; + + // casc radius min/max selections + if (casc.cascradius() < cascSelections.cascradius) + return false; + if (casc.cascradius() > cascSelections.cascradiusMax) + return false; + // DCA bachelor selection + if (std::fabs(casc.dcabachtopv()) < cascSelections.dcabachtopv) + return false; + // Bachelor-baryon cosPA selection + if (casc.bachBaryonCosPA() < cascSelections.bachbaryoncospa) + return false; + // DCA bachelor-baryon selection + if (std::fabs(casc.bachBaryonDCAxyToPV()) < cascSelections.dcaxybachbaryontopv) + return false; + // casc cosine of pointing angle + if (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.casccospa) + return false; + // DCA between casc daughters + if (casc.dcacascdaughters() > cascSelections.dcacascdau) + return false; + + if (casc.sign() < 0 && (cascType == kXiP || cascType == kOmegaP)) + return false; + if (casc.sign() > 0 && (cascType == kXiM || cascType == kOmegaM)) + return false; + + // + // proper lifetime + float distOverTotMom = std::sqrt(std::pow(casc.x() - collision.posX(), 2) + std::pow(casc.y() - collision.posY(), 2) + std::pow(casc.z() - collision.posZ(), 2)) / (casc.p() + 1E-10); + if ((cascType == kXiM || cascType == kXiP) && distOverTotMom * o2::constants::physics::MassXiMinus > cascSelections.cascProperLifeTime) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && distOverTotMom * o2::constants::physics::MassOmegaMinus > cascSelections.cascProperLifeTime) + return false; + + // rapidity + if (std::fabs(rapidity) > cascSelections.rapidityCut) + return false; + + // + // invariant mass window + // + if (std::fabs(casc.mLambda() - o2::constants::physics::MassLambda0) > cascSelections.v0MassWindow) + return false; + + // + // competing mass rejection + // + if ((cascType == kXiM || cascType == kXiP) && std::fabs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < cascSelections.compMassRejection) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && std::fabs(casc.mXi() - o2::constants::physics::MassXiMinus) < cascSelections.compMassRejection) + return false; + + auto bachTrackExtra = casc.template bachelor_as(); + auto posTrackExtra = casc.template posTrack_as(); + auto negTrackExtra = casc.template negTrack_as(); + + // ITS quality flags + if (bachTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + if (posTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + if (negTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + + // TPC quality flags + if (bachTrackExtra.tpcNClsCrossedRows() < cascSelections.minTPCrows) + return false; + if (posTrackExtra.tpcNClsCrossedRows() < cascSelections.minTPCrows) + return false; + if (negTrackExtra.tpcNClsCrossedRows() < cascSelections.minTPCrows) + return false; + + // TPC PID + if ((cascType == kXiM || cascType == kXiP) && std::fabs(bachTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && std::fabs(bachTrackExtra.tpcNSigmaKa()) > cascSelections.tpcPidNsigmaCut) + return false; + if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion + if (std::fabs(posTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) + return false; + } - double posx = mcCollision.posX(); - double posy = mcCollision.posY(); + // TOF Requirement checks + if (cascSelections.requireBachHasTOF && !casc.bachelorHasTOF()) { + return false; + } + if (cascSelections.requirePosHasTOF && !casc.positiveHasTOF()) { + return false; + } + if (cascSelections.requireNegHasTOF && !casc.negativeHasTOF()) { + return false; + } - for (auto& mcparticle : mcParticles) { + if (cascSelections.requireAtLeastOneHasTOF && !casc.bachelorHasTOF() && !casc.positiveHasTOF() && !casc.negativeHasTOF()) { + return false; + } - if (!mcparticle.has_daughters()) { - continue; + // + // TOF PID in NSigma + // Bachelor track + if (casc.bachelorHasTOF()) { + if ((cascType == kXiM || cascType == kXiP) && std::fabs(casc.tofNSigmaXiPi()) > cascSelections.tofPidNsigmaCutXiPi) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && std::fabs(casc.tofNSigmaOmKa()) > cascSelections.tofPidNsigmaCutOmKa) + return false; + } + // Positive track + if (casc.positiveHasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> positive daughter = proton + if (cascType == kXiM && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + if (cascType == kOmegaM && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + } else { // Xi+ or Omega+ --> positive daughter = pion + if (cascType == kXiP && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + if (cascType == kOmegaP && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + } + } + // Negative track + if (casc.negativeHasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> negative daughter = pion + if (cascType == kXiM && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + if (cascType == kOmegaM && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + } else { // Xi+ or Omega+ --> negative daughter = proton + if (cascType == kXiP && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + if (cascType == kOmegaP && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPr) + return false; } + } - double vx = 0; - double vy = 0; - for (auto& mcparticleDaughter0 : mcparticle.daughters_as()) { - vx = mcparticleDaughter0.vx() - posx; - vy = mcparticleDaughter0.vy() - posy; - if (vx != 0 && vy != 0) - break; + // TRD Requirement checks + if (cascSelections.requireBachHasTRD && !bachTrackExtra.hasTRD()) { + return false; + } + if (cascSelections.requirePosHasTRD && !posTrackExtra.hasTRD()) { + return false; + } + if (cascSelections.requireNegHasTRD && !negTrackExtra.hasTRD()) { + return false; + } + + int bachTRDhits = 0, posTRDhits = 0, negTRDhits = 0; + for (unsigned int i = 0; i <= 5; i++) { + if (bachTrackExtra.trdPattern() & (1 << i)) { + bachTRDhits++; } - double R_Decay = TMath::Sqrt(vx * vx + vy * vy); - - if (mcparticle.pdgCode() == PDG_t::kK0Short) - histos_eve.fill(HIST("GenK0sPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kLambda0) - histos_eve.fill(HIST("GenLambdaPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kLambda0Bar) - histos_eve.fill(HIST("GenAntiLambdaPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kXiMinus) - histos_eve.fill(HIST("GenXiMinusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kXiPlusBar) - histos_eve.fill(HIST("GenXiPlusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kOmegaMinus) - histos_eve.fill(HIST("GenOmegaMinusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kOmegaPlusBar) - histos_eve.fill(HIST("GenOmegaPlusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - - if (mcparticle.isPhysicalPrimary() && TMath::Abs(mcparticle.y()) < V0_rapidity) { - if (mcparticle.pdgCode() == PDG_t::kK0Short) - histos_eve.fill(HIST("GeneratedParticles"), 0.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kLambda0) - histos_eve.fill(HIST("GeneratedParticles"), 2.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kLambda0Bar) - histos_eve.fill(HIST("GeneratedParticles"), 4.5, mcparticle.pt(), R_Decay); + if (posTrackExtra.trdPattern() & (1 << i)) { + posTRDhits++; } - if (mcparticle.isPhysicalPrimary() && TMath::Abs(mcparticle.y()) < Casc_rapidity) { - if (mcparticle.pdgCode() == PDG_t::kXiMinus) - histos_eve.fill(HIST("GeneratedParticles"), 6.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kXiPlusBar) - histos_eve.fill(HIST("GeneratedParticles"), 8.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kOmegaMinus) - histos_eve.fill(HIST("GeneratedParticles"), 10.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kOmegaPlusBar) - histos_eve.fill(HIST("GeneratedParticles"), 12.5, mcparticle.pt(), R_Decay); + if (negTrackExtra.trdPattern() & (1 << i)) { + negTRDhits++; } } + + if (bachTrackExtra.hasTRD() && bachTRDhits < cascSelections.minTRDclusters) { + return false; + } + if (posTrackExtra.hasTRD() && posTRDhits < cascSelections.minTRDclusters) { + return false; + } + if (negTrackExtra.hasTRD() && negTRDhits < cascSelections.minTRDclusters) { + return false; + } + + return true; + } + + template + bool checkV0MCAssociation(TV0 v0, int v0Type) + // precalculate this information so that a check is one mask operation, not many + { + if (!v0.isPhysicalPrimary()) + return false; + + bool isPositiveProton = v0.pdgCodePositive() == PDG_t::kProton; + bool isPositivePion = v0.pdgCodePositive() == PDG_t::kPiPlus || (doTreatPiToMuon && v0.pdgCodePositive() == PDG_t::kMuonPlus); + bool isNegativeProton = v0.pdgCodeNegative() == PDG_t::kProtonBar; + bool isNegativePion = v0.pdgCodeNegative() == PDG_t::kPiMinus || (doTreatPiToMuon && v0.pdgCodeNegative() == PDG_t::kMuonMinus); + + if (v0Type == kK0s && v0.pdgCode() == PDG_t::kK0Short && isPositivePion && isNegativePion) { + return true; + } + if (v0Type == kLambda && v0.pdgCode() == PDG_t::kLambda0 && isPositiveProton && isNegativePion) { + return true; + } + if (v0Type == kAntiLambda && v0.pdgCode() == PDG_t::kLambda0Bar && isPositivePion && isNegativeProton) { + return true; + } + return false; + } + + template + bool checkCascadeMCAssociation(TCascade casc, int cascType) + // precalculate this information so that a check is one mask operation, not many + { + if (!casc.isPhysicalPrimary()) + return false; + + bool isBachelorPionPlus = casc.pdgCodeBachelor() == PDG_t::kPiPlus || (doTreatPiToMuon && casc.pdgCodeBachelor() == PDG_t::kMuonPlus); + bool isBachelorKaonPlus = casc.pdgCodeBachelor() == PDG_t::kKPlus; + bool isBachelorPionMinus = casc.pdgCodeBachelor() == PDG_t::kPiMinus || (doTreatPiToMuon && casc.pdgCodeBachelor() == PDG_t::kMuonMinus); + bool isBachelorKaonMinus = casc.pdgCodeBachelor() == PDG_t::kKMinus; + bool isPositiveProton = casc.pdgCodePositive() == PDG_t::kProton; + bool isPositivePion = casc.pdgCodePositive() == PDG_t::kPiPlus || (doTreatPiToMuon && casc.pdgCodePositive() == PDG_t::kMuonPlus); + bool isNegativeProton = casc.pdgCodeNegative() == PDG_t::kProtonBar; + bool isNegativePion = casc.pdgCodeNegative() == PDG_t::kPiMinus || (doTreatPiToMuon && casc.pdgCodeNegative() == PDG_t::kMuonMinus); + + if (cascType == kXiM && casc.pdgCode() == PDG_t::kXiMinus && isPositiveProton && isNegativePion && isBachelorPionMinus) { + return true; + } + if (cascType == kXiP && casc.pdgCode() == PDG_t::kXiPlusBar && isPositivePion && isNegativeProton && isBachelorPionPlus) { + return true; + } + if (cascType == kOmegaM && casc.pdgCode() == PDG_t::kOmegaMinus && isPositiveProton && isNegativePion && isBachelorKaonMinus) { + return true; + } + if (cascType == kOmegaP && casc.pdgCode() == PDG_t::kOmegaPlusBar && isPositivePion && isNegativeProton && isBachelorKaonPlus) { + return true; + } + return false; } - PROCESS_SWITCH(v0cascadesQA, processMcEvent, "Process MC level Event", true); //////////////////////////////////////////// - ////////// V0 QA - Reconstructed /////////// + /////////// QA - Reconstructed ///////////// //////////////////////////////////////////// - void processReconstructedV0(soa::Join::iterator const& collision, aod::V0Datas const& fullV0s, DaughterTracks&) + void processReconstructed(soa::Join::iterator const& collision, soa::Join const& fullV0s, soa::Join const& fullCascades, DaughterTracks const&, aod::BCsWithTimestamps const&) { - if (sel8 && !collision.sel8()) { + histos_event.fill(HIST("hEventCounter"), 0.5); + if (!isEventAccepted(collision, true)) { return; } + histos_event.fill(HIST("hEventCounter"), 1.5); + + for (auto const& v0 : fullV0s) { + if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut || + std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future + + if (v0Selections.v0TypeSelection > -1 && v0.v0Type() != v0Selections.v0TypeSelection) + continue; // skip V0s that are not standard + + // fillV0s(v0, collision.posX(), collision.posY(), collision.posZ()); - int dauEtaFlag = 0; - for (auto& v0 : fullV0s) { auto posdau = v0.posTrack_as(); auto negdau = v0.negTrack_as(); - if (posdau.eta() < 0. && negdau.eta() < 0.) { + if (v0.negativeeta() < 0. && v0.positiveeta() < 0.) { dauEtaFlag = -1; - } else if (posdau.eta() >= 0. && negdau.eta() >= 0.) { + } else if (v0.negativeeta() >= 0. && v0.positiveeta() >= 0.) { dauEtaFlag = 1; } else { dauEtaFlag = 0; } - // check TPC - if (checkDauTPC && (!posdau.hasTPC() || !negdau.hasTPC())) { - continue; - } - - Int_t posITSNhits = 0, negITSNhits = 0; - for (unsigned int i = 0; i < 7; i++) { - if (posdau.itsClusterMap() & (1 << i)) { - posITSNhits++; - } - if (negdau.itsClusterMap() & (1 << i)) { - negITSNhits++; - } - } - histos_V0.fill(HIST("CosPA"), v0.v0cosPA()); - histos_V0.fill(HIST("V0Radius"), v0.v0radius()); - histos_V0.fill(HIST("V0DCANegToPV"), v0.dcanegtopv()); - histos_V0.fill(HIST("V0DCAPosToPV"), v0.dcapostopv()); - histos_V0.fill(HIST("V0DCAV0Daughters"), v0.dcaV0daughters()); + histos_V0.fill(HIST("Radius"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPV"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPV"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0Daughters"), v0.dcaV0daughters()); float decayLength = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(v0.px(), v0.py(), v0.pz()); histos_V0.fill(HIST("DecayLength"), decayLength); @@ -417,166 +1115,98 @@ struct v0cascadesQA { float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; - if (v0.v0cosPA() > V0_cosPA && - v0.v0radius() > V0_radius && - v0.dcaV0daughters() < V0_dcav0dau && - TMath::Abs(v0.dcapostopv()) > V0_dcapostopv && TMath::Abs(v0.dcanegtopv()) > V0_dcanegtopv) { - - // K0Short - if (TMath::Abs(v0.yK0Short()) < V0_rapidity && - CtauK0s < lifetimecut->get("lifetimecutK0S") && - TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaV0Pion && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaV0Pion) { - - histos_V0.fill(HIST("CtauK0s"), CtauK0s); - histos_V0.fill(HIST("DecayLengthK0s"), decayLength); - histos_V0.fill(HIST("InvMassK0S"), v0.pt(), v0.mK0Short(), dauEtaFlag); - histos_V0.fill(HIST("InvMassK0SVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mK0Short()); - histos_V0.fill(HIST("V0DCAV0ToPVK0S"), v0.dcav0topv()); - if (doextraanalysis) { - histos_V0.fill(HIST("InvMassK0S_Radius"), v0.v0radius(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_PtRadius"), v0.pt(), v0.v0radius(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_ITSMapDaughters"), posITSNhits, negITSNhits, v0.mK0Short()); - } - } - - // Lambda - if (TMath::Abs(v0.yLambda()) < V0_rapidity && - CtauLambda < lifetimecut->get("lifetimecutLambda") && - TMath::Abs(posdau.tpcNSigmaPr()) < NSigmaV0Proton && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaV0Pion) { - - histos_V0.fill(HIST("DecayLengthLambda"), decayLength); - histos_V0.fill(HIST("CtauLambda"), CtauLambda); - histos_V0.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), dauEtaFlag); - if (doextraanalysis) - histos_V0.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mLambda()); - histos_V0.fill(HIST("V0DCAV0ToPVLambda"), v0.dcav0topv()); - if (v0.v0cosPA() > 0.999 && v0.dcaV0daughters() < 1 && TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) > 0.012 && TMath::Abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) > 0.08 && TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < 0.002) { - histos_V0.fill(HIST("ResponsePionFromLambda"), v0.pt(), negdau.tpcNSigmaPi()); - histos_V0.fill(HIST("ResponseProtonFromLambda"), v0.pt(), posdau.tpcNSigmaPr()); - } - if (doextraanalysis) { - histos_V0.fill(HIST("InvMassLambda_Radius"), v0.v0radius(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_Ctau"), CtauLambda, v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_ITSMapDaughters"), posITSNhits, negITSNhits, v0.mLambda()); - } - } - - // AntiLambda - if (TMath::Abs(v0.yLambda()) < V0_rapidity && - CtauLambda < lifetimecut->get("lifetimecutLambda") && - TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaV0Pion && TMath::Abs(negdau.tpcNSigmaPr()) < NSigmaV0Proton) { - - histos_V0.fill(HIST("DecayLengthAntiLambda"), decayLength); - histos_V0.fill(HIST("CtauAntiLambda"), CtauLambda); - histos_V0.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda(), dauEtaFlag); - if (doextraanalysis) - histos_V0.fill(HIST("InvMassAntiLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mAntiLambda()); - histos_V0.fill(HIST("V0DCAV0ToPVAntiLambda"), v0.dcav0topv()); - if (doextraanalysis) { - histos_V0.fill(HIST("InvMassAntiLambda_Radius"), v0.v0radius(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_Ctau"), CtauLambda, v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_ITSMapDaughters"), posITSNhits, negITSNhits, v0.mAntiLambda()); - } + // K0Short + if (isV0Accepted(v0, collision, v0.rapidity(0), kK0s)) { + histos_V0.fill(HIST("CosPAK0s"), v0.v0cosPA()); + histos_V0.fill(HIST("RadiusK0s"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPVK0s"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPVK0s"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0DaughtersK0s"), v0.dcaV0daughters()); + histos_V0.fill(HIST("DecayLengthK0s"), decayLength); + histos_V0.fill(HIST("LifetimeK0s"), CtauK0s); + histos_V0.fill(HIST("InvMassK0s"), v0.pt(), v0.mK0Short(), dauEtaFlag); + histos_V0.fill(HIST("DCAV0ToPVK0s"), v0.dcav0topv()); + histos_V0.fill(HIST("TPCPIDPosPionFromK0s"), v0.pt(), posdau.tpcNSigmaPi()); + histos_V0.fill(HIST("TPCPIDNegPionFromK0s"), v0.pt(), negdau.tpcNSigmaPi()); + if (doextraanalysis) { + histos_V0.fill(HIST("InvMassK0s_Radius"), v0.v0radius(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_PtRadius"), v0.pt(), v0.v0radius(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_Lifetime"), CtauK0s, v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_ITSMapDaughters"), posdau.itsNCls(), negdau.itsNCls(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0sVsPtVsPA"), v0.pt(), std::acos(v0.v0cosPA()), v0.mK0Short()); } } - } - } - PROCESS_SWITCH(v0cascadesQA, processReconstructedV0, "Process reconstructed level V0s", true); - - //////////////////////////////// - ////////// V0 QA - MC ////////// - //////////////////////////////// - - void processMcV0(soa::Join::iterator const& collision, soa::Join const& fullV0s, aod::McParticles const&, MyTracksMC const&) - { - if (sel8 && !collision.sel8()) { - return; - } - - for (auto& v0 : fullV0s) { - if (!v0.has_mcParticle()) { - continue; - } - auto v0mcparticle = v0.mcParticle(); - Int_t lPDG = 0; - if (TMath::Abs(v0mcparticle.pdgCode()) == PDG_t::kK0Short || TMath::Abs(v0mcparticle.pdgCode()) == PDG_t::kLambda0) { - lPDG = v0mcparticle.pdgCode(); + // Lambda + if (isV0Accepted(v0, collision, v0.rapidity(1), kLambda)) { + histos_V0.fill(HIST("CosPALambda"), v0.v0cosPA()); + histos_V0.fill(HIST("RadiusLambda"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPVLambda"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPVLambda"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0DaughtersLambda"), v0.dcaV0daughters()); + histos_V0.fill(HIST("DecayLengthLambda"), decayLength); + histos_V0.fill(HIST("LifetimeLambda"), CtauLambda); + histos_V0.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), dauEtaFlag); + histos_V0.fill(HIST("DCAV0ToPVLambda"), v0.dcav0topv()); + histos_V0.fill(HIST("TPCPIDPionFromLambda"), v0.pt(), negdau.tpcNSigmaPi()); + histos_V0.fill(HIST("TPCPIDProtonFromLambda"), v0.pt(), posdau.tpcNSigmaPr()); + if (doextraanalysis) { + histos_V0.fill(HIST("InvMassLambda_Radius"), v0.v0radius(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_Lifetime"), CtauLambda, v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_ITSMapDaughters"), posdau.itsNCls(), negdau.itsNCls(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), std::acos(v0.v0cosPA()), v0.mLambda()); + } } - float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; - float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; - - if (v0.v0cosPA() > V0_cosPA && - v0.v0radius() > V0_radius && - v0.dcaV0daughters() < V0_dcav0dau && - TMath::Abs(v0.dcapostopv()) > V0_dcapostopv && - TMath::Abs(v0.dcanegtopv()) > V0_dcanegtopv) { - - // K0Short - if (lPDG == PDG_t::kK0Short) { - if (TMath::Abs(v0.yK0Short()) < V0_rapidity && CtauK0s < lifetimecut->get("lifetimecutK0S")) { - histos_V0.fill(HIST("InvMassK0STrue"), v0.pt(), v0.v0radius(), v0.mK0Short()); - } - } - if (lPDG == PDG_t::kLambda0) { - if (TMath::Abs(v0.yLambda()) < V0_rapidity && CtauLambda < lifetimecut->get("lifetimecutLambda")) { - histos_V0.fill(HIST("InvMassLambdaTrue"), v0.pt(), v0.v0radius(), v0.mLambda()); - } - } - if (lPDG == PDG_t::kLambda0Bar) { - if (TMath::Abs(v0.yLambda()) < V0_rapidity && CtauLambda < lifetimecut->get("lifetimecutLambda")) { - histos_V0.fill(HIST("InvMassAntiLambdaTrue"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); - } + // AntiLambda + if (isV0Accepted(v0, collision, v0.rapidity(2), kAntiLambda)) { + histos_V0.fill(HIST("CosPAAntiLambda"), v0.v0cosPA()); + histos_V0.fill(HIST("RadiusAntiLambda"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPVAntiLambda"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPVAntiLambda"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0DaughtersAntiLambda"), v0.dcaV0daughters()); + histos_V0.fill(HIST("DecayLengthAntiLambda"), decayLength); + histos_V0.fill(HIST("LifetimeAntiLambda"), CtauLambda); + histos_V0.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda(), dauEtaFlag); + histos_V0.fill(HIST("DCAV0ToPVAntiLambda"), v0.dcav0topv()); + histos_V0.fill(HIST("TPCPIDPionFromAntiLambda"), v0.pt(), posdau.tpcNSigmaPi()); + histos_V0.fill(HIST("TPCPIDProtonFromAntiLambda"), v0.pt(), negdau.tpcNSigmaPr()); + if (doextraanalysis) { + histos_V0.fill(HIST("InvMassAntiLambda_Radius"), v0.v0radius(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_Lifetime"), CtauLambda, v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_ITSMapDaughters"), posdau.itsNCls(), negdau.itsNCls(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambdaVsPtVsPA"), v0.pt(), std::acos(v0.v0cosPA()), v0.mAntiLambda()); } } } - } - PROCESS_SWITCH(v0cascadesQA, processMcV0, "Process MC level V0s", false); - ////////////////////////////////////// - ///// Cascade QA - Reconstructed ///// - ////////////////////////////////////// - - void processReconstructedCascade(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, DaughterTracks&) - { - if (sel8 && !collision.sel8()) { - return; - } - - for (auto& casc : Cascades) { - auto bachelor = casc.bachelor_as(); - auto posdau = casc.posTrack_as(); - auto negdau = casc.negTrack_as(); - - // check TPC - if (checkDauTPC && (!posdau.hasTPC() || !negdau.hasTPC() || !bachelor.hasTPC())) { - continue; - } + for (auto const& casc : fullCascades) { + if (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut || + std::abs(casc.positiveeta()) > cascSelections.daughterEtaCut || + std::abs(casc.bacheloreta()) > cascSelections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future histos_Casc.fill(HIST("CascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()), casc.sign()); histos_Casc.fill(HIST("V0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), casc.sign()); - double v0cospatoxi = RecoDecay::cpa(array{casc.x(), casc.y(), casc.z()}, array{casc.xlambda(), casc.ylambda(), casc.zlambda()}, array{casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()}); + double v0cospatoxi = RecoDecay::cpa(std::array{casc.x(), casc.y(), casc.z()}, array{casc.xlambda(), casc.ylambda(), casc.zlambda()}, std::array{casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()}); histos_Casc.fill(HIST("V0CosPAToXi"), v0cospatoxi, casc.sign()); histos_Casc.fill(HIST("CascRadius"), casc.cascradius(), casc.sign()); - histos_Casc.fill(HIST("CascV0Radius"), casc.v0radius(), casc.sign()); - histos_Casc.fill(HIST("CascyXi"), casc.yXi(), casc.sign()); - histos_Casc.fill(HIST("CascyOmega"), casc.yOmega(), casc.sign()); + histos_Casc.fill(HIST("V0Radius"), casc.v0radius(), casc.sign()); + histos_Casc.fill(HIST("CascRapidityXi"), casc.yXi(), casc.sign()); + histos_Casc.fill(HIST("CascRapidityOmega"), casc.yOmega(), casc.sign()); float cascDecayLength = std::sqrt(std::pow(casc.x() - collision.posX(), 2) + std::pow(casc.y() - collision.posY(), 2) + std::pow(casc.z() - collision.posZ(), 2)); histos_Casc.fill(HIST("CascDecayLength"), cascDecayLength, casc.sign()); - histos_Casc.fill(HIST("CascDecayLengthXi"), cascDecayLength, casc.sign()); - histos_Casc.fill(HIST("CascDecayLengthOmega"), cascDecayLength, casc.sign()); float cascTotalMomentum = RecoDecay::sqrtSumOfSquares(casc.px(), casc.py(), casc.pz()); float CtauXi = cascDecayLength / (cascTotalMomentum + 1E-10) * o2::constants::physics::MassXi0; // see O2Physics/Common/Core/MC.h for codes and names accepted @@ -586,9 +1216,9 @@ struct v0cascadesQA { float v0DecayLength = std::sqrt(std::pow(casc.xlambda() - casc.x(), 2) + std::pow(casc.ylambda() - casc.y(), 2) + std::pow(casc.zlambda() - casc.z(), 2)); float CtauV0 = v0DecayLength / (v0TotalMomentum + 1E-10) * o2::constants::physics::MassLambda0; - histos_Casc.fill(HIST("CascCtauXi"), CtauXi, casc.sign()); - histos_Casc.fill(HIST("CascCtauOmega"), CtauOmega, casc.sign()); - histos_Casc.fill(HIST("V0Ctau"), CtauV0, casc.sign()); + histos_Casc.fill(HIST("CascLifetimeXi"), CtauXi, casc.sign()); + histos_Casc.fill(HIST("CascLifetimeOmega"), CtauOmega, casc.sign()); + histos_Casc.fill(HIST("V0Lifetime"), CtauV0, casc.sign()); histos_Casc.fill(HIST("CascPt"), casc.pt(), casc.sign()); histos_Casc.fill(HIST("DcaV0Daughters"), casc.dcaV0daughters(), casc.sign()); histos_Casc.fill(HIST("DcaCascDaughters"), casc.dcacascdaughters(), casc.sign()); @@ -596,176 +1226,196 @@ struct v0cascadesQA { histos_Casc.fill(HIST("DcaBachToPV"), casc.dcabachtopv(), casc.sign()); histos_Casc.fill(HIST("DcaPosToPV"), casc.dcapostopv(), casc.sign()); histos_Casc.fill(HIST("DcaNegToPV"), casc.dcanegtopv(), casc.sign()); - histos_Casc.fill(HIST("InvMassLambdaDaughter"), casc.mLambda(), casc.sign()); - - if (casc.v0radius() > Casc_v0radius && - casc.cascradius() > Casc_cascradius && - casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_v0cospa && - casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_casccospa && - TMath::Abs(casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ())) > Casc_dcav0topv && - TMath::Abs(casc.dcapostopv()) > Casc_dcapostopv && TMath::Abs(casc.dcanegtopv()) > Casc_dcanegtopv && TMath::Abs(casc.dcabachtopv()) > Casc_dcabachtopv && - casc.dcaV0daughters() < Casc_dcav0dau && casc.dcacascdaughters() < Casc_dcacascdau) { - if (casc.sign() < 0) { - if (TMath::Abs(posdau.tpcNSigmaPr()) < NSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaCascPion) { - if (TMath::Abs(casc.yXi()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < NSigmaCascPion) { - histos_Casc.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta()); - histos_Casc.fill(HIST("InvMassXiMinus_Radius"), casc.cascradius(), casc.mXi()); - } - if (TMath::Abs(casc.yOmega()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < NSigmaCascKaon) { - histos_Casc.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta()); - } - } - } else { - if (TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaCascPion && TMath::Abs(negdau.tpcNSigmaPr()) < NSigmaCascProton) { - if (TMath::Abs(casc.yXi()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < NSigmaCascPion) { - histos_Casc.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi(), casc.eta()); - histos_Casc.fill(HIST("InvMassXiPlus_Radius"), casc.cascradius(), casc.mXi()); - } - if (TMath::Abs(casc.yOmega()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < NSigmaCascKaon) { - histos_Casc.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega(), casc.eta()); - } - } - } + histos_Casc.fill(HIST("InvMassLambda"), casc.mLambda(), casc.sign()); + + if (isCascadeSelected(casc, collision, casc.rapidity(0), kXiM)) { + histos_Casc.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta()); + histos_Casc.fill(HIST("InvMassXiMinus_Radius"), casc.cascradius(), casc.mXi()); + } + if (isCascadeSelected(casc, collision, casc.rapidity(0), kXiP)) { + histos_Casc.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi(), casc.eta()); + histos_Casc.fill(HIST("InvMassXiPlus_Radius"), casc.cascradius(), casc.mXi()); + } + if (isCascadeSelected(casc, collision, casc.rapidity(2), kOmegaM)) { + histos_Casc.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta()); + } + if (isCascadeSelected(casc, collision, casc.rapidity(2), kOmegaP)) { + histos_Casc.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega(), casc.eta()); } } } - PROCESS_SWITCH(v0cascadesQA, processReconstructedCascade, "Process reconstructed level Cascades", true); - ////////////////////////////////////// - ////////// Cascade QA - MC /////////// - ////////////////////////////////////// + //////////////////////////////// + ////////// QA - MC ///////////// + //////////////////////////////// - void processMcCascade(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, MyTracksMC const&, aod::McParticles const&) + void processMonteCarlo(soa::Join::iterator const& collision, soa::Join const&, soa::Join const& fullV0s, soa::Join const&, soa::Join const& fullCascades, soa::Join const&, DaughterTracks const&, aod::BCsWithTimestamps const&) { - if (sel8 && !collision.sel8()) { + if (!isEventAccepted(collision, false)) { + return; + } + if (!collision.has_mcCollision()) + return; + auto mcCollision = collision.mcCollision_as>(); + // Apply selections on MC collisions + if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { + return; + } + if (eventSelections.requireINEL0 && mcCollision.multMCNParticlesEta10() < 1) { + return; + } + if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) { return; } - for (auto& casc : Cascades) { + for (auto const& v0 : fullV0s) { + if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut || + std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 0.5); + if (v0Selections.v0TypeSelection > -1 && v0.v0Type() != v0Selections.v0TypeSelection) + continue; // skip V0s that are not standard - if (casc.v0radius() > Casc_v0radius && - casc.cascradius() > Casc_cascradius && - casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_v0cospa && - casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_casccospa && - TMath::Abs(casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ())) > Casc_dcav0topv && - TMath::Abs(casc.dcapostopv()) > Casc_dcapostopv && TMath::Abs(casc.dcanegtopv()) > Casc_dcanegtopv && TMath::Abs(casc.dcabachtopv()) > Casc_dcabachtopv && - casc.dcaV0daughters() < Casc_dcav0dau && casc.dcacascdaughters() < Casc_dcacascdau) { + if (!v0.has_v0MCCore()) + continue; - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 1.5); + auto v0MC = v0.template v0MCCore_as>(); - auto reconegtrack = casc.negTrack_as(); - auto recopostrack = casc.posTrack_as(); - auto recobachelor = casc.bachelor_as(); - if (!reconegtrack.has_mcParticle() || !recopostrack.has_mcParticle() || !recobachelor.has_mcParticle()) { - continue; - } - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 2.5); + // K0Short + if (isV0Accepted(v0, collision, v0MC.rapidityMC(0), kK0s) && checkV0MCAssociation(v0MC, kK0s)) { + histos_V0.fill(HIST("InvMassK0sTrue"), v0MC.ptMC(), v0.v0radius(), v0.mK0Short()); + } + // Lambda + if (isV0Accepted(v0, collision, v0MC.rapidityMC(1), kLambda) && checkV0MCAssociation(v0MC, kLambda)) { + histos_V0.fill(HIST("InvMassLambdaTrue"), v0MC.ptMC(), v0.v0radius(), v0.mLambda()); + } + // AntiLambda + if (isV0Accepted(v0, collision, v0MC.rapidityMC(2), kAntiLambda) && checkV0MCAssociation(v0MC, kAntiLambda)) { + histos_V0.fill(HIST("InvMassAntiLambdaTrue"), v0MC.ptMC(), v0.v0radius(), v0.mAntiLambda()); + } + } + + for (auto const& casc : fullCascades) { + if (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut || + std::abs(casc.positiveeta()) > cascSelections.daughterEtaCut || + std::abs(casc.bacheloreta()) > cascSelections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future + + if (!casc.has_cascMCCore()) + continue; + + auto cascMC = casc.template cascMCCore_as>(); + + histos_Casc.fill(HIST("QA_CascadeCandidates"), 0.5); - auto mcnegtrack = reconegtrack.mcParticle_as(); - auto mcpostrack = recopostrack.mcParticle_as(); - auto bachelor = recobachelor.mcParticle_as(); - if (!mcnegtrack.has_mothers() || !mcpostrack.has_mothers() || !bachelor.has_mothers()) { - continue; + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(0), kXiM)) { + histos_Casc.fill(HIST("QA_CascCandidates"), 1.5); + if (checkCascadeMCAssociation(cascMC, kXiM)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 2.5); + histos_Casc.fill(HIST("InvMassXiMinusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mXi()); } - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 3.5); - - for (auto& particleMotherOfBach : bachelor.mothers_as()) { - for (auto& particleMotherOfNeg : mcnegtrack.mothers_as()) { - for (auto& particleMotherOfPos : mcpostrack.mothers_as()) { - for (auto& particleMotherOfV0 : particleMotherOfNeg.mothers_as()) { - - bool MomOfBachIsPrimary = particleMotherOfBach.isPhysicalPrimary(); - bool MomOfNegIsPrimary = particleMotherOfNeg.isPhysicalPrimary(); - bool MomOfPosIsPrimary = particleMotherOfPos.isPhysicalPrimary(); - - bool isXiMinusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kXiMinus && - bachelor.pdgCode() == PDG_t::kPiMinus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0 && - mcnegtrack.pdgCode() == PDG_t::kPiMinus && - mcpostrack.pdgCode() == PDG_t::kProton; - - bool isOmegaMinusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kOmegaMinus && - bachelor.pdgCode() == PDG_t::kKMinus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0 && - mcnegtrack.pdgCode() == PDG_t::kPiMinus && - mcpostrack.pdgCode() == PDG_t::kProton; - - bool isXiPlusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kXiPlusBar && - bachelor.pdgCode() == PDG_t::kPiPlus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0Bar && - mcnegtrack.pdgCode() == PDG_t::kProtonBar && - mcpostrack.pdgCode() == PDG_t::kPiPlus; - - bool isOmegaPlusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kOmegaPlusBar && - bachelor.pdgCode() == PDG_t::kKPlus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0Bar && - mcnegtrack.pdgCode() == PDG_t::kProtonBar && - mcpostrack.pdgCode() == PDG_t::kPiPlus; - - if (isXiMinusCascade) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 8.5); - if (TMath::Abs(casc.yXi()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassXiMinusTrue"), casc.pt(), casc.cascradius(), casc.mXi()); - } - } - - if (isOmegaMinusCascade) { - if (TMath::Abs(casc.yOmega()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassOmegaMinusTrue"), casc.pt(), casc.cascradius(), casc.mOmega()); - } - } - - if (isXiPlusCascade) { - if (TMath::Abs(casc.yXi()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassXiPlusTrue"), casc.pt(), casc.cascradius(), casc.mXi()); - } - } - - if (isOmegaPlusCascade) { - if (TMath::Abs(casc.yOmega()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassOmegaPlusTrue"), casc.pt(), casc.cascradius(), casc.mOmega()); - } - } - - // QA section - XiMinus - if (MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary)) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 4.5); - } - if ((particleMotherOfNeg.pdgCode() == particleMotherOfPos.pdgCode())) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 5.5); - } - if ((particleMotherOfV0 == particleMotherOfBach)) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 6.5); - } - if (particleMotherOfBach.pdgCode() == PDG_t::kXiMinus && - bachelor.pdgCode() == PDG_t::kPiMinus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0 && - mcnegtrack.pdgCode() == PDG_t::kPiMinus && - mcpostrack.pdgCode() == PDG_t::kProton) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 7.5); - } - } - } - } + } + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(0), kXiP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 3.5); + if (checkCascadeMCAssociation(cascMC, kXiP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 4.5); + histos_Casc.fill(HIST("InvMassXiPlusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mXi()); + } + } + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(2), kOmegaM)) { + histos_Casc.fill(HIST("QA_CascCandidates"), 5.5); + if (checkCascadeMCAssociation(cascMC, kOmegaM)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 6.5); + histos_Casc.fill(HIST("InvMassOmegaMinusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mOmega()); + } + } + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(2), kOmegaP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 7.5); + if (checkCascadeMCAssociation(cascMC, kOmegaP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 8.5); + histos_Casc.fill(HIST("InvMassOmegaPlusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mOmega()); } } } } - PROCESS_SWITCH(v0cascadesQA, processMcCascade, "Process MC level Cascades", false); + + /////////////////////////////////////// + ////////// Collision QA - MC ////////// + /////////////////////////////////////// + + void processGenerated(soa::Join::iterator const& mcCollision, aod::McParticles const& mcParticles, soa::SmallGroups> const& collisions) + { + // Apply selections on MC collisions + if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { + return; + } + if (eventSelections.requireINEL0 && mcCollision.multMCNParticlesEta10() < 1) { + return; + } + if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) { + return; + } + + histos_event.fill(HIST("hEventCounterMC"), 0.5); + + // Check if there is at least one of the reconstructed collisions associated to this MC collision + // If so, we consider it + bool atLeastOne = false; + for (const auto& collision : collisions) { + if (!isEventAccepted(collision, false)) { + continue; + } + atLeastOne = true; + } + + if (!atLeastOne) { // Check that the event is reconstructed and that the reconstructed events pass the selection + return; + } + + histos_event.fill(HIST("hEventCounterMC"), 1.5); + + for (auto const& mcparticle : mcParticles) { + + if (!mcparticle.has_daughters()) { + continue; + } + + double vx = 0; + double vy = 0; + for (auto const& mcparticleDaughter0 : mcparticle.daughters_as()) { + vx = mcparticleDaughter0.vx(); + vy = mcparticleDaughter0.vy(); + if (vx != 0 && vy != 0) + break; + } + double R_Decay = std::sqrt(vx * vx + vy * vy); + + if (mcparticle.isPhysicalPrimary() && std::abs(mcparticle.y()) < v0Selections.rapidityCut) { + if (mcparticle.pdgCode() == PDG_t::kK0Short) + histos_event.fill(HIST("GeneratedV0s"), 0.5, mcparticle.pt(), R_Decay); // K0s + if (mcparticle.pdgCode() == PDG_t::kLambda0) + histos_event.fill(HIST("GeneratedV0s"), 1.5, mcparticle.pt(), R_Decay); // Lambda + if (mcparticle.pdgCode() == PDG_t::kLambda0Bar) + histos_event.fill(HIST("GeneratedV0s"), 2.5, mcparticle.pt(), R_Decay); // AntiLambda + } + if (mcparticle.isPhysicalPrimary() && std::abs(mcparticle.y()) < cascSelections.rapidityCut) { + if (mcparticle.pdgCode() == PDG_t::kXiMinus) + histos_event.fill(HIST("GeneratedCascades"), 0.5, mcparticle.pt(), R_Decay); // Xi- + if (mcparticle.pdgCode() == PDG_t::kXiPlusBar) + histos_event.fill(HIST("GeneratedCascades"), 1.5, mcparticle.pt(), R_Decay); // Xi+ + if (mcparticle.pdgCode() == PDG_t::kOmegaMinus) + histos_event.fill(HIST("GeneratedCascades"), 2.5, mcparticle.pt(), R_Decay); // Omega- + if (mcparticle.pdgCode() == PDG_t::kOmegaPlusBar) + histos_event.fill(HIST("GeneratedCascades"), 3.5, mcparticle.pt(), R_Decay); // Omega+ + + // if (!IsParticleFromOutOfBunchPileupCollision){fill the 1.5, 3.5 etc} AliPhysics analysis + } + } + } + + PROCESS_SWITCH(v0cascadesQA, processReconstructed, "Process reconstructed event and V0s+cascades in data", true); + PROCESS_SWITCH(v0cascadesQA, processMonteCarlo, "Process reconstructed event and V0s+cascades in MC", false); + PROCESS_SWITCH(v0cascadesQA, processGenerated, "Process MC level event and V0s+cascades in MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 9f82e6c57d05c039d4e1a199da888aa8b0877b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Jos=C3=A9?= <52935244+lucasjsilva@users.noreply.github.com> Date: Thu, 2 Apr 2026 01:10:43 +0200 Subject: [PATCH 146/282] =?UTF-8?q?[PWGLF]=20Add=20selection=20of=20recons?= =?UTF-8?q?tructed=20events=20that=20have=20an=20associated=20generat?= =?UTF-8?q?=E2=80=A6=20(#15612)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index a0ef2af5aa0..62f5e93d830 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -357,6 +357,9 @@ struct StudyPnch { if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; } + if (!RecCol.has_mcCollision()) { + continue; + } auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); if (multrec > 0) { From 4d3c95f8f6335c230fab3fbb1e262f0ee20849d7 Mon Sep 17 00:00:00 2001 From: Katarzyna <116073883+kgwizdzi@users.noreply.github.com> Date: Thu, 2 Apr 2026 01:25:35 +0200 Subject: [PATCH 147/282] [PWGCF] FU: PID selection and corr. bkgs update (#15619) --- .../Core/FemtoUniverseParticleHisto.h | 37 +++---- .../femtoUniverseProducerTask.cxx | 12 ++- .../Tasks/femtoUniverseEfficiencyBase.cxx | 97 ++++++++++++++++--- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 32 +++--- 4 files changed, 123 insertions(+), 55 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 8a48e540c74..508cb8994c4 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h @@ -70,7 +70,7 @@ class FemtoUniverseParticleHisto // comment template - void init_debug(std::string folderName, T& tempFitVarpTAxis) // o2-linter: disable=name/function-variable + void init_debug(std::string folderName, T& tempFitVarMomAxis) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { @@ -86,22 +86,22 @@ class FemtoUniverseParticleHisto mHistogramRegistry->add((folderName + folderSuffix + "/hITSclustersIB").c_str(), "; ITS clusters in IB; Entries", kTH1F, {{10, -0.5, 9.5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hDCAz").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{z} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hDCA").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA (cm)", kTH2F, {{100, 0, 10}, {301, 0., 1.5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/hTPCdEdX").c_str(), "; #it{p} (GeV/#it{c}); TPC Signal", kTH2F, {{tempFitVarpTAxis}, {1000, 0, 1000}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{e}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{#pi}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{K}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{p}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{d}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{e}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{#pi}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{K}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{p}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{d}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{e}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{#pi}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{K}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{p}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{d}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hTPCdEdX").c_str(), "; #it{p} (GeV/#it{c}); TPC Signal", kTH2F, {{tempFitVarMomAxis}, {1000, 0, 1000}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{e}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{K}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{p}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{d}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{e}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{K}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{p}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{d}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{e}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{K}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{p}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{d}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0) { mHistogramRegistry->add((folderName + folderSuffix + "/hDaughDCA").c_str(), "; DCA^{daugh} (cm); Entries", kTH1F, {{1000, 0, 10}}); mHistogramRegistry->add((folderName + folderSuffix + "/hTransRadius").c_str(), "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); @@ -238,6 +238,7 @@ class FemtoUniverseParticleHisto } framework::AxisSpec tempFitVarpTAxis = {tempFitVarpTBins, "#it{p}_{T} (GeV/#it{c})"}; // the pT binning may vary + framework::AxisSpec tempFitVarMomAxis = {tempFitVarpTBins, "#it{p} (GeV/#it{c})"}; // the p binning framework::AxisSpec tempFitVarAxis = {tempFitVarBins, tempFitVarAxisTitle}; // std::string folderName = (static_cast(o2::aod::femtouniverseparticle::ParticleTypeName[mParticleType]).c_str() + static_cast(mFolderSuffix[mFolderSuffixType])).c_str(); @@ -246,7 +247,7 @@ class FemtoUniverseParticleHisto // Fill here the actual histogramms by calling init_base and init_MC init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); if (isDebug) { - init_debug(folderName, tempFitVarpTAxis); + init_debug(folderName, tempFitVarMomAxis); } if (isMC) { init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index c4186b34d83..d73fc6794e5 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -341,7 +341,7 @@ struct FemtoUniverseProducerTask { Configurable trackD0pTGenMax{"trackD0pTGenMax", 24.0, "MC Truth, max. pT for tracks and D0/D0bar cand."}; Configurable useYCutD0Cand{"useYCutD0Cand", true, "True - apply cut on y of D0 cand./false - apply cut on eta"}; Configurable storeD0D0barDoubleMassHypo{"storeD0D0barDoubleMassHypo", false, "Store D0/D0bar cand. which pass selection criteria for both, D0 and D0bar"}; - Configurable> classMlD0D0bar{"classMlD0D0bar", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; + Configurable fillCorrBkgsD0{"fillCorrBkgsD0", false, "Flag to fill derived tables with correlated background candidates"}; } ConfD0Selection; // PID bitmask configurables @@ -1835,8 +1835,10 @@ struct FemtoUniverseProducerTask { for (const auto& hfCand : hfCands) { - if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; + if (!ConfD0Selection.fillCorrBkgsD0) { + if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; + } } if (ConfD0Selection.useYCutD0Cand && std::abs(hfHelper.yD0(hfCand)) > ConfD0Selection.yD0CandMax) { @@ -1853,11 +1855,11 @@ struct FemtoUniverseProducerTask { auto arrayDaughters = std::array{postrack, negtrack}; indexMcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); - if (!(indexMcRec > -1)) { + if (!ConfD0Selection.fillCorrBkgsD0 && !(indexMcRec > -1)) { continue; } - if (std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { + if ((std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (ConfD0Selection.fillCorrBkgsD0 && hfCand.flagMcMatchRec() != 0)) { int postrackID = hfCand.prong0Id(); // Index to first prong int rowInPrimaryTrackTablePos = -1; rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 2f90a0c4e52..865e4db500d 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -43,7 +43,7 @@ struct FemtoUniverseEfficiencyBase { Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; Configurable forceTof{"forceTof", false, "Enable to reject tracks without TOF for PID, set to false for processes with V0"}; - Configurable checkIfTofAvailable{"checkIfTofAvailable", true, "Enable to check if TOF is available for PID, set to false for processes with V0"}; + Configurable checkIfTofAvailable{"checkIfTofAvailable", false, "Enable to check if TOF is available for PID, set to false for processes with V0"}; // Collisions Configurable confZVertex{"confZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; @@ -72,9 +72,16 @@ struct FemtoUniverseEfficiencyBase { Configurable confNsigmaPiRejectKaNsigma{"confNsigmaPiRejectKaNsigma", 2.0, "Reject if a pion could be a kaon within a givien nSigma value"}; Configurable confNsigmaPiRejectPrNsigma{"confNsigmaPiRejectPrNsigma", 2.0, "Reject if a pion could be a proton within a givien nSigma value"}; Configurable confPDGCheckMCReco{"confPDGCheckMCReco", true, "Check PDG code of MC reco paricles"}; - } ConfBothTracks; + struct : o2::framework::ConfigurableGroup { + Configurable> trkPIDspecies{"trkPIDspecies", std::vector{o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon}, "Trk sel: Particles species for PID, proton, pion, kaon"}; + Configurable> trkPidTPCMax{"trkPidTPCMax", std::vector{2., 3., 2.}, "maximum nSigma TPC"}; + Configurable> trkPidTOFMax{"trkPidTOFMax", std::vector{2., 3., 2.}, "maximum nSigma TOF"}; + Configurable trkPidTofPtThreshold{"trkPidTofPtThreshold", 0.6, "minimum pT after which TOF PID is applicable"}; + Configurable trkUsePassPIDSelection{"trkUsePassPIDSelection", false, "Set to true to use passPIDSelection function, if false then use isParticleNSigma"}; + } ConfTracksPid; + /// Lambda cuts Configurable confV0InvMassLowLimit{"confV0InvMassLowLimit", 1.10, "Lower limit of the V0 invariant mass"}; Configurable confV0InvMassUpLimit{"confV0InvMassUpLimit", 1.13, "Upper limit of the V0 invariant mass"}; @@ -86,10 +93,10 @@ struct FemtoUniverseEfficiencyBase { // Momentum thresholds for Run2 and Run3 Configurable confMomKaonRun2{"confMomKaonRun2", 0.4, "Momentum threshold for kaon identification using ToF (Run2)"}; Configurable confMomKaonRun3{"confMomKaonRun3", 0.3, "Momentum threshold for kaon identification using ToF (Run3)"}; - Configurable confMomKaon045{"confMomKaon045", 0.45, "Momentum threshold for kaon identification pT = 0.45 GeV/c"}; - Configurable confMomKaon055{"confMomKaon055", 0.55, "Momentum threshold for kaon identification pT = 0.55 GeV/c"}; - Configurable confMomKaon08{"confMomKaon08", 0.8, "Momentum threshold for kaon identification pT = 0.8 GeV/c"}; - Configurable confMomKaon15{"confMomKaon15", 1.5, "Momentum threshold for kaon identification pT = 1.5 GeV/c"}; + Configurable confMomKaon045{"confMomKaon045", 0.45, "Momentum threshold for kaon identification p = 0.45 GeV/c"}; + Configurable confMomKaon055{"confMomKaon055", 0.55, "Momentum threshold for kaon identification p = 0.55 GeV/c"}; + Configurable confMomKaon08{"confMomKaon08", 0.8, "Momentum threshold for kaon identification p = 0.8 GeV/c"}; + Configurable confMomKaon15{"confMomKaon15", 1.5, "Momentum threshold for kaon identification p = 1.5 GeV/c"}; // n sigma cuts for Run 2 Configurable confKaonNsigmaTPCbelow04Run2{"confKaonNsigmaTPCbelow04Run2", 2.0, "Reject kaons with pT below 0.4 if TPC n sigma is above this value."}; Configurable confKaonNsigmaTPCfrom04to045Run2{"confKaonNsigmaTPCfrom04to045Run2", 1.0, "Reject kaons within pT from 0.4 to 0.45 if TPC n sigma is above this value."}; @@ -244,6 +251,7 @@ struct FemtoUniverseEfficiencyBase { return true; } + // if (mom <= ConfBothTracks.confMomProton || !partHasTof) { if (mom <= ConfBothTracks.confMomProton || !partHasTof) { if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { return true; @@ -486,6 +494,50 @@ struct FemtoUniverseEfficiencyBase { } } + template + bool passPIDSelection(Atrack const& track, SpeciesContainer const mPIDspecies, + T1 const maxTPC, T2 const maxTOF, double ptThreshold = 0.75, bool tofForced = false, bool partHasTof = false) + { + // Ensure size consistency + if (mPIDspecies.value.size() != maxTPC.value.size() || mPIDspecies.value.size() != maxTOF.value.size()) { + LOGF(error, "Size of particle species and corresponding nSigma selection arrays should be the same"); + return false; // Early exit on error + } + + for (size_t speciesIndex = 0; speciesIndex < mPIDspecies.value.size(); ++speciesIndex) { + auto const& pid = mPIDspecies->at(speciesIndex); + auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track); + + if (tofForced && !partHasTof) { + return false; + } + + if (speciesIndex == 0) { // First species logic + if (std::abs(nSigmaTPC) > maxTPC->at(speciesIndex)) { + return false; // TPC check failed + } + if (tofForced || (track.pt() > ptThreshold && partHasTof)) { + auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) > maxTOF->at(speciesIndex)) { + return false; // TOF check failed + } + } + } else { // Other species logic + if (std::abs(nSigmaTPC) < maxTPC->at(speciesIndex)) { // Check TPC nSigma first + if (partHasTof) { + auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) < maxTOF->at(speciesIndex)) { + return false; // Reject if both TPC and TOF are within thresholds + } + } else { + return false; // Reject if only TPC is within threshold and TOF is unavailable + } + } + } + } + return true; // Passed all checks + } + bool invMLambda(float invMassLambda, float invMassAntiLambda) { if ((invMassLambda < confV0InvMassLowLimit || invMassLambda > confV0InvMassUpLimit) && (invMassAntiLambda < confV0InvMassLowLimit || invMassAntiLambda > confV0InvMassUpLimit)) { @@ -551,13 +603,19 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 2); - if (!isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), 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))) { - continue; + if (!ConfTracksPid.trkUsePassPIDSelection) { + if (!isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), 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))) { + continue; + } + if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { + continue; + } + } else { + if (!passPIDSelection(part, ConfTracksPid.trkPIDspecies, ConfTracksPid.trkPidTPCMax, ConfTracksPid.trkPidTOFMax, ConfTracksPid.trkPidTofPtThreshold, forceTof, static_cast(part.mLambda()))) { + continue; + } } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { - continue; - } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 3); if (!part.has_fdMCParticle()) { @@ -604,12 +662,19 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 2); - if (!isParticleNSigma(confPDGCodePartTwo, static_cast(part.mLambda()), 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))) { - continue; - } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartTwo, static_cast(part.mLambda()), part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { - continue; + if (!ConfTracksPid.trkUsePassPIDSelection) { + if (!isParticleNSigma(confPDGCodePartTwo, static_cast(part.mLambda()), 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))) { + continue; + } + if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartTwo, static_cast(part.mLambda()), part.p(), 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::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { + continue; + } + } else { + if (!passPIDSelection(part, ConfTracksPid.trkPIDspecies, ConfTracksPid.trkPidTPCMax, ConfTracksPid.trkPidTOFMax, ConfTracksPid.trkPidTofPtThreshold, forceTof, static_cast(part.mLambda()))) { + continue; + } } + registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 3); if (!part.has_fdMCParticle()) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 12ea6f27d68..8cde231fecb 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -558,14 +558,14 @@ struct FemtoUniversePairTaskTrackD0 { mcRecoRegistry.add("hMassVsPtD0barNonPrompt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // Histograms for D0/D0bar correlated backgrounds if (fillCorrBkgs) { - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0ToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - mcRecoRegistry.add("D0D0bar_corrBkgs/hMassVsPtD0barToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } // Histograms for identified hadrons mcRecoRegistry.add("hMcRecKpPt", "MC Reco K+;#it{p}_{T} (GeV/c); counts", {HistType::kTH1F, {{500, 0, 5}}}); @@ -1501,13 +1501,13 @@ struct FemtoUniversePairTaskTrackD0 { } if (fillCorrBkgs) { if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0) { // D0 -> pi+K-pi0 - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToPiKaPi"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0ToPiKaPi"), part.mLambda(), part.pt(), weight); } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPi) { // D0 -> pi+pi- - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToPiPi"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0ToPiPi"), part.mLambda(), part.pt(), weight); } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPiPi0) { // D0 -> pi+pi-pi0 - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToPiPiPi"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0ToPiPiPi"), part.mLambda(), part.pt(), weight); } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToKK) { // D0 -> K+K- - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0ToKaKa"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0ToKaKa"), part.mLambda(), part.pt(), weight); } } if (part.tpcNClsFound() == 0) { // prompt candidates @@ -1525,13 +1525,13 @@ struct FemtoUniversePairTaskTrackD0 { } if (fillCorrBkgs) { if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0) { // D0 -> pi+K-pi0 - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToPiKaPi"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0barToPiKaPi"), part.mLambda(), part.pt(), weight); } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPi) { // D0 -> pi+pi- - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToPiPi"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0barToPiPi"), part.mLambda(), part.pt(), weight); } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPiPi0) { // D0 -> pi+pi-pi0 - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToPiPiPi"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0barToPiPiPi"), part.mLambda(), part.pt(), weight); } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToKK) { // D0 -> K+K- - mcRecoRegistry.fill(HIST("D0D0bar_corrBkgs/hMassVsPtD0barToKaKa"), part.mLambda(), part.pt(), weight); + mcRecoRegistry.fill(HIST("hMassVsPtD0barToKaKa"), part.mLambda(), part.pt(), weight); } } if (part.tpcNClsFound() == 0) { // prompt candidates From a5f8d6b7a0ff02d6055ddba6bf0cd5225cf16e82 Mon Sep 17 00:00:00 2001 From: Paola Vargas Torres <88360333+PaolaVT@users.noreply.github.com> Date: Thu, 2 Apr 2026 02:23:06 -0600 Subject: [PATCH 148/282] [PWGLF] Phi prime cut was added (#15553) Co-authored-by: Paola Vargas Torres Co-authored-by: Paola Vargas Torres --- PWGLF/Tasks/Nuspex/multiplicityPt.cxx | 185 ++++++++++++++++++-------- 1 file changed, 133 insertions(+), 52 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx index 59e06791e8f..1a71c04db8b 100644 --- a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx +++ b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx @@ -29,6 +29,8 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/GRPMagField.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -62,13 +64,11 @@ using namespace constants::physics; using BCsRun3 = soa::Join; -//============================================================================= -// Main Analysis Struct -//============================================================================= struct MultiplicityPt { // Service Service pdg; + Service ccdb; static constexpr int CentBinMax = 100; static constexpr int MultBinMax = 200; static constexpr int RecMultBinMax = 100; @@ -82,9 +82,6 @@ struct MultiplicityPt { }; - //=========================================================================== - // Configurable Parameters - //=========================================================================== Configurable isRun3{"isRun3", true, "is Run3 dataset"}; Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; @@ -123,7 +120,12 @@ struct MultiplicityPt { Configurable nClTPCPIDCut{"nClTPCPIDCut", true, "Apply TPC clusters for PID cut"}; // Phi cut parameters - Configurable applyPhiCut{"applyPhiCut", false, "Apply phi sector cut"}; + Configurable applyPhiCut{"applyPhiCut", false, "Apply phi sector cut to remove problematic TPC regions"}; + Configurable pTthresholdPhiCut{"pTthresholdPhiCut", 2.0f, "pT threshold above which to apply phi cut"}; + Configurable phiCutLowParam1{"phiCutLowParam1", 0.119297, "First parameter for low phi cut"}; + Configurable phiCutLowParam2{"phiCutLowParam2", 0.000379693, "Second parameter for low phi cut"}; + Configurable phiCutHighParam1{"phiCutHighParam1", 0.16685, "First parameter for high phi cut"}; + Configurable phiCutHighParam2{"phiCutHighParam2", 0.00981942, "Second parameter for high phi cut"}; // Basic track cuts Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; @@ -137,13 +139,13 @@ struct MultiplicityPt { // Custom track cuts matching spectraTOF TrackSelection customTrackCuts; + // TF1 pointers for phi cuts + TF1* fphiCutLow = nullptr; + TF1* fphiCutHigh = nullptr; + // Histogram Registry HistogramRegistry ue; - //=========================================================================== - // Table Definitions - Using individual tables, not joined for MC - //=========================================================================== - // Data collisions (not used but kept for completeness) using CollisionTableData = soa::Join; @@ -165,9 +167,6 @@ struct MultiplicityPt { // Preslice for MC particles Preslice perMCCol = aod::mcparticle::mcCollisionId; - //=========================================================================== - // Constants - //=========================================================================== enum ParticleSpecies : int { kPion = 0, kKaon = 1, @@ -179,9 +178,68 @@ struct MultiplicityPt { static constexpr int PDGKaon = kKPlus; static constexpr int PDGProton = kProton; - //=========================================================================== - // Helper Functions - //=========================================================================== + // Get magnetic field from CCDB + int getMagneticField(uint64_t timestamp) + { + static o2::parameters::GRPMagField* grpo = nullptr; + if (grpo == nullptr) { + grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); + if (grpo == nullptr) { + LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); + return 0; + } + LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field()); + } + return grpo->getNominalL3Field(); + } + + // Get transformed phi for phi cut (with magnetic field) + float getTransformedPhi(const float phi, const int charge, const float magField) const + { + float transformedPhi = phi; + if (magField < 0) { + transformedPhi = o2::constants::math::TwoPI - transformedPhi; + } + if (charge < 0) { + transformedPhi = o2::constants::math::TwoPI - transformedPhi; + } + transformedPhi += o2::constants::math::PI / 18.0f; + transformedPhi = std::fmod(transformedPhi, o2::constants::math::PI / 9.0f); + return transformedPhi; + } + + // Phi cut function (with magnetic field) + template + bool passedPhiCut(const TrackType& track, float magField) const + { + if (!applyPhiCut.value) { + return true; + } + + if (track.pt() < pTthresholdPhiCut.value) { + return true; + } + + float pt = track.pt(); + float phi = track.phi(); + int charge = track.sign(); + + if (magField < 0) { + phi = o2::constants::math::TwoPI - phi; + } + if (charge < 0) { + phi = o2::constants::math::TwoPI - phi; + } + + phi += o2::constants::math::PI / 18.0f; + phi = std::fmod(phi, o2::constants::math::PI / 9.0f); + + if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt)) { + return false; + } + + return true; + } template int countGeneratedChargedPrimaries(const ParticleContainer& particles, float etaMax, float ptMin) const @@ -257,7 +315,7 @@ struct MultiplicityPt { } template - bool passesTrackSelection(TrackType const& track) const + bool passesTrackSelection(TrackType const& track, float magField = 0) const { if (track.eta() < cfgCutEtaMin.value || track.eta() > cfgCutEtaMax.value) return false; @@ -277,6 +335,10 @@ struct MultiplicityPt { if (!passedNClTPCPIDCut(track)) return false; + // Add phi cut with magnetic field + if (!passedPhiCut(track, magField)) + return false; + return true; } @@ -348,9 +410,6 @@ struct MultiplicityPt { return true; } - //=========================================================================== - // Process Switches - //=========================================================================== void processData(CollisionTableData::iterator const& collision, TrackTableData const& tracks, BCsRun3 const& bcs); @@ -365,9 +424,6 @@ struct MultiplicityPt { BCsRun3 const& bcs); PROCESS_SWITCH(MultiplicityPt, processMC, "process MC", true); - //=========================================================================== - // Standard Framework Functions - //=========================================================================== void init(InitContext const&); void endOfStream(EndOfStreamContext& /*eos*/) @@ -382,24 +438,36 @@ struct MultiplicityPt { } }; -//============================================================================= -// Workflow Definition -//============================================================================= WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } -//============================================================================= -// Implementation of Member Functions -//============================================================================= - void MultiplicityPt::init(InitContext const&) { LOG(info) << "=================================================="; LOG(info) << "Initializing MultiplicityPt task with full centrality diagnostics"; LOG(info) << "=================================================="; + // Initialize phi cut functions + if (applyPhiCut.value) { + fphiCutLow = new TF1("StandardPhiCutLow", + Form("%f/x/x+pi/18.0-%f", + phiCutLowParam1.value, phiCutLowParam2.value), + 0, 50); + fphiCutHigh = new TF1("StandardPhiCutHigh", + Form("%f/x+pi/18.0+%f", + phiCutHighParam1.value, phiCutHighParam2.value), + 0, 50); + + LOGF(info, "=== Phi Cut Parameters ==="); + LOGF(info, "Low cut: %.6f/x² + pi/18 - %.6f", + phiCutLowParam1.value, phiCutLowParam2.value); + LOGF(info, "High cut: %.6f/x + pi/18 + %.6f", + phiCutHighParam1.value, phiCutHighParam2.value); + LOGF(info, "Applied for pT > %.1f GeV/c", pTthresholdPhiCut.value); + } + if (useCustomTrackCuts.value) { LOG(info) << "Using custom track cuts matching spectraTOF approach"; customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(itsPattern.value); @@ -448,10 +516,6 @@ void MultiplicityPt::init(InitContext const&) } AxisSpec recoMultAxis = {recoMultBins, "N_{ch}^{reco}"}; - //=========================================================================== - // Comprehensive Histogram Registration - //=========================================================================== - // Centrality diagnostic histograms - USE FINE BINNING ue.add("Centrality/hCentRaw", "Raw FT0M Centrality (no cuts);Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); @@ -578,6 +642,16 @@ void MultiplicityPt::init(InitContext const&) ue.add("Inclusive/hPtMeasuredVsCent", "All measured tracks (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + // Phi cut monitoring histograms + if (applyPhiCut.value) { + ue.add("PhiCut/hPtVsPhiPrimeBefore", "pT vs φ' before cut;p_{T} (GeV/c);φ'", + HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); + ue.add("PhiCut/hPtVsPhiPrimeAfter", "pT vs φ' after cut;p_{T} (GeV/c);φ'", + HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); + ue.add("PhiCut/hRejectionRate", "Track rejection rate by phi cut;p_{T} (GeV/c);Rejection Rate", + HistType::kTProfile, {{100, 0, 10}}); + } + // Particle-specific histograms const std::array particleNames = {"Pion", "Kaon", "Proton"}; const std::array particleSymbols = {"#pi^{#pm}", "K^{#pm}", "p+#bar{p}"}; @@ -654,12 +728,11 @@ void MultiplicityPt::init(InitContext const&) LOG(info) << "=== Initialized MultiplicityPt task with full centrality diagnostics ==="; LOG(info) << "Standard centrality binning: " << centBinningStd.size() - 1 << " bins (0-100%)"; LOG(info) << "Fine centrality binning: " << centBinningFine.size() - 1 << " bins (0-100%)"; + if (applyPhiCut.value) { + LOG(info) << "Phi cut ENABLED for pT > " << pTthresholdPhiCut.value << " GeV/c"; + } } -//============================================================================= -// Process Functions -//============================================================================= - void MultiplicityPt::processData(CollisionTableData::iterator const& /*collision*/, TrackTableData const& /*tracks*/, BCsRun3 const& /*bcs*/) @@ -681,9 +754,6 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, LOG(info) << "Total collision labels: " << labels.size(); LOG(info) << "Total centrality entries: " << centTable.size(); - //=========================================================================== - // DEBUG: Print raw centrality information first - //=========================================================================== LOG(info) << "\n=== CENTRALITY DEBUG - RAW DATA ==="; LOG(info) << "First 20 centrality values from centTable:"; int debugCount = 0; @@ -714,9 +784,6 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, LOG(info) << "Checking if centrality might be inverted..."; LOG(info) << "Will check correlation with multiplicity in the next step."; - //=========================================================================== - // FIRST PASS: Build maps of MC collision ID to generated particle counts - //=========================================================================== std::map mcCollisionToNch; std::map mcCollisionVz; std::set physicsSelectedMCCollisions; @@ -797,9 +864,6 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, LOG(info) << "INEL>1: " << mcINELgt1; LOG(info) << "Physics-selected MC collisions: " << physicsSelectedMCCollisions.size(); - //=========================================================================== - // Build maps for labels and centrality - //=========================================================================== std::map recoToMcMap; std::map recoToCentMap; @@ -837,9 +901,6 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, LOG(info) << "recoToMcMap size: " << recoToMcMap.size(); LOG(info) << "recoToCentMap size: " << recoToCentMap.size(); - //=========================================================================== - // DEBUG: Check correlation between centrality and multiplicity - //=========================================================================== LOG(info) << "\n=== CENTRALITY VS MULTIPLICITY DEBUG ==="; // Create temporary vectors to check correlation @@ -1003,6 +1064,13 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, nSelectedEvents++; nPassAll++; + // Get magnetic field for phi cut + float magField = 0; + if (applyPhiCut.value) { + const auto& bc = collision.bc_as(); + magField = getMagneticField(bc.timestamp()); + } + // Process tracks in selected events int nTracksInEvent = 0; for (const auto& track : tracks) { @@ -1011,9 +1079,22 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, if (track.collisionId() != collId) continue; - if (!passesTrackSelection(track)) { + // Fill phi cut monitoring before cut + if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { + float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); + ue.fill(HIST("PhiCut/hPtVsPhiPrimeBefore"), track.pt(), phiPrime); + } + + if (!passesTrackSelection(track, magField)) { continue; } + + // Fill phi cut monitoring after cut + if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { + float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); + ue.fill(HIST("PhiCut/hPtVsPhiPrimeAfter"), track.pt(), phiPrime); + } + nTracksInEvent++; // Fill TPC cluster histograms From bcccf1d3fa8c75d95f832f9a97a3aab4cbb920da Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:47:07 +0200 Subject: [PATCH 149/282] [PWGCF] FemtoUniverse: Add min and max configs for FracSharedTPCcls (#15622) --- ...oUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index b7a4cacfca7..023a355abc6 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -104,7 +104,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confTrkTPCfracsClsMax{"confTrkTPCfracsClsMax", 1.0, "Max of fraction of TPC shared cluster "}; Configurable confTrkTPCnClsMin{"confTrkTPCnClsMin", 80, "Min number of TPC clusters"}; Configurable confTrkTPCsClsMax{"confTrkTPCsClsMax", 160, "Max number of TPC shared clusters"}; - Configurable confPairFracSharedTPCcls{"confPairFracSharedTPCcls", 1.0, "Max. fraction of TPC shared clusters between two closed tracks"}; + Configurable confPairFracSharedTPCclsMin{"confPairFracSharedTPCclsMin", 0.0, "Min. fraction of TPC shared clusters between two closed tracks"}; + Configurable confPairFracSharedTPCclsMax{"confPairFracSharedTPCclsMax", 1.0, "Miax. fraction of TPC shared clusters between two closed tracks"}; Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; Configurable confUseCCImCut{"confUseCCImCut", false, "Fill SH within specific quadrants of qout-qside"}; Configurable confMinqTcut{"confMinqTcut", 0.005, "Min. qT cut on filling SH"}; @@ -560,7 +561,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (kT < firstRealElement || kT > lastElement) continue; float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); - if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + if (pairFractionTPCsCls < twotracksconfigs.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { continue; } @@ -607,7 +608,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { continue; float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); - if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + if (pairFractionTPCsCls < twotracksconfigs.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { continue; } @@ -971,7 +972,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { continue; float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); - if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + if (pairFractionTPCsCls < twotracksconfigs.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { continue; } From 28b1464133b2c5196c75e055f9a3c4e45fbcf045 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Thu, 2 Apr 2026 12:44:28 +0200 Subject: [PATCH 150/282] [PWGCF] Add independent sideband cuts, add v0 for resonances (#15584) --- .../Tasks/flowGenericFramework.cxx | 111 ++++++++++++------ 1 file changed, 77 insertions(+), 34 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 854fa50e9ca..eeb2c4965f8 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -89,7 +89,8 @@ std::vector centbinning(90); int nBootstrap = 10; GFWRegions regions; GFWCorrConfigs configs; -GFWCorrConfigs configsradial; +GFWCorrConfigs configsV02; +GFWCorrConfigs configsV0; std::vector multGlobalCorrCutPars; std::vector multPVCorrCutPars; std::vector multGlobalPVCorrCutPars; @@ -203,17 +204,26 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgUseStrictPID, bool, true, "Use strict PID cuts for TPC") O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5, "pt cut on TOF for PID"); O2_DEFINE_CONFIGURABLE(cfgUseItsPID, bool, true, "Use ITS PID for particle identification") - O2_DEFINE_CONFIGURABLE(cfgK0SignalMin, float, 0.48, "Minimum cut on K0 mT signal (upper limit of left sideband)"); - O2_DEFINE_CONFIGURABLE(cfgK0SignalMax, float, 0.51, "Minimum cut on K0 mT signal (lower limit of right sideband)"); - O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMin, float, 1.1, "Minimum cut on Lambda mT signal (upper limit of left sideband)"); - O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMax, float, 1.3, "Minimum cut on Lambda mT signal (lower limit of right sideband)"); + O2_DEFINE_CONFIGURABLE(cfgK0SignalMin, float, 0.48, "Minimum cut on K0 mT signal"); + O2_DEFINE_CONFIGURABLE(cfgK0SignalMax, float, 0.51, "Maximum cut on K0 mT signal"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMin, float, 1.1, "Minimum cut on Lambda mT signal"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMax, float, 1.3, "Maximum cut on Lambda mT signal"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand1Min, float, 0.44, "Minimum cut on K0 side band 1"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand1Max, float, 0.47, "Maximum cut on K0 side band 1"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand2Min, float, 0.52, "Minimum cut on K0 side band 2"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand2Max, float, 0.56, "Maximum cut on K0 side band 2"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand1Min, float, 1.0, "Minimum cut on Lambda side band 1"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand1Max, float, 1.05, "Maximum cut on Lambda side band 1"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand2Min, float, 1.4, "Minimum cut on Lambda side band 2"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand2Max, float, 1.6, "Maximum cut on Lambda side band 2"); } cfgPIDCuts; Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull"}, {-0.8, 0.4, -0.8}, {-0.4, 0.8, 0.8}, {0, 0, 0}, {1, 1, 1}}, "Configurations for GFW regions"}; Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}", "refFull {2 2 -2 -2}"}, {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"}, {0, 0, 0, 0, 0}, {15, 1, 1, 0, 0}}, "Configurations for each correlation to calculate"}; - Configurable cfgCorrConfigRadial{"cfgCorrConfigRadial", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; + Configurable cfgCorrConfigV02{"cfgCorrConfigV02", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; + Configurable cfgCorrConfigV0{"cfgCorrConfigV0", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; @@ -365,7 +375,8 @@ struct FlowGenericFramework { GFW* fGFW = new GFW(); std::vector corrconfigs; - std::vector corrconfigsradial; + std::vector corrconfigsV02; + std::vector corrconfigsV0; TRandom3* fRndm = new TRandom3(0); TAxis* fPtAxis; @@ -418,11 +429,16 @@ struct FlowGenericFramework { o2::analysis::gfw::configs.SetpTCorrMasks(cfgCorrConfig->GetpTCorrMasks()); o2::analysis::gfw::regions.Print(); o2::analysis::gfw::configs.Print(); - o2::analysis::gfw::configsradial.SetCorrs(cfgCorrConfigRadial->GetCorrs()); - o2::analysis::gfw::configsradial.SetHeads(cfgCorrConfigRadial->GetHeads()); - o2::analysis::gfw::configsradial.SetpTDifs(cfgCorrConfigRadial->GetpTDifs()); - o2::analysis::gfw::configsradial.SetpTCorrMasks(cfgCorrConfigRadial->GetpTCorrMasks()); - o2::analysis::gfw::configsradial.Print(); + o2::analysis::gfw::configsV02.SetCorrs(cfgCorrConfigV02->GetCorrs()); + o2::analysis::gfw::configsV02.SetHeads(cfgCorrConfigV02->GetHeads()); + o2::analysis::gfw::configsV02.SetpTDifs(cfgCorrConfigV02->GetpTDifs()); + o2::analysis::gfw::configsV02.SetpTCorrMasks(cfgCorrConfigV02->GetpTCorrMasks()); + o2::analysis::gfw::configsV02.Print(); + o2::analysis::gfw::configsV0.SetCorrs(cfgCorrConfigV0->GetCorrs()); + o2::analysis::gfw::configsV0.SetHeads(cfgCorrConfigV0->GetHeads()); + o2::analysis::gfw::configsV0.SetpTDifs(cfgCorrConfigV0->GetpTDifs()); + o2::analysis::gfw::configsV0.SetpTCorrMasks(cfgCorrConfigV0->GetpTCorrMasks()); + o2::analysis::gfw::configsV0.Print(); o2::analysis::gfw::ptbinning = cfgGFWBinning->GetPtBinning(); o2::analysis::gfw::ptpoilow = cfgGFWBinning->GetPtPOImin(); o2::analysis::gfw::ptpoiup = cfgGFWBinning->GetPtPOImax(); @@ -631,16 +647,22 @@ struct FlowGenericFramework { LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable"); // Radial flow configs - for (auto i = 0; i < o2::analysis::gfw::configsradial.GetSize(); ++i) { - corrconfigsradial.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configsradial.GetCorrs()[i], o2::analysis::gfw::configsradial.GetHeads()[i], o2::analysis::gfw::configsradial.GetpTDifs()[i])); + for (auto i = 0; i < o2::analysis::gfw::configsV02.GetSize(); ++i) { + corrconfigsV02.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configsV02.GetCorrs()[i], o2::analysis::gfw::configsV02.GetHeads()[i], o2::analysis::gfw::configsV02.GetpTDifs()[i])); } - if (corrconfigsradial.empty()) - LOGF(error, "Radial configuration contains vectors of different size - check the GFWCorrConfig configurable"); + if (corrconfigsV02.empty()) + LOGF(error, "Radial (V02) configuration contains vectors of different size - check the GFWCorrConfig configurable"); + for (auto i = 0; i < o2::analysis::gfw::configsV0.GetSize(); ++i) { + corrconfigsV0.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configsV0.GetCorrs()[i], o2::analysis::gfw::configsV0.GetHeads()[i], o2::analysis::gfw::configsV0.GetpTDifs()[i])); + } + if (corrconfigsV0.empty()) + LOGF(error, "Radial (V0) configuration contains vectors of different size - check the GFWCorrConfig configurable"); fGFW->CreateRegions(); TObjArray* oba = new TObjArray(); addConfigObjectsToObjArray(oba, corrconfigs); - addConfigObjectsToObjArray(oba, corrconfigsradial); + addConfigObjectsToObjArray(oba, corrconfigsV02); + addConfigObjectsToObjArray(oba, corrconfigsV0); if (doprocessData || doprocessRun2 || doprocessMCReco) { fFC->SetName("FlowContainer"); @@ -1270,17 +1292,30 @@ struct FlowGenericFramework { for (std::size_t i = 0; i < fractions[3].size(); ++i) registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[3][i]); - if (corrconfigsradial.size() < 4) + if (corrconfigsV02.size() < 4) return; for (uint l_ind = 0; l_ind < 4; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); + auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; - auto val = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kFALSE).real() / dnx; + auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm); + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm); + } + } + + if (corrconfigsV0.size() < 4) + return; + + if (fFCpts[0]->corrDen[0] == 0.) + return; + + for (uint l_ind = 0; l_ind < 4; ++l_ind) { + double mpt = fFCpts[0]->corrNum[1] / fFCpts[0]->corrDen[1]; + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm); } } return; @@ -1359,12 +1394,12 @@ struct FlowGenericFramework { if (selectK0(collision, v0, centrality, weff)) { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (v0.mK0Short() < cfgPIDCuts.cfgK0SignalMin) + if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) npt_resonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - else if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMax) - npt_resonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - else + if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMin && v0.mK0Short() < cfgPIDCuts.cfgK0SignalMax) npt_resonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand2Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand2Max) + npt_resonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } @@ -1374,12 +1409,12 @@ struct FlowGenericFramework { if (selectLambda(collision, v0, centrality, weff)) { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMin) + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand1Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand1Max) npt_resonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - else if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMax) - npt_resonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - else + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMin && v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMax) npt_resonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand2Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand2Max) + npt_resonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } @@ -1414,16 +1449,24 @@ struct FlowGenericFramework { for (std::size_t i = 0; i < fractions_resonances[4].size(); ++i) registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[4][i]); - for (uint l_ind = 4; l_ind < corrconfigsradial.size(); ++l_ind) { + for (uint l_ind = 4; l_ind < corrconfigsV02.size(); ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); + auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; - auto val = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kFALSE).real() / dnx; + auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); + } + } + + for (uint l_ind = 4; l_ind < corrconfigsV0.size(); ++l_ind) { + double mpt = fFCpts[0]->corrNum[1] / fFCpts[0]->corrDen[1]; + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom); } } + int multiplicity = 0; switch (cfgUseNchCorrection) { case 0: @@ -1467,7 +1510,7 @@ struct FlowGenericFramework { double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { if (weffCh > 0) - acceptedTracks.total += weffCh; + acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; ++acceptedTracks.total_uncorr; } From 22b46bb5c6a12f15357f714b16b6b444fea8476d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 2 Apr 2026 12:55:08 +0200 Subject: [PATCH 151/282] [DPG] Fix includes and using statements (#15381) --- .../dEdxVsOccupancyWithTrackQAinfo.cxx | 41 +++++++++---------- DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx | 37 +++++++++-------- DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx | 40 +++++++++--------- DPG/Tasks/AOTEvent/lumiQa.cxx | 34 ++++++++++----- DPG/Tasks/AOTEvent/matchingQa.cxx | 36 ++++++++++++---- DPG/Tasks/AOTEvent/rofOccupancyQa.cxx | 33 +++++++++------ DPG/Tasks/AOTTrack/D0CalibTables.h | 6 +-- DPG/Tasks/AOTTrack/MonitorFilterBit.cxx | 27 +++++++++--- .../AOTTrack/PID/Combined/qaPIDWithV0s.cxx | 18 ++++---- .../AOTTrack/PID/HMPID/hmpidDeuteron.cxx | 9 +++- DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx | 24 +++++------ .../AOTTrack/PID/HMPID/hmpidTableProducer.cxx | 20 ++++----- DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h | 4 +- DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx | 27 ++++++++++-- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx | 24 ++++++++--- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx | 21 +++++++--- .../AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx | 16 ++++++-- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx | 28 +++++++++---- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx | 19 +++++++++ DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx | 23 +++++++++-- DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx | 21 +++++++--- DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx | 27 +++++++++--- .../AOTTrack/V0Cascades/perfK0sResolution.cxx | 7 ++-- DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx | 18 ++++---- .../AOTTrack/V0Cascades/qaEfficiencyV0s.cxx | 33 ++++++++------- .../V0Cascades/qaK0sTrackingEfficiency.cxx | 23 +++++++---- .../derivedDataCreatorD0Calibration.cxx | 18 +++++--- DPG/Tasks/AOTTrack/qaDcaMC.cxx | 34 ++++++++------- DPG/Tasks/AOTTrack/qaEventTrack.h | 10 ++++- DPG/Tasks/AOTTrack/qaEventTrackLite.cxx | 39 +++++++++++------- .../AOTTrack/qaEventTrackLiteProducer.cxx | 18 ++++---- DPG/Tasks/AOTTrack/qaFakeHits.cxx | 21 ++++++---- DPG/Tasks/AOTTrack/qaMatchEff.cxx | 1 - DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx | 27 ++++++------ DPG/Tasks/AOTTrack/qaSignChargeMC.cxx | 18 +++++--- DPG/Tasks/AOTTrack/qaTrackSelection.cxx | 22 +++++++--- DPG/Tasks/AOTTrack/qaTrackSplitting.cxx | 23 +++++++++-- DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx | 39 ++++++++++++++---- .../AOTTrack/unitTestForReconstruction.cxx | 22 ++++------ DPG/Tasks/FDD/qaFDD.cxx | 38 +++++++++++------ DPG/Tasks/FT0/qaFT0TrgBased.cxx | 32 ++++++++------- DPG/Tasks/FV0/qaFV0.cxx | 33 ++++++++------- DPG/Tasks/ITS/filterTracks.cxx | 18 ++++---- DPG/Tasks/MFT/aQCMFTTracks.cxx | 25 ++++------- DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx | 17 ++++---- DPG/Tasks/TOF/tofOfflineCalib.cxx | 28 ++++++++++++- DPG/Tasks/TOF/tofSkimsTableCreator.cxx | 18 ++++++-- DPG/Tasks/TOF/tofSkimsTableCreator.h | 4 +- DPG/Tasks/TPC/tpcSkimsTableCreator.cxx | 1 + DPG/Tasks/TPC/tpcSkimsTableCreator.h | 1 - DPG/Tasks/TPC/tpcTreeCreatorLight.cxx | 23 +++++------ DPG/Tasks/TPC/tpcTreeCreatorLight.h | 5 +-- DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h | 2 + 53 files changed, 741 insertions(+), 412 deletions(-) diff --git a/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx b/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx index c87fd48bc99..444406a6c42 100644 --- a/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx +++ b/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx @@ -14,30 +14,29 @@ /// /// \author Igor Altsybeev -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/HistogramRegistry.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TH3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx index 3fc293c7e84..a79bd82a5c3 100644 --- a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx @@ -16,27 +16,32 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TH3.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include #include #include diff --git a/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx b/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx index e87ca9c73f3..b85b1d3b42c 100644 --- a/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx +++ b/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx @@ -15,30 +15,28 @@ /// \author Igor Altsybeev #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -// #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsFT0/RecPoints.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TH3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include diff --git a/DPG/Tasks/AOTEvent/lumiQa.cxx b/DPG/Tasks/AOTEvent/lumiQa.cxx index 35ef282650b..f03419fff52 100644 --- a/DPG/Tasks/AOTEvent/lumiQa.cxx +++ b/DPG/Tasks/AOTEvent/lumiQa.cxx @@ -9,17 +9,31 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include #include - -#include "TH1.h" -#include "TList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTEvent/matchingQa.cxx b/DPG/Tasks/AOTEvent/matchingQa.cxx index 3b266f047e9..62bece530f7 100644 --- a/DPG/Tasks/AOTEvent/matchingQa.cxx +++ b/DPG/Tasks/AOTEvent/matchingQa.cxx @@ -9,14 +9,34 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "MetadataHelper.h" +#include "Common/Core/MetadataHelper.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx index cbc8d7d56d1..af9e0697922 100644 --- a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx @@ -14,20 +14,27 @@ /// /// \author Igor Altsybeev -#include - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" #include "Common/CCDB/EventSelectionParams.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "Framework/HistogramRegistry.h" -// #include "DataFormatsParameters/GRPLHCIFData.h" -#include "ITSMFTBase/DPLAlpideParam.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/D0CalibTables.h b/DPG/Tasks/AOTTrack/D0CalibTables.h index 973582d8ba2..81e16201b63 100644 --- a/DPG/Tasks/AOTTrack/D0CalibTables.h +++ b/DPG/Tasks/AOTTrack/D0CalibTables.h @@ -16,16 +16,14 @@ #ifndef DPG_TASKS_AOTTRACK_D0CALIBTABLES_H_ #define DPG_TASKS_AOTTRACK_D0CALIBTABLES_H_ -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include #include -#include - +#include +#include #include -#include #include #include diff --git a/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx b/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx index b8fb6679b1c..648c1258127 100644 --- a/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx +++ b/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx @@ -15,12 +15,29 @@ /// \brief Task performing basic checks on filter-bit selections. /// -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/Core/RecoDecay.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/ASoA.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx b/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx index 9b1d4f9c692..8ff792a860b 100644 --- a/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx +++ b/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx @@ -18,19 +18,21 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx index 98ea08f7add..27451cff7e3 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx @@ -12,10 +12,17 @@ #include "tableHMPID.h" #include +#include +#include +#include +#include +#include #include #include -#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx index 5a1f821cda2..50059151aab 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx @@ -11,31 +11,29 @@ #include "tableHMPID.h" -#include "Common/Core/PID/PIDTOF.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" - +#include #include -#include #include #include +#include #include -#include +#include +#include +#include #include -#include -#include -#include -#include #include #include +#include #include -#include +#include #include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx index f2865d65be9..e7cb03e25be 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx @@ -11,32 +11,26 @@ #include "tableHMPID.h" -#include "Common/Core/PID/PIDTOF.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" +#include #include -#include #include +#include #include +#include #include -#include +#include +#include +#include #include -#include -#include -#include -#include - -#include +#include #include #include diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h b/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h index dff3a00ed4f..6844da6c519 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h +++ b/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h @@ -12,8 +12,8 @@ #ifndef DPG_TASKS_AOTTRACK_PID_HMPID_TABLEHMPID_H_ #define DPG_TASKS_AOTTRACK_PID_HMPID_TABLEHMPID_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include namespace o2::aod { diff --git a/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx b/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx index 8b74a7beb77..03dfe30779b 100644 --- a/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx +++ b/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx @@ -20,11 +20,30 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx index 95f9016d388..bbe18f83730 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx @@ -16,15 +16,27 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx index a1461cb0509..2a9d59a71b0 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx @@ -16,15 +16,24 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx index 2bcccc5a67b..8a83649dbc7 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx @@ -16,16 +16,26 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" +#include +#include +#include #include +#include +#include #include -#include +#include +#include +#include #include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx index b9ead03b14f..c0b4e628fe2 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx @@ -21,15 +21,25 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFT0/Digit.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include "TEfficiency.h" -#include "THashList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx index 3a0f2de652f..d9ef9cd278b 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx @@ -18,10 +18,29 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" +#include +#include +#include #include +#include #include +#include +#include +#include +#include #include #include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx index 53c03e6c338..cbc4084e922 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx @@ -20,10 +20,25 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx index e05023b4b3a..8ff86797176 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx @@ -15,13 +15,24 @@ /// \brief Task to produce QA output of the PID with TPC running on the MC. /// -// O2 includes #include "Common/DataModel/PIDResponseTPC.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx index bf8492b8036..2c0501963b5 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx @@ -16,12 +16,29 @@ /// \brief Implementation for QA tasks of the TPC signal (lite task, refer to qaPIDTPC.cxx for full TPC QA for PID) /// -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx b/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx index 1ab36ad9f71..aa2f13ba744 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx @@ -20,10 +20,12 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -37,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -44,15 +47,13 @@ #include #include #include -#include #include #include #include +#include #include -#include - #include #include #include diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx index 2513ad92a91..be37adc3943 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx @@ -18,21 +18,17 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.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 "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx index a728b252007..ff6236ec9a9 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx @@ -17,23 +17,26 @@ /// The efficiency for particles is computed according to the PDG code (sign included and not charge) /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -// ROOT includes -#include "TPDGCode.h" -#include "TEfficiency.h" -#include "THashList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include using namespace o2::framework; static constexpr int nSpecies = 2; // One per PDG diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx index 64b84711d90..2765e7e87d9 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx @@ -11,19 +11,24 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx b/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx index 04db9d2fd1c..33a4a2a9ed7 100644 --- a/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx +++ b/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx @@ -25,18 +25,26 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/OccupancyTables.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include "CommonDataFormat/InteractionRecord.h" +#include +#include #include +#include #include +#include +#include +#include +#include #include -#include +#include +#include +#include #include #include #include @@ -46,12 +54,12 @@ #include #include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include -#include +#include #include -#include #include #include +#include #include #include #include diff --git a/DPG/Tasks/AOTTrack/qaDcaMC.cxx b/DPG/Tasks/AOTTrack/qaDcaMC.cxx index 4054c59b33a..28b65bfa304 100644 --- a/DPG/Tasks/AOTTrack/qaDcaMC.cxx +++ b/DPG/Tasks/AOTTrack/qaDcaMC.cxx @@ -15,23 +15,29 @@ /// \brief Task to analyse the DCA distributions in the MC according to PDG code and status /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" -// ROOT includes -#include "TPDGCode.h" -#include "TEfficiency.h" -#include "THashList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/qaEventTrack.h b/DPG/Tasks/AOTTrack/qaEventTrack.h index 42cbe5455ca..edd9512c5ec 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrack.h +++ b/DPG/Tasks/AOTTrack/qaEventTrack.h @@ -17,10 +17,14 @@ /// \brief Header file for QA tasks for the track and the event properties. /// +#ifndef DPG_TASKS_AOTTRACK_QAEVENTTRACK_H_ +#define DPG_TASKS_AOTTRACK_QAEVENTTRACK_H_ + #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" +#include + +#include // Output table declaration namespace o2::aod @@ -165,3 +169,5 @@ DECLARE_SOA_TABLE(DPGNonRecoParticles, "AOD", "DPGNonRecoPart", //! Table of the dpgparticles::IsFromMaterial, mcparticle::Vx, mcparticle::Vy, mcparticle::Vz); } // namespace o2::aod + +#endif // DPG_TASKS_AOTTRACK_QAEVENTTRACK_H_ diff --git a/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx b/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx index f6812f35a8e..61938e1d348 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx @@ -20,25 +20,34 @@ #include "qaEventTrack.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/DCA.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "MathUtils/BetheBlochAleph.h" -#include "ReconstructionDataFormats/PID.h" - -#include "TF1.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::dataformats; // Lite version of the QA task to run on skimmed dataset struct qaEventTrackLite { diff --git a/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx b/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx index 2c2ab18a49d..8e41e7a24cc 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx @@ -19,29 +19,27 @@ #include "qaEventTrack.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" +#include +#include +#include +#include +#include +#include -#include "TRandom.h" +#include +#include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::dataformats; struct QaEventTrackLiteProducer { // Tables to produce diff --git a/DPG/Tasks/AOTTrack/qaFakeHits.cxx b/DPG/Tasks/AOTTrack/qaFakeHits.cxx index 4005b0834c9..b0dc3c553cc 100644 --- a/DPG/Tasks/AOTTrack/qaFakeHits.cxx +++ b/DPG/Tasks/AOTTrack/qaFakeHits.cxx @@ -16,19 +16,26 @@ /// \brief Task to analyze the fraction of the true and fake hits depending on where the fake hits are picked /// -#include "PWGLF/DataModel/LFParticleIdentification.h" - -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include #include +#include #include +#include +#include +#include #include #include -#include -#include +#include + +#include +#include + +#include +#include +#include using namespace o2::framework; // Particle information diff --git a/DPG/Tasks/AOTTrack/qaMatchEff.cxx b/DPG/Tasks/AOTTrack/qaMatchEff.cxx index 4b6d3e87d13..d34c897ac55 100644 --- a/DPG/Tasks/AOTTrack/qaMatchEff.cxx +++ b/DPG/Tasks/AOTTrack/qaMatchEff.cxx @@ -80,7 +80,6 @@ using namespace o2; using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using namespace extConfPar; using o2::constants::math::PI; using o2::constants::math::TwoPI; diff --git a/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx b/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx index dd66692a4e2..2c1d251b710 100644 --- a/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx +++ b/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx @@ -10,18 +10,21 @@ // or submit itself to any jurisdiction. /// \author Mattia Faggin , Padova University and INFN -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/HistogramRegistry.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "TH1F.h" -#include "TH2F.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2::framework; using namespace o2; diff --git a/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx b/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx index e40dd0e76e9..1de78d081a2 100644 --- a/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx +++ b/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx @@ -16,11 +16,19 @@ /// \since 08/05/2024 /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/qaTrackSelection.cxx b/DPG/Tasks/AOTTrack/qaTrackSelection.cxx index f7ea3dd2f53..6cb389b8608 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSelection.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSelection.cxx @@ -16,15 +16,27 @@ /// \brief Task to check how many tracks pass the cuts /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" #include "Common/Core/TrackSelection.h" -#include "Common/DataModel/EventSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + using namespace o2::framework; struct QaTrackCuts { diff --git a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx index 3125f1e7c03..680cb819b34 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx @@ -15,13 +15,28 @@ /// \brief Task to analyse the numbers of particles reconstructed more than once /// -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Common/DataModel/EventSelection.h" +#include "TrackSelection.h" + #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx index dd5a969e458..842f167d7d2 100644 --- a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx +++ b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx @@ -16,6 +16,7 @@ #include "PWGHF/Utils/utilsAnalysis.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" @@ -26,17 +27,39 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include +#include + +#include #include +#include +#include +#include +#include +#include #include #include diff --git a/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx b/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx index a5e6016d9fb..b5f44d9c311 100644 --- a/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx +++ b/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx @@ -15,21 +15,17 @@ /// \author Alberto Caliva (alberto.caliva@cern.ch), Catalin-Lucian Ristea (catalin.ristea@cern.ch) /// \since September 9, 2025 -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include #include #include #include diff --git a/DPG/Tasks/FDD/qaFDD.cxx b/DPG/Tasks/FDD/qaFDD.cxx index c985d7dbb9d..96f4d31dcab 100644 --- a/DPG/Tasks/FDD/qaFDD.cxx +++ b/DPG/Tasks/FDD/qaFDD.cxx @@ -9,21 +9,35 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "Common/DataModel/EventSelection.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFIT/Triggers.h" #include "Common/DataModel/FT0Corrected.h" -#include "CCDB/CcdbApi.h" -#include "CommonDataFormat/BunchFilling.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "TH1F.h" -#include "TH2F.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/FT0/qaFT0TrgBased.cxx b/DPG/Tasks/FT0/qaFT0TrgBased.cxx index 35a2c2cc884..c42b839087a 100644 --- a/DPG/Tasks/FT0/qaFT0TrgBased.cxx +++ b/DPG/Tasks/FT0/qaFT0TrgBased.cxx @@ -13,27 +13,29 @@ /// \author Uliana Dmitrieva uliana.dmitrieva@cern.ch /// \brief FT0 QA +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include #include -#include +#include #include #include #include -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" -#include "Common/DataModel/Multiplicity.h" -#include "DataFormatsFT0/Digit.h" - -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/InitContext.h" -#include "Framework/runDataProcessing.h" - using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/FV0/qaFV0.cxx b/DPG/Tasks/FV0/qaFV0.cxx index 295f981b0b7..1e21e679f1a 100644 --- a/DPG/Tasks/FV0/qaFV0.cxx +++ b/DPG/Tasks/FV0/qaFV0.cxx @@ -13,28 +13,27 @@ /// \author Andreas Molander andreas.molander@cern.ch /// \brief FV0 QA +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + #include #include -#include -#include #include +#include #include -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" - -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/InitContext.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/runDataProcessing.h" - -#include "TH1F.h" -#include "TH2F.h" - using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/ITS/filterTracks.cxx b/DPG/Tasks/ITS/filterTracks.cxx index 446a792e3f4..6a9ee148142 100644 --- a/DPG/Tasks/ITS/filterTracks.cxx +++ b/DPG/Tasks/ITS/filterTracks.cxx @@ -14,22 +14,26 @@ /// /// \author Andrea Rossi +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include using namespace o2; diff --git a/DPG/Tasks/MFT/aQCMFTTracks.cxx b/DPG/Tasks/MFT/aQCMFTTracks.cxx index 5b5f4a71aa4..be34d97fe69 100644 --- a/DPG/Tasks/MFT/aQCMFTTracks.cxx +++ b/DPG/Tasks/MFT/aQCMFTTracks.cxx @@ -16,24 +16,17 @@ /// \author David Grund /// \since -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/TimingInfo.h" -#include "Framework/runDataProcessing.h" - -#include -#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx b/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx index 5f285fcc2b4..fc38e305938 100644 --- a/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx +++ b/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx @@ -12,13 +12,16 @@ /// \brief Simple QC task to run /// \author Fabrizio Grosa, fabrizio.grosa@cern.ch (CERN) -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; @@ -36,7 +39,7 @@ struct mcSimpleQc { {"histNumGlobalTracks", ";#it{N}_{global tracks};entries", {HistType::kTH1F, {{200, -0.5, 200.}}}}, // {"histNumPvContributors", ";#it{N}_{PV contributors};entries", {HistType::kTH1F, {{200, -0.5, 200.}}}}, // {"histFracAmbiguousTracks", ";#it{N}_{ambiguous tracks} / #it{N}_{tracks};entries", {HistType::kTH1F, {{100, 0., 1.}}}} // - } // + } // }; using CollisionsWithMCLabels = soa::Join; @@ -84,4 +87,4 @@ struct mcSimpleQc { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} diff --git a/DPG/Tasks/TOF/tofOfflineCalib.cxx b/DPG/Tasks/TOF/tofOfflineCalib.cxx index 950efc83e07..f3b6aed8ab8 100644 --- a/DPG/Tasks/TOF/tofOfflineCalib.cxx +++ b/DPG/Tasks/TOF/tofOfflineCalib.cxx @@ -24,9 +24,33 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/TOF/tofSkimsTableCreator.cxx b/DPG/Tasks/TOF/tofSkimsTableCreator.cxx index c61a3336982..4fcdc3fb7cb 100644 --- a/DPG/Tasks/TOF/tofSkimsTableCreator.cxx +++ b/DPG/Tasks/TOF/tofSkimsTableCreator.cxx @@ -20,12 +20,24 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/FT0Corrected.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/TOF/tofSkimsTableCreator.h b/DPG/Tasks/TOF/tofSkimsTableCreator.h index f1dd4ccfb3e..f3a6f63bb9b 100644 --- a/DPG/Tasks/TOF/tofSkimsTableCreator.h +++ b/DPG/Tasks/TOF/tofSkimsTableCreator.h @@ -23,7 +23,9 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx index c91afe4734f..85607d41636 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.h b/DPG/Tasks/TPC/tpcSkimsTableCreator.h index 0d05ce33348..61017c27d1c 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.h @@ -20,7 +20,6 @@ #ifndef DPG_TASKS_TPC_TPCSKIMSTABLECREATOR_H_ #define DPG_TASKS_TPC_TPCSKIMSTABLECREATOR_H_ -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/OccupancyTables.h" #include diff --git a/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx b/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx index a0871336051..7d9ae11ea1b 100644 --- a/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx +++ b/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx @@ -18,28 +18,27 @@ #include "tpcTreeCreatorLight.h" -#include - -#include -/// ROOT -#include "TRandom3.h" -/// O2 -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -/// O2Physics -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::track; -using namespace o2::dataformats; struct TreeWriterTPCTOF { using Trks = soa::Join; diff --git a/DPG/Tasks/TPC/tpcTreeCreatorLight.h b/DPG/Tasks/TPC/tpcTreeCreatorLight.h index 2af95cf2256..a9b7af27966 100644 --- a/DPG/Tasks/TPC/tpcTreeCreatorLight.h +++ b/DPG/Tasks/TPC/tpcTreeCreatorLight.h @@ -17,10 +17,9 @@ #ifndef DPG_TASKS_TPC_TPCTREECREATORLIGHT_H_ #define DPG_TASKS_TPC_TPCTREECREATORLIGHT_H_ -#include "Common/Core/trackUtilities.h" +#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" +#include enum ParticleSpecies { kPionTrack = BIT(0), diff --git a/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h b/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h index e32cee320fc..32c27233067 100644 --- a/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h @@ -24,6 +24,8 @@ #include "Common/DataModel/OccupancyTables.h" +#include + #include #include From a51139e21991f83ba427f3a4c3a55a3bf7470982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:26:07 +0200 Subject: [PATCH 152/282] [Tools] Fix includes and using statements (#15391) --- Tools/KFparticle/qaKFEventTrack.cxx | 63 +++++++++++++---------------- Tools/KFparticle/qaKFEventTrack.h | 8 ++-- Tools/KFparticle/qaKFParticle.h | 6 +-- Tools/KFparticle/qaKFParticleLc.cxx | 58 +++++++++++--------------- Tools/KFparticle/qaKFParticleLc.h | 6 +-- Tools/ML/model.cxx | 1 + Tools/ML/model.h | 1 + 7 files changed, 65 insertions(+), 78 deletions(-) diff --git a/Tools/KFparticle/qaKFEventTrack.cxx b/Tools/KFparticle/qaKFEventTrack.cxx index f3f026a8da7..2242de51154 100644 --- a/Tools/KFparticle/qaKFEventTrack.cxx +++ b/Tools/KFparticle/qaKFEventTrack.cxx @@ -15,47 +15,42 @@ /// \brief Task to test the performance of the KFParticle package /// +#ifndef HomogeneousField +#define HomogeneousField +#endif + #include "Tools/KFparticle/qaKFEventTrack.h" -#include -#include -#include "TableHelper.h" -#include -using namespace std; -/// includes O2 -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" - -/// includes O2Physics #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/Core/trackUtilities.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Tools/KFparticle/KFUtilities.h" -/// includes KFParticle -#include "KFParticle.h" -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFParticleBase.h" -#include "KFVertex.h" - -#ifndef HomogeneousField - -#define HomogeneousField - -#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +using namespace std; using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tools/KFparticle/qaKFEventTrack.h b/Tools/KFparticle/qaKFEventTrack.h index 399a3139a91..51f505a435e 100644 --- a/Tools/KFparticle/qaKFEventTrack.h +++ b/Tools/KFparticle/qaKFEventTrack.h @@ -15,9 +15,11 @@ #ifndef TOOLS_KFPARTICLE_QAKFEVENTTRACK_H_ #define TOOLS_KFPARTICLE_QAKFEVENTTRACK_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" +#include + +#include + +#include enum FlagsTracks { kITS = BIT(0), diff --git a/Tools/KFparticle/qaKFParticle.h b/Tools/KFparticle/qaKFParticle.h index afb23851cb5..e9c8f298325 100644 --- a/Tools/KFparticle/qaKFParticle.h +++ b/Tools/KFparticle/qaKFParticle.h @@ -15,9 +15,9 @@ #ifndef TOOLS_KFPARTICLE_QAKFPARTICLE_H_ #define TOOLS_KFPARTICLE_QAKFPARTICLE_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" +#include + +#include enum Source { kPrompt = BIT(0), diff --git a/Tools/KFparticle/qaKFParticleLc.cxx b/Tools/KFparticle/qaKFParticleLc.cxx index 792acdff439..86902d349cd 100644 --- a/Tools/KFparticle/qaKFParticleLc.cxx +++ b/Tools/KFparticle/qaKFParticleLc.cxx @@ -15,52 +15,40 @@ /// \brief Task to test the performance of the KFParticle package on the Lc to pKpi decay /// -#include "Tools/KFparticle/qaKFParticleLc.h" - -#include "TableHelper.h" - -#include - -#include -#include +#ifndef HomogeneousField +#define HomogeneousField +#endif -#include +#include "Tools/KFparticle/qaKFParticleLc.h" -/// includes O2 -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" - -/// includes O2Physics -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/KFparticle/KFUtilities.h" -/// includes KFParticle -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFParticle.h" -#include "KFParticleBase.h" -#include "KFVertex.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifndef HomogeneousField +#include -#define HomogeneousField +#include +#include +#include -#endif +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tools/KFparticle/qaKFParticleLc.h b/Tools/KFparticle/qaKFParticleLc.h index 8c57232f99a..29fc5707be4 100644 --- a/Tools/KFparticle/qaKFParticleLc.h +++ b/Tools/KFparticle/qaKFParticleLc.h @@ -15,9 +15,9 @@ #ifndef TOOLS_KFPARTICLE_QAKFPARTICLELC_H_ #define TOOLS_KFPARTICLE_QAKFPARTICLELC_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" +#include + +#include enum Source { kPrompt = BIT(0), diff --git a/Tools/ML/model.cxx b/Tools/ML/model.cxx index a60abc65af5..6d2098068aa 100644 --- a/Tools/ML/model.cxx +++ b/Tools/ML/model.cxx @@ -23,6 +23,7 @@ #include +#include #include #include diff --git a/Tools/ML/model.h b/Tools/ML/model.h index 468c3dfd733..3be08e72fa9 100644 --- a/Tools/ML/model.h +++ b/Tools/ML/model.h @@ -22,6 +22,7 @@ #include +#include #include #include From cecb2fecabc006619ff03dceda7fa95fa004ed9a Mon Sep 17 00:00:00 2001 From: dyx-11 <1260971129@qq.com> Date: Thu, 2 Apr 2026 20:04:52 +0800 Subject: [PATCH 153/282] [PWGUD] add event consistency flag (#15624) --- PWGUD/Tasks/flowCumulantsUpc.cxx | 46 +++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index ad75ae1a3c3..9624c1a5c86 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -125,9 +125,18 @@ struct FlowCumulantsUpc { O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut") O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size") O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2") + O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 0, "Flag to select consistent events - 0: off, 1: v2{2} gap calculable, 2: v2{4} full calculable, 4: v2{4} gap calculable, 8: v2{4} 3sub calculable") + Configurable> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"}; Configurable> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"}; Configurable> cfgRunRemoveList{"cfgRunRemoveList", std::vector{-1}, "excluded run numbers"}; + Configurable> cfgConsistentEventVector{"cfgConsistentEventVector", std::vector{-0.8, -0.5, -0.4, 0.4, 0.5, 0.8}, "eta regions: left(min,max), mid(min,max), right(min,max)"}; + struct AcceptedTracks { + int nNeg; + int nMid; + int nPos; + int nFull; + }; ConfigurableAxis axisPtHist{"axisPtHist", {100, 0., 10.}, "pt axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, "pt axis for histograms"}; @@ -217,13 +226,15 @@ struct FlowCumulantsUpc { // Add some output objects to the histogram registry // Event QA - registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{5, 0, 5}}}); + registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{6, 0, 6}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after gapside selection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after its selection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after pt selection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after occupancy"); - registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{5, 0, 5}}}); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(6, "after consistency check"); + + registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{7, 0, 7}}}); registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(1, "after event selection"); registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(2, "PVContributor"); registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(3, "dcaz"); @@ -955,7 +966,7 @@ struct FlowCumulantsUpc { registry.fill(HIST("hMult"), tracks.size()); registry.fill(HIST("hCent"), cent); fGFW->Clear(); - if (cfgIfVertex && abs(vtxz) > cfgCutVertex) { + if (cfgIfVertex && std::abs(vtxz) > cfgCutVertex) { return; } registry.fill(HIST("hEventCount"), 3.5); @@ -971,6 +982,8 @@ struct FlowCumulantsUpc { if (cfgUseNch) { independent = static_cast(tracks.size()); } + AcceptedTracks acceptedTracks{0, 0, 0, 0}; + std::vector consistentEventVector = cfgConsistentEventVector; for (const auto& track : tracks) { registry.fill(HIST("hChi2prTPCcls"), track.tpcChi2NCl()); @@ -996,6 +1009,16 @@ struct FlowCumulantsUpc { continue; } registry.fill(HIST("hPt"), track.pt()); + + if (cfgConsistentEventFlag && consistentEventVector.size() == 6) { // o2-linter: disable=magic-number (size match) + acceptedTracks.nFull += 1; + if (eta > consistentEventVector[0] && eta < consistentEventVector[1]) + acceptedTracks.nNeg += 1; + if (eta > consistentEventVector[2] && eta < consistentEventVector[3]) + acceptedTracks.nMid += 1; + if (eta > consistentEventVector[4] && eta < consistentEventVector[5]) + acceptedTracks.nPos += 1; + } if (withinPtRef) { registry.fill(HIST("hPhi"), phi); registry.fill(HIST("hPhiWeighted"), phi, wacc); @@ -1017,6 +1040,23 @@ struct FlowCumulantsUpc { registry.fill(HIST("hEtaNch2D"), eta, tracks.size()); } registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected); + if (cfgConsistentEventFlag) { + if (cfgConsistentEventFlag & 1) { + if (!acceptedTracks.nPos || !acceptedTracks.nNeg) + return; + } else if (cfgConsistentEventFlag & 2) { + if (acceptedTracks.nFull < 4) // o2-linter: disable=magic-number (at least four tracks in full acceptance) + return; + } else if (cfgConsistentEventFlag & 4) { + if (acceptedTracks.nPos < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in each subevent) + return; + } + if (cfgConsistentEventFlag & 8) { + if (acceptedTracks.nPos < 2 || acceptedTracks.nMid < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in all three subevents) + return; + } + } + registry.fill(HIST("hEventCount"), 5.5); // Filling Flow Container for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { From a3901082066ef3d5c3e1974eefae879c15fc19e7 Mon Sep 17 00:00:00 2001 From: omassen <55696099+omassen@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:33:53 +0200 Subject: [PATCH 154/282] [PWGEM] New Dielectron analysis type: Bootstrapping for v2. (#15576) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ALICE Action Bot Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGEM/Dilepton/Core/Dilepton.h | 92 +++++++++++++++++++++++--- PWGEM/Dilepton/Utils/EventHistograms.h | 48 +++++++++++++- PWGEM/Dilepton/Utils/PairUtilities.h | 1 + 3 files changed, 130 insertions(+), 11 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 46a4a8718e6..b5ba7dad68e 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -113,7 +114,7 @@ struct Dilepton { o2::framework::Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; o2::framework::Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; - o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5"}; + o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5, kBootstrapv2:6"}; o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; @@ -142,6 +143,8 @@ struct Dilepton { o2::framework::ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; o2::framework::ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {15, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> + o2::framework::Configurable cfgNumBootstrapSamples{"cfgNumBootstrapSamples", 1, "Number of Bootstrap Samples"}; + EMEventCut fEMEventCut; struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -673,6 +676,17 @@ struct Dilepton { fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kBootstrapv2)) { + nmod = 2; + const o2::framework::AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; + const o2::framework::AxisSpec axis_bootstrap{cfgNumBootstrapSamples, 0.5, static_cast(cfgNumBootstrapSamples) + 0.5, "sample"}; // for bootstrap samples + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp, axis_bootstrap}, true); + fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); + fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); + fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); + o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistogramsBootstrap(&fRegistry, cfgNumBootstrapSamples); } else { // same as kQC to avoid seg. fault fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); @@ -844,7 +858,7 @@ struct Dilepton { } template - bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) + bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector weightvector) { if constexpr (ev_id == 0) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -1057,7 +1071,6 @@ struct Dilepton { } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), cos_thetaPol, phiPol, quadmom, weight); } - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kHFll)) { float dphi = v1.Phi() - v2.Phi(); dphi = RecoDecay::constrainAngle(dphi, -o2::constants::math::PIHalf); @@ -1071,6 +1084,51 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), dphi, deta, weight); } + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kBootstrapv2)) { + std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; + std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; + std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; + std::array q2btot = {collision.q2xbtot(), collision.q2ybtot()}; + std::array q2bpos = {collision.q2xbpos(), collision.q2ybpos()}; + std::array q2bneg = {collision.q2xbneg(), collision.q2ybneg()}; + std::array q2fv0a = {collision.q2xfv0a(), collision.q2yfv0a()}; + std::array q3ft0m = {collision.q3xft0m(), collision.q3yft0m()}; + std::array q3ft0a = {collision.q3xft0a(), collision.q3yft0a()}; + std::array q3ft0c = {collision.q3xft0c(), collision.q3yft0c()}; + std::array q3btot = {collision.q3xbtot(), collision.q3ybtot()}; + std::array q3bpos = {collision.q3xbpos(), collision.q3ybpos()}; + std::array q3bneg = {collision.q3xbneg(), collision.q3ybneg()}; + std::array q3fv0a = {collision.q3xfv0a(), collision.q3yfv0a()}; + + std::vector>> qvectors = { + {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 0th harmonics + {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 1st harmonics + {q2ft0m, q2ft0a, q2ft0c, q2btot, q2bpos, q2bneg, q2fv0a}, // 2nd harmonics + {q3ft0m, q3ft0a, q3ft0c, q3btot, q3bpos, q3bneg, q3fv0a}, // 3rd harmonics + }; + + if constexpr (ev_id == 0) { + // LOGF(info, "collision.centFT0C() = %f, collision.trackOccupancyInTimeRange() = %d, getSPresolution = %f", collision.centFT0C(), collision.trackOccupancyInTimeRange(), getSPresolution(collision.centFT0C(), collision.trackOccupancyInTimeRange())); + + float sp = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v12.Phi())), static_cast(std::sin(nmod * v12.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(collision.centFT0C(), collision.trackOccupancyInTimeRange()); + for (int i = 0; i < cfgNumBootstrapSamples; i++) { + if (t1.sign() * t2.sign() < 0) { // ULS + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), sp, i + 0.5, weightvector.at(i)); + } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), sp, i + 0.5, weightvector.at(i)); + } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), sp, i + 0.5, weightvector.at(i)); + } + } + } else if constexpr (ev_id == 1) { + if (t1.sign() * t2.sign() < 0) { // ULS + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } + } } else { // same as kQC to avoid seg. fault if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); @@ -1266,6 +1324,20 @@ struct Dilepton { } } + std::vector bootstrapweights = {}; + if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kBootstrapv2)) { // bootstrapping for accepted events + int randomSeed = static_cast(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + TRandom3 randomNumber(randomSeed); + for (int i = 0; i < cfgNumBootstrapSamples; i++) { + float poissonweight = 0.; + poissonweight = static_cast(randomNumber.PoissonD(1.0)); + bootstrapweights.push_back(poissonweight); + o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfoBootstrap(&fRegistry, collision, i, poissonweight); + } + } else { + bootstrapweights.push_back(1.0); // to pass as non-empyt dummy to use + } + if (nmod == 2) { o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, 2>(&fRegistry, collision); } else if (nmod == 3) { @@ -1286,19 +1358,19 @@ struct Dilepton { used_trackIds_per_col.reserve(posTracks_per_coll.size() + negTracks_per_coll.size()); int nuls = 0, nlspp = 0, nlsmm = 0; for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS - bool is_pair_ok = fillPairInfo<0>(collision, pos, neg, cut, tracks); + bool is_pair_ok = fillPairInfo<0>(collision, pos, neg, cut, tracks, bootstrapweights); if (is_pair_ok) { nuls++; } } for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ - bool is_pair_ok = fillPairInfo<0>(collision, pos1, pos2, cut, tracks); + bool is_pair_ok = fillPairInfo<0>(collision, pos1, pos2, cut, tracks, bootstrapweights); if (is_pair_ok) { nlspp++; } } for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- - bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks); + bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks, bootstrapweights); if (is_pair_ok) { nlsmm++; } @@ -1380,25 +1452,25 @@ struct Dilepton { for (const auto& pos : selected_posTracks_in_this_event) { // ULS mix for (const auto& neg : negTracks_from_event_pool) { - fillPairInfo<1>(collision, pos, neg, cut, nullptr); + fillPairInfo<1>(collision, pos, neg, cut, nullptr, bootstrapweights); } } for (const auto& neg : selected_negTracks_in_this_event) { // ULS mix for (const auto& pos : posTracks_from_event_pool) { - fillPairInfo<1>(collision, neg, pos, cut, nullptr); + fillPairInfo<1>(collision, neg, pos, cut, nullptr, bootstrapweights); } } for (const auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix for (const auto& pos2 : posTracks_from_event_pool) { - fillPairInfo<1>(collision, pos1, pos2, cut, nullptr); + fillPairInfo<1>(collision, pos1, pos2, cut, nullptr, bootstrapweights); } } for (const auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix for (const auto& neg2 : negTracks_from_event_pool) { - fillPairInfo<1>(collision, neg1, neg2, cut, nullptr); + fillPairInfo<1>(collision, neg1, neg2, cut, nullptr, bootstrapweights); } } } // end of loop over mixed event pool diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index c24ba9b497c..fc4061610eb 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -152,6 +152,25 @@ void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) fRegistry->addClone("Event/before/", "Event/after/"); } +void addEventHistogramsBootstrap(o2::framework::HistogramRegistry* fRegistry, int nsamples = 1) +{ + fRegistry->add("Event/bootstrap/hPoissonWeights", "Poisson Weights per sample;sample;weight", o2::framework::kTH2D, {{nsamples, 0.5, nsamples + 0.5}, {210, -1, 20}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2BPosQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); +} + template void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, const float /*weight*/ = 1.f) { @@ -184,7 +203,7 @@ void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const if (collision.sel8()) { fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 10.0); } - if (abs(collision.posZ()) < 10.0) { + if (std::abs(collision.posZ()) < 10.0) { fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 11.0); } if (collision.selection_bit(o2::aod::emevsel::kNoCollInTimeRangeStandard)) { @@ -319,5 +338,32 @@ void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ3FV0AQ3BTot_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q3fv0a, q3btot)); } } +template +void fillEventInfoBootstrap(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, const int sample, const float weight) +{ + std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; + std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; + std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; + std::array q2fv0a = {collision.q2xfv0a(), collision.q2yfv0a()}; + std::array q2bpos = {collision.q2xbpos(), collision.q2ybpos()}; + std::array q2bneg = {collision.q2xbneg(), collision.q2ybneg()}; + std::array q2btot = {collision.q2xbtot(), collision.q2ybtot()}; + + fRegistry->fill(HIST("Event/bootstrap/hPoissonWeights"), sample + 0.5, weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0MQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0m, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0MQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0m, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2BPosQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2bpos, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0CQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0c, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0CQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0c, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0CQ2BTot_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0c, q2btot), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2BTot_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2btot), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2FT0C_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2ft0c), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2BTot_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2btot), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2FT0C_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2ft0c), weight); +} } // namespace o2::aod::pwgem::dilepton::utils::eventhistogram #endif // PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index fd915c7fd0f..693045306eb 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -49,6 +49,7 @@ enum class DileptonAnalysisType : int { kFlowV3 = 3, kPolarization = 4, kHFll = 5, + kBootstrapv2 = 6, }; enum class DileptonHadronAnalysisType : int { From 1337e7468d21234a07c688486f8645081b2b655b 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: Thu, 2 Apr 2026 17:32:56 +0200 Subject: [PATCH 155/282] [PWGHF] add more PID infos into the derived table of Cd (#15629) --- PWGHF/D2H/Tasks/taskCd.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index 665e640a87b..fbe561566fd 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -75,6 +75,7 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Decay length in transverse plane (cm) DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle (3D) DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine of pointing angle in XY plane +DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); //! chi2PCA DECLARE_SOA_COLUMN(NSigmaTpcDe, nSigmaTpcDe, float); //! TPC nσ for deuteron hypothesis DECLARE_SOA_COLUMN(NSigmaTpcKa, nSigmaTpcKa, float); //! TPC nσ for kaon hypothesis DECLARE_SOA_COLUMN(NSigmaTpcPi, nSigmaTpcPi, float); //! TPC nσ for pion hypothesis @@ -85,7 +86,9 @@ DECLARE_SOA_COLUMN(NSigmaTofPi, nSigmaTofPi, float); //! TOF nσ for DECLARE_SOA_COLUMN(NItsClusters, nItsClusters, int8_t); //! Number of ITS clusters used in the track fit DECLARE_SOA_COLUMN(NItsNClusterSize, nItsNClusterSize, int8_t); //! Number of ITS clusters size used in the track fit DECLARE_SOA_COLUMN(NTpcClusters, nTpcClusters, int8_t); //! Number of TPC clusters used in the track fit -DECLARE_SOA_COLUMN(NTpcSignalsDe, nTpcSignalsDe, int8_t); //! Number of TPC signas +DECLARE_SOA_COLUMN(NTpcSignalsDe, nTpcSignalsDe, int8_t); //! Number of TPC signas for deuteron +DECLARE_SOA_COLUMN(NTpcSignalsPi, nTpcSignalsPi, int8_t); //! Number of TPC signas for pion +DECLARE_SOA_COLUMN(NTpcSignalsKa, nTpcSignalsKa, int8_t); //! Number of TPC signas for kaon DECLARE_SOA_COLUMN(NItsSignalsDe, nItsSignalsDe, int8_t); //! Number of ITS signas DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! Candidates falg DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality @@ -105,6 +108,7 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::ImpactParameter2, full::DecayLength, full::Cpa, + full::Chi2PCA, full::NSigmaTpcDe, full::NSigmaItsDe, full::NSigmaTofDe, @@ -112,6 +116,8 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::NItsNClusterSize, full::NTpcClusters, full::NTpcSignalsDe, + full::NTpcSignalsPi, + full::NTpcSignalsKa, full::NItsSignalsDe, full::CandidateSelFlag, full::Cent, @@ -214,6 +220,8 @@ struct HfTaskCd { registry.add("Data/hNsigmaTOFDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{TOF}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hNsigmaITSDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{ITS}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hTPCSignalDeVsP", "deuteron;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); + registry.add("Data/hTPCSignalPiVsP", "Pion;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); + registry.add("Data/hTPCSignalKaVsP", "Kaon;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); registry.add("Data/hITSSignalDeVsP", "deuteron;#it{p} (GeV/#it{c}); ITS signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {20, 0, 20}}}); registry.add("Data/hNsigmaTPCPiVsP", "Pion;#it{p} (GeV/#it{c});n#sigma^{TPC}_{pi};", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hNsigmaTOFPiVsP", "Pion;#it{p} (GeV/#it{c});n#sigma^{TOF}_{pi};", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); @@ -353,6 +361,9 @@ struct HfTaskCd { int tpcNClusterDe = 0; float tpcSignalsDe = 0.f; + float tpcSignalsPi = 0.f; + float tpcSignalsKa = 0.f; + float itsSignalsDe = 0.f; float pSignedDe = -999.f; @@ -371,6 +382,8 @@ struct HfTaskCd { auto prong0Its = tracksWithItsPid.iteratorAt(candidate.prong0Id() - tracksWithItsPid.offset()); auto prong2Its = tracksWithItsPid.iteratorAt(candidate.prong2Id() - tracksWithItsPid.offset()); + tpcSignalsKa = prong1.tpcSignal(); + if (selDeKPi) { candFlag = 1; pSignedDe = prong0.p() * prong0.sign(); @@ -384,6 +397,7 @@ struct HfTaskCd { itsNClusterSizeDe = prong0.itsClusterSizes(); tpcNClusterDe = prong0.tpcNClsCrossedRows(); tpcSignalsDe = prong0.tpcSignal(); + tpcSignalsPi = prong2.tpcSignal(); itsSignalsDe = itsSignal(prong0); } else if (selPiKDe) { candFlag = -1; @@ -398,6 +412,7 @@ struct HfTaskCd { itsNClusterSizeDe = prong2.itsClusterSizes(); tpcNClusterDe = prong2.tpcNClsCrossedRows(); tpcSignalsDe = prong2.tpcSignal(); + tpcSignalsPi = prong0.tpcSignal(); itsSignalsDe = itsSignal(prong2); } @@ -406,6 +421,8 @@ struct HfTaskCd { registry.fill(HIST("Data/hNsigmaTOFDeVsP"), pSignedDe, nSigmaTofDe); registry.fill(HIST("Data/hNsigmaITSDeVsP"), pSignedDe, nSigmaItsDe); registry.fill(HIST("Data/hTPCSignalDeVsP"), pSignedDe, tpcSignalsDe); + registry.fill(HIST("Data/hTPCSignalPiVsP"), pSignedPi, tpcSignalsPi); + registry.fill(HIST("Data/hTPCSignalKaVsP"), prong1.p() * prong1.sign(), tpcSignalsKa); registry.fill(HIST("Data/hITSSignalDeVsP"), pSignedDe, itsSignalsDe); registry.fill(HIST("Data/hNsigmaTPCPiVsP"), pSignedPi, nSigmaTpcPi); registry.fill(HIST("Data/hNsigmaTOFPiVsP"), pSignedPi, nSigmaTofPi); @@ -423,6 +440,7 @@ struct HfTaskCd { candidate.impactParameter2(), decayLength, cpa, + chi2PCA, nSigmaTpcDe, nSigmaItsDe, nSigmaTofDe, @@ -430,6 +448,8 @@ struct HfTaskCd { itsNClusterSizeDe, tpcNClusterDe, tpcSignalsDe, + tpcSignalsPi, + tpcSignalsKa, itsSignalsDe, candFlag, cent, From 866046c0b7fd1485b63a021f89bc6589126694d7 Mon Sep 17 00:00:00 2001 From: Stefanie Mrozinski <63045530+Steffimro@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:36:10 +0200 Subject: [PATCH 156/282] [PWGEM] Add new photon pair diagnostic plots + clean up of QA plots (#15627) --- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 1041 +++++++++++++++---------- 1 file changed, 648 insertions(+), 393 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 36fc0d98ca9..43a37569823 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -120,7 +121,11 @@ enum class PairTruthType : uint8_t { Pi0Daughters, }; -struct photonhbt { +static constexpr float kMinMagnitude = 1e-12f; +static constexpr float kMinCosine = 1e-12f; +static constexpr float kMinSigma = 1e-9; + +struct Photonhbt { template static inline V0Combo classifyV0Combo(TGamma const& g) @@ -213,20 +218,52 @@ struct photonhbt { "most combinatorics while covering well beyond the CF range for systematics."}; } qaflags; - Configurable cfgDo3D{"cfgDo3D", false, "enable 3D (qout,qside,qlong) analysis"}; - Configurable cfgDo2D{"cfgDo2D", false, "enable 2D (qout,qinv) projection (requires cfgDo3D)"}; - Configurable cfgUseLCMS{"cfgUseLCMS", true, "measure 1D relative momentum in LCMS"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - Configurable cfgMCMaxQinv{"cfgMCMaxQinv", 0.3f, - "max q_{inv}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; - Configurable cfgMCMinKt{"cfgMCMinKt", 0.0f, - "min k_{T}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; - Configurable cfgMCMaxKt{"cfgMCMaxKt", 0.7f, - "max k_{T}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + // ─── HBT analysis mode ─────────────────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "hbtanalysis_group"; + Configurable cfgDo3D{"cfgDo3D", false, "enable 3D (qout,qside,qlong) analysis"}; + Configurable cfgDo2D{"cfgDo2D", false, "enable 2D (qout,qinv) projection (requires cfgDo3D)"}; + Configurable cfgUseLCMS{"cfgUseLCMS", false, "measure 1D relative momentum in LCMS"}; + } hbtanalysis; + + // ─── Event mixing ───────────────────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "mixing_group"; + Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; + Configurable ndepth{"ndepth", 100, "depth for event mixing"}; + Configurable ndiffBCMix{"ndiffBCMix", 594, "difference in global BC required for mixed events"}; + Configurable cfgEP2EstimatorForMix{"cfgEP2EstimatorForMix", 3, "FT0M:0, FT0A:1, FT0C:2, FV0A:3, BTot:4, BPos:5, BNeg:6"}; + Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.f, -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.f, 5.f, 10.f, 20.f, 30.f, 40.f, 50.f, 60.f, 70.f, 80.f, 90.f, 100.f, 999.f}, "Mixing bins - centrality"}; + ConfigurableAxis confEPBinsBins{"confEPBinsBins", {16, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}, "Mixing bins - EP angle"}; + ConfigurableAxis confOccupancyBins{"confOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + } mixing; + + // ─── Centrality slection ───────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "centralitySelection_group"; + Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + } centralitySelection; + struct : ConfigurableGroup { - std::string prefix = "mctruth_sparse_group"; + std::string prefix = "mctruth_group"; + Configurable cfgMCMaxQinv{"cfgMCMaxQinv", 0.3f, "..."}; + Configurable cfgMCMinKt{"cfgMCMinKt", 0.0f, "..."}; + Configurable cfgMCMaxKt{"cfgMCMaxKt", 0.7f, "..."}; + Configurable cfgDoTruthMix{"cfgDoTruthMix", false, "..."}; + Configurable cfgTruthMixDepth{"cfgTruthMixDepth", 10, "..."}; + Configurable cfgMCMinV0Pt{"cfgMCMinV0Pt", 0.1f, + "min pT for true photons in truth-efficiency loop (GeV/c); " + "0 = fall back to pcmcuts.cfgMinPtV0"}; + Configurable cfgMCMinLegPt{"cfgMCMinLegPt", 0.0f, "min pT for true e^{+}/e^{-} legs in truth-efficiency loop (GeV/c);"}; + } mctruth; + + struct : ConfigurableGroup { + std::string prefix = "mctruthSparse_group"; Configurable cfgFillDEtaDPhiVsQinvTrueTrueDistinct{"cfgFillDEtaDPhiVsQinvTrueTrueDistinct", true, "fill hDEtaDPhiVsQinv for TrueTrueDistinct pairs"}; Configurable cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton{"cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton", false, "fill hDEtaDPhiVsQinv for TrueTrueSamePhoton pairs"}; Configurable cfgFillDEtaDPhiVsQinvSharedMcLeg{"cfgFillDEtaDPhiVsQinvSharedMcLeg", false, "fill hDEtaDPhiVsQinv for SharedMcLeg pairs"}; @@ -239,20 +276,7 @@ struct photonhbt { Configurable cfgFillDRDZQinvTrueFake{"cfgFillDRDZQinvTrueFake", false, "fill hSparseDeltaRDeltaZQinv for TrueFake pairs"}; Configurable cfgFillDRDZQinvFakeFake{"cfgFillDRDZQinvFakeFake", true, "fill hSparseDeltaRDeltaZQinv for FakeFake pairs"}; Configurable cfgFillDRDZQinvPi0Daughters{"cfgFillDRDZQinvPi0Daughters", false, "fill hSparseDeltaRDeltaZQinv for Pi0Daughters pairs"}; - } mcthruth_sparse; - Configurable maxY{"maxY", 0.9, "maximum rapidity"}; - - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; - Configurable ndepth{"ndepth", 100, "depth for event mixing"}; - Configurable ndiffBCMix{"ndiffBCMix", 594, "difference in global BC required for mixed events"}; - Configurable cfgEP2EstimatorForMix{"cfgEP2EstimatorForMix", 3, "FT0M:0, FT0A:1, FT0C:2, FV0A:3, BTot:4, BPos:5, BNeg:6"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.f, -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.f, 5.f, 10.f, 20.f, 30.f, 40.f, 50.f, 60.f, 70.f, 80.f, 90.f, 100.f, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}, "Mixing bins - EP angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + } mctruthSparse; struct : ConfigurableGroup { std::string prefix = "ggpaircut_group"; @@ -265,6 +289,7 @@ struct photonhbt { Configurable cfgEllipseSigEta{"cfgEllipseSigEta", 0.02f, "sigma_eta for ellipse cut"}; Configurable cfgEllipseSigPhi{"cfgEllipseSigPhi", 0.02f, "sigma_phi for ellipse cut"}; Configurable cfgEllipseR2{"cfgEllipseR2", 1.0f, "R^2 threshold: reject if ellipse value < R^2"}; + Configurable cfgMaxAsymmetry{"cfgMaxAsymmetry", -1.f, "max |p_{T, 1} - p_{T, 2}|/(p_{T, 1} + p_{T, 2}) asymmetry cut"}; } ggpaircuts; EMPhotonEventCut fEMEventCut; @@ -320,7 +345,7 @@ struct photonhbt { Configurable cfgMaxTPCNsigmaEl{"cfgMaxTPCNsigmaEl", +3.5, "max TPC nsigma electron"}; } pcmcuts; - ~photonhbt() + ~Photonhbt() { delete emh1; emh1 = nullptr; @@ -328,6 +353,7 @@ struct photonhbt { emh2 = nullptr; mapMixedEventIdToGlobalBC.clear(); usedPhotonIdsPerCol.clear(); + truthGammaPool.clear(); } HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -351,7 +377,7 @@ struct photonhbt { return false; const float sE = ggpaircuts.cfgEllipseSigEta.value; const float sP = ggpaircuts.cfgEllipseSigPhi.value; - if (sE < 1e-9f || sP < 1e-9f) + if (sE < kMinSigma || sP < kMinSigma) return false; return (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP) < ggpaircuts.cfgEllipseR2.value; } @@ -365,6 +391,19 @@ struct photonhbt { return true; } + inline bool passAsymmetryCut(float pt1, float pt2) const + { + if (ggpaircuts.cfgMaxAsymmetry.value < 0.f) { + return true; + } + + const float sum = pt1 + pt2; + if (sum < kMinSigma) { + return false; + } + return std::fabs(pt1 - pt2) / sum < ggpaircuts.cfgMaxAsymmetry.value; + } + inline bool passQinvQAGate(float qinv) const { const float limit = qaflags.cfgMaxQinvForQA.value; @@ -392,7 +431,7 @@ struct photonhbt { ROOT::Math::PxPyPzEVector p1cm = boost(p1); ROOT::Math::XYZVector pairDir(pair.Px(), pair.Py(), pair.Pz()); ROOT::Math::XYZVector p1cmDir(p1cm.Px(), p1cm.Py(), p1cm.Pz()); - if (pairDir.R() < 1e-9 || p1cmDir.R() < 1e-9) + if (pairDir.R() < kMinSigma || p1cmDir.R() < kMinSigma) return -1.f; return static_cast(pairDir.Unit().Dot(p1cmDir.Unit())); } @@ -419,7 +458,7 @@ struct photonhbt { const int b = static_cast( std::lower_bound(edges.begin(), edges.end(), val) - edges.begin()) - 1; - return clampBin(b, static_cast(edges.size()) - 2); + return clampBin(b, static_cast(edges.size()) - 2); // } template @@ -430,7 +469,7 @@ struct photonhbt { return "Pair/same/QA/Before/"; if constexpr (step_id == 1) return "Pair/same/QA/AfterDRCosOA/"; - if constexpr (step_id == 2) + if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) return "Pair/same/QA/AfterRZ/"; return "Pair/same/QA/AfterEllipse/"; } else { @@ -438,7 +477,7 @@ struct photonhbt { return "Pair/mix/QA/Before/"; if constexpr (step_id == 1) return "Pair/mix/QA/AfterDRCosOA/"; - if constexpr (step_id == 2) + if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) return "Pair/mix/QA/AfterRZ/"; return "Pair/mix/QA/AfterEllipse/"; } @@ -455,12 +494,12 @@ struct photonhbt { void init(InitContext& /*context*/) { mRunNumber = 0; - parseBins(ConfVtxBins, ztxBinEdges); - parseBins(ConfCentBins, centBinEdges); - parseBins(ConfEPBins, epBinEgdes); - parseBins(ConfOccupancyBins, occBinEdges); - emh1 = new MyEMH(ndepth); - emh2 = new MyEMH(ndepth); + parseBins(mixing.confVtxBins, ztxBinEdges); + parseBins(mixing.confCentBins, centBinEdges); + parseBins(mixing.confEPBinsBins, epBinEgdes); + parseBins(mixing.confOccupancyBins, occBinEdges); + emh1 = new MyEMH(mixing.ndepth); + emh2 = new MyEMH(mixing.ndepth); o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); DefineEMEventCut(); DefinePCMCut(); @@ -500,15 +539,22 @@ struct photonhbt { bool valid = true; }; + struct TruthGamma { + int id = -1, posId = -1, negId = -1; + float eta = 0.f, phi = 0.f, pt = 0.f; + float rTrue = -1.f; + float legDRtrue = -1.f; + float legDEta = 0.f; // ← neu + float legDPhi = 0.f; // ← neu + float alphaTrue = 0.f; + }; + + std::map, std::deque>> truthGammaPool; + void addSinglePhotonQAHistogramsForStep(const std::string& path) { - fRegistryPairQA.add((path + "hPt").c_str(), "p_{T};p_{T} (GeV/c);counts", kTH1D, {axisPt}, true); - fRegistryPairQA.add((path + "hEta").c_str(), "#eta;#eta;counts", kTH1D, {axisEta}, true); - fRegistryPairQA.add((path + "hPhi").c_str(), "#phi;#phi (rad);counts", kTH1D, {axisPhi}, true); - fRegistryPairQA.add((path + "hEtaVsPhi").c_str(), "acceptance;#phi (rad);#eta", kTH2D, {axisPhi, axisEta}, true); - fRegistryPairQA.add((path + "hR").c_str(), "R_{conv};R_{conv} (cm);counts", kTH1D, {axisR}, true); - fRegistryPairQA.add((path + "hZConv").c_str(), "z_{conv};z_{conv} (cm);counts", kTH1D, {axisZConv}, true); - fRegistryPairQA.add((path + "hRVsZConv").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH2D, {axisZConv, axisR}, true); + fRegistryPairQA.add((path + "hEtaVsPhiPt").c_str(), "acceptance;#phi (rad);#eta", kTH3D, {axisPhi, axisEta, axisPt}, true); + fRegistryPairQA.add((path + "hRVsZConvPt").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH3D, {axisZConv, axisR, axisPt}, true); } void addFullRangeHistograms(const std::string& path) @@ -540,39 +586,31 @@ struct photonhbt { constexpr auto base = fullRangePrefix(); fRegistry.fill(HIST(base) + HIST("hDeltaRCosOAVsQinv"), qinv, drOverCosOA); } - void addQAHistogramsForStep(const std::string& path) { - fRegistryPairQA.add((path + "hPairEta").c_str(), "pair #eta;#eta_{pair};counts", kTH1D, {axisEta}, true); - fRegistryPairQA.add((path + "hPairPhi").c_str(), "pair #phi;#phi_{pair} (rad);counts", kTH1D, {axisPhi}, true); - fRegistryPairQA.add((path + "hPairKt").c_str(), "pair k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistryPairQA.add((path + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); - fRegistryPairQA.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); - fRegistryPairQA.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); - fRegistryPairQA.add((path + "hCosTheta").c_str(), "cos(#theta*);cos(#theta*);counts", kTH1D, {axisCosTheta}, true); - fRegistryPairQA.add((path + "hOpeningAngle").c_str(), "Opening angle;#alpha (rad);counts", kTH1D, {axisOpeningAngle}, true); + // Ellipse fRegistryPairQA.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma)^{2}+(#Delta#phi/#sigma)^{2};value;counts", kTH1D, {axisEllipseVal}, true); - fRegistryPairQA.add((path + "hR1").c_str(), "R_{conv,1};R_{1} (cm);counts", kTH1D, {axisR}, true); - fRegistryPairQA.add((path + "hR2").c_str(), "R_{conv,2};R_{2} (cm);counts", kTH1D, {axisR}, true); - fRegistryPairQA.add((path + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); - fRegistryPairQA.add((path + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); - fRegistryPairQA.add((path + "hDeltaRxy").c_str(), "#Delta r_{xy};#Delta r_{xy} (cm);counts", kTH1D, {axisDeltaRxy}, true); - fRegistryPairQA.add((path + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); - fRegistryPairQA.add((path + "hCent").c_str(), "centrality;centrality (%);counts", kTH1D, {axisCentQA}, true); - fRegistryPairQA.add((path + "hOccupancy").c_str(), "occupancy;occupancy;counts", kTH1D, {axisOccupancy}, true); - fRegistryPairQA.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistryPairQA.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2D, {axisEta, axisDeltaEta}, true); + + // Conversion point fRegistryPairQA.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); - fRegistryPairQA.add((path + "hDeltaRVsDeltaZ").c_str(), "|R_{1}-R_{2}| vs #Delta z;|R_{1}-R_{2}| (cm);#Delta z (cm)", kTH2D, {axisDeltaR, axisDeltaZ}, true); - fRegistryPairQA.add((path + "hDeltaRVsKt").c_str(), "|R_{1}-R_{2}| vs k_{T};k_{T} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisKt, axisDeltaR}, true); - fRegistryPairQA.add((path + "hDeltaZVsKt").c_str(), "#Delta z vs k_{T};k_{T} (GeV/c);#Delta z (cm)", kTH2D, {axisKt, axisDeltaZ}, true); - fRegistryPairQA.add((path + "hDeltaPhiVsDeltaR").c_str(), "#Delta#phi vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#phi (rad)", kTH2D, {axisDeltaR, axisDeltaPhi}, true); - fRegistryPairQA.add((path + "hDeltaEtaVsDeltaR").c_str(), "#Delta#eta vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#eta", kTH2D, {axisDeltaR, axisDeltaEta}, true); - fRegistryPairQA.add((path + "hDeltaPhiVsDeltaZ").c_str(), "#Delta#phi vs #Delta z;#Delta z (cm);#Delta#phi (rad)", kTH2D, {axisDeltaZ, axisDeltaPhi}, true); - fRegistryPairQA.add((path + "hDeltaEtaVsDeltaZ").c_str(), "#Delta#eta vs #Delta z;#Delta z (cm);#Delta#eta", kTH2D, {axisDeltaZ, axisDeltaEta}, true); - fRegistryPairQA.add((path + "hDeltaRVsCent").c_str(), "|R_{1}-R_{2}| vs centrality;centrality (%);|R_{1}-R_{2}| (cm)", kTH2D, {axisCentQA, axisDeltaR}, true); - fRegistryPairQA.add((path + "hDeltaRVsOccupancy").c_str(), "|R_{1}-R_{2}| vs occupancy;occupancy;|R_{1}-R_{2}| (cm)", kTH2D, {axisOccupancy, axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaRxyKt").c_str(), "#Delta r_{xy} vs k_{T};#Delta r_{xy} (cm);k_{T} (GeV/c)", kTH2D, {axisDeltaRxy, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaR3DKt").c_str(), "#Delta r_{3D} vs k_{T};#Delta r_{3D} (cm);k_{T} (GeV/c)", kTH2D, {axisDeltaR3D, axisKt}, true); + + // Delta Eta QA + fRegistryPairQA.add((path + "hDeltaEtaDeltaRKt").c_str(), "#Delta#eta,|R_{1}-R_{2}|,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaR, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaEtaDeltaZKt").c_str(), "#Delta#eta,#Delta z,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaZ, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaEtaEtaKt").c_str(), "#Delta#eta,#eta_{pair},k_{T}", kTHnSparseD, {axisDeltaEta, axisEta, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaEtaPhiKt").c_str(), "#Delta#eta,#phi_{pair},k_{T}", kTHnSparseD, {axisDeltaEta, axisPhi, axisKt}, true); + + // Delta Phi QA fRegistryPairQA.add((path + "hSparseDEtaDPhiKt").c_str(), "#Delta#eta,#Delta#phi,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiDeltaRKt").c_str(), "#Delta#phi,|R_{1}-R_{2}|,k_{T}", kTHnSparseD, {axisDeltaPhi, axisDeltaR, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiDeltaZKt").c_str(), "#Delta#phi,#Delta z,k_{T}", kTHnSparseD, {axisDeltaPhi, axisDeltaZ, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiPhiKt").c_str(), "#Delta#phi,#phi_{pair},k_{T}", kTHnSparseD, {axisDeltaPhi, axisPhi, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiEtaKt").c_str(), "#Delta#phi,#eta_{pair},k_{T}", kTHnSparseD, {axisDeltaPhi, axisEta, axisKt}, true); + + // Delta Eta Delta Phi Diagnostics + fRegistryPairQA.add((path + "hPhiVsEtaKt").c_str(), "#phi_{pair},#eta_{pair},k_{T}", kTHnSparseD, {axisPhi, axisEta, axisKt}, true); fRegistryPairQA.add((path + "hSparseDeltaRDeltaZKt").c_str(), "|R_{1}-R_{2}|,#Delta z,k_{T}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); } @@ -580,10 +618,10 @@ struct photonhbt { { static constexpr std::string_view det[6] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg"}; fRegistry.add("Event/before/hEP2_CentFT0C_forMix", - Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), + Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[mixing.cfgEP2EstimatorForMix].data()), kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); fRegistry.add("Event/after/hEP2_CentFT0C_forMix", - Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), + Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[mixing.cfgEP2EstimatorForMix].data()), kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); addSinglePhotonQAHistogramsForStep("SinglePhoton/Before/"); @@ -591,20 +629,25 @@ struct photonhbt { addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterRZ/"); addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterEllipse/"); - if (cfgDo3D) { + if (hbtanalysis.cfgDo3D) { fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) + if (hbtanalysis.cfgDo2D) fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) + if (hbtanalysis.cfgUseLCMS) fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); else fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); } - fRegistry.add("Pair/same/hDeltaRCosOA", - "distance between 2 conversion points / cos(#theta_{op}/2);#Delta r / cos(#theta_{op}/2) (cm);counts", - kTH1D, {{100, 0, 100}}, true); + fRegistry.add("Pair/same/hDeltaRCosOA", "distance between 2 conversion points / cos(#theta_{op}/2);#Delta r / cos(#theta_{op}/2) (cm);counts", kTH1D, {{100, 0, 100}}, true); + fRegistry.add("Pair/same/hSparse_DEtaDPhi_kT", + "same-event (#Delta#eta,#Delta#phi,q_{inv},k_{T}) for efficiency reweighting;" + "#Delta#eta;#Delta#phi (rad);q_{inv} (GeV/c);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + + fRegistry.add("Pair/same/hPhi_lowerPtV0", "azimuthal angle of lower-p_{T} V0 in pair;#phi (rad);counts", kTH1D, {axisPhi}, true); + fRegistry.add("Pair/same/hSparse_DEtaDPhi_qinv_kT", "azimuthal angle of lower-p_{T} V0 in pair;#phi (rad);counts", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisQinv, axisKt}, true); addQAHistogramsForStep("Pair/same/QA/Before/"); addQAHistogramsForStep("Pair/same/QA/AfterDRCosOA/"); @@ -616,6 +659,23 @@ struct photonhbt { fRegistryPairMC.addClone("Pair/same/MC/", "Pair/mix/MC/"); addFullRangeHistograms("Pair/same/FullRange/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); + + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_sameSideLegs", + "both V0 same #eta-side, all legs same side;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_mixedLegs", + "both V0 same #eta-side, legs mixed sides;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_matchingLegs", + "V0 on opposite #eta-sides, legs match their V0 side;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_crossedLegs", + "V0 on opposite #eta-sides, legs cross their V0 side;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); } void DefineEMEventCut() @@ -673,7 +733,7 @@ struct photonhbt { return "SinglePhoton/Before/"; if constexpr (step_id == 1) return "SinglePhoton/AfterDRCosOA/"; - if constexpr (step_id == 2) + if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) return "SinglePhoton/AfterRZ/"; return "SinglePhoton/AfterEllipse/"; } @@ -685,13 +745,8 @@ struct photonhbt { return; constexpr auto base = singlePhotonQAPrefix(); const float r = std::sqrt(g.vx() * g.vx() + g.vy() * g.vy()); - fRegistryPairQA.fill(HIST(base) + HIST("hPt"), g.pt()); - fRegistryPairQA.fill(HIST(base) + HIST("hEta"), g.eta()); - fRegistryPairQA.fill(HIST(base) + HIST("hPhi"), g.phi()); - fRegistryPairQA.fill(HIST(base) + HIST("hEtaVsPhi"), g.phi(), g.eta()); - fRegistryPairQA.fill(HIST(base) + HIST("hR"), r); - fRegistryPairQA.fill(HIST(base) + HIST("hZConv"), g.vz()); - fRegistryPairQA.fill(HIST(base) + HIST("hRVsZConv"), g.vz(), r); + fRegistryPairQA.fill(HIST(base) + HIST("hEtaVsPhiPt"), g.phi(), g.eta(), g.pt()); + fRegistryPairQA.fill(HIST(base) + HIST("hRVsZConvPt"), g.vz(), r, g.pt()); } template @@ -716,15 +771,23 @@ struct photonhbt { float qout_lcms = q3_lcms.Dot(uv_out); float qside_lcms = q3_lcms.Dot(uv_side); float qlong_lcms = q3_lcms.Dot(uv_long); - if (cfgDo3D) { + if (hbtanalysis.cfgDo3D) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_3D"), std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); - if (cfgDo2D) + if (hbtanalysis.cfgDo2D) fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt, weight); } else { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_1D"), - cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + } + float deta_pair = v1.Eta() - v2.Eta(); + float dphi_pair = v1.Phi() - v2.Phi(); + dphi_pair = RecoDecay::constrainAngle(dphi_pair, -o2::constants::math::PI); + if constexpr (ev_id == 0) { + fRegistry.fill(HIST("Pair/same/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); + } else { + fRegistry.fill(HIST("Pair/mix/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); } } @@ -777,13 +840,21 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - if (cfgDo3D) { + if (hbtanalysis.cfgDo3D) { fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_3D"), std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); - if (cfgDo2D) + if (hbtanalysis.cfgDo2D) fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt, weight); } else { - fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_1D"), hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + } + float deta_pair = v1.Eta() - v2.Eta(); + float dphi_pair = v1.Phi() - v2.Phi(); + dphi_pair = RecoDecay::constrainAngle(dphi_pair, -o2::constants::math::PI); + if constexpr (ev_id == 0) { + fRegistry.fill(HIST("Pair/same/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); + } else { + fRegistry.fill(HIST("Pair/mix/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); } } @@ -808,7 +879,7 @@ struct photonhbt { o.deltaR3D = std::sqrt(o.dx * o.dx + o.dy * o.dy + o.dz * o.dz); ROOT::Math::XYZVector cp1(o.x1, o.y1, o.z1), cp2(o.x2, o.y2, o.z2); const float mag1 = std::sqrt(cp1.Mag2()), mag2 = std::sqrt(cp2.Mag2()); - if (mag1 < 1e-12f || mag2 < 1e-12f) { + if (mag1 < kMinMagnitude || mag2 < kMinMagnitude) { o.valid = false; return o; } @@ -819,7 +890,7 @@ struct photonhbt { if (o.opa > o2::constants::math::PI) o.opa -= o2::constants::math::PI; o.cosOA = std::cos(o.opa / 2.f); - o.drOverCosOA = (std::fabs(o.cosOA) < 1e-12f) ? 1e12f : (o.deltaR3D / o.cosOA); + o.drOverCosOA = (std::fabs(o.cosOA) < kMinCosine) ? 1e12f : (o.deltaR3D / o.cosOA); o.v1 = ROOT::Math::PtEtaPhiMVector(g1.pt(), g1.eta(), g1.phi(), 0.f); o.v2 = ROOT::Math::PtEtaPhiMVector(g2.pt(), g2.eta(), g2.phi(), 0.f); o.k12 = 0.5f * (o.v1 + o.v2); @@ -835,44 +906,41 @@ struct photonhbt { } template - inline void fillPairQAStep(PairQAObservables const& o, float cent, float occupancy) + inline void fillPairQAStep(PairQAObservables const& o, float /*cent*/, float /*occupancy*/) { if (!qaflags.doPairQa) return; constexpr auto base = qaPrefix(); - fRegistryPairQA.fill(HIST(base) + HIST("hPairEta"), o.pairEta); - fRegistryPairQA.fill(HIST(base) + HIST("hPairPhi"), o.pairPhi); - fRegistryPairQA.fill(HIST(base) + HIST("hPairKt"), o.kt); - fRegistryPairQA.fill(HIST(base) + HIST("hQinv"), o.qinv); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEta"), o.deta); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhi"), o.dphi); - fRegistryPairQA.fill(HIST(base) + HIST("hCosTheta"), o.cosTheta); - fRegistryPairQA.fill(HIST(base) + HIST("hOpeningAngle"), o.openingAngle); - fRegistryPairQA.fill(HIST(base) + HIST("hR1"), o.r1); - fRegistryPairQA.fill(HIST(base) + HIST("hR2"), o.r2); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR"), o.deltaR); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaZ"), o.deltaZ); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRxy"), o.deltaRxy); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR3D"), o.deltaR3D); - fRegistryPairQA.fill(HIST(base) + HIST("hCent"), cent); - fRegistryPairQA.fill(HIST(base) + HIST("hOccupancy"), occupancy); - const float sE = ggpaircuts.cfgEllipseSigEta.value, sP = ggpaircuts.cfgEllipseSigPhi.value; - if (sE > 1e-9f && sP > 1e-9f) - fRegistryPairQA.fill(HIST(base) + HIST("hEllipseVal"), (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP)); - fRegistryPairQA.fill(HIST(base) + HIST("hDEtaDPhi"), o.deta, o.dphi); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsPairEta"), o.pairEta, o.deta); - fRegistryPairQA.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsDeltaZ"), o.deltaR, o.deltaZ); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsKt"), o.kt, o.deltaR); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaZVsKt"), o.kt, o.deltaZ); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiVsDeltaR"), o.deltaR, o.dphi); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsDeltaR"), o.deltaR, o.deta); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiVsDeltaZ"), o.deltaZ, o.dphi); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsDeltaZ"), o.deltaZ, o.deta); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsCent"), cent, o.deltaR); - fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsOccupancy"), occupancy, o.deltaR); + + ///// Delta Eta QA + + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaDeltaRKt"), o.deta, o.deltaR, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaEtaKt"), o.deta, o.pairEta, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaPhiKt"), o.deta, o.pairPhi, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaDeltaZKt"), o.deta, o.deltaZ, o.kt); + + ///// Delta Phi QA + + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiDeltaRKt"), o.dphi, o.deltaR, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiDeltaZKt"), o.dphi, o.deltaZ, o.kt); fRegistryPairQA.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiPhiKt"), o.dphi, o.pairPhi, o.kt); + + // Delta Eta Dleta Phi Stuff + + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiEtaKt"), o.dphi, o.pairEta, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hPhiVsEtaKt"), o.pairPhi, o.pairEta, o.kt); + + //// Delta R (Conversion point) QA + + fRegistryPairQA.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); fRegistryPairQA.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRxyKt"), o.deltaRxy, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR3DKt"), o.deltaR3D, o.kt); + + const float sE = ggpaircuts.cfgEllipseSigEta.value, sP = ggpaircuts.cfgEllipseSigPhi.value; + if (sE > kMinSigma && sP > kMinSigma) + fRegistryPairQA.fill(HIST(base) + HIST("hEllipseVal"), (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP)); } template @@ -897,7 +965,7 @@ struct photonhbt { info.motherId = mothIdPos; const auto mother = mcParticles.iteratorAt(mothIdPos); info.motherPdg = mother.pdgCode(); - info.isTruePhoton = (info.motherPdg == 22); + info.isTruePhoton = (info.motherPdg == kGamma); info.isPhysicalPrimary = mother.isPhysicalPrimary(); return info; } @@ -920,6 +988,56 @@ struct photonhbt { return PairTruthType::TrueTrueDistinct; } + enum class EtaTopology : uint8_t { + SameSideV0SameSideLegs = 0, ///< both V0 eta same sign; all 4 legs same sign + SameSideV0MixedLegs = 1, ///< both V0 eta same sign; legs not all on that sign + DiffSideV0MatchingLegs = 2, ///< V0s on opposite sides; each V0's legs match its own side + DiffSideV0CrossedLegs = 3, ///< V0s on opposite sides; legs do NOT match their V0's side + }; + + /// Classify the eta-side topology of a photon pair from the 6 raw eta values. + static EtaTopology classifyEtaTopology(float v1eta, float v2eta, + float pos1eta, float neg1eta, + float pos2eta, float neg2eta) + { + const bool v1pos = v1eta >= 0.f; + const bool v2pos = v2eta >= 0.f; + if (v1pos == v2pos) { // same-side V0s + const bool allSame = + ((pos1eta >= 0.f) == v1pos) && ((neg1eta >= 0.f) == v1pos) && + ((pos2eta >= 0.f) == v1pos) && ((neg2eta >= 0.f) == v1pos); + return allSame ? EtaTopology::SameSideV0SameSideLegs + : EtaTopology::SameSideV0MixedLegs; + } + // different-side V0s + const bool v1match = ((pos1eta >= 0.f) == v1pos) && ((neg1eta >= 0.f) == v1pos); + const bool v2match = ((pos2eta >= 0.f) == v2pos) && ((neg2eta >= 0.f) == v2pos); + return (v1match && v2match) ? EtaTopology::DiffSideV0MatchingLegs + : EtaTopology::DiffSideV0CrossedLegs; + } + + inline void fillEtaTopologyHisto(EtaTopology topo, float deta, float dphi, float kt) + { + switch (topo) { + case EtaTopology::SameSideV0SameSideLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_sameSideLegs"), + deta, dphi, kt); + break; + case EtaTopology::SameSideV0MixedLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_mixedLegs"), + deta, dphi, kt); + break; + case EtaTopology::DiffSideV0MatchingLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_matchingLegs"), + deta, dphi, kt); + break; + case EtaTopology::DiffSideV0CrossedLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_crossedLegs"), + deta, dphi, kt); + break; + } + } + template static bool isPi0DaughterPair(PhotonMCInfo const& m1, PhotonMCInfo const& m2, TMCParticles const& mcParticles) @@ -933,7 +1051,7 @@ struct photonhbt { const int gm1 = ph1.mothersIds()[0], gm2 = ph2.mothersIds()[0]; if (gm1 != gm2) return false; - return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == 111); + return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == kPi0); } static constexpr std::string_view pairTruthLabel(PairTruthType t) @@ -955,244 +1073,229 @@ struct photonhbt { return "Unknown/"; } } - void addMCHistograms() { const AxisSpec axisTruthType{{0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, - "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg,4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; + "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg," + "4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; const AxisSpec axisDeltaEtaMC{90, -1.6f, +1.6f, "#Delta#eta"}; const AxisSpec axisDeltaPhiMC{90, -o2::constants::math::PI, +o2::constants::math::PI, "#Delta#phi (rad)"}; + const AxisSpec axQinvMC{60, 0.f, 0.3f, "q_{inv}^{true} (GeV/c)"}; + const AxisSpec axRconv{180, 0.f, 90.f, "R_{conv}^{true} (cm)"}; + const AxisSpec axAlpha{100, -1.f, 1.f, "#alpha^{true}"}; + const AxisSpec axLegDR{100, 0.f, 0.3f, "leg #Delta R^{true}"}; + + // fRegistryPairMC — reco-level pair histograms, per MC truth type + // Per-type CF + observables static constexpr std::array kTypes = { - "TrueTrueDistinct/", "TrueTrueSamePhoton/", "SharedMcLeg/", "TrueFake/", "FakeFake/", "Pi0Daughters/"}; + "TrueTrueDistinct/", "TrueTrueSamePhoton/", "SharedMcLeg/", + "TrueFake/", "FakeFake/", "Pi0Daughters/"}; for (const auto& label : kTypes) { const std::string base = std::string("Pair/same/MC/") + std::string(label); - if (cfgDo3D) { - fRegistryPairMC.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) - fRegistryPairMC.add((base + "CF_2D").c_str(), "MC CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + + // CF + if (hbtanalysis.cfgDo3D) { + fRegistryPairMC.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", + kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (hbtanalysis.cfgDo2D) + fRegistryPairMC.add((base + "CF_2D").c_str(), "MC CF 2D", + kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) - fRegistryPairMC.add((base + "CF_1D").c_str(), "MC CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); - else - fRegistryPairMC.add((base + "CF_1D").c_str(), "MC CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); + fRegistryPairMC.add((base + "CF_1D").c_str(), + hbtanalysis.cfgUseLCMS ? "MC CF 1D LCMS" : "MC CF 1D (qinv)", + kTH2D, {hbtanalysis.cfgUseLCMS ? axisQabsLcms : axisQinv, axisKt}, true); } + + // 1D observables fRegistryPairMC.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); - fRegistryPairMC.add((base + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); - fRegistryPairMC.add((base + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); - fRegistryPairMC.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); fRegistryPairMC.add((base + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); fRegistryPairMC.add((base + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); fRegistryPairMC.add((base + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); - fRegistryPairMC.add((base + "hKt").c_str(), "k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + + // 2D observables + fRegistryPairMC.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); fRegistryPairMC.add((base + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv}", kTH2D, {axisQinv, axisDeltaR}, true); fRegistryPairMC.add((base + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv}", kTH2D, {axisQinv, axisDeltaZ}, true); fRegistryPairMC.add((base + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv}", kTH2D, {axisQinv, axisDeltaR3D}, true); + // Sparse (conditional) + fRegistryPairMC.add((base + "hSparse_DEtaDPhi_kT").c_str(), + "#Delta#eta,#Delta#phi,k_{T};#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + const bool addDEtaDPhiVsQinv = - (label == "TrueTrueDistinct/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (label == "TrueTrueSamePhoton/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value - : (label == "SharedMcLeg/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value - : (label == "TrueFake/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueFake.value - : (label == "FakeFake/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvFakeFake.value - : mcthruth_sparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value; + (label == "TrueTrueDistinct/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value + : (label == "TrueTrueSamePhoton/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (label == "TrueFake/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (label == "FakeFake/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mctruthSparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value; if (addDEtaDPhiVsQinv) - fRegistryPairMC.add((base + "hDEtaDPhiVsQinv").c_str(), "#Delta#eta vs #Delta#phi vs q_{inv}", kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + fRegistryPairMC.add((base + "hDEtaDPhiVsQinv").c_str(), + "#Delta#eta vs #Delta#phi vs q_{inv}", kTHnSparseD, + {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + const bool addDRDZQinv = - (label == "TrueTrueDistinct/") ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueDistinct.value : (label == "TrueTrueSamePhoton/") ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueSamePhoton.value - : (label == "SharedMcLeg/") ? mcthruth_sparse.cfgFillDRDZQinvSharedMcLeg.value - : (label == "TrueFake/") ? mcthruth_sparse.cfgFillDRDZQinvTrueFake.value - : (label == "FakeFake/") ? mcthruth_sparse.cfgFillDRDZQinvFakeFake.value - : mcthruth_sparse.cfgFillDRDZQinvPi0Daughters.value; + (label == "TrueTrueDistinct/") ? mctruthSparse.cfgFillDRDZQinvTrueTrueDistinct.value + : (label == "TrueTrueSamePhoton/") ? mctruthSparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mctruthSparse.cfgFillDRDZQinvSharedMcLeg.value + : (label == "TrueFake/") ? mctruthSparse.cfgFillDRDZQinvTrueFake.value + : (label == "FakeFake/") ? mctruthSparse.cfgFillDRDZQinvFakeFake.value + : mctruthSparse.cfgFillDRDZQinvPi0Daughters.value; if (addDRDZQinv) - fRegistryPairMC.add((base + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); - fRegistryPairMC.add((base + "hSparse_DEtaDPhi_kT").c_str(), - "#Delta#eta vs #Delta#phi vs k_{T};#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", - kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + fRegistryPairMC.add((base + "hSparseDeltaRDeltaZQinv").c_str(), + "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, + {axisDeltaR, axisDeltaZ, axisQinv}, true); } - fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsQinv", "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); - fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsKt", "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); - if (cfgDo3D) { - fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_3D", "pairs with missing MC label — CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) - fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_2D", "pairs with missing MC label — CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); - } else { - if (cfgUseLCMS) - fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", "pairs with missing MC label — CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); - else - fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", "pairs with missing MC label — CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); - } - fRegistryPairMC.add("Pair/same/MC/NoLabel/hDEtaDPhi", - "pairs with missing MC label: #Delta#eta vs #Delta#phi;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", - kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistryPairMC.add("Pair/same/MC/NoLabel/hKt", "pairs with missing MC label: k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistryPairMC.add("Pair/same/MC/NoLabel/hQinv", "pairs with missing MC label: q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsQinv", + "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); + fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsKt", + "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_truePairs", - "reco pairs where both photons are true (TrueTrueDistinct+SamePhoton+Pi0);" + "true reco pairs (TrueTrueDistinct+SamePhoton+Pi0);" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_fakePairs", - "reco pairs with at least one fake photon (FakeFake+TrueFake+SharedMcLeg);" + "fake reco pairs (FakeFake+TrueFake+SharedMcLeg);" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_kT_truePairs", - "reco true pairs: #Delta#eta × #Delta#phi × k_{T};" + "true pairs: #Delta#eta,#Delta#phi,k_{T};" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); - fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_truePairs", - "reco true pairs: #Delta#eta × #Delta#phi × q_{inv};" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", - kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_kT_fakePairs", - "reco fake pairs: #Delta#eta × #Delta#phi × k_{T};" + "fake pairs: #Delta#eta,#Delta#phi,k_{T};" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_truePairs", + "true pairs: #Delta#eta,#Delta#phi,q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_fakePairs", - "reco fake pairs: #Delta#eta × #Delta#phi × q_{inv};" + "fake pairs: #Delta#eta,#Delta#phi,q_{inv};" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); - const AxisSpec axQinvMC{60, 0.f, 0.3f, "q_{inv}^{true} (GeV/c)"}; + // ─── Pairs with missing MC label ───────────────────────────────────────── + if (hbtanalysis.cfgDo3D) { + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_3D", + "missing MC label — CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (hbtanalysis.cfgDo2D) + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_2D", + "missing MC label — CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + } else { + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", + hbtanalysis.cfgUseLCMS ? "missing MC label — CF 1D LCMS" : "missing MC label — CF 1D (qinv)", + kTH2D, {hbtanalysis.cfgUseLCMS ? axisQabsLcms : axisQinv, axisKt}, true); + } + fRegistryPairMC.add("Pair/same/MC/NoLabel/hDEtaDPhi", + "missing MC label: #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hQinv", + "missing MC label: q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hKt", + "missing MC label: k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_truthConverted", - "true converted pairs, denominator;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_all4LegsThisColl", - "all 4 legs found — #Delta#eta #Delta#phi q_{inv};" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsBuilt", - "both V0s built — #Delta#eta × #Delta#phi × q_{inv};" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsSelected", - "both V0s pass cuts — numerator;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); - - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_truthConverted", - "true converted pairs — denominator;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_all4LegsThisColl", - "all 4 legs found — #Delta#eta × #Delta#phi × k_{T};" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsBuilt", - "both V0s built — #Delta#eta × #Delta#phi × k_{T};" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); - fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsSelected", - "both V0s pass cuts — numerator;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", - kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); - fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_truthConverted", - "true converted pairs: q_{inv}^{true} vs k_{T};" - "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", - kTH2D, {axisKt, axQinvMC}, true); - fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_all4LegsThisColl", - "all 4 legs found: q_{inv}^{true} vs k_{T};" - "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", - kTH2D, {axisKt, axQinvMC}, true); - fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_bothPhotonsBuilt", - "both V0s built: q_{inv}^{true} vs k_{T};" - "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", - kTH2D, {axisKt, axQinvMC}, true); - fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_bothPhotonsSelected", - "both V0s selected: q_{inv}^{true} vs k_{T};" - "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", - kTH2D, {axisKt, axQinvMC}, true); - - fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_truthConverted", - "true converted pairs — generator level #Delta#eta vs #Delta#phi;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", - kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_all4LegsThisColl", - "all 4 legs found — #Delta#eta vs #Delta#phi;" - "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", - kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_bothPhotonsBuilt", - "both V0s built — #Delta#eta vs #Delta#phi;" + // fRegistryMC — truth-level histograms + + // ─── Truth-level CF + fRegistryMC.add("MC/TruthCF/hQinvVsKt_same", "truth-level same-event CF;k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthCF/hDEtaDPhi_same", + "truth-level same-event #Delta#eta vs #Delta#phi;" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_bothPhotonsSelected", - "both V0s selected — #Delta#eta vs #Delta#phi;" + fRegistryMC.add("MC/TruthCF/hQinvVsKt_mix", "truth-level mixed-event CF;k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthCF/hDEtaDPhi_mix", + "truth-level mixed-event #Delta#eta vs #Delta#phi;" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + auto addStageHistos = [&](const char* suffix, const char* title, auto... axes) { + for (const auto& stage : {"truthConverted", "all4LegsThisColl", + "bothPhotonsBuilt", "bothPhotonsSelected"}) { + const std::string name = std::string("MC/TruthAO2D/") + suffix + std::string("_") + stage; + const std::string ttl = std::string(title) + std::string(" [") + stage + "]"; + fRegistryMC.add(name.c_str(), ttl.c_str(), kTHnD, {axes...}, true); + } + }; + auto addStageHistos2D = [&](const char* suffix, const char* title, auto ax1, auto ax2) { + for (const auto& stage : {"truthConverted", "all4LegsThisColl", + "bothPhotonsBuilt", "bothPhotonsSelected"}) { + const std::string name = std::string("MC/TruthAO2D/") + suffix + std::string("_") + stage; + fRegistryMC.add(name.c_str(), title, kTH2D, {ax1, ax2}, true); + } + }; + + addStageHistos("hSparse_DEtaDPhi_qinv", + "#Delta#eta,#Delta#phi,q_{inv}^{true};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + axisDeltaEta, axisDeltaPhi, axQinvMC); + + addStageHistos("hSparse_DEtaDPhi_kT", + "#Delta#eta,#Delta#phi,k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + axisDeltaEta, axisDeltaPhi, axisKt); + + addStageHistos2D("hQinvVsKt", + "q_{inv}^{true} vs k_{T};k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + axisKt, axQinvMC); + + addStageHistos2D("hDEtaDPhi", + "#Delta#eta vs #Delta#phi;#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + axisDeltaEta, axisDeltaPhi); + + // Rconv waterfall (nur converted + selected) + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted", + "denominator: R_{conv,1} vs R_{conv,2};R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected", + "numerator: R_{conv,1} vs R_{conv,2};R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted", + "denominator: min(R_{conv}) vs k_{T};k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_bothPhotonsSelected", + "numerator: min(R_{conv}) vs k_{T};k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + + // Stage waterfall summary + consistency fRegistryMC.add("MC/TruthAO2D/hStage_vs_kT", - "pair reco stage vs k_{T} — integrated efficiency waterfall;" - "k_{T} (GeV/c);stage (0=converted,1=all4legs,2=bothBuilt,3=bothSel)", + "efficiency waterfall;k_{T} (GeV/c);stage (0=converted,1=all4legs,2=bothBuilt,3=bothSel)", kTH2D, {axisKt, AxisSpec{4, -0.5f, 3.5f, "stage"}}, true); - fRegistryMC.add("MC/TruthAO2D/hStageConsistency", - "stage consistency check (expect all entries at 0);" - "N(V0 built but legs not found) per event;counts", + "stage consistency (expect all at 0);N(V0 built but legs not found);counts", kTH1D, {AxisSpec{20, -0.5f, 19.5f, "N_{bad}"}}, true); - { - const AxisSpec axRconv{180, 0.f, 90.f, "R_{conv}^{true} (cm)"}; - - fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted", - "true pairs — denominator: R_{conv}(#gamma_{1}) vs R_{conv}(#gamma_{2});" - "R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", - kTH2D, {axRconv, axRconv}, true); - fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected", - "true pairs — numerator: R_{conv}(#gamma_{1}) vs R_{conv}(#gamma_{2});" - "R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", - kTH2D, {axRconv, axRconv}, true); - - fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted", - "true pairs — denominator: min(R_{conv}) vs k_{T};" - "k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", - kTH2D, {axisKt, axRconv}, true); - fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_bothPhotonsSelected", - "true pairs — numerator: min(R_{conv}) vs k_{T};" - "k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", - kTH2D, {axisKt, axRconv}, true); - - fRegistryMC.add("MC/LegDiag/hRconv_legFound_vs_pt", - "single photon leg found in this collision: R_{conv}^{true} vs photon p_{T};" - "p_{T,#gamma}^{true} (GeV/c);R_{conv}^{true} (cm)", - kTH2D, {axisPt, axRconv}, true); - fRegistryMC.add("MC/LegDiag/hRconv_legMissing_vs_pt", - "single photon leg NOT found in this collision: R_{conv}^{true} vs photon p_{T};" - "p_{T,#gamma}^{true} (GeV/c);R_{conv}^{true} (cm)", - kTH2D, {axisPt, axRconv}, true); - } - + // ─── Single-leg diagnostics ─────────────────────────────────────────────── + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legFound", "leg found: #Delta R^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#Delta R_{e^{+}e^{-}}^{true}", kTH2D, {axisPt, axLegDR}, true); + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legMissing", "leg missing: #Delta R^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#Delta R_{e^{+}e^{-}}^{true}", kTH2D, {axisPt, axLegDR}, true); + fRegistryMC.add("MC/LegDiag/hLegDEta_legFound_vs_pt", "leg found: |#Delta#eta| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#eta_{e^{+}e^{-}}|", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#eta_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDEta_legMissing_vs_pt", "leg missing: |#Delta#eta| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#eta_{e^{+}e^{-}}|", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#eta_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDPhi_legFound_vs_pt", "leg found: |#Delta#phi| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#phi_{e^{+}e^{-}}| (rad)", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#phi_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDPhi_legMissing_vs_pt", "leg missing: |#Delta#phi| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#phi_{e^{+}e^{-}}| (rad)", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#phi_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hAlphaTrue_legFound_vs_pt", "leg found: #alpha^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#alpha^{true}", kTH2D, {axisPt, axAlpha}, true); + fRegistryMC.add("MC/LegDiag/hAlphaTrue_legMissing_vs_pt", "leg missing: #alpha^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#alpha^{true}", kTH2D, {axisPt, axAlpha}, true); + fRegistryMC.add("MC/LegDiag/hAlpha_vs_legDR_legMissing", "leg missing: #alpha^{true} vs #Delta R^{true};#Delta R_{e^{+}e^{-}}^{true};#alpha^{true}", kTH2D, {axLegDR, axAlpha}, true); + + // ─── Pair-level leg diagnostics ─────────────────────────────────────────── + fRegistryMC.add("MC/LegDiag/hNLegsPair_vs_kT", "N legs found per pair vs k_{T};k_{T} (GeV/c);N_{legs found} (0-4)", kTH2D, {axisKt, AxisSpec{5, -0.5f, 4.5f, "N_{legs found}"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegPt_vs_kT", "missing leg p_{T}^{true} vs pair k_{T};k_{T} (GeV/c);p_{T,leg}^{true} (GeV/c)", kTH2D, {axisKt, AxisSpec{100, 0.f, 0.5f, "p_{T,leg}^{true} (GeV/c)"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegRconv_vs_kT", "missing leg R_{conv}^{true} vs pair k_{T};k_{T} (GeV/c);R_{conv}^{true} (cm)", kTH2D, {axisKt, axisR}, true); + + // ─── Cross-built V0 pairs ───────────────────────────────────────────────── fRegistryMC.add("MC/PairCrossBuild/hSparse_DEtaDPhi_kT", - "pairs with cross-built V0 (legs from two different true photons);" + "cross-built V0 pairs: #Delta#eta,#Delta#phi,k_{T};" "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); fRegistryMC.add("MC/PairCrossBuild/hStageOut_vs_kT", - "cross-built pairs: how many were correctly built despite the fake V0;" + "cross-built pairs: N correctly built vs k_{T};" "k_{T} (GeV/c);N photons correctly built (0/1/2)", - kTH2D, {axisKt, AxisSpec{3, -0.5f, 2.5f, "N photons correctly built"}}, true); - fRegistryMC.add("MC/LegDiag/hNLegsPair_vs_kT", - "N legs found per pair (collision-local) vs k_{T};" - "k_{T} (GeV/c);N_{legs found} (0-4)", - kTH2D, {axisKt, AxisSpec{5, -0.5f, 4.5f, "N_{legs found} (this collision)"}}, true); - fRegistryMC.add("MC/LegDiag/hMissingLegPt_vs_kT", - "p_{T}^{true} of missing V0 legs vs pair k_{T};" - "k_{T} (GeV/c);p_{T,leg}^{true} (GeV/c)", - kTH2D, {axisKt, AxisSpec{100, 0.f, 0.5f, "p_{T,leg}^{true} (GeV/c)"}}, true); - fRegistryMC.add("MC/LegDiag/hMissingLegRconv_vs_kT", - "parent R_{conv}^{true} of missing leg vs pair k_{T};" - "k_{T} (GeV/c);R_{conv}^{true} (cm)", - kTH2D, {axisKt, axisR}, true); - fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legFound", - "single photon: leg found — leg #Delta R^{true} vs photon p_{T};" - "p_{T,#gamma}^{true} (GeV/c);leg #Delta R^{true}", - kTH2D, {axisPt, AxisSpec{100, 0.f, 0.3f, "leg #Delta R^{true}"}}, true); - fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legMissing", - "single photon: leg NOT found — leg #Delta R^{true} vs photon p_{T};" - "p_{T,#gamma}^{true} (GeV/c);leg #Delta R^{true}", - kTH2D, {axisPt, AxisSpec{100, 0.f, 0.3f, "leg #Delta R^{true}"}}, true); + kTH2D, {axisKt, AxisSpec{3, -0.5f, 2.5f, "N correctly built"}}, true); } template @@ -1228,12 +1331,9 @@ struct photonhbt { if (doMCQA) { fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhi"), obs.deta, obs.dphi); fRegistryPairMC.fill(HIST(base) + HIST("hQinv"), obs.qinv); - fRegistryPairMC.fill(HIST(base) + HIST("hDeltaEta"), obs.deta); - fRegistryPairMC.fill(HIST(base) + HIST("hDeltaPhi"), obs.dphi); fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR"), obs.deltaR); fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); - fRegistryPairMC.fill(HIST(base) + HIST("hKt"), obs.kt); } if (doSparse) fRegistryPairMC.fill(HIST(base) + HIST("hSparse_DEtaDPhi_kT"), obs.deta, obs.dphi, obs.kt); @@ -1304,18 +1404,18 @@ struct photonhbt { fRegistryPairMC.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); - const bool fillDRDZ = ((TruthT == PairTruthType::TrueTrueDistinct) ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueSamePhoton.value - : (TruthT == PairTruthType::SharedMcLeg) ? mcthruth_sparse.cfgFillDRDZQinvSharedMcLeg.value - : (TruthT == PairTruthType::TrueFake) ? mcthruth_sparse.cfgFillDRDZQinvTrueFake.value - : (TruthT == PairTruthType::FakeFake) ? mcthruth_sparse.cfgFillDRDZQinvFakeFake.value - : mcthruth_sparse.cfgFillDRDZQinvPi0Daughters.value); + const bool fillDRDZ = ((TruthT == PairTruthType::TrueTrueDistinct) ? mctruthSparse.cfgFillDRDZQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mctruthSparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mctruthSparse.cfgFillDRDZQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mctruthSparse.cfgFillDRDZQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mctruthSparse.cfgFillDRDZQinvFakeFake.value + : mctruthSparse.cfgFillDRDZQinvPi0Daughters.value); if (fillDRDZ) fRegistryPairMC.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); - const bool enabled = ((TruthT == PairTruthType::TrueTrueDistinct) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value - : (TruthT == PairTruthType::SharedMcLeg) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value - : (TruthT == PairTruthType::TrueFake) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueFake.value - : (TruthT == PairTruthType::FakeFake) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvFakeFake.value - : mcthruth_sparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value); + const bool enabled = ((TruthT == PairTruthType::TrueTrueDistinct) ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mctruthSparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mctruthSparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mctruthSparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value); if (enabled) fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); } @@ -1367,13 +1467,13 @@ struct photonhbt { float qout_lcms = q3_lcms.Dot(uv_out); float qside_lcms = q3_lcms.Dot(uv_side); float qlong_lcms = q3_lcms.Dot(uv_long); - if (cfgDo3D) { + if (hbtanalysis.cfgDo3D) { fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_3D"), std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt); - if (cfgDo2D) + if (hbtanalysis.cfgDo2D) fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt); } else { - fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_1D"), hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt); } } @@ -1392,11 +1492,11 @@ struct photonhbt { initCCDB(collision); int ndiphoton = 0; const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; - if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) + if (cent[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || centralitySelection.cfgCentMax < cent[mixing.cfgCentEstimator]) continue; const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; - const float ep2 = epArr[cfgEP2EstimatorForMix]; + const float ep2 = epArr[mixing.cfgEP2EstimatorForMix]; fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) @@ -1405,10 +1505,10 @@ struct photonhbt { fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - const float occupancy = (cfgOccupancyEstimator == 1) + const float occupancy = (mixing.cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); - const float centForQA = cent[cfgCentEstimator]; + const float centForQA = cent[mixing.cfgCentEstimator]; const int zbin = binOf(ztxBinEdges, collision.posZ()), centbin = binOf(centBinEdges, centForQA); const int epbin = binOf(epBinEgdes, ep2), occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); @@ -1429,7 +1529,10 @@ struct photonhbt { if (pos1.trackId() == pos2.trackId() || pos1.trackId() == ele2.trackId() || ele1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) continue; + if (!passAsymmetryCut(g1.pt(), g2.pt())) + continue; auto obs = buildPairQAObservables(g1, g2); + if (!obs.valid) continue; const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); @@ -1460,27 +1563,42 @@ struct photonhbt { fillFullRangeQA<0>(obs, centForQA, occupancy); fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); ndiphoton++; + fRegistry.fill(HIST("Pair/same/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); + + fillEtaTopologyHisto( + classifyEtaTopology(g1.eta(), g2.eta(), + pos1.eta(), ele1.eta(), + pos2.eta(), ele2.eta()), + obs.deta, obs.dphi, obs.kt); auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { - EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); - emh1->AddTrackToEventPool(keyDFCollision,gtmp); - } }; + EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); + gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); + emh1->AddTrackToEventPool(keyDFCollision, gtmp); + } + }; addToPool(g1); addToPool(g2); } - if (qaflags.doSinglePhotonQa) - for (const auto& g : photons1Coll) + if (qaflags.doSinglePhotonQa) { + for (const auto& g : photons1Coll) { if (cut1.template IsSelected(g)) { const int gid = g.globalIndex(); - if (idsAfterDR.count(gid)) + if (idsAfterDR.count(gid)) { fillSinglePhotonQAStep<1>(g); - if (idsAfterRZ.count(gid)) + } + if (idsAfterRZ.count(gid)) { fillSinglePhotonQAStep<2>(g); - if (idsAfterEllipse.count(gid)) + } + if (idsAfterEllipse.count(gid)) { fillSinglePhotonQAStep<3>(g); + } } + } + } usedPhotonIdsPerCol.clear(); - if (!cfgDoMix || ndiphoton == 0) + if (!mixing.cfgDoMix || ndiphoton == 0) continue; auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); @@ -1490,11 +1608,13 @@ struct photonhbt { const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); - if (diffBC < ndiffBCMix) + if (diffBC < mixing.ndiffBCMix) continue; auto poolPhotons = emh1->GetTracksPerCollision(mixID); for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { + if (!passAsymmetryCut(g1.pt(), g2.pt())) + continue; auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; @@ -1519,6 +1639,8 @@ struct photonhbt { if (doFR) fillFullRangeQA<1>(obs, centForQA, occupancy); fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); + fRegistry.fill(HIST("Pair/mix/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); } } if (ndiphoton > 0) { @@ -1540,11 +1662,11 @@ struct photonhbt { initCCDB(collision); int ndiphoton = 0; const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; - if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) + if (cent[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || centralitySelection.cfgCentMax < cent[mixing.cfgCentEstimator]) continue; const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; - const float ep2 = epArr[cfgEP2EstimatorForMix]; + const float ep2 = epArr[mixing.cfgEP2EstimatorForMix]; fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) @@ -1553,10 +1675,10 @@ struct photonhbt { fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - const float occupancy = (cfgOccupancyEstimator == 1) + const float occupancy = (mixing.cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); - const float centForQA = cent[cfgCentEstimator]; + const float centForQA = cent[mixing.cfgCentEstimator]; const int zbin = binOf(ztxBinEdges, collision.posZ()), centbin = binOf(centBinEdges, centForQA); const int epbin = binOf(epBinEgdes, ep2), occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); @@ -1580,6 +1702,8 @@ struct photonhbt { auto truthType = classifyPairTruth(mc1, mc2); if (truthType == PairTruthType::TrueTrueDistinct && isPi0DaughterPair(mc1, mc2, mcParticles)) truthType = PairTruthType::Pi0Daughters; + if (!passAsymmetryCut(g1.pt(), g2.pt())) + continue; auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; @@ -1610,6 +1734,14 @@ struct photonhbt { if (doFR) fillFullRangeQA<0>(obs, centForQA, occupancy); fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); + fRegistry.fill(HIST("Pair/same/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); + + fillEtaTopologyHisto( + classifyEtaTopology(g1.eta(), g2.eta(), + pos1.eta(), ele1.eta(), + pos2.eta(), ele2.eta()), + obs.deta, obs.dphi, obs.kt); ndiphoton++; if (!mc1.hasMC || !mc2.hasMC) { fillPairHistogramNoLabel(collision, obs.v1, obs.v2); @@ -1664,25 +1796,32 @@ struct photonhbt { auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { - EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); - emh1->AddTrackToEventPool(keyDFCollision,gtmp); - } }; + EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); + gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); + emh1->AddTrackToEventPool(keyDFCollision, gtmp); + } + }; addToPool(g1); addToPool(g2); } - if (qaflags.doSinglePhotonQa) - for (const auto& g : photonsColl) + if (qaflags.doSinglePhotonQa) { + for (const auto& g : photonsColl) { if (cut.template IsSelected(g)) { const int gid = g.globalIndex(); - if (idsAfterDR.count(gid)) + if (idsAfterDR.count(gid)) { fillSinglePhotonQAStep<1>(g); - if (idsAfterRZ.count(gid)) + } + if (idsAfterRZ.count(gid)) { fillSinglePhotonQAStep<2>(g); - if (idsAfterEllipse.count(gid)) + } + if (idsAfterEllipse.count(gid)) { fillSinglePhotonQAStep<3>(g); + } } + } + } usedPhotonIdsPerCol.clear(); - if (!cfgDoMix || ndiphoton == 0) + if (!mixing.cfgDoMix || ndiphoton == 0) continue; auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); @@ -1692,12 +1831,15 @@ struct photonhbt { const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); - if (diffBC < ndiffBCMix) + if (diffBC < mixing.ndiffBCMix) continue; auto poolPhotons = emh1->GetTracksPerCollision(mixID); for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { + if (!passAsymmetryCut(g1.pt(), g2.pt())) + continue; auto obs = buildPairQAObservables(g1, g2); + if (!obs.valid) continue; const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); @@ -1721,6 +1863,8 @@ struct photonhbt { if (doFR) fillFullRangeQA<1>(obs, centForQA, occupancy); fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); + fRegistry.fill(HIST("Pair/mix/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); } } if (ndiphoton > 0) { @@ -1758,7 +1902,8 @@ struct photonhbt { if (!fEMEventCut.IsSelected(collision)) continue; const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; - if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) + if (cent[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || + centralitySelection.cfgCentMax < cent[mixing.cfgCentEstimator]) continue; if (!collision.has_emmcevent()) continue; @@ -1772,10 +1917,9 @@ struct photonhbt { std::unordered_set legIdsThisCollision; legIdsThisCollision.reserve(legsColl.size()); - for (const auto& leg : legsColl) { + for (const auto& leg : legsColl) if (leg.has_emmcparticle()) legIdsThisCollision.insert(leg.emmcparticleId()); - } std::unordered_map> crossBuildMap; @@ -1788,8 +1932,7 @@ struct photonhbt { for (const auto& g : recoPhotonsColl) { const auto pos = g.template posTrack_as(); const auto neg = g.template negTrack_as(); - const bool wrongEvt = (pos.collisionId() != thisCollisionId || neg.collisionId() != thisCollisionId); - if (wrongEvt) + if (pos.collisionId() != thisCollisionId || neg.collisionId() != thisCollisionId) continue; if (!pos.has_emmcparticle() || !neg.has_emmcparticle()) continue; @@ -1801,14 +1944,14 @@ struct photonhbt { if (posMotherId != negMotherId) { const auto posMother = emmcParticles.iteratorAt(posMotherId); const auto negMother = emmcParticles.iteratorAt(negMotherId); - if (posMother.pdgCode() == 22 && negMother.pdgCode() == 22) { + if (posMother.pdgCode() == kGamma && negMother.pdgCode() == kGamma) { crossBuildMap[posMotherId].insert(negMotherId); crossBuildMap[negMotherId].insert(posMotherId); } continue; } const int gammaId = posMotherId; - if (emmcParticles.iteratorAt(gammaId).pdgCode() != 22) + if (emmcParticles.iteratorAt(gammaId).pdgCode() != kGamma) continue; const bool passes = cut.template IsSelected, TLegs>(g); auto& info = gammaRecoMap[gammaId]; @@ -1816,46 +1959,78 @@ struct photonhbt { info.passesCut = info.passesCut || passes; } - struct TruthGamma { - int id = -1, posId = -1, negId = -1; - float eta = 0.f, phi = 0.f, pt = 0.f, rTrue = -1.f, legDRtrue = -1.f; - }; + // ─── Build true gamma list ──────────────────────────────────────────────── std::vector trueGammas; trueGammas.reserve(32); for (const auto& g : emmcPartsColl) { - if (g.pdgCode() != 22) + if (g.pdgCode() != kGamma) continue; if (!g.isPhysicalPrimary() && !g.producedByGenerator()) continue; if (std::fabs(g.eta()) > pcmcuts.cfgMaxEtaV0.value) continue; - if (g.pt() < pcmcuts.cfgMinPtV0.value) + const float mcV0PtMin = (mctruth.cfgMCMinV0Pt.value > 0.f) + ? mctruth.cfgMCMinV0Pt.value + : pcmcuts.cfgMinPtV0.value; + if (g.pt() < mcV0PtMin) continue; if (!g.has_daughters()) continue; + int posId = -1, negId = -1; float rTrue = -1.f; - for (const int dId : g.daughtersIds()) { - if (dId < 0) + for (const auto& dId : g.daughtersIds()) { + if (dId < 0) { continue; + } const auto d = emmcParticles.iteratorAt(dId); - if (d.pdgCode() == -11) { + if (d.pdgCode() == kElectron) { posId = dId; rTrue = std::sqrt(d.vx() * d.vx() + d.vy() * d.vy()); - } else if (d.pdgCode() == 11) + } else if (d.pdgCode() == kPositron) { negId = dId; + } } - if (posId < 0 || negId < 0) + if (posId < 0 || negId < 0) { continue; + } + const auto mcPosE = emmcParticles.iteratorAt(posId); const auto mcNegE = emmcParticles.iteratorAt(negId); + + if (mctruth.cfgMCMinLegPt.value > 0.f && + (static_cast(mcPosE.pt()) < mctruth.cfgMCMinLegPt.value || + static_cast(mcNegE.pt()) < mctruth.cfgMCMinLegPt.value)) + continue; + const float deTrE = static_cast(mcPosE.eta() - mcNegE.eta()); const float dpTrE = wrapPhi(static_cast(mcPosE.phi() - mcNegE.phi())); const float legDRt = std::sqrt(deTrE * deTrE + dpTrE * dpTrE); + + const float pxG = static_cast(g.px()), pyG = static_cast(g.py()), + pzG = static_cast(g.pz()); + const float magG = std::sqrt(pxG * pxG + pyG * pyG + pzG * pzG); + float alphaTrue = 0.f; + if (magG > kMinSigma) { + const float ux = pxG / magG, uy = pyG / magG, uz = pzG / magG; + const float pLpos = static_cast(mcPosE.px()) * ux + + static_cast(mcPosE.py()) * uy + + static_cast(mcPosE.pz()) * uz; + const float pLneg = static_cast(mcNegE.px()) * ux + + static_cast(mcNegE.py()) * uy + + static_cast(mcNegE.pz()) * uz; + const float sumPL = pLpos + pLneg; + if (std::fabs(sumPL) > kMinSigma) + alphaTrue = (pLpos - pLneg) / sumPL; + } + trueGammas.push_back({static_cast(g.globalIndex()), posId, negId, static_cast(g.eta()), static_cast(g.phi()), - static_cast(g.pt()), rTrue, legDRt}); + static_cast(g.pt()), rTrue, legDRt, + deTrE, + dpTrE, + alphaTrue}); } { @@ -1872,22 +2047,34 @@ struct photonhbt { for (const auto& tg : trueGammas) { const bool posFound = legIdsThisCollision.count(tg.posId) > 0; const bool negFound = legIdsThisCollision.count(tg.negId) > 0; + const bool bothFound = posFound && negFound; + for (const auto& [legId, legFound] : std::initializer_list>{{tg.posId, posFound}, {tg.negId, negFound}}) { if (legId < 0) continue; if (legFound) { fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legFound"), tg.pt, tg.legDRtrue); - if (tg.rTrue >= 0.f) - fRegistryMC.fill(HIST("MC/LegDiag/hRconv_legFound_vs_pt"), tg.pt, tg.rTrue); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDEta_legFound_vs_pt"), tg.pt, std::fabs(tg.legDEta)); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDPhi_legFound_vs_pt"), tg.pt, std::fabs(tg.legDPhi)); } else { fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legMissing"), tg.pt, tg.legDRtrue); - if (tg.rTrue >= 0.f) - fRegistryMC.fill(HIST("MC/LegDiag/hRconv_legMissing_vs_pt"), tg.pt, tg.rTrue); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDEta_legMissing_vs_pt"), tg.pt, std::fabs(tg.legDEta)); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDPhi_legMissing_vs_pt"), tg.pt, std::fabs(tg.legDPhi)); } } + + // ─── Armenteros-α diagnostics per photon ───────────────────────────── + if (bothFound) { + fRegistryMC.fill(HIST("MC/LegDiag/hAlphaTrue_legFound_vs_pt"), tg.pt, tg.alphaTrue); + } else { + // At least one leg missing + fRegistryMC.fill(HIST("MC/LegDiag/hAlphaTrue_legMissing_vs_pt"), tg.pt, tg.alphaTrue); + fRegistryMC.fill(HIST("MC/LegDiag/hAlpha_vs_legDR_legMissing"), tg.legDRtrue, tg.alphaTrue); + } } + // ─── Pair loop: efficiency ───────────────────────────────────── for (size_t i = 0; i < trueGammas.size(); ++i) { for (size_t j = i + 1; j < trueGammas.size(); ++j) { const auto& g1 = trueGammas[i]; @@ -1898,16 +2085,17 @@ struct photonhbt { const float px2 = g2.pt * std::cos(g2.phi), py2 = g2.pt * std::sin(g2.phi); const float kt = 0.5f * std::sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)); - if (cfgMCMinKt > 0.f && kt < cfgMCMinKt) + if (mctruth.cfgMCMinKt > 0.f && kt < mctruth.cfgMCMinKt) continue; - if (cfgMCMaxKt > 0.f && kt > cfgMCMaxKt) + if (mctruth.cfgMCMaxKt > 0.f && kt > mctruth.cfgMCMaxKt) continue; const float e1 = g1.pt * std::cosh(g1.eta), e2 = g2.pt * std::cosh(g2.eta); - const float dot = e1 * e2 - (px1 * px2 + py1 * py2 + g1.pt * std::sinh(g1.eta) * g2.pt * std::sinh(g2.eta)); + const float dot = e1 * e2 - (px1 * px2 + py1 * py2 + + g1.pt * std::sinh(g1.eta) * g2.pt * std::sinh(g2.eta)); const float qinv_true = std::sqrt(std::max(0.f, 2.f * dot)); - if (cfgMCMaxQinv > 0.f && qinv_true > cfgMCMaxQinv) + if (mctruth.cfgMCMaxQinv > 0.f && qinv_true > mctruth.cfgMCMaxQinv) continue; auto it1 = gammaRecoMap.find(g1.id), it2 = gammaRecoMap.find(g2.id); @@ -1924,6 +2112,7 @@ struct photonhbt { fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_truthConverted"), deta, dphi, kt); fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_truthConverted"), kt, qinv_true); fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_truthConverted"), deta, dphi); + if (pairAll4LegsThisColl) { fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_all4LegsThisColl"), deta, dphi, qinv_true); fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_all4LegsThisColl"), deta, dphi, kt); @@ -1948,8 +2137,9 @@ struct photonhbt { if (g1Sel && g2Sel) fRegistryMC.fill(HIST("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected"), g1.rTrue, g2.rTrue); } - const float minRconv = (g1.rTrue >= 0.f && g2.rTrue >= 0.f) ? std::min(g1.rTrue, g2.rTrue) - : (g1.rTrue >= 0.f ? g1.rTrue : g2.rTrue); + const float minRconv = (g1.rTrue >= 0.f && g2.rTrue >= 0.f) + ? std::min(g1.rTrue, g2.rTrue) + : (g1.rTrue >= 0.f ? g1.rTrue : g2.rTrue); if (minRconv >= 0.f) { fRegistryMC.fill(HIST("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted"), kt, minRconv); if (g1Sel && g2Sel) @@ -1991,8 +2181,73 @@ struct photonhbt { } } } - } - } + + // ─── Truth-level CF mixing ──────────────────────────────────────────────── + if (mctruth.cfgDoTruthMix.value) { + for (size_t i = 0; i < trueGammas.size(); ++i) { + for (size_t j = i + 1; j < trueGammas.size(); ++j) { + const auto& g1 = trueGammas[i]; + const auto& g2 = trueGammas[j]; + if (!passAsymmetryCut(g1.pt, g2.pt)) + continue; + const float deta = g1.eta - g2.eta; + const float dphi = wrapPhi(g1.phi - g2.phi); + const float px1 = g1.pt * std::cos(g1.phi), py1 = g1.pt * std::sin(g1.phi); + const float px2 = g2.pt * std::cos(g2.phi), py2 = g2.pt * std::sin(g2.phi); + const float kt = 0.5f * std::sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)); + const float e1 = g1.pt * std::cosh(g1.eta), e2 = g2.pt * std::cosh(g2.eta); + const float dot = e1 * e2 - (px1 * px2 + py1 * py2 + + g1.pt * std::sinh(g1.eta) * g2.pt * std::sinh(g2.eta)); + const float qinv_true = std::sqrt(std::max(0.f, 2.f * dot)); + fRegistryMC.fill(HIST("MC/TruthCF/hQinvVsKt_same"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthCF/hDEtaDPhi_same"), deta, dphi); + } + } + + const float centForBin = cent[mixing.cfgCentEstimator.value]; + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), + collision.ep2bneg()}; + const float ep2 = epArr[mixing.cfgEP2EstimatorForMix.value]; + const float occupancy = (mixing.cfgOccupancyEstimator.value == 1) + ? static_cast(collision.trackOccupancyInTimeRange()) + : collision.ft0cOccupancyInTimeRange(); + auto keyBin = std::make_tuple(binOf(ztxBinEdges, collision.posZ()), + binOf(centBinEdges, centForBin), + binOf(epBinEgdes, ep2), + binOf(occBinEdges, occupancy)); + + if (truthGammaPool.count(keyBin)) { + for (const auto& poolEvent : truthGammaPool[keyBin]) { + for (const auto& g1 : trueGammas) { + for (const auto& g2 : poolEvent) { + if (!passAsymmetryCut(g1.pt, g2.pt)) + continue; + const float deta = g1.eta - g2.eta; + const float dphi = wrapPhi(g1.phi - g2.phi); + const float px1 = g1.pt * std::cos(g1.phi), py1 = g1.pt * std::sin(g1.phi); + const float px2 = g2.pt * std::cos(g2.phi), py2 = g2.pt * std::sin(g2.phi); + const float kt = 0.5f * std::sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)); + const float e1 = g1.pt * std::cosh(g1.eta), e2 = g2.pt * std::cosh(g2.eta); + const float dot = e1 * e2 - (px1 * px2 + py1 * py2 + + g1.pt * std::sinh(g1.eta) * g2.pt * std::sinh(g2.eta)); + const float qinv_true = std::sqrt(std::max(0.f, 2.f * dot)); + fRegistryMC.fill(HIST("MC/TruthCF/hQinvVsKt_mix"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthCF/hDEtaDPhi_mix"), deta, dphi); + } + } + } + } + + if (!trueGammas.empty()) { + auto& poolBin = truthGammaPool[keyBin]; + poolBin.push_back(trueGammas); + if (static_cast(poolBin.size()) > mctruth.cfgTruthMixDepth.value) + poolBin.pop_front(); + } + } // end cfgDoTruthMix + } // end collision loop + } // end runTruthEfficiency using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler< std::tuple, std::pair, EMPair>; @@ -2008,9 +2263,9 @@ struct photonhbt { PresliceUnsorted perMCCollisionEMMCParts = aod::emmcparticle::emmceventId; Filter collisionFilterCentrality = - (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + (centralitySelection.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < centralitySelection.cfgCentMax) || + (centralitySelection.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < centralitySelection.cfgCentMax) || + (centralitySelection.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < centralitySelection.cfgCentMax); Filter collisionFilterOccupancyTrack = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; @@ -2029,7 +2284,7 @@ struct photonhbt { perCollisionPCM, perCollisionPCM, fV0PhotonCut, fV0PhotonCut); ndf++; } - PROCESS_SWITCH(photonhbt, processAnalysis, "pairing for analysis", true); + PROCESS_SWITCH(Photonhbt, processAnalysis, "pairing for analysis", true); void processMC(FilteredMyCollisions const& collisions, MyV0Photons const& v0photons, @@ -2045,10 +2300,10 @@ struct photonhbt { ndf++; } - PROCESS_SWITCH(photonhbt, processMC, "MC CF + truth efficiency maps for CF correction", false); + PROCESS_SWITCH(Photonhbt, processMC, "MC CF + truth efficiency maps for CF correction", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"photonhbt"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From faaefe3a3f671eb67055783526c0e624f5bb75fb Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:38:02 +0200 Subject: [PATCH 157/282] [PWGCF] FemtoUniverse: pT vs. InvMassMother histogram correction. (#15628) --- .../Tasks/femtoUniversePairTaskTrackV0Helicity.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index fd24e2b8227..cd31dc73b55 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx @@ -167,6 +167,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { Configurable cfgProcessHel3{"cfgProcessHel3", false, "Process particle pairs from the helicity range 3"}; // -0.1 > cosineTheta >= -0.5 Configurable cfgProcessHel4{"cfgProcessHel4", false, "Process particle pairs from the helicity range 4"}; // -0.5 > cosineTheta >= -1.0 ConfigurableAxis confInvMassMotherpTBinsHel{"confInvMassMotherpTBinsHel", {5, 0, 5}, "pT binning in the pT vs. InvMassMother plot for helicity"}; + ConfigurableAxis confInvMassMotherBinsHel{"confInvMassMotherBinsHel", {1000, 0.8, 1.4}, "InvMassMother binning in the pT vs. InvMassMother plot for helicity"}; /// Efficiency Configurable confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"}; @@ -296,10 +297,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { thetaRegistry.add("Theta/NegativeChild/hThetaPt", " ; p_{T} (GeV/#it{c}); cos(#theta)", kTH2F, {{100, 0, 10}, {110, -1.1, 1.1}}); thetaRegistry.add("Theta/NegativeChild/hThetaEta", " ; #eta; cos(#theta)", kTH2F, {{100, -1, 1}, {110, -1.1, 1.1}}); thetaRegistry.add("Theta/NegativeChild/hThetaPhi", " ; #phi; cos(#theta)", kTH2F, {{100, -1, 7}, {110, -1.1, 1.1}}); - thetaRegistry.add("Theta/Mother/hInvMassMotherHel1", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); - thetaRegistry.add("Theta/Mother/hInvMassMotherHel2", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); - thetaRegistry.add("Theta/Mother/hInvMassMotherHel3", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); - thetaRegistry.add("Theta/Mother/hInvMassMotherHel4", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel1", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel2", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel3", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel4", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); /// MC Truth registryMCtruth.add("plus/MCtruthLambda", "MC truth Lambdas;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); From 2a0b11a80452dfef9f840260387b4b09e6c612ec Mon Sep 17 00:00:00 2001 From: aimeric-landou <46970521+aimeric-landou@users.noreply.github.com> Date: Thu, 2 Apr 2026 18:53:28 +0100 Subject: [PATCH 158/282] [PWGJE] jetFinderQA.cxx: add histograms in qcMultCutCheck, hists for primaries (#15632) --- PWGJE/Tasks/jetFinderQA.cxx | 45 +++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 6c5984cb424..c7c9e359a51 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -91,6 +91,7 @@ struct JetFinderQATask { Configurable multCutCheck_analyseMBGapEvents{"multCutCheck_analyseMBGapEvents", 0, "flag to choose to reject min. bias gap events; -1: MBGap only, 0: skip MBGap events, 1: analyse all events"}; Configurable doMultCutCheck{"doMultCutCheck", false, "decide to apply multCutCheck or not"}; Configurable multCutCheck_applyRCTSelections{"multCutCheck_applyRCTSelections", true, "decide to apply RCT selections"}; + Configurable multCutCheck_applyWeightCorrection{"multCutCheck_applyWeightCorrection", true, "decide to apply weight correction"}; std::vector filledJetR_Both; std::vector filledJetR_Low; @@ -434,12 +435,20 @@ struct JetFinderQATask { registry.add("h2_track_pt_track_sigma1overpt", "#sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 10.}, {10000, 0.0, 1.0}}}); registry.add("h2_track_pt_high_track_sigma1overpt", "#sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{90, 10., 100.}, {10000, 0.0, 1.0}}}); + registry.add("h_mccollision_processid", "mccollision process id;mccollision process id;entries", {HistType::kTH1D, {{200, 0.0, 200.0}}}); + registry.add("h_particle_pdgcode", "particle pdgcode;particle pdgcode;entries", {HistType::kTH1D, {{3000, 0.0, 3000.0}}}); - registry.add("h_particle_genstatuscode", "particle gen status code;particle gen status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); + registry.add("h_particle_genstatuscode", "particle gen status code;particle gen status code;entries", {HistType::kTH1D, {{420, -210.0, 210.0}}}); registry.add("h_particle_hepmcstatuscode", "particle hep mc status code;particle hep mc status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); registry.add("h_particle_process", "particle process;particle process;entries", {HistType::kTH1D, {{50, 0.0, 50.0}}}); registry.add("h_particle_producedbygenerator", "particle producedByGenerator status;particle producedByGenerator status;entries", {HistType::kTH1D, {{2, 0.0, 2}}}); + registry.add("h_particle_primary_pdgcode", "primary particle pdgcode;primary particle pdgcode;entries", {HistType::kTH1D, {{3000, 0.0, 3000.0}}}); + registry.add("h_particle_primary_genstatuscode", "primary particle gen status code;primary particle gen status code;entries", {HistType::kTH1D, {{420, -210.0, 210.0}}}); + registry.add("h_particle_primary_hepmcstatuscode", "primary particle hep mc status code;primary particle hep mc status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); + registry.add("h_particle_primary_process", "primary particle process;primary particle process;entries", {HistType::kTH1D, {{50, 0.0, 50.0}}}); + registry.add("h_particle_primary_producedbygenerator", "primary particle producedByGenerator status;primary particle producedByGenerator status;entries", {HistType::kTH1D, {{2, 0.0, 2}}}); + registry.add("h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxis}}, doSumw2); registry.add("h_jet_eta", "jet eta;#eta; counts", {HistType::kTH1F, {jetEtaAxis}}, doSumw2); registry.add("h_jet_phi", "jet phi;#phi; counts", {HistType::kTH1F, {phiAxis}}, doSumw2); @@ -1483,12 +1492,13 @@ struct JetFinderQATask { PROCESS_SWITCH(JetFinderQATask, processOccupancyQA, "occupancy QA on jet derived data", false); void processQcMultCutCheck(soa::Filtered>::iterator const& collision, - aod::JetMcCollisions const&, + soa::Join const&, + // soa::Join const& aodMcCollisions, soa::Join const& mcdjets, soa::Filtered> const& tracks, soa::Filtered const& mcparticles) { - float eventWeight = collision.weight(); + float eventWeight = multCutCheck_applyWeightCorrection ? collision.weight() : 1; bool hasJetAboveMultCut = false; for (auto const& mcdjet : mcdjets) { @@ -1501,15 +1511,19 @@ struct JetFinderQATask { } bool fillHistograms = true; - bool isWeighted = true; + bool isWeighted = multCutCheck_applyWeightCorrection; if (!applyCollisionCuts_multCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { return; } registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); - if (collision.has_mcCollision()) { // the collision is fake and has no associated mc coll; skip as .mccollision() cannot be called - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), collision.mcCollision().ptHard()); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), collision.mcCollision().ptHard(), eventWeight); + if (collision.has_mcCollision()) { // the collision is not fake and has one associated mc coll; .mccollision() can be called + auto jetMcCollision = collision.mcCollision_as>(); + auto aodMcCollision = jetMcCollision.mcCollision_as>(); + + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(collision.weight(), 1.0 / pTHatExponent)), jetMcCollision.ptHard()); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), simPtRef / (std::pow(collision.weight(), 1.0 / pTHatExponent)), jetMcCollision.ptHard(), eventWeight); + registry.fill(HIST("h_mccollision_processid"), aodMcCollision.processId(), eventWeight); } else { registry.fill(HIST("h_fakecollisions"), 0.5); } @@ -1534,11 +1548,18 @@ struct JetFinderQATask { } for (auto const& mcparticle : mcparticles) { - registry.fill(HIST("h_particle_pdgcode"), mcparticle.pdgCode()); - registry.fill(HIST("h_particle_genstatuscode"), mcparticle.getGenStatusCode()); - registry.fill(HIST("h_particle_hepmcstatuscode"), mcparticle.getHepMCStatusCode()); - registry.fill(HIST("h_particle_process"), mcparticle.getProcess()); - registry.fill(HIST("h_particle_producedbygenerator"), mcparticle.producedByGenerator()); + registry.fill(HIST("h_particle_pdgcode"), mcparticle.pdgCode(), eventWeight); + registry.fill(HIST("h_particle_genstatuscode"), mcparticle.getGenStatusCode(), eventWeight); + registry.fill(HIST("h_particle_hepmcstatuscode"), mcparticle.getHepMCStatusCode(), eventWeight); + registry.fill(HIST("h_particle_process"), mcparticle.getProcess(), eventWeight); + registry.fill(HIST("h_particle_producedbygenerator"), mcparticle.producedByGenerator(), eventWeight); + if (mcparticle.isPhysicalPrimary()) { + registry.fill(HIST("h_particle_primary_pdgcode"), mcparticle.pdgCode(), eventWeight); + registry.fill(HIST("h_particle_primary_genstatuscode"), mcparticle.getGenStatusCode(), eventWeight); + registry.fill(HIST("h_particle_primary_hepmcstatuscode"), mcparticle.getHepMCStatusCode(), eventWeight); + registry.fill(HIST("h_particle_primary_process"), mcparticle.getProcess(), eventWeight); + registry.fill(HIST("h_particle_primary_producedbygenerator"), mcparticle.producedByGenerator(), eventWeight); + } } for (auto const& mcdjet : mcdjets) { From 2a7f691778d671f87f5758bcb9129ecdf1b0c127 Mon Sep 17 00:00:00 2001 From: Zoltan Varga <91464454+zovarga@users.noreply.github.com> Date: Thu, 2 Apr 2026 19:53:56 +0200 Subject: [PATCH 159/282] [PWGJE] Change MiniCollision index column declaration for jetLundPlane.cxx (#15633) Co-authored-by: ALICE Action Bot --- PWGJE/Tasks/jetLundPlane.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PWGJE/Tasks/jetLundPlane.cxx b/PWGJE/Tasks/jetLundPlane.cxx index 6b8bd423622..eaa2af5b3a6 100644 --- a/PWGJE/Tasks/jetLundPlane.cxx +++ b/PWGJE/Tasks/jetLundPlane.cxx @@ -53,7 +53,7 @@ DECLARE_SOA_TABLE(MiniCollisions, "AOD", "MINICOLL", MiniCollTag); // MiniJets -> MiniCollisions -DECLARE_SOA_INDEX_COLUMN(MiniCollision, miniCollision); +DECLARE_SOA_INDEX_COLUMN_CUSTOM(MiniCollision, miniCollision, "MINICOLLS"); // Jet payload DECLARE_SOA_COLUMN(Level, level, uint8_t); // JetLevel::Det=reco(det), JetLevel::Part=truth(part) @@ -96,6 +96,9 @@ DECLARE_SOA_TABLE(MiniJetMatches, "AOD", "MINIMCH", namespace { constexpr float kTiny = 1e-12f; +constexpr uint64_t collisionKeyShift = 1ULL; +constexpr uint64_t partCollisionKeyTag = 1ULL; +constexpr size_t MinConstituentsForJet = 2; struct JetLevel { enum Type : uint8_t { @@ -416,7 +419,7 @@ struct JetLundPlaneUnfolding { std::vector getPrimarySplittings(JetRowT const& jet, ConstituentTableT const&) { auto fjInputs = buildFastJetInputs(jet.template tracks_as(), trackPtMin.value); - if (fjInputs.size() < 2) { + if (fjInputs.size() < MinConstituentsForJet) { return {}; } @@ -583,7 +586,8 @@ struct JetLundPlaneUnfolding { fillSplittingQAHists(spl, /*isTruth*/ true, partJet.pt()); if (writeMiniAOD.value) { - const uint64_t partCollKey = (static_cast(partJet.mcCollisionId()) << 1U) | 1ULL; + const uint64_t partCollKey = + (static_cast(partJet.mcCollisionId()) << collisionKeyShift) | partCollisionKeyTag; int partMiniCollIdx = -1; auto collIt = partMiniCollByKey.find(partCollKey); if (collIt == partMiniCollByKey.end()) { @@ -650,7 +654,8 @@ struct JetLundPlaneUnfolding { fillSplittingQAHists(detSpl, /*isTruth*/ false, detJet.pt()); if (writeMiniAOD.value) { - const uint64_t detCollKey = (static_cast(detJet.collisionId()) << 1U); + const uint64_t detCollKey = + (static_cast(detJet.collisionId()) << collisionKeyShift); int detMiniCollIdx = -1; auto collIt = detMiniCollByKey.find(detCollKey); if (collIt == detMiniCollByKey.end()) { @@ -795,5 +800,5 @@ struct JetLundPlaneUnfolding { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"jet-lund-plane"})}; + adaptAnalysisTask(cfgc)}; } From a56bec631b2b9510a343722ff0ec212862bd0b70 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:10:16 +0200 Subject: [PATCH 160/282] [PWGMM/LumiStability] Separate ZDC QA into dedicated task (#15625) Co-authored-by: Nicolas Strangmann --- PWGMM/Lumi/Tasks/CMakeLists.txt | 5 + PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx | 122 +-------------- PWGMM/Lumi/Tasks/lumiZdcQa.cxx | 165 ++++++++++++++++++++ 3 files changed, 177 insertions(+), 115 deletions(-) create mode 100644 PWGMM/Lumi/Tasks/lumiZdcQa.cxx diff --git a/PWGMM/Lumi/Tasks/CMakeLists.txt b/PWGMM/Lumi/Tasks/CMakeLists.txt index 5bd93ae27d8..000f831a5c8 100644 --- a/PWGMM/Lumi/Tasks/CMakeLists.txt +++ b/PWGMM/Lumi/Tasks/CMakeLists.txt @@ -50,3 +50,8 @@ o2physics_add_dpl_workflow(lumi-stability-p-p SOURCES lumiStabilityPP.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCCDB O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(lumi-zdc-qa + SOURCES lumiZdcQa.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCCDB O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx index d267dbfb83f..068801a64c5 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx @@ -56,30 +56,9 @@ using namespace o2::framework::expressions; o2::common::core::MetadataHelper metadataInfo; -namespace o2::aod -{ -namespace myBc_aod -{ -DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t); -DECLARE_SOA_COLUMN(BCid, bcId, int); -DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); -DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); -DECLARE_SOA_COLUMN(AmplitudeZNA, amplitudeZNA, float); -DECLARE_SOA_COLUMN(AmplitudeZNC, amplitudeZNC, float); -} // namespace myBc_aod -DECLARE_SOA_TABLE(MyBCaod, "AOD", "MYBCAOD", - myBc_aod::Timestamp, - myBc_aod::BCid, - myBc_aod::TimeZNA, - myBc_aod::TimeZNC, - myBc_aod::AmplitudeZNA, - myBc_aod::AmplitudeZNC); -} // namespace o2::aod - using MyBCs = soa::Join; struct LumiStabilityLightIons { - Produces BCaod; Configurable cfgDoFT0Vtx{"cfgDoFT0Vtx", true, "Create and fill histograms for the FT0 vertex trigger"}; Configurable cfgDoFT0CE{"cfgDoFT0CE", true, "Create and fill histograms for the FT0 centrality trigger"}; @@ -99,20 +78,12 @@ struct LumiStabilityLightIons { Configurable cfgDoBCNSLFDD{"cfgDoBCNSLFDD", true, "Create and fill histograms for non-super-leading BCs w.r.t. FDD activity"}; Configurable cfgDoBCNSLFT0{"cfgDoBCNSLFT0", true, "Create and fill histograms for non-super-leading BCs w.r.t. FT0 activity"}; - Configurable cfgRequireZDCTriggerForZDCQA{"cfgRequireZDCTriggerForZDCQA", true, "Require ZDC trigger (1ZNC) for filling QA histograms"}; - Configurable cfgRequireTVXTriggerForZDCQA{"cfgRequireTVXTriggerForZDCQA", true, "Require FT0 vertex trigger (MTVX) for filling ZDC QA histograms"}; - Configurable cfgRequireZEDTriggerForZDCQA{"cfgRequireZEDTriggerForZDCQA", true, "Require ZED trigger (1ZNC||1ZNA) for filling QA histograms"}; - Configurable cfgRequireNoT0ForSLBC{"cfgRequireNoT0ForSLBC", false, "Require no T0 signal for definition of super leading BC (otherwise only no FDD)"}; Configurable cfgEmptyBCsBeforeLeadingBC{"cfgEmptyBCsBeforeLeadingBC", 5, "Minimum number of non-B BCs before a BCL leading BC"}; Configurable cfgEmptyBCsBeforeLeadingBCLE{"cfgEmptyBCsBeforeLeadingBCLE", 5, "Minimum number of strictly empty (E-type) BCs before a BCLE leading BC"}; Configurable cfgBCsBeforeSuperLeading{"cfgBCsBeforeSuperLeading", 5, "Minimum number of BCs without FDD/FT0 activity before a super-leading BC"}; - Configurable cfgFillBCao2d{"cfgFillBCao2d", false, "Fill BC ao2d with timestamps and ZDC times"}; - Configurable cfgTstampStartFillingBCao2d{"cfgTstampStartFillingBCao2d", 0, "Minimum value of timestamp for output bc ao2d to be filled"}; - Configurable cfgTstampEndFillingBCao2d{"cfgTstampEndFillingBCao2d", 0, "Maximum value of timestamp for output bc ao2d to be filled"}; - Configurable cfgBcShiftFDDForData2023{"cfgBcShiftFDDForData2023", 7, "Number of BCs to shift FDD, applied for 2023 data only"}; std::bitset beamPatternA, beamPatternC; @@ -156,7 +127,7 @@ struct LumiStabilityLightIons { kBCNSLFT0 = 11 }; - static constexpr std::string_view NBCsVsTimeHistNames[6][12] = { + static constexpr std::string_view NBCsVsTimeHistNames[5][12] = { {"AllBCs/BC_A/nBCsVsTime", "AllBCs/BC_B/nBCsVsTime", "AllBCs/BC_C/nBCsVsTime", "AllBCs/BC_E/nBCsVsTime", "AllBCs/BC_L/nBCsVsTime", "AllBCs/BC_LE/nBCsVsTime", "AllBCs/BC_NL/nBCsVsTime", "AllBCs/BC_NLE/nBCsVsTime", "AllBCs/BC_SL_FDD/nBCsVsTime", "AllBCs/BC_SL_FT0/nBCsVsTime", "AllBCs/BC_NSL_FDD/nBCsVsTime", "AllBCs/BC_NSL_FT0/nBCsVsTime"}, {"FT0VTx/BC_A/nBCsVsTime", "FT0VTx/BC_B/nBCsVsTime", "FT0VTx/BC_C/nBCsVsTime", "FT0VTx/BC_E/nBCsVsTime", "FT0VTx/BC_L/nBCsVsTime", "FT0VTx/BC_LE/nBCsVsTime", "FT0VTx/BC_NL/nBCsVsTime", "FT0VTx/BC_NLE/nBCsVsTime", "FT0VTx/BC_SL_FDD/nBCsVsTime", "FT0VTx/BC_SL_FT0/nBCsVsTime", "FT0VTx/BC_NSL_FDD/nBCsVsTime", "FT0VTx/BC_NSL_FT0/nBCsVsTime"}, {"FT0CE/BC_A/nBCsVsTime", "FT0CE/BC_B/nBCsVsTime", "FT0CE/BC_C/nBCsVsTime", "FT0CE/BC_E/nBCsVsTime", "FT0CE/BC_L/nBCsVsTime", "FT0CE/BC_LE/nBCsVsTime", "FT0CE/BC_NL/nBCsVsTime", "FT0CE/BC_NLE/nBCsVsTime", "FT0CE/BC_SL_FDD/nBCsVsTime", "FT0CE/BC_SL_FT0/nBCsVsTime", "FT0CE/BC_NSL_FDD/nBCsVsTime", "FT0CE/BC_NSL_FT0/nBCsVsTime"}, @@ -220,10 +191,7 @@ struct LumiStabilityLightIons { (iBCCategory == kBCNSLFDD && cfgDoBCNSLFDD) || (iBCCategory == kBCNSLFT0 && cfgDoBCNSLFT0)) { mHistManager.add(Form("%s", std::string(NBCsVsTimeHistNames[iTrigger][iBCCategory]).c_str()), "Time of triggered BCs since the start of fill;#bf{t-t_{SOF} (min)};#bf{#it{N}_{BC}}", HistType::kTH1D, {timeAxis}); mHistManager.add(Form("%s", std::string(NBCsVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), "BC ID of triggered BCs;#bf{BC ID in orbit};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); - mInspectedHistos[iTrigger][iBCCategory] = mHistManager.add( - Form("%s", std::string(NBCsInspectedVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), - "Inspected BC ID (denominator for mu);#bf{BC ID in orbit};#bf{#it{N}_{BC}}", - HistType::kTH1D, {bcIDAxis}); + mInspectedHistos[iTrigger][iBCCategory] = mHistManager.add(Form("%s", std::string(NBCsInspectedVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), "Inspected BC ID (denominator for mu);#bf{BC ID in orbit};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); } } } @@ -246,19 +214,6 @@ struct LumiStabilityLightIons { mHistManager.add("FT0Vtx_EvSel/nBCsVsTime", "Time of TVX triggered BCs since the start of fill;;#bf{#it{N}_{BC}}", HistType::kTH1D, {timeAxis}); mHistManager.add("nBCsVsBCID", "Time of TVX triggered BCs since the start of fill;#bf{t-t_{SOF} (min)};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); mHistManager.add("TFsPerMinute", "TFs seen in this minute (to account for failed jobs);#bf{t-t_{SOF} (min)};#bf{#it{N}_{TFs}}", HistType::kTH1D, {timeAxis}); - - if (cfgDo1ZNC) { - AxisSpec zdcTimeAxis{200, -50., 50.}; - mHistManager.add("ZDCQA/BCHasZDC", "Does the BC have ZDC?;BC has ZDC;Has ZNC according to CTP;#bf{#it{N}_{BC}}", HistType::kTH2D, {{2, -0.5, 1.5}, {2, -0.5, 1.5}}); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(1, "No CTP trigger"); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(2, "CTP triggered"); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(1, "No found ZDC"); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(2, "Good ZDC"); - mHistManager.add("ZDCQA/ZNCTimeVsEnergy", "ZDC properties in BCs with found ZDC;Energy;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH2D, {{1501, -10, 1.5E4}, zdcTimeAxis}); - mHistManager.add("ZDCQA/ZDCTimes", "Correlation between ZNA and ZNC timing;#bf{ZNC arrival time (ns)};#bf{ZNA arrival time (ns)}", HistType::kTH2D, {zdcTimeAxis, zdcTimeAxis}); - mHistManager.add("ZDCQA/ZNATime", "Time of the ZNA signal;#bf{ZNA arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); - mHistManager.add("ZDCQA/ZNCTime", "Time of the ZNC signal;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); - } } void setLHCIFData(const auto& bc) @@ -431,64 +386,6 @@ struct LumiStabilityLightIons { } } - void processZDCQA(MyBCs const& bcs, aod::Zdcs const&) - { - const int maxTimeZDC = 50; - const float dummyZDCTime = 42.f; - - for (const auto& bc : bcs) { - std::bitset<64> ctpInputMask(bc.inputMask()); - - if (cfgRequireTVXTriggerForZDCQA && !(ctpInputMask.test(2))) { - continue; - } - if (cfgRequireZDCTriggerForZDCQA && !(ctpInputMask.test(25))) { - continue; - } - if (cfgRequireZEDTriggerForZDCQA && !(ctpInputMask.test(24))) { - continue; - } - - bool zdcHit = !bc.has_zdc() ? 0 : ((bc.zdc().energyCommonZNC() > -1 && std::abs(bc.zdc().timeZNC()) < 1E5) ? 1 : 0); - mHistManager.fill(HIST("ZDCQA/BCHasZDC"), zdcHit, ctpInputMask.test(25) ? 1 : 0); - - if (!bc.has_zdc()) { - continue; - } - - mHistManager.fill(HIST("ZDCQA/ZNCTimeVsEnergy"), - bc.zdc().energyCommonZNC() > -1 ? bc.zdc().energyCommonZNC() : -1, - std::abs(bc.zdc().timeZNC()) < maxTimeZDC ? bc.zdc().timeZNC() : dummyZDCTime); - - float timeZNA = bc.zdc().timeZNA(); - float timeZNC = bc.zdc().timeZNC(); - - if (std::abs(timeZNA) > maxTimeZDC) { - timeZNA = dummyZDCTime; - mHistManager.fill(HIST("ZDCQA/ZNCTime"), timeZNC); - } - if (std::abs(timeZNC) > maxTimeZDC) { - timeZNC = dummyZDCTime; - if (timeZNA != dummyZDCTime) { - mHistManager.fill(HIST("ZDCQA/ZNATime"), timeZNA); - } - } - - mHistManager.fill(HIST("ZDCQA/ZDCTimes"), timeZNA, timeZNC); - - uint64_t timestamp = bc.timestamp(); - int64_t globalBC = bc.globalBC(); - int localBC = globalBC % nBCsPerOrbit; - float amplitudeZNA = bc.zdc().amplitudeZNA(); - float amplitudeZNC = bc.zdc().amplitudeZNC(); - - if (cfgFillBCao2d && timestamp >= cfgTstampStartFillingBCao2d && timestamp <= cfgTstampEndFillingBCao2d) { - BCaod(timestamp, localBC, timeZNA, timeZNC, amplitudeZNA, amplitudeZNC); - } - } - } - PROCESS_SWITCH(LumiStabilityLightIons, processZDCQA, "process QA for the ZDC triggers (light ions and PbPb)", false); - void process(MyBCs const& bcs, aod::FT0s const&, aod::FDDs const&) { DenomCounter nBCsPerBcId(nBCsPerOrbit); @@ -499,17 +396,15 @@ struct LumiStabilityLightIons { } for (const auto& bc : bcs) { - if (bc.timestamp() == 0) { + if (bc.timestamp() == 0) continue; - } setLHCIFData(bc); float timeSinceSOF = getTimeSinceSOF(bc); - if (bc.selection_bit(aod::evsel::kIsTriggerTVX)) { + if (bc.selection_bit(aod::evsel::kIsTriggerTVX)) mHistManager.fill(HIST("FT0Vtx_EvSel/nBCsVsTime"), timeSinceSOF); - } int64_t globalBC = bc.globalBC(); int localBC = static_cast(globalBC % nBCsPerOrbit); @@ -541,9 +436,8 @@ struct LumiStabilityLightIons { int64_t globalBCStart = (globalBCLastInspectedBC >= 0 && globalBCLastInspectedBC < globalBC) ? globalBCLastInspectedBC + 1 : globalBC; const int64_t maxBcGap = 2LL * nBCsPerOrbit; - if (globalBC - globalBCStart > maxBcGap) { + if (globalBC - globalBCStart > maxBcGap) globalBCStart = globalBC; - } for (int64_t iGBC = globalBCStart; iGBC <= globalBC; ++iGBC) { const int iLBC = static_cast((iGBC % nBCsPerOrbit + nBCsPerOrbit) % nBCsPerOrbit); @@ -578,12 +472,10 @@ struct LumiStabilityLightIons { } } - if (anyFDDTrigger) { + if (anyFDDTrigger) globalBCIdOfLastBCWithActivityFDD = globalBCFDD; - } - if (anyFT0Trigger) { + if (anyFT0Trigger) globalBCIdOfLastBCWithActivityFT0 = globalBC; - } globalBCLastInspectedBC = globalBC; diff --git a/PWGMM/Lumi/Tasks/lumiZdcQa.cxx b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx new file mode 100644 index 00000000000..80f2012a164 --- /dev/null +++ b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx @@ -0,0 +1,165 @@ +// 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. +// +/// \file lumiStabilityLightIons.cxx +/// \brief Analysis over BCs to study the luminosity stability along time +/// +/// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt +/// \author Stefanie Mrozinski (stefanie.mrozinski@cern.ch) - Goethe University Frankfurt +/// \author Lorenzo Mattei (lorenzo.mattei@cern.ch) - Turin University + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/MetadataHelper.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +o2::common::core::MetadataHelper metadataInfo; + +namespace o2::aod +{ +namespace myBc_aod +{ +DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t); +DECLARE_SOA_COLUMN(BCid, bcId, int); +DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); +DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); +DECLARE_SOA_COLUMN(AmplitudeZNA, amplitudeZNA, float); +DECLARE_SOA_COLUMN(AmplitudeZNC, amplitudeZNC, float); +} // namespace myBc_aod +DECLARE_SOA_TABLE(MyBCaod, "AOD", "MYBCAOD", + myBc_aod::Timestamp, + myBc_aod::BCid, + myBc_aod::TimeZNA, + myBc_aod::TimeZNC, + myBc_aod::AmplitudeZNA, + myBc_aod::AmplitudeZNC); +} // namespace o2::aod + +using MyBCs = soa::Join; + +struct LumiZdcQa { + Produces BCaod; + + Configurable cfgRequireZDCTriggerForZDCQA{"cfgRequireZDCTriggerForZDCQA", true, "Require ZDC trigger (1ZNC) for filling QA histograms"}; + Configurable cfgRequireTVXTriggerForZDCQA{"cfgRequireTVXTriggerForZDCQA", true, "Require FT0 vertex trigger (MTVX) for filling ZDC QA histograms"}; + Configurable cfgRequireZEDTriggerForZDCQA{"cfgRequireZEDTriggerForZDCQA", true, "Require ZED trigger (1ZNC||1ZNA) for filling QA histograms"}; + + Configurable cfgFillBCao2d{"cfgFillBCao2d", false, "Fill BC ao2d with timestamps and ZDC times"}; + Configurable cfgTstampStartFillingBCao2d{"cfgTstampStartFillingBCao2d", 0, "Minimum value of timestamp for output bc ao2d to be filled"}; + Configurable cfgTstampEndFillingBCao2d{"cfgTstampEndFillingBCao2d", 0, "Maximum value of timestamp for output bc ao2d to be filled"}; + + const int nBCsPerOrbit = 3564; + + HistogramRegistry mHistManager{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + + void init(InitContext&) + { + AxisSpec zdcTimeAxis{200, -50., 50.}; + mHistManager.add("ZDCQA/BCHasZDC", "Does the BC have ZDC?;BC has ZDC;Has ZNC according to CTP;#bf{#it{N}_{BC}}", HistType::kTH2D, {{2, -0.5, 1.5}, {2, -0.5, 1.5}}); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(1, "No CTP trigger"); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(2, "CTP triggered"); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(1, "No found ZDC"); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(2, "Good ZDC"); + mHistManager.add("ZDCQA/ZNCTimeVsEnergy", "ZDC properties in BCs with found ZDC;Energy;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH2D, {{1501, -10, 1.5E4}, zdcTimeAxis}); + mHistManager.add("ZDCQA/ZDCTimes", "Correlation between ZNA and ZNC timing;#bf{ZNC arrival time (ns)};#bf{ZNA arrival time (ns)}", HistType::kTH2D, {zdcTimeAxis, zdcTimeAxis}); + mHistManager.add("ZDCQA/ZNATime", "Time of the ZNA signal;#bf{ZNA arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); + mHistManager.add("ZDCQA/ZNCTime", "Time of the ZNC signal;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); + } + + void process(MyBCs const& bcs, aod::Zdcs const&) + { + const int maxTimeZDC = 50; + const float dummyZDCTime = 42.f; + + for (const auto& bc : bcs) { + std::bitset<64> ctpInputMask(bc.inputMask()); + + if (cfgRequireTVXTriggerForZDCQA && !(ctpInputMask.test(2))) { + continue; + } + if (cfgRequireZDCTriggerForZDCQA && !(ctpInputMask.test(25))) { + continue; + } + if (cfgRequireZEDTriggerForZDCQA && !(ctpInputMask.test(24))) { + continue; + } + + bool zdcHit = !bc.has_zdc() ? 0 : ((bc.zdc().energyCommonZNC() > -1 && std::abs(bc.zdc().timeZNC()) < 1E5) ? 1 : 0); + mHistManager.fill(HIST("ZDCQA/BCHasZDC"), zdcHit, ctpInputMask.test(25) ? 1 : 0); + + if (!bc.has_zdc()) { + continue; + } + + mHistManager.fill(HIST("ZDCQA/ZNCTimeVsEnergy"), + bc.zdc().energyCommonZNC() > -1 ? bc.zdc().energyCommonZNC() : -1, + std::abs(bc.zdc().timeZNC()) < maxTimeZDC ? bc.zdc().timeZNC() : dummyZDCTime); + + float timeZNA = bc.zdc().timeZNA(); + float timeZNC = bc.zdc().timeZNC(); + + if (std::abs(timeZNA) > maxTimeZDC) { + timeZNA = dummyZDCTime; + mHistManager.fill(HIST("ZDCQA/ZNCTime"), timeZNC); + } + if (std::abs(timeZNC) > maxTimeZDC) { + timeZNC = dummyZDCTime; + if (timeZNA != dummyZDCTime) { + mHistManager.fill(HIST("ZDCQA/ZNATime"), timeZNA); + } + } + + mHistManager.fill(HIST("ZDCQA/ZDCTimes"), timeZNA, timeZNC); + + uint64_t timestamp = bc.timestamp(); + int64_t globalBC = bc.globalBC(); + int localBC = globalBC % nBCsPerOrbit; + float amplitudeZNA = bc.zdc().amplitudeZNA(); + float amplitudeZNC = bc.zdc().amplitudeZNC(); + + if (cfgFillBCao2d && timestamp >= cfgTstampStartFillingBCao2d && timestamp <= cfgTstampEndFillingBCao2d) { + BCaod(timestamp, localBC, timeZNA, timeZNC, amplitudeZNA, amplitudeZNC); + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + metadataInfo.initMetadata(cfgc); + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 641568388aa8653d4942ba81f60363e3d695a2fa Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:15:02 +0200 Subject: [PATCH 161/282] [PWGCF] Refresh naming convention of table producer (#15620) --- .../DataModel/LongRangeDerived.h | 96 ++++++++--------- .../TableProducer/longrangeMaker.cxx | 102 +++++++++--------- .../Tasks/longrangecorrDerived.cxx | 58 +++++----- 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h b/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h index f9b79242ac0..8dd31e82aa1 100644 --- a/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h +++ b/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h @@ -34,16 +34,16 @@ DECLARE_SOA_COLUMN(TotalFV0AmplitudeA, totalFV0AmplitudeA, float); //! sum of am DECLARE_SOA_COLUMN(GapSide, gapSide, uint8_t); // 0 for side A, 1 for side C, 2 for both sides } // namespace lrcorrcolltable -DECLARE_SOA_TABLE(CollLRTables, "AOD", "COLLLRTABLE", +DECLARE_SOA_TABLE(LRCollisions, "AOD", "LRCOLLISION", o2::soa::Index<>, bc::RunNumber, lrcorrcolltable::Zvtx, lrcorrcolltable::Multiplicity, lrcorrcolltable::Centrality, timestamp::Timestamp); -using CollLRTable = CollLRTables::iterator; +using LRCollision = LRCollisions::iterator; -DECLARE_SOA_TABLE(UpcCollLRTables, "AOD", "UPCCOLLLRTABLE", +DECLARE_SOA_TABLE(UpcLRCollisions, "AOD", "UPCLRCOLLISION", o2::soa::Index<>, bc::GlobalBC, bc::RunNumber, @@ -52,30 +52,30 @@ DECLARE_SOA_TABLE(UpcCollLRTables, "AOD", "UPCCOLLLRTABLE", lrcorrcolltable::TotalFT0AmplitudeA, lrcorrcolltable::TotalFT0AmplitudeC, lrcorrcolltable::TotalFV0AmplitudeA); -using UpcCollLRTable = UpcCollLRTables::iterator; +using UpcLRCollision = UpcLRCollisions::iterator; -DECLARE_SOA_TABLE(UpcSgCollLRTables, "AOD", "UPCSGCOLLLRTABLE", +DECLARE_SOA_TABLE(UpcSgLRCollisions, "AOD", "UPCSGLRCOLLISION", lrcorrcolltable::GapSide); -using UpcSgCollLRTable = UpcSgCollLRTables::iterator; +using UpcSgLRCollision = UpcSgLRCollisions::iterator; namespace lrcorrzdctable { -DECLARE_SOA_INDEX_COLUMN(UpcCollLRTable, upcCollLRTable); +DECLARE_SOA_INDEX_COLUMN(UpcLRCollision, upcLRCollision); DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); } // namespace lrcorrzdctable -DECLARE_SOA_TABLE(ZdcLRTables, "AOD", "ZDCLRTABLE", +DECLARE_SOA_TABLE(LRZdcs, "AOD", "LRZDC", o2::soa::Index<>, - lrcorrzdctable::UpcCollLRTableId, + lrcorrzdctable::UpcLRCollisionId, lrcorrzdctable::EnergyCommonZNA, lrcorrzdctable::EnergyCommonZNC); -using ZdcLRTable = ZdcLRTables::iterator; +using LRZdc = LRZdcs::iterator; namespace lrcorrtrktable { -DECLARE_SOA_INDEX_COLUMN(CollLRTable, collLRTable); -DECLARE_SOA_INDEX_COLUMN(UpcCollLRTable, upcCollLRTable); +DECLARE_SOA_INDEX_COLUMN(LRCollision, lrCollision); +DECLARE_SOA_INDEX_COLUMN(UpcLRCollision, upcLRCollision); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); @@ -99,36 +99,36 @@ enum V0TrackPid { }; } // namespace lrcorrtrktable -DECLARE_SOA_TABLE(TrkLRTables, "AOD", "TRKLRTABLE", +DECLARE_SOA_TABLE(LRMidTracks, "AOD", "LRMIDTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi, lrcorrtrktable::TrackType); -using TrkLRTable = TrkLRTables::iterator; +using LRMidTrack = LRMidTracks::iterator; -DECLARE_SOA_TABLE(Ft0aLRTables, "AOD", "FT0ALRTABLE", +DECLARE_SOA_TABLE(LRFt0aTracks, "AOD", "LRFT0ATRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0aLRTable = Ft0aLRTables::iterator; +using LRFt0aTrack = LRFt0aTracks::iterator; -DECLARE_SOA_TABLE(Ft0cLRTables, "AOD", "FT0CLRTABLE", +DECLARE_SOA_TABLE(LRFt0cTracks, "AOD", "LRFT0CTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0cLRTable = Ft0cLRTables::iterator; +using LRFt0cTrack = LRFt0cTracks::iterator; -DECLARE_SOA_TABLE(V0TrkLRTables, "AOD", "V0TRKLRTABLE", +DECLARE_SOA_TABLE(LRV0Tracks, "AOD", "LRV0TRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::IdPos, lrcorrtrktable::IdNeg, lrcorrtrktable::Pt, @@ -136,54 +136,54 @@ DECLARE_SOA_TABLE(V0TrkLRTables, "AOD", "V0TRKLRTABLE", lrcorrtrktable::Phi, lrcorrtrktable::InvMass, lrcorrtrktable::V0Type); -using V0TrkLRTable = V0TrkLRTables::iterator; +using LRV0Track = LRV0Tracks::iterator; -DECLARE_SOA_TABLE(MftTrkLRTables, "AOD", "MFTTRKLRTABLE", +DECLARE_SOA_TABLE(LRMftTracks, "AOD", "LRMFTTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftTrkLRTable = MftTrkLRTables::iterator; +using LRMftTrack = LRMftTracks::iterator; -DECLARE_SOA_TABLE(MftBestTrkLRTables, "AOD", "MFTBESTTRKLRTABLE", +DECLARE_SOA_TABLE(LRMftBestTracks, "AOD", "LRMFTBESTTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftBestTrkLRTable = MftBestTrkLRTables::iterator; +using LRMftBestTrack = LRMftBestTracks::iterator; -DECLARE_SOA_TABLE(TrkLRUpcTables, "AOD", "TRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRMidTracks, "AOD", "UPCLRMIDTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi, lrcorrtrktable::TrackType); -using TrkLRUpcTable = TrkLRUpcTables::iterator; +using UpcLRMidTrack = UpcLRMidTracks::iterator; -DECLARE_SOA_TABLE(Ft0aLRUpcTables, "AOD", "FT0ALRUpcTABLE", +DECLARE_SOA_TABLE(UpcLRFt0aTracks, "AOD", "UPCLRFT0ATRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0aLRUpcTable = Ft0aLRUpcTables::iterator; +using UpcLRFt0aTrack = UpcLRFt0aTracks::iterator; -DECLARE_SOA_TABLE(Ft0cLRUpcTables, "AOD", "FT0CLRUpcTABLE", +DECLARE_SOA_TABLE(UpcLRFt0cTracks, "AOD", "UPCLRFT0CTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0cLRUpcTable = Ft0cLRUpcTables::iterator; +using UpcLRFt0cTrack = UpcLRFt0cTracks::iterator; -DECLARE_SOA_TABLE(V0TrkLRUpcTables, "AOD", "V0TRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRV0Tracks, "AOD", "UPCLRV0TRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::IdPos, lrcorrtrktable::IdNeg, lrcorrtrktable::Pt, @@ -191,23 +191,23 @@ DECLARE_SOA_TABLE(V0TrkLRUpcTables, "AOD", "V0TRKLRUPCTABLE", lrcorrtrktable::Phi, lrcorrtrktable::InvMass, lrcorrtrktable::V0Type); -using V0TrkLRUpcTable = V0TrkLRUpcTables::iterator; +using UpcLRV0Track = UpcLRV0Tracks::iterator; -DECLARE_SOA_TABLE(MftTrkLRUpcTables, "AOD", "MFTTRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRMftTracks, "AOD", "UPCLRMFTTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftTrkLRUpcTable = MftTrkLRUpcTables::iterator; +using UpcLRMftTrack = UpcLRMftTracks::iterator; -DECLARE_SOA_TABLE(MftBestTrkLRUpcTables, "AOD", "MFTBESTTRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRMftBestTracks, "AOD", "UPCLRMFTBESTTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftBestTrkLRUpcTable = MftBestTrkLRUpcTables::iterator; +using UpcLRMftBestTrack = UpcLRMftBestTracks::iterator; } // namespace o2::aod diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx index a7d90746265..816eb4da038 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx @@ -233,24 +233,24 @@ struct LongrangeMaker { cfgSgCuts = (SGCutParHolder)sgCuts; } - Produces collisionLRTable; - Produces tracksLRTable; - Produces ft0aLRTable; - Produces ft0cLRTable; - Produces mftLRTable; - Produces mftbestLRTable; - Produces v0LRTable; - - Produces outupccol; - Produces outsgupccol; - Produces outzdctable; - - Produces tracksLRUpcTable; - Produces ft0aLRUpcTable; - Produces ft0cLRUpcTable; - Produces mftLRUpcTable; - Produces mftbestLRUpcTable; - Produces v0LRUpcTable; + Produces lrcollision; + Produces lrmidtracks; + Produces lrft0atracks; + Produces lrft0ctracks; + Produces lrmfttracks; + Produces lrmftbesttracks; + Produces lrv0tracks; + + Produces upclrcollision; + Produces upcsglrcollision; + Produces lrzdcs; + + Produces upclrmidtracks; + Produces upclrft0atracks; + Produces upclrft0ctracks; + Produces upclrmfttracks; + Produces upclrmftbesttracks; + Produces upclrv0tracks; Filter fTracksEta = nabs(aod::track::eta) < cfgtrksel.cfgEtaCut; Filter fTracksPt = (aod::track::pt > cfgtrksel.cfgPtCutMin) && (aod::track::pt < cfgtrksel.cfgPtCutMax); @@ -273,7 +273,7 @@ struct LongrangeMaker { auto centrality = selColCent(col); auto bc = col.bc_as(); - collisionLRTable(bc.runNumber(), col.posZ(), multiplicity, centrality, bc.timestamp()); + lrcollision(bc.runNumber(), col.posZ(), multiplicity, centrality, bc.timestamp()); // track loop for (const auto& track : tracks) { @@ -281,13 +281,13 @@ struct LongrangeMaker { continue; if (!myTrackFilter.IsSelected(track)) continue; - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); if (getTrackPID(track) == PionTrackN) - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); if (getTrackPID(track) == KaonTrackN) - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); if (getTrackPID(track) == ProtonTrackN) - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); } // ft0 loop @@ -298,14 +298,14 @@ struct LongrangeMaker { float ampl = ft0.amplitudeA()[iCh]; auto phi = getPhiFT0(chanelid, 0); auto eta = getEtaFT0(chanelid, 0); - ft0aLRTable(collisionLRTable.lastIndex(), chanelid, ampl, eta, phi); + lrft0atracks(lrcollision.lastIndex(), chanelid, ampl, eta, phi); } for (std::size_t iCh = 0; iCh < ft0.channelC().size(); iCh++) { auto chanelid = ft0.channelC()[iCh]; float ampl = ft0.amplitudeC()[iCh]; auto phi = getPhiFT0(chanelid, 1); auto eta = getEtaFT0(chanelid, 1); - ft0cLRTable(collisionLRTable.lastIndex(), chanelid, ampl, eta, phi); + lrft0ctracks(lrcollision.lastIndex(), chanelid, ampl, eta, phi); } } @@ -315,7 +315,7 @@ struct LongrangeMaker { continue; auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), phi); + lrmfttracks(lrcollision.lastIndex(), track.pt(), track.eta(), phi); } if (retracks.size() > 0) { @@ -329,7 +329,7 @@ struct LongrangeMaker { } auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftbestLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), phi); + lrmftbesttracks(lrcollision.lastIndex(), track.pt(), track.eta(), phi); } } @@ -344,8 +344,8 @@ struct LongrangeMaker { // K0short if (isSelectK0s(col, v0)) { // candidate is K0s - v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); + lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); } // Lambda and Anti-Lambda @@ -355,13 +355,13 @@ struct LongrangeMaker { // Note: candidate compatible with Lambda and Anti-Lambda hypothesis are counted twice (once for each hypothesis) if (lambdaTag) { // candidate is Lambda massV0 = v0.mLambda(); - v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); + lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); } if (antilambdaTag) { // candidate is Anti-lambda massV0 = v0.mAntiLambda(); - v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); + lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); } // end of Lambda and Anti-Lambda processing } } // process function @@ -398,13 +398,13 @@ struct LongrangeMaker { upchelpers::FITInfo fitInfo{}; udhelpers::getFITinfo(fitInfo, newbc, bcs, ft0s, fv0as, fdds); auto multiplicity = countNTracks(tracks); - outupccol(bc.globalBC(), bc.runNumber(), col.posZ(), multiplicity, fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFV0A); - outsgupccol(issgevent); + upclrcollision(bc.globalBC(), bc.runNumber(), col.posZ(), multiplicity, fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFV0A); + upcsglrcollision(issgevent); if (newbc.has_zdc()) { auto zdc = newbc.zdc(); - outzdctable(outupccol.lastIndex(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); + lrzdcs(upclrcollision.lastIndex(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); } else { - outzdctable(outupccol.lastIndex(), -999, -999); + lrzdcs(upclrcollision.lastIndex(), -999, -999); } // track loop @@ -413,13 +413,13 @@ struct LongrangeMaker { continue; if (!myTrackFilter.IsSelected(track)) continue; - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); if (getTrackPID(track) == PionTrackN) - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); if (getTrackPID(track) == KaonTrackN) - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); if (getTrackPID(track) == ProtonTrackN) - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); } // ft0 loop @@ -430,14 +430,14 @@ struct LongrangeMaker { float ampl = ft0.amplitudeA()[iCh]; auto phi = getPhiFT0(chanelid, 0); auto eta = getEtaFT0(chanelid, 0); - ft0aLRUpcTable(outupccol.lastIndex(), chanelid, ampl, eta, phi); + upclrft0atracks(upclrcollision.lastIndex(), chanelid, ampl, eta, phi); } for (std::size_t iCh = 0; iCh < ft0.channelC().size(); iCh++) { auto chanelid = ft0.channelC()[iCh]; float ampl = ft0.amplitudeC()[iCh]; auto phi = getPhiFT0(chanelid, 1); auto eta = getEtaFT0(chanelid, 1); - ft0cLRUpcTable(outupccol.lastIndex(), chanelid, ampl, eta, phi); + upclrft0ctracks(upclrcollision.lastIndex(), chanelid, ampl, eta, phi); } } @@ -447,7 +447,7 @@ struct LongrangeMaker { continue; auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), phi); + upclrmfttracks(upclrcollision.lastIndex(), track.pt(), track.eta(), phi); } if (retracks.size() > 0) { @@ -461,7 +461,7 @@ struct LongrangeMaker { } auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftbestLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), phi); + upclrmftbesttracks(upclrcollision.lastIndex(), track.pt(), track.eta(), phi); } } @@ -476,8 +476,8 @@ struct LongrangeMaker { // K0short if (isSelectK0s(col, v0)) { // candidate is K0s - v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); + upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); } // Lambda and Anti-Lambda @@ -487,13 +487,13 @@ struct LongrangeMaker { // Note: candidate compatible with Lambda and Anti-Lambda hypothesis are counted twice (once for each hypothesis) if (lambdaTag) { // candidate is Lambda massV0 = v0.mLambda(); - v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); + upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); } if (antilambdaTag) { // candidate is Anti-lambda massV0 = v0.mAntiLambda(); - v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); + upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); } // end of Lambda and Anti-Lambda processing } } // SG events diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index 977f534729a..9d759b1695a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx @@ -117,35 +117,35 @@ struct LongrangecorrDerived { OutputObj same{"sameEvent"}; OutputObj mixed{"mixedEvent"}; - using CollsTable = aod::CollLRTables; - using TrksTable = aod::TrkLRTables; - using MftTrksTable = aod::MftTrkLRTables; - using Ft0aTrksTable = aod::Ft0aLRTables; - using Ft0cTrksTable = aod::Ft0cLRTables; - using MftbestTrksTable = aod::MftBestTrkLRTables; - using V0TrksTable = aod::V0TrkLRTables; - - using UpcCollsTable = soa::Join; - using TrksUpcTable = aod::TrkLRUpcTables; - using MftTrksUpcTable = aod::MftTrkLRUpcTables; - using Ft0aTrksUpcTable = aod::Ft0aLRUpcTables; - using Ft0cTrksUpcTable = aod::Ft0cLRUpcTables; - using MftbestTrksUpcTable = aod::MftBestTrkLRUpcTables; - using V0TrksUpcTable = aod::V0TrkLRUpcTables; - - Preslice perColTpc = aod::lrcorrtrktable::collLRTableId; - Preslice perColMft = aod::lrcorrtrktable::collLRTableId; - Preslice perColMftbest = aod::lrcorrtrktable::collLRTableId; - Preslice perColFt0a = aod::lrcorrtrktable::collLRTableId; - Preslice perColFt0c = aod::lrcorrtrktable::collLRTableId; - Preslice perColV0 = aod::lrcorrtrktable::collLRTableId; - - Preslice perUpcColTpc = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColMft = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColMftbest = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColFt0a = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColFt0c = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColV0 = aod::lrcorrtrktable::upcCollLRTableId; + using CollsTable = aod::LRCollisions; + using TrksTable = aod::LRMidTracks; + using MftTrksTable = aod::LRMftTracks; + using Ft0aTrksTable = aod::LRFt0aTracks; + using Ft0cTrksTable = aod::LRFt0cTracks; + using MftbestTrksTable = aod::LRMftBestTracks; + using V0TrksTable = aod::LRV0Tracks; + + using UpcCollsTable = soa::Join; + using TrksUpcTable = aod::UpcLRMidTracks; + using MftTrksUpcTable = aod::UpcLRMftTracks; + using Ft0aTrksUpcTable = aod::UpcLRFt0aTracks; + using Ft0cTrksUpcTable = aod::UpcLRFt0cTracks; + using MftbestTrksUpcTable = aod::UpcLRMftBestTracks; + using V0TrksUpcTable = aod::UpcLRV0Tracks; + + Preslice perColTpc = aod::lrcorrtrktable::lrCollisionId; + Preslice perColMft = aod::lrcorrtrktable::lrCollisionId; + Preslice perColMftbest = aod::lrcorrtrktable::lrCollisionId; + Preslice perColFt0a = aod::lrcorrtrktable::lrCollisionId; + Preslice perColFt0c = aod::lrcorrtrktable::lrCollisionId; + Preslice perColV0 = aod::lrcorrtrktable::lrCollisionId; + + Preslice perUpcColTpc = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColMft = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColMftbest = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColFt0a = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColFt0c = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColV0 = aod::lrcorrtrktable::upcLRCollisionId; void init(InitContext const&) { From 7a4c85f8dbcb6776012a1ab19663a6cff8a90834 Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:15:25 +0200 Subject: [PATCH 162/282] [PWGCF] flowSP: Add constant limit to tight DCA cut (same as XY) (#15608) --- PWGCF/Flow/Tasks/flowSP.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index d863773ce4c..2880cd75b7b 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -127,8 +127,9 @@ struct FlowSP { // Additional track Selections O2_DEFINE_CONFIGURABLE(cfgTrackSelsUseAdditionalTrackCut, bool, false, "Bool to enable Additional Track Cut"); O2_DEFINE_CONFIGURABLE(cfgTrackSelsDoDCApt, bool, false, "Apply Pt dependent DCAz cut"); - O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt1, float, 0.1, "DcaZ < a * b / pt^1.1 -> this sets a"); - O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt2, float, 0.035, "DcaZ < a * b / pt^1.1 -> this sets b"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt1, float, 0.1, "DcaZ < const + (a * b) / pt^1.1 -> this sets a"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt2, float, 0.035, "DcaZ < const + (a * b) / pt^1.1 -> this sets b"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCAptConsMin, float, 0.1, "DcaZ < const + (a * b) / pt^1.1 -> this sets const"); O2_DEFINE_CONFIGURABLE(cfgTrackSelsPIDNsigma, float, 2.0, "nSigma cut for PID"); O2_DEFINE_CONFIGURABLE(cfgTrackSelDoTrackQAvsCent, bool, true, "Do track selection QA plots as function of centrality"); // harmonics for v coefficients @@ -1000,7 +1001,7 @@ struct FlowSP { if (track.dcaZ() > cfgTrackSelsDCAz) return false; - if (cfgTrackSelsDoDCApt && std::fabs(track.dcaZ()) > (cfgTrackSelsDCApt1 * cfgTrackSelsDCApt2) / (std::pow(track.pt(), 1.1))) + if (cfgTrackSelsDoDCApt && std::fabs(track.dcaZ()) > (cfgTrackSelsDCAptConsMin + (cfgTrackSelsDCApt1 * cfgTrackSelsDCApt2) / (std::pow(track.pt(), 1.1)))) return false; histos.fill(HIST("hTrackCount"), trackSel_DCAz); From d784f60514f5e1c6611704f7b81ca0850fec7a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:07:02 +0200 Subject: [PATCH 163/282] [ALICE3] Fix compilation errors in macros (#15631) --- ALICE3/Macros/drawFastTracker.C | 2 +- ALICE3/Macros/testFastTracker.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ALICE3/Macros/drawFastTracker.C b/ALICE3/Macros/drawFastTracker.C index f15ebaacc68..71f44970d37 100644 --- a/ALICE3/Macros/drawFastTracker.C +++ b/ALICE3/Macros/drawFastTracker.C @@ -75,7 +75,7 @@ void drawFastTracker(float magneticField = 5.f, // in units of kGauss fastTracker.AddLayer("B11", 100., 250, x0OB, xrhoOB, resRPhiOB, resZOB, eff, 1); } else { std::vector pixelRes{0.025, 0.025, 0.01, 0.01}; - fastTracker.AddSiliconALICE3v4(pixelRes); + // fastTracker.AddSiliconALICE3v4(pixelRes); // FIXME } fastTracker.Print(); diff --git a/ALICE3/Macros/testFastTracker.C b/ALICE3/Macros/testFastTracker.C index c07b7e3ac98..68d416295a8 100644 --- a/ALICE3/Macros/testFastTracker.C +++ b/ALICE3/Macros/testFastTracker.C @@ -27,7 +27,7 @@ void testFastTracker(std::string geometryFile = "a3geo.ini") // auto& ccdb = o2::ccdb::BasicCCDBManager::instance(); // ccdb.setURL("http://alice-ccdb.cern.ch"); o2::fastsim::FastTracker fastTracker; - fastTracker.AddGenericDetector(geometryFile); + // fastTracker.AddGenericDetector(geometryFile); // FIXME // fastTracker.AddGenericDetector(geometryFile, &ccdb); fastTracker.Print(); } From 295df1eb52288e07ea6be4d7e9eebab6acd17f63 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 3 Apr 2026 04:47:57 +0200 Subject: [PATCH 164/282] [PWGCF] DptDpt - Tracking particle origin at generator level (#15637) Co-authored-by: Victor Gonzalez --- .../Tasks/CMakeLists.txt | 4 + .../Tasks/particleOriginAnalysis.cxx | 454 ++++++++++++++++++ 2 files changed, 458 insertions(+) create mode 100644 PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 49b1a9573a4..0a12a77b2fe 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -103,4 +103,8 @@ o2physics_add_dpl_workflow(lambdacascadecorrelation PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(particle-origin-analysis + SOURCES particleOriginAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx new file mode 100644 index 00000000000..847ed0b46e0 --- /dev/null +++ b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx @@ -0,0 +1,454 @@ +// 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. + +/// \file particleOriginAnalysis.cxx +/// \brief Classifies filtered physical primary identified particles as prompt +/// (from string fragmentation) or from resonance decay by inspecting +/// the MC mother chain. Produces per-species prompt/decay fractions +/// and mother identity distributions vs pT and centrality. +/// Designed for generator-level MC studies of balance function +/// origin decomposition across collision systems. +/// Consumes the filtered tables produced by dptDptFilter. +/// \author victor.gonzalez.sebastian@gmail.com + +#include "PWGCF/Core/AnalysisConfigurableCuts.h" +#include "PWGCF/DataModel/DptDptFiltered.h" +#include "PWGCF/TableProducer/dptDptFilter.h" + +#include "Common/Core/TableHelper.h" + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/runDataProcessing.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::soa; +using namespace o2::framework::expressions; + +#define FORMATSTRING(theformat, theparams...) TString::Format(theformat, theparams).Data() + +namespace particleorigintask +{ +using namespace o2::analysis::dptdptfilter; + +// ============================================================================ +// Compact encoding of the mother resonance identity +// ============================================================================ +enum MotherSpecies { + kMothPrompt = 0, ///< not from decay (prompt from hadronization) + kMothRho0, ///< rho0(770) - PDG 113 + kMothRhoCharged, ///< rho+/-(770) - PDG 213 + kMothOmega782, ///< omega(782) - PDG 223 + kMothEta, ///< eta - PDG 221 + kMothEtaPrime, ///< eta'(958) - PDG 331 + kMothKStar892Ch, ///< K*(892)+/- - PDG 323 + kMothKStar892_0, ///< K*(892)0 - PDG 313 + kMothPhi1020, ///< phi(1020) - PDG 333 + kMothDelta, ///< Delta(1232) all - PDG 1114,2114,2214,2224 + kMothSigmaStar, ///< Sigma*(1385) - PDG 3114,3214,3224 + kMothLambda1520, ///< Lambda(1520) - PDG 3124 + kMothF0_980, ///< f0(980) - PDG 9010221 + kMothOtherMeson, ///< other meson mothers + kMothOtherBaryon, ///< other baryon mothers + kNMotherSpecies +}; + +static const char* motherLabel[kNMotherSpecies] = { + "prompt", "#rho^{0}", "#rho^{#pm}", "#omega", "#eta", "#eta'", + "K*^{#pm}", "K*^{0}", "#phi", + "#Delta", "#Sigma*", "#Lambda(1520)", + "f_{0}(980)", "other meson", "other baryon"}; + +// PDG codes used from TPDGCode.h (ROOT): +// kRho770_0 (113), kRho770Plus (213), kLambda1520 (3124), +// kPiPlus (211), kKPlus (321), kProton (2212) +// PDG codes used from CommonConstants/PhysicsConstants.h (O2): +// o2::constants::physics::Pdg::kEta (221), kOmega (223), kEtaPrime (331), +// kK0Star892 (313), kKPlusStar892 (323), kPhi (333) +// PDG codes NOT in either header - defined here: +static constexpr int KPdgDeltaMinusMinus = 1114; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgDelta0 = 2114; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgDeltaPlus = 2214; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgDeltaPlusPlus = 2224; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgSigmaStarMinus = 3114; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgSigmaStar0 = 3214; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgSigmaStarPlus = 3224; // o2-linter: disable=pdg/explicit-code(not existing) +static constexpr int KPdgF0_980 = 9010221; // o2-linter: disable=pdg/explicit-code(not existing),name/function-variable(clashes with f0),name/constexpr-constant(clashes with f0) + +/// PDG codes below this threshold are mesons; at or above are baryons +static constexpr int KPdgBaryonThreshold = 1000; // o2-linter: disable=pdg/explicit-code(not a PDG code) + +/// \brief Encode absolute PDG code of a mother into compact bin index +inline int encodeMotherPDG(int absPdg) +{ + using namespace o2::constants::physics; + switch (absPdg) { + case kRho770_0: + return kMothRho0; + case kRho770Plus: /* kRho770Minus is just -213, we use abs */ + return kMothRhoCharged; + case Pdg::kOmega: + return kMothOmega782; + case Pdg::kEta: + return kMothEta; + case Pdg::kEtaPrime: + return kMothEtaPrime; + case Pdg::kKPlusStar892: + return kMothKStar892Ch; + case Pdg::kK0Star892: + return kMothKStar892_0; + case Pdg::kPhi: + return kMothPhi1020; + case KPdgDeltaMinusMinus: + case KPdgDelta0: + case KPdgDeltaPlus: + case KPdgDeltaPlusPlus: + return kMothDelta; + case KPdgSigmaStarMinus: + case KPdgSigmaStar0: + case KPdgSigmaStarPlus: + return kMothSigmaStar; + case kLambda1520: + return kMothLambda1520; + case KPdgF0_980: + return kMothF0_980; + default: + return (absPdg < KPdgBaryonThreshold) ? kMothOtherMeson : kMothOtherBaryon; + } +} + +/// PDG codes above this threshold correspond to hadrons (mesons and baryons). +/// Below are quarks (1-6), leptons (11-16), gauge bosons (21-25), and +/// special/internal generator codes. +static constexpr int KPdgHadronThreshold = 100; // o2-linter: disable=pdg/explicit-code(not a PDG code) + +// ============================================================================ +// Classification utilities +// ============================================================================ + +/// \brief Check if a mother is a beam or initial-state particle +/// using its status code rather than just its PDG code +inline bool isBeamParticle(auto const& mother) +{ + int status = mother.getGenStatusCode(); + // Pythia status codes 11-19: beam particles and event-setup entries + // HepMC status 4: beam particles + static constexpr int BEAMSTATUSCODEMIN = 11; + static constexpr int BEAMSTATUSCODEMAX = 19; + static constexpr int HEPMCBEAMSTATUSCODE = 4; + + return (status >= BEAMSTATUSCODEMIN && status <= BEAMSTATUSCODEMAX) || mother.getHepMCStatusCode() == HEPMCBEAMSTATUSCODE; +} + +/// \brief Classify a physical primary by its immediate mother +/// \return {isFromDecay, motherPdgCode} +template +inline std::pair classifyImmediate(McParticleObject const& particle, + McParticlesTable const& /*mcParticles*/) +{ + if (!particle.has_mothers()) { + return {false, 0}; + } + auto mother = particle.template mothers_first_as(); + int absMomPdg = std::abs(mother.pdgCode()); + if (absMomPdg > KPdgHadronThreshold && !isBeamParticle(mother)) { + return {true, mother.pdgCode()}; + } + return {false, 0}; +} + +/// \brief Trace back to the earliest hadronic ancestor +/// \return {isFromDecay, originalAncestorPdgCode} +template +inline std::pair classifyAncestor(McParticleObject const& particle, + McParticlesTable const& mcParticles) +{ + /* reuse classifyImmediate for the first step */ + auto [isFromDecay, immediatePdg] = classifyImmediate(particle, mcParticles); + if (!isFromDecay) { + return {false, 0}; + } + + /* the immediate mother is hadronic; now walk up to find the original resonance */ + auto current = particle.template mothers_first_as(); + int originalPdg = current.pdgCode(); + constexpr int KMaxDepth = 20; + for (int depth = 0; current.has_mothers() && depth < KMaxDepth; ++depth) { + auto grandparent = current.template mothers_first_as(); + if (std::abs(grandparent.pdgCode()) <= KPdgHadronThreshold || isBeamParticle(grandparent)) { + break; + } + originalPdg = grandparent.pdgCode(); + current = grandparent; + } + return {true, originalPdg}; +} + +} // namespace particleorigintask + +// ============================================================================ +// The analysis task +// ============================================================================ +struct ParticleOriginAnalysis { + + /* the histogram registry */ + HistogramRegistry registry{"ParticleOriginData", {}, OutputObjHandlingPolicy::AnalysisObject}; + + /* the species and track names from configuration */ + std::vector poinames; ///< the species of interest names + std::vector tnames; ///< the track names + + /* the number of track ids from configuration */ + size_t nch = 0; + + /* histogram pointers for direct access */ + /* per track id histograms: indexed by trackacceptedid */ + static constexpr int KNMo = particleorigintask::kNMotherSpecies; + + std::vector> fhPromptVsPt; ///< prompt counts vs pT, per track id + std::vector> fhDecayVsPt; ///< from-decay counts vs pT, per track id + std::vector> fhPromptVsCentVsPt; ///< prompt counts vs (cent, pT), per track id + std::vector> fhDecayVsCentVsPt; ///< from-decay counts vs (cent, pT), per track id + std::vector> fhMotherVsPtVsCent; ///< immediate mother (encoded) vs pT vs cent, per track id + std::vector> fhAncestorVsPtVsCent; ///< earliest ancestor (encoded) vs pT vs cent, per track id + std::vector> fhMotherPDG; ///< immediate mother |PDG| (fine, 1D safety net), per track id + std::vector> fhAncestorPDG; ///< earliest ancestor |PDG| (fine, 1D safety net), per track id + + void init(InitContext& initContext) + { + using namespace particleorigintask; + using namespace o2::analysis::dptdptfilter; + + /* self configure the binning from the filter task */ + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPTbins", ptbins, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPTmin", ptlow, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mPTmax", ptup, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mEtabins", etabins, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mEtamin", etalow, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mEtamax", etaup, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mZVtxbins", zvtxbins, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mZVtxmin", zvtxlow, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgBinning.mZVtxmax", zvtxup, false); + + /* self configure the desired species */ + o2::analysis::dptdptfilter::PIDSpeciesSelection pidselector; + std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; + std::vector spids = {0, 1, 2, 3, 4}; + for (uint i = 0; i < cfgnames.size(); ++i) { + auto includeIt = [&pidselector, &initContext](int spid, auto name) { + bool mUseIt = false; + bool mExcludeIt = false; + if (getTaskOptionValue(initContext, "dpt-dpt-filter-tracks", TString::Format("%s.mUseIt", name.c_str()).Data(), mUseIt, false) && + getTaskOptionValue(initContext, "dpt-dpt-filter-tracks", TString::Format("%s.mExclude", name.c_str()).Data(), mExcludeIt, false)) { + if (mUseIt && !mExcludeIt) { + auto cfg = new o2::analysis::TrackSelectionPIDCfg(); + cfg->mUseIt = true; + cfg->mExclude = false; + pidselector.addSpecies(spid, cfg); + } + } + }; + includeIt(spids[i], cfgnames[i]); + } + uint nspecies = pidselector.getNSpecies(); + if (nspecies == 0) { + /* unidentified analysis */ + poinames.push_back(pidselector.getHadFName()); + tnames.push_back(std::string(TString::Format("%sP", pidselector.getHadFName()).Data())); + tnames.push_back(std::string(TString::Format("%sM", pidselector.getHadFName()).Data())); + LOGF(info, "Incorporated species name %s to the analysis", poinames[0].c_str()); + } else { + for (uint8_t ix = 0; ix < nspecies; ++ix) { + poinames.push_back(std::string(pidselector.getSpeciesFName(ix))); + tnames.push_back(std::string(TString::Format("%sP", pidselector.getSpeciesFName(ix)).Data())); + tnames.push_back(std::string(TString::Format("%sM", pidselector.getSpeciesFName(ix)).Data())); + LOGF(info, "Incorporated species name %s to the analysis", poinames[ix].c_str()); + } + } + nch = tnames.size(); + + /* self configure centrality/multiplicity ranges from the filter task */ + int nCentBins = 1; + std::vector centBinEdges = {0.0f, 100.0f}; + std::string centspec; + if (getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgCentSpec", centspec, false)) { + LOGF(info, "Got the centralities specification: %s", centspec.c_str()); + auto tokens = TString(centspec.c_str()).Tokenize(","); + nCentBins = tokens->GetEntries(); + centBinEdges.clear(); + for (int i = 0; i < nCentBins; ++i) { + double cmmin = 0.0; + double cmmax = 0.0; + sscanf(tokens->At(i)->GetName(), "%lf-%lf", &cmmin, &cmmax); + if (i == 0) { + centBinEdges.push_back(cmmin); + } + centBinEdges.push_back(cmmax); + } + delete tokens; + } else { + LOGF(info, "No centralities specification. Setting it to: 0-100"); + } + + /* build the centrality axis with variable bin edges */ + const AxisSpec centAxis{centBinEdges, "centrality (%)"}; + const AxisSpec ptAxis{ptbins, ptlow, ptup, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec motherAxis{KNMo, -0.5f, KNMo - 0.5f, "mother species"}; + const AxisSpec pdgAxis{100, 0.5f, 100.5f, "species"}; + const AxisSpec zvtxAxis{zvtxbins, zvtxlow, zvtxup, "#it{z}_{vtx}"}; + + /* resize the histogram vectors */ + fhPromptVsPt.resize(nch, nullptr); + fhDecayVsPt.resize(nch, nullptr); + fhPromptVsCentVsPt.resize(nch, nullptr); + fhDecayVsCentVsPt.resize(nch, nullptr); + fhMotherVsPtVsCent.resize(nch, nullptr); + fhAncestorVsPtVsCent.resize(nch, nullptr); + fhMotherPDG.resize(nch, nullptr); + fhAncestorPDG.resize(nch, nullptr); + + /* per track id histograms */ + for (uint i = 0; i < nch; ++i) { + const char* tname = tnames[i].c_str(); + + fhPromptVsPt[i] = registry.add( + FORMATSTRING("PromptVsPt_%s", tname), + FORMATSTRING("Prompt %s;#it{p}_{T} (GeV/#it{c});counts", tname), + kTH1F, {ptAxis}); + + fhDecayVsPt[i] = registry.add( + FORMATSTRING("DecayVsPt_%s", tname), + FORMATSTRING("From decay %s;#it{p}_{T} (GeV/#it{c});counts", tname), + kTH1F, {ptAxis}); + + fhPromptVsCentVsPt[i] = registry.add( + FORMATSTRING("PromptVsCentVsPt_%s", tname), + FORMATSTRING("Prompt %s;centrality (%%);#it{p}_{T} (GeV/#it{c})", tname), + kTH2F, {centAxis, ptAxis}); + + fhDecayVsCentVsPt[i] = registry.add( + FORMATSTRING("DecayVsCentVsPt_%s", tname), + FORMATSTRING("From decay %s;centrality (%%);#it{p}_{T} (GeV/#it{c})", tname), + kTH2F, {centAxis, ptAxis}); + + fhMotherVsPtVsCent[i] = registry.add( + FORMATSTRING("MotherVsPtVsCent_%s", tname), + FORMATSTRING("Immediate mother of %s;mother;#it{p}_{T} (GeV/#it{c});centrality (%%)", tname), + kTH3F, {motherAxis, ptAxis, centAxis}); + + fhAncestorVsPtVsCent[i] = registry.add( + FORMATSTRING("AncestorVsPtVsCent_%s", tname), + FORMATSTRING("Earliest ancestor of %s;ancestor;#it{p}_{T} (GeV/#it{c});centrality (%%)", tname), + kTH3F, {motherAxis, ptAxis, centAxis}); + + /* label the encoded mother/ancestor axis */ + for (int im = 0; im < KNMo; ++im) { + fhMotherVsPtVsCent[i]->GetXaxis()->SetBinLabel(im + 1, motherLabel[im]); + fhAncestorVsPtVsCent[i]->GetXaxis()->SetBinLabel(im + 1, motherLabel[im]); + } + + fhMotherPDG[i] = registry.add( + FORMATSTRING("MotherPDG_%s", tname), + FORMATSTRING("Immediate mother PDG of %s from decay;PDG code;counts", tname), + kTH1F, {pdgAxis}); + + fhAncestorPDG[i] = registry.add( + FORMATSTRING("AncestorPDG_%s", tname), + FORMATSTRING("Earliest ancestor PDG of %s from decay;PDG code;counts", tname), + kTH1F, {pdgAxis}); + } + } + + /// \brief Fill the origin classification histograms for one accepted particle + /// \param tid the trackacceptedid from the filter + /// \param centmult the centrality/multiplicity percentile + /// \param pt the particle transverse momentum + /// \param isFromDecay true if immediate mother is a hadron + /// \param immediatePdg the PDG code of the immediate mother + /// \param isFromDecayFull true if earliest ancestor is a hadron + /// \param ancestorPdg the PDG code of the earliest hadronic ancestor + void fillOrigin(int tid, float centmult, float pt, + bool isFromDecay, int immediatePdg, + bool isFromDecayFull, int ancestorPdg) + { + using namespace particleorigintask; + + if (isFromDecay) { + fhDecayVsPt[tid]->Fill(pt); + fhDecayVsCentVsPt[tid]->Fill(centmult, pt); + int encodedMother = encodeMotherPDG(std::abs(immediatePdg)); + fhMotherVsPtVsCent[tid]->Fill(static_cast(encodedMother), pt, centmult); + fhMotherPDG[tid]->Fill(TString::Format("%d", immediatePdg).Data(), 1.0); + } else { + fhPromptVsPt[tid]->Fill(pt); + fhPromptVsCentVsPt[tid]->Fill(centmult, pt); + fhMotherVsPtVsCent[tid]->Fill(static_cast(kMothPrompt), pt, centmult); + } + if (isFromDecayFull) { + int encodedAncestor = encodeMotherPDG(std::abs(ancestorPdg)); + fhAncestorVsPtVsCent[tid]->Fill(static_cast(encodedAncestor), pt, centmult); + fhAncestorPDG[tid]->Fill(TString::Format("%d", ancestorPdg).Data(), 1.0); + } else { + fhAncestorVsPtVsCent[tid]->Fill(static_cast(kMothPrompt), pt, centmult); + } + } + + Filter onlyacceptedcollisions = (aod::dptdptfilter::collisionaccepted == uint8_t(true)); + + /// \brief Process: one accepted generator-level collision at a time + /// with its associated MC particles joined with filter information. + /// Follows the processGenLevelNotStored / processSame pattern. + void process(soa::Filtered>::iterator const& collision, + soa::Join const& particles) + { + using namespace particleorigintask; + using namespace o2::analysis::dptdptfilter; + + float centmult = collision.centmult(); + + for (auto const& particle : particles) { + int8_t tid = particle.trackacceptedid(); + if (tid < 0) { + /* particle not accepted */ + continue; + } + float pt = particle.pt(); + + /* classify origin using the McParticles mother chain */ + auto [isFromDecay, immediatePdg] = classifyImmediate(particle, particles); + auto [isFromDecayFull, ancestorPdg] = classifyAncestor(particle, particles); + + /* fill histograms indexed by trackacceptedid */ + fillOrigin(tid, centmult, pt, isFromDecay, immediatePdg, + isFromDecayFull, ancestorPdg); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 8e57973bd65ec2aa446e4fb0f5e6d2d69ce7945e Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Fri, 3 Apr 2026 04:56:17 +0200 Subject: [PATCH 165/282] [PWGHF] ppbar decay channel for hidden charm (#15638) Co-authored-by: ALICE Action Bot Co-authored-by: spolitan <59452587+stefanopolitano@users.noreply.github.com> --- PWGHF/D2H/DataModel/ReducedDataModel.h | 14 + PWGHF/D2H/TableProducer/CMakeLists.txt | 5 + .../dataCreatorHiddenCharmReduced.cxx | 318 ++++++++++++++++++ PWGHF/D2H/Tasks/CMakeLists.txt | 5 + PWGHF/D2H/Tasks/taskHiddenCharm.cxx | 145 ++++++++ 5 files changed, 487 insertions(+) create mode 100644 PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx create mode 100644 PWGHF/D2H/Tasks/taskHiddenCharm.cxx diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index d70597c8678..09f8bcd2d1b 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -196,6 +196,7 @@ DECLARE_SOA_COLUMN(TpcNClsCrossedRowsProngMin, tpcNClsCrossedRowsProngMin, int); DECLARE_SOA_COLUMN(TpcChi2NClProngMax, tpcChi2NClProngMax, float); //! maximum value of TPC chi2 for the decay daughter tracks DECLARE_SOA_COLUMN(PtProngMin, ptProngMin, float); //! minimum value of transverse momentum for the decay daughter tracks DECLARE_SOA_COLUMN(AbsEtaProngMin, absEtaProngMin, float); //! minimum value of absolute pseudorapidity for the decay daughter tracks +DECLARE_SOA_COLUMN(TrackType, trackType, uint8_t); //! particle type according to PID selection (pion, kaon, proton) // dynamic columns DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! transverse momentum @@ -1653,6 +1654,19 @@ DECLARE_SOA_TABLE(HfMcRecRedResos, "AOD", "HFMCRECREDRESO", //! Reconstruction-l hf_reso_cand_reduced::InvMassGen, hf_cand_mc_flag::NTracksDecayed, o2::soa::Marker<1>); + +//! Table with selected tracks for Hc analysis +DECLARE_SOA_TABLE(HcSelTracks, "AOD", "HCSELTRACKS", + o2::soa::Index<>, + // Indices + hf_track_index_reduced::TrackId, + hf_track_index_reduced::HfRedCollisionId, + // Static + hf_track_vars_reduced::Px, + hf_track_vars_reduced::Py, + hf_track_vars_reduced::Pz, + hf_track_vars_reduced::Sign, + hf_track_vars_reduced::TrackType); } // namespace aod namespace soa diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index 7ad2570bec7..674bbeeb25c 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -90,6 +90,11 @@ o2physics_add_dpl_workflow(data-creator-jpsi-had-reduced PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(data-creator-hidden-charm-reduced + SOURCES dataCreatorHiddenCharmReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) + # Converters o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml diff --git a/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx new file mode 100644 index 00000000000..2e9a00bd6b5 --- /dev/null +++ b/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx @@ -0,0 +1,318 @@ +// 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. + +/// \file dataCreatorHiddenCharmReduced.cxx +/// \brief Reduced data creator for hidden-charm analyses at midrapidity +/// +/// \author A. Palasciano, , INFN Bari +/// \author S. Politanò , CERN + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" +#include "PWGHF/D2H/Utils/utilsRedDataFormat.h" +#include "PWGHF/DataModel/AliasTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" + +#include "Common/Core/TPCVDriftManager.h" +#include "Common/Core/ZorroSummary.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::analysis; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::hf_centrality; + +enum TrackType : uint8_t { + Pion = 0, + Kaon, + Proton +}; + +struct HfDataCreatorHiddenCharmReduced { + + Produces hfReducedCollision; + Produces hfCollisionCounter; + Produces hfTrackLite; + + struct : ConfigurableGroup { + // track quality + Configurable fillHistograms{"fillHistograms", true, "Fill proton QA histograms"}; + Configurable selectProtons{"selectProtons", true, "Select protons"}; + Configurable itsNClsMin{"itsNClsMin", 5, "Minimum number of ITS clusters"}; + Configurable tpcNClsFoundMin{"tpcNClsFoundMin", 50, "Minimum number of found TPC clusters"}; + Configurable tpcNClsCrossedRowsMin{"tpcNClsCrossedRowsMin", 80, "Minimum number of crossed TPC rows"}; + Configurable ptMinTrack{"ptMinTrack", 0.5, "Minimum proton-track pT"}; + Configurable etaMaxTrack{"etaMaxTrack", 0.8, "Maximum proton-track |eta|"}; + Configurable momForCombinedPid{"momForCombinedPid", 0.75f, "Momentum threshold above which combined TPC+TOF proton PID is used"}; + Configurable> binsPtTrack{"binsPtTrack", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "Track pT bin limits for DCA cuts"}; + Configurable> cutsTrack{"cutsTrack", {hf_cuts_single_track::CutsTrack[0], hf_cuts_single_track::NBinsPtTrack, hf_cuts_single_track::NCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track DCA selections per pT bin"}; + Configurable maxNsigmaTofPi{"maxNsigmaTofPi", 2.f, "Maximum pion n-sigma in TOF for proton rejection"}; + Configurable maxNsigmaTofKa{"maxNsigmaTofKa", 2.f, "Maximum kaon n-sigma in TOF for proton rejection"}; + Configurable maxNsigmaCombinedPr{"maxNsigmaCombinedPr", 3.f, "Maximum combined proton n-sigma from TPC and TOF"}; + Configurable maxNsigmaTpcPi{"maxNsigmaTpcPi", 2.f, "Maximum pion n-sigma in TPC for proton rejection"}; + Configurable maxNsigmaTpcKa{"maxNsigmaTpcKa", 2.f, "Maximum kaon n-sigma in TPC for proton rejection"}; + Configurable maxNsigmaTpcPr{"maxNsigmaTpcPr", 3.f, "Maximum proton n-sigma in TPC"}; + Configurable forceTOF{"forceTOF", false, "Require TOF PID information for proton selection"}; + } config; + + // Configurable (others) + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; + Configurable doMcRecQa{"doMcRecQa", true, "Fill QA histograms for Mc matching"}; + Configurable rejectPairsWithCommonDaughter{"rejectPairsWithCommonDaughter", true, "flag to reject already at this stage the pairs that share a daughter track"}; + Configurable rejectCollisionsWithBadEvSel{"rejectCollisionsWithBadEvSel", true, "flag to reject collisions with bad event selection"}; + + o2::hf_evsel::HfEventSelection hfEvSel; + o2::hf_evsel::HfEventSelectionMc hfEvSelMc; + + double bz{0.}; + int runNumber{0}; // needed to detect if the run changed and trigger update of calibrations etc. + + // material correction for track propagation + o2::base::MatLayerCylSet* lut{}; + o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + o2::aod::common::TPCVDriftManager vDriftMgr; + o2::ccdb::CcdbApi ccdbApi; + Service ccdb{}; + + using BCsInfo = soa::Join; + using TracksWithPID = soa::Join; + + Preslice trackIndicesPerCollision = aod::track_association::collisionId; + + HistogramRegistry registry{"registry"}; + OutputObj zorroSummary{"zorroSummary"}; + + void init(InitContext& initContext) + { + // Configure CCDB access + ccdb->setURL(ccdbUrl.value); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + ccdbApi.init(ccdbUrl); + runNumber = 0; + lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get("GLO/Param/MatLUT")); + + if (config.fillHistograms) { + const AxisSpec axisPt{360, 0., 36., "#it{p}_{T}^{proton} (GeV/#it{c})"}; + const AxisSpec axisEta{100, -1., 1., "#eta"}; + const AxisSpec axisDca{400, -2., 2., "DCA_{xy} to primary vertex (cm)"}; + const AxisSpec axisNSigma{100, -5., 5., "n#sigma"}; + + registry.add("hPzVtx", "Z position of primary vertex for selected tracks;z_{vtx} (cm);entries", {HistType::kTH1D, {AxisSpec{200, -20., 20., "z_{vtx} (cm)"}}}); + registry.add("hPtNoCuts", "All associated tracks;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1D, {axisPt}}); + registry.add("hPtCutsProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1D, {axisPt}}); + registry.add("hEtaCutsProton", "Selected proton tracks;#eta;entries", {HistType::kTH1D, {axisEta}}); + registry.add("hDCAToPrimXYVsPtCutsProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});DCA_{xy} to primary vertex (cm)", {HistType::kTH2D, {axisPt, axisDca}}); + registry.add("hNSigmaTPCProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});n#sigma_{TPC}", {HistType::kTH2D, {axisPt, axisNSigma}}); + registry.add("hNSigmaTOFProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});n#sigma_{TOF}", {HistType::kTH2D, {axisPt, axisNSigma}}); + registry.add("hInvMass", "Invariant mass of selected proton with all other tracks in the event;#it{p}_{T}^{proton} (GeV/#it{c});invariant mass with other tracks (GeV/#it{c}^{2})", {HistType::kTH2D, {axisPt, AxisSpec{100, 2.85, 3.25, "invariant mass with other tracks (GeV/#it{c}^{2})"}}}); + } + + // init HF event selection helper + hfEvSel.init(registry, &zorroSummary); + + const auto& workflows = initContext.services().get(); + for (const DeviceSpec& device : workflows.devices) { + if (device.name == "hf-data-creator-charm-reso-to-d0-reduced") { + // init HF event selection helper + hfEvSelMc.init(device, registry); + break; + } + } + } + + template + bool isSelectedPid(TTrack const& track) const + { + const float momForCombinedPid = config.momForCombinedPid.value; + const float maxNsigmaTpcPr = config.maxNsigmaTpcPr.value; + const float maxNsigmaTpcPi = config.maxNsigmaTpcPi.value; + const float maxNsigmaTpcKa = config.maxNsigmaTpcKa.value; + const float maxNsigmaCombinedPr = config.maxNsigmaCombinedPr.value; + const float maxNsigmaTofPi = config.maxNsigmaTofPi.value; + const float maxNsigmaTofKa = config.maxNsigmaTofKa.value; + const bool forceTOF = config.forceTOF.value; + + const float mom = std::hypot(track.px(), track.py(), track.pz()); + const float nSigmaTPCPr = track.tpcNSigmaPr(); + const float nSigmaTPCPi = track.tpcNSigmaPi(); + const float nSigmaTPCKa = track.tpcNSigmaKa(); + const bool hasTOF = track.hasTOF(); + if (!hasTOF && forceTOF) { + return false; + } + + bool isProton = false; + bool rejectAsPion = false; + bool rejectAsKaon = false; + + if (mom < momForCombinedPid || !hasTOF) { + isProton = std::abs(nSigmaTPCPr) < maxNsigmaTpcPr; + rejectAsPion = std::abs(nSigmaTPCPi) < maxNsigmaTpcPi; + rejectAsKaon = std::abs(nSigmaTPCKa) < maxNsigmaTpcKa; + } else { + const float nSigmaTOFPr = track.tofNSigmaPr(); + const float nSigmaTOFPi = track.tofNSigmaPi(); + const float nSigmaTOFKa = track.tofNSigmaKa(); + isProton = std::hypot(nSigmaTPCPr, nSigmaTOFPr) < maxNsigmaCombinedPr; + rejectAsPion = std::hypot(nSigmaTPCPi, nSigmaTOFPi) < maxNsigmaTofPi; + rejectAsKaon = std::hypot(nSigmaTPCKa, nSigmaTOFKa) < maxNsigmaTofKa; + } + return isProton && !rejectAsPion && !rejectAsKaon; + } + + template + bool isSelectedTrack(TTrack const& track) const + { + const int tpcNClsFoundMin = config.tpcNClsFoundMin.value; + const int tpcNClsCrossedRowsMin = config.tpcNClsCrossedRowsMin.value; + const int itsNClsMin = config.itsNClsMin.value; + const double etaMaxTrack = config.etaMaxTrack.value; + const double ptMinTrack = config.ptMinTrack.value; + + if (!track.isGlobalTrackWoDCA()) { + return false; + } + if (track.tpcNClsFound() < tpcNClsFoundMin) { + return false; + } + if (track.tpcNClsCrossedRows() < tpcNClsCrossedRowsMin) { + return false; + } + if (track.itsNCls() < itsNClsMin) { + return false; + } + if (std::abs(track.eta()) > etaMaxTrack) { + return false; + } + if (track.pt() < ptMinTrack) { + return false; + } + if (!isSelectedTrackDca(config.binsPtTrack, config.cutsTrack, track.pt(), track.dcaXY(), track.dcaZ())) { + return false; + } + return isSelectedPid(track); + } + + void processEtaCTrack(soa::Join const& collisions, + aod::TrackAssoc const& trackIndices, + TracksWithPID const& tracks, + aod::BCsWithTimestamps const&) + { + hfTrackLite.reserve(tracks.size()); + + int zvtxColl{0}; + int sel8Coll{0}; + int zvtxAndSel8Coll{0}; + int zvtxAndSel8CollAndSoftTrig{0}; + int allSelColl{0}; + constexpr int NDaughtersCharmMeson = 2; + for (const auto& collision : collisions) { + const auto hfRejMap = o2::hf_evsel::getEvSel(collision, hfEvSel, zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl, ccdb, registry); + if (rejectCollisionsWithBadEvSel && hfRejMap != 0) { + continue; + } + const auto thisCollId = collision.globalIndex(); + const auto trackIds = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); + if (config.fillHistograms) { + registry.fill(HIST("hPzVtx"), collision.posZ()); + } + std::vector selectedTrackIds; + for (const auto& trkId : trackIds) { + auto trk = trkId.track_as(); + if (config.fillHistograms) { + registry.fill(HIST("hPtNoCuts"), trk.pt()); + } + if (!isSelectedTrack(trk)) { + continue; + } + std::array pVecProton{trk.pVector()}; + hfTrackLite(trk.globalIndex(), collision.globalIndex(), pVecProton[0], pVecProton[1], pVecProton[2], trk.sign(), static_cast(TrackType::Proton)); + selectedTrackIds.push_back(trk.globalIndex()); + if (config.fillHistograms) { + registry.fill(HIST("hPtCutsProton"), trk.pt()); + registry.fill(HIST("hEtaCutsProton"), trk.eta()); + registry.fill(HIST("hDCAToPrimXYVsPtCutsProton"), trk.pt(), trk.dcaXY()); + registry.fill(HIST("hNSigmaTPCProton"), trk.pt(), trk.tpcNSigmaPr()); + if (trk.hasTOF()) { + registry.fill(HIST("hNSigmaTOFProton"), trk.pt(), trk.tofNSigmaPr()); + } + } + } + if (selectedTrackIds.size() < NDaughtersCharmMeson) { + continue; + } + hfReducedCollision(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), hfRejMap, bz); + for (size_t i = 0; i < selectedTrackIds.size(); ++i) { + auto t1 = tracks.rawIteratorAt(selectedTrackIds[i]); + std::array pVec1{t1.pVector()}; + for (size_t j = i + 1; j < selectedTrackIds.size(); ++j) { + auto t2 = tracks.rawIteratorAt(selectedTrackIds[j]); + if (t1.sign() * t2.sign() > 0) { + continue; + } + std::array pVec2{t2.pVector()}; + float invMass = RecoDecay::m(std::array{pVec1, pVec2}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassProton}); + float ptEtac = RecoDecay::pt(RecoDecay::sumOfVec(pVec1, pVec2)); + if (config.fillHistograms) { + registry.fill(HIST("hInvMass"), ptEtac, invMass); + } + } + } + } + hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); + } + + PROCESS_SWITCH(HfDataCreatorHiddenCharmReduced, processEtaCTrack, "EtaC -> p pbar reconstruction", true); +}; + +// struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{}; + workflow.push_back(adaptAnalysisTask(cfgc)); + return workflow; +} diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 40f2358fdaf..608145a8e51 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -153,3 +153,8 @@ o2physics_add_dpl_workflow(task-xic0-to-xi-pi SOURCES taskXic0ToXiPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(task-hidden-charm + SOURCES taskHiddenCharm.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGHF/D2H/Tasks/taskHiddenCharm.cxx b/PWGHF/D2H/Tasks/taskHiddenCharm.cxx new file mode 100644 index 00000000000..0830048c0a7 --- /dev/null +++ b/PWGHF/D2H/Tasks/taskHiddenCharm.cxx @@ -0,0 +1,145 @@ +// 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. + +/// \file taskHiddenCharm.cxx +/// \brief Analysis task for hidden charm hadrons at midrapidity +/// +/// \author A. Palasciano, , INFN Bari +/// \author S. Politanò , CERN + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::hf_centrality; + +enum TrackType : uint8_t { + Pion = 0, + Kaon, + Proton +}; + +struct HfTaskHiddenCharm { + Configurable centEstimator{"centEstimator", 0, "Centrality estimation (None: 0, FT0A: 1, FT0C: 2, FT0M: 3, FV0A: 4, NTracksPV: 5, FT0CVariant2: 6)"}; + Configurable centralityMin{"centralityMin", 0.f, "Minimum accepted centrality"}; + Configurable centralityMax{"centralityMax", 100.f, "Maximum accepted centrality"}; + Configurable fillOnlyUnlikeSign{"fillOnlyUnlikeSign", true, "Fill only unlike-sign proton pairs"}; + Configurable fillOnlyLikeSign{"fillOnlyLikeSign", true, "Fill only like-sign proton pairs"}; + + SliceCache cache; + + using SelectedCollisionsPP = aod::HfRedCollisions; + using SelectedCollisionsPbPb = soa::Join; + Partition selectedProtons = aod::hf_track_vars_reduced::trackType == static_cast(TrackType::Proton); + Partition selectedPions = aod::hf_track_vars_reduced::trackType == static_cast(TrackType::Pion); + Partition selectedKaons = aod::hf_track_vars_reduced::trackType == static_cast(TrackType::Kaon); + + ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {1400, 2.8, 4.2}, ""}; + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {100, 0., 10.}, ""}; + ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {100, 0., 100.}, ""}; + ConfigurableAxis thnConfigAxisSign{"thnConfigAxisSign", {2, -1., 1.}, ""}; + + HistogramRegistry registry{"registry", {}}; + + void init(InitContext&) + { + const AxisSpec axisInvMass{thnConfigAxisInvMass, "M_{p#bar{p}} (GeV/#it{c}^{2})"}; + const AxisSpec axisPt{thnConfigAxisPt, "#it{p}_{T}^{p#bar{p}} (GeV/#it{c})"}; + const AxisSpec axisCent{thnConfigAxisCent, "Centrality"}; + const AxisSpec axisSign{thnConfigAxisSign, "q_{1} #times q_{2}"}; + + registry.add("hSparseHiddenCharm", "Hidden-charm proton-pair candidates", HistType::kTHnSparseF, {axisInvMass, axisPt, axisSign, axisCent}); + registry.add("hPtVsInvMassLikeSign", "Hidden-charm LS M_{inv}", HistType::kTH2D, {axisInvMass, axisPt}); + registry.add("hPtVsInvMassUnlikeSign", "Hidden-charm proton-pair ULS", HistType::kTH2D, {axisInvMass, axisPt}); + registry.add("hPtVsInvMassAllSign", "Hidden-charm proton-pair LS+ULS M_{inv}", HistType::kTH2D, {axisInvMass, axisPt}); + } + + template + void fillEtac(TCollisions const& collision, + TProtonIds const& protonIds) + { + float cent{-1.f}; + if constexpr (CentEstimator != o2::hf_centrality::CentralityEstimator::None) { + cent = o2::hf_centrality::getCentralityColl(collision, centEstimator); + if (cent < centralityMin || cent >= centralityMax) { + return; // skip events outside the centrality range + } + } + + for (const auto& proton1 : protonIds) { + for (const auto& proton2 : protonIds) { + if (proton1.trackId() >= proton2.trackId()) { + continue; // avoid double counting and self-pairs + } + const int sign = (proton1.sign() * proton2.sign() > 0) ? 1 : -1; + if ((sign == 1 && !fillOnlyLikeSign) || (sign == -1 && !fillOnlyUnlikeSign)) { + continue; + } + std::array pVec1{proton1.px(), proton1.py(), proton1.pz()}; + std::array pVec2{proton2.px(), proton2.py(), proton2.pz()}; + float invMass = RecoDecay::m(std::array{pVec1, pVec2}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassProton}); + float ptEtac = RecoDecay::pt(RecoDecay::sumOfVec(pVec1, pVec2)); + registry.fill(HIST("hSparseHiddenCharm"), invMass, ptEtac, sign, cent); + if (sign == 1) { + registry.fill(HIST("hPtVsInvMassLikeSign"), invMass, ptEtac); + } else if (sign == -1) { + registry.fill(HIST("hPtVsInvMassUnlikeSign"), invMass, ptEtac); + registry.fill(HIST("hPtVsInvMassAllSign"), invMass, ptEtac); + } + } + } + } + + void processEtacPP(SelectedCollisionsPP::iterator const& collision, + aod::HcSelTracks const& /*tracks*/) + { + auto candProtons = selectedProtons->sliceByCached(aod::hf_track_index_reduced::hfRedCollisionId, collision.globalIndex(), cache); + fillEtac(collision, candProtons); + } + PROCESS_SWITCH(HfTaskHiddenCharm, processEtacPP, "Process Etac candidates for pp", true); + + // void processEtacPbPb(SelectedCollisionsPbPb::iterator const& collisions, + // aod::HcSelTracks const& protonIds) + //{ + // fillEtac(collisions, protonIds, true); + // } + // PROCESS_SWITCH(HfTaskHiddenCharm, processEtacPbPb, "Process Etac candidates for PbPb", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From c120a43d50f964a2320dcdc852cf7445a303f644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 3 Apr 2026 15:44:29 +0200 Subject: [PATCH 166/282] [ALICE3] Revert usage of Trk PID in D meson chain (#15642) --- ALICE3/TableProducer/alice3-decayfinder.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ALICE3/TableProducer/alice3-decayfinder.cxx b/ALICE3/TableProducer/alice3-decayfinder.cxx index 588f5b6aaa6..f828ee5fbff 100644 --- a/ALICE3/TableProducer/alice3-decayfinder.cxx +++ b/ALICE3/TableProducer/alice3-decayfinder.cxx @@ -66,7 +66,8 @@ using std::array; // #define bitcheck(var, nbit) ((var) & (static_cast(1) << (nbit))) // For MC association in pre-selection -using Alice3TracksWPid = soa::Join; +using Alice3TracksWPid = soa::Join; +using Alice3TracksWTrkPid = soa::Join; struct alice3decayFinder { SliceCache cache; @@ -185,18 +186,17 @@ struct alice3decayFinder { ((aod::a3DecayMap::decayMap & trackSelectionKaMinusFromD) == trackSelectionKaMinusFromD) && aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > kaFromD_dcaXYconstant + kaFromD_dcaXYpTdep* nabs(aod::track::signed1Pt); // partitions for Lc baryons - Partition tracksPiPlusFromLc = + Partition tracksPiPlusFromLc = ((aod::a3DecayMap::decayMap & trackSelectionPiPlusFromLc) == trackSelectionPiPlusFromLc) && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > piFromLc_dcaXYconstant + piFromLc_dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition tracksKaPlusFromLc = + Partition tracksKaPlusFromLc = ((aod::a3DecayMap::decayMap & trackSelectionKaPlusFromLc) == trackSelectionKaPlusFromLc) && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > kaFromLc_dcaXYconstant + kaFromLc_dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition tracksPrPlusFromLc = + Partition tracksPrPlusFromLc = ((aod::a3DecayMap::decayMap & trackSelectionPrPlusFromLc) == trackSelectionPrPlusFromLc) && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > prFromLc_dcaXYconstant + prFromLc_dcaXYpTdep* nabs(aod::track::signed1Pt); - // partitions for Lc baryons - Partition tracksPiMinusFromLc = + Partition tracksPiMinusFromLc = ((aod::a3DecayMap::decayMap & trackSelectionPiMinusFromLc) == trackSelectionPiMinusFromLc) && aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > piFromLc_dcaXYconstant + piFromLc_dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition tracksKaMinusFromLc = + Partition tracksKaMinusFromLc = ((aod::a3DecayMap::decayMap & trackSelectionKaMinusFromLc) == trackSelectionKaMinusFromLc) && aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > kaFromLc_dcaXYconstant + kaFromLc_dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition tracksPrMinusFromLc = + Partition tracksPrMinusFromLc = ((aod::a3DecayMap::decayMap & trackSelectionPrMinusFromLc) == trackSelectionPrMinusFromLc) && aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > prFromLc_dcaXYconstant + prFromLc_dcaXYpTdep* nabs(aod::track::signed1Pt); // Helper struct to pass candidate information @@ -1068,7 +1068,7 @@ struct alice3decayFinder { void processFindLc(aod::Collision const& collision, aod::McParticles const& mcParticles, - Alice3TracksWPid const& tracks) + Alice3TracksWTrkPid const& tracks) { LOG(debug) << "Processing Lc candidates for collision " << collision.globalIndex() << " with " << tracks.size() << " tracks"; for (auto const& track : tracks) { From d421db326aff5e2a37ecf1920205a1dd207d929c Mon Sep 17 00:00:00 2001 From: Deependra Sharma <38365215+deependra170598@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:37:59 +0530 Subject: [PATCH 167/282] [PWGHF] Pt shape study (#15613) --- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 262 +++++++++++++----- PWGHF/TableProducer/candidateCreatorDstar.cxx | 2 +- 2 files changed, 194 insertions(+), 70 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 4fcdf05bb55..f0af577b233 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -61,15 +61,14 @@ struct HfTaskDstarToD0Pi { Configurable isCentStudy{"isCentStudy", true, "Flag to select centrality study"}; Configurable qaEnabled{"qaEnabled", true, "Flag to enable QA histograms"}; Configurable studyD0ToPiKPi0{"studyD0ToPiKPi0", false, "Flag to study D*->D0(piKpi0)pi channel"}; + Configurable ptShapeStudy{"ptShapeStudy", false, "Flag to enable pT shape study"}; + Configurable useWeightOnline{"useWeightOnline", false, "Flag to enable use of weights for pT shape study online"}; // CCDB configuration - Configurable useWeight{"useWeight", true, "Flag to use weights from CCDB"}; - Configurable nWeights{"nWeights", 6, "Number of weights to be used from CCDB"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable ccdbPathForWeight{"ccdbPathForWeight", "Users/d/desharma/weights", "CCDB path for PVContrib weights"}; - Configurable timestampCCDB{"timestampCCDB", -1, "CCDB timestamp for the weights"}; - Configurable weightFileName{"weightFileName", "Weights.root", "Name of the weight file to be used for PVContrib"}; - Configurable> centRangesForWeights{"centRangesForWeights", {0.0, 5.0, 10.0, 30.0, 50.0, 70.0, 100.0}, "Centrality ranges for weights. Size of ranges should be equal to nWeights + 1"}; + Configurable ccdbPathForWeight{"ccdbPathForWeight", "", "CCDB path for pt shape weights"}; + Configurable timestampCCDB{"timestampCCDB", -1, "CCDB timestamp for pt shape weights"}; + Configurable weightFileName{"weightFileName", "Weights.root", "Name of the weight file to be used for pt shape study"}; Configurable yCandDstarRecoMax{"yCandDstarRecoMax", 0.8, "max. candidate Dstar rapidity"}; Configurable yCandDstarGenMax{"yCandDstarGenMax", 0.5, "max. rapidity of Generator level Particle"}; @@ -80,9 +79,23 @@ struct HfTaskDstarToD0Pi { o2::ccdb::CcdbApi ccdbApi; SliceCache cache; - std::vector hWeights; + std::vector hWeights; + int const nWeights = 2; // prompt and non-prompt weights + std::vector const weightHistNames = {"promptWeightVsPt", "nonPromptWeightVsPt"}; + enum weightType { + Prompt = 0, + NonPrompt = 1 + }; + + // for offline weights + std::vector axesPtVsCentVsBDTVsPvContribVsPtB; + std::vector axesPtVsCentVsPvContribVsPtB; + std::vector axesPtVsPvContribVsPtB; + std::vector axesPtVsBDTVsPtB; + std::vector axesPtVsCentVsBDTVsPvContrib; std::vector axesPtVsCentVsPvContrib; + std::vector axesPtVsPvContrib; std::vector axesPtVsBDT; using CandDstarWSelFlag = soa::Join; @@ -114,6 +127,7 @@ struct HfTaskDstarToD0Pi { ConfigurableAxis binningBkgBDTScore{"binningBkgBDTScore", {100, 0.0f, 1.0f}, "Bins for background BDT Score"}; ConfigurableAxis binningSigBDTScore{"binningSigBDTScore", {100, 0.0f, 1.0f}, "Bins for Signal (Prompts + Non Prompt) BDT Score"}; ConfigurableAxis binningPvContrib{"binningPvContrib", {100, 0.0f, 300.0f}, "Bins for PVContrib"}; + ConfigurableAxis binningPtFine{"binningPtFine", {100, 0.0f, 100.0f}, "fine bins for pT shape offline study "}; // for offline pt shape study HistogramRegistry registry{"registry", {}}; @@ -136,10 +150,27 @@ struct HfTaskDstarToD0Pi { AxisSpec axisPvContrib = {binningPvContrib, "PV Contribution"}; AxisSpec const axisPt = {vecPtBins, "#it{p}_{T} (GeV/#it{c})"}; + // for offline weights + AxisSpec axisPtFine = {vecPtBins, "#it{p}_{T} (GeV/#it{c})"}; + if (ptShapeStudy && !useWeightOnline) { + axisPtFine = {binningPtFine, "pT (GeV/c)"}; + } + // // std::cout<< "fine pt bins for pt shape study: binningPtFine"<< binningPtFine->data() << std::endl; + // // std::cout<< "fine pt bins for pt shape study: axisPtFine"<< axisPtFine.binEdges[2] << std::endl; + axesPtVsCentVsBDTVsPvContrib = {axisPt, axisCentrality, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt, axisPvContrib}; axesPtVsCentVsPvContrib = {axisPt, axisCentrality, axisPvContrib}; + axesPtVsPvContrib = {axisPt, axisPvContrib}; axesPtVsBDT = {axisPt, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt}; + // for offline weights + if (ptShapeStudy && !useWeightOnline) { + axesPtVsCentVsBDTVsPvContribVsPtB = {axisPt, axisCentrality, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt, axisPvContrib, axisPtFine}; + axesPtVsCentVsPvContribVsPtB = {axisPt, axisCentrality, axisPvContrib, axisPtFine}; + axesPtVsPvContribVsPtB = {axisPt, axisPvContrib, axisPtFine}; + axesPtVsBDTVsPtB = {axisPt, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt, axisPtFine}; + } + if (qaEnabled) { // only QA registry.add("QA/hPtDstar", "Dstar Candidates; Dstar candidate #it{p}_{T} (GeV/#it{c}); entries", {HistType::kTH1F, {{360, 0., 36.}}}); @@ -223,7 +254,14 @@ struct HfTaskDstarToD0Pi { // Non Prmpt Gen registry.add("Efficiency/hPtVsYNonPromptDstarGen", "MC Matched Non-Prompt D* Candidates at Generator Level; #it{p}_{T} of D*; #it{y}", {HistType::kTH2F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}}}, true); - // Checking PV contributors from Data as well MC rec for calculation weights offline + if (ptShapeStudy && !useWeightOnline) { + // Prompt Gen + registry.add("Efficiency/PtShape/hPtVsYVsFinePtPromptDstarGen", "MC Matched Prompt D* Candidates at Generator Level; #it{p}_{T} of D*; #it{y}; #it{p}_{T} of D*", {HistType::kTH3F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}, {axisPtFine}}}, true); + // Non Prmpt Gen + registry.add("Efficiency/PtShape/hPtVsYVsFinePtBNonPromptDstarGen", "MC Matched Non-Prompt D* Candidates at Generator Level; #it{p}_{T} of D*; #it{y}; #it{p}_{T} of B hadron", {HistType::kTH3F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}, {100, -5., 5.}, {axisPtFine}}}, true); + } + + // Checking PV contributors from Data as well MC rec for calculation of efficiency weights offline if (isCentStudy) { registry.add("Efficiency/hNumPvContributorsAll", "PV Contributors; PV Contributor; FT0M Centrality", {HistType::kTH2F, {{axisPvContrib}, {axisCentrality}}}, true); registry.add("Efficiency/hNumPvContributorsCand", "PV Contributors; PV Contributor; FT0M Centrality", {HistType::kTH2F, {{axisPvContrib}, {axisCentrality}}}, true); @@ -235,10 +273,18 @@ struct HfTaskDstarToD0Pi { registry.add("Efficiency/hPtVsCentVsPvContribRecSig", "Pt Vs Cent Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsPvContrib}, true); registry.add("Efficiency/hPtPromptVsCentVsPvContribRecSig", "Pt Vs Cent Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsPvContrib}, true); registry.add("Efficiency/hPtNonPromptVsCentVsPvContribRecSig", "Pt Vs Cent Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsPvContrib}, true); + if (ptShapeStudy && !useWeightOnline) { + registry.add("Efficiency/PtShape/hPtPromptVsCentVsPvContribVsFinePtRecSig", "Pt Vs Cent Vs PvContrib Vs Fine Pt of D*", {HistType::kTHnSparseF, axesPtVsCentVsPvContribVsPtB}, true); + registry.add("Efficiency/PtShape/hPtNonPromptVsCentVsPvContribVsFinePtBRecSig", "Pt Vs Cent Vs PvContrib Vs Fine Pt of B hadron", {HistType::kTHnSparseF, axesPtVsCentVsPvContribVsPtB}, true); + } } else if (doprocessMcWoMl && !isCentStudy) { - registry.add("Efficiency/hPtVsPvContribRecSig", "Pt Vs PvContrib", {HistType::kTHnSparseF, axesPtVsBDT}, true); - registry.add("Efficiency/hPtPromptVsPvContribRecSig", "Pt Vs PvContrib", {HistType::kTHnSparseF, axesPtVsBDT}, true); - registry.add("Efficiency/hPtNonPromptVsPvContribRecSig", "Pt Vs PvContrib", {HistType::kTHnSparseF, axesPtVsBDT}, true); + registry.add("Efficiency/hPtVsPvContribRecSig", "Pt Vs PvContrib", {HistType::kTHnSparseF, axesPtVsPvContrib}, true); + registry.add("Efficiency/hPtPromptVsPvContribRecSig", "Pt Vs PvContrib", {HistType::kTHnSparseF, axesPtVsPvContrib}, true); + registry.add("Efficiency/hPtNonPromptVsPvContribRecSig", "Pt Vs PvContrib", {HistType::kTHnSparseF, axesPtVsPvContrib}, true); + if (ptShapeStudy && !useWeightOnline) { + registry.add("Efficiency/PtShape/hPtPromptVsPvContribVsFinePtRecSig", "Pt Vs PvContrib Vs Fine Pt of D*", {HistType::kTHnSparseF, axesPtVsPvContribVsPtB}, true); + registry.add("Efficiency/PtShape/hPtNonPromptVsPvContribVsFinePtBRecSig", "Pt Vs PvContrib Vs Fine Pt of B hadron", {HistType::kTHnSparseF, axesPtVsPvContribVsPtB}, true); + } } // Hists at Reco level W/ ML usefull for efficiency calculation @@ -246,11 +292,19 @@ struct HfTaskDstarToD0Pi { registry.add("Efficiency/hPtVsCentVsBDTScoreVsPvContribRecSig", "Pt Vs Cent Vs BDTScore Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsBDTVsPvContrib}, true); registry.add("Efficiency/hPtPromptVsCentVsBDTScorePvContribRecSig", "Pt Vs Cent Vs BDTScore Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsBDTVsPvContrib}, true); registry.add("Efficiency/hPtNonPrompRectVsCentVsBDTScorePvContribRecSig", "Pt Vs Cent Vs BDTScore", {HistType::kTHnSparseF, axesPtVsCentVsBDTVsPvContrib}, true); + if (ptShapeStudy && !useWeightOnline) { + registry.add("Efficiency/PtShape/hPtPromptVsCentVsBDTScoreVsPvContribVsFinePtRecSig", "Pt Vs Cent Vs BDTScore Vs PvContrib Vs Fine Pt of D*", {HistType::kTHnSparseF, axesPtVsCentVsBDTVsPvContribVsPtB}, true); + registry.add("Efficiency/PtShape/hPtNonPromptVsCentVsBDTScorePvContribVsFinePtBRecSig", "Pt Vs Cent Vs BDTScore Vs PvContrib Vs Fine Pt of B hadron", {HistType::kTHnSparseF, axesPtVsCentVsBDTVsPvContribVsPtB}, true); + } // registry.add("Efficiency/hPtBkgVsCentVsBDTScore", "Pt Vs Cent Vs BDTScore", {HistType::kTHnSparseF, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}, {axisCentrality}, {axisBDTScoreBackground}, {axisBDTScorePrompt}, {axisBDTScoreNonPrompt}}}); } else if (doprocessMcWML && !isCentStudy) { registry.add("Efficiency/hPtVsBDTScoreRecSig", "Pt Vs BDTScore", {HistType::kTHnSparseF, axesPtVsBDT}, true); registry.add("Efficiency/hPtPromptVsBDTScoreRecSig", "Pt Vs BDTScore", {HistType::kTHnSparseF, axesPtVsBDT}, true); registry.add("Efficiency/hPtNonPromptVsBDTScoreRecSig", "Pt Vs BDTScore", {HistType::kTHnSparseF, axesPtVsBDT}, true); + if (ptShapeStudy && !useWeightOnline) { + registry.add("Efficiency/PtShape/hPtPromptVsBDTScoreVsFinePtRecSig", "Pt Vs BDTScore Vs Fine Pt of D*", {HistType::kTHnSparseF, axesPtVsBDTVsPtB}, true); + registry.add("Efficiency/PtShape/hPtNonPromptVsBDTScoreVsFinePtBRecSig", "Pt Vs BDTScore Vs Fine Pt of B hadron", {HistType::kTHnSparseF, axesPtVsBDTVsPtB}, true); + } } // Hists at Gen level usefull for efficiency calculation @@ -260,10 +314,18 @@ struct HfTaskDstarToD0Pi { registry.add("Efficiency/hPtVsCentVsPvContribGen", "Pt Vs Cent Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsPvContrib}, true); registry.add("Efficiency/hPtPromptVsCentVsPvContribGen", "Pt Vs Cent Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsPvContrib}, true); registry.add("Efficiency/hPtNonPromptVsCentVsPvContribGen", "Pt Vs Cent Vs PvContrib", {HistType::kTHnSparseF, axesPtVsCentVsPvContrib}, true); + if (ptShapeStudy && !useWeightOnline) { + registry.add("Efficiency/PtShape/hPtPromptVsCentVsPvContribVsFinePtGen", "Pt Vs Cent Vs PvContrib Vs Fine Pt of D*", {HistType::kTHnSparseF, axesPtVsCentVsPvContribVsPtB}, true); + registry.add("Efficiency/PtShape/hPtNonPromptVsCentVsPvContribVsFinePtBGen", "Pt Vs Cent Vs PvContrib Vs Fine Pt of B hadron", {HistType::kTHnSparseF, axesPtVsCentVsPvContribVsPtB}, true); + } } else { registry.add("Efficiency/hPtGen", "MC Matched D* Candidates at Generator Level", {HistType::kTH1F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}}}, true); registry.add("Efficiency/hPtPromptVsGen", "MC Matched Prompt D* Candidates at Generator Level", {HistType::kTH1F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}}}, true); registry.add("Efficiency/hPtNonPromptVsGen", "MC Matched Non-Prompt D* Candidates at Generator Level", {HistType::kTH1F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}}}, true); + if (ptShapeStudy && !useWeightOnline) { + registry.add("Efficiency/PtShape/hPtPromptVsFinePtGen", "MC Matched Prompt D* Candidates at Generator Level; #it{p}_{T} of D*; #it{p}_{T} of D*", {HistType::kTH2F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}, {axisPtFine}}}, true); + registry.add("Efficiency/PtShape/hPtNonPromptVsFinePtBGen", "MC Matched Non-Prompt D* Candidates at Generator Level; #it{p}_{T} of D*; #it{p}_{T} of B hadron", {HistType::kTH2F, {{vecPtBins, "#it{p}_{T} (GeV/#it{c})"}, {axisPtFine}}}, true); + } } } @@ -289,8 +351,8 @@ struct HfTaskDstarToD0Pi { } } - // if weights to be applied - if (useWeight) { + // if weights to be applied for pt shape study + if (ptShapeStudy && useWeightOnline) { ccdbApi.init(ccdbUrl); std::map const metadata; // Retrieve the file from CCDB @@ -300,28 +362,39 @@ struct HfTaskDstarToD0Pi { return; } - if (isCentStudy) { - // Open the ROOT file - TFile* weightFile = TFile::Open(weightFileName.value.c_str(), "READ"); - if ((weightFile != nullptr) && !weightFile->IsZombie()) { - // Ensure hWeights is properly sized - hWeights.resize(nWeights); - for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { - std::string const histName = "hMult" + std::to_string(ithWeight + 1) + "_Weight"; - hWeights[ithWeight] = dynamic_cast(weightFile->Get(histName.c_str())); - if (hWeights[ithWeight] == nullptr) { - LOGF(fatal, "Histogram %s not found in weight file!", histName.c_str()); - return; - } - hWeights[ithWeight]->SetDirectory(nullptr); - hWeights[ithWeight]->SetName(("hWeight" + std::to_string(ithWeight + 1)).c_str()); - } - weightFile->Close(); - delete weightFile; - } else { - LOGF(fatal, "Failed to open weight file from CCDB: %s", weightFileName.value.c_str()); + // Open the ROOT file to intialise weight hists + TFile* weightFile = TFile::Open(weightFileName.value.c_str(), "READ"); + if ((weightFile != nullptr) && !weightFile->IsZombie()) { + // Ensure hWeights is properly sized + hWeights.resize(nWeights); // prompt and non-prompt + + hWeights[weightType::Prompt] = dynamic_cast(weightFile->Get(weightHistNames[weightType::Prompt].c_str())); + hWeights[weightType::NonPrompt] = dynamic_cast(weightFile->Get(weightHistNames[weightType::NonPrompt].c_str())); + if (hWeights[weightType::Prompt] == nullptr) { + LOGF(fatal, "Histogram %s not found in weight file!", weightHistNames[weightType::Prompt].c_str()); + return; + } + if (hWeights[weightType::NonPrompt] == nullptr) { + LOGF(fatal, "Histogram %s not found in weight file!", weightHistNames[weightType::NonPrompt].c_str()); return; } + // checking if bin wdith of weight histograms are not finner than pT axis of Dstar + if (hWeights[weightType::Prompt]->GetXaxis()->GetBinWidth(1) >= vecPtBins[1] - vecPtBins[0]) { + LOGF(fatal, "Bin width of weight histogram should be finer than pT axis of Dstar!"); + return; + } + if (hWeights[weightType::NonPrompt]->GetXaxis()->GetBinWidth(1) >= vecPtBins[1] - vecPtBins[0]) { + LOGF(fatal, "Bin width of weight histogram should be finer than pT axis of Dstar!"); + return; + } + hWeights[weightType::Prompt]->SetDirectory(nullptr); + hWeights[weightType::NonPrompt]->SetDirectory(nullptr); + + weightFile->Close(); + delete weightFile; + } else { + LOGF(fatal, "Failed to open weight file from CCDB: %s", weightFileName.value.c_str()); + return; } } } @@ -473,9 +546,10 @@ struct HfTaskDstarToD0Pi { auto prong0 = candDstarMcRec.template prong0_as(); auto indexMother = RecoDecay::getMother(rowsMcPartilces, prong0.template mcParticle_as(), o2::constants::physics::Pdg::kDStar, true, &signDstar, 2); auto particleMother = rowsMcPartilces.rawIteratorAt(indexMother); // What is difference between rawIterator() or iteratorAt() methods? + auto ptMother = particleMother.pt(); if (qaEnabled) { - registry.fill(HIST("QA/hPtSkimDstarGenSig"), particleMother.pt()); // generator level pt - registry.fill(HIST("QA/hPtVsCentSkimDstarGenSig"), particleMother.pt(), centrality); + registry.fill(HIST("QA/hPtSkimDstarGenSig"), ptMother); // generator level pt + registry.fill(HIST("QA/hPtVsCentSkimDstarGenSig"), ptMother, centrality); registry.fill(HIST("QA/hPtVsYSkimDstarRecSig"), ptDstarRecSig, yDstarRecSig); // Skimed at level of trackIndexSkimCreator if (candDstarMcRec.isRecoTopol()) { // if Topological selection are passed registry.fill(HIST("QA/hPtVsYRecoTopolDstarRecSig"), ptDstarRecSig, yDstarRecSig); @@ -487,18 +561,17 @@ struct HfTaskDstarToD0Pi { if (candDstarMcRec.isSelDstarToD0Pi()) { // if all selection passed float weightValue = 1.0; - if (useWeight && (hWeights.empty() || hWeights[0] == nullptr)) { - LOGF(fatal, "Weight histograms are not initialized or empty. Check CCDB path or weight file."); - return; - } - if (useWeight && isCentStudy) { - for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { - if (centrality > centRangesForWeights.value[ithWeight] && centrality <= centRangesForWeights.value[ithWeight + 1]) { - weightValue = hWeights[ithWeight]->GetBinContent(hWeights[ithWeight]->FindBin(nPVContributors)); - break; - } + std::vector ptShapeWeightValues(nWeights, 1.0); // Assuming two weights: one for prompt and one for non-prompt + + if (ptShapeStudy && useWeightOnline) { + if (hWeights.empty() || hWeights[0] == nullptr) { + LOGF(fatal, "Weight histograms are not initialized or empty. Check CCDB path or weight file."); + return; } + ptShapeWeightValues[weightType::Prompt] = hWeights[weightType::Prompt]->GetBinContent(hWeights[weightType::Prompt]->FindBin(ptDstarRecSig)); + ptShapeWeightValues[weightType::NonPrompt] = hWeights[weightType::NonPrompt]->GetBinContent(hWeights[weightType::NonPrompt]->FindBin(ptMother)); } + if (qaEnabled) { registry.fill(HIST("QA/hPtFullRecoDstarRecSig"), ptDstarRecSig); } @@ -508,33 +581,61 @@ struct HfTaskDstarToD0Pi { auto bdtScore = candDstarMcRec.mlProbDstarToD0Pi(); registry.fill(HIST("Efficiency/hPtVsCentVsBDTScoreVsPvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, weightValue); if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtPromptVsCentVsBDTScorePvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, weightValue); + registry.fill(HIST("Efficiency/hPtPromptVsCentVsBDTScorePvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, ptShapeWeightValues[weightType::Prompt]); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("Efficiency/hPtNonPrompRectVsCentVsBDTScorePvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, weightValue); + registry.fill(HIST("Efficiency/hPtNonPrompRectVsCentVsBDTScorePvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, ptShapeWeightValues[weightType::NonPrompt]); + } + if (ptShapeStudy && !useWeightOnline) { + if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/PtShape/hPtPromptVsCentVsBDTScoreVsPvContribVsFinePtRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, ptDstarRecSig); + } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/PtShape/hPtNonPromptVsCentVsBDTScorePvContribVsFinePtBRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, ptMother); + } } } else { auto bdtScore = candDstarMcRec.mlProbDstarToD0Pi(); registry.fill(HIST("Efficiency/hPtVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], weightValue); if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtPromptVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], weightValue); + registry.fill(HIST("Efficiency/hPtPromptVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], ptShapeWeightValues[weightType::Prompt]); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("Efficiency/hPtNonPromptVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], weightValue); + registry.fill(HIST("Efficiency/hPtNonPromptVsBDTScoreRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], ptShapeWeightValues[weightType::NonPrompt]); + } + if (ptShapeStudy && !useWeightOnline) { + if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/PtShape/hPtPromptVsBDTScoreVsFinePtRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], ptDstarRecSig); + } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/PtShape/hPtNonPromptVsBDTScoreVsFinePtBRecSig"), ptDstarRecSig, bdtScore[0], bdtScore[1], bdtScore[2], ptMother); + } } } } else { // All efficiency histograms at reconstruction level w/o ml if (isCentStudy) { registry.fill(HIST("Efficiency/hPtVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, weightValue); if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, weightValue); + registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, ptShapeWeightValues[weightType::Prompt]); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, weightValue); + registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribRecSig"), ptDstarRecSig, centrality, nPVContributors, ptShapeWeightValues[weightType::NonPrompt]); + } + if (ptShapeStudy && !useWeightOnline) { + if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/PtShape/hPtPromptVsCentVsPvContribVsFinePtRecSig"), ptDstarRecSig, centrality, nPVContributors, ptDstarRecSig); + } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/PtShape/hPtNonPromptVsCentVsPvContribVsFinePtBRecSig"), ptDstarRecSig, centrality, nPVContributors, ptMother); + } } } else { registry.fill(HIST("Efficiency/hPtVsPvContribRecSig"), ptDstarRecSig, nPVContributors, weightValue); if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, weightValue); + registry.fill(HIST("Efficiency/hPtPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, ptShapeWeightValues[weightType::Prompt]); } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("Efficiency/hPtNonPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, weightValue); + registry.fill(HIST("Efficiency/hPtNonPromptVsPvContribRecSig"), ptDstarRecSig, nPVContributors, ptShapeWeightValues[weightType::NonPrompt]); + } + if (ptShapeStudy && !useWeightOnline) { + if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/PtShape/hPtPromptVsPvContribVsFinePtRecSig"), ptDstarRecSig, nPVContributors, ptDstarRecSig); + } else if (candDstarMcRec.originMcRec() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/PtShape/hPtNonPromptVsPvContribVsFinePtBRecSig"), ptDstarRecSig, nPVContributors, ptMother); + } } } } @@ -631,6 +732,12 @@ struct HfTaskDstarToD0Pi { for (auto const& mcParticle : rowsMcPartilces) { if (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { // MC Matching is successful at Generator Level auto ptGen = mcParticle.pt(); + + // mother information + auto idxBhadMotherPart = mcParticle.idxBhadMotherPart(); + auto bMother = rowsMcPartilces.rawIteratorAt(idxBhadMotherPart); + auto ptBMother = bMother.pt(); + auto yGen = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassDStar); if (yCandDstarGenMax >= 0. && std::abs(yGen) > yCandDstarGenMax) { continue; @@ -668,17 +775,15 @@ struct HfTaskDstarToD0Pi { } float weightValue = 1.0; - if (useWeight && (hWeights.empty() || hWeights[0] == nullptr)) { - LOGF(fatal, "Weight histograms are not initialized or empty. Check CCDB path or weight file."); - return; - } - if (useWeight && isCentStudy) { - for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { - if (centFT0MGen > centRangesForWeights.value[ithWeight] && centFT0MGen <= centRangesForWeights.value[ithWeight + 1]) { - weightValue = hWeights[ithWeight]->GetBinContent(hWeights[ithWeight]->FindBin(centFT0MGen, pvContributors)); - break; - } + std::vector ptShapeWeightValues(nWeights, 1.0); // Assuming two weights: one for prompt and one for non-prompt + + if (ptShapeStudy && useWeightOnline) { + if (hWeights.empty() || hWeights[0] == nullptr) { + LOGF(fatal, "Weight histograms are not initialized or empty. Check CCDB path or weight file."); + return; } + ptShapeWeightValues[weightType::Prompt] = hWeights[weightType::Prompt]->GetBinContent(hWeights[weightType::Prompt]->FindBin(ptGen)); + ptShapeWeightValues[weightType::NonPrompt] = hWeights[weightType::NonPrompt]->GetBinContent(hWeights[weightType::NonPrompt]->FindBin(ptBMother)); } registry.fill(HIST("Efficiency/hPtVsYDstarGen"), ptGen, yGen, weightValue); @@ -693,20 +798,39 @@ struct HfTaskDstarToD0Pi { // Prompt if (mcParticle.originMcGen() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("Efficiency/hPtVsYPromptDstarGen"), ptGen, yGen, weightValue); + registry.fill(HIST("Efficiency/hPtVsYPromptDstarGen"), ptGen, yGen, ptShapeWeightValues[weightType::Prompt]); if (isCentStudy) { - registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, weightValue); + registry.fill(HIST("Efficiency/hPtPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, ptShapeWeightValues[weightType::Prompt]); } else { - registry.fill(HIST("Efficiency/hPtPromptVsGen"), ptGen, weightValue); + registry.fill(HIST("Efficiency/hPtPromptVsGen"), ptGen, ptShapeWeightValues[weightType::Prompt]); } // Non-Prompt } else if (mcParticle.originMcGen() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("Efficiency/hPtVsYNonPromptDstarGen"), ptGen, yGen, weightValue); + registry.fill(HIST("Efficiency/hPtVsYNonPromptDstarGen"), ptGen, yGen, ptShapeWeightValues[weightType::NonPrompt]); if (isCentStudy) { - registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, weightValue); + registry.fill(HIST("Efficiency/hPtNonPromptVsCentVsPvContribGen"), ptGen, centFT0MGen, pvContributors, ptShapeWeightValues[weightType::NonPrompt]); } else { - registry.fill(HIST("Efficiency/hPtNonPromptVsGen"), ptGen, weightValue); + registry.fill(HIST("Efficiency/hPtNonPromptVsGen"), ptGen, ptShapeWeightValues[weightType::NonPrompt]); + } + } + if (ptShapeStudy && !useWeightOnline) { + // prompt + if (mcParticle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/PtShape/hPtVsYVsFinePtPromptDstarGen"), ptGen, yGen, ptGen); + if (isCentStudy) { + registry.fill(HIST("Efficiency/PtShape/hPtPromptVsCentVsPvContribVsFinePtGen"), ptGen, centFT0MGen, pvContributors, ptGen); + } else { + registry.fill(HIST("Efficiency/PtShape/hPtPromptVsFinePtGen"), ptGen, ptGen); + } + // Non-Prompt + } else if (mcParticle.originMcGen() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/PtShape/hPtVsYVsFinePtBNonPromptDstarGen"), ptGen, yGen, ptBMother); + if (isCentStudy) { + registry.fill(HIST("Efficiency/PtShape/hPtNonPromptVsCentVsPvContribVsFinePtBGen"), ptGen, centFT0MGen, pvContributors, ptBMother); + } else { + registry.fill(HIST("Efficiency/PtShape/hPtNonPromptVsFinePtBGen"), ptGen, ptBMother); + } } } } diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 07fe259219a..6e4701bc63b 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -720,7 +720,7 @@ struct HfCandidateCreatorDstarExpressions { // check wether the particle is non-promt (from a B0 hadron) if (flagDstar != 0) { - auto particleDstar = mcParticles.iteratorAt(indexRecDstar); + auto particleDstar = mcParticles.rawIteratorAt(indexRecDstar); originDstar = RecoDecay::getCharmHadronOrigin(mcParticles, particleDstar, false, &idxBhadMothers); } if (originDstar == RecoDecay::OriginType::NonPrompt) { From 4154efb8b2e8d7667c6f2c3816cf38a7c8395678 Mon Sep 17 00:00:00 2001 From: sawan <124118453+sawankumawat@users.noreply.github.com> Date: Sat, 4 Apr 2026 02:54:55 +0530 Subject: [PATCH 168/282] [PWGLF] Put vz cut as configurable (#15213) --- PWGLF/Tasks/Resonances/kstarqa.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 26a9c5aed59..e581299b318 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -98,7 +98,7 @@ struct Kstarqa { Configurable isApplyMCchecksClosure{"isApplyMCchecksClosure", true, "Apply MC checks for closure test"}; Configurable deltaRCut{"deltaRCut", 0.0f, "Apply deltaR cut between two daughters"}; - // Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; Configurable configOccCut{"configOccCut", 1000., "Occupancy cut"}; // Configurables for track selections @@ -157,7 +157,7 @@ struct Kstarqa { float lowPtCutPID = 0.5; int noOfDaughters = 2; // float rapidityMotherData = 0.5; - float cutzvertex = 10.0f; + // float cutzvertex = 10.0f; float cfgCutEtaMax = 0.8f; float cfgCutPT = 0.2f; float cfgDeepAngle = 0.04; @@ -253,7 +253,7 @@ struct Kstarqa { std::vector eveCutLabels = { "All Events", - Form("|Vz| < %.1f", selectionConfig.cutzvertex), + "|Vz| < 10", "sel8", std::string("kNoTimeFrameBorder") + check(selectionConfig.isNoTimeFrameBorder.value), std::string("kNoITSROFrameBorder") + check(selectionConfig.isNoITSROFrameBorder.value), From c60f88822f3bc937218198f0c850c41df38b7262 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Sat, 4 Apr 2026 00:37:32 +0200 Subject: [PATCH 169/282] =?UTF-8?q?[PWGCF]=20fix=20call=20to=20flow-pt=20c?= =?UTF-8?q?ontainer=20array=20before=20correlations=20filled,=20fixed?= =?UTF-8?q?=E2=80=A6=20(#15646)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tasks/flowGenericFramework.cxx | 214 +++++++++--------- 1 file changed, 104 insertions(+), 110 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index eeb2c4965f8..e43730e8212 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -242,10 +242,7 @@ struct FlowGenericFramework { // Define output OutputObj fFC{FlowContainer("FlowContainer")}; - OutputObj fFCpt_ch{FlowPtContainer("FlowPtContainer_ch")}; - OutputObj fFCpt_pi{FlowPtContainer("FlowPtContainer_pi")}; - OutputObj fFCpt_ka{FlowPtContainer("FlowPtContainer_ka")}; - OutputObj fFCpt_pr{FlowPtContainer("FlowPtContainer_pr")}; + OutputObj fFCpt{FlowPtContainer("FlowPtContainer")}; OutputObj fFCgen{FlowContainer("FlowContainer_gen")}; HistogramRegistry registry{"registry"}; @@ -255,8 +252,6 @@ struct FlowGenericFramework { std::array itsNsigmaCut; std::array tpcNsigmaCut; - std::vector fFCpts = {&(*fFCpt_ch), &(*fFCpt_pi), &(*fFCpt_ka), &(*fFCpt_pr)}; - // QA outputs std::map>> th1sList; std::map>> th3sList; @@ -328,6 +323,13 @@ struct FlowGenericFramework { KAONS, PROTONS }; + enum ParticleIDs { + CHARGEDID, + PIONID, + KAONID, + PROTONID, + SPECIESCOUNT + }; enum OutputSpecies { K0 = 0, LAMBDA = 1, @@ -465,7 +467,7 @@ struct FlowGenericFramework { projectMatrix(cfgPIDCuts.nSigmas->getData(), tpcNsigmaCut, tofNsigmaCut, itsNsigmaCut); readMatrix(cfgPIDCuts.resonanceCuts->getData(), resoCutVals); readMatrix(cfgPIDCuts.resonanceSwitches->getData(), resoSwitchVals); - PrintResoCuts(); + printResoCuts(); AxisSpec phiAxis = {o2::analysis::gfw::phibins, o2::analysis::gfw::philow, o2::analysis::gfw::phiup, "#phi"}; AxisSpec phiModAxis = {100, 0, constants::math::PI / 9, "fmod(#varphi,#pi/9)"}; @@ -675,11 +677,10 @@ struct FlowGenericFramework { fFCgen->Initialize(oba, multAxis, cfgNbootstrap); } delete oba; - for (auto& container : fFCpts) { - container->setUseCentralMoments(cfgUseCentralMoments); - container->setUseGapMethod(cfgUseGapMethod); - container->initialise(multAxis, cfgMpar, o2::analysis::gfw::configs, cfgNbootstrap); - } + + fFCpt->setUseCentralMoments(cfgUseCentralMoments); + fFCpt->setUseGapMethod(cfgUseGapMethod); + fFCpt->initialise(multAxis, cfgMpar, o2::analysis::gfw::configs, cfgNbootstrap); // Multiplicity correlation cuts if (cfgMultCut) { @@ -752,7 +753,7 @@ struct FlowGenericFramework { static constexpr std::string_view FillTimeName[] = {"before/", "after/"}; - void PrintResoCuts() + void printResoCuts() { auto printTable = [](const auto& lbl, const auto& valuesMatrix, const std::string& title) { LOGF(info, "===== %s =====", title.c_str()); @@ -1013,7 +1014,7 @@ struct FlowGenericFramework { th1sList[run][hEventSel]->Fill(kTVXinTRD); } // Cut on event selection flags - for (auto& cut : eventcutflags) { + for (const auto& cut : eventcutflags) { if (!cut.enabled) continue; if (!collision.selection_bit(cut.flag)) @@ -1111,7 +1112,7 @@ struct FlowGenericFramework { { if (std::fabs(track.dcaXY()) > (0.0105f + 0.0035f / track.pt())) return false; - return ((track.tpcNClsCrossedRows() >= 70) && (track.tpcNClsFound() >= 50) && (track.itsNCls() >= 5)); + return ((track.tpcNClsCrossedRows() >= 70) && (track.tpcNClsFound() >= 50) && (track.itsNCls() >= 5)); // o2-linter: disable=magic-number (hard coded default cuts) } enum DataType { @@ -1215,7 +1216,7 @@ struct FlowGenericFramework { } float total = 0; - unsigned int total_uncorr = 0; + unsigned int totaluncorr = 0; std::vector pidtotal; std::vector nch; @@ -1227,13 +1228,11 @@ struct FlowGenericFramework { template void fillOutputContainers(const float& centmult, const double& rndm, AcceptedTracks acceptedtracks) { - for (auto& container : fFCpts) { - container->calculateCorrelations(); - container->fillPtProfiles(centmult, rndm); - container->fillCMProfiles(centmult, rndm); - } + fFCpt->calculateCorrelations(); + fFCpt->fillPtProfiles(centmult, rndm); + fFCpt->fillCMProfiles(centmult, rndm); if (!cfgUseGapMethod) - fFCpts[0]->fillVnPtStdProfiles(centmult, rndm); + fFCpt->fillVnPtStdProfiles(centmult, rndm); for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { if (!corrconfigs.at(l_ind).pTDif) { @@ -1244,7 +1243,7 @@ struct FlowGenericFramework { if (std::abs(val) < 1) { (dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm) : fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm); if (cfgUseGapMethod) { - fFCpts[0]->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); + fFCpt->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); } } continue; @@ -1259,13 +1258,13 @@ struct FlowGenericFramework { } } - double chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; + double chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.totaluncorr; // calculate fractions std::vector> inputs = {acceptedtracks.nch, acceptedtracks.npi, acceptedtracks.nka, acceptedtracks.npr}; std::vector> fractions; fractions.reserve(inputs.size()); int pidcounter = 0; - for (const auto& vec : inputs) { + for (auto& vec : inputs) { // o2-linter: disable=const-ref-in-for-loop (modified through transform) fractions.emplace_back(); fractions.back().reserve(vec.size()); @@ -1292,10 +1291,10 @@ struct FlowGenericFramework { for (std::size_t i = 0; i < fractions[3].size(); ++i) registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[3][i]); - if (corrconfigsV02.size() < 4) + if (corrconfigsV02.size() < SPECIESCOUNT) // return; - for (uint l_ind = 0; l_ind < 4; ++l_ind) { + for (uint l_ind = 0; l_ind < SPECIESCOUNT; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) @@ -1306,16 +1305,14 @@ struct FlowGenericFramework { } } - if (corrconfigsV0.size() < 4) + if (corrconfigsV0.size() < SPECIESCOUNT) return; - - if (fFCpts[0]->corrDen[0] == 0.) + if (fFCpt->corrDen[0] == 0.) return; - - for (uint l_ind = 0; l_ind < 4; ++l_ind) { - double mpt = fFCpts[0]->corrNum[1] / fFCpts[0]->corrDen[1]; + for (uint l_ind = 0; l_ind < SPECIESCOUNT; ++l_ind) { + double mpt = fFCpt->corrNum[1] / fFCpt->corrDen[1]; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm); + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm); } } return; @@ -1340,8 +1337,7 @@ struct FlowGenericFramework { th1sList[run][hCent]->Fill(centrality); } fGFW->Clear(); - for (auto& container : fFCpts) - container->clearVector(); + fFCpt->clearVector(); float lRandom = fRndm->Rndm(); // be cautious, this only works for Pb-Pb @@ -1384,9 +1380,28 @@ struct FlowGenericFramework { processTrack(track, vtxz, field, run, densitycorrections, acceptedTracks); } registry.fill(HIST("trackQA/after/Nch_corrected"), acceptedTracks.total); - registry.fill(HIST("trackQA/after/Nch_uncorrected"), acceptedTracks.total_uncorr); + registry.fill(HIST("trackQA/after/Nch_uncorrected"), acceptedTracks.totaluncorr); + + int multiplicity = 0; + switch (cfgUseNchCorrection) { + case 0: + multiplicity = tracks.size(); + break; + case 1: + multiplicity = acceptedTracks.total; + break; + case 2: + multiplicity = acceptedTracks.totaluncorr; + break; + default: + multiplicity = tracks.size(); + break; + } + + if (!cfgFillWeights) + fillOutputContainers
((cfgUseNch) ? multiplicity : centrality, lRandom, acceptedTracks); - std::vector> npt_resonances(6, std::vector(o2::analysis::gfw::ptbinning.size())); + std::vector> nptResonances(6, std::vector(o2::analysis::gfw::ptbinning.size())); // Process V0s for (const auto& v0 : v0s) { if (resoSwitchVals[K0][kUseParticle]) { @@ -1395,11 +1410,11 @@ struct FlowGenericFramework { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) - npt_resonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + nptResonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMin && v0.mK0Short() < cfgPIDCuts.cfgK0SignalMax) - npt_resonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + nptResonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand2Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand2Max) - npt_resonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + nptResonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } @@ -1410,20 +1425,20 @@ struct FlowGenericFramework { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand1Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand1Max) - npt_resonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + nptResonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMin && v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMax) - npt_resonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + nptResonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand2Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand2Max) - npt_resonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + nptResonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } } - double chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; + double chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.totaluncorr; // calculate fractions - std::vector> fractions_resonances = npt_resonances; + std::vector> fractions_resonances = nptResonances; int pidcounter = 0; - for (auto& vec : fractions_resonances) { + for (auto& vec : fractions_resonances) { // o2-linter: disable=const-ref-in-for-loop (modified through transform) double total = chtotal; if (cfgUsePIDTotal) total = (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0.f) : chtotal; @@ -1448,7 +1463,6 @@ struct FlowGenericFramework { registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[5][i]); for (std::size_t i = 0; i < fractions_resonances[4].size(); ++i) registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[4][i]); - for (uint l_ind = 4; l_ind < corrconfigsV02.size(); ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); @@ -1459,32 +1473,15 @@ struct FlowGenericFramework { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); } } - for (uint l_ind = 4; l_ind < corrconfigsV0.size(); ++l_ind) { - double mpt = fFCpts[0]->corrNum[1] / fFCpts[0]->corrDen[1]; + double dn = fFCpt->corrDen[1]; + if (dn == 0.) + continue; + double mpt = fFCpt->corrNum[1] / dn; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom); } } - - int multiplicity = 0; - switch (cfgUseNchCorrection) { - case 0: - multiplicity = tracks.size(); - break; - case 1: - multiplicity = acceptedTracks.total; - break; - case 2: - multiplicity = acceptedTracks.total_uncorr; - break; - default: - multiplicity = tracks.size(); - break; - } - - if (!cfgFillWeights) - fillOutputContainers
((cfgUseNch) ? multiplicity : centrality, lRandom, acceptedTracks); } template @@ -1511,7 +1508,7 @@ struct FlowGenericFramework { if (std::abs(track.eta()) < cfgEtaNch) { if (weffCh > 0) acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; - ++acceptedTracks.total_uncorr; + ++acceptedTracks.totaluncorr; } if (!trackSelected(track, field)) @@ -1520,11 +1517,11 @@ struct FlowGenericFramework { int pidIndex = 0; if (cfgUsePID) { if (std::abs(mcParticle.pdgCode()) == kPiPlus) - pidIndex = 1; + pidIndex = PIONID; if (std::abs(mcParticle.pdgCode()) == kKPlus) - pidIndex = 2; + pidIndex = KAONID; if (std::abs(mcParticle.pdgCode()) == kProton) - pidIndex = 3; + pidIndex = PROTONID; } if (std::abs(track.eta()) < cfgEtaNch) { @@ -1537,11 +1534,11 @@ struct FlowGenericFramework { if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (weffCh > 0) acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; - if (pidIndex == 1 && weff > 0) + if (pidIndex == PIONID && weff > 0) acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (pidIndex == 2 && weff > 0) + if (pidIndex == KAONID && weff > 0) acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - if (pidIndex == 3 && weff > 0) + if (pidIndex == PROTONID && weff > 0) acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } @@ -1549,7 +1546,7 @@ struct FlowGenericFramework { if (cfgFillWeights) { fillWeights(mcParticle, vtxz, 0, run); } else { - fillPtSums(track, vtxz, pidIndex); + fillPtSums(track, vtxz); fillGFW(mcParticle, vtxz, pidIndex, densitycorrections); } @@ -1582,7 +1579,7 @@ struct FlowGenericFramework { if (std::abs(track.eta()) < cfgEtaNch) { ++acceptedTracks.total; - ++acceptedTracks.total_uncorr; + ++acceptedTracks.totaluncorr; if (pidIndex) acceptedTracks.pidtotal[pidIndex - 1] += 1; @@ -1590,16 +1587,16 @@ struct FlowGenericFramework { if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { acceptedTracks.nch[ptBinIndex] += 1.0; - if (pidIndex == 1) + if (pidIndex == PIONID) acceptedTracks.npi[ptBinIndex] += 1.0; - if (pidIndex == 2) + if (pidIndex == KAONID) acceptedTracks.nka[ptBinIndex] += 1.0; - if (pidIndex == 3) + if (pidIndex == PROTONID) acceptedTracks.npr[ptBinIndex] += 1.0; } } - fillPtSums(track, vtxz, pidIndex); + fillPtSums(track, vtxz); fillGFW(track, vtxz, pidIndex, densitycorrections); if (cfgFillQA) @@ -1615,7 +1612,7 @@ struct FlowGenericFramework { if (std::abs(track.eta()) < cfgEtaNch) { if (weffCh > 0) acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; - ++acceptedTracks.total_uncorr; + ++acceptedTracks.totaluncorr; } if (!trackSelected(track, field)) @@ -1634,13 +1631,13 @@ struct FlowGenericFramework { if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (weffCh > 0) acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; - if (pidIndex == 1 && weff > 0) { + if (pidIndex == PIONID && weff > 0) { acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } - if (pidIndex == 2 && weff > 0) { + if (pidIndex == KAONID && weff > 0) { acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } - if (pidIndex == 3 && weff > 0) { + if (pidIndex == PROTONID && weff > 0) { acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } @@ -1649,7 +1646,7 @@ struct FlowGenericFramework { if (cfgFillWeights) { fillWeights(track, vtxz, pidIndex, run); } else { - fillPtSums(track, vtxz, pidIndex); + fillPtSums(track, vtxz); fillGFW(track, vtxz, pidIndex, densitycorrections); } if (cfgFillQA) { @@ -1695,7 +1692,7 @@ struct FlowGenericFramework { bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) { - double mass_K0s = v0.mK0Short(); + double massK0s = v0.mK0Short(); auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); @@ -1704,7 +1701,7 @@ struct FlowGenericFramework { if (postrack.pt() < resoCutVals[K0][kPosTrackPt] || negtrack.pt() < resoCutVals[K0][kNegTrackPt]) return false; registry.fill(HIST("K0/hK0Count"), kFillDaughterPt); - if (mass_K0s < resoCutVals[K0][kMassMin] && mass_K0s > resoCutVals[K0][kMassMax]) + if (massK0s < resoCutVals[K0][kMassMin] && massK0s > resoCutVals[K0][kMassMax]) return false; registry.fill(HIST("K0/hK0Count"), kFillMassCut); // Rapidity correction @@ -1734,7 +1731,7 @@ struct FlowGenericFramework { return false; registry.fill(HIST("K0/hK0Count"), kFillDaughterTrackSelection); - registry.fill(HIST("K0/hK0Mass_sparse"), mass_K0s, v0.pt(), centrality); + registry.fill(HIST("K0/hK0Mass_sparse"), massK0s, v0.pt(), centrality); registry.fill(HIST("K0/hK0Phi"), v0.phi()); registry.fill(HIST("K0/hK0Eta"), v0.eta()); registry.fill(HIST("K0/PiPlusTPC_K0"), postrack.pt(), postrack.tpcNSigmaKa()); @@ -1744,9 +1741,9 @@ struct FlowGenericFramework { registry.fill(HIST("K0/hK0s"), 1); if (cfgUsePIDEfficiencies) { - double weff_d1 = getEfficiency(postrack, 1); - double weff_d2 = getEfficiency(negtrack, 1); - weff = weff_d1 * weff_d2; + double weffDaughter1 = getEfficiency(postrack, 1); + double weffDaughter2 = getEfficiency(negtrack, 1); + weff = weffDaughter1 * weffDaughter2; if (weff > 0) registry.fill(HIST("K0/hK0s_corrected"), weff); } @@ -1832,9 +1829,9 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/hLambdas"), 1); if (cfgUsePIDEfficiencies) { - double weff_d1 = getEfficiency(postrack, 3); - double weff_d2 = getEfficiency(negtrack, 1); - weff = weff_d1 * weff_d2; + double weffDaughter1 = getEfficiency(postrack, 3); + double weffDaughter2 = getEfficiency(negtrack, 1); + weff = weffDaughter1 * weffDaughter2; if (weff > 0) registry.fill(HIST("Lambda/hLambdas_corrected"), weff); } @@ -1850,9 +1847,9 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/hLambdas"), 1); if (cfgUsePIDEfficiencies) { - double weff_d1 = getEfficiency(postrack, 1); - double weff_d2 = getEfficiency(negtrack, 3); - weff = weff_d1 * weff_d2; + double weffDaughter1 = getEfficiency(postrack, 1); + double weffDaughter2 = getEfficiency(negtrack, 3); + weff = weffDaughter1 * weffDaughter2; if (weff > 0) registry.fill(HIST("Lambda/hLambdas_corrected"), weff); } @@ -1861,22 +1858,19 @@ struct FlowGenericFramework { } template - inline void fillPtSums(TTrack track, const double& vtxz, const int pidIndex) + inline void fillPtSums(TTrack track, const double& vtxz) { double wacc = (dt == kGen) ? 1. : getAcceptance(track, vtxz, 0); double weff = (dt == kGen) ? 1. : getEfficiency(track); if (weff < 0) return; - if (std::abs(track.eta()) < cfgEtaPtPt) { - fFCpt_ch->fill(weff, track.pt()); - if (pidIndex) - fFCpts[pidIndex]->fill(weff, track.pt()); - } + if (std::abs(track.eta()) < cfgEtaPtPt) + fFCpt->fill(weff, track.pt()); if (!cfgUseGapMethod) { std::complex q2p = {weff * wacc * std::cos(2 * track.phi()), weff * wacc * std::sin(2 * track.phi())}; std::complex q2n = {weff * wacc * std::cos(-2 * track.phi()), weff * wacc * std::sin(-2 * track.phi())}; - fFCpt_ch->fillArray(q2p, q2n, weff * track.pt(), weff); - fFCpt_ch->fillArray(weff * wacc, weff * wacc, weff, weff); + fFCpt->fillArray(q2p, q2n, weff * track.pt(), weff); + fFCpt->fillArray(weff * wacc, weff * wacc, weff, weff); } } @@ -2070,7 +2064,7 @@ struct FlowGenericFramework { registry.fill(HIST("eventQA/after/multiplicity"), tracks.size()); // Get magnetic field polarity - auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) processCollision(collision, tracks, v0s, centrality, field, run); } @@ -2120,7 +2114,7 @@ struct FlowGenericFramework { if (!cfgFillWeights) loadCorrections(bc); - auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processMCReco, "Process analysis for MC reconstructed events", false); @@ -2162,7 +2156,7 @@ struct FlowGenericFramework { if (!cfgFillWeights) loadCorrections(bc); - auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) processCollision(collision, tracks, v0s, centrality, field, run); } PROCESS_SWITCH(FlowGenericFramework, processRun2, "Process analysis for Run 2 converted data", false); From 37738ef593e2b54bb37f5912cdf839bb35cf689e Mon Sep 17 00:00:00 2001 From: AlexianL <123153896+AlexianL@users.noreply.github.com> Date: Sat, 4 Apr 2026 12:08:57 +0200 Subject: [PATCH 170/282] [PWGLF,PWGMM] mftReassociationValidation.cxx : add features, rename some plots (#15640) --- .../Mult/Tasks/mftReassociationValidation.cxx | 499 +++++++++++++++--- 1 file changed, 421 insertions(+), 78 deletions(-) diff --git a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx index f527b61329c..31e8e78df72 100644 --- a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx +++ b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx @@ -17,14 +17,17 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" #include #include #include #include +#include #include #include #include @@ -36,6 +39,7 @@ #include #include #include +#include #include #include @@ -88,6 +92,7 @@ enum DataType { enum SpecificEventSelectionStep { AllEventsPrecise = 0, HasMcCollision, + IsNotSplitVertex, IsSel8, IsNoSameBunchPileup, IsGoodItsLayersAll, @@ -98,9 +103,31 @@ enum SpecificEventSelectionStep { IsNoCollInTimeRangeStrict, IsNoHighMultCollInPrevRof, IsRctFlagChecked, + IsWithinZvtxWindow, NSpecificEventSelectionSteps }; +enum SpecificTrackSelectionStep { + AllTracksPrecise = 0, + IsTrueTrack, + AfterOrphanCut, + AfterEtaCut, + AfterClusterCut, + AfterPtCut, + AfterDcaXYCut, + AfterDcaZCut, + IsCATrack, + IsLTFTrack, + HasMcParticle, + NSpecificTrackSelectionSteps +}; + +enum TrackAmbiguityCheckStep { + AllTracksCheck = 0, + IsAmbDegreeEqualToCompatibleCollIdsSize, + NTrackAmbiguityCheckSteps +}; + enum MonteCarloEventSelectionStep { AllMonteCarloEvents = 0, MonteCarloEventsAfterEventSelection, @@ -179,6 +206,8 @@ enum MftTrackSelectionStep { Eta, Cluster, Pt, + IsCA, + IsLTF, NMftTrackSelectionSteps }; @@ -195,6 +224,7 @@ std::unordered_map recoVtxX; std::unordered_map recoVtxY; std::unordered_map recoVtxZ; std::unordered_map recoMcCollisionId; +std::unordered_map recoMcCollBestCollisionIndex; struct MftReassociationValidation { @@ -209,6 +239,12 @@ struct MftReassociationValidation { struct : ConfigurableGroup { std::string prefix = "ConfigTask_group"; Configurable centralityBinsForMc{"centralityBinsForMc", false, "falsce = OFF, true = ON for data like multiplicity/centrality bins for MC steps"}; + Configurable keepOnlyPhysicalPrimary{"keepOnlyPhysicalPrimary", true, "Keep only physical primary particles"}; + Configurable keepOnlySecondaries{"keepOnlySecondaries", false, "Keep only secondary particles"}; + Configurable cfgApplyZShiftFromCCDB{"cfgApplyZShiftFromCCDB", true, "flag to apply z shift from CCDB"}; + Configurable cfgZShiftPath{"cfgZShiftPath", "Users/m/mcoquet/ZShift", "CCDB path for z shift to apply to forward tracks"}; + Configurable cfgManualZShift{"cfgManualZShift", 0.0f, "manual z-shift for propagation of global muon to PV"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; } configTask; // configurables for collisions @@ -225,9 +261,11 @@ struct MftReassociationValidation { Configurable isApplyNoCollInRofStrict{"isApplyNoCollInRofStrict", false, ""}; Configurable isApplyNoCollInRofStandard{"isApplyNoCollInRofStandard", false, ""}; Configurable isApplyNoHighMultCollInPrevRof{"isApplyNoHighMultCollInPrevRof", false, ""}; + Configurable zVertexMaxInFilter{"zVertexMaxInFilter", 30.0f, "Accepted z-vertex range"}; Configurable zVertexMax{"zVertexMax", 10.0f, "Accepted z-vertex range"}; Configurable requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"}; Configurable requireCorrelationAnalysisRCTFlagChecker{"requireCorrelationAnalysisRCTFlagChecker", false, "Check event quality in run condition table for correlation analysis"}; + Configurable requireMcCollBestCollIndex{"requireMcCollBestCollIndex", false, "check for split vertices"}; Configurable setRCTFlagCheckerLabel{"setRCTFlagCheckerLabel", "CBT_muon_global", "Evt sel: RCT flag checker label"}; Configurable requireRCTFlagCheckerLimitAcceptanceAsBad{"requireRCTFlagCheckerLimitAcceptanceAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; Configurable requireZDCCheck{"requireZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; @@ -237,6 +275,12 @@ struct MftReassociationValidation { struct : ConfigurableGroup { std::string prefix = "ConfigMft_group"; Configurable cutBestCollisionId{"cutBestCollisionId", 0, "cut on the best collision Id used in a filter"}; + Configurable cutFakeTracks{"cutFakeTracks", false, "if true, cut fake tracks using McMask"}; + Configurable cutOrphanTracksExplicitly{"cutOrphanTracksExplicitly", false, "if true, cut orphan tracks explicitly"}; + Configurable cutOnDcaXY{"cutOnDcaXY", false, "if true, cut on DCA XY"}; + Configurable cutOnDcaZ{"cutOnDcaZ", false, "if true, cut on DCA Z"}; + Configurable dcaXYMax{"dcaXYMax", 2.0f, "Maximum value for DCA XY"}; + Configurable dcaZMax{"dcaZMax", 10.0f, "Maximum value for DCA Z"}; Configurable etaMftTrackMax{"etaMftTrackMax", -2.4f, "Maximum value for the eta of MFT tracks when used in cut function"}; Configurable etaMftTrackMin{"etaMftTrackMin", -3.36f, "Minimum value for the eta of MFT tracks when used in cut function"}; Configurable etaMftTrackMaxFilter{"etaMftTrackMaxFilter", -2.0f, "Maximum value for the eta of MFT tracks when used in filter"}; @@ -247,22 +291,34 @@ struct MftReassociationValidation { Configurable ptMftTrackMax{"ptMftTrackMax", 10.0f, "max value of MFT tracks pT when used in cut function"}; Configurable ptMftTrackMin{"ptMftTrackMin", 0.f, "min value of MFT tracks pT when used in cut function"}; Configurable useMftPtCut{"useMftPtCut", false, "if true, use the Mft pt function cut"}; + Configurable useOnlyCATracks{"useOnlyCATracks", false, "if true, use strictly MFT tracks reconstructed with CA algo."}; + Configurable useOnlyLTFTracks{"useOnlyLTFTracks", false, "if true, use strictly MFT tracks reconstructed with LTF algo."}; } configMft; - TF1* fPtDepDCAxy = nullptr; - + float mZShift = 0; // z-vertex shift + float bZ = 0; // Magnetic field for MFT + static constexpr double CcenterMFT[3] = {0, 0, -61.4}; // Field at center of MFT SliceCache cache; Service pdg; Service ccdb; o2::ccdb::CcdbApi ccdbApi; + o2::parameters::GRPMagField* grpmag = nullptr; RCTFlagsChecker rctChecker; - RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad}; + RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}; std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiffAmbiguousTracks; std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiffNonAmbiguousTracks; std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiff2dReassociatedTracks; std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiffNot2dReassociatedTracks; std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiff3dReassociatedTracks; std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiffNot3dReassociatedTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hZVtxDiffNotMatchedTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDcaAmbiguousTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDcaNonAmbiguousTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDca2dReassociatedTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDcaNot2dReassociatedTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDca3dReassociatedTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDcaNot3dReassociatedTracks; + std::array, MatchedToTrueCollisionStep::NMatchedToTrueCollisionSteps> hDcaNotMatchedTracks; // ========================= // using declarations : DATA @@ -289,19 +345,19 @@ struct MftReassociationValidation { // ========================= // Collision filters - Filter collisionVtxZFilter = nabs(aod::collision::posZ) < configCollision.zVertexMax; + Filter collisionVtxZFilter = nabs(aod::collision::posZ) < configCollision.zVertexMaxInFilter; Filter mftTrackEtaFilter = ((aod::fwdtrack::eta < configMft.etaMftTrackMaxFilter) && (aod::fwdtrack::eta > configMft.etaMftTrackMinFilter)); Filter mftTrackCollisionIdFilter = (aod::fwdtrack::bestCollisionId >= 0); - Filter mftTrackDcaXYFilter = (nabs(aod::fwdtrack::bestDCAXY) < configMft.mftMaxDCAxy); + // Filter mftTrackDcaXYFilter = (nabs(aod::fwdtrack::bestDCAXY) < configMft.mftMaxDCAxy); // Filter mftTrackDcaZFilter = (nabs(aod::fwdtrack::bestDCAZ) < configMft.mftMaxDCAz); // ========================= // Filters & partitions : MONTE-CARLO // ========================= - Filter primaries = (aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary && (aod::mcparticle::eta < configMft.etaMftTrackMaxFilter) && (aod::mcparticle::eta > configMft.etaMftTrackMinFilter); + Filter mcParticleEtaFilter = (aod::mcparticle::eta < configMft.etaMftTrackMaxFilter) && (aod::mcparticle::eta > configMft.etaMftTrackMinFilter); Partition mcParticlesSample = (aod::mcparticle::eta < configMft.etaMftTrackMaxFilter) && (aod::mcparticle::eta > configMft.etaMftTrackMinFilter); @@ -347,6 +403,8 @@ struct MftReassociationValidation { labelsMftTracksSelection[MftTrackSelectionStep::Eta] = "MFT tracks after eta selection"; labelsMftTracksSelection[MftTrackSelectionStep::Cluster] = "MFT tracks after clusters selection"; labelsMftTracksSelection[MftTrackSelectionStep::Pt] = "MFT tracks after pT selection"; + labelsMftTracksSelection[MftTrackSelectionStep::IsCA] = "MFT tracks reconstructed with CA"; + labelsMftTracksSelection[MftTrackSelectionStep::IsLTF] = "MFT tracks reconstructed with LTF"; registry.get(HIST(WhatDataType[DataType]) + HIST("hMftTracksSelection"))->SetMinimum(0); for (int iBin = 0; iBin < MftTrackSelectionStep::NMftTrackSelectionSteps; iBin++) { @@ -405,6 +463,38 @@ struct MftReassociationValidation { hZVtxDiffNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hZVtxDiffNot3dReassociatedTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaY, configAxis.axisDcaZ}); hZVtxDiffNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hZVtxDiffNot3dReassociatedTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaY, configAxis.axisDcaZ}); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks] = registry.add("MC/hZVtxDiffNotMatchedTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaY, configAxis.axisDcaZ}); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions] = registry.add("MC/hZVtxDiffNotMatchedTracksWithCollAmongCompatible", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaY, configAxis.axisDcaZ}); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions] = registry.add("MC/hZVtxDiffNotMatchedTracksWithoutCollAmongCompatible", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaY, configAxis.axisDcaZ}); + + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks] = registry.add("MC/hDcaAmbiguousTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hDcaAmbiguousTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hDcaAmbiguousTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks] = registry.add("MC/hDcaNonAmbiguousTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hDcaNonAmbiguousTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hDcaNonAmbiguousTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + + hDca2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks] = registry.add("MC/hDca2dReassociatedTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{XY}^{gen} (cm);", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaX}); + hDca2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hDca2dReassociatedTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{XY}^{gen} (cm);", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaX}); + hDca2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hDca2dReassociatedTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{XY}^{gen} (cm);", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaX}); + + hDcaNot2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks] = registry.add("MC/hDcaNot2dReassociatedTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{XY}^{gen} (cm);", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaX}); + hDcaNot2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hDcaNot2dReassociatedTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{XY}^{gen} (cm);", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaX}); + hDcaNot2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hDcaNot2dReassociatedTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{XY}^{gen} (cm);", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaX}); + + hDca3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks] = registry.add("MC/hDca3dReassociatedTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDca3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hDca3dReassociatedTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDca3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hDca3dReassociatedTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + + hDcaNot3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks] = registry.add("MC/hDcaNot3dReassociatedTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision] = registry.add("MC/hDcaNot3dReassociatedTracksNotMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision] = registry.add("MC/hDcaNot3dReassociatedTracksMatchedToTrueCollision", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks] = registry.add("MC/hDcaNotMatchedTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions] = registry.add("MC/hDcaNotMatchedTracksWithCollAmongCompatible", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions] = registry.add("MC/hDcaNotMatchedTracksWithoutCollAmongCompatible", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY}^{reco} (cm); DCA_{Z}^{reco} (cm); DCA_{XY}^{gen} (cm); DCA_{Z}^{gen} (cm)", HistType::kTHnSparseF, {configAxis.axisPt, configAxis.axisEta, configAxis.axisDcaX, configAxis.axisDcaZ, configAxis.axisDcaX, configAxis.axisDcaZ}); + registry.add("MC/hIsAmbiguousTrackMatchedToTrueCollision", "hIsAmbiguousTrackMatchedToTrueCollision", {HistType::kTH1D, {{MftAmbiguousAndMatchedToTrueCollisionStep::NMftAmbiguousAndMatchedToTrueCollisionSteps, -0.5, +MftAmbiguousAndMatchedToTrueCollisionStep::NMftAmbiguousAndMatchedToTrueCollisionSteps - 0.5}}}); std::string labelsMftAmbiguousAndMatchedToTrueCollisionStep[MftAmbiguousAndMatchedToTrueCollisionStep::NMftAmbiguousAndMatchedToTrueCollisionSteps]; labelsMftAmbiguousAndMatchedToTrueCollisionStep[MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguous] = "number of MFT ambiguous tracks"; @@ -427,52 +517,51 @@ struct MftReassociationValidation { registry.get(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNonAmbiguousAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/Is2dReassociatedAndMatchedToTrueCollision", "Is2dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/hIs2dReassociatedAndMatchedToTrueCollision", "Is2dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); std::string labelsMft2dReassociatedAndMatchedToTrueCollisionStep[Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps]; labelsMft2dReassociatedAndMatchedToTrueCollisionStep[Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociated] = "number of MFT 2d reassociated tracks"; labelsMft2dReassociatedAndMatchedToTrueCollisionStep[Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndMatchedToTrueCollision] = "number of MFT 2d reassociated tracks matched to true collision"; labelsMft2dReassociatedAndMatchedToTrueCollisionStep[Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndNotMatchedToTrueCollision] = "number of MFT 2d reassociated tracks NOT matched to true collision"; - registry.get(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/hIs2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < Mft2dReassociatedAndMatchedToTrueCollisionStep::NMft2dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/hIs2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/IsNot2dReassociatedAndMatchedToTrueCollision", "IsNot2dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/hIsNot2dReassociatedAndMatchedToTrueCollision", "IsNot2dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); std::string labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps]; labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociated] = "number of MFT NOT 2d reassociated tracks"; labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndMatchedToTrueCollision] = "number of MFT NOT 2d reassociated tracks matched to true collision"; labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndNotMatchedToTrueCollision] = "number of MFT NOT 2d reassociated tracks NOT matched to true collision"; - registry.get(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/hIsNot2dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < MftNot2dReassociatedAndMatchedToTrueCollisionStep::NMftNot2dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/hIsNot2dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot2dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/Is3dReassociatedAndMatchedToTrueCollision", "Is3dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/hIs3dReassociatedAndMatchedToTrueCollision", "Is3dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); std::string labelsMft3dReassociatedAndMatchedToTrueCollisionStep[Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps]; labelsMft3dReassociatedAndMatchedToTrueCollisionStep[Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociated] = "number of MFT 3d reassociated tracks"; labelsMft3dReassociatedAndMatchedToTrueCollisionStep[Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndMatchedToTrueCollision] = "number of MFT 3d reassociated tracks matched to true collision"; labelsMft3dReassociatedAndMatchedToTrueCollisionStep[Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndNotMatchedToTrueCollision] = "number of MFT 3d reassociated tracks NOT matched to true collision"; - registry.get(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/hIs3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < Mft3dReassociatedAndMatchedToTrueCollisionStep::NMft3dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/hIs3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMft3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } - registry.add("MC/IsNot3dReassociatedAndMatchedToTrueCollision", "IsNot3dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); + registry.add("MC/hIsNot3dReassociatedAndMatchedToTrueCollision", "IsNot3dReassociatedAndMatchedToTrueCollision", {HistType::kTH1D, {{MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps, -0.5, +MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps - 0.5}}}); std::string labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps]; labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociated] = "number of MFT NOT 3d reassociated tracks"; labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndMatchedToTrueCollision] = "number of MFT NOT 3d reassociated tracks matched to true collision"; labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndNotMatchedToTrueCollision] = "number of MFT NOT 3d reassociated tracks NOT matched to true collision"; - registry.get(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); + registry.get(HIST("MC/hIsNot3dReassociatedAndMatchedToTrueCollision"))->SetMinimum(0); for (int iBin = 0; iBin < MftNot3dReassociatedAndMatchedToTrueCollisionStep::NMftNot3dReassociatedAndMatchedToTrueCollisionSteps; iBin++) { - registry.get(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); + registry.get(HIST("MC/hIsNot3dReassociatedAndMatchedToTrueCollision"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftNot3dReassociatedAndMatchedToTrueCollisionStep[iBin].data()); } registry.add("MC/hIsTrueCollisionAmongCompatibleCollisions", "IsTrueCollisionAmongCompatibleCollisions", {HistType::kTH1D, {{MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps, -0.5, +MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps - 0.5}}}); - registry.add("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi", "hIsTrueCollisionAmongCompatibleCollisionsNonAmbi", {HistType::kTH1D, {{MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps, -0.5, +MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps - 0.5}}}); registry.add("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated", "hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated", {HistType::kTH1D, {{MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps, -0.5, +MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps - 0.5}}}); registry.add("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated", "hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated", {HistType::kTH1D, {{MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps, -0.5, +MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps - 0.5}}}); std::string labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps]; @@ -480,13 +569,11 @@ struct MftReassociationValidation { labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions] = "number of MFT tracks with True Coll. among Compatible"; labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions] = "number of MFT tracks WITHOUT True Coll. among Compatible"; registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"))->SetMinimum(0); - registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"))->SetMinimum(0); registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"))->SetMinimum(0); registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"))->SetMinimum(0); for (int iBin = 0; iBin < MftIsTrueCollisionAmongCompatibleCollisionsStep::NMftIsTrueCollisionAmongCompatibleCollisionsSteps; iBin++) { registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[iBin].data()); - registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[iBin].data()); registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[iBin].data()); registry.get(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"))->GetXaxis()->SetBinLabel(iBin + 1, labelsMftIsTrueCollisionAmongCompatibleCollisionsStep[iBin].data()); } @@ -502,8 +589,8 @@ struct MftReassociationValidation { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); - rctChecker.init(configCollision.setRCTFlagCheckerLabel, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad); - correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad); + rctChecker.init(configCollision.setRCTFlagCheckerLabel, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad, true); + correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad, true); // ========================= // Event histograms @@ -517,6 +604,7 @@ struct MftReassociationValidation { std::string labels[SpecificEventSelectionStep::NSpecificEventSelectionSteps]; labels[SpecificEventSelectionStep::AllEventsPrecise] = "all"; labels[SpecificEventSelectionStep::HasMcCollision] = "has MC coll?"; + labels[SpecificEventSelectionStep::IsNotSplitVertex] = "Is not split vertex (BestCollisionIndex)"; labels[SpecificEventSelectionStep::IsSel8] = "sel8"; labels[SpecificEventSelectionStep::IsNoSameBunchPileup] = "IsNoSameBunchPileup"; labels[SpecificEventSelectionStep::IsGoodItsLayersAll] = "IsGoodItsLayersAll"; @@ -527,12 +615,42 @@ struct MftReassociationValidation { labels[SpecificEventSelectionStep::IsNoCollInTimeRangeStrict] = "IsNoCollInTimeRangeStrict"; labels[SpecificEventSelectionStep::IsNoHighMultCollInPrevRof] = "IsNoHighMultCollInPrevRof"; labels[SpecificEventSelectionStep::IsRctFlagChecked] = "IsRctFlagChecked"; + labels[SpecificEventSelectionStep::IsWithinZvtxWindow] = "IsWithinZvtxWindow"; registry.get(HIST("hPreciseEventCounter"))->SetMinimum(0); for (int iBin = 0; iBin < SpecificEventSelectionStep::NSpecificEventSelectionSteps; iBin++) { registry.get(HIST("hPreciseEventCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } + registry.add("MC/hPreciseTrackSelectionCounter", "hPreciseTrackSelectionCounter", {HistType::kTH1D, {{SpecificTrackSelectionStep::NSpecificTrackSelectionSteps, -0.5, +SpecificTrackSelectionStep::NSpecificTrackSelectionSteps - 0.5}}}); + std::string labelsTrackSelection[SpecificTrackSelectionStep::NSpecificTrackSelectionSteps]; + labelsTrackSelection[SpecificTrackSelectionStep::AllTracksPrecise] = "all tracks"; + labelsTrackSelection[SpecificTrackSelectionStep::IsTrueTrack] = "true tracks"; + labelsTrackSelection[SpecificTrackSelectionStep::AfterOrphanCut] = "after orphan cut"; + labelsTrackSelection[SpecificTrackSelectionStep::AfterEtaCut] = "after eta cut"; + labelsTrackSelection[SpecificTrackSelectionStep::AfterClusterCut] = "after cluster cut"; + labelsTrackSelection[SpecificTrackSelectionStep::AfterPtCut] = "after pt cut"; + labelsTrackSelection[SpecificTrackSelectionStep::AfterDcaXYCut] = "after DCA XY cut"; + labelsTrackSelection[SpecificTrackSelectionStep::AfterDcaZCut] = "after DCA Z cut"; + labelsTrackSelection[SpecificTrackSelectionStep::IsCATrack] = "is CA track"; + labelsTrackSelection[SpecificTrackSelectionStep::IsLTFTrack] = "is LTF track"; + labelsTrackSelection[SpecificTrackSelectionStep::HasMcParticle] = "has MC particle"; + registry.get(HIST("MC/hPreciseTrackSelectionCounter"))->SetMinimum(0); + + for (int iBin = 0; iBin < SpecificTrackSelectionStep::NSpecificTrackSelectionSteps; iBin++) { + registry.get(HIST("MC/hPreciseTrackSelectionCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labelsTrackSelection[iBin].data()); + } + + registry.add("MC/hTrackAmbiguityCheck", "hTrackAmbiguityCheck", {HistType::kTH1D, {{TrackAmbiguityCheckStep::NTrackAmbiguityCheckSteps, -0.5, +TrackAmbiguityCheckStep::NTrackAmbiguityCheckSteps - 0.5}}}); + std::string labelsTrackAmbiguityCheck[TrackAmbiguityCheckStep::NTrackAmbiguityCheckSteps]; + labelsTrackAmbiguityCheck[TrackAmbiguityCheckStep::AllTracksCheck] = "all tracks"; + labelsTrackAmbiguityCheck[TrackAmbiguityCheckStep::IsAmbDegreeEqualToCompatibleCollIdsSize] = "ambDegree == compatibleCollIds.size"; + registry.get(HIST("MC/hTrackAmbiguityCheck"))->SetMinimum(0); + + for (int iBin = 0; iBin < TrackAmbiguityCheckStep::NTrackAmbiguityCheckSteps; iBin++) { + registry.get(HIST("MC/hTrackAmbiguityCheck"))->GetXaxis()->SetBinLabel(iBin + 1, labelsTrackAmbiguityCheck[iBin].data()); + } + registry.add("MC/hMonteCarloEventCounter", "hMonteCarloEventCounter", {HistType::kTH1D, {{MonteCarloEventSelectionStep::NMonteCarloEventSelectionSteps, -0.5, +MonteCarloEventSelectionStep::NMonteCarloEventSelectionSteps - 0.5}}}); std::string labelsMonteCarloEvents[MonteCarloEventSelectionStep::NMonteCarloEventSelectionSteps]; labelsMonteCarloEvents[MonteCarloEventSelectionStep::AllMonteCarloEvents] = "all collisions"; @@ -658,6 +776,35 @@ struct MftReassociationValidation { return recoOfTrueInCompatible; } + template + void loadZVertexShiftCorrection(TBc const& bc) + { + + grpmag = ccdb->getForTimeStamp(configTask.grpmagPath, bc.timestamp()); + LOG(info) << "Setting magnetic field to current " << grpmag->getL3Current() + << " A for run " << bc.runNumber() + << " from its GRPMagField CCDB object"; + o2::base::Propagator::initFieldFromGRP(grpmag); + + o2::field::MagneticField* field = static_cast(TGeoGlobalMagField::Instance()->GetField()); + bZ = field->getBz(CcenterMFT); + LOG(info) << "The field at the center of the MFT is bZ = " << bZ; + + if (configTask.cfgApplyZShiftFromCCDB) { + auto* zShift = ccdb->getForTimeStamp>(configTask.cfgZShiftPath, bc.timestamp()); + if (zShift != nullptr && !zShift->empty()) { + LOGF(info, "reading z shift %f from %s", (*zShift)[0], configTask.cfgZShiftPath.value); + mZShift = (*zShift)[0]; + } else { + LOGF(info, "z shift is not found in ccdb path %s. set to 0 cm", configTask.cfgZShiftPath.value); + mZShift = 0; + } + } else { + LOGF(info, "z shift is manually set to %f cm", configTask.cfgManualZShift.value); + mZShift = configTask.cfgManualZShift; + } + } + // ========================= // Cuts with functions // ========================= @@ -730,6 +877,12 @@ struct MftReassociationValidation { if (fillHistograms) { registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::IsRctFlagChecked); } + if (collision.posZ() > configCollision.zVertexMax || collision.posZ() < (-configCollision.zVertexMax)) { + return false; + } + if (fillHistograms) { + registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::IsWithinZvtxWindow); + } registry.fill(HIST("Data/hVtxZ"), collision.posZ()); @@ -740,7 +893,7 @@ struct MftReassociationValidation { // I tried to put it as a filter, but filters for normal TPC tracks also apply to MFT tracks I think // and it seems that they are not compatible template - bool isAcceptedMftTrack(TTrack const& mftTrack, bool fillHistograms) + bool isAcceptedMftTrack(TTrack const& mftTrack, bool fillHistograms, bool isData, float dcaXY, float dcaZ) { // cut on the eta of MFT tracks if (mftTrack.eta() > configMft.etaMftTrackMax || mftTrack.eta() < configMft.etaMftTrackMin) { @@ -748,7 +901,11 @@ struct MftReassociationValidation { } if (fillHistograms) { - registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Eta); + if (isData) { + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Eta); + } else { + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterEtaCut); + } } // cut on the number of clusters of the reconstructed MFT track @@ -757,7 +914,11 @@ struct MftReassociationValidation { } if (fillHistograms) { - registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Cluster); + if (isData) { + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Cluster); + } else { + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterClusterCut); + } } // cut on the pT of MFT tracks (for test purposes) @@ -766,7 +927,48 @@ struct MftReassociationValidation { } if (fillHistograms) { - registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Pt); + if (isData) { + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::Pt); + } else { + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterPtCut); + } + } + + if (configMft.cutOnDcaXY && std::abs(dcaXY) > configMft.dcaXYMax) { + return false; + } + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterDcaXYCut); + if (configMft.cutOnDcaZ && std::abs(dcaZ) > configMft.dcaZMax) { + return false; + } + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterDcaZCut); + + // cut on the track algorithm of MFT tracks + if (mftTrack.isCA()) { + if (fillHistograms) { + if (isData) { + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::IsCA); + } else { + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::IsCATrack); + } + } + + if (configMft.useOnlyLTFTracks) { + return false; + } + + } else { + if (fillHistograms) { + if (isData) { + registry.fill(HIST("Data/hMftTracksSelection"), MftTrackSelectionStep::IsLTF); + } else { + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::IsLTFTrack); + } + } + + if (configMft.useOnlyCATracks) { + return false; + } } return true; @@ -811,6 +1013,8 @@ struct MftReassociationValidation { soa::SmallGroups const& reassociated2dMftTracks, aod::BCsWithTimestamps const&) { + auto bc = collision.template bc_as(); + loadZVertexShiftCorrection(bc); if (!(isAcceptedCollision(collision, true))) { return; @@ -823,7 +1027,13 @@ struct MftReassociationValidation { registry.fill(HIST("Data/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::AllMftTracks); auto templatedMftTrack = reassociated2dMftTrack.template mfttrack_as(); - if (!isAcceptedMftTrack(templatedMftTrack, false)) { + o2::track::TrackParCovFwd trackPar = o2::aod::fwdtrackutils::getTrackParCovFwdShift(templatedMftTrack, mZShift); + std::array dcaInfOrig; + trackPar.propagateToDCAhelix(bZ, {collision.posX(), collision.posY(), collision.posZ()}, dcaInfOrig); + auto dcaXYoriginal = 999.f; + dcaXYoriginal = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + + if (!isAcceptedMftTrack(templatedMftTrack, false, true, dcaXYoriginal, dcaInfOrig[2])) { continue; } @@ -839,17 +1049,19 @@ struct MftReassociationValidation { } PROCESS_SWITCH(MftReassociationValidation, processData, "Process MFT reassociation validation for DATA", false); - void processCreateLookupTable(FilteredCollisionsWSelMultMcLabels const& collisions) + void processCreateLookupTable(FilteredCollisionsWSelMultMcLabels const& collisions, soa::Join const& mcCollisions) { recoVtxX.clear(); recoVtxY.clear(); recoVtxZ.clear(); recoMcCollisionId.clear(); + recoMcCollBestCollisionIndex.clear(); recoVtxX.reserve(collisions.size()); recoVtxY.reserve(collisions.size()); recoVtxZ.reserve(collisions.size()); recoMcCollisionId.reserve(collisions.size()); + recoMcCollBestCollisionIndex.reserve(mcCollisions.size()); for (auto const& col : collisions) { recoVtxX.emplace(col.globalIndex(), col.posX()); @@ -857,6 +1069,10 @@ struct MftReassociationValidation { recoVtxZ.emplace(col.globalIndex(), col.posZ()); recoMcCollisionId.emplace(col.globalIndex(), col.mcCollisionId()); } + + for (auto const& mcCol : mcCollisions) { + recoMcCollBestCollisionIndex.emplace(mcCol.globalIndex(), mcCol.bestCollisionIndex()); + } } PROCESS_SWITCH(MftReassociationValidation, processCreateLookupTable, "Process look uptable creation", false); @@ -864,8 +1080,12 @@ struct MftReassociationValidation { FilteredMftTracksWCollsMcLabels const& /*mftTracks*/, soa::SmallGroups> const& reassociated2dMftTracks, aod::McCollisions const& /*mcCollisions*/, - aod::McParticles const& /*particles*/) + aod::McParticles const& /*particles*/, + aod::BCsWithTimestamps const& /*bcs*/) { + auto bc = collision.template bc_as(); + loadZVertexShiftCorrection(bc); + registry.fill(HIST("MC/hMonteCarloEventCounter"), MonteCarloEventSelectionStep::AllMonteCarloEvents); registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::AllEventsPrecise); @@ -877,6 +1097,19 @@ struct MftReassociationValidation { registry.fill(HIST("MC/hMonteCarloEventCounter"), MonteCarloEventSelectionStep::HasMonteCarloCollision); registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::HasMcCollision); + const int mcCollisionId = collision.mcCollisionId(); + auto iteratorMcCollisionBestCollIndex = recoMcCollBestCollisionIndex.find(mcCollisionId); + if (iteratorMcCollisionBestCollIndex == recoMcCollBestCollisionIndex.end()) { + return; + } + const float mcCollisionBestCollIndex = iteratorMcCollisionBestCollIndex->second; + + if (configCollision.requireMcCollBestCollIndex && (collision.globalIndex() != mcCollisionBestCollIndex)) { + return; + } + + registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::IsNotSplitVertex); + if (!isAcceptedCollision(collision, true)) { return; } @@ -885,20 +1118,51 @@ struct MftReassociationValidation { for (auto const& reassociated2dMftTrack : reassociated2dMftTracks) { + if (reassociated2dMftTrack.has_mcParticle()) { + if (configTask.keepOnlyPhysicalPrimary && !reassociated2dMftTrack.mcParticle().isPhysicalPrimary()) { + continue; + } + if (configTask.keepOnlySecondaries && reassociated2dMftTrack.mcParticle().isPhysicalPrimary()) { + continue; + } + } + registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::AllMftTracks); registry.fill(HIST("MC/hMonteCarloTrackCounter"), MonteCarloTrackSelectionStep::AllMonteCarloTracks); + registry.fill(HIST("MC/hTrackAmbiguityCheck"), TrackAmbiguityCheckStep::AllTracksCheck); + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AllTracksPrecise); auto templatedTrack = reassociated2dMftTrack.template mfttrack_as(); - if (!isAcceptedMftTrack(templatedTrack, false)) { + o2::track::TrackParCovFwd trackPar = o2::aod::fwdtrackutils::getTrackParCovFwdShift(templatedTrack, mZShift); + std::array dcaInfOrig; + trackPar.propagateToDCAhelix(bZ, {collision.posX(), collision.posY(), collision.posZ()}, dcaInfOrig); + auto dcaXYoriginal = 999.f; + dcaXYoriginal = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + + if (configMft.cutFakeTracks && templatedTrack.mcMask() != 0) { + continue; + } + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::IsTrueTrack); + if (configMft.cutOrphanTracksExplicitly && reassociated2dMftTrack.ambDegree() == 0) { + continue; + } + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterOrphanCut); + + if (!isAcceptedMftTrack(templatedTrack, true, false, dcaXYoriginal, dcaInfOrig[2])) { continue; } + if (reassociated2dMftTrack.ambDegree() == static_cast(reassociated2dMftTrack.compatibleCollIds().size())) { + registry.fill(HIST("MC/hTrackAmbiguityCheck"), TrackAmbiguityCheckStep::IsAmbDegreeEqualToCompatibleCollIdsSize); + } + registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::AfterTrackSelection); registry.fill(HIST("MC/hMonteCarloTrackCounter"), MonteCarloTrackSelectionStep::MonteCarloTracksAfterTrackSelection); if (templatedTrack.has_mcParticle()) { registry.fill(HIST("MC/hMonteCarloTrackCounter"), MonteCarloTrackSelectionStep::HasMonteCarloParticle); + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::HasMcParticle); auto particle = templatedTrack.template mcParticle_as(); float deltaX = -999.f; @@ -962,66 +1226,92 @@ struct MftReassociationValidation { reassociatedDeltaY = yPosBestColl - yPosTrue; reassociatedDeltaZ = zPosBestColl - zPosTrue; + const auto dcaXtruth(particle.vx() - particle.mcCollision().posX()); + const auto dcaYtruth(particle.vy() - particle.mcCollision().posY()); + const auto dcaZtruth(particle.vz() - particle.mcCollision().posZ()); + auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + dcaYtruth * dcaYtruth); + if (reassociated2dMftTrack.ambDegree() > 1) { // AMBIGUOUS TRACKS registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::NumberOfAmbiguousTracks); registry.fill(HIST("MC/hIsAmbiguousTrackMatchedToTrueCollision"), MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguous); registry.fill(HIST("MC/hReassociation2dMftTracks"), Reassociation2dMftTracks::AllAmbiguousTracksAfterTrackSelectionsFor2d); hZVtxDiffAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); if (collision.mcCollisionId() == particle.mcCollisionId()) { registry.fill(HIST("MC/hIsAmbiguousTrackMatchedToTrueCollision"), MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguousAndMatchedToTrueCollision); hZVtxDiffAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } else { registry.fill(HIST("MC/hIsAmbiguousTrackMatchedToTrueCollision"), MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguousAndNotMatchedToTrueCollision); hZVtxDiffAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } if (templatedTrack.collisionId() == reassociated2dMftTrack.bestCollisionId()) { // IS NOT 2D REASSOCIATED registry.fill(HIST("MC/hReassociation2dMftTracks"), Reassociation2dMftTracks::NotReassociated2dMftTracks); - registry.fill(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociated); + registry.fill(HIST("MC/hIsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociated); hZVtxDiffNot2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNot2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), dcaXYtruth); if (mcCollisionIdReco == particle.mcCollisionId()) { - registry.fill(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndMatchedToTrueCollision); + registry.fill(HIST("MC/hIsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndMatchedToTrueCollision); hZVtxDiffNot2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNot2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), dcaXYtruth); } else { - registry.fill(HIST("MC/IsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndNotMatchedToTrueCollision); + registry.fill(HIST("MC/hIsNot2dReassociatedAndMatchedToTrueCollision"), MftNot2dReassociatedAndMatchedToTrueCollisionStep::IsNot2dReassociatedAndNotMatchedToTrueCollision); hZVtxDiffNot2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNot2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), dcaXYtruth); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), 0, dcaXYtruth, 0); if (isTrueCollisionAmongCompatibleCollisions(reassociated2dMftTrack)) { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), 0, dcaXYtruth, 0); } else { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), 0, dcaXYtruth, 0); } } } else { // IS 2D REASSOCIATED registry.fill(HIST("MC/hReassociation2dMftTracks"), Reassociation2dMftTracks::Reassociated2dMftTracks); - registry.fill(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociated); - hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + registry.fill(HIST("MC/hIs2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociated); + hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDca2dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), dcaXYtruth); // is collision.mcCollisionId() the reassociated collision vertex ? or the initial collision if (mcCollisionIdReco == particle.mcCollisionId()) { - registry.fill(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndMatchedToTrueCollision); - hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + registry.fill(HIST("MC/hIs2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndMatchedToTrueCollision); + hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDca2dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), dcaXYtruth); } else { - registry.fill(HIST("MC/Is2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndNotMatchedToTrueCollision); - hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + registry.fill(HIST("MC/hIs2dReassociatedAndMatchedToTrueCollision"), Mft2dReassociatedAndMatchedToTrueCollisionStep::Is2dReassociatedAndNotMatchedToTrueCollision); + hZVtxDiff2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDca2dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), dcaXYtruth); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), 0, dcaXYtruth, 0); if (isTrueCollisionAmongCompatibleCollisions(reassociated2dMftTrack)) { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), 0, dcaXYtruth, 0); } else { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated2dMftTrack.bestDCAXY(), 0, dcaXYtruth, 0); } } } @@ -1031,23 +1321,16 @@ struct MftReassociationValidation { registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::NumberOfNonAmbiguousTracks); registry.fill(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"), MftNonAmbiguousAndMatchedToTrueCollisionStep::IsNonAmbiguous); hZVtxDiffNonAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); if (collision.mcCollisionId() == particle.mcCollisionId()) { registry.fill(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"), MftNonAmbiguousAndMatchedToTrueCollisionStep::IsNonAmbiguousAndMatchedToTrueCollision); hZVtxDiffNonAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } else { registry.fill(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"), MftNonAmbiguousAndMatchedToTrueCollisionStep::IsNonAmbiguousAndNotMatchedToTrueCollision); hZVtxDiffNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); - - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); - if (isTrueCollisionAmongCompatibleCollisions(reassociated2dMftTrack)) { - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); - } else { - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); - } + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } } // end of if non ambi @@ -1062,8 +1345,12 @@ struct MftReassociationValidation { FilteredMftTracksWCollsMcLabels const& /*mftTracks*/, soa::SmallGroups> const& reassociated3dMftTracks, aod::McCollisions const& /*mcCollisions*/, - aod::McParticles const& /*particles*/) + aod::McParticles const& /*particles*/, + aod::BCsWithTimestamps const& /*bcs*/) { + auto bc = collision.template bc_as(); + loadZVertexShiftCorrection(bc); + registry.fill(HIST("MC/hMonteCarloEventCounter"), MonteCarloEventSelectionStep::AllMonteCarloEvents); registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::AllEventsPrecise); @@ -1075,6 +1362,19 @@ struct MftReassociationValidation { registry.fill(HIST("MC/hMonteCarloEventCounter"), MonteCarloEventSelectionStep::HasMonteCarloCollision); registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::HasMcCollision); + const int mcCollisionId = collision.mcCollisionId(); + auto iteratorMcCollisionBestCollIndex = recoMcCollBestCollisionIndex.find(mcCollisionId); + if (iteratorMcCollisionBestCollIndex == recoMcCollBestCollisionIndex.end()) { + return; + } + const float mcCollisionBestCollIndex = iteratorMcCollisionBestCollIndex->second; + + if (configCollision.requireMcCollBestCollIndex && (collision.globalIndex() != mcCollisionBestCollIndex)) { + return; + } + + registry.fill(HIST("hPreciseEventCounter"), SpecificEventSelectionStep::IsNotSplitVertex); + if (!isAcceptedCollision(collision, true)) { return; } @@ -1083,20 +1383,51 @@ struct MftReassociationValidation { for (auto const& reassociated3dMftTrack : reassociated3dMftTracks) { + if (reassociated3dMftTrack.has_mcParticle()) { + if (configTask.keepOnlyPhysicalPrimary && !reassociated3dMftTrack.mcParticle().isPhysicalPrimary()) { + continue; + } + if (configTask.keepOnlySecondaries && reassociated3dMftTrack.mcParticle().isPhysicalPrimary()) { + continue; + } + } + registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::AllMftTracks); registry.fill(HIST("MC/hMonteCarloTrackCounter"), MonteCarloTrackSelectionStep::AllMonteCarloTracks); + registry.fill(HIST("MC/hTrackAmbiguityCheck"), TrackAmbiguityCheckStep::AllTracksCheck); + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AllTracksPrecise); auto templatedTrack = reassociated3dMftTrack.template mfttrack_as(); - if (!isAcceptedMftTrack(templatedTrack, false)) { + o2::track::TrackParCovFwd trackPar = o2::aod::fwdtrackutils::getTrackParCovFwdShift(templatedTrack, mZShift); + std::array dcaInfOrig; + trackPar.propagateToDCAhelix(bZ, {collision.posX(), collision.posY(), collision.posZ()}, dcaInfOrig); + auto dcaXYoriginal = 999.f; + dcaXYoriginal = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + + if (configMft.cutFakeTracks && templatedTrack.mcMask() != 0) { + continue; + } + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::IsTrueTrack); + if (configMft.cutOrphanTracksExplicitly && reassociated3dMftTrack.ambDegree() == 0) { continue; } + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::AfterOrphanCut); + + if (!isAcceptedMftTrack(templatedTrack, true, false, dcaXYoriginal, dcaInfOrig[2])) { + continue; + } + + if (reassociated3dMftTrack.ambDegree() == static_cast(reassociated3dMftTrack.compatibleCollIds().size())) { + registry.fill(HIST("MC/hTrackAmbiguityCheck"), TrackAmbiguityCheckStep::IsAmbDegreeEqualToCompatibleCollIdsSize); + } registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::AfterTrackSelection); registry.fill(HIST("MC/hMonteCarloTrackCounter"), MonteCarloTrackSelectionStep::MonteCarloTracksAfterTrackSelection); if (templatedTrack.has_mcParticle()) { registry.fill(HIST("MC/hMonteCarloTrackCounter"), MonteCarloTrackSelectionStep::HasMonteCarloParticle); + registry.fill(HIST("MC/hPreciseTrackSelectionCounter"), SpecificTrackSelectionStep::HasMcParticle); auto particle = templatedTrack.template mcParticle_as(); float deltaX = -999.f; @@ -1106,18 +1437,12 @@ struct MftReassociationValidation { float reassociatedDeltaY = -999.f; float reassociatedDeltaZ = -999.f; auto collision = templatedTrack.collision_as(); - // auto mcCollision = particle.mcCollision_as(); - // deltaZ = collision.posZ() - mcCollision.posZ(); auto xPosTrue = reassociated3dMftTrack.mcParticle().mcCollision().posX(); auto yPosTrue = reassociated3dMftTrack.mcParticle().mcCollision().posY(); auto zPosTrue = reassociated3dMftTrack.mcParticle().mcCollision().posZ(); const int bestRecoColl = reassociated3dMftTrack.bestCollisionId(); const int originalRecoColl = templatedTrack.collisionId(); - // if (bestRecoColl < 0) { - // // no associated reco collision -> skip or count separately - // continue; - // } auto iteratorOriginalCollVtxX = recoVtxX.find(originalRecoColl); auto iteratorOriginalCollVtxY = recoVtxY.find(originalRecoColl); @@ -1166,66 +1491,91 @@ struct MftReassociationValidation { reassociatedDeltaY = yPosBestColl - yPosTrue; reassociatedDeltaZ = zPosBestColl - zPosTrue; + const auto dcaXtruth(particle.vx() - particle.mcCollision().posX()); + const auto dcaYtruth(particle.vy() - particle.mcCollision().posY()); + const auto dcaZtruth(particle.vz() - particle.mcCollision().posZ()); + auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + dcaYtruth * dcaYtruth); + if (reassociated3dMftTrack.ambDegree() > 1) { // AMBIGUOUS TRACKS registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::NumberOfAmbiguousTracks); registry.fill(HIST("MC/hIsAmbiguousTrackMatchedToTrueCollision"), MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguous); registry.fill(HIST("MC/hReassociation3dMftTracks"), Reassociation3dMftTracks::AllAmbiguousTracksAfterTrackSelectionsFor3d); hZVtxDiffAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); if (collision.mcCollisionId() == particle.mcCollisionId()) { registry.fill(HIST("MC/hIsAmbiguousTrackMatchedToTrueCollision"), MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguousAndMatchedToTrueCollision); hZVtxDiffAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } else { registry.fill(HIST("MC/hIsAmbiguousTrackMatchedToTrueCollision"), MftAmbiguousAndMatchedToTrueCollisionStep::IsAmbiguousAndNotMatchedToTrueCollision); hZVtxDiffAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } if (templatedTrack.collisionId() == reassociated3dMftTrack.bestCollisionId()) { // IS NOT 3D REASSOCIATED registry.fill(HIST("MC/hReassociation3dMftTracks"), Reassociation3dMftTracks::NotReassociated3dMftTracks); - registry.fill(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociated); + registry.fill(HIST("MC/hIsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociated); hZVtxDiffNot3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNot3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); if (mcCollisionIdReco == particle.mcCollisionId()) { - registry.fill(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndMatchedToTrueCollision); + registry.fill(HIST("MC/hIsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndMatchedToTrueCollision); hZVtxDiffNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); } else { - registry.fill(HIST("MC/IsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndNotMatchedToTrueCollision); + registry.fill(HIST("MC/hIsNot3dReassociatedAndMatchedToTrueCollision"), MftNot3dReassociatedAndMatchedToTrueCollisionStep::IsNot3dReassociatedAndNotMatchedToTrueCollision); hZVtxDiffNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNot3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); if (isTrueCollisionAmongCompatibleCollisions(reassociated3dMftTrack)) { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); } else { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaNotReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); } } } else { // IS 3D REASSOCIATED registry.fill(HIST("MC/hReassociation3dMftTracks"), Reassociation3dMftTracks::Reassociated3dMftTracks); - registry.fill(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociated); - hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + registry.fill(HIST("MC/hIs3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociated); + hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDca3dReassociatedTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - // is collision.mcCollisionId() the reassociated collision vertex ? or the initial collision if (mcCollisionIdReco == particle.mcCollisionId()) { - registry.fill(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndMatchedToTrueCollision); - hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + registry.fill(HIST("MC/hIs3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndMatchedToTrueCollision); + hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDca3dReassociatedTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); } else { - registry.fill(HIST("MC/Is3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndNotMatchedToTrueCollision); - hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + registry.fill(HIST("MC/hIs3dReassociatedAndMatchedToTrueCollision"), Mft3dReassociatedAndMatchedToTrueCollisionStep::Is3dReassociatedAndNotMatchedToTrueCollision); + hZVtxDiff3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDca3dReassociatedTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); if (isTrueCollisionAmongCompatibleCollisions(reassociated3dMftTrack)) { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); } else { registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsDcaReassociated"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); + hZVtxDiffNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociatedDeltaX, reassociatedDeltaY, reassociatedDeltaZ); + hDcaNotMatchedTracks[MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions]->Fill(templatedTrack.pt(), templatedTrack.eta(), reassociated3dMftTrack.bestDCAXY(), reassociated3dMftTrack.bestDCAZ(), dcaXYtruth, dcaZtruth); } } } @@ -1235,23 +1585,16 @@ struct MftReassociationValidation { registry.fill(HIST("MC/hAmbiguityOfMftTracks"), MftTrackAmbiguityStep::NumberOfNonAmbiguousTracks); registry.fill(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"), MftNonAmbiguousAndMatchedToTrueCollisionStep::IsNonAmbiguous); hZVtxDiffNonAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::AllTracks]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); if (collision.mcCollisionId() == particle.mcCollisionId()) { registry.fill(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"), MftNonAmbiguousAndMatchedToTrueCollisionStep::IsNonAmbiguousAndMatchedToTrueCollision); hZVtxDiffNonAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } else { registry.fill(HIST("MC/hIsNonAmbiguousTrackMatchedToTrueCollision"), MftNonAmbiguousAndMatchedToTrueCollisionStep::IsNonAmbiguousAndNotMatchedToTrueCollision); hZVtxDiffNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), deltaX, deltaY, deltaZ); - - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"), MftIsTrueCollisionAmongCompatibleCollisionsStep::AllWronglyAssociatedTracks); - if (isTrueCollisionAmongCompatibleCollisions(reassociated3dMftTrack)) { - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsTrueCollisionAmongCompatibleCollisions); - } else { - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisions"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); - registry.fill(HIST("MC/hIsTrueCollisionAmongCompatibleCollisionsNonAmbi"), MftIsTrueCollisionAmongCompatibleCollisionsStep::IsNotTrueCollisionAmongCompatibleCollisions); - } + hDcaNonAmbiguousTracks[MatchedToTrueCollisionStep::IsNotMatchedToTrueCollision]->Fill(templatedTrack.pt(), templatedTrack.eta(), dcaXYoriginal, dcaInfOrig[2], dcaXYtruth, dcaZtruth); } } // end of if non ambi From 33aaed99b93a9fbff0a1442e8831520bc0797246 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sat, 4 Apr 2026 17:58:14 +0200 Subject: [PATCH 171/282] [PWGCF] DptDpt - Proper particle origin counting resolution (#15649) Co-authored-by: Victor Gonzalez --- .../Tasks/particleOriginAnalysis.cxx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx index 847ed0b46e0..354a6865699 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx @@ -33,8 +33,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include -#include +#include +#include #include #include @@ -337,32 +337,32 @@ struct ParticleOriginAnalysis { fhPromptVsPt[i] = registry.add( FORMATSTRING("PromptVsPt_%s", tname), FORMATSTRING("Prompt %s;#it{p}_{T} (GeV/#it{c});counts", tname), - kTH1F, {ptAxis}); + kTH1D, {ptAxis}); fhDecayVsPt[i] = registry.add( FORMATSTRING("DecayVsPt_%s", tname), FORMATSTRING("From decay %s;#it{p}_{T} (GeV/#it{c});counts", tname), - kTH1F, {ptAxis}); + kTH1D, {ptAxis}); fhPromptVsCentVsPt[i] = registry.add( FORMATSTRING("PromptVsCentVsPt_%s", tname), FORMATSTRING("Prompt %s;centrality (%%);#it{p}_{T} (GeV/#it{c})", tname), - kTH2F, {centAxis, ptAxis}); + kTH2D, {centAxis, ptAxis}); fhDecayVsCentVsPt[i] = registry.add( FORMATSTRING("DecayVsCentVsPt_%s", tname), FORMATSTRING("From decay %s;centrality (%%);#it{p}_{T} (GeV/#it{c})", tname), - kTH2F, {centAxis, ptAxis}); + kTH2D, {centAxis, ptAxis}); fhMotherVsPtVsCent[i] = registry.add( FORMATSTRING("MotherVsPtVsCent_%s", tname), FORMATSTRING("Immediate mother of %s;mother;#it{p}_{T} (GeV/#it{c});centrality (%%)", tname), - kTH3F, {motherAxis, ptAxis, centAxis}); + kTH3D, {motherAxis, ptAxis, centAxis}); fhAncestorVsPtVsCent[i] = registry.add( FORMATSTRING("AncestorVsPtVsCent_%s", tname), FORMATSTRING("Earliest ancestor of %s;ancestor;#it{p}_{T} (GeV/#it{c});centrality (%%)", tname), - kTH3F, {motherAxis, ptAxis, centAxis}); + kTH3D, {motherAxis, ptAxis, centAxis}); /* label the encoded mother/ancestor axis */ for (int im = 0; im < KNMo; ++im) { @@ -373,12 +373,12 @@ struct ParticleOriginAnalysis { fhMotherPDG[i] = registry.add( FORMATSTRING("MotherPDG_%s", tname), FORMATSTRING("Immediate mother PDG of %s from decay;PDG code;counts", tname), - kTH1F, {pdgAxis}); + kTH1D, {pdgAxis}); fhAncestorPDG[i] = registry.add( FORMATSTRING("AncestorPDG_%s", tname), FORMATSTRING("Earliest ancestor PDG of %s from decay;PDG code;counts", tname), - kTH1F, {pdgAxis}); + kTH1D, {pdgAxis}); } } From e66df3510fac7c0c58abb081151077056d2e34a0 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: Sat, 4 Apr 2026 18:16:08 +0200 Subject: [PATCH 172/282] =?UTF-8?q?[PWGHF]=20remove=20collision=20id=20inf?= =?UTF-8?q?os=20of=20the=20derived=20table=20of=20Cd=20and=20use=20TPC=20i?= =?UTF-8?q?nne=E2=80=A6=20(#15650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGHF/D2H/Tasks/taskCd.cxx | 42 +++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index fbe561566fd..d9dfa56a455 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -65,6 +65,8 @@ namespace full // Candidate kinematics DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c^2) DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(Eta, eta, float); //! eta of candidate (GeV/c) +DECLARE_SOA_COLUMN(Phi, phi, float); //! phi of candidate (GeV/c) DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Transverse momentum of prong 0 (GeV/c) DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Transverse momentum of prong 1 (GeV/c) DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); //! Transverse momentum of prong 2 (GeV/c) @@ -100,6 +102,8 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp fo DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::M, full::Pt, + full::Eta, + full::Phi, full::PtProng0, full::PtProng1, full::PtProng2, @@ -120,9 +124,7 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::NTpcSignalsKa, full::NItsSignalsDe, full::CandidateSelFlag, - full::Cent, - full::GIndexCol, - full::TimeStamp); + full::Cent); } // namespace o2::aod struct HfTaskCd { @@ -268,8 +270,8 @@ struct HfTaskCd { auto thisCollId = collision.globalIndex(); auto groupedCdCandidates = candidates.sliceBy(candCdPerCollision, thisCollId); auto numPvContributors = collision.numContrib(); - auto bc = collision.template bc_as(); - int64_t timeStamp = bc.timestamp(); + // auto bc = collision.template bc_as(); + // int64_t timeStamp = bc.timestamp(); for (const auto& candidate : groupedCdCandidates) { if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::CdToDeKPi)) { @@ -277,6 +279,8 @@ struct HfTaskCd { } const auto pt = candidate.pt(); + const auto eta = candidate.eta(); + const auto phi = candidate.phi(); const auto ptProng0 = candidate.ptProng0(); const auto ptProng1 = candidate.ptProng1(); const auto ptProng2 = candidate.ptProng2(); @@ -323,10 +327,10 @@ struct HfTaskCd { registry.fill(HIST("Data/hCPAxyVsPt"), cpaXY, pt); registry.fill(HIST("Data/hDca2"), chi2PCA); registry.fill(HIST("Data/hDca2VsPt"), chi2PCA, pt); - registry.fill(HIST("Data/hEta"), candidate.eta()); - registry.fill(HIST("Data/hEtaVsPt"), candidate.eta(), pt); - registry.fill(HIST("Data/hPhi"), candidate.phi()); - registry.fill(HIST("Data/hPhiVsPt"), candidate.phi(), pt); + registry.fill(HIST("Data/hEta"), eta); + registry.fill(HIST("Data/hEtaVsPt"), eta, pt); + registry.fill(HIST("Data/hPhi"), phi); + registry.fill(HIST("Data/hPhiVsPt"), phi, pt); registry.fill(HIST("hSelectionStatus"), candidate.isSelCdToDeKPi(), pt); registry.fill(HIST("hSelectionStatus"), candidate.isSelCdToPiKDe(), pt); registry.fill(HIST("Data/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); @@ -386,8 +390,8 @@ struct HfTaskCd { if (selDeKPi) { candFlag = 1; - pSignedDe = prong0.p() * prong0.sign(); - pSignedPi = prong2.p() * prong2.sign(); + pSignedDe = prong0.tpcInnerParam() * prong0.sign(); + pSignedPi = prong2.tpcInnerParam() * prong2.sign(); nSigmaTpcDe = candidate.nSigTpcDe0(); nSigmaTofDe = candidate.nSigTofDe0(); nSigmaTpcPi = candidate.nSigTpcPi2(); @@ -401,8 +405,8 @@ struct HfTaskCd { itsSignalsDe = itsSignal(prong0); } else if (selPiKDe) { candFlag = -1; - pSignedDe = prong2.p() * prong2.sign(); - pSignedPi = prong0.p() * prong0.sign(); + pSignedDe = prong2.tpcInnerParam() * prong2.sign(); + pSignedPi = prong0.tpcInnerParam() * prong0.sign(); nSigmaTpcDe = candidate.nSigTpcDe2(); nSigmaTofDe = candidate.nSigTofDe2(); nSigmaTpcPi = candidate.nSigTpcPi0(); @@ -422,16 +426,18 @@ struct HfTaskCd { registry.fill(HIST("Data/hNsigmaITSDeVsP"), pSignedDe, nSigmaItsDe); registry.fill(HIST("Data/hTPCSignalDeVsP"), pSignedDe, tpcSignalsDe); registry.fill(HIST("Data/hTPCSignalPiVsP"), pSignedPi, tpcSignalsPi); - registry.fill(HIST("Data/hTPCSignalKaVsP"), prong1.p() * prong1.sign(), tpcSignalsKa); + registry.fill(HIST("Data/hTPCSignalKaVsP"), prong1.tpcInnerParam() * prong1.sign(), tpcSignalsKa); registry.fill(HIST("Data/hITSSignalDeVsP"), pSignedDe, itsSignalsDe); registry.fill(HIST("Data/hNsigmaTPCPiVsP"), pSignedPi, nSigmaTpcPi); registry.fill(HIST("Data/hNsigmaTOFPiVsP"), pSignedPi, nSigmaTofPi); - registry.fill(HIST("Data/hNsigmaTPCKaVsP"), prong1.p() * prong1.sign(), nSigmaTpcKa); - registry.fill(HIST("Data/hNsigmaTOFKaVsP"), prong1.p() * prong1.sign(), nSigmaTofKa); + registry.fill(HIST("Data/hNsigmaTPCKaVsP"), prong1.tpcInnerParam() * prong1.sign(), nSigmaTpcKa); + registry.fill(HIST("Data/hNsigmaTOFKaVsP"), prong1.tpcInnerParam() * prong1.sign(), nSigmaTofKa); rowCandCd( invMassCd, pt, + eta, + phi, ptProng0, ptProng1, ptProng2, @@ -452,9 +458,7 @@ struct HfTaskCd { tpcSignalsKa, itsSignalsDe, candFlag, - cent, - collision.globalIndex(), - timeStamp); + cent); } } } From 3e7c82cfb1c77c47d3d5ba9a9f6f3c28ba16468c Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sat, 4 Apr 2026 20:43:51 +0200 Subject: [PATCH 173/282] [PWGCF] FemtoUniverse: Add additional rejection of fraction of merged points with elliptic CPR (#15651) Co-authored-by: ALICE Action Bot --- .../Core/FemtoUniverseDetaDphiStar.h | 76 +++++++++++++++++-- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 34 +++++++-- 2 files changed, 96 insertions(+), 14 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 05e0cfb5682..f3878d03fad 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -187,8 +187,9 @@ class FemtoUniverseDetaDphiStar } } - template - void init_kT(HistogramRegistry* registry, t1& ktbins, std::vector ldeltaphistarcutmin, std::vector ldeltaphistarcutmax, std::vector ldeltaetacutmin, std::vector ldeltaetacutmax) + template + // void init_kT(HistogramRegistry* registry, t1& ktbins, std::vector ldeltaphistarcutmin, std::vector ldeltaphistarcutmax, std::vector ldeltaetacutmin, std::vector ldeltaetacutmax, std::vector ldeltaphistarcutFractionmin, std::vector ldeltaphistarcutFractionmax, std::vector ldeltaetacutFractionmin, std::vector ldeltaetacutFractionmax) + void init_kT(HistogramRegistry* registry, t1& ktbins, t2& ldeltaphistarcutmin, t2& ldeltaphistarcutmax, t2& ldeltaetacutmin, t2& ldeltaetacutmax, t2& ldeltaphistarcutFractionmin, t2& ldeltaphistarcutFractionmax, t2& ldeltaetacutFractionmin, t2& ldeltaetacutFractionmax) { mHistogramRegistry = registry; ktBins = ktbins; @@ -198,6 +199,11 @@ class FemtoUniverseDetaDphiStar cutDeltaEtaMaxVector = ldeltaetacutmax; cutDeltaEtaMinVector = ldeltaetacutmin; + cutDeltaPhiStarFractionMaxVector = ldeltaphistarcutFractionmax; + cutDeltaPhiStarFractionMinVector = ldeltaphistarcutFractionmin; + cutDeltaEtaFractionMaxVector = ldeltaetacutFractionmax; + cutDeltaEtaFractionMinVector = ldeltaetacutFractionmin; + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { std::string dirName = static_cast(DirNames[0]); for (int j = 1; j < static_cast(ktBins.size() - 1); j++) { @@ -208,6 +214,8 @@ class FemtoUniverseDetaDphiStar histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadphisameafterFractionkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterFractionSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadphimixedafterFractionkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterFractionMIxed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -713,6 +721,55 @@ class FemtoUniverseDetaDphiStar } } + /// Check if pair is close or not + template + bool isClosePairFractionkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, float lmagfield, float DistMax, float FracMax) + { + /// Track-Track combination + // check if provided particles are in agreement with the class instantiation + if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack) { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar instantiation! Please provide kTrack,kTrack candidates."; + return false; + } + + int ktbinval = 1; + if (ktval >= ktBins[1] && ktval < ktBins[2]) { + ktbinval = 1; + } else if (ktval >= ktBins[2] && ktval < ktBins[3]) { + ktbinval = 2; + } else if (ktval >= ktBins[3] && ktval < ktBins[4]) { + ktbinval = 3; + } else if (ktval >= ktBins[4] && ktval < ktBins[5]) { + ktbinval = 4; + } + + magfield = lmagfield; + + auto deta = part1.eta() - part2.eta(); + auto dphiAvg = averagePhiStar(part1, part2, 0); + auto distfrac = averagePhiStarFrac(part1, part2, DistMax); + auto DeltaPhiStarMax = static_cast(cutDeltaPhiStarFractionMaxVector[ktbinval]); + auto DeltaPhiStarMin = static_cast(cutDeltaPhiStarFractionMinVector[ktbinval]); + auto DeltaEtaMax = static_cast(cutDeltaEtaFractionMaxVector[ktbinval]); + auto DeltaEtaMin = static_cast(cutDeltaEtaFractionMinVector[ktbinval]); + + double outerVal = std::pow(dphiAvg, 2) / std::pow(DeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(DeltaEtaMax, 2); + double innerVal = std::pow(dphiAvg, 2) / std::pow(DeltaPhiStarMin, 2) + std::pow(deta, 2) / std::pow(DeltaEtaMin, 2); + + if ((innerVal >= 1.0) && (outerVal < 1.0) && (distfrac > FracMax)) { + return true; + } else { + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadphisameafterFractionkT[ktbinval]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadphimixedafterFractionkT[ktbinval]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; + } + } + /// Check if pair is close or not template void ClosePairqLCMS(Part const& part1, Part const& part2, float lmagfield, uint8_t ChosenEventType, double qlcms) // add typename Parts and variable parts for adding MClabels @@ -787,10 +844,15 @@ class FemtoUniverseDetaDphiStar float cutDeltaEtaMax; float cutDeltaEtaMin; - std::vector cutDeltaPhiStarMaxVector; - std::vector cutDeltaPhiStarMinVector; - std::vector cutDeltaEtaMaxVector; - std::vector cutDeltaEtaMinVector; + std::vector cutDeltaPhiStarMaxVector; + std::vector cutDeltaPhiStarMinVector; + std::vector cutDeltaEtaMaxVector; + std::vector cutDeltaEtaMinVector; + + std::vector cutDeltaPhiStarFractionMaxVector; + std::vector cutDeltaPhiStarFractionMinVector; + std::vector cutDeltaEtaFractionMaxVector; + std::vector cutDeltaEtaFractionMinVector; float magfield; bool plotForEveryRadii = false; @@ -805,6 +867,8 @@ class FemtoUniverseDetaDphiStar std::array, 4> histdetadphimixedbeforekT{}; std::array, 4> histdetadphisameafterkT{}; std::array, 4> histdetadphimixedafterkT{}; + std::array, 4> histdetadphisameafterFractionkT{}; + std::array, 4> histdetadphimixedafterFractionkT{}; std::array, 9>, 7> histdetadpiRadii{}; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 023a355abc6..6c310c792a5 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -89,14 +89,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confIsCPRatITS{"confIsCPRatITS", false, "Close Pair check at ITS"}; 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., "Delta Phi min cut for Close Pair Rejection"}; - Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0., "Delta Eta max cut for Close Pair Rejection"}; - Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0., "Delta Eta min cut for Close Pair Rejection"}; - Configurable> confCPRdeltaPhiCutMaxVector{"confCPRdeltaPhiCutMaxVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Phi max cut for Close Pair Rejection"}; - Configurable> confCPRdeltaPhiCutMinVector{"confCPRdeltaPhiCutMinVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Phi min cut for Close Pair Rejection"}; - Configurable> confCPRdeltaEtaCutMaxVector{"confCPRdeltaEtaCutMaxVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta max cut for Close Pair Rejection"}; - Configurable> confCPRdeltaEtaCutMinVector{"confCPRdeltaEtaCutMinVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta min 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 confIsCPRkT{"confIsCPRkT", true, "kT dependent deltaEta-deltaPhi cut for Close Pair Rejection"}; + Configurable confIsCPRFraction{"confIsCPRFraction", true, "Close Pair Rejection with fraction of merged points"}; Configurable confTrkDCAxyMax{"confTrkDCAxyMax", 0.2, "Max DCA in xy "}; Configurable confTrkDCAzMax{"confTrkDCAzMax", 0.2, "Max DCA in z "}; Configurable confTrkTPCcRowsMin{"confTrkTPCcRowsMin", 80, "Min of TPC crossed rows"}; @@ -120,6 +117,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confisIdenLCMS{"confisIdenLCMS", true, "Choosing identical or non-identical pairs in LCMS"}; Configurable confIsWeight{"confIsWeight", true, "Fill quantum weight"}; Configurable confisIdenPRF{"confisIdenPRF", false, "Choosing identical or non-identical pairs in PRF"}; + + ConfigurableAxis confCPRdeltaEtaCutMaxVec{"confCPRdeltaEtaCutMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta eta cut in CPR"}; + ConfigurableAxis confCPRdeltaEtaCutMinVec{"confCPRdeltaEtaCutMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta eta cut in CPR"}; + ConfigurableAxis confCPRdeltaPhiCutMaxVec{"confCPRdeltaPhiCutMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta phi cut in CPR"}; + ConfigurableAxis confCPRdeltaPhiCutMinVec{"confCPRdeltaPhiCutMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta phi cut in CPR"}; + + ConfigurableAxis confCPRdeltaEtaCutFractionMaxVec{"confCPRdeltaEtaCutFractionMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta eta cut in CPR Fraction"}; + ConfigurableAxis confCPRdeltaEtaCutFractionMinVec{"confCPRdeltaEtaCutFractionMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta eta cut in CPR Fraction"}; + ConfigurableAxis confCPRdeltaPhiCutFractionMaxVec{"confCPRdeltaPhiCutFractionMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta phi cut in CPR Fraction"}; + ConfigurableAxis confCPRdeltaPhiCutFractionMinVec{"confCPRdeltaPhiCutFractionMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta phi cut in CPR Fraction"}; + } twotracksconfigs; using FemtoFullParticles = soa::Join; @@ -489,7 +497,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { pairCleaner.init(&qaRegistry); if (twotracksconfigs.confIsCPR.value) { pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confCPRdeltaPhiCutMin.value, twotracksconfigs.confCPRdeltaPhiCutMax.value, twotracksconfigs.confCPRdeltaEtaCutMin.value, twotracksconfigs.confCPRdeltaEtaCutMax.value, twotracksconfigs.confCPRChosenRadii.value, twotracksconfigs.confCPRPlotPerRadii.value); - pairCloseRejection.init_kT(&resultRegistry, confKtKstarBins, twotracksconfigs.confCPRdeltaPhiCutMinVector, twotracksconfigs.confCPRdeltaPhiCutMaxVector, twotracksconfigs.confCPRdeltaEtaCutMinVector, twotracksconfigs.confCPRdeltaEtaCutMaxVector); + pairCloseRejection.init_kT(&resultRegistry, confKtKstarBins, twotracksconfigs.confCPRdeltaPhiCutMinVec.value, twotracksconfigs.confCPRdeltaPhiCutMaxVec.value, twotracksconfigs.confCPRdeltaEtaCutMinVec.value, twotracksconfigs.confCPRdeltaEtaCutMaxVec.value, twotracksconfigs.confCPRdeltaPhiCutFractionMinVec.value, twotracksconfigs.confCPRdeltaPhiCutFractionMaxVec.value, twotracksconfigs.confCPRdeltaEtaCutFractionMinVec.value, twotracksconfigs.confCPRdeltaEtaCutFractionMaxVec.value); } vPIDPartOne = trackonefilter.confPIDPartOne.value; @@ -633,6 +641,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } + if (twotracksconfigs.confIsCPRFraction) { + if (pairCloseRejection.isClosePairFractionkT(p1, p2, femto_universe_container::EventType::same, kT, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + continue; + } + } } else { if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; @@ -996,6 +1009,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } + if (twotracksconfigs.confIsCPRFraction) { + if (pairCloseRejection.isClosePairFractionkT(p1, p2, femto_universe_container::EventType::mixed, kT, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + continue; + } + } } else { if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; From 2e678d542847c6fccf8688a314e659c418675f71 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: Sun, 5 Apr 2026 00:54:23 +0200 Subject: [PATCH 174/282] [PWGHF] add more Pid column and Lc mass in the derived table of taskCd (#15652) --- PWGHF/D2H/Tasks/taskCd.cxx | 31 ++++++++++--------- .../DataModel/CandidateReconstructionTables.h | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index d9dfa56a455..33327575366 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -63,7 +63,8 @@ namespace o2::aod namespace full { // Candidate kinematics -DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c^2) +DECLARE_SOA_COLUMN(MassCd, massCd, float); //! Invariant mass of cd candidate (GeV/c^2) +DECLARE_SOA_COLUMN(MassLc, massLc, float); //! Invariant mass of lc candidate (GeV/c^2) DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) DECLARE_SOA_COLUMN(Eta, eta, float); //! eta of candidate (GeV/c) DECLARE_SOA_COLUMN(Phi, phi, float); //! phi of candidate (GeV/c) @@ -79,6 +80,7 @@ DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of po DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine of pointing angle in XY plane DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); //! chi2PCA DECLARE_SOA_COLUMN(NSigmaTpcDe, nSigmaTpcDe, float); //! TPC nσ for deuteron hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcPr, nSigmaTpcPr, float); //! TPC nσ for proton hypothesis DECLARE_SOA_COLUMN(NSigmaTpcKa, nSigmaTpcKa, float); //! TPC nσ for kaon hypothesis DECLARE_SOA_COLUMN(NSigmaTpcPi, nSigmaTpcPi, float); //! TPC nσ for pion hypothesis DECLARE_SOA_COLUMN(NSigmaItsDe, nSigmaItsDe, float); //! ITS nσ for deuteron hypothesis @@ -100,7 +102,8 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp fo // Full table: include ALL columns declared above DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", - full::M, + full::MassCd, + full::MassLc, full::Pt, full::Eta, full::Phi, @@ -114,15 +117,13 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::Cpa, full::Chi2PCA, full::NSigmaTpcDe, + full::NSigmaTpcPr, full::NSigmaItsDe, full::NSigmaTofDe, - full::NItsClusters, full::NItsNClusterSize, - full::NTpcClusters, full::NTpcSignalsDe, full::NTpcSignalsPi, full::NTpcSignalsKa, - full::NItsSignalsDe, full::CandidateSelFlag, full::Cent); } // namespace o2::aod @@ -219,6 +220,7 @@ struct HfTaskCd { registry.add("Data/hImpParErrProng1", "3-prong candidates;prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/hImpParErrProng2", "3-prong candidates;prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/hNsigmaTPCDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{TPC}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); + registry.add("Data/hNsigmaTPCPrVsP", "proton;#it{p} (GeV/#it{c}); n#sigma^{TPC}_{p}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hNsigmaTOFDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{TOF}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hNsigmaITSDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{ITS}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hTPCSignalDeVsP", "deuteron;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); @@ -290,11 +292,14 @@ struct HfTaskCd { const auto cpa = candidate.cpa(); const auto cpaXY = candidate.cpaXY(); float invMassCd = 0.f; + float invMassLc = 0.f; if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { invMassCd = HfHelper::invMassCdToDeKPi(candidate); + invMassLc = HfHelper::invMassLcToPKPi(candidate); } if (candidate.isSelCdToPiKDe() >= selectionFlagCd) { invMassCd = HfHelper::invMassCdToPiKDe(candidate); + invMassLc = HfHelper::invMassLcToPiKP(candidate); } if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { @@ -356,13 +361,11 @@ struct HfTaskCd { if (fillTree) { int candFlag = -999; - float nSigmaTpcDe = 0.f, nSigmaTpcKa = 0.f, nSigmaTpcPi = 0.f; + float nSigmaTpcDe = 0.f, nSigmaTpcKa = 0.f, nSigmaTpcPi = 0.f, nSigmaTpcPr = 0.f; float nSigmaItsDe = 0.f; float nSigmaTofDe = 0.f, nSigmaTofKa = 0.f, nSigmaTofPi = 0.f; - int itsNClusterDe = 0; int itsNClusterSizeDe = 0; - int tpcNClusterDe = 0; float tpcSignalsDe = 0.f; float tpcSignalsPi = 0.f; @@ -393,13 +396,12 @@ struct HfTaskCd { pSignedDe = prong0.tpcInnerParam() * prong0.sign(); pSignedPi = prong2.tpcInnerParam() * prong2.sign(); nSigmaTpcDe = candidate.nSigTpcDe0(); + nSigmaTpcPr = candidate.nSigTpcPr0(); nSigmaTofDe = candidate.nSigTofDe0(); nSigmaTpcPi = candidate.nSigTpcPi2(); nSigmaTofPi = candidate.nSigTofPi2(); nSigmaItsDe = prong0Its.itsNSigmaDe(); - itsNClusterDe = prong0.itsNCls(); itsNClusterSizeDe = prong0.itsClusterSizes(); - tpcNClusterDe = prong0.tpcNClsCrossedRows(); tpcSignalsDe = prong0.tpcSignal(); tpcSignalsPi = prong2.tpcSignal(); itsSignalsDe = itsSignal(prong0); @@ -408,13 +410,12 @@ struct HfTaskCd { pSignedDe = prong2.tpcInnerParam() * prong2.sign(); pSignedPi = prong0.tpcInnerParam() * prong0.sign(); nSigmaTpcDe = candidate.nSigTpcDe2(); + nSigmaTpcPr = candidate.nSigTpcPr2(); nSigmaTofDe = candidate.nSigTofDe2(); nSigmaTpcPi = candidate.nSigTpcPi0(); nSigmaTofPi = candidate.nSigTofPi0(); nSigmaItsDe = prong2Its.itsNSigmaDe(); - itsNClusterDe = prong2.itsNCls(); itsNClusterSizeDe = prong2.itsClusterSizes(); - tpcNClusterDe = prong2.tpcNClsCrossedRows(); tpcSignalsDe = prong2.tpcSignal(); tpcSignalsPi = prong0.tpcSignal(); itsSignalsDe = itsSignal(prong2); @@ -422,6 +423,7 @@ struct HfTaskCd { // PID QA registry.fill(HIST("Data/hNsigmaTPCDeVsP"), pSignedDe, nSigmaTpcDe); + registry.fill(HIST("Data/hNsigmaTPCPrVsP"), pSignedDe, nSigmaTpcPr); registry.fill(HIST("Data/hNsigmaTOFDeVsP"), pSignedDe, nSigmaTofDe); registry.fill(HIST("Data/hNsigmaITSDeVsP"), pSignedDe, nSigmaItsDe); registry.fill(HIST("Data/hTPCSignalDeVsP"), pSignedDe, tpcSignalsDe); @@ -435,6 +437,7 @@ struct HfTaskCd { rowCandCd( invMassCd, + invMassLc, pt, eta, phi, @@ -448,15 +451,13 @@ struct HfTaskCd { cpa, chi2PCA, nSigmaTpcDe, + nSigmaTpcPr, nSigmaItsDe, nSigmaTofDe, - itsNClusterDe, itsNClusterSizeDe, - tpcNClusterDe, tpcSignalsDe, tpcSignalsPi, tpcSignalsKa, - itsSignalsDe, candFlag, cent); } diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index bd34cc4817a..02c0e0b297b 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -837,7 +837,7 @@ DECLARE_SOA_TABLE(HfCand3Prong2PidAl, "AOD", "HFCAND3P2PIDAL", //! using HfCand3Prong = HfCand3ProngExt; using HfCand3ProngWPidPiKaPr = soa::Join; using HfCand3ProngWPidPiKa = soa::Join; -using HfCand3ProngWPidPiKaDe = soa::Join; +using HfCand3ProngWPidPiKaDe = soa::Join; using HfCand3ProngWPidPiKaTr = soa::Join; using HfCand3ProngWPidPiKaHe = soa::Join; using HfCand3ProngWPidPiKaAl = soa::Join; From e8c254b1ab6aead12ecc640527860e11a085be28 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: Sun, 5 Apr 2026 16:10:27 +0200 Subject: [PATCH 175/282] [PWGHF] Fill also proton table in charm nuclei for QA check (#15656) --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 7ae95c956b7..74fb8468af5 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -267,7 +267,7 @@ struct HfCandidateCreator3Prong { fillProngPid(track2, rowProng2PidKa); /// fill proton PID information only if necessary - if (createLc || createXic) { + if (createLc || createXic || createCharmNuclei) { fillProngPid(track0, rowProng0PidPr); fillProngPid(track1, rowProng1PidPr); fillProngPid(track2, rowProng2PidPr); From e9a4020870b3aacf3e6f8253a5e81b8412b2fd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sun, 5 Apr 2026 16:11:13 +0200 Subject: [PATCH 176/282] [Common] TOF PID: Add utility getters for dyn response (#15644) --- Common/DataModel/PIDResponseTOF.h | 154 ++++++++++++++++++++++++------ 1 file changed, 126 insertions(+), 28 deletions(-) diff --git a/Common/DataModel/PIDResponseTOF.h b/Common/DataModel/PIDResponseTOF.h index 72007579e70..212dfd8bf51 100644 --- a/Common/DataModel/PIDResponseTOF.h +++ b/Common/DataModel/PIDResponseTOF.h @@ -57,33 +57,38 @@ template using hasTOFAl = decltype(std::declval().tofNSigmaAl()); // PID index as template argument -#define perSpeciesWrapper(functionName) \ - template \ - auto functionName(const TrackType& track) \ - { \ - if constexpr (index == o2::track::PID::Electron) { \ - return track.functionName##El(); \ - } else if constexpr (index == o2::track::PID::Muon) { \ - return track.functionName##Mu(); \ - } else if constexpr (index == o2::track::PID::Pion) { \ - return track.functionName##Pi(); \ - } else if constexpr (index == o2::track::PID::Kaon) { \ - return track.functionName##Ka(); \ - } else if constexpr (index == o2::track::PID::Proton) { \ - return track.functionName##Pr(); \ - } else if constexpr (index == o2::track::PID::Deuteron) { \ - return track.functionName##De(); \ - } else if constexpr (index == o2::track::PID::Triton) { \ - return track.functionName##Tr(); \ - } else if constexpr (index == o2::track::PID::Helium3) { \ - return track.functionName##He(); \ - } else if constexpr (index == o2::track::PID::Alpha) { \ - return track.functionName##Al(); \ - } \ +#define perSpeciesWrapper(functionName) \ + template \ + auto functionName(const TrackType& track) \ + { \ + if constexpr (index == o2::track::PID::Electron) { \ + return track.functionName##El(); \ + } else if constexpr (index == o2::track::PID::Muon) { \ + return track.functionName##Mu(); \ + } else if constexpr (index == o2::track::PID::Pion) { \ + return track.functionName##Pi(); \ + } else if constexpr (index == o2::track::PID::Kaon) { \ + return track.functionName##Ka(); \ + } else if constexpr (index == o2::track::PID::Proton) { \ + return track.functionName##Pr(); \ + } else if constexpr (index == o2::track::PID::Deuteron) { \ + return track.functionName##De(); \ + } else if constexpr (index == o2::track::PID::Triton) { \ + return track.functionName##Tr(); \ + } else if constexpr (index == o2::track::PID::Helium3) { \ + return track.functionName##He(); \ + } else if constexpr (index == o2::track::PID::Alpha) { \ + return track.functionName##Al(); \ + } \ + LOGF(fatal, "%s %i (%s) is not available", #functionName, index, o2::track::PID::getName(index)); \ + return 0.f; \ } perSpeciesWrapper(tofNSigma); perSpeciesWrapper(tofExpSigma); +perSpeciesWrapper(tofExpSignalDiff); +#undef perSpeciesWrapper + template auto tofExpSignal(const TrackType& track) { @@ -106,10 +111,35 @@ auto tofExpSignal(const TrackType& track) } else if constexpr (index == o2::track::PID::Alpha) { return track.tofExpSignalAl(track.tofSignal()); } + LOGF(fatal, "tofExpSignal %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; } -perSpeciesWrapper(tofExpSignalDiff); -#undef perSpeciesWrapper +template +auto tofExpTime(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tofExpTimeEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tofExpTimeMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tofExpTimePi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tofExpTimeKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tofExpTimePr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tofExpTimeDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tofExpTimeTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tofExpTimeHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tofExpTimeAl(); + } + LOGF(fatal, "tofExpTime %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; +} // PID index as function argument for TOF #define perSpeciesWrapper(functionName) \ @@ -161,6 +191,9 @@ perSpeciesWrapper(tofExpSignalDiff); perSpeciesWrapper(tofNSigma); perSpeciesWrapper(tofExpSigma); +perSpeciesWrapper(tofExpSignalDiff); +#undef perSpeciesWrapper + template auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) { @@ -206,9 +239,6 @@ auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) return 0.f; } } -perSpeciesWrapper(tofExpSignalDiff); - -#undef perSpeciesWrapper } // namespace pidutils @@ -364,6 +394,38 @@ PERSPECIES_TOF_SIGMA_COLUMN(He, o2::track::PID::Helium3); PERSPECIES_TOF_SIGMA_COLUMN(Al, o2::track::PID::Alpha); #undef PERSPECIES_TOF_SIGMA_COLUMN +DECLARE_SOA_DYNAMIC_COLUMN(TOFExpSigmaImp, tofExpSigmaDyn, + [](float tofExpMom, + float momentum, + float eta, + float tofSignal, + float tofEvTimeErr, + o2::track::PID::ID particleId) -> float { + switch (particleId) { + case o2::track::PID::Electron: // El + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Muon: // Mu + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Pion: // Pi + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Kaon: // Ka + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Proton: // Pr + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Deuteron: // De + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Triton: // Tr + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Helium3: // He3 + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + case o2::track::PID::Alpha: // Al + return o2::pid::tof::TOFResponseImpl::expectedSigma(tofSignal, tofExpMom, momentum, eta, tofEvTimeErr); + default: + LOGF(fatal, "TOFExpSigmaImp for PID index %i (%s) is not available", particleId, o2::track::PID::getName(particleId)); + return 0.f; + } + }); + #define PERSPECIES_TOF_SEPARATION_COLUMN(name, id) \ DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigma##name##Imp, tofNSigmaDyn##name, \ [](const float tofExpMom, \ @@ -393,8 +455,43 @@ PERSPECIES_TOF_SEPARATION_COLUMN(He, o2::track::PID::Helium3); PERSPECIES_TOF_SEPARATION_COLUMN(Al, o2::track::PID::Alpha); #undef PERSPECIES_TOF_SEPARATION_COLUMN +DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaImp, tofNSigmaDyn, + [](float tofExpMom, + const float length, + float momentum, + float eta, + float tofSignal, + float tofEvTime, + float tofEvTimeErr, + o2::track::PID::ID particleId) -> float { + switch (particleId) { + case o2::track::PID::Electron: // El + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Muon: // Mu + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Pion: // Pi + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Kaon: // Ka + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Proton: // Pr + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Deuteron: // De + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Triton: // Tr + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Helium3: // He3 + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + case o2::track::PID::Alpha: // Al + return o2::pid::tof::TOFResponseImpl::nSigma(tofSignal, tofExpMom, length, momentum, eta, tofEvTime, tofEvTimeErr); + default: + LOGF(fatal, "TOFNSigmaImp for PID index %i (%s) is not available", particleId, o2::track::PID::getName(particleId)); + return 0.f; + } + }); + } // namespace pidtof +using TOFExpSigmaDyn = pidtof::TOFExpSigmaImp; using TOFExpSigmaDynEl = pidtof::TOFExpSigmaElImp; using TOFExpSigmaDynMu = pidtof::TOFExpSigmaMuImp; using TOFExpSigmaDynPi = pidtof::TOFExpSigmaPiImp; @@ -405,6 +502,7 @@ using TOFExpSigmaDynTr = pidtof::TOFExpSigmaTrImp; using TOFExpSigmaDynAl = pidtof::TOFExpSigmaAlImp; +using TOFNSigmaDyn = pidtof::TOFNSigmaImp; using TOFNSigmaDynEl = pidtof::TOFNSigmaElImp; using TOFNSigmaDynMu = pidtof::TOFNSigmaMuImp; using TOFNSigmaDynPi = pidtof::TOFNSigmaPiImp; From 29b77c46d06be481956b2dbadec080f846c75df1 Mon Sep 17 00:00:00 2001 From: Joshua Koenig Date: Sun, 5 Apr 2026 16:15:48 +0200 Subject: [PATCH 177/282] [Infrastructure] Update Codeowners for PWGEM (#15425) Co-authored-by: jokonig --- CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index f2ea6f38a0b..a24c1eefbb0 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -50,9 +50,9 @@ /PWGCF/Tutorial @alibuild @ariedel-cern @victor-gonzalez @otonvd @shouqiye /PWGDQ @alibuild @iarsene @mcoquet642 @lucamicheletti93 @XiaozhiBai -/PWGEM @alibuild @feisenhu @dsekihat @ivorobye @jokonig -/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu @hscheid @jokonig -/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat @jokonig +/PWGEM @alibuild @feisenhu @dsekihat @jokonig @hscheid +/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @feisenhu @hscheid @jokonig +/PWGEM/PhotonMeson @alibuild @mhemmer-cern @dsekihat @jokonig @hscheid @amaringarcia /PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano @zhangbiao-phy @gluparel @stefanopolitano @xinyepeng @singhra1994 # PWG-LF /PWGLF @alibuild @omvazque @skundu692 @mpuccio From 1fdd48fc6f17333b7a81963be029379d3bb839b5 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sun, 5 Apr 2026 16:46:09 +0200 Subject: [PATCH 178/282] [PWGCF] FemtoUniverse: Add configurables for deta-dphi* axes and 3D histogram of PairFracSharedTPCcls, deta,dphi* (#15655) Co-authored-by: ALICE Action Bot --- .../Core/FemtoUniverseDetaDphiStar.h | 135 ++++++++++-------- ...toUniversePairTaskTrackCascadeExtended.cxx | 9 +- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 4 +- .../femtoUniversePairTaskTrackNucleus.cxx | 4 +- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 4 +- .../Tasks/femtoUniversePairTaskTrackTrack.cxx | 5 +- ...ersePairTaskTrackTrack3DMultKtExtended.cxx | 4 +- ...emtoUniversePairTaskTrackTrackExtended.cxx | 5 +- .../femtoUniversePairTaskTrackTrackMC.cxx | 6 +- ...iversePairTaskTrackTrackMultKtExtended.cxx | 5 +- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 29 ++-- .../femtoUniversePairTaskTrackV0Extended.cxx | 6 +- .../femtoUniversePairTaskTrackV0Helicity.cxx | 9 +- ...femtoUniversePairTaskV0CascadeExtended.cxx | 4 +- 14 files changed, 140 insertions(+), 89 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index f3878d03fad..92ee2401b6a 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -50,7 +50,8 @@ class FemtoUniverseDetaDphiStar /// Destructor virtual ~FemtoUniverseDetaDphiStar() = default; /// Initialization of the histograms and setting required values - void init(HistogramRegistry* registry, HistogramRegistry* registryQA, float ldeltaphistarcutmin, float ldeltaphistarcutmax, float ldeltaetacutmin, float ldeltaetacutmax, float lchosenradii, bool lplotForEveryRadii, float lPhiMassMin = 1.014, float lPhiMassMax = 1.026, bool lisSameSignCPR = false) + template + void init(HistogramRegistry* registry, HistogramRegistry* registryQA, t1& fDeltaEtaAxis, t1& fDeltaPhiStarAxis, float ldeltaphistarcutmin, float ldeltaphistarcutmax, float ldeltaetacutmin, float ldeltaetacutmax, float lchosenradii, bool lplotForEveryRadii, float lPhiMassMin = 1.014, float lPhiMassMax = 1.026, bool lisSameSignCPR = false) { chosenRadii = lchosenradii; cutDeltaPhiStarMax = ldeltaphistarcutmax; @@ -66,31 +67,31 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { std::string dirName = static_cast(DirNames[0]); - histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); - histdetadpiqlcmssame = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpiqlcmsmixed = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiqlcmssame = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpiqlcmsmixed = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int i = 0; i < 9; i++) { - histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[1]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } @@ -99,13 +100,13 @@ class FemtoUniverseDetaDphiStar /// V0-V0 combination for (int k = 0; k < 2; k++) { std::string dirName = static_cast(DirNames[2]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } @@ -114,13 +115,13 @@ class FemtoUniverseDetaDphiStar /// Cascade-Cascade combination for (int k = 0; k < 7; k++) { std::string dirName = static_cast(DirNames[5]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } @@ -129,13 +130,13 @@ class FemtoUniverseDetaDphiStar /// Track-Cascade combination for (int k = 0; k < 3; k++) { std::string dirName = static_cast(DirNames[6]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } @@ -144,13 +145,13 @@ class FemtoUniverseDetaDphiStar /// V0-Cascade combination for (int k = 0; k < 3; k++) { std::string dirName = static_cast(DirNames[7]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } @@ -158,14 +159,14 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[3]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } @@ -173,23 +174,22 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[4]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); } } } } } - template - // void init_kT(HistogramRegistry* registry, t1& ktbins, std::vector ldeltaphistarcutmin, std::vector ldeltaphistarcutmax, std::vector ldeltaetacutmin, std::vector ldeltaetacutmax, std::vector ldeltaphistarcutFractionmin, std::vector ldeltaphistarcutFractionmax, std::vector ldeltaetacutFractionmin, std::vector ldeltaetacutFractionmax) - void init_kT(HistogramRegistry* registry, t1& ktbins, t2& ldeltaphistarcutmin, t2& ldeltaphistarcutmax, t2& ldeltaetacutmin, t2& ldeltaetacutmax, t2& ldeltaphistarcutFractionmin, t2& ldeltaphistarcutFractionmax, t2& ldeltaetacutFractionmin, t2& ldeltaetacutFractionmax) + template + void init_kT(HistogramRegistry* registry, t1& ktbins, t3& fDeltaEtaAxis, t3& fDeltaPhiStarAxis, t2& ldeltaphistarcutmin, t2& ldeltaphistarcutmax, t2& ldeltaetacutmin, t2& ldeltaetacutmax, t2& ldeltaphistarcutFractionmin, t2& ldeltaphistarcutFractionmax, t2& ldeltaetacutFractionmin, t2& ldeltaetacutFractionmax, bool filldEtadPhiTPCcls) { mHistogramRegistry = registry; ktBins = ktbins; @@ -210,12 +210,16 @@ class FemtoUniverseDetaDphiStar std::string histSuffixkT1 = std::to_string(static_cast(ktBins[j] * 100.0)); std::string histSuffixkT2 = std::to_string(static_cast(ktBins[j + 1] * 100.0)); std::string histFolderkT = "kT_" + histSuffixkT1 + "_" + histSuffixkT2 + "/"; - histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphisameafterFractionkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterFractionSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedafterFractionkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterFractionMIxed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadphisameafterFractionkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterFractionSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadphimixedafterFractionkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterFractionMIxed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + if (filldEtadPhiTPCcls) { + histdetadphiVsPairTPCFracSharedsamebefore[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphiVsPairTPCFracSharedsamebefore").c_str(), "; PairTPCFracSharedCls; #Delta #eta; #Delta #phi", kTH3F, {{20, 0.0, 1.0}, {fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + histdetadphiVsPairTPCFracSharedmixedbefore[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphiVsPairTPCFracSharedmixedbefore").c_str(), "; PairTPCFracSharedCls; #Delta #eta; #Delta #phi", kTH3F, {{20, 0.0, 1.0}, {fDeltaEtaAxis}, {fDeltaPhiStarAxis}}); + } } } } @@ -651,7 +655,7 @@ class FemtoUniverseDetaDphiStar /// Check if pair is close or not template - bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut, bool IsDphiAvgOrDist, float lmagfield, float DistMax, float FracMax) + bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut, bool IsDphiAvgOrDist, float lmagfield, float DistMax, float FracMax, bool filldEtadPhiTPCcls, float fPairTPCFracShared) { /// Track-Track combination // check if provided particles are in agreement with the class instantiation @@ -683,8 +687,14 @@ class FemtoUniverseDetaDphiStar if (ChosenEventType == femto_universe_container::EventType::same) { histdetadphisamebeforekT[ktbinval]->Fill(deta, dphiAvg); + if (filldEtadPhiTPCcls) { + histdetadphiVsPairTPCFracSharedsamebefore[ktbinval]->Fill(fPairTPCFracShared, deta, dphiAvg); + } } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadphimixedbeforekT[ktbinval]->Fill(deta, dphiAvg); + if (filldEtadPhiTPCcls) { + histdetadphiVsPairTPCFracSharedmixedbefore[ktbinval]->Fill(fPairTPCFracShared, deta, dphiAvg); + } } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } @@ -844,15 +854,15 @@ class FemtoUniverseDetaDphiStar float cutDeltaEtaMax; float cutDeltaEtaMin; - std::vector cutDeltaPhiStarMaxVector; - std::vector cutDeltaPhiStarMinVector; - std::vector cutDeltaEtaMaxVector; - std::vector cutDeltaEtaMinVector; + std::vector cutDeltaPhiStarMaxVector; + std::vector cutDeltaPhiStarMinVector; + std::vector cutDeltaEtaMaxVector; + std::vector cutDeltaEtaMinVector; - std::vector cutDeltaPhiStarFractionMaxVector; - std::vector cutDeltaPhiStarFractionMinVector; - std::vector cutDeltaEtaFractionMaxVector; - std::vector cutDeltaEtaFractionMinVector; + std::vector cutDeltaPhiStarFractionMaxVector; + std::vector cutDeltaPhiStarFractionMinVector; + std::vector cutDeltaEtaFractionMaxVector; + std::vector cutDeltaEtaFractionMinVector; float magfield; bool plotForEveryRadii = false; @@ -872,6 +882,9 @@ class FemtoUniverseDetaDphiStar std::array, 9>, 7> histdetadpiRadii{}; + std::array, 4> histdetadphiVsPairTPCFracSharedsamebefore{}; + std::array, 4> histdetadphiVsPairTPCFracSharedmixedbefore{}; + std::shared_ptr histdetadpiqlcmssame{}; std::shared_ptr histdetadpiqlcmsmixed{}; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 715a3c1380a..8f4a3285866 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -104,6 +104,11 @@ struct femtoUniversePairTaskTrackCascadeExtended { ConfigurableAxis confTrkTempFitVarBins{"confTrkTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; Configurable confNEventsMix{"confNEventsMix", 5, "Number of events for mixing"}; + struct : o2::framework::ConfigurableGroup { + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; + } twotracksconfigs; + // Efficiency Configurable confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"}; Configurable confCCDBEfficiency{"confCCDBEfficiency", "", "CCDB path to efficiency object"}; @@ -334,9 +339,9 @@ struct femtoUniversePairTaskTrackCascadeExtended { pairCleanerCasc.init(&qaRegistry); if (confIsCPR.value) { if (doprocessSameEvent || doprocessSameEventBitmask || doprocessMixedEvent || doprocessMixedEventBitmask) - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); if (doprocessSameEventCasc || doprocessSameEventCascBitmask || doprocessMixedEventCasc || doprocessMixedEventCascBitmask) - pairCloseRejectionCasc.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); + pairCloseRejectionCasc.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); } if (!confLocalEfficiency.value.empty()) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 8cde231fecb..0311b48b560 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -94,6 +94,8 @@ struct FemtoUniversePairTaskTrackD0 { 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"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; } ConfBothTracks; /// Particle 1 --- IDENTIFIED TRACK @@ -624,7 +626,7 @@ struct FemtoUniversePairTaskTrackD0 { softPionRemoval.init(&qaRegistry); pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfBothTracks.confDeltaEtaAxis, ConfBothTracks.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDTrack = ConfTrack.confPIDTrack.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index e133de72efe..b194a5aec31 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -194,6 +194,8 @@ struct FemtoUniversePairTaskTrackNucleus { 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 confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; Configurable cfgProcessPP{"cfgProcessPP", true, "Process positively charged particles (plus-plus)"}; Configurable cfgProcessMM{"cfgProcessMM", true, "Process negatively charged particles (minus-minus)"}; @@ -470,7 +472,7 @@ struct FemtoUniversePairTaskTrackNucleus { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRDeltaPhiCutMin.value, confCPRDeltaPhiCutMax.value, confCPRDeltaEtaCutMin.value, confCPRDeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRDeltaPhiCutMin.value, confCPRDeltaPhiCutMax.value, confCPRDeltaEtaCutMin.value, confCPRDeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDTrack = trackfilter.confPIDTrack.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 98a697434ac..96f1b7ca865 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -83,6 +83,8 @@ struct FemtoUniversePairTaskTrackPhi { Configurable ConfCPRInvMassCutMin{"ConfCPRInvMassCutMin", 1.014, "Invariant mass (low) cut for Close Pair Rejection"}; Configurable ConfCPRInvMassCutMax{"ConfCPRInvMassCutMax", 1.026, "Invariant mass (high) cut for Close Pair Rejection"}; Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; /// Table for both particles Configurable ConfPIDProtonNsigmaCombined{"ConfPIDProtonNsigmaCombined", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; @@ -480,7 +482,7 @@ struct FemtoUniversePairTaskTrackPhi { pairCleaner.init(&qaRegistry); if (ConfCPRIsEnabled) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin, ConfCPRdeltaPhiCutMax, ConfCPRdeltaEtaCutMin, ConfCPRdeltaEtaCutMax, ConfCPRChosenRadii, ConfCPRPlotPerRadii, ConfCPRInvMassCutMin, ConfCPRInvMassCutMax); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, ConfCPRdeltaPhiCutMin, ConfCPRdeltaPhiCutMax, ConfCPRdeltaEtaCutMin, ConfCPRdeltaEtaCutMax, ConfCPRChosenRadii, ConfCPRPlotPerRadii, ConfCPRInvMassCutMin, ConfCPRInvMassCutMax); } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx index e672064bd59..6538be22a7f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx @@ -129,6 +129,9 @@ struct FemtoUniversePairTaskTrackTrack { Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; + FemtoUniverseFemtoContainer sameEventFemtoCont; FemtoUniverseFemtoContainer mixedEventFemtoCont; FemtoUniverseAngularContainer sameEventAngularCont; @@ -165,7 +168,7 @@ struct FemtoUniversePairTaskTrackTrack { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDPartOne = confPIDPartOne.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx index 5de02b3c346..6a7bda27d00 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -78,6 +78,8 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { Configurable confisIdenLCMS{"confisIdenLCMS", true, "Choosing identical or non-identical pairs in LCMS"}; Configurable confIsWeight{"confIsWeight", false, "Fill quantum weight"}; Configurable confisIdenPRF{"confisIdenPRF", false, "Choosing identical or non-identical pairs in PRF"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; } twotracksconfigs; SliceCache cache; @@ -426,7 +428,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDPartOne = trackonefilter.confPIDPartOne.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx index 7760a8f2451..559d308f63b 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx @@ -165,6 +165,9 @@ struct FemtoUniversePairTaskTrackTrackExtended { Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; + FemtoUniverseContainer sameEventCont; FemtoUniverseContainer mixedEventCont; FemtoUniversePairCleaner pairCleaner; @@ -336,7 +339,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { mixedEventCont.setPDGCodes(trackonefilter.confPDGCodePartOne, tracktwofilter.confPDGCodePartTwo); pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDPartOne = trackonefilter.confPIDPartOne.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx index 5cff8c72cf9..62d856c8f7f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx @@ -39,6 +39,7 @@ #include "TDatabasePDG.h" +#include #include using namespace o2; @@ -168,6 +169,9 @@ struct femtoUniversePairTaskTrackTrackMC { Configurable cfgProcessMultBins{"cfgProcessMultBins", true, "Process kstar histograms in multiplicity bins (in multiplicity bins)"}; Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if cfgProcessMultBins is set false, this will not be processed regardless this Configurable state)"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; + FemtoUniverseContainer sameEventCont; FemtoUniverseContainer mixedEventCont; @@ -388,7 +392,7 @@ struct femtoUniversePairTaskTrackTrackMC { pairCleaner.init(&qaRegistry); if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); } vPIDPartOne = trackonefilter.ConfPIDPartOne.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index 840f66fc56e..cf31b851958 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -189,6 +189,9 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { Configurable cfgProcessKtBins{"cfgProcessKtBins", false, "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"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; + FemtoUniverseFemtoContainer sameEventCont; FemtoUniverseFemtoContainer mixedEventCont; @@ -412,7 +415,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } vPIDPartOne = trackonefilter.confPIDPartOne.value; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 6c310c792a5..7242f0ceea9 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -117,17 +117,20 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confisIdenLCMS{"confisIdenLCMS", true, "Choosing identical or non-identical pairs in LCMS"}; Configurable confIsWeight{"confIsWeight", true, "Fill quantum weight"}; Configurable confisIdenPRF{"confisIdenPRF", false, "Choosing identical or non-identical pairs in PRF"}; + Configurable confIsfilldEtadPhiTPCcls{"confIsfilldEtadPhiTPCcls", false, "Filling of 3D histogram PairFracSharedTPCcls vs. dEta vs. dPhiStar"}; - ConfigurableAxis confCPRdeltaEtaCutMaxVec{"confCPRdeltaEtaCutMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta eta cut in CPR"}; - ConfigurableAxis confCPRdeltaEtaCutMinVec{"confCPRdeltaEtaCutMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta eta cut in CPR"}; - ConfigurableAxis confCPRdeltaPhiCutMaxVec{"confCPRdeltaPhiCutMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta phi cut in CPR"}; - ConfigurableAxis confCPRdeltaPhiCutMinVec{"confCPRdeltaPhiCutMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta phi cut in CPR"}; + Configurable> confCPRdeltaEtaCutMaxVec{"confCPRdeltaEtaCutMaxVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta eta cut in CPR"}; + Configurable> confCPRdeltaEtaCutMinVec{"confCPRdeltaEtaCutMinVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta eta cut in CPR"}; + Configurable> confCPRdeltaPhiCutMaxVec{"confCPRdeltaPhiCutMaxVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta phi cut in CPR"}; + Configurable> confCPRdeltaPhiCutMinVec{"confCPRdeltaPhiCutMinVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta phi cut in CPR"}; - ConfigurableAxis confCPRdeltaEtaCutFractionMaxVec{"confCPRdeltaEtaCutFractionMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta eta cut in CPR Fraction"}; - ConfigurableAxis confCPRdeltaEtaCutFractionMinVec{"confCPRdeltaEtaCutFractionMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta eta cut in CPR Fraction"}; - ConfigurableAxis confCPRdeltaPhiCutFractionMaxVec{"confCPRdeltaPhiCutFractionMaxVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta phi cut in CPR Fraction"}; - ConfigurableAxis confCPRdeltaPhiCutFractionMinVec{"confCPRdeltaPhiCutFractionMinVec", {VARIABLE_WIDTH, 0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta phi cut in CPR Fraction"}; + Configurable> confCPRdeltaEtaCutFractionMaxVec{"confCPRdeltaEtaCutFractionMaxVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta eta cut in CPR Fraction"}; + Configurable> confCPRdeltaEtaCutFractionMinVec{"confCPRdeltaEtaCutFractionMinVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta eta cut in CPR Fraction"}; + Configurable> confCPRdeltaPhiCutFractionMaxVec{"confCPRdeltaPhiCutFractionMaxVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for max delta phi cut in CPR Fraction"}; + Configurable> confCPRdeltaPhiCutFractionMinVec{"confCPRdeltaPhiCutFractionMinVec", std::vector{0.0f, 0.0f, 0.0f, 0.0f}, "Bins for min delta phi cut in CPR Fraction"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; } twotracksconfigs; using FemtoFullParticles = soa::Join; @@ -496,8 +499,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { pairCleaner.init(&qaRegistry); if (twotracksconfigs.confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confCPRdeltaPhiCutMin.value, twotracksconfigs.confCPRdeltaPhiCutMax.value, twotracksconfigs.confCPRdeltaEtaCutMin.value, twotracksconfigs.confCPRdeltaEtaCutMax.value, twotracksconfigs.confCPRChosenRadii.value, twotracksconfigs.confCPRPlotPerRadii.value); - pairCloseRejection.init_kT(&resultRegistry, confKtKstarBins, twotracksconfigs.confCPRdeltaPhiCutMinVec.value, twotracksconfigs.confCPRdeltaPhiCutMaxVec.value, twotracksconfigs.confCPRdeltaEtaCutMinVec.value, twotracksconfigs.confCPRdeltaEtaCutMaxVec.value, twotracksconfigs.confCPRdeltaPhiCutFractionMinVec.value, twotracksconfigs.confCPRdeltaPhiCutFractionMaxVec.value, twotracksconfigs.confCPRdeltaEtaCutFractionMinVec.value, twotracksconfigs.confCPRdeltaEtaCutFractionMaxVec.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, twotracksconfigs.confCPRdeltaPhiCutMin.value, twotracksconfigs.confCPRdeltaPhiCutMax.value, twotracksconfigs.confCPRdeltaEtaCutMin.value, twotracksconfigs.confCPRdeltaEtaCutMax.value, twotracksconfigs.confCPRChosenRadii.value, twotracksconfigs.confCPRPlotPerRadii.value); + pairCloseRejection.init_kT(&resultRegistry, confKtKstarBins, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, twotracksconfigs.confCPRdeltaPhiCutMinVec.value, twotracksconfigs.confCPRdeltaPhiCutMaxVec.value, twotracksconfigs.confCPRdeltaEtaCutMinVec.value, twotracksconfigs.confCPRdeltaEtaCutMaxVec.value, twotracksconfigs.confCPRdeltaPhiCutFractionMinVec.value, twotracksconfigs.confCPRdeltaPhiCutFractionMaxVec.value, twotracksconfigs.confCPRdeltaEtaCutFractionMinVec.value, twotracksconfigs.confCPRdeltaEtaCutFractionMaxVec.value, twotracksconfigs.confIsfilldEtadPhiTPCcls); } vPIDPartOne = trackonefilter.confPIDPartOne.value; @@ -580,7 +583,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { continue; } } else { @@ -638,7 +641,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { continue; } if (twotracksconfigs.confIsCPRFraction) { @@ -1006,7 +1009,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { continue; } if (twotracksconfigs.confIsCPRFraction) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index c317199d716..01e918cfe4e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -176,6 +176,8 @@ struct FemtoUniversePairTaskTrackV0Extended { 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 confRandomizeCPR{"confRandomizeCPR", false, "Fill Dete-Dphi histograms in random order: v01, v02 or v02, v01 - does not apply to track-V0"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; } ConfCPR; // Efficiency @@ -387,8 +389,8 @@ struct FemtoUniversePairTaskTrackV0Extended { pairCleaner.init(&qaRegistry); pairCleanerV0.init(&qaRegistry); if (ConfCPR.confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPR.confCPRdeltaPhiCutMin.value, ConfCPR.confCPRdeltaPhiCutMax.value, ConfCPR.confCPRdeltaEtaCutMin.value, ConfCPR.confCPRdeltaEtaCutMax.value, ConfCPR.confCPRChosenRadii.value, ConfCPR.confCPRPlotPerRadii.value); - pairCloseRejectionV0.init(&resultRegistry, &qaRegistry, ConfCPR.confCPRdeltaPhiCutMin.value, ConfCPR.confCPRdeltaPhiCutMax.value, ConfCPR.confCPRdeltaEtaCutMin.value, ConfCPR.confCPRdeltaEtaCutMax.value, ConfCPR.confCPRChosenRadii.value, ConfCPR.confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPR.confDeltaEtaAxis, ConfCPR.confDeltaPhiStarAxis, ConfCPR.confCPRdeltaPhiCutMin.value, ConfCPR.confCPRdeltaPhiCutMax.value, ConfCPR.confCPRdeltaEtaCutMin.value, ConfCPR.confCPRdeltaEtaCutMax.value, ConfCPR.confCPRChosenRadii.value, ConfCPR.confCPRPlotPerRadii.value); + pairCloseRejectionV0.init(&resultRegistry, &qaRegistry, ConfCPR.confDeltaEtaAxis, ConfCPR.confDeltaPhiStarAxis, ConfCPR.confCPRdeltaPhiCutMin.value, ConfCPR.confCPRdeltaPhiCutMax.value, ConfCPR.confCPRdeltaEtaCutMin.value, ConfCPR.confCPRdeltaEtaCutMax.value, ConfCPR.confCPRChosenRadii.value, ConfCPR.confCPRPlotPerRadii.value); } if (!confLocalEfficiency.value.empty()) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index cd31dc73b55..ecb3e242b6f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx @@ -160,6 +160,11 @@ struct FemtoUniversePairTaskTrackV0Helicity { 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 3D 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 3D plot: k* vs multiplicity vs mT (set to true in order to use)"}; + struct : o2::framework::ConfigurableGroup { + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; + } twotracksconfigs; + /// Helicity ranges and configurables Configurable cfgProcessHel{"cfgProcessHel", true, "Process particle pairs from all helicity ranges"}; Configurable cfgProcessHel1{"cfgProcessHel1", false, "Process particle pairs from the helicity range 1"}; // 1.0 >= cosineTheta >= 0.1 @@ -409,8 +414,8 @@ struct FemtoUniversePairTaskTrackV0Helicity { pairCleaner.init(&qaRegistry); pairCleanerV0.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); - pairCloseRejectionV0.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejectionV0.init(&resultRegistry, &qaRegistry, twotracksconfigs.confDeltaEtaAxis, twotracksconfigs.confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } if (!confLocalEfficiency.value.empty()) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx index 739128780ea..520b910d497 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskV0CascadeExtended.cxx @@ -81,6 +81,8 @@ struct FemtoUniversePairTaskV0CascadeExtended { Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.0, "Delta Eta cut for Close Pair Rejection"}; Configurable confIsSameSignCPR{"confIsSameSignCPR", false, "Close Pair Rejection for same sign children of cascades"}; + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; + ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; /// for correlation part Configurable confIsMC{"confIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; @@ -214,7 +216,7 @@ struct FemtoUniversePairTaskV0CascadeExtended { pairCleaner.init(&qaRegistry); if (confIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); + pairCloseRejection.init(&resultRegistry, &qaRegistry, confDeltaEtaAxis, confDeltaPhiStarAxis, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value, 0, 0, confIsSameSignCPR.value); } } From 0a8ae169574a4a2d358f934aaa9e51800cecf23d Mon Sep 17 00:00:00 2001 From: spolitan <59452587+stefanopolitano@users.noreply.github.com> Date: Sun, 5 Apr 2026 18:29:29 +0200 Subject: [PATCH 179/282] [PWGHF] Add single-track cuts to Hc creator (#15658) --- .../dataCreatorHiddenCharmReduced.cxx | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx index 2e9a00bd6b5..c205258b3c6 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx @@ -83,11 +83,19 @@ struct HfDataCreatorHiddenCharmReduced { Configurable tpcNClsCrossedRowsMin{"tpcNClsCrossedRowsMin", 80, "Minimum number of crossed TPC rows"}; Configurable ptMinTrack{"ptMinTrack", 0.5, "Minimum proton-track pT"}; Configurable etaMaxTrack{"etaMaxTrack", 0.8, "Maximum proton-track |eta|"}; - Configurable momForCombinedPid{"momForCombinedPid", 0.75f, "Momentum threshold above which combined TPC+TOF proton PID is used"}; + Configurable trackChi2Cut{"trackChi2Cut", 4.f, "Maximum chi2/ncls in TPC"}; + Configurable trackMinChi2Cut{"trackMinChi2Cut", 0.f, "Minimum chi2/ncls in TPC"}; + Configurable trackMaxChi2ITS{"trackMaxChi2ITS", 36.f, "Maximum chi2/ncls in ITS"}; Configurable> binsPtTrack{"binsPtTrack", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "Track pT bin limits for DCA cuts"}; Configurable> cutsTrack{"cutsTrack", {hf_cuts_single_track::CutsTrack[0], hf_cuts_single_track::NBinsPtTrack, hf_cuts_single_track::NCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track DCA selections per pT bin"}; + // DCA + Configurable> paramsDCAxyPtDep{"paramsDCAxyPtDep", std::vector{0.0010, 0.0080, 0.73}, "Parameters for pT-dependent DCAxy cut: p0, p1, p2 for cut = p0 + p1/pt^p2"}; + Configurable> paramsDCAzPtDep{"paramsDCAzPtDep", std::vector{-0.0044, 0.0152, 0.47}, "Parameters for pT-dependent DCAz cut: p0, p1, p2 for cut = p0 + p1/pt^p2"}; + // PID + Configurable momForCombinedPid{"momForCombinedPid", 0.75f, "Momentum threshold above which combined TPC+TOF proton PID is used"}; Configurable maxNsigmaTofPi{"maxNsigmaTofPi", 2.f, "Maximum pion n-sigma in TOF for proton rejection"}; Configurable maxNsigmaTofKa{"maxNsigmaTofKa", 2.f, "Maximum kaon n-sigma in TOF for proton rejection"}; + Configurable maxNsigmaTofPr{"maxNsigmaTofPr", 3.f, "Maximum proton n-sigma in TOF"}; Configurable maxNsigmaCombinedPr{"maxNsigmaCombinedPr", 3.f, "Maximum combined proton n-sigma from TPC and TOF"}; Configurable maxNsigmaTpcPi{"maxNsigmaTpcPi", 2.f, "Maximum pion n-sigma in TPC for proton rejection"}; Configurable maxNsigmaTpcKa{"maxNsigmaTpcKa", 2.f, "Maximum kaon n-sigma in TPC for proton rejection"}; @@ -148,6 +156,7 @@ struct HfDataCreatorHiddenCharmReduced { registry.add("hNSigmaTPCProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});n#sigma_{TPC}", {HistType::kTH2D, {axisPt, axisNSigma}}); registry.add("hNSigmaTOFProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});n#sigma_{TOF}", {HistType::kTH2D, {axisPt, axisNSigma}}); registry.add("hInvMass", "Invariant mass of selected proton with all other tracks in the event;#it{p}_{T}^{proton} (GeV/#it{c});invariant mass with other tracks (GeV/#it{c}^{2})", {HistType::kTH2D, {axisPt, AxisSpec{100, 2.85, 3.25, "invariant mass with other tracks (GeV/#it{c}^{2})"}}}); + registry.add("hDeDxTPCProton", "Selected proton tracks;#it{p}_{T}^{track} (GeV/#it{c});TPC dE/dx (a.u.)", {HistType::kTH2D, {axisPt, AxisSpec{100, 0., 200., "TPC dE/dx (a.u.)"}}}); } // init HF event selection helper @@ -163,6 +172,11 @@ struct HfDataCreatorHiddenCharmReduced { } } + static float dcaSigma(float const& pt, float const& p0, float const& p1, float const& p2) + { + return p0 + p1 / std::pow(std::abs(pt), p2); + } + template bool isSelectedPid(TTrack const& track) const { @@ -188,10 +202,17 @@ struct HfDataCreatorHiddenCharmReduced { bool rejectAsPion = false; bool rejectAsKaon = false; - if (mom < momForCombinedPid || !hasTOF) { + if (mom < momForCombinedPid) { isProton = std::abs(nSigmaTPCPr) < maxNsigmaTpcPr; rejectAsPion = std::abs(nSigmaTPCPi) < maxNsigmaTpcPi; rejectAsKaon = std::abs(nSigmaTPCKa) < maxNsigmaTpcKa; + + if (hasTOF) { + rejectAsPion = rejectAsPion || std::abs(track.tofNSigmaPi()) < maxNsigmaTofPi; + rejectAsKaon = rejectAsKaon || std::abs(track.tofNSigmaKa()) < maxNsigmaTofKa; + isProton = isProton || std::abs(track.tofNSigmaPr()) < maxNsigmaCombinedPr; + } + } else { const float nSigmaTOFPr = track.tofNSigmaPr(); const float nSigmaTOFPi = track.tofNSigmaPi(); @@ -211,6 +232,11 @@ struct HfDataCreatorHiddenCharmReduced { const int itsNClsMin = config.itsNClsMin.value; const double etaMaxTrack = config.etaMaxTrack.value; const double ptMinTrack = config.ptMinTrack.value; + const float trackChi2Cut = config.trackChi2Cut.value; + const float trackMinChi2Cut = config.trackMinChi2Cut.value; + const float trackMaxChi2ITS = config.trackMaxChi2ITS.value; + const float dcaXY = track.dcaXY(); + const float dcaZ = track.dcaZ(); if (!track.isGlobalTrackWoDCA()) { return false; @@ -224,6 +250,12 @@ struct HfDataCreatorHiddenCharmReduced { if (track.itsNCls() < itsNClsMin) { return false; } + if (track.tpcChi2NCl() > trackChi2Cut || track.tpcChi2NCl() < trackMinChi2Cut) { + return false; + } + if (track.itsChi2NCl() > trackMaxChi2ITS) { + return false; + } if (std::abs(track.eta()) > etaMaxTrack) { return false; } @@ -233,6 +265,9 @@ struct HfDataCreatorHiddenCharmReduced { if (!isSelectedTrackDca(config.binsPtTrack, config.cutsTrack, track.pt(), track.dcaXY(), track.dcaZ())) { return false; } + if (dcaSigma(track.pt(), config.paramsDCAxyPtDep.value[0], config.paramsDCAxyPtDep.value[1], config.paramsDCAxyPtDep.value[2]) > std::abs(dcaXY) || dcaSigma(track.pt(), config.paramsDCAzPtDep.value[0], config.paramsDCAzPtDep.value[1], config.paramsDCAzPtDep.value[2]) > std::abs(dcaZ)) { + return false; + } return isSelectedPid(track); } @@ -276,6 +311,7 @@ struct HfDataCreatorHiddenCharmReduced { registry.fill(HIST("hEtaCutsProton"), trk.eta()); registry.fill(HIST("hDCAToPrimXYVsPtCutsProton"), trk.pt(), trk.dcaXY()); registry.fill(HIST("hNSigmaTPCProton"), trk.pt(), trk.tpcNSigmaPr()); + registry.fill(HIST("hDeDxTPCProton"), trk.pt(), trk.tpcSignal()); if (trk.hasTOF()) { registry.fill(HIST("hNSigmaTOFProton"), trk.pt(), trk.tofNSigmaPr()); } From a16105209cd6a8a27a166582e78c6b4d10eba7dd Mon Sep 17 00:00:00 2001 From: Deependra Sharma <38365215+deependra170598@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:46:27 +0530 Subject: [PATCH 180/282] [PWGHF] Added safety checks before using ccdb efficiency objects (#15653) --- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 9b15c6f7233..e14bc59a504 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -118,8 +118,8 @@ struct HfTaskCorrelationDstarHadrons { HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; o2::ccdb::CcdbApi ccdbApi; - std::vector vecHistEfficiencyDstar; - std::vector vecHistEfficiencyTracks; + std::vector vecHistEfficiencyDstar; + std::vector vecHistEfficiencyTracks; void init(InitContext&) { @@ -166,12 +166,12 @@ struct HfTaskCorrelationDstarHadrons { vecHistEfficiencyTracks.resize(nEfficiencyHist); for (int iHist = 0; iHist < nEfficiencyHist; iHist++) { - vecHistEfficiencyDstar[iHist] = dynamic_cast(efficiencyDstarRootFile->Get(Form("hEfficiencyDstar_%d", iHist))); + vecHistEfficiencyDstar[iHist] = dynamic_cast(efficiencyDstarRootFile->Get(Form("hEfficiencyDstar_%d", iHist))); if (!vecHistEfficiencyDstar[iHist]) { LOGF(fatal, "Failed to retrieve Dstar efficiency histogram hEfficiencyDstar_%d from file", iHist); } - vecHistEfficiencyTracks[iHist] = dynamic_cast(efficiencyTracksRootFile->Get(Form("hEfficiencyTracks_%d", iHist))); + vecHistEfficiencyTracks[iHist] = dynamic_cast(efficiencyTracksRootFile->Get(Form("hEfficiencyTracks_%d", iHist))); if (!vecHistEfficiencyTracks[iHist]) { LOGF(fatal, "Failed to retrieve track efficiency histogram hEfficiencyTracks_%d from file", iHist); } @@ -212,19 +212,31 @@ struct HfTaskCorrelationDstarHadrons { // if (ptTrack > 10.0) { // ptTrack = 10.5; // } - float netEfficiencyWeight = 1.0; + float netEfficiencyWeight = 1.0, efficiencyWeightDstar = 1.0, efficiencyWeightTracks = 1.0; if (applyEfficiency && !useCcdbEfficiency) { - float const efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); - // LOG(info)<<"efficiencyWeightDstar "<at(effBinPtTrack); - // LOG(info)<<"efficiencyWeightTracks "<at(effBinPtDstar); + efficiencyWeightTracks = efficiencyTracks->at(effBinPtTrack); netEfficiencyWeight = 1.0 / (efficiencyWeightDstar * efficiencyWeightTracks); } else if (applyEfficiency && useCcdbEfficiency && nEfficiencyHist == 1) { - float const efficiencyWeightDstar = vecHistEfficiencyDstar[0]->GetBinContent(vecHistEfficiencyDstar[0]->GetXaxis()->FindBin(ptDstar)); - // LOG(info)<<"efficiencyWeightDstar "<GetBinContent(vecHistEfficiencyTracks[0]->GetXaxis()->FindBin(ptTrack)); - // LOG(info)<<"efficiencyWeightTracks "<GetXaxis()->GetBinLowEdge(1); + if (ptDstar <= ptEffLowEdgeDstar) { // pT of current dstar candidate is lower than the lower edge of the pT axis + efficiencyWeightDstar = vecHistEfficiencyDstar[0]->GetBinContent(1); + } else { + efficiencyWeightDstar = vecHistEfficiencyDstar[0]->GetBinContent(vecHistEfficiencyDstar[0]->GetXaxis()->FindBin(ptDstar)); + if (!efficiencyWeightDstar) { + LOGF(fatal, "Dstar efficiency weight can't be zero."); + } + } + float const ptEffLowEdgeTrack = vecHistEfficiencyTracks[0]->GetBinLowEdge(1); + if (ptTrack <= ptEffLowEdgeTrack) { // pT of current track is lower than the lower edge of the pT axis + efficiencyWeightTracks = vecHistEfficiencyTracks[0]->GetBinContent(1); + } else { + efficiencyWeightTracks = vecHistEfficiencyTracks[0]->GetBinContent(vecHistEfficiencyTracks[0]->GetXaxis()->FindBin(ptTrack)); + if (!efficiencyWeightTracks) { + LOGF(fatal, "track efficiency weight can't be zero"); + } + } netEfficiencyWeight = 1.0 / (efficiencyWeightDstar * efficiencyWeightTracks); } else if (applyEfficiency && useCcdbEfficiency && nEfficiencyHist > 1) { // to do From e09db65e0ed4ca68a918c23c2fff0ae7012fef4c Mon Sep 17 00:00:00 2001 From: Gianni Shigeru Setoue Liveraro <81832939+gianniliveraro@users.noreply.github.com> Date: Sun, 5 Apr 2026 14:44:14 -0300 Subject: [PATCH 181/282] [PWGLF] Small fixes in sigma0 analysis (#15659) Co-authored-by: ALICE Action Bot --- .../Strangeness/sigma0builder.cxx | 29 ++++----- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 64 +++++++++---------- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 339088a311c..0450200a07b 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -1096,7 +1096,7 @@ struct sigma0builder { for (size_t i = 0; i < cluster.mcParticleIds().size(); i++) { int mcId = cluster.mcParticleIds()[i]; - auto mcPart = mcparticles.iteratorAt(mcId); + auto mcPart = mcparticles.rawIteratorAt(mcId); // Accumulate total momentum (fallback strategy) sumPx += mcPart.px(); @@ -1112,31 +1112,28 @@ struct sigma0builder { if (daughterId < 0) continue; // Not from Sigma0 -> try next contributor - auto mcPhoton = mcparticles.iteratorAt(daughterId); - - // Sanity check: are we getting the correct particles? - auto dummy = mcparticles.rawIteratorAt(daughterId); - if (mcPhoton.globalIndex() != dummy.globalIndex()) - LOGF(fatal, "The behave of rawIteratorAt != iteratorAt. Index %i != %i. Please check. Aborting.", mcPhoton.globalIndex(), dummy.globalIndex()); + auto mcPhoton = mcparticles.rawIteratorAt(daughterId); // Require true photon, please if (mcPhoton.pdgCode() != PDG_t::kGamma) continue; // Get Sigma0 index from photon mother - auto mothers = mcPhoton.mothersIds(); - if (mothers.empty()) // No mothers? Weird + auto const& photonMothers = mcPhoton.template mothers_as(); + if (photonMothers.empty()) // No mothers? Weird continue; - int sigmaIndex = mothers[0]; + // Assumption: first mother is the physical one + auto const& photonMother = photonMothers.front(); + int photonMotherIndex = photonMother.globalIndex(); // ------------------------------------------------------------ // Check 2: // Does this photon share the same mother as the Lambda? // ------------------------------------------------------------ - if (sigmaIndex == lambdaMotherIndex) { + if (photonMotherIndex == lambdaMotherIndex) { matchedPhotonId = daughterId; - matchedMotherIndex = sigmaIndex; + matchedMotherIndex = photonMotherIndex; MCinfo.EMCalClusterAmplitude = cluster.amplitudeA()[i]; break; // SUCCESS -> stop loop } @@ -1148,8 +1145,8 @@ struct sigma0builder { if (matchedPhotonId >= 0 && matchedMotherIndex >= 0) { - auto mcPhoton = mcparticles.iteratorAt(matchedPhotonId); - auto mcSigma = mcparticles.iteratorAt(matchedMotherIndex); + auto mcPhoton = mcparticles.rawIteratorAt(matchedPhotonId); + auto mcSigma = mcparticles.rawIteratorAt(matchedMotherIndex); // --- Pair (Sigma0) information MCinfo.fV0PairProducedByGenerator = mcSigma.producedByGenerator(); @@ -1172,7 +1169,7 @@ struct sigma0builder { MCinfo.V01PDGCode = mcPhoton.pdgCode(); if (!mcPhoton.mothersIds().empty()) { - auto mcMother = mcparticles.iteratorAt(mcPhoton.mothersIds()[0]); + auto mcMother = mcparticles.rawIteratorAt(mcPhoton.mothersIds()[0]); MCinfo.V01PDGCodeMother = mcMother.pdgCode(); } @@ -2405,7 +2402,7 @@ struct sigma0builder { // Momentum components float gammapx = gammapT * std::cos(gamma.phi()); float gammapy = gammapT * std::sin(gamma.phi()); - float gammapz = gammapT * std::sinh(gamma.phi()); + float gammapz = gammapT * std::sinh(gamma.eta()); //_______________________________________________ // Sigma0 pre-selections diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index fd6b48609e1..8e0b65f125a 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -41,10 +41,8 @@ #include "ReconstructionDataFormats/Track.h" #include -#include #include #include -#include #include #include @@ -258,6 +256,7 @@ struct sigmaanalysis { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisInvPt{"axisInvPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 5.0, 10.0, 20.0, 50.0}, ""}; ConfigurableAxis axisDeltaPt{"axisDeltaPt", {400, -50.0, 50.0}, ""}; + ConfigurableAxis axisReso{"axisReso", {400, -2.0, 2.0}, ""}; ConfigurableAxis axisRapidity{"axisRapidity", {100, -2.0f, 2.0f}, "Rapidity"}; ConfigurableAxis axisIRBinning{"axisIRBinning", {150, 0, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "N_{ch}"}; @@ -502,18 +501,16 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); // pT Resolution: - if (fillResoQAhistos && histodir == "BeforeSel") { - histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + if (fillResoQAhistos) { + histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dAntiLambdaPtResolution", "h2dAntiLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); } @@ -1003,52 +1000,55 @@ struct sigmaanalysis { return TrkCode; } - template + template void getResolution(TSigma0Object const& sigma) { + // Check whether it is before or after selections + static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; + //_______________________________________ // Gamma MC association - if (sigma.photonPDGCode() == 22) { + if (sigma.photonPDGCode() == PDG_t::kGamma) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), sigma.photonPt() - sigma.photonmcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt() / sigma.photonmcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } //_______________________________________ // Lambda MC association - if (sigma.lambdaPDGCode() == 3122) { + if (sigma.lambdaPDGCode() == PDG_t::kLambda0) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // AntiLambda MC association - if (sigma.lambdaPDGCode() == -3122) { + if (sigma.lambdaPDGCode() == PDG_t::kLambda0Bar) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // Sigma and AntiSigma MC association if (sigma.isSigma0()) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), sigma.pt() - sigma.mcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt() / sigma.mcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } if (sigma.isAntiSigma0()) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) - histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } @@ -1072,24 +1072,24 @@ struct sigmaanalysis { //_______________________________________ // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! - if ((PhotonPDGCode == 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122)) && (!fIsSigma && !fIsAntiSigma)) { + if ((PhotonPDGCode == PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar)) && (!fIsSigma && !fIsAntiSigma)) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueDaughters"), sigmapT, sigmaMass); histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dTrueDaughtersMatrix"), LambdaPDGCodeMother, PhotonPDGCodeMother); } //_______________________________________ // Real Gamma x fake Lambda - if ((PhotonPDGCode == 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) + if ((PhotonPDGCode == PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueGammaFakeLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Real Lambda - if ((PhotonPDGCode != 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122))) + if ((PhotonPDGCode != PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar))) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeGammaTrueLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Fake Lambda - if ((PhotonPDGCode != 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) + if ((PhotonPDGCode != PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeDaughters"), sigmapT, sigmaMass); } @@ -1220,7 +1220,7 @@ struct sigmaanalysis { //_______________________________________ // MC specific - if (doprocessMonteCarlo) { + if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { if constexpr (requires { sigma.lambdaPDGCode(); sigma.photonPDGCode(); }) { if (fillSelhistos) { @@ -1302,8 +1302,8 @@ struct sigmaanalysis { //_______________________________________ // pT resolution histos - if ((mode == 0) && fillResoQAhistos) - getResolution(sigma); + if (fillResoQAhistos) + getResolution(sigma); } } } From a9ea146fddb13b42f26646c8e4a242ad167bccab Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:48:31 +0200 Subject: [PATCH 182/282] [PWGLF] Add BC table based centrality (#15657) --- .../heavyionMultiplicity.cxx | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index 5dd2ed61719..167db95f0e5 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -208,6 +208,10 @@ struct HeavyionMultiplicity { Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; + Configurable selectCollidingBCs{"selectCollidingBCs", true, "BC analysis: select colliding BCs"}; + Configurable selectTVX{"selectTVX", true, "BC analysis: select TVX"}; + Configurable selectFV0OrA{"selectFV0OrA", true, "BC analysis: select FV0OrA"}; + void init(InitContext const&) { AxisSpec axisMult = {multHistBin, "Mult", "MultAxis"}; @@ -357,6 +361,18 @@ struct HeavyionMultiplicity { histos.add("hRecMCdndeta", "hRecMCdndeta", kTHnSparseD, {axisVtxZ, centAxis, axisOccupancy, axisEta, axisPhi, axisRecTrkType}, false); histos.add("etaResolution", "etaResolution", kTH2D, {axisEta, axisDeltaEta}); } + + if (doprocessBcData) { + histos.add("BcHist", "BcHist", kTH1D, {axisEvent}, false); + auto hstat = histos.get(HIST("BcHist")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(1, "All BCs"); + x->SetBinLabel(2, "Colliding BCs"); + x->SetBinLabel(3, "TVX"); + x->SetBinLabel(4, "FV0OrA"); + histos.add("BcCentFT0CHist", "BcCentFT0CHist", kTH1D, {axisCent}, false); + histos.add("BcCentFT0MHist", "BcCentFT0MHist", kTH1D, {axisCent}, false); + } } template @@ -971,6 +987,22 @@ struct HeavyionMultiplicity { } // collision loop } + void processBcData(soa::Join::iterator const& multbc) + { + histos.fill(HIST("BcHist"), 1); // all BCs + if (selectCollidingBCs && !multbc.multCollidingBC()) + return; + histos.fill(HIST("BcHist"), 2); // colliding + if (selectTVX && !multbc.multTVX()) + return; + histos.fill(HIST("BcHist"), 3); // TVX + if (selectFV0OrA && !multbc.multFV0OrA()) + return; + histos.fill(HIST("BcHist"), 4); // FV0OrA + histos.fill(HIST("BcCentFT0CHist"), multbc.centFT0C()); + histos.fill(HIST("BcCentFT0MHist"), multbc.centFT0M()); + } + PROCESS_SWITCH(HeavyionMultiplicity, processData, "process data CentFT0C", false); PROCESS_SWITCH(HeavyionMultiplicity, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(HeavyionMultiplicity, processMonteCarlo, "process MC CentFT0C", false); @@ -979,6 +1011,7 @@ struct HeavyionMultiplicity { PROCESS_SWITCH(HeavyionMultiplicity, processGen, "process pure MC gen", false); PROCESS_SWITCH(HeavyionMultiplicity, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); PROCESS_SWITCH(HeavyionMultiplicity, processMCeff, "process extra efficiency function", false); + PROCESS_SWITCH(HeavyionMultiplicity, processBcData, "process BC Centrality", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From dbb91a1840eb157e01d9535dad7f36581360e668 Mon Sep 17 00:00:00 2001 From: basiach <74355517+basiach@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:09:34 +0200 Subject: [PATCH 183/282] [PWGCF] FemtoUniverse: Fixing cascade QA plots to match true selection (#15661) Co-authored-by: Barbara Chytla Co-authored-by: ALICE Action Bot --- ...toUniversePairTaskTrackCascadeExtended.cxx | 124 +++++++++++------- 1 file changed, 77 insertions(+), 47 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 8f4a3285866..9166d4dc0e7 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -153,7 +153,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseDetaDphiStar pairCloseRejectionCasc; - HistogramRegistry rXiQA{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry CascQAExtra{"CascQAExtra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registryMCgen{"MCgenHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -264,23 +264,23 @@ struct femtoUniversePairTaskTrackCascadeExtended { AxisSpec multAxis = {multBinning, "Multiplicity"}; // Histograms - rXiQA.add("hMassXi", "hMassXi", {HistType::kTH1F, {aXiMassAxis}}); - rXiQA.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {aXiMassAxis}}); - rXiQA.add("hPtXi", "hPtXi", {HistType::kTH1F, {{ptAxis}}}); - rXiQA.add("hEtaXi", "hEtaXi", {HistType::kTH1F, {{etaAxis}}}); - rXiQA.add("hPhiXi", "hPhiXi", {HistType::kTH1F, {{phiAxis}}}); - rXiQA.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {aDCADaughAxis}}); - rXiQA.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {aCPAAxis}}); - rXiQA.add("hV0TranRad", "hV0TranRad", {HistType::kTH1F, {tranRadAxis}}); - rXiQA.add("hDCACascDaughters", "hDCACascDaughters", {HistType::kTH1F, {aDCADaughAxis}}); - rXiQA.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {aCPAAxis}}); - rXiQA.add("hCascTranRad", "hCascTranRad", {HistType::kTH1F, {tranRadAxis}}); - rXiQA.add("hDcaPostoPV", "hDcaPostoPV", {HistType::kTH1F, {aDCAToPVAxis}}); - rXiQA.add("hDcaNegtoPV", "hDcaNegtoPV", {HistType::kTH1F, {aDCAToPVAxis}}); - rXiQA.add("hDcaBachtoPV", "hDcaBachtoPV", {HistType::kTH1F, {aDCAToPVAxis}}); - rXiQA.add("hDcaV0toPV", "hDcaV0toPV", {HistType::kTH1F, {aDCAToPVAxis}}); - rXiQA.add("hInvMpT", "hInvMpT", kTH2F, {{ptAxis}, {aXiMassAxis}}); - rXiQA.add("hInvMpTmult", "hInvMpTmult", kTH3F, {{ptAxis}, {aXiMassAxis}, {multAxis}}); + CascQAExtra.add("hMassXi", "hMassXi", {HistType::kTH1F, {aXiMassAxis}}); + CascQAExtra.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {aXiMassAxis}}); + CascQAExtra.add("hPtXi", "hPtXi", {HistType::kTH1F, {{ptAxis}}}); + CascQAExtra.add("hEtaXi", "hEtaXi", {HistType::kTH1F, {{etaAxis}}}); + CascQAExtra.add("hPhiXi", "hPhiXi", {HistType::kTH1F, {{phiAxis}}}); + CascQAExtra.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {aDCADaughAxis}}); + CascQAExtra.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {aCPAAxis}}); + CascQAExtra.add("hV0TranRad", "hV0TranRad", {HistType::kTH1F, {tranRadAxis}}); + CascQAExtra.add("hDCACascDaughters", "hDCACascDaughters", {HistType::kTH1F, {aDCADaughAxis}}); + CascQAExtra.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {aCPAAxis}}); + CascQAExtra.add("hCascTranRad", "hCascTranRad", {HistType::kTH1F, {tranRadAxis}}); + CascQAExtra.add("hDcaPostoPV", "hDcaPostoPV", {HistType::kTH1F, {aDCAToPVAxis}}); + CascQAExtra.add("hDcaNegtoPV", "hDcaNegtoPV", {HistType::kTH1F, {aDCAToPVAxis}}); + CascQAExtra.add("hDcaBachtoPV", "hDcaBachtoPV", {HistType::kTH1F, {aDCAToPVAxis}}); + CascQAExtra.add("hDcaV0toPV", "hDcaV0toPV", {HistType::kTH1F, {aDCAToPVAxis}}); + CascQAExtra.add("hInvMpT", "hInvMpT", kTH2F, {{ptAxis}, {aXiMassAxis}}); + CascQAExtra.add("hInvMpTmult", "hInvMpTmult", kTH3F, {{ptAxis}, {aXiMassAxis}, {multAxis}}); eventHisto.init(&qaRegistry); /// nSigma debug histograms for the selected particle species only i.e. not sigmas of all particles mixed together @@ -376,44 +376,68 @@ struct femtoUniversePairTaskTrackCascadeExtended { } } - void processCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const FemtoFullParticles& parts, const aod::FDCascParticles& fdcascs) + template + using hasSigma = decltype(std::declval().tpcNSigmaStorePr()); + + // Additional cascade QA plots + template + void doCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const TableType& parts, PartitionType& partsTwo, const aod::FDCascParticles& fdcascs) { - for (const auto& casc : fdcascs) { - const auto& part = casc.fdParticle_as(); - rXiQA.fill(HIST("hMassXi"), part.mLambda()); + auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + // Basic particle loop + for (const auto& part : groupPartsTwo) { + CascQAExtra.fill(HIST("hMassXi"), part.mLambda()); const auto& posChild = parts.iteratorAt(part.globalIndex() - 3 - parts.begin().globalIndex()); const auto& negChild = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex()); const auto& bachelor = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex()); - float posChildTPC, negChildTPC, bachelorTPC, posChildTOF, negChildTOF, bachelorTOF; - if (!isParticleTPC(posChild, CascChildTable[confCascType1][0], &posChildTPC) || !isParticleTPC(negChild, CascChildTable[confCascType1][1], &negChildTPC) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2], &bachelorTPC)) - continue; + if constexpr (std::experimental::is_detected::value) { + float posChildTPC, negChildTPC, bachelorTPC, posChildTOF, negChildTOF, bachelorTOF; + if (!isParticleTPC(posChild, CascChildTable[confCascType1][0], &posChildTPC) || !isParticleTPC(negChild, CascChildTable[confCascType1][1], &negChildTPC) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2], &bachelorTPC)) + continue; - if (!isParticleTOF(posChild, CascChildTable[confCascType1][0], &posChildTOF) || !isParticleTOF(negChild, CascChildTable[confCascType1][1], &negChildTOF) || !isParticleTOF(bachelor, CascChildTable[confCascType1][2], &bachelorTOF)) - continue; + if (!isParticleTOF(posChild, CascChildTable[confCascType1][0], &posChildTOF) || !isParticleTOF(negChild, CascChildTable[confCascType1][1], &negChildTOF) || !isParticleTOF(bachelor, CascChildTable[confCascType1][2], &bachelorTOF)) + continue; + + CascQAExtra.fill(HIST("hPtXi"), part.pt()); + CascQAExtra.fill(HIST("hEtaXi"), part.eta()); + CascQAExtra.fill(HIST("hPhiXi"), part.phi()); + CascQAExtra.fill(HIST("hMassXiSelected"), part.mLambda()); + CascQAExtra.fill(HIST("hInvMpT"), part.pt(), part.mLambda()); + } + } + + // Cascade extended table loop + for (const auto& casc : fdcascs) { + const auto& part = casc.fdParticle_as(); - rXiQA.fill(HIST("hPtXi"), part.pt()); - rXiQA.fill(HIST("hEtaXi"), part.eta()); - rXiQA.fill(HIST("hPhiXi"), part.phi()); - rXiQA.fill(HIST("hMassXiSelected"), part.mLambda()); - rXiQA.fill(HIST("hDCAV0Daughters"), casc.dcaV0daughters()); - rXiQA.fill(HIST("hV0CosPA"), casc.cpav0()); - rXiQA.fill(HIST("hV0TranRad"), casc.v0radius()); - rXiQA.fill(HIST("hCascCosPA"), casc.cpaCasc()); - rXiQA.fill(HIST("hDCACascDaughters"), casc.dcacascdaughters()); - rXiQA.fill(HIST("hCascTranRad"), casc.cascradius()); - rXiQA.fill(HIST("hDcaPostoPV"), casc.dcapostopv()); - rXiQA.fill(HIST("hDcaNegtoPV"), casc.dcanegtopv()); - rXiQA.fill(HIST("hDcaBachtoPV"), casc.dcabachtopv()); - rXiQA.fill(HIST("hDcaV0toPV"), casc.dcav0topv()); - rXiQA.fill(HIST("hInvMpT"), part.pt(), part.mLambda()); + const auto& posChildExt = parts.iteratorAt(part.globalIndex() - 3 - parts.begin().globalIndex()); + const auto& negChildExt = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex()); + const auto& bachelorExt = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex()); + + if constexpr (std::experimental::is_detected::value) { + float posChildTPCExt, negChildTPCExt, bachelorTPCExt, posChildTOFExt, negChildTOFExt, bachelorTOFExt; + if (!isParticleTPC(posChildExt, CascChildTable[confCascType1][0], &posChildTPCExt) || !isParticleTPC(negChildExt, CascChildTable[confCascType1][1], &negChildTPCExt) || !isParticleTPC(bachelorExt, CascChildTable[confCascType1][2], &bachelorTPCExt)) + continue; + + if (!isParticleTOF(posChildExt, CascChildTable[confCascType1][0], &posChildTOFExt) || !isParticleTOF(negChildExt, CascChildTable[confCascType1][1], &negChildTOFExt) || !isParticleTOF(bachelorExt, CascChildTable[confCascType1][2], &bachelorTOFExt)) + continue; + + CascQAExtra.fill(HIST("hDCAV0Daughters"), casc.dcaV0daughters()); + CascQAExtra.fill(HIST("hV0CosPA"), casc.cpav0()); + CascQAExtra.fill(HIST("hV0TranRad"), casc.v0radius()); + CascQAExtra.fill(HIST("hCascCosPA"), casc.cpaCasc()); + CascQAExtra.fill(HIST("hDCACascDaughters"), casc.dcacascdaughters()); + CascQAExtra.fill(HIST("hCascTranRad"), casc.cascradius()); + CascQAExtra.fill(HIST("hDcaPostoPV"), casc.dcapostopv()); + CascQAExtra.fill(HIST("hDcaNegtoPV"), casc.dcanegtopv()); + CascQAExtra.fill(HIST("hDcaBachtoPV"), casc.dcabachtopv()); + CascQAExtra.fill(HIST("hDcaV0toPV"), casc.dcav0topv()); + } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascadeQA, "Enable processing cascades", false); - - template - using hasSigma = decltype(std::declval().tpcNSigmaStorePr()); /// track - cascade correlations template @@ -474,7 +498,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { bachHistos.fillQABase(bachelor, HIST("hBachelor")); cascQAHistos.fillQA(part); } - rXiQA.fill(HIST("hInvMpTmult"), part.pt(), part.mLambda(), multCol); + CascQAExtra.fill(HIST("hInvMpTmult"), part.pt(), part.mLambda(), multCol); } for (const auto& part : groupPartsOne) { @@ -557,6 +581,12 @@ struct femtoUniversePairTaskTrackCascadeExtended { } } + void processCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const FemtoFullParticles& parts, const aod::FDCascParticles& fdcascs) + { + doCascadeQA(col, parts, partsTwoFull, fdcascs); + } + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascadeQA, "Enable additional QA for cascades", false); + void processSameEvent(const FilteredFDCollision& col, const FemtoFullParticles& parts) { doSameEvent(col, parts, partsOneFull, partsTwoFull); From d26ca498c1b15886f6bab9a89e1796a5d617f0fd Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:04:11 +0530 Subject: [PATCH 184/282] [PWGCF] Update lambdaR2Correlation.cxx (#15645) --- .../Tasks/lambdaR2Correlation.cxx | 472 +++++++----------- 1 file changed, 178 insertions(+), 294 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 0d0d75c58bb..9bffe9debd0 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -75,9 +75,6 @@ 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(PrPx, prPx, float); -DECLARE_SOA_COLUMN(PrPy, prPy, float); -DECLARE_SOA_COLUMN(PrPz, prPz, float); DECLARE_SOA_COLUMN(PosTrackId, posTrackId, int64_t); DECLARE_SOA_COLUMN(NegTrackId, negTrackId, int64_t); DECLARE_SOA_COLUMN(CosPA, cosPA, float); @@ -96,9 +93,6 @@ DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::Phi, lambdatrack::Rap, lambdatrack::Mass, - lambdatrack::PrPx, - lambdatrack::PrPy, - lambdatrack::PrPz, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::CosPA, @@ -135,9 +129,6 @@ DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::Phi, lambdatrack::Rap, lambdatrack::Mass, - lambdatrack::PrPx, - lambdatrack::PrPy, - lambdatrack::PrPz, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, @@ -146,7 +137,6 @@ DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::V0PrmScd, lambdatrack::CorrFact); using LambdaMcGenTrack = LambdaMcGenTracks::iterator; - } // namespace o2::aod enum CollisionLabels { @@ -239,16 +229,19 @@ enum PrmScdPairType { }; struct LambdaTableProducer { - + // Table Producers Produces lambdaCollisionTable; Produces lambdaTrackTable; Produces lambdaMCGenCollisionTable; Produces lambdaMCGenTrackTable; + // Centrality Axis + ConfigurableAxis cCentBins{"cCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 50.f, 80.0f, 100.f}, "Variable Centrality Bins"}; + // Collisions - Configurable cCentEstimator{"cCentEstimator", 0, "Centrality Estimator : 0-FT0M, 1-FT0C"}; - Configurable cMinZVtx{"cMinZVtx", -10.0, "Min VtxZ cut"}; - Configurable cMaxZVtx{"cMaxZVtx", 10.0, "Max VtxZ cut"}; + Configurable cCentEstimator{"cCentEstimator", 1, "Centrality Estimator : 0-FT0M, 1-FT0C"}; + Configurable cMinZVtx{"cMinZVtx", -7.0, "Min VtxZ cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 7.0, "Max VtxZ cut"}; Configurable cMinMult{"cMinMult", 0., "Minumum Multiplicity"}; Configurable cMaxMult{"cMaxMult", 100.0, "Maximum Multiplicity"}; Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; @@ -263,15 +256,13 @@ struct LambdaTableProducer { Configurable cIsGoodITSLayers{"cIsGoodITSLayers", false, "Good ITS Layers All"}; // Tracks - Configurable cTrackMinPt{"cTrackMinPt", 0.15, "p_{T} minimum"}; + Configurable cTrackMinPt{"cTrackMinPt", 0.1, "p_{T} minimum"}; Configurable cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} maximum"}; Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "TPC Min Crossed Rows"}; - Configurable cMinTpcCROverCls{"cMinTpcCROverCls", 0.8, "Tpc Min Crossed Rows Over Findable Clusters"}; - Configurable cMaxTpcSharedClusters{"cMaxTpcSharedClusters", 0.4, "Tpc Max Shared Clusters"}; - Configurable cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"}; Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"}; Configurable cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"}; + Configurable cMatchEfficiency{"cMatchEfficiency", false, "Get Matching Efficiency"}; // V0s Configurable cMinDcaProtonToPV{"cMinDcaProtonToPV", 0.02, "Minimum Proton DCAr to PV"}; @@ -289,35 +280,35 @@ struct LambdaTableProducer { Configurable cKshortRejFlag{"cKshortRejFlag", true, "K0short Mass Rej Flag"}; // V0s kinmatic acceptance - Configurable cMinV0Mass{"cMinV0Mass", 1.10, "V0 Mass Min"}; - Configurable cMaxV0Mass{"cMaxV0Mass", 1.12, "V0 Mass Min"}; - Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; - Configurable cMaxV0Pt{"cMaxV0Pt", 4.2, "Minimum V0 pT"}; + Configurable cV0MassWindow{"cV0MassWindow", 0.007, "V0 Mass Window"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.6, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 3.6, "Minimum V0 pT"}; Configurable cMaxV0Rap{"cMaxV0Rap", 0.5, "|rap| cut"}; Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Do Eta Analysis"}; - Configurable cV0TypeSelFlag{"cV0TypeSelFlag", false, "V0 Type Selection Flag"}; + Configurable cV0TypeSelFlag{"cV0TypeSelFlag", true, "V0 Type Selection Flag"}; Configurable cV0TypeSelection{"cV0TypeSelection", 1, "V0 Type Selection"}; // V0s MC Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; - Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; - Configurable cSelMCPSV0{"cSelMCPSV0", true, "Select Primary/Secondary V0"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", false, "Select True Lambda"}; + Configurable cSelMCPSV0{"cSelMCPSV0", false, "Select Primary/Secondary V0"}; Configurable cCheckRecoDauFlag{"cCheckRecoDauFlag", true, "Check for reco daughter PID"}; Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; Configurable cGenSecondaryLambda{"cGenSecondaryLambda", false, "Secondary Generated Lambda"}; Configurable cGenDecayChannel{"cGenDecayChannel", true, "Gen Level Decay Channel Flag"}; - Configurable cRecoMomResoFlag{"cRecoMomResoFlag", false, "Check effect of momentum space smearing on balance function"}; // Efficiency Correction Configurable cCorrectionFlag{"cCorrectionFlag", false, "Correction Flag"}; Configurable cGetEffFact{"cGetEffFact", false, "Get Efficiency Factor Flag"}; Configurable cGetPrimFrac{"cGetPrimFrac", false, "Get Primary Fraction Flag"}; + Configurable cGetMatchEff{"cGetMatchEff", false, "Get Matching Efficiency Flag"}; Configurable cCorrFactHist{"cCorrFactHist", 0, "Efficiency Factor Histogram"}; Configurable cPrimFracHist{"cPrimFracHist", 0, "Primary Fraction Histogram"}; // 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"}; + Configurable cUrlCCDB{"cUrlCCDB", "http://alice-ccdb.cern.ch", "ALICE CCDB URL"}; + Configurable cPathCCDB{"cPathCCDB", "Users/y/ypatley/LHC22oPass7/LambdaCorrectionFactor", "Path for ccdb-object"}; + Configurable cPathCCDBMatchEff{"cPathCCDBMatchEff", "Users/y/ypatley/LHC22oPass7/ITSTPCMatchEff", "Path for ccdb-object for matching efficiency"}; // Initialize CCDB Service Service ccdb; @@ -337,7 +328,6 @@ struct LambdaTableProducer { // Initialize Global Variables float cent = 0., mult = 0.; - float pt = 0., eta = 0., rap = 0., phi = 0.; void init(InitContext const&) { @@ -348,7 +338,9 @@ struct LambdaTableProducer { // initialize axis specifications const AxisSpec axisCols(5, 0.5, 5.5, ""); const AxisSpec axisTrks(30, 0.5, 30.5, ""); - const AxisSpec axisCent(100, 0, 100, "FT0M (%)"); + const AxisSpec axisCent(100, 0, 100, "Centrality(%)"); + const AxisSpec axisVarCent(cCentBins, "FT0C%"); + const AxisSpec axisPVMults(1000, 0, 1000, "N_{PV}"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); const AxisSpec axisPID(8000, -4000, 4000, "PdgCode"); @@ -369,6 +361,7 @@ struct LambdaTableProducer { const AxisSpec axisAlpha(40, -1, 1, "#alpha"); const AxisSpec axisQtarm(40, 0, 0.4, "q_{T}"); + const AxisSpec axisITSTPCTrackPt(100, 0, 10, "p_{T} (GeV/#it{c})"); const AxisSpec axisTrackPt(40, 0, 4, "p_{T} (GeV/#it{c})"); const AxisSpec axisTrackDCA(200, -1, 1, "dca_{XY} (cm)"); const AxisSpec axisMomPID(80, 0, 4, "p (GeV/#it{c})"); @@ -379,6 +372,7 @@ struct LambdaTableProducer { // Event histograms histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCols}); histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + histos.add("Events/h2f_pvmult_vs_cent", "PVMult Vs Cent", kTH2F, {axisCent, axisPVMults}); // QA histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisTrks}); @@ -386,6 +380,11 @@ struct LambdaTableProducer { 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}); + histos.add("Tracks/h2f_track_tpccrossedrows", "Crossed rows TPC", kTH2F, {axisTrackPt, {260, 0, 260}}); + histos.add("Tracks/h2f_track_chisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("Tracks/h2f_track_chisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("Tracks/h2f_itstrack_centpt", "h2f_itstrack_centpt", kTH2F, {axisVarCent, axisITSTPCTrackPt}); + histos.add("Tracks/h2f_itstpctrack_centpt", "h2f_itstpctrack_centpt", kTH2F, {axisVarCent, axisITSTPCTrackPt}); // QA Lambda histos.add("QA/Lambda/h2f_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); @@ -404,6 +403,10 @@ struct LambdaTableProducer { 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_xisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("QA/Lambda/h2f_pos_prong_xisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("QA/Lambda/h2f_neg_prong_xisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("QA/Lambda/h2f_neg_prong_xisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); 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}); @@ -429,7 +432,8 @@ struct LambdaTableProducer { // McReco Histos 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_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_primary_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_secondary_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos histos.add("McGen/h1f_collision_recgen", "# of Reco Collision Associated to One Mc Generator Collision", kTH1F, {axisMult}); @@ -548,7 +552,7 @@ struct LambdaTableProducer { } // Set Multiplicity - mult = col.multNTracksPV(); + mult = col.multTPC(); return true; } @@ -575,18 +579,6 @@ struct LambdaTableProducer { return false; } - if (track.tpcCrossedRowsOverFindableCls() < cMinTpcCROverCls) { - return false; - } - - if (track.tpcNClsShared() > cMaxTpcSharedClusters) { - return false; - } - - if (track.tpcChi2NCl() > cMaxChi2Tpc) { - return false; - } - return true; } @@ -693,13 +685,13 @@ struct LambdaTableProducer { bool lambdaFlag = false, antiLambdaFlag = false; // get v0 track as lambda - if ((v0.mLambda() > cMinV0Mass && v0.mLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + if ((std::abs(v0.mLambda() - MassLambda0) <= cV0MassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { lambdaFlag = true; v0type = kLambda; } // get v0 track as anti-lambda - if ((v0.mAntiLambda() > cMinV0Mass && v0.mAntiLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + if (((std::abs(v0.mAntiLambda() - MassLambda0) <= cV0MassWindow)) && (selLambdaDauWithTpcPid(postrack, negtrack))) { antiLambdaFlag = true; v0type = kAntiLambda; } @@ -842,8 +834,8 @@ struct LambdaTableProducer { return true; } - template - float getCorrectionFactors(V const& v0) + template + float getCorrectionFactors(V const& v0, T const&) { // Check for efficiency correction flag if (!cCorrectionFlag) { @@ -860,7 +852,7 @@ struct LambdaTableProducer { } // initialize efficiency factor and primary fraction values - float effCorrFact = 1., primFrac = 1.; + float effCorrFact = 1., primFrac = 1., matchEffFact = 1.; float rap = (cDoEtaAnalysis) ? v0.eta() : v0.yLambda(); // Get Efficiency Factor @@ -900,15 +892,31 @@ struct LambdaTableProducer { delete histPrm; } - return primFrac * effCorrFact; + // Get Matching Efficiency Correction + if (cGetMatchEff) { + auto posTrack = v0.template posTrack_as(); + auto negTrack = v0.template negTrack_as(); + auto ccdbObjMatchEff = ccdb->getForTimeStamp(cPathCCDBMatchEff.value, -1); + TObject* objMatchEff = reinterpret_cast(ccdbObjMatchEff->FindObject("hITSTPCMatchingEfficiency")); + TH1F* histMatchEff = reinterpret_cast(objMatchEff->Clone()); + float posTrackMatchEff = histMatchEff->GetBinContent(histMatchEff->FindBin(cent, posTrack.pt())); + float negTrackMatchEff = histMatchEff->GetBinContent(histMatchEff->FindBin(cent, negTrack.pt())); + matchEffFact = posTrackMatchEff * negTrackMatchEff; + } + + return primFrac * effCorrFact * matchEffFact; } template - void fillLambdaMothers(V const& v0, T const&) + void fillLambdaMothers(V const& v0, T const&, PrmScdType const& ps) { auto mcpart = v0.template mcParticle_as(); auto lambdaMothers = mcpart.template mothers_as(); - histos.fill(HIST("Tracks/h2f_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + if (ps == kPrimary) { + histos.fill(HIST("Tracks/h2f_primary_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + } else { + histos.fill(HIST("Tracks/h2f_secondary_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + } } template @@ -946,9 +954,13 @@ struct LambdaTableProducer { 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("h2f_pos_prong_xisqperclusterits"), postrack.pt(), postrack.itsChi2NCl()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_xisqperclustertpc"), postrack.pt(), postrack.tpcChi2NCl()); 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_neg_prong_xisqperclusterits"), negtrack.pt(), negtrack.itsChi2NCl()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_xisqperclustertpc"), negtrack.pt(), negtrack.tpcChi2NCl()); 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()); @@ -973,6 +985,27 @@ struct LambdaTableProducer { histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPhi"), phi); } + template + void getMatchEffHist(T const& tracks) + { + for (auto const& track : tracks) { + if constexpr (dmc == kMC) { // Check corresponding MC particle + if (!track.has_mcParticle()) { + continue; + } + } + if (track.pt() <= cTrackMinPt && std::abs(track.eta()) >= cTrackEtaCut) { // Kinematic selection + continue; + } + if (track.hasITS()) { // ITS only track + histos.fill(HIST("Tracks/h2f_itstrack_centpt"), cent, track.pt()); + } + if (track.hasITS() && track.hasTPC()) { // ITS + TPC track + histos.fill(HIST("Tracks/h2f_itstpctrack_centpt"), cent, track.pt()); + } + } + } + // Reconstructed Level Tables template void fillLambdaRecoTables(C const& collision, V const& v0tracks, T const& tracks) @@ -987,8 +1020,10 @@ struct LambdaTableProducer { } } + // Fill Collision Histograms histos.fill(HIST("Events/h1f_collisions_info"), kPassSelCol); histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); + histos.fill(HIST("Events/h2f_pvmult_vs_cent"), cent, collision.multNTracksPV()); // Fill Collision Table lambdaCollisionTable(cent, mult, collision.posX(), collision.posY(), collision.posZ()); @@ -997,13 +1032,17 @@ struct LambdaTableProducer { ParticleType v0Type = kLambda; PrmScdType v0PrmScdType = kPrimary; float mass = 0., corr_fact = 1.; - float prPx = 0., prPy = 0., prPz = 0.; + // Loop over V0s for (auto const& v0 : v0tracks) { + // daugthers + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + // check for corresponding MCGen Particle if constexpr (dmc == kMC) { histos.fill(HIST("Tracks/h1f_tracks_info"), kTracksBeforeHasMcParticle); - if (!v0.has_mcParticle()) { + if (!v0.has_mcParticle() || !postrack.has_mcParticle() || !negtrack.has_mcParticle()) { // check corresponding MC particle continue; } } @@ -1021,7 +1060,7 @@ struct LambdaTableProducer { continue; } - // we have v0 as lambda + // We have v0 as lambda histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed); // Remove lambda with ambiguous daughters (Only for run3) @@ -1033,10 +1072,6 @@ struct LambdaTableProducer { // Get Lambda mass and kinematic variables mass = (v0Type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); - pt = v0.pt(); - eta = v0.eta(); - rap = v0.yLambda(); - phi = v0.phi(); // do MC analysis if constexpr (dmc == kMC) { @@ -1053,46 +1088,23 @@ struct LambdaTableProducer { } // get mothers information - if (v0PrmScdType == kSecondary) { - fillLambdaMothers(v0, tracks); - } + fillLambdaMothers(v0, tracks, v0PrmScdType); histos.fill(HIST("Tracks/h1f_tracks_info"), kPassTrueLambdaSel); histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); - - if (cRecoMomResoFlag) { - auto mc = v0.template mcParticle_as(); - pt = mc.pt(); - eta = mc.eta(); - rap = mc.y(); - phi = mc.phi(); - float y = (cDoEtaAnalysis) ? eta : rap; - // apply kinematic selection (On Truth) - if (!kinCutSelection(pt, std::abs(y), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { - continue; - } - } } histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); // get correction factors - corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0) : getCorrectionFactors(v0); + corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0, tracks) : getCorrectionFactors(v0, tracks); // fill lambda qa if (v0Type == kLambda) { - // Assign proton Eta Phi - prPx = v0.template posTrack_as().px(); - prPy = v0.template posTrack_as().py(); - prPz = v0.template posTrack_as().pz(); histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); fillLambdaQAHistos(collision, v0, tracks); fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); } else { - // Assign proton Eta Phi - prPx = v0.template negTrack_as().px(); - prPy = v0.template negTrack_as().py(); - prPz = v0.template negTrack_as().pz(); histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); fillLambdaQAHistos(collision, v0, tracks); fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); @@ -1100,7 +1112,7 @@ struct LambdaTableProducer { // Fill Lambda/AntiLambda Table lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), - pt, eta, phi, rap, mass, prPx, prPy, prPz, + v0.pt(), v0.eta(), v0.phi(), v0.yLambda(), mass, v0.template posTrack_as().index(), v0.template negTrack_as().index(), v0.v0cosPA(), v0.dcaV0daughters(), (int8_t)v0Type, v0PrmScdType, corr_fact); } @@ -1117,8 +1129,8 @@ struct LambdaTableProducer { ParticleType v0Type = kLambda; PrmScdType v0PrmScdType = kPrimary; float rap = 0.; - float prPx = 0., prPy = 0., prPz = 0.; + // Loop over MC particles for (auto const& mcpart : mcParticles) { // check for Lambda first if (mcpart.pdgCode() == kLambda0) { @@ -1158,7 +1170,6 @@ struct LambdaTableProducer { auto dautracks = mcpart.template daughters_as(); std::vector daughterPDGs, daughterIDs; std::vector vDauPt, vDauEta, vDauRap, vDauPhi; - std::vector vDauPx, vDauPy, vDauPz; for (auto const& dautrack : dautracks) { daughterPDGs.push_back(dautrack.pdgCode()); daughterIDs.push_back(dautrack.globalIndex()); @@ -1166,9 +1177,6 @@ struct LambdaTableProducer { vDauEta.push_back(dautrack.eta()); vDauRap.push_back(dautrack.y()); vDauPhi.push_back(dautrack.phi()); - vDauPx.push_back(dautrack.px()); - vDauPy.push_back(dautrack.py()); - vDauPz.push_back(dautrack.pz()); } if (cGenDecayChannel) { // check decay channel if (v0Type == kLambda) { @@ -1185,10 +1193,6 @@ struct LambdaTableProducer { histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaToPrPi); if (v0Type == kLambda) { - // Assign proton p-vec - prPx = vDauPx[0]; - prPy = vDauPy[0]; - prPz = vDauPz[0]; histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0]); histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1]); histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode()); @@ -1202,10 +1206,6 @@ struct LambdaTableProducer { histos.fill(HIST("McGen/Lambda/Pion/hPhi"), vDauPhi[1]); fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); } else { - // Assign anti-proton p-vec - prPx = vDauPx[1]; - prPy = vDauPy[1]; - prPz = vDauPz[1]; histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0]); histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1]); histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode()); @@ -1222,7 +1222,7 @@ struct LambdaTableProducer { // Fill Lambda McGen Table lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), - mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), prPx, prPy, prPz, + mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), daughterIDs[0], daughterIDs[1], (int8_t)v0Type, -999., -999., v0PrmScdType, 1.); } } @@ -1251,23 +1251,28 @@ struct LambdaTableProducer { fillLambdaMcGenTables(mcCollision, mcParticles); } - SliceCache cache; - Preslice> perCollision = aod::v0data::collisionId; - - using CollisionsRun3 = soa::Join; - using CollisionsRun2 = soa::Join; - using Tracks = soa::Join; - using TracksRun2 = soa::Join; + // Collision, tracks and V0s + using CollisionsRun3 = soa::Join; + using CollisionsRun2 = soa::Join; + using Tracks = soa::Join; + using TracksRun2 = soa::Join; using TracksMC = soa::Join; using TracksMCRun2 = soa::Join; using McV0Tracks = soa::Join; + SliceCache cache; + Preslice> perCollision = aod::v0data::collisionId; + + void processDummy(CollisionsRun3::iterator const&) {} + + PROCESS_SWITCH(LambdaTableProducer, processDummy, "Dummy Process", true); + void processDataRun3(CollisionsRun3::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) { fillLambdaRecoTables(collision, V0s, tracks); } - PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", true); + PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", false); void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, TracksRun2 const& tracks) { @@ -1276,6 +1281,18 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processDataRun2, "Process for Run2 DATA", false); + void processMatchEffData(CollisionsRun3::iterator const& collision, Tracks const& tracks) + { + // check collision + if (!selCollision(collision)) { + return; + } + // Get Matching Efficiency + getMatchEffHist(tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMatchEffData, "Process for Matching Efficieny Calculation", false); + void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&) { @@ -1300,6 +1317,18 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun2, "Process for Run2 McReco DATA", false); + void processMatchEffMCReco(soa::Join::iterator const& collision, aod::McCollisions const&, TracksMC const& tracks, aod::McParticles const&) + { + // check collision + if (!selCollision(collision)) { + return; + } + // Get Matching Efficiency + getMatchEffHist(tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMatchEffMCReco, "Process for Matching Efficieny Calculation at MC Reconstructed Level", false); + void processMCRun3(aod::McCollisions::iterator const& mcCollision, soa::SmallGroups> const& collisions, McV0Tracks const& V0s, TracksMC const& tracks, @@ -1383,9 +1412,12 @@ struct LambdaTracksExtProducer { } } - void process(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) - { + void processDummy(aod::LambdaCollisions::iterator const&) {} + PROCESS_SWITCH(LambdaTracksExtProducer, processDummy, "Dummy Process", true); + + void processLambdaTrackExt(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) + { int nTotLambda = 0, nTotAntiLambda = 0, nSelLambda = 0, nSelAntiLambda = 0; for (auto const& lambda : tracks) { @@ -1482,162 +1514,8 @@ struct LambdaTracksExtProducer { histos.fill(HIST("h1i_antilambda_mult"), nSelAntiLambda); } } -}; - -struct LambdaSpinCorrelation { - // Global Configurables - Configurable cNPtBins{"cNPtBins", 30, "N pT Bins"}; - Configurable cMinPt{"cMinPt", 0.5, "pT Min"}; - Configurable cMaxPt{"cMaxPt", 3.5, "pT Max"}; - Configurable cNRapBins{"cNRapBins", 10, "N Rapidity Bins"}; - Configurable cMinRap{"cMinRap", -0.5, "Minimum Rapidity"}; - Configurable cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"}; - Configurable cNPhiBins{"cNPhiBins", 36, "N Phi Bins"}; - Configurable cNBinsCosTS{"cNBinsCosTS", 10, "N CosTS Bins"}; - Configurable cInvBoostFlag{"cInvBoostFlag", true, "Inverse Boost Flag"}; - // Centrality Axis - ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; - - // Histogram Registry. - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // Global variables - float cent = 0.; - - void init(InitContext const&) - { - const AxisSpec axisCheck(1, 0, 1, ""); - const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); - const AxisSpec axisCent(cMultBins, "FT0M (%)"); - const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); - const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); - const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); - const AxisSpec axisPt(cNPtBins, cMinPt, cMaxPt, "p_{T} (GeV/#it{c})"); - const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta"); - const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); - const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#varphi (rad)"); - const AxisSpec axisDRap(2 * cNRapBins, cMinRap - cMaxRap, cMaxRap - cMinRap, "#Deltay"); - const AxisSpec axisDPhi(cNPhiBins, -PI, PI, "#Delta#varphi"); - const AxisSpec axisCosTS(cNBinsCosTS, -1, 1, "cos(#theta*)"); - const AxisSpec axisDR(10, 0, 2, "#DeltaR"); - - // Single and Two Particle Densities - // 1D Histograms - histos.add("Reco/h2f_n2_mass_LaPLaM", "m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - histos.add("Reco/h2f_n2_mass_LaPLaP", "m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - histos.add("Reco/h2f_n2_mass_LaMLaM", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - - // rho2 for C2 - histos.add("RecoCorr/h2f_n2_dlta_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR}); - histos.add("RecoCorr/h2f_n2_dlta_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR}); - histos.add("RecoCorr/h2f_n2_dlta_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_cphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_cphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_cphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_dphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); - histos.add("RecoCorr/h2f_n2_dphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); - histos.add("RecoCorr/h2f_n2_dphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); - } - - void getBoostVector(std::array const& p, std::array& v, bool inverseBoostFlag = true) - { - int n = p.size(); - for (int i = 0; i < n - 1; ++i) { - if (inverseBoostFlag) { - v[i] = -p[i] / RecoDecay::e(p[0], p[1], p[2], p[3]); - } else { - v[i] = p[i] / RecoDecay::e(p[0], p[1], p[2], p[3]); - } - } - } - - void boost(std::array& p, std::array const& b) - { - float e = RecoDecay::e(p[0], p[1], p[2], p[3]); - float b2 = b[0] * b[0] + b[1] * b[1] + b[2] * b[2]; - float gamma = 1. / std::sqrt(1 - b2); - float bp = b[0] * p[0] + b[1] * p[1] + b[2] * p[2]; - float gamma2 = b2 > 0 ? (gamma - 1.) / b2 : 0.; - - p[0] = p[0] + gamma2 * bp * b[0] + gamma * b[0] * e; - p[1] = p[1] + gamma2 * bp * b[1] + gamma * b[1] * e; - p[2] = p[2] + gamma2 * bp * b[2] + gamma * b[2] * e; - } - - template - void fillPairHistos(U& p1, U& p2) - { - static constexpr std::string_view SubDirHist[] = {"LaPLaM", "LaPLaP", "LaMLaM"}; - - // Fill lambda pair mass - histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt()); - float drap = p1.rap() - p2.rap(); - float dphi = RecoDecay::constrainAngle(p1.phi() - p2.phi(), -PI); - - // Get Lambda-Proton four-momentum - std::array l1 = {p1.px(), p1.py(), p1.pz(), MassLambda0}; - std::array l2 = {p2.px(), p2.py(), p2.pz(), MassLambda0}; - std::array pr1 = {p1.prPx(), p1.prPy(), p1.prPz(), MassProton}; - std::array pr2 = {p2.prPx(), p2.prPy(), p2.prPz(), MassProton}; - std::array v1, v2; - getBoostVector(l1, v1, cInvBoostFlag); - getBoostVector(l2, v2, cInvBoostFlag); - boost(pr1, v1); - boost(pr2, v2); - - std::array pr1tv = {pr1[0], pr1[1], pr1[2]}; - std::array pr2tv = {pr2[0], pr2[1], pr2[2]}; - float cphi = RecoDecay::dotProd(pr1tv, pr2tv) / (RecoDecay::sqrtSumOfSquares(pr1tv[0], pr1tv[1], pr1tv[2]) * RecoDecay::sqrtSumOfSquares(pr2tv[0], pr2tv[1], pr2tv[2])); - float prdphi = RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI); - float prdrap = RecoDecay::eta(pr1tv) - RecoDecay::eta(pr2tv); - float dr = std::sqrt(prdrap * prdrap + prdphi * prdphi); - - // Fill pair density - histos.fill(HIST("RecoCorr/h2f_n2_dphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI)); - histos.fill(HIST("RecoCorr/h2f_n2_cphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, cphi); - histos.fill(HIST("RecoCorr/h2f_n2_dlta_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, dr); - } - - template - void analyzePairs(T const& trks_1, T const& trks_2) - { - for (auto const& trk_1 : trks_1) { - for (auto const& trk_2 : trks_2) { - // check for same index for Lambda-Lambda / AntiLambda-AntiLambda - if (samelambda && ((trk_1.index() == trk_2.index()))) { - continue; - } - fillPairHistos(trk_1, trk_2); - } - } - } - - // Initialize tables - using LambdaCollisions = aod::LambdaCollisions; - using LambdaTracks = soa::Join; - - SliceCache cache; - Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); - Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); - - void processDummy(LambdaCollisions::iterator const&) {} - - PROCESS_SWITCH(LambdaSpinCorrelation, processDummy, "Dummy process", true); - - void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) - { - // assign centrality - cent = collision.cent(); - - auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - analyzePairs(lambdaTracks, antiLambdaTracks); - analyzePairs(lambdaTracks, lambdaTracks); - analyzePairs(antiLambdaTracks, antiLambdaTracks); - } - - PROCESS_SWITCH(LambdaSpinCorrelation, processDataReco, "Process for Data and MCReco", false); + PROCESS_SWITCH(LambdaTracksExtProducer, processLambdaTrackExt, "Process for lambda track extension", false); }; struct LambdaR2Correlation { @@ -1657,7 +1535,7 @@ struct LambdaR2Correlation { Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Eta/Rap Analysis Flag"}; // Centrality Axis - ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; + ConfigurableAxis cCentBins{"cCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -1691,7 +1569,7 @@ struct LambdaR2Correlation { const AxisSpec axisCheck(1, 0, 1, ""); const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); - const AxisSpec axisCent(cMultBins, "FT0M (%)"); + const AxisSpec axisCent(cCentBins, "FT0C (%)"); const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); @@ -1706,16 +1584,14 @@ struct LambdaR2Correlation { // Event 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/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTH2F, {axisCent, axisChMult}); - histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTH2F, {axisCent, axisMult}); - histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTH2F, {axisCent, axisMult}); + histos.add("Event/Reco/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTProfile, {axisCent}); + histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTProfile, {axisCent}); + histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTProfile, {axisCent}); // Efficiency Histograms // Single Particle Efficiencies histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); - histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); - histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRap}); histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRap}); @@ -1723,22 +1599,16 @@ struct LambdaR2Correlation { // 1D Histograms histos.add("Reco/Primary/h3f_n1_centmasspt_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisMass, axisPt}); histos.add("Reco/Primary/h3f_n1_centmasspt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisMass, axisPt}); - histos.add("Reco/Primary/h2f_n1_pt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); - histos.add("Reco/Primary/h2f_n1_pt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); - histos.add("Reco/Primary/h2f_n1_eta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisEta}); - histos.add("Reco/Primary/h2f_n1_eta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisEta}); - histos.add("Reco/Primary/h2f_n1_rap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisRap}); - histos.add("Reco/Primary/h2f_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisRap}); - histos.add("Reco/Primary/h2f_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPhi}); - histos.add("Reco/Primary/h2f_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPhi}); + histos.add("Reco/Primary/h4f_n1_ptrapphi_LaP", "#rho_{1}^{#Lambda}", kTHnSparseF, {axisCent, axisPt, axisRap, axisPhi}); + histos.add("Reco/Primary/h4f_n1_ptrapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRap, axisPhi}); // rho1 for R2 RapPhi histos.add("Reco/Primary/h3f_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisRap, axisPhi}); histos.add("Reco/Primary/h3f_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisPhi}); // rho1 for Q_{inv} - histos.add("Reco/Primary/h3f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); - histos.add("Reco/Primary/h3f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/h3f_n1_ptrapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRapPhi}); + histos.add("Reco/Primary/h3f_n1_ptrapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRapPhi}); // Clone Singles Primary/Secondary Histogram if (cAnaSecondaries) { @@ -1760,9 +1630,9 @@ struct LambdaR2Correlation { histos.add("Reco/PP/h3f_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); // rho2 for R2 Qinv - histos.add("Reco/PP/h2f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); - histos.add("Reco/PP/h2f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2F, {axisCent, axisQinv}); - histos.add("Reco/PP/h2f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h3f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); + histos.add("Reco/PP/h3f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); + histos.add("Reco/PP/h3f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); // Clone Pairs Histograms if (cAnaSecondaryPairs) { @@ -1779,6 +1649,21 @@ struct LambdaR2Correlation { } } + // Rap-Phi Bin Index + int getRapPhiBin(float const& rap, float const& phi) + { + int rapbin = static_cast((rap - kminrap) / rapbinwidth); + int phibin = static_cast(phi / phibinwidth); + + int rapphibin = -99; + if (rapbin >= 0 && phibin >= 0 && rapbin < nrapbins && phibin < nphibins) { + rapphibin = rapbin * nphibins + phibin; + return rapphibin; + } + + return rapphibin; + } + template void fillPairHistos(U& p1, U& p2) { @@ -1813,7 +1698,7 @@ struct LambdaR2Correlation { 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(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h2f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, qinv, corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, p1.pt(), getRapPhiBin(p1.rap(), p1.phi()), qinv, corfac); } template @@ -1831,21 +1716,17 @@ struct LambdaR2Correlation { // Efficiency Plots histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h2f_n1_centpt_") + HIST(SubDirHist[part]), cent, track.pt()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centpteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta()); histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centptrap_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap()); // QA Plots histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_centmasspt_") + HIST(SubDirHist[part]), cent, track.mass(), track.pt()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_pt_") + HIST(SubDirHist[part]), cent, track.pt(), track.corrFact()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_eta_") + HIST(SubDirHist[part]), cent, track.eta(), track.corrFact()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_phi_") + HIST(SubDirHist[part]), cent, track.phi(), track.corrFact()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_rap_") + HIST(SubDirHist[part]), cent, track.rap(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h4f_n1_ptrapphi_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap(), track.phi(), track.corrFact()); // Rho1 for N1RapPhi histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_rapphi_") + HIST(SubDirHist[part]), cent, track.rap(), track.phi(), track.corrFact()); - // Rho1 for Q_{inv} Bkg Estimation - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_pteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta(), track.corrFact()); + // Rho1 for Q_{inv} + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_ptrapphi_") + HIST(SubDirHist[part]), cent, track.pt(), getRapPhiBin(track.rap(), track.phi()), track.corrFact()); } // fill multiplicity histograms @@ -1881,6 +1762,10 @@ struct LambdaR2Correlation { Partition partSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); Partition partSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + void processDummy(aod::LambdaCollisions::iterator const&) {} + + PROCESS_SWITCH(LambdaR2Correlation, processDummy, "Dummy Process", true); + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) { histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); @@ -1923,7 +1808,7 @@ struct LambdaR2Correlation { } } - PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", false); using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; using LambdaMcGenTracks = aod::LambdaMcGenTracks; @@ -1984,6 +1869,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } From b0e28ad9a935d97ff5345f08b891c93cdd2f1ca1 Mon Sep 17 00:00:00 2001 From: wenyaCern <31894577+wenyaCern@users.noreply.github.com> Date: Mon, 6 Apr 2026 13:15:31 +0200 Subject: [PATCH 185/282] [PWGCF] Revert "[PWGCF] Update lambdaR2Correlation.cxx" (#15665) --- .../Tasks/lambdaR2Correlation.cxx | 472 +++++++++++------- 1 file changed, 294 insertions(+), 178 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 9bffe9debd0..0d0d75c58bb 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -75,6 +75,9 @@ 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(PrPx, prPx, float); +DECLARE_SOA_COLUMN(PrPy, prPy, float); +DECLARE_SOA_COLUMN(PrPz, prPz, float); DECLARE_SOA_COLUMN(PosTrackId, posTrackId, int64_t); DECLARE_SOA_COLUMN(NegTrackId, negTrackId, int64_t); DECLARE_SOA_COLUMN(CosPA, cosPA, float); @@ -93,6 +96,9 @@ DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::Phi, lambdatrack::Rap, lambdatrack::Mass, + lambdatrack::PrPx, + lambdatrack::PrPy, + lambdatrack::PrPz, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::CosPA, @@ -129,6 +135,9 @@ DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::Phi, lambdatrack::Rap, lambdatrack::Mass, + lambdatrack::PrPx, + lambdatrack::PrPy, + lambdatrack::PrPz, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, @@ -137,6 +146,7 @@ DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::V0PrmScd, lambdatrack::CorrFact); using LambdaMcGenTrack = LambdaMcGenTracks::iterator; + } // namespace o2::aod enum CollisionLabels { @@ -229,19 +239,16 @@ enum PrmScdPairType { }; struct LambdaTableProducer { - // Table Producers + Produces lambdaCollisionTable; Produces lambdaTrackTable; Produces lambdaMCGenCollisionTable; Produces lambdaMCGenTrackTable; - // Centrality Axis - ConfigurableAxis cCentBins{"cCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 50.f, 80.0f, 100.f}, "Variable Centrality Bins"}; - // Collisions - Configurable cCentEstimator{"cCentEstimator", 1, "Centrality Estimator : 0-FT0M, 1-FT0C"}; - Configurable cMinZVtx{"cMinZVtx", -7.0, "Min VtxZ cut"}; - Configurable cMaxZVtx{"cMaxZVtx", 7.0, "Max VtxZ cut"}; + Configurable cCentEstimator{"cCentEstimator", 0, "Centrality Estimator : 0-FT0M, 1-FT0C"}; + Configurable cMinZVtx{"cMinZVtx", -10.0, "Min VtxZ cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 10.0, "Max VtxZ cut"}; Configurable cMinMult{"cMinMult", 0., "Minumum Multiplicity"}; Configurable cMaxMult{"cMaxMult", 100.0, "Maximum Multiplicity"}; Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; @@ -256,13 +263,15 @@ struct LambdaTableProducer { Configurable cIsGoodITSLayers{"cIsGoodITSLayers", false, "Good ITS Layers All"}; // Tracks - Configurable cTrackMinPt{"cTrackMinPt", 0.1, "p_{T} minimum"}; + Configurable cTrackMinPt{"cTrackMinPt", 0.15, "p_{T} minimum"}; Configurable cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} maximum"}; Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "TPC Min Crossed Rows"}; + Configurable cMinTpcCROverCls{"cMinTpcCROverCls", 0.8, "Tpc Min Crossed Rows Over Findable Clusters"}; + Configurable cMaxTpcSharedClusters{"cMaxTpcSharedClusters", 0.4, "Tpc Max Shared Clusters"}; + Configurable cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"}; Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"}; Configurable cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"}; - Configurable cMatchEfficiency{"cMatchEfficiency", false, "Get Matching Efficiency"}; // V0s Configurable cMinDcaProtonToPV{"cMinDcaProtonToPV", 0.02, "Minimum Proton DCAr to PV"}; @@ -280,35 +289,35 @@ struct LambdaTableProducer { Configurable cKshortRejFlag{"cKshortRejFlag", true, "K0short Mass Rej Flag"}; // V0s kinmatic acceptance - Configurable cV0MassWindow{"cV0MassWindow", 0.007, "V0 Mass Window"}; - Configurable cMinV0Pt{"cMinV0Pt", 0.6, "Minimum V0 pT"}; - Configurable cMaxV0Pt{"cMaxV0Pt", 3.6, "Minimum V0 pT"}; + Configurable cMinV0Mass{"cMinV0Mass", 1.10, "V0 Mass Min"}; + Configurable cMaxV0Mass{"cMaxV0Mass", 1.12, "V0 Mass Min"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 4.2, "Minimum V0 pT"}; Configurable cMaxV0Rap{"cMaxV0Rap", 0.5, "|rap| cut"}; Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Do Eta Analysis"}; - Configurable cV0TypeSelFlag{"cV0TypeSelFlag", true, "V0 Type Selection Flag"}; + Configurable cV0TypeSelFlag{"cV0TypeSelFlag", false, "V0 Type Selection Flag"}; Configurable cV0TypeSelection{"cV0TypeSelection", 1, "V0 Type Selection"}; // V0s MC Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; - Configurable cSelectTrueLambda{"cSelectTrueLambda", false, "Select True Lambda"}; - Configurable cSelMCPSV0{"cSelMCPSV0", false, "Select Primary/Secondary V0"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; + Configurable cSelMCPSV0{"cSelMCPSV0", true, "Select Primary/Secondary V0"}; Configurable cCheckRecoDauFlag{"cCheckRecoDauFlag", true, "Check for reco daughter PID"}; Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; Configurable cGenSecondaryLambda{"cGenSecondaryLambda", false, "Secondary Generated Lambda"}; Configurable cGenDecayChannel{"cGenDecayChannel", true, "Gen Level Decay Channel Flag"}; + Configurable cRecoMomResoFlag{"cRecoMomResoFlag", false, "Check effect of momentum space smearing on balance function"}; // Efficiency Correction Configurable cCorrectionFlag{"cCorrectionFlag", false, "Correction Flag"}; Configurable cGetEffFact{"cGetEffFact", false, "Get Efficiency Factor Flag"}; Configurable cGetPrimFrac{"cGetPrimFrac", false, "Get Primary Fraction Flag"}; - Configurable cGetMatchEff{"cGetMatchEff", false, "Get Matching Efficiency Flag"}; Configurable cCorrFactHist{"cCorrFactHist", 0, "Efficiency Factor Histogram"}; Configurable cPrimFracHist{"cPrimFracHist", 0, "Primary Fraction Histogram"}; // CCDB - Configurable cUrlCCDB{"cUrlCCDB", "http://alice-ccdb.cern.ch", "ALICE CCDB URL"}; - Configurable cPathCCDB{"cPathCCDB", "Users/y/ypatley/LHC22oPass7/LambdaCorrectionFactor", "Path for ccdb-object"}; - Configurable cPathCCDBMatchEff{"cPathCCDBMatchEff", "Users/y/ypatley/LHC22oPass7/ITSTPCMatchEff", "Path for ccdb-object for matching efficiency"}; + 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; @@ -328,6 +337,7 @@ struct LambdaTableProducer { // Initialize Global Variables float cent = 0., mult = 0.; + float pt = 0., eta = 0., rap = 0., phi = 0.; void init(InitContext const&) { @@ -338,9 +348,7 @@ struct LambdaTableProducer { // initialize axis specifications const AxisSpec axisCols(5, 0.5, 5.5, ""); const AxisSpec axisTrks(30, 0.5, 30.5, ""); - const AxisSpec axisCent(100, 0, 100, "Centrality(%)"); - const AxisSpec axisVarCent(cCentBins, "FT0C%"); - const AxisSpec axisPVMults(1000, 0, 1000, "N_{PV}"); + const AxisSpec axisCent(100, 0, 100, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); const AxisSpec axisPID(8000, -4000, 4000, "PdgCode"); @@ -361,7 +369,6 @@ struct LambdaTableProducer { const AxisSpec axisAlpha(40, -1, 1, "#alpha"); const AxisSpec axisQtarm(40, 0, 0.4, "q_{T}"); - const AxisSpec axisITSTPCTrackPt(100, 0, 10, "p_{T} (GeV/#it{c})"); const AxisSpec axisTrackPt(40, 0, 4, "p_{T} (GeV/#it{c})"); const AxisSpec axisTrackDCA(200, -1, 1, "dca_{XY} (cm)"); const AxisSpec axisMomPID(80, 0, 4, "p (GeV/#it{c})"); @@ -372,7 +379,6 @@ struct LambdaTableProducer { // Event histograms histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCols}); histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("Events/h2f_pvmult_vs_cent", "PVMult Vs Cent", kTH2F, {axisCent, axisPVMults}); // QA histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisTrks}); @@ -380,11 +386,6 @@ struct LambdaTableProducer { 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}); - histos.add("Tracks/h2f_track_tpccrossedrows", "Crossed rows TPC", kTH2F, {axisTrackPt, {260, 0, 260}}); - histos.add("Tracks/h2f_track_chisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); - histos.add("Tracks/h2f_track_chisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); - histos.add("Tracks/h2f_itstrack_centpt", "h2f_itstrack_centpt", kTH2F, {axisVarCent, axisITSTPCTrackPt}); - histos.add("Tracks/h2f_itstpctrack_centpt", "h2f_itstpctrack_centpt", kTH2F, {axisVarCent, axisITSTPCTrackPt}); // QA Lambda histos.add("QA/Lambda/h2f_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); @@ -403,10 +404,6 @@ struct LambdaTableProducer { 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_xisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); - histos.add("QA/Lambda/h2f_pos_prong_xisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); - histos.add("QA/Lambda/h2f_neg_prong_xisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); - histos.add("QA/Lambda/h2f_neg_prong_xisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); 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}); @@ -432,8 +429,7 @@ struct LambdaTableProducer { // McReco Histos 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_primary_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("Tracks/h2f_secondary_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos histos.add("McGen/h1f_collision_recgen", "# of Reco Collision Associated to One Mc Generator Collision", kTH1F, {axisMult}); @@ -552,7 +548,7 @@ struct LambdaTableProducer { } // Set Multiplicity - mult = col.multTPC(); + mult = col.multNTracksPV(); return true; } @@ -579,6 +575,18 @@ struct LambdaTableProducer { return false; } + if (track.tpcCrossedRowsOverFindableCls() < cMinTpcCROverCls) { + return false; + } + + if (track.tpcNClsShared() > cMaxTpcSharedClusters) { + return false; + } + + if (track.tpcChi2NCl() > cMaxChi2Tpc) { + return false; + } + return true; } @@ -685,13 +693,13 @@ struct LambdaTableProducer { bool lambdaFlag = false, antiLambdaFlag = false; // get v0 track as lambda - if ((std::abs(v0.mLambda() - MassLambda0) <= cV0MassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + if ((v0.mLambda() > cMinV0Mass && v0.mLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { lambdaFlag = true; v0type = kLambda; } // get v0 track as anti-lambda - if (((std::abs(v0.mAntiLambda() - MassLambda0) <= cV0MassWindow)) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + if ((v0.mAntiLambda() > cMinV0Mass && v0.mAntiLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { antiLambdaFlag = true; v0type = kAntiLambda; } @@ -834,8 +842,8 @@ struct LambdaTableProducer { return true; } - template - float getCorrectionFactors(V const& v0, T const&) + template + float getCorrectionFactors(V const& v0) { // Check for efficiency correction flag if (!cCorrectionFlag) { @@ -852,7 +860,7 @@ struct LambdaTableProducer { } // initialize efficiency factor and primary fraction values - float effCorrFact = 1., primFrac = 1., matchEffFact = 1.; + float effCorrFact = 1., primFrac = 1.; float rap = (cDoEtaAnalysis) ? v0.eta() : v0.yLambda(); // Get Efficiency Factor @@ -892,31 +900,15 @@ struct LambdaTableProducer { delete histPrm; } - // Get Matching Efficiency Correction - if (cGetMatchEff) { - auto posTrack = v0.template posTrack_as(); - auto negTrack = v0.template negTrack_as(); - auto ccdbObjMatchEff = ccdb->getForTimeStamp(cPathCCDBMatchEff.value, -1); - TObject* objMatchEff = reinterpret_cast(ccdbObjMatchEff->FindObject("hITSTPCMatchingEfficiency")); - TH1F* histMatchEff = reinterpret_cast(objMatchEff->Clone()); - float posTrackMatchEff = histMatchEff->GetBinContent(histMatchEff->FindBin(cent, posTrack.pt())); - float negTrackMatchEff = histMatchEff->GetBinContent(histMatchEff->FindBin(cent, negTrack.pt())); - matchEffFact = posTrackMatchEff * negTrackMatchEff; - } - - return primFrac * effCorrFact * matchEffFact; + return primFrac * effCorrFact; } template - void fillLambdaMothers(V const& v0, T const&, PrmScdType const& ps) + void fillLambdaMothers(V const& v0, T const&) { auto mcpart = v0.template mcParticle_as(); auto lambdaMothers = mcpart.template mothers_as(); - if (ps == kPrimary) { - histos.fill(HIST("Tracks/h2f_primary_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); - } else { - histos.fill(HIST("Tracks/h2f_secondary_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); - } + histos.fill(HIST("Tracks/h2f_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); } template @@ -954,13 +946,9 @@ struct LambdaTableProducer { 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("h2f_pos_prong_xisqperclusterits"), postrack.pt(), postrack.itsChi2NCl()); - histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_xisqperclustertpc"), postrack.pt(), postrack.tpcChi2NCl()); 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_neg_prong_xisqperclusterits"), negtrack.pt(), negtrack.itsChi2NCl()); - histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_xisqperclustertpc"), negtrack.pt(), negtrack.tpcChi2NCl()); 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()); @@ -985,27 +973,6 @@ struct LambdaTableProducer { histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPhi"), phi); } - template - void getMatchEffHist(T const& tracks) - { - for (auto const& track : tracks) { - if constexpr (dmc == kMC) { // Check corresponding MC particle - if (!track.has_mcParticle()) { - continue; - } - } - if (track.pt() <= cTrackMinPt && std::abs(track.eta()) >= cTrackEtaCut) { // Kinematic selection - continue; - } - if (track.hasITS()) { // ITS only track - histos.fill(HIST("Tracks/h2f_itstrack_centpt"), cent, track.pt()); - } - if (track.hasITS() && track.hasTPC()) { // ITS + TPC track - histos.fill(HIST("Tracks/h2f_itstpctrack_centpt"), cent, track.pt()); - } - } - } - // Reconstructed Level Tables template void fillLambdaRecoTables(C const& collision, V const& v0tracks, T const& tracks) @@ -1020,10 +987,8 @@ struct LambdaTableProducer { } } - // Fill Collision Histograms histos.fill(HIST("Events/h1f_collisions_info"), kPassSelCol); histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); - histos.fill(HIST("Events/h2f_pvmult_vs_cent"), cent, collision.multNTracksPV()); // Fill Collision Table lambdaCollisionTable(cent, mult, collision.posX(), collision.posY(), collision.posZ()); @@ -1032,17 +997,13 @@ struct LambdaTableProducer { ParticleType v0Type = kLambda; PrmScdType v0PrmScdType = kPrimary; float mass = 0., corr_fact = 1.; + float prPx = 0., prPy = 0., prPz = 0.; - // Loop over V0s for (auto const& v0 : v0tracks) { - // daugthers - auto postrack = v0.template posTrack_as(); - auto negtrack = v0.template negTrack_as(); - // check for corresponding MCGen Particle if constexpr (dmc == kMC) { histos.fill(HIST("Tracks/h1f_tracks_info"), kTracksBeforeHasMcParticle); - if (!v0.has_mcParticle() || !postrack.has_mcParticle() || !negtrack.has_mcParticle()) { // check corresponding MC particle + if (!v0.has_mcParticle()) { continue; } } @@ -1060,7 +1021,7 @@ struct LambdaTableProducer { continue; } - // We have v0 as lambda + // we have v0 as lambda histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed); // Remove lambda with ambiguous daughters (Only for run3) @@ -1072,6 +1033,10 @@ struct LambdaTableProducer { // Get Lambda mass and kinematic variables mass = (v0Type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); + pt = v0.pt(); + eta = v0.eta(); + rap = v0.yLambda(); + phi = v0.phi(); // do MC analysis if constexpr (dmc == kMC) { @@ -1088,23 +1053,46 @@ struct LambdaTableProducer { } // get mothers information - fillLambdaMothers(v0, tracks, v0PrmScdType); + if (v0PrmScdType == kSecondary) { + fillLambdaMothers(v0, tracks); + } histos.fill(HIST("Tracks/h1f_tracks_info"), kPassTrueLambdaSel); histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); + + if (cRecoMomResoFlag) { + auto mc = v0.template mcParticle_as(); + pt = mc.pt(); + eta = mc.eta(); + rap = mc.y(); + phi = mc.phi(); + float y = (cDoEtaAnalysis) ? eta : rap; + // apply kinematic selection (On Truth) + if (!kinCutSelection(pt, std::abs(y), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + continue; + } + } } histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); // get correction factors - corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0, tracks) : getCorrectionFactors(v0, tracks); + corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0) : getCorrectionFactors(v0); // fill lambda qa if (v0Type == kLambda) { + // Assign proton Eta Phi + prPx = v0.template posTrack_as().px(); + prPy = v0.template posTrack_as().py(); + prPz = v0.template posTrack_as().pz(); histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); fillLambdaQAHistos(collision, v0, tracks); fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); } else { + // Assign proton Eta Phi + prPx = v0.template negTrack_as().px(); + prPy = v0.template negTrack_as().py(); + prPz = v0.template negTrack_as().pz(); histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); fillLambdaQAHistos(collision, v0, tracks); fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); @@ -1112,7 +1100,7 @@ struct LambdaTableProducer { // Fill Lambda/AntiLambda Table lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), - v0.pt(), v0.eta(), v0.phi(), v0.yLambda(), mass, + pt, eta, phi, rap, mass, prPx, prPy, prPz, v0.template posTrack_as().index(), v0.template negTrack_as().index(), v0.v0cosPA(), v0.dcaV0daughters(), (int8_t)v0Type, v0PrmScdType, corr_fact); } @@ -1129,8 +1117,8 @@ struct LambdaTableProducer { ParticleType v0Type = kLambda; PrmScdType v0PrmScdType = kPrimary; float rap = 0.; + float prPx = 0., prPy = 0., prPz = 0.; - // Loop over MC particles for (auto const& mcpart : mcParticles) { // check for Lambda first if (mcpart.pdgCode() == kLambda0) { @@ -1170,6 +1158,7 @@ struct LambdaTableProducer { auto dautracks = mcpart.template daughters_as(); std::vector daughterPDGs, daughterIDs; std::vector vDauPt, vDauEta, vDauRap, vDauPhi; + std::vector vDauPx, vDauPy, vDauPz; for (auto const& dautrack : dautracks) { daughterPDGs.push_back(dautrack.pdgCode()); daughterIDs.push_back(dautrack.globalIndex()); @@ -1177,6 +1166,9 @@ struct LambdaTableProducer { vDauEta.push_back(dautrack.eta()); vDauRap.push_back(dautrack.y()); vDauPhi.push_back(dautrack.phi()); + vDauPx.push_back(dautrack.px()); + vDauPy.push_back(dautrack.py()); + vDauPz.push_back(dautrack.pz()); } if (cGenDecayChannel) { // check decay channel if (v0Type == kLambda) { @@ -1193,6 +1185,10 @@ struct LambdaTableProducer { histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaToPrPi); if (v0Type == kLambda) { + // Assign proton p-vec + prPx = vDauPx[0]; + prPy = vDauPy[0]; + prPz = vDauPz[0]; histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0]); histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1]); histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode()); @@ -1206,6 +1202,10 @@ struct LambdaTableProducer { histos.fill(HIST("McGen/Lambda/Pion/hPhi"), vDauPhi[1]); fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); } else { + // Assign anti-proton p-vec + prPx = vDauPx[1]; + prPy = vDauPy[1]; + prPz = vDauPz[1]; histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0]); histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1]); histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode()); @@ -1222,7 +1222,7 @@ struct LambdaTableProducer { // Fill Lambda McGen Table lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), - mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), + mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), prPx, prPy, prPz, daughterIDs[0], daughterIDs[1], (int8_t)v0Type, -999., -999., v0PrmScdType, 1.); } } @@ -1251,28 +1251,23 @@ struct LambdaTableProducer { fillLambdaMcGenTables(mcCollision, mcParticles); } - // Collision, tracks and V0s - using CollisionsRun3 = soa::Join; - using CollisionsRun2 = soa::Join; - using Tracks = soa::Join; - using TracksRun2 = soa::Join; - using TracksMC = soa::Join; - using TracksMCRun2 = soa::Join; - using McV0Tracks = soa::Join; - SliceCache cache; Preslice> perCollision = aod::v0data::collisionId; - void processDummy(CollisionsRun3::iterator const&) {} - - PROCESS_SWITCH(LambdaTableProducer, processDummy, "Dummy Process", true); + using CollisionsRun3 = soa::Join; + using CollisionsRun2 = soa::Join; + using Tracks = soa::Join; + using TracksRun2 = soa::Join; + using TracksMC = soa::Join; + using TracksMCRun2 = soa::Join; + using McV0Tracks = soa::Join; void processDataRun3(CollisionsRun3::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) { fillLambdaRecoTables(collision, V0s, tracks); } - PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", false); + PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", true); void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, TracksRun2 const& tracks) { @@ -1281,18 +1276,6 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processDataRun2, "Process for Run2 DATA", false); - void processMatchEffData(CollisionsRun3::iterator const& collision, Tracks const& tracks) - { - // check collision - if (!selCollision(collision)) { - return; - } - // Get Matching Efficiency - getMatchEffHist(tracks); - } - - PROCESS_SWITCH(LambdaTableProducer, processMatchEffData, "Process for Matching Efficieny Calculation", false); - void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&) { @@ -1317,18 +1300,6 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun2, "Process for Run2 McReco DATA", false); - void processMatchEffMCReco(soa::Join::iterator const& collision, aod::McCollisions const&, TracksMC const& tracks, aod::McParticles const&) - { - // check collision - if (!selCollision(collision)) { - return; - } - // Get Matching Efficiency - getMatchEffHist(tracks); - } - - PROCESS_SWITCH(LambdaTableProducer, processMatchEffMCReco, "Process for Matching Efficieny Calculation at MC Reconstructed Level", false); - void processMCRun3(aod::McCollisions::iterator const& mcCollision, soa::SmallGroups> const& collisions, McV0Tracks const& V0s, TracksMC const& tracks, @@ -1412,12 +1383,9 @@ struct LambdaTracksExtProducer { } } - void processDummy(aod::LambdaCollisions::iterator const&) {} - - PROCESS_SWITCH(LambdaTracksExtProducer, processDummy, "Dummy Process", true); - - void processLambdaTrackExt(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) + void process(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) { + int nTotLambda = 0, nTotAntiLambda = 0, nSelLambda = 0, nSelAntiLambda = 0; for (auto const& lambda : tracks) { @@ -1514,8 +1482,162 @@ struct LambdaTracksExtProducer { histos.fill(HIST("h1i_antilambda_mult"), nSelAntiLambda); } } +}; + +struct LambdaSpinCorrelation { + // Global Configurables + Configurable cNPtBins{"cNPtBins", 30, "N pT Bins"}; + Configurable cMinPt{"cMinPt", 0.5, "pT Min"}; + Configurable cMaxPt{"cMaxPt", 3.5, "pT Max"}; + Configurable cNRapBins{"cNRapBins", 10, "N Rapidity Bins"}; + Configurable cMinRap{"cMinRap", -0.5, "Minimum Rapidity"}; + Configurable cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"}; + Configurable cNPhiBins{"cNPhiBins", 36, "N Phi Bins"}; + Configurable cNBinsCosTS{"cNBinsCosTS", 10, "N CosTS Bins"}; + Configurable cInvBoostFlag{"cInvBoostFlag", true, "Inverse Boost Flag"}; - PROCESS_SWITCH(LambdaTracksExtProducer, processLambdaTrackExt, "Process for lambda track extension", false); + // Centrality Axis + ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; + + // Histogram Registry. + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Global variables + float cent = 0.; + + void init(InitContext const&) + { + const AxisSpec axisCheck(1, 0, 1, ""); + const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); + const AxisSpec axisCent(cMultBins, "FT0M (%)"); + const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); + const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); + const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); + const AxisSpec axisPt(cNPtBins, cMinPt, cMaxPt, "p_{T} (GeV/#it{c})"); + const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta"); + const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); + const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#varphi (rad)"); + const AxisSpec axisDRap(2 * cNRapBins, cMinRap - cMaxRap, cMaxRap - cMinRap, "#Deltay"); + const AxisSpec axisDPhi(cNPhiBins, -PI, PI, "#Delta#varphi"); + const AxisSpec axisCosTS(cNBinsCosTS, -1, 1, "cos(#theta*)"); + const AxisSpec axisDR(10, 0, 2, "#DeltaR"); + + // Single and Two Particle Densities + // 1D Histograms + histos.add("Reco/h2f_n2_mass_LaPLaM", "m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("Reco/h2f_n2_mass_LaPLaP", "m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("Reco/h2f_n2_mass_LaMLaM", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + + // rho2 for C2 + histos.add("RecoCorr/h2f_n2_dlta_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR}); + histos.add("RecoCorr/h2f_n2_dlta_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR}); + histos.add("RecoCorr/h2f_n2_dlta_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorr/h2f_n2_cphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorr/h2f_n2_cphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorr/h2f_n2_cphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorr/h2f_n2_dphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); + histos.add("RecoCorr/h2f_n2_dphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); + histos.add("RecoCorr/h2f_n2_dphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); + } + + void getBoostVector(std::array const& p, std::array& v, bool inverseBoostFlag = true) + { + int n = p.size(); + for (int i = 0; i < n - 1; ++i) { + if (inverseBoostFlag) { + v[i] = -p[i] / RecoDecay::e(p[0], p[1], p[2], p[3]); + } else { + v[i] = p[i] / RecoDecay::e(p[0], p[1], p[2], p[3]); + } + } + } + + void boost(std::array& p, std::array const& b) + { + float e = RecoDecay::e(p[0], p[1], p[2], p[3]); + float b2 = b[0] * b[0] + b[1] * b[1] + b[2] * b[2]; + float gamma = 1. / std::sqrt(1 - b2); + float bp = b[0] * p[0] + b[1] * p[1] + b[2] * p[2]; + float gamma2 = b2 > 0 ? (gamma - 1.) / b2 : 0.; + + p[0] = p[0] + gamma2 * bp * b[0] + gamma * b[0] * e; + p[1] = p[1] + gamma2 * bp * b[1] + gamma * b[1] * e; + p[2] = p[2] + gamma2 * bp * b[2] + gamma * b[2] * e; + } + + template + void fillPairHistos(U& p1, U& p2) + { + static constexpr std::string_view SubDirHist[] = {"LaPLaM", "LaPLaP", "LaMLaM"}; + + // Fill lambda pair mass + histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt()); + float drap = p1.rap() - p2.rap(); + float dphi = RecoDecay::constrainAngle(p1.phi() - p2.phi(), -PI); + + // Get Lambda-Proton four-momentum + std::array l1 = {p1.px(), p1.py(), p1.pz(), MassLambda0}; + std::array l2 = {p2.px(), p2.py(), p2.pz(), MassLambda0}; + std::array pr1 = {p1.prPx(), p1.prPy(), p1.prPz(), MassProton}; + std::array pr2 = {p2.prPx(), p2.prPy(), p2.prPz(), MassProton}; + std::array v1, v2; + getBoostVector(l1, v1, cInvBoostFlag); + getBoostVector(l2, v2, cInvBoostFlag); + boost(pr1, v1); + boost(pr2, v2); + + std::array pr1tv = {pr1[0], pr1[1], pr1[2]}; + std::array pr2tv = {pr2[0], pr2[1], pr2[2]}; + float cphi = RecoDecay::dotProd(pr1tv, pr2tv) / (RecoDecay::sqrtSumOfSquares(pr1tv[0], pr1tv[1], pr1tv[2]) * RecoDecay::sqrtSumOfSquares(pr2tv[0], pr2tv[1], pr2tv[2])); + float prdphi = RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI); + float prdrap = RecoDecay::eta(pr1tv) - RecoDecay::eta(pr2tv); + float dr = std::sqrt(prdrap * prdrap + prdphi * prdphi); + + // Fill pair density + histos.fill(HIST("RecoCorr/h2f_n2_dphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI)); + histos.fill(HIST("RecoCorr/h2f_n2_cphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, cphi); + histos.fill(HIST("RecoCorr/h2f_n2_dlta_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, dr); + } + + template + void analyzePairs(T const& trks_1, T const& trks_2) + { + for (auto const& trk_1 : trks_1) { + for (auto const& trk_2 : trks_2) { + // check for same index for Lambda-Lambda / AntiLambda-AntiLambda + if (samelambda && ((trk_1.index() == trk_2.index()))) { + continue; + } + fillPairHistos(trk_1, trk_2); + } + } + } + + // Initialize tables + using LambdaCollisions = aod::LambdaCollisions; + using LambdaTracks = soa::Join; + + SliceCache cache; + Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + + void processDummy(LambdaCollisions::iterator const&) {} + + PROCESS_SWITCH(LambdaSpinCorrelation, processDummy, "Dummy process", true); + + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) + { + // assign centrality + cent = collision.cent(); + + auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + analyzePairs(lambdaTracks, antiLambdaTracks); + analyzePairs(lambdaTracks, lambdaTracks); + analyzePairs(antiLambdaTracks, antiLambdaTracks); + } + + PROCESS_SWITCH(LambdaSpinCorrelation, processDataReco, "Process for Data and MCReco", false); }; struct LambdaR2Correlation { @@ -1535,7 +1657,7 @@ struct LambdaR2Correlation { Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Eta/Rap Analysis Flag"}; // Centrality Axis - ConfigurableAxis cCentBins{"cCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; + ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -1569,7 +1691,7 @@ struct LambdaR2Correlation { const AxisSpec axisCheck(1, 0, 1, ""); const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); - const AxisSpec axisCent(cCentBins, "FT0C (%)"); + const AxisSpec axisCent(cMultBins, "FT0M (%)"); const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); @@ -1584,14 +1706,16 @@ struct LambdaR2Correlation { // Event 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/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTProfile, {axisCent}); - histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTProfile, {axisCent}); - histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTProfile, {axisCent}); + histos.add("Event/Reco/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTH2F, {axisCent, axisChMult}); + histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTH2F, {axisCent, axisMult}); + histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTH2F, {axisCent, axisMult}); // Efficiency Histograms // Single Particle Efficiencies histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRap}); histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRap}); @@ -1599,16 +1723,22 @@ struct LambdaR2Correlation { // 1D Histograms histos.add("Reco/Primary/h3f_n1_centmasspt_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisMass, axisPt}); histos.add("Reco/Primary/h3f_n1_centmasspt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisMass, axisPt}); - histos.add("Reco/Primary/h4f_n1_ptrapphi_LaP", "#rho_{1}^{#Lambda}", kTHnSparseF, {axisCent, axisPt, axisRap, axisPhi}); - histos.add("Reco/Primary/h4f_n1_ptrapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRap, axisPhi}); + histos.add("Reco/Primary/h2f_n1_pt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/h2f_n1_pt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/h2f_n1_eta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisEta}); + histos.add("Reco/Primary/h2f_n1_eta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisEta}); + histos.add("Reco/Primary/h2f_n1_rap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisRap}); + histos.add("Reco/Primary/h2f_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisRap}); + histos.add("Reco/Primary/h2f_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPhi}); + histos.add("Reco/Primary/h2f_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPhi}); // rho1 for R2 RapPhi histos.add("Reco/Primary/h3f_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisRap, axisPhi}); histos.add("Reco/Primary/h3f_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisPhi}); // rho1 for Q_{inv} - histos.add("Reco/Primary/h3f_n1_ptrapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRapPhi}); - histos.add("Reco/Primary/h3f_n1_ptrapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRapPhi}); + histos.add("Reco/Primary/h3f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/h3f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); // Clone Singles Primary/Secondary Histogram if (cAnaSecondaries) { @@ -1630,9 +1760,9 @@ struct LambdaR2Correlation { histos.add("Reco/PP/h3f_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); // rho2 for R2 Qinv - histos.add("Reco/PP/h3f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); - histos.add("Reco/PP/h3f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); - histos.add("Reco/PP/h3f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); // Clone Pairs Histograms if (cAnaSecondaryPairs) { @@ -1649,21 +1779,6 @@ struct LambdaR2Correlation { } } - // Rap-Phi Bin Index - int getRapPhiBin(float const& rap, float const& phi) - { - int rapbin = static_cast((rap - kminrap) / rapbinwidth); - int phibin = static_cast(phi / phibinwidth); - - int rapphibin = -99; - if (rapbin >= 0 && phibin >= 0 && rapbin < nrapbins && phibin < nphibins) { - rapphibin = rapbin * nphibins + phibin; - return rapphibin; - } - - return rapphibin; - } - template void fillPairHistos(U& p1, U& p2) { @@ -1698,7 +1813,7 @@ struct LambdaR2Correlation { 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(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, p1.pt(), getRapPhiBin(p1.rap(), p1.phi()), qinv, corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h2f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, qinv, corfac); } template @@ -1716,17 +1831,21 @@ struct LambdaR2Correlation { // Efficiency Plots histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h2f_n1_centpt_") + HIST(SubDirHist[part]), cent, track.pt()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centpteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta()); histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centptrap_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap()); // QA Plots histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_centmasspt_") + HIST(SubDirHist[part]), cent, track.mass(), track.pt()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h4f_n1_ptrapphi_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap(), track.phi(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_pt_") + HIST(SubDirHist[part]), cent, track.pt(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_eta_") + HIST(SubDirHist[part]), cent, track.eta(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_phi_") + HIST(SubDirHist[part]), cent, track.phi(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_rap_") + HIST(SubDirHist[part]), cent, track.rap(), track.corrFact()); // Rho1 for N1RapPhi histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_rapphi_") + HIST(SubDirHist[part]), cent, track.rap(), track.phi(), track.corrFact()); - // Rho1 for Q_{inv} - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_ptrapphi_") + HIST(SubDirHist[part]), cent, track.pt(), getRapPhiBin(track.rap(), track.phi()), track.corrFact()); + // Rho1 for Q_{inv} Bkg Estimation + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_pteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta(), track.corrFact()); } // fill multiplicity histograms @@ -1762,10 +1881,6 @@ struct LambdaR2Correlation { Partition partSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); Partition partSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); - void processDummy(aod::LambdaCollisions::iterator const&) {} - - PROCESS_SWITCH(LambdaR2Correlation, processDummy, "Dummy Process", true); - void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) { histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); @@ -1808,7 +1923,7 @@ struct LambdaR2Correlation { } } - PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", false); + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; using LambdaMcGenTracks = aod::LambdaMcGenTracks; @@ -1869,5 +1984,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } From 49d5d8df748fe36a47d12aa18bd129c3233a5fac Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Mon, 6 Apr 2026 17:38:11 +0530 Subject: [PATCH 186/282] [PWGLF] Add weight option to histograms (#15660) --- .../Resonances/lambda1520analysisinpp.cxx | 131 +++++++++++++++--- 1 file changed, 108 insertions(+), 23 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 6c6d0a66b25..c2e148cd774 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -178,6 +178,7 @@ struct Lambda1520analysisinpp { Configurable cEtacutMC{"cEtacutMC", 0.5f, "MC eta cut"}; Configurable cUseRapcutMC{"cUseRapcutMC", true, "MC eta cut"}; Configurable cUseEtacutMC{"cUseEtacutMC", true, "MC eta cut"}; + Configurable useWeight{"useWeight", false, "Use weight for signal loss calculation"}; // cuts on mother Configurable cfgUseCutsOnMother{"cfgUseCutsOnMother", false, "Enable additional cuts on mother"}; @@ -431,7 +432,11 @@ struct Lambda1520analysisinpp { if (doprocessdummy) { histos.add("Result/dummy/Genprotonpt", "pT distribution of #Lambda(1520) from Proton", kTH3F, {axisMClabel, axisPt, axisMult}); histos.add("Result/dummy/Genlambdapt", "pT distribution of #Lambda(1520) from #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/dummy/Genxipt", "pT distribution of #Lambda(1520) from #Xi^{-}", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/Genxipt", "pT distribution of #Lambda(1520) from #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); + + histos.add("Result/dummy/GenTrueprotonpt", "pT distribution of True MC Proton", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/GenTruelambdapt", "pT distribution of True MC #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/GenTruexipt", "pT distribution of True MC #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); } // Print output histograms statistics @@ -1309,95 +1314,175 @@ struct Lambda1520analysisinpp { return (ptL2 > 0) ? std::sqrt(ptL2) : -1.f; }; - for (auto& part : mcPartsAll) { + for (const auto& part : mcPartsAll) { if (!part.isPhysicalPrimary()) continue; float pt = part.pt(); + float weight; + if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) // rapidity cut continue; if (std::abs(part.pdgCode()) == kProton) { + // true proton + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 0, pt, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 1, pt, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 2, pt, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 3, pt, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 4, pt, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 5, pt, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 6, pt, centrality); + float ptL = computePtL(pt, massPr); if (ptL < 0) continue; - histos.fill(HIST("Result/dummy/Genprotonpt"), 0, ptL, centrality); + if (useWeight) + weight = ptL / pt; + else + weight = 1.f; + + histos.fill(HIST("Result/dummy/Genprotonpt"), 0, ptL, centrality, weight); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/Genprotonpt"), 1, ptL, centrality); + histos.fill(HIST("Result/dummy/Genprotonpt"), 1, ptL, centrality, weight); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/Genprotonpt"), 2, ptL, centrality); + histos.fill(HIST("Result/dummy/Genprotonpt"), 2, ptL, centrality, weight); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/Genprotonpt"), 3, ptL, centrality); + histos.fill(HIST("Result/dummy/Genprotonpt"), 3, ptL, centrality, weight); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/Genprotonpt"), 4, ptL, centrality); + histos.fill(HIST("Result/dummy/Genprotonpt"), 4, ptL, centrality, weight); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/Genprotonpt"), 5, ptL, centrality); + histos.fill(HIST("Result/dummy/Genprotonpt"), 5, ptL, centrality, weight); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/Genprotonpt"), 6, ptL, centrality); + histos.fill(HIST("Result/dummy/Genprotonpt"), 6, ptL, centrality, weight); } if (std::abs(part.pdgCode()) == kLambda0) { + // true lambda + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 0, pt, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 1, pt, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 2, pt, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 3, pt, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 4, pt, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 5, pt, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/GenTruelambdapt"), 6, pt, centrality); + float ptL = computePtL(pt, MassLambda0); if (ptL < 0) continue; - histos.fill(HIST("Result/dummy/Genlambdapt"), 0, ptL, centrality); + if (useWeight) + weight = ptL / pt; + else + weight = 1.f; + + histos.fill(HIST("Result/dummy/Genlambdapt"), 0, ptL, centrality, weight); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/Genlambdapt"), 1, ptL, centrality); + histos.fill(HIST("Result/dummy/Genlambdapt"), 1, ptL, centrality, weight); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/Genlambdapt"), 2, ptL, centrality); + histos.fill(HIST("Result/dummy/Genlambdapt"), 2, ptL, centrality, weight); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/Genlambdapt"), 3, ptL, centrality); + histos.fill(HIST("Result/dummy/Genlambdapt"), 3, ptL, centrality, weight); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/Genlambdapt"), 4, ptL, centrality); + histos.fill(HIST("Result/dummy/Genlambdapt"), 4, ptL, centrality, weight); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/Genlambdapt"), 5, ptL, centrality); + histos.fill(HIST("Result/dummy/Genlambdapt"), 5, ptL, centrality, weight); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/Genlambdapt"), 6, ptL, centrality); + histos.fill(HIST("Result/dummy/Genlambdapt"), 6, ptL, centrality, weight); } if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { + // true Xi + histos.fill(HIST("Result/dummy/GenTruexipt"), 0, pt, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/GenTruexipt"), 1, pt, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/GenTruexipt"), 2, pt, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/GenTruexipt"), 3, pt, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/GenTruexipt"), 4, pt, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/GenTruexipt"), 5, pt, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/GenTruexipt"), 6, pt, centrality); + float ptL = computePtL(pt, MassXiMinus); if (ptL < 0) continue; - histos.fill(HIST("Result/dummy/Genxipt"), 0, ptL, centrality); + if (useWeight) + weight = ptL / pt; + else + weight = 1.f; + + histos.fill(HIST("Result/dummy/Genxipt"), 0, ptL, centrality, weight); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/Genxipt"), 1, ptL, centrality); + histos.fill(HIST("Result/dummy/Genxipt"), 1, ptL, centrality, weight); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/Genxipt"), 2, ptL, centrality); + histos.fill(HIST("Result/dummy/Genxipt"), 2, ptL, centrality, weight); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/Genxipt"), 3, ptL, centrality); + histos.fill(HIST("Result/dummy/Genxipt"), 3, ptL, centrality, weight); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/Genxipt"), 4, ptL, centrality); + histos.fill(HIST("Result/dummy/Genxipt"), 4, ptL, centrality, weight); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/Genxipt"), 5, ptL, centrality); + histos.fill(HIST("Result/dummy/Genxipt"), 5, ptL, centrality, weight); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/Genxipt"), 6, ptL, centrality); + histos.fill(HIST("Result/dummy/Genxipt"), 6, ptL, centrality, weight); } } } From 46c556739cc2aec857d89a86de6e1a5fc626e329 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, 6 Apr 2026 19:47:45 +0200 Subject: [PATCH 187/282] [PWGHF] fix a small bug related to variable type in Cd task (#15667) --- PWGHF/D2H/Tasks/taskCd.cxx | 14 +++++++------- PWGHF/TableProducer/candidateCreator3Prong.cxx | 2 +- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index 33327575366..af4e5960cd9 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -87,13 +87,13 @@ DECLARE_SOA_COLUMN(NSigmaItsDe, nSigmaItsDe, float); //! ITS nσ for DECLARE_SOA_COLUMN(NSigmaTofDe, nSigmaTofDe, float); //! TOF nσ for deuteron hypothesis DECLARE_SOA_COLUMN(NSigmaTofKa, nSigmaTofKa, float); //! TOF nσ for kaon hypothesis DECLARE_SOA_COLUMN(NSigmaTofPi, nSigmaTofPi, float); //! TOF nσ for pion hypothesis -DECLARE_SOA_COLUMN(NItsClusters, nItsClusters, int8_t); //! Number of ITS clusters used in the track fit -DECLARE_SOA_COLUMN(NItsNClusterSize, nItsNClusterSize, int8_t); //! Number of ITS clusters size used in the track fit -DECLARE_SOA_COLUMN(NTpcClusters, nTpcClusters, int8_t); //! Number of TPC clusters used in the track fit -DECLARE_SOA_COLUMN(NTpcSignalsDe, nTpcSignalsDe, int8_t); //! Number of TPC signas for deuteron -DECLARE_SOA_COLUMN(NTpcSignalsPi, nTpcSignalsPi, int8_t); //! Number of TPC signas for pion -DECLARE_SOA_COLUMN(NTpcSignalsKa, nTpcSignalsKa, int8_t); //! Number of TPC signas for kaon -DECLARE_SOA_COLUMN(NItsSignalsDe, nItsSignalsDe, int8_t); //! Number of ITS signas +DECLARE_SOA_COLUMN(NItsClusters, nItsClusters, float); //! Number of ITS clusters used in the track fit +DECLARE_SOA_COLUMN(NItsNClusterSize, nItsNClusterSize, float); //! Number of ITS clusters size used in the track fit +DECLARE_SOA_COLUMN(NTpcClusters, nTpcClusters, float); //! Number of TPC clusters used in the track fit +DECLARE_SOA_COLUMN(NTpcSignalsDe, nTpcSignalsDe, float); //! Number of TPC signas for deuteron +DECLARE_SOA_COLUMN(NTpcSignalsPi, nTpcSignalsPi, float); //! Number of TPC signas for pion +DECLARE_SOA_COLUMN(NTpcSignalsKa, nTpcSignalsKa, float); //! Number of TPC signas for kaon +DECLARE_SOA_COLUMN(NItsSignalsDe, nItsSignalsDe, float); //! Number of ITS signas DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! Candidates falg DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collisionAdd commentMore actions diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 74fb8468af5..b7542c5bbe3 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -143,7 +143,7 @@ struct HfCandidateCreator3Prong { Configurable applyTopoConstraint{"applyTopoConstraint", false, "apply origin from PV hypothesis for created candidate, works only in KF mode"}; Configurable applyInvMassConstraint{"applyInvMassConstraint", false, "apply particle type hypothesis to recalculate created candidate's momentum, works only in KF mode"}; - Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3)"}; + Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3, alpha)"}; HfEventSelection hfEvSel; // event selection and monitoring o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 33e1c3a1669..16ca600001b 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -338,7 +338,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { Configurable useIsQualityTrackITSForSoftPion{"useIsQualityTrackITSForSoftPion", true, "check qualityTracksITS status for soft pion tracks"}; // CharmNuclei track selection Configurable> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NVarCuts, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"}; - Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3)"}; + Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3, alpha)"}; // proton PID, applied only if corresponding process function enabled Configurable> selectionsPid{"selectionsPid", {hf_presel_pid::CutsPid[0], hf_presel_pid::NPidRows, hf_presel_pid::NPidCuts, hf_presel_pid::labelsRowsPid, hf_presel_pid::labelsCutsPid}, "PID selections for proton / kaon / deuteron / triton /helium applied if proper process function enabled"}; // CCDB From 49906a919a97927998d5f7547130b9bfa80c2923 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Mon, 6 Apr 2026 19:57:31 +0200 Subject: [PATCH 188/282] [PWGHF] Add QA histograms for UPC process (#15666) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskD0.cxx | 117 ++++++++++++++++++++++++++++++++++--- 1 file changed, 109 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 16dbff833e4..68dba6a3d91 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -123,11 +123,12 @@ struct HfTaskD0 { using CollisionsWithMcLabels = soa::Join; using CollisionsWithMcLabelsCent = soa::Join; using TracksSelQuality = soa::Join; - using TracksWPid = soa::Join; - + using TracksWPid = soa::Join; + // using TracksWithExtra = o2::soa::Join; Filter filterD0Flag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK))) != static_cast(0); - + Preslice perCol = aod::track::collisionId; Preslice candD0PerCollision = aod::hf_cand::collisionId; + PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; PresliceUnsorted colPerMcCollisionCent = aod::mccollisionlabel::mcCollisionId; @@ -396,11 +397,13 @@ struct HfTaskD0 { } registry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); - registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 200}, {1000, 0., 2000}}}); - registry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{700, -35., 35.}, {700, -35., 35.}}}); + registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{1000, 0., 20000}, {1000, 0., 20000}}}); + registry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{200, -10., 10.}, {200, -10., 10.}}}); registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap type;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}}); registry.add("Data/hGapVsEtaTrack0", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); registry.add("Data/hGapVsEtaTrack1", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + registry.add("QAtracks/hEtaTrackVsGap", "", {HistType::kTH2F, {{7, -1.5, 5.5}, {100, -1.8, 1.8}}}); + registry.add("QAtracks/hPtTrackVsGap", "", {HistType::kTH2F, {{7, -1.5, 5.5}, {100, 0, 50}}}); registry.add("Data/hTPCnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); registry.add("Data/hTPCnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); @@ -428,8 +431,49 @@ struct HfTaskD0 { registry.add("Data/hTpcTofnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); registry.add("Data/hTpcTofnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); registry.add("Data/hTpcTofnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); - registry.add("Data/hGapVsRap", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + // QA histograms for Event level info + registry.add("QAevents/hPVcontrVsGap", " ;Gap ; N PV contributors", {HistType::kTH2F, {{7, -1.5, 5.5}, {800, 0., 200.}}}); + registry.add("QAevents/ampFT0AVsC_GapA", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.) Gap A", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); + registry.add("QAevents/ampFT0AVsC_GapC", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.) Gap C", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); + registry.add("QAevents/energyZNAvsC_GapA", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.) Gap A", {HistType::kTH2F, {{1000, 0., 20000}, {1000, 0., 20000}}}); + registry.add("QAevents/energyZNAvsC_GapC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.) Gap A", {HistType::kTH2F, {{1000, 0., 20000}, {1000, 0., 20000}}}); + registry.add("QAevents/timeZNAvsC_GapA", "ZNA vs ZNC time;ZNA Time;ZNC time Gap A", {HistType::kTH2F, {{200, -10., 10.}, {200, -10., 10.}}}); + registry.add("QAevents/timeZNAvsC_GapC", "ZNA vs ZNC time;ZNA Time;ZNC time Gap C", {HistType::kTH2F, {{200, -10., 10.}, {200, -10., 10.}}}); + // QA histograms for tracks + // A side gap + registry.add("QAtracks/hTPCnSigmaPi_GapA", "Gap A;P (GeV/c) ;TPC nSigma Pi", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTPCnSigmaKa_GapA", "Gap A;P (GeV/c) ;TPC nSigma Ka", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTPCnSigmaPr_GapA", "Gap A;P (GeV/c) ;TPC nSigma Pr", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTOFnSigmaPi_GapA", "Gap A;P (GeV/c) ;TOF nSigma Pi", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTOFnSigmaKa_GapA", "Gap A;P (GeV/c) ;TOF nSigma Ka", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTOFnSigmaPr_GapA", "Gap A;P (GeV/c) ;TOF nSigma Pr", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTPCTOFnSigmaPi_GapA", "Gap A;P (GeV/c) ;TPCTOF nSigma Pi", {HistType::kTH2F, {{360, 0, 36}, {120, 0., 6.}}}); + registry.add("QAtracks/hTPCTOFnSigmaKa_GapA", "Gap A;P (GeV/c) ;TPCTOF nSigma Ka", {HistType::kTH2F, {{360, 0, 36}, {120, 0., 6.}}}); + registry.add("QAtracks/hTPCTOFnSigmaPr_GapA", "Gap A;P (GeV/c) ;TPCTOF nSigma Pr", {HistType::kTH2F, {{360, 0, 36}, {120, 0., 6.}}}); + + registry.add("QAtracks/hTPCNCls_GapA", "Gap A; TPC Cls", {HistType::kTH1F, {{160, 0., 160.}}}); + registry.add("QAtracks/hTPCChi2_GapA", "Gap A; TPC chi2", {HistType::kTH1F, {{24, 0., 6.}}}); + registry.add("QAtracks/hITSNCls_GapA", "Gap A; TPC Cls", {HistType::kTH1F, {{8, -1., 7.}}}); + registry.add("QAtracks/hDCAxy_GapA", "Gap A; DCA xy", {HistType::kTH1F, {{400, -2, 2.}}}); + registry.add("QAtracks/hDCAz_GapA", "Gap A; DCA z", {HistType::kTH1F, {{400, -4, 4.}}}); + + // C side gap + registry.add("QAtracks/hTPCnSigmaPi_GapC", "Gap C;P (GeV/c) ;TPC nSigma Pi", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTPCnSigmaKa_GapC", "Gap C;P (GeV/c) ;TPC nSigma Ka", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTPCnSigmaPr_GapC", "Gap C;P (GeV/c) ;TPC nSigma Pr", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTOFnSigmaPi_GapC", "Gap C;P (GeV/c) ;TOF nSigma Pi", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTOFnSigmaKa_GapC", "Gap C;P (GeV/c) ;TOF nSigma Ka", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTOFnSigmaPr_GapC", "Gap C;P (GeV/c) ;TOF nSigma Pr", {HistType::kTH2F, {{360, 0, 36}, {120, -6., 6.}}}); + registry.add("QAtracks/hTPCTOFnSigmaPi_GapC", "Gap C;P (GeV/c) ;TPCTOF nSigma Pi", {HistType::kTH2F, {{360, 0, 36}, {120, 0, 6.}}}); + registry.add("QAtracks/hTPCTOFnSigmaKa_GapC", "Gap C;P (GeV/c) ;TPCTOF nSigma Ka", {HistType::kTH2F, {{360, 0, 36}, {120, 0., 6.}}}); + registry.add("QAtracks/hTPCTOFnSigmaPr_GapC", "Gap C;P (GeV/c) ;TPCTOF nSigma Pr", {HistType::kTH2F, {{360, 0, 36}, {120, 0., 6.}}}); + + registry.add("QAtracks/hTPCNCls_GapC", "Gap C; TPC Cls", {HistType::kTH1F, {{160, 0., 160.}}}); + registry.add("QAtracks/hTPCChi2_GapC", "Gap C; TPC chi2", {HistType::kTH1F, {{24, 0., 6.}}}); + registry.add("QAtracks/hITSNCls_GapC", "Gap C; TPC Cls", {HistType::kTH1F, {{8, -1., 7.}}}); + registry.add("QAtracks/hDCAxy_GapC", "Gap C; DCA xy", {HistType::kTH1F, {{400, -2, 2.}}}); + registry.add("QAtracks/hDCAz_GapC", "Gap C; DCA z", {HistType::kTH1F, {{400, -4, 4.}}}); hfEvSel.addHistograms(registry); @@ -625,7 +669,7 @@ struct HfTaskD0 { aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, - TracksWPid const&) + TracksWPid const& tracks) { for (const auto& collision : collisions) { float centrality{-1.f}; @@ -667,6 +711,19 @@ struct HfTaskD0 { } registry.fill(HIST("Data/fitInfo/ampFT0A_vs_ampFT0C"), fitInfo.ampFT0A, fitInfo.ampFT0C); registry.fill(HIST("Data/hUpcGapAfterSelection"), gap); + registry.fill(HIST("QAevents/hPVcontrVsGap"), gap, collision.numContrib()); + + if (gap == 0) { + registry.fill(HIST("QAevents/ampFT0AVsC_GapA"), fitInfo.ampFT0A, fitInfo.ampFT0C); + registry.fill(HIST("QAevents/energyZNAvsC_GapA"), zdcEnergyZNA, zdcEnergyZNC); + registry.fill(HIST("QAevents/timeZNAvsC_GapA"), zdcTimeZNA, zdcTimeZNC); + } + + if (gap == 1) { + registry.fill(HIST("QAevents/ampFT0AVsC_GapC"), fitInfo.ampFT0A, fitInfo.ampFT0C); + registry.fill(HIST("QAevents/energyZNAvsC_GapC"), zdcEnergyZNA, zdcEnergyZNC); + registry.fill(HIST("QAevents/timeZNAvsC_GapC"), zdcTimeZNA, zdcTimeZNC); + } const auto thisCollId = collision.globalIndex(); const auto& groupedD0Candidates = candidates.sliceBy(candD0PerCollision, thisCollId); @@ -679,6 +736,50 @@ struct HfTaskD0 { ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true) * 1.e-3; // kHz } + auto tracksample = tracks.sliceBy(perCol, collision.globalIndex()); + if (collision.numContrib() > 1) { + for (const auto& track : tracksample) { + if (!track.isGlobalTrack()) { + continue; + } + registry.fill(HIST("QAtracks/hEtaTrackVsGap"), gap, track.eta()); + registry.fill(HIST("QAtracks/hPtTrackVsGap"), gap, track.pt()); + + if (gap == 0) { // QA for Gap A + registry.fill(HIST("QAtracks/hTPCnSigmaPi_GapA"), track.p(), track.tpcNSigmaPi()); + registry.fill(HIST("QAtracks/hTPCnSigmaKa_GapA"), track.p(), track.tpcNSigmaKa()); + registry.fill(HIST("QAtracks/hTPCnSigmaPr_GapA"), track.p(), track.tpcNSigmaPr()); + registry.fill(HIST("QAtracks/hTOFnSigmaPi_GapA"), track.p(), track.tofNSigmaPi()); + registry.fill(HIST("QAtracks/hTOFnSigmaKa_GapA"), track.p(), track.tofNSigmaKa()); + registry.fill(HIST("QAtracks/hTOFnSigmaPr_GapA"), track.p(), track.tofNSigmaPr()); + registry.fill(HIST("QAtracks/hTPCTOFnSigmaPi_GapA"), track.p(), track.tpcTofNSigmaPi()); + registry.fill(HIST("QAtracks/hTPCTOFnSigmaKa_GapA"), track.p(), track.tpcTofNSigmaKa()); + registry.fill(HIST("QAtracks/hTPCTOFnSigmaPr_GapA"), track.p(), track.tpcTofNSigmaPr()); + registry.fill(HIST("QAtracks/hTPCNCls_GapA"), track.tpcNClsFound()); + registry.fill(HIST("QAtracks/hTPCChi2_GapA"), track.tpcChi2NCl()); + registry.fill(HIST("QAtracks/hITSNCls_GapA"), track.itsNCls()); + registry.fill(HIST("QAtracks/hDCAxy_GapA"), track.dcaXY()); + registry.fill(HIST("QAtracks/hDCAz_GapA"), track.dcaZ()); + } + if (gap == 1) { // QA for Gap C + registry.fill(HIST("QAtracks/hTPCnSigmaPi_GapC"), track.p(), track.tpcNSigmaPi()); + registry.fill(HIST("QAtracks/hTPCnSigmaKa_GapC"), track.p(), track.tpcNSigmaKa()); + registry.fill(HIST("QAtracks/hTPCnSigmaPr_GapC"), track.p(), track.tpcNSigmaPr()); + registry.fill(HIST("QAtracks/hTOFnSigmaPi_GapC"), track.p(), track.tofNSigmaPi()); + registry.fill(HIST("QAtracks/hTOFnSigmaKa_GapC"), track.p(), track.tofNSigmaKa()); + registry.fill(HIST("QAtracks/hTOFnSigmaPr_GapC"), track.p(), track.tofNSigmaPr()); + registry.fill(HIST("QAtracks/hTPCTOFnSigmaPi_GapC"), track.p(), track.tpcTofNSigmaPi()); + registry.fill(HIST("QAtracks/hTPCTOFnSigmaKa_GapC"), track.p(), track.tpcTofNSigmaKa()); + registry.fill(HIST("QAtracks/hTPCTOFnSigmaPr_GapC"), track.p(), track.tpcTofNSigmaPr()); + registry.fill(HIST("QAtracks/hTPCNCls_GapC"), track.tpcNClsFound()); + registry.fill(HIST("QAtracks/hTPCChi2_GapC"), track.tpcChi2NCl()); + registry.fill(HIST("QAtracks/hITSNCls_GapC"), track.itsNCls()); + registry.fill(HIST("QAtracks/hDCAxy_GapC"), track.dcaXY()); + registry.fill(HIST("QAtracks/hDCAz_GapC"), track.dcaZ()); + } + } + } + for (const auto& candidate : groupedD0Candidates) { if (yCandRecoMax >= 0. && std::abs(HfHelper::yD0(candidate)) > yCandRecoMax) { continue; @@ -761,7 +862,7 @@ struct HfTaskD0 { valuesToFill.push_back(static_cast(ptCandidate)); if constexpr (FillMl) { auto const& mlScores = candidate.mlProbD0(); - if (mlScores.size() == 3) { + if (mlScores.size() == NAxesMl) { valuesToFill.push_back(mlScores[0]); valuesToFill.push_back(mlScores[1]); valuesToFill.push_back(mlScores[2]); From d2d41ea34925270d2e44698e26b19349759d57bf Mon Sep 17 00:00:00 2001 From: Lorenzo Bernardinis <95907752+lorber98@users.noreply.github.com> Date: Tue, 7 Apr 2026 09:39:20 +0200 Subject: [PATCH 189/282] [PWGLF] Add histograms for inclusive V0s in MB events (#15647) --- .../Strangeness/strangenessInJetsIons.cxx | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx b/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx index cefeec99ce6..9694d86cc4f 100644 --- a/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx +++ b/PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx @@ -458,6 +458,10 @@ struct StrangenessInJetsIons { registryMC.add("K0s_reconstructed_MB", "K0s_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxis}); registryMC.add("Lambda_reconstructed_MB", "Lambda_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxis}); registryMC.add("AntiLambda_reconstructed_MB", "AntiLambda_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxis}); + + registryMC.add("K0s_reconstructed_MB_incl", "K0s_reconstructed_MB_incl", HistType::kTH2F, {multAxis, ptAxis}); + registryMC.add("Lambda_reconstructed_MB_incl", "Lambda_reconstructed_MB_incl", HistType::kTH2F, {multAxis, ptAxis}); + registryMC.add("AntiLambda_reconstructed_MB_incl", "AntiLambda_reconstructed_MB_incl", HistType::kTH2F, {multAxis, ptAxis}); } if (particleOfInterestDict[ParticleOfInterest::kCascades]) { registryMC.add("XiPos_reconstructed_jet", "XiPos_reconstructed_jet", HistType::kTH2F, {multAxis, ptAxis}); @@ -1217,8 +1221,6 @@ struct StrangenessInJetsIons { auto motherNeg = mcParticles.iteratorAt(negParticle.mothersIds()[0]); if (motherPos != motherNeg) continue; - if (!motherPos.isPhysicalPrimary()) - continue; if (std::abs(motherPos.eta()) > 0.8) continue; @@ -1228,13 +1230,30 @@ struct StrangenessInJetsIons { // K0s if (passedK0ShortSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kK0Short) { - registryMC.fill(HIST("K0s_reconstructed_MB"), multiplicity, v0.pt()); + registryMC.fill(HIST("K0s_reconstructed_MB_incl"), multiplicity, v0.pt()); } // Lambda if (passedLambdaSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kLambda0) { - registryMC.fill(HIST("Lambda_reconstructed_MB"), multiplicity, v0.pt()); + registryMC.fill(HIST("Lambda_reconstructed_MB_incl"), multiplicity, v0.pt()); } // AntiLambda + if (passedAntiLambdaSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kLambda0Bar) { + registryMC.fill(HIST("AntiLambda_reconstructed_MB_incl"), multiplicity, v0.pt()); + } + + if (!motherPos.isPhysicalPrimary()) + continue; + + // Histograms below are filled only for PhysicalPrimary particles + // K0s (primary) + if (passedK0ShortSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kK0Short) { + registryMC.fill(HIST("K0s_reconstructed_MB"), multiplicity, v0.pt()); + } + // Lambda (primary) + if (passedLambdaSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kLambda0) { + registryMC.fill(HIST("Lambda_reconstructed_MB"), multiplicity, v0.pt()); + } + // AntiLambda (primary) if (passedAntiLambdaSelection(v0, pos, neg, vtxPos) && motherPos.pdgCode() == kLambda0Bar) { registryMC.fill(HIST("AntiLambda_reconstructed_MB"), multiplicity, v0.pt()); } From 0a42bb2fdcdde07e12899b2e4185077f258384b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 7 Apr 2026 13:28:55 +0200 Subject: [PATCH 190/282] [DPG] PID: add QA for TOF dynamic columns (#14883) --- DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt | 5 + .../AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx | 807 ++++++++++++++++++ 2 files changed, 812 insertions(+) create mode 100644 DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx diff --git a/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt b/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt index 87af80a68dd..894163330df 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt +++ b/DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt @@ -15,6 +15,11 @@ o2physics_add_dpl_workflow(pid-tof-qa PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(pid-tof-qa-dynamic + SOURCES qaPIDTOFDynamic.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(pid-tof-qa-beta SOURCES qaPIDTOFBeta.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx new file mode 100644 index 00000000000..07992cc7753 --- /dev/null +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx @@ -0,0 +1,807 @@ +// 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. + +/// +/// \file qaPIDTOFDynamic.cxx +/// \author Nicolò Jacazio nicolo.jacazio@cern.ch +/// \brief Implementation for QA tasks of the TOF PID quantities +/// + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/TableProducer/PID/pidTOFBase.h" + +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::track; + +/// Task to produce the TOF QA plots with dynamic columns +struct tofPidQaDynamic { + Service tofResponse; + Service ccdb; + static constexpr int Np = 9; + static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"}; + static constexpr std::string_view hexpected[Np] = {"expected/El", "expected/Mu", "expected/Pi", + "expected/Ka", "expected/Pr", "expected/De", + "expected/Tr", "expected/He", "expected/Al"}; + static constexpr std::string_view hdelta[Np] = {"delta/El", "delta/Mu", "delta/Pi", + "delta/Ka", "delta/Pr", "delta/De", + "delta/Tr", "delta/He", "delta/Al"}; + static constexpr std::string_view hdelta_pt[Np] = {"delta/pt/El", "delta/pt/Mu", "delta/pt/Pi", + "delta/pt/Ka", "delta/pt/Pr", "delta/pt/De", + "delta/pt/Tr", "delta/pt/He", "delta/pt/Al"}; + + static constexpr std::string_view hdelta_etaphi[Np] = {"delta/etaphi/El", "delta/etaphi/Mu", "delta/etaphi/Pi", + "delta/etaphi/Ka", "delta/etaphi/Pr", "delta/etaphi/De", + "delta/etaphi/Tr", "delta/etaphi/He", "delta/etaphi/Al"}; + + // Ev. Time fill + static constexpr std::string_view hdelta_evtime_fill[Np] = {"delta/evtime/fill/El", "delta/evtime/fill/Mu", "delta/evtime/fill/Pi", + "delta/evtime/fill/Ka", "delta/evtime/fill/Pr", "delta/evtime/fill/De", + "delta/evtime/fill/Tr", "delta/evtime/fill/He", "delta/evtime/fill/Al"}; + static constexpr std::string_view hdelta_pt_evtime_fill[Np] = {"delta/pt/evtime/fill/El", "delta/pt/evtime/fill/Mu", "delta/pt/evtime/fill/Pi", + "delta/pt/evtime/fill/Ka", "delta/pt/evtime/fill/Pr", "delta/pt/evtime/fill/De", + "delta/pt/evtime/fill/Tr", "delta/pt/evtime/fill/He", "delta/pt/evtime/fill/Al"}; + // Ev. Time TOF + static constexpr std::string_view hdelta_evtime_tof[Np] = {"delta/evtime/tof/El", "delta/evtime/tof/Mu", "delta/evtime/tof/Pi", + "delta/evtime/tof/Ka", "delta/evtime/tof/Pr", "delta/evtime/tof/De", + "delta/evtime/tof/Tr", "delta/evtime/tof/He", "delta/evtime/tof/Al"}; + static constexpr std::string_view hdelta_pt_evtime_tof[Np] = {"delta/pt/evtime/tof/El", "delta/pt/evtime/tof/Mu", "delta/pt/evtime/tof/Pi", + "delta/pt/evtime/tof/Ka", "delta/pt/evtime/tof/Pr", "delta/pt/evtime/tof/De", + "delta/pt/evtime/tof/Tr", "delta/pt/evtime/tof/He", "delta/pt/evtime/tof/Al"}; + // Ev. Time FT0 + static constexpr std::string_view hdelta_evtime_ft0[Np] = {"delta/evtime/ft0/El", "delta/evtime/ft0/Mu", "delta/evtime/ft0/Pi", + "delta/evtime/ft0/Ka", "delta/evtime/ft0/Pr", "delta/evtime/ft0/De", + "delta/evtime/ft0/Tr", "delta/evtime/ft0/He", "delta/evtime/ft0/Al"}; + static constexpr std::string_view hdelta_pt_evtime_ft0[Np] = {"delta/pt/evtime/ft0/El", "delta/pt/evtime/ft0/Mu", "delta/pt/evtime/ft0/Pi", + "delta/pt/evtime/ft0/Ka", "delta/pt/evtime/ft0/Pr", "delta/pt/evtime/ft0/De", + "delta/pt/evtime/ft0/Tr", "delta/pt/evtime/ft0/He", "delta/pt/evtime/ft0/Al"}; + // Ev. Time TOF+FT0 + static constexpr std::string_view hdelta_evtime_tofft0[Np] = {"delta/evtime/tofft0/El", "delta/evtime/tofft0/Mu", "delta/evtime/tofft0/Pi", + "delta/evtime/tofft0/Ka", "delta/evtime/tofft0/Pr", "delta/evtime/tofft0/De", + "delta/evtime/tofft0/Tr", "delta/evtime/tofft0/He", "delta/evtime/tofft0/Al"}; + static constexpr std::string_view hdelta_pt_evtime_tofft0[Np] = {"delta/pt/evtime/tofft0/El", "delta/pt/evtime/tofft0/Mu", "delta/pt/evtime/tofft0/Pi", + "delta/pt/evtime/tofft0/Ka", "delta/pt/evtime/tofft0/Pr", "delta/pt/evtime/tofft0/De", + "delta/pt/evtime/tofft0/Tr", "delta/pt/evtime/tofft0/He", "delta/pt/evtime/tofft0/Al"}; + static constexpr std::string_view hexpsigma[Np] = {"expsigma/El", "expsigma/Mu", "expsigma/Pi", + "expsigma/Ka", "expsigma/Pr", "expsigma/De", + "expsigma/Tr", "expsigma/He", "expsigma/Al"}; + static constexpr std::string_view hnsigma[Np] = {"nsigma/El", "nsigma/Mu", "nsigma/Pi", + "nsigma/Ka", "nsigma/Pr", "nsigma/De", + "nsigma/Tr", "nsigma/He", "nsigma/Al"}; + static constexpr std::string_view hnsigma_pt[Np] = {"nsigma/pt/El", "nsigma/pt/Mu", "nsigma/pt/Pi", + "nsigma/pt/Ka", "nsigma/pt/Pr", "nsigma/pt/De", + "nsigma/pt/Tr", "nsigma/pt/He", "nsigma/pt/Al"}; + + // Ev. Time fill + static constexpr std::string_view hnsigma_evtime_fill[Np] = {"nsigma/evtime/fill/El", "nsigma/evtime/fill/Mu", "nsigma/evtime/fill/Pi", + "nsigma/evtime/fill/Ka", "nsigma/evtime/fill/Pr", "nsigma/evtime/fill/De", + "nsigma/evtime/fill/Tr", "nsigma/evtime/fill/He", "nsigma/evtime/fill/Al"}; + static constexpr std::string_view hnsigma_pt_evtime_fill[Np] = {"nsigma/pt/evtime/fill/El", "nsigma/pt/evtime/fill/Mu", "nsigma/pt/evtime/fill/Pi", + "nsigma/pt/evtime/fill/Ka", "nsigma/pt/evtime/fill/Pr", "nsigma/pt/evtime/fill/De", + "nsigma/pt/evtime/fill/Tr", "nsigma/pt/evtime/fill/He", "nsigma/pt/evtime/fill/Al"}; + // Ev. Time TOF + static constexpr std::string_view hnsigma_evtime_tof[Np] = {"nsigma/evtime/tof/El", "nsigma/evtime/tof/Mu", "nsigma/evtime/tof/Pi", + "nsigma/evtime/tof/Ka", "nsigma/evtime/tof/Pr", "nsigma/evtime/tof/De", + "nsigma/evtime/tof/Tr", "nsigma/evtime/tof/He", "nsigma/evtime/tof/Al"}; + static constexpr std::string_view hnsigma_pt_evtime_tof[Np] = {"nsigma/pt/evtime/tof/El", "nsigma/pt/evtime/tof/Mu", "nsigma/pt/evtime/tof/Pi", + "nsigma/pt/evtime/tof/Ka", "nsigma/pt/evtime/tof/Pr", "nsigma/pt/evtime/tof/De", + "nsigma/pt/evtime/tof/Tr", "nsigma/pt/evtime/tof/He", "nsigma/pt/evtime/tof/Al"}; + // Ev. Time FT0 + static constexpr std::string_view hnsigma_evtime_ft0[Np] = {"nsigma/evtime/ft0/El", "nsigma/evtime/ft0/Mu", "nsigma/evtime/ft0/Pi", + "nsigma/evtime/ft0/Ka", "nsigma/evtime/ft0/Pr", "nsigma/evtime/ft0/De", + "nsigma/evtime/ft0/Tr", "nsigma/evtime/ft0/He", "nsigma/evtime/ft0/Al"}; + static constexpr std::string_view hnsigma_pt_evtime_ft0[Np] = {"nsigma/pt/evtime/ft0/El", "nsigma/pt/evtime/ft0/Mu", "nsigma/pt/evtime/ft0/Pi", + "nsigma/pt/evtime/ft0/Ka", "nsigma/pt/evtime/ft0/Pr", "nsigma/pt/evtime/ft0/De", + "nsigma/pt/evtime/ft0/Tr", "nsigma/pt/evtime/ft0/He", "nsigma/pt/evtime/ft0/Al"}; + // Ev. Time TOF+FT0 + static constexpr std::string_view hnsigma_evtime_tofft0[Np] = {"nsigma/evtime/tofft0/El", "nsigma/evtime/tofft0/Mu", "nsigma/evtime/tofft0/Pi", + "nsigma/evtime/tofft0/Ka", "nsigma/evtime/tofft0/Pr", "nsigma/evtime/tofft0/De", + "nsigma/evtime/tofft0/Tr", "nsigma/evtime/tofft0/He", "nsigma/evtime/tofft0/Al"}; + static constexpr std::string_view hnsigma_pt_evtime_tofft0[Np] = {"nsigma/pt/evtime/tofft0/El", "nsigma/pt/evtime/tofft0/Mu", "nsigma/pt/evtime/tofft0/Pi", + "nsigma/pt/evtime/tofft0/Ka", "nsigma/pt/evtime/tofft0/Pr", "nsigma/pt/evtime/tofft0/De", + "nsigma/pt/evtime/tofft0/Tr", "nsigma/pt/evtime/tofft0/He", "nsigma/pt/evtime/tofft0/Al"}; + + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable logAxis{"logAxis", 0, "Flag to use a log momentum axis"}; + Configurable nBinsP{"nBinsP", 400, "Number of bins for the momentum"}; + Configurable minP{"minP", 0.1f, "Minimum momentum in range"}; + Configurable maxP{"maxP", 5.f, "Maximum momentum in range"}; + ConfigurableAxis etaBins{"etaBins", {100, -1.f, 1.f}, "Binning in eta"}; + ConfigurableAxis phiBins{"phiBins", {100, 0, TMath::TwoPi()}, "Binning in eta"}; + ConfigurableAxis trackLengthBins{"trackLengthBins", {100, 0, 1000.f}, "Binning in track length plot"}; + ConfigurableAxis deltaBins{"deltaBins", {200, -1000.f, 1000.f}, "Binning in Delta (T-Texp-T0)"}; + ConfigurableAxis expSigmaBins{"expSigmaBins", {200, 0.f, 200.f}, "Binning in expected Sigma"}; + ConfigurableAxis nSigmaBins{"nSigmaBins", {401, -10.025f, 10.025f}, "Binning in NSigma"}; + Configurable applyEvSel{"applyEvSel", 2, "Flag to apply event selection cut: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection"}; + Configurable trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; + Configurable applyRapidityCut{"applyRapidityCut", false, "Flag to apply rapidity cut"}; + Configurable enableEvTimeSplitting{"enableEvTimeSplitting", false, "Flag to enable histograms splitting depending on the Event Time used"}; + Configurable produceDeltaTEtaPhiMap{"produceDeltaTEtaPhiMap", false, "Produces the map of the delta time as a function of eta and phi"}; + Configurable ptDeltaTEtaPhiMapMin{"ptDeltaTEtaPhiMapMin", 1.45f, "Threshold in pT to build the map of the delta time as a function of eta and phi"}; + Configurable ptDeltaTEtaPhiMapMax{"ptDeltaTEtaPhiMapMax", 1.55f, "Threshold in pT to build the map of the delta time as a function of eta and phi"}; + Configurable splitSignalPerCharge{"splitSignalPerCharge", true, "Split the signal per charge (reduces memory footprint if off)"}; + Configurable enableVsMomentumHistograms{"enableVsMomentumHistograms", 0, "1: Enables plots vs momentum instead of just pT 2: Enables plots vs momentum vs eta instead of just pT (reduces memory footprint if off)"}; + Configurable requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"}; + Configurable pvContributorsMin{"pvContributorsMin", -10, "Minimum pvContributors"}; + Configurable pvContributorsMax{"pvContributorsMax", 10000, "Maximum pvContributors"}; + + template + void initPerParticle(const AxisSpec& pAxis, + const AxisSpec& ptAxis, + const AxisSpec& etaAxis, + const AxisSpec& phiAxis, + const AxisSpec& chargeAxis) + { + static_assert(id >= 0 && id <= PID::Alpha && "Particle index outside limits"); + bool enableFullHistos = false; + int enabledProcesses = 0; + switch (id) { // Skipping disabled particles +#define particleCase(particleId) \ + case PID::particleId: \ + if (!doprocess##particleId && !doprocessFull##particleId) { \ + return; \ + } \ + if (doprocess##particleId) { \ + enabledProcesses++; \ + } \ + if (doprocessFull##particleId) { \ + enableFullHistos = true; \ + enabledProcesses++; \ + } \ + LOGF(info, "Enabled TOF QA for %s %s", #particleId, pT[id]); \ + break; + + particleCase(Electron); + particleCase(Muon); + particleCase(Pion); + particleCase(Kaon); + particleCase(Proton); + particleCase(Deuteron); + particleCase(Triton); + particleCase(Helium3); + particleCase(Alpha); +#undef particleCase + } + if (enabledProcesses != 1) { + LOG(fatal) << "Cannot enable more than one process function per particle, check and retry!"; + } + + // NSigma + const char* axisTitle = Form("N_{#sigma}^{TOF}(%s)", pT[id]); + const AxisSpec nSigmaAxis{nSigmaBins, axisTitle}; + histos.add(hnsigma[id].data(), axisTitle, kTH2F, {pAxis, nSigmaAxis}); + if (splitSignalPerCharge) { + histos.add(hnsigma_pt[id].data(), axisTitle, kTH3F, {ptAxis, nSigmaAxis, chargeAxis}); + } else { + histos.add(hnsigma_pt[id].data(), axisTitle, kTH2F, {ptAxis, nSigmaAxis}); + } + if (enableEvTimeSplitting) { + histos.add(hnsigma_evtime_fill[id].data(), axisTitle, kTH2F, {pAxis, nSigmaAxis}); + histos.add(hnsigma_evtime_tof[id].data(), axisTitle, kTH2F, {pAxis, nSigmaAxis}); + histos.add(hnsigma_evtime_ft0[id].data(), axisTitle, kTH2F, {pAxis, nSigmaAxis}); + histos.add(hnsigma_evtime_tofft0[id].data(), axisTitle, kTH2F, {pAxis, nSigmaAxis}); + + if (splitSignalPerCharge) { + histos.add(hnsigma_pt_evtime_fill[id].data(), axisTitle, kTH3F, {ptAxis, nSigmaAxis, chargeAxis}); + histos.add(hnsigma_pt_evtime_tof[id].data(), axisTitle, kTH3F, {ptAxis, nSigmaAxis, chargeAxis}); + histos.add(hnsigma_pt_evtime_ft0[id].data(), axisTitle, kTH3F, {ptAxis, nSigmaAxis, chargeAxis}); + histos.add(hnsigma_pt_evtime_tofft0[id].data(), axisTitle, kTH3F, {ptAxis, nSigmaAxis, chargeAxis}); + } else { + histos.add(hnsigma_pt_evtime_fill[id].data(), axisTitle, kTH2F, {ptAxis, nSigmaAxis}); + histos.add(hnsigma_pt_evtime_tof[id].data(), axisTitle, kTH2F, {ptAxis, nSigmaAxis}); + histos.add(hnsigma_pt_evtime_ft0[id].data(), axisTitle, kTH2F, {ptAxis, nSigmaAxis}); + histos.add(hnsigma_pt_evtime_tofft0[id].data(), axisTitle, kTH2F, {ptAxis, nSigmaAxis}); + } + } + + if (!enableFullHistos) { // Enabling only NSigma for tiny tables + return; + } + + // Exp signal + const AxisSpec expAxis{1000, 0, 2e6, Form("t_{exp}(%s) (ps)", pT[id])}; + histos.add(hexpected[id].data(), "", kTH2F, {pAxis, expAxis}); + + // Signal - Expected signal + const AxisSpec deltaAxis{deltaBins, Form("t-t_{ev}-t_{exp}(%s) (ps)", pT[id])}; + axisTitle = Form("#Delta^{TOF}(%s)", pT[id]); + histos.add(hdelta[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis}); + if (splitSignalPerCharge) { + histos.add(hdelta_pt[id].data(), axisTitle, kTH3F, {ptAxis, deltaAxis, chargeAxis}); + } else { + histos.add(hdelta_pt[id].data(), axisTitle, kTH2F, {ptAxis, deltaAxis}); + } + if (produceDeltaTEtaPhiMap) { + histos.add(hdelta_etaphi[id].data(), Form("%s, %.2f < #it{p}_{T} < %.2f", axisTitle, ptDeltaTEtaPhiMapMin.value, ptDeltaTEtaPhiMapMax.value), kTH3F, {etaAxis, phiAxis, deltaAxis}); + } + + // Exp Sigma + const AxisSpec expSigmaAxis{expSigmaBins, Form("Exp_{#sigma}^{TOF}(%s) (ps)", pT[id])}; + histos.add(hexpsigma[id].data(), "", kTH2F, {pAxis, expSigmaAxis}); + + if (!enableEvTimeSplitting) { // Returning if the plots with the different event time are not reqested + return; + } + + if (enableVsMomentumHistograms == 1) { + histos.add(hdelta_evtime_fill[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis}); + histos.add(hdelta_evtime_tof[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis}); + histos.add(hdelta_evtime_ft0[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis}); + histos.add(hdelta_evtime_tofft0[id].data(), axisTitle, kTH2F, {pAxis, deltaAxis}); + } else if (enableVsMomentumHistograms == 2) { + histos.add(hdelta_evtime_fill[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis}); + histos.add(hdelta_evtime_tof[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis}); + histos.add(hdelta_evtime_ft0[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis}); + histos.add(hdelta_evtime_tofft0[id].data(), axisTitle, kTH3F, {pAxis, etaAxis, deltaAxis}); + } + + if (splitSignalPerCharge) { + histos.add(hdelta_pt_evtime_fill[id].data(), axisTitle, kTH3F, {ptAxis, deltaAxis, chargeAxis}); + histos.add(hdelta_pt_evtime_tof[id].data(), axisTitle, kTH3F, {ptAxis, deltaAxis, chargeAxis}); + histos.add(hdelta_pt_evtime_ft0[id].data(), axisTitle, kTH3F, {ptAxis, deltaAxis, chargeAxis}); + histos.add(hdelta_pt_evtime_tofft0[id].data(), axisTitle, kTH3F, {ptAxis, deltaAxis, chargeAxis}); + } else { + histos.add(hdelta_pt_evtime_fill[id].data(), axisTitle, kTH2F, {ptAxis, deltaAxis}); + histos.add(hdelta_pt_evtime_tof[id].data(), axisTitle, kTH2F, {ptAxis, deltaAxis}); + histos.add(hdelta_pt_evtime_ft0[id].data(), axisTitle, kTH2F, {ptAxis, deltaAxis}); + histos.add(hdelta_pt_evtime_tofft0[id].data(), axisTitle, kTH2F, {ptAxis, deltaAxis}); + } + } + + void init(o2::framework::InitContext& context) + { + tofResponse->initSetup(ccdb, context); + const AxisSpec multAxis{100, 0, 100, "TOF multiplicity"}; + const AxisSpec vtxZAxis{100, -20, 20, "Vtx_{z} (cm)"}; + const AxisSpec contributorsAxis{100, 0, 1000, "PV contributors"}; + const AxisSpec etaAxis{etaBins, "#it{#eta}"}; + const AxisSpec phiAxis{phiBins, "#it{#phi}"}; + const AxisSpec colTimeAxis{100, -2000, 2000, "Collision time (ps)"}; + const AxisSpec colTimeResoAxis{100, 0, 1000, "#sigma_{Collision time} (ps)"}; + const AxisSpec lAxis{trackLengthBins, "Track length (cm)"}; + const AxisSpec ptResoAxis{100, 0, 0.1, "#sigma_{#it{p}_{T}}"}; + AxisSpec ptAxis{nBinsP, minP, maxP, "#it{p}_{T}/|Z| (GeV/#it{c})"}; + AxisSpec pAxis{nBinsP, minP, maxP, "#it{p}/|Z| (GeV/#it{c})"}; + AxisSpec pExpAxis{nBinsP, minP, maxP, "#it{p}_{Exp. TOF} (GeV/#it{c})"}; + if (logAxis) { + ptAxis.makeLogarithmic(); + pAxis.makeLogarithmic(); + pExpAxis.makeLogarithmic(); + } + const AxisSpec tofAxis{10000, 0, 2e6, "TOF Signal (ps)"}; + const AxisSpec chargeAxis{2, -2.f, 2.f, "Charge"}; + + // Event properties + auto h = histos.add("event/evsel", "", kTH1D, {{10, 0.5, 10.5, "Ev. Sel."}}); + h->GetXaxis()->SetBinLabel(1, "Events read"); + h->GetXaxis()->SetBinLabel(2, "Passed ev. sel."); + h->GetXaxis()->SetBinLabel(3, "Passed vtx Z"); + h->GetXaxis()->SetBinLabel(4, Form("Passed pvContributorsMin %f", pvContributorsMin.value)); + h->GetXaxis()->SetBinLabel(5, Form("Passed pvContributorsMax %f", pvContributorsMax.value)); + + h = histos.add("event/trackselection", "", kTH1D, {{10, 0.5, 10.5, "Selection passed"}}); + h->GetXaxis()->SetBinLabel(1, "Tracks read"); + h->GetXaxis()->SetBinLabel(2, "isGlobalTrack"); + h->GetXaxis()->SetBinLabel(3, "hasITS"); + h->GetXaxis()->SetBinLabel(4, "hasTPC"); + h->GetXaxis()->SetBinLabel(5, "hasTOF"); + h->GetXaxis()->SetBinLabel(6, "goodTOFMatch"); + + histos.add("event/pvcontributors", "", kTH1D, {contributorsAxis}); + histos.add("event/vertexz", "", kTH1D, {vtxZAxis}); + h = histos.add("event/particlehypo", "", kTH1D, {{10, 0, 10, "PID in tracking"}}); + for (int i = 0; i < 9; i++) { + h->GetXaxis()->SetBinLabel(i + 1, PID::getName(i)); + } + + histos.add("event/evtime/colltime", "collisionTime()", kTH1D, {colTimeAxis}); + histos.add("event/evtime/colltimereso", "collisionTimeRes()", kTH2F, {multAxis, colTimeResoAxis}); + histos.add("event/evtime/undef", "Undefined event time", kTH1D, {colTimeAxis}); + histos.add("event/evtime/undefreso", "Undefined event time reso.", kTH2F, {multAxis, colTimeResoAxis}); + histos.add("event/evtime/avail", "Available event time", kTH1D, {colTimeAxis}); + histos.add("event/evtime/availreso", "Available event time reso.", kTH2F, {multAxis, colTimeResoAxis}); + histos.add("event/evtime/ft0tof", "FT0+TOF event time", kTH1D, {colTimeAxis}); + histos.add("event/evtime/ft0tofreso", "FT0+TOF event time reso.", kTH2F, {multAxis, colTimeResoAxis}); + histos.add("event/evtime/tof", "TOF event time", kTH1D, {colTimeAxis}); + histos.add("event/evtime/tofreso", "TOF event time reso.", kTH2F, {multAxis, colTimeResoAxis}); + histos.add("event/evtime/ft0", "FT0 event time", kTH1D, {colTimeAxis}); + histos.add("event/evtime/ft0reso", "FT0 event time reso.", kTH2F, {multAxis, colTimeResoAxis}); + + histos.add("event/tofsignal", "TOF signal", kTH2F, {pAxis, tofAxis}); + histos.add("event/tofsignalunassigned", "TOF signal (unassigned tracks)", kTH2F, {pAxis, tofAxis}); + histos.add("event/pexp", "", kTH2F, {pAxis, pExpAxis}); + histos.add("event/eta", "", kTH1D, {etaAxis}); + histos.add("event/phi", "", kTH1D, {phiAxis}); + histos.add("event/etaphi", "", kTH2F, {etaAxis, phiAxis}); + histos.add("event/length", "", kTH1D, {lAxis}); + histos.add("event/pt", "", kTH1D, {ptAxis}); + histos.add("event/p", "", kTH1D, {pAxis}); + // histos.add("event/ptreso", "", kTH2F, {pAxis, ptResoAxis}); + + // Extra histograms for consistency with non Dynamic columns + histos.add("check/beta", "beta #Delta", kTH1D, {{1000, -10, 10, "beta #Delta"}}); + histos.add("check/mass", "mass #Delta", kTH1D, {{1000, -10, 10, "mass #Delta"}}); + histos.add("check/El/reso", "reso #Delta", kTH1D, {{1000, -10, 10, "Reso #Delta"}}); + histos.add("check/El/exp", "exp #Delta", kTH1D, {{1000, -10, 10, "exp #Delta"}}); + histos.add("check/El/delta", "#Delta #Delta", kTH1D, {{1000, -10, 10, "#Delta #Delta"}}); + histos.add("check/El/nsigma", "nsigma #Delta", kTH1D, {{1000, -10, 10, "nsigma #Delta"}}); + histos.addClone("check/El/", "check/Mu/"); + histos.addClone("check/El/", "check/Pi/"); + histos.addClone("check/El/", "check/Ka/"); + histos.addClone("check/El/", "check/Pr/"); + histos.addClone("check/El/", "check/De/"); + histos.addClone("check/El/", "check/Tr/"); + histos.addClone("check/El/", "check/He/"); + histos.addClone("check/El/", "check/Al/"); + + static_for<0, 8>([&](auto i) { + initPerParticle(pAxis, ptAxis, etaAxis, phiAxis, chargeAxis); + }); + LOG(info) << "QA PID TOF histograms:"; + histos.print(); + } + + template + bool isEventSelected(const CollisionType& collision, const TrackType& tracks) + { + + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 1); + } + if (applyEvSel == 1) { + if (!collision.sel7()) { + return false; + } + } else if (applyEvSel == 2) { + if (!collision.sel8()) { + return false; + } + } + + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 2); + } + + int tofmult = 0; + float evtime = 0.f; + float evtimereso = 0.f; + int evtimeflag = 0; + + if constexpr (fillHistograms) { + for (auto t : tracks) { + if (!t.hasTOF()) { // Skipping tracks without TOF + continue; + } + tofmult++; + evtime = t.tofEvTime(); + evtimereso = t.tofEvTimeErr(); + evtimeflag = 0; + if (t.isEvTimeDefined()) { + evtimeflag = 1; + } + if (t.isEvTimeTOF() && t.isEvTimeT0AC()) { + evtimeflag = 2; + } else if (t.isEvTimeTOF()) { + evtimeflag = 3; + } else if (t.isEvTimeT0AC()) { + evtimeflag = 4; + } + } + } + if (std::abs(collision.posZ()) > 10.f) { + return false; + } + // Count the number of contributors + int pvContributors = 0; + for (const auto& trk : tracks) { + if (trk.isPVContributor()) { + pvContributors++; + } + } + histos.fill(HIST("event/pvcontributors"), pvContributors); + if (pvContributors < pvContributorsMin) { + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 4); + } + if (pvContributors > pvContributorsMax) { + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 5); + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 6); + histos.fill(HIST("event/vertexz"), collision.posZ()); + + histos.fill(HIST("event/evtime/colltime"), collision.collisionTime() * 1000.f); + histos.fill(HIST("event/evtime/colltimereso"), tofmult, collision.collisionTimeRes() * 1000.f); + + switch (evtimeflag) { + case 0: + histos.fill(HIST("event/evtime/undef"), evtime); + histos.fill(HIST("event/evtime/undefreso"), tofmult, evtimereso); + break; + case 1: + histos.fill(HIST("event/evtime/avail"), evtime); + histos.fill(HIST("event/evtime/availreso"), tofmult, evtimereso); + break; + case 2: + histos.fill(HIST("event/evtime/ft0tof"), evtime); + histos.fill(HIST("event/evtime/ft0tofreso"), tofmult, evtimereso); + break; + case 3: + histos.fill(HIST("event/evtime/tof"), evtime); + histos.fill(HIST("event/evtime/tofreso"), tofmult, evtimereso); + break; + case 4: + histos.fill(HIST("event/evtime/tof"), evtime); + histos.fill(HIST("event/evtime/tofreso"), tofmult, evtimereso); + break; + default: + LOG(fatal) << "Unrecognized Event time flag"; + break; + } + } + return true; + } + + template + bool isTrackSelected(const CollisionType&, const TrackType& track) + { + if constexpr (fillHistograms) { + histos.fill(HIST("event/trackselection"), 1.f); + } + if (!track.isGlobalTrack()) { // Skipping non global tracks + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/trackselection"), 2.f); + } + if (!track.hasITS()) { // Skipping tracks without ITS + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/trackselection"), 3.f); + } + if (!track.hasTPC()) { // Skipping tracks without TPC + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/trackselection"), 4.f); + } + if (!track.hasTOF()) { // Skipping tracks without TOF + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/trackselection"), 5.f); + } + if (requireGoodMatchTracks.value && !track.goodTOFMatch()) { // Skipping tracks without good match + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/trackselection"), 6.f); + histos.fill(HIST("event/particlehypo"), track.pidForTracking()); + if (track.has_collision()) { + histos.fill(HIST("event/tofsignal"), track.p(), track.tofSignal()); + } else { + histos.fill(HIST("event/tofsignalunassigned"), track.p(), track.tofSignal()); + } + histos.fill(HIST("event/pexp"), track.p(), track.tofExpMom()); + histos.fill(HIST("event/eta"), track.eta()); + histos.fill(HIST("event/phi"), track.phi()); + histos.fill(HIST("event/etaphi"), track.eta(), track.phi()); + histos.fill(HIST("event/length"), track.length()); + histos.fill(HIST("event/pt"), track.pt()); + histos.fill(HIST("event/p"), track.p()); + // histos.fill(HIST("event/ptreso"), track.p(), track.sigma1Pt() * track.pt() * track.pt()); + } + return true; + } + + Filter eventFilter = (applyEvSel.node() == 0) || + ((applyEvSel.node() == 1) && (o2::aod::evsel::sel7 == true)) || + ((applyEvSel.node() == 2) && (o2::aod::evsel::sel8 == true)); + Filter trackFilter = (trackSelection.node() == 0) || + ((trackSelection.node() == 1) && requireGlobalTrackInFilter()) || + ((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) || + ((trackSelection.node() == 3) && requireGlobalTrackWoDCAInFilter()) || + ((trackSelection.node() == 4) && requireQualityTracksInFilter()) || + ((trackSelection.node() == 5) && requireInAcceptanceTracksInFilter()); + using CollisionCandidate = soa::Filtered>::iterator; + using TrackCandidates = soa::Join; + + void process(CollisionCandidate const& collision, + soa::Filtered const& tracks, + o2::aod::BCsWithTimestamps const&) + { + tofResponse->processSetup(collision.bc_as()); + + isEventSelected(collision, tracks); + for (auto t : tracks) { + isTrackSelected(collision, t); + } + } + + template + void processSingleParticle(CollisionCandidate const& collision, + TrackType const& tracks) + { + if (!isEventSelected(collision, tracks)) { + return; + } + + for (auto t : tracks) { + if (!isTrackSelected(collision, t)) { + continue; + } + + if (applyRapidityCut) { + if (std::abs(t.rapidity(PID::getMass(id))) > 0.5) { + continue; + } + } + + const auto nsigma = t.tofNSigmaDyn(id); + histos.fill(HIST(hnsigma[id]), t.p(), nsigma); + if (splitSignalPerCharge) { + histos.fill(HIST(hnsigma_pt[id]), t.pt(), nsigma, t.sign()); + } else { + histos.fill(HIST(hnsigma_pt[id]), t.pt(), nsigma); + } + // Filling info split per ev. time + if (enableEvTimeSplitting) { + if (t.isEvTimeTOF() && t.isEvTimeT0AC()) { // TOF + FT0 Ev. Time + histos.fill(HIST(hnsigma_evtime_tofft0[id]), t.p(), nsigma); + if (splitSignalPerCharge) { + histos.fill(HIST(hnsigma_pt_evtime_tofft0[id]), t.pt(), nsigma, t.sign()); + } else { + histos.fill(HIST(hnsigma_pt_evtime_tofft0[id]), t.pt(), nsigma); + } + } else if (t.isEvTimeT0AC()) { // FT0 Ev. Time + histos.fill(HIST(hnsigma_evtime_ft0[id]), t.p(), nsigma); + if (splitSignalPerCharge) { + histos.fill(HIST(hnsigma_pt_evtime_ft0[id]), t.pt(), nsigma, t.sign()); + } else { + histos.fill(HIST(hnsigma_pt_evtime_ft0[id]), t.pt(), nsigma); + } + } else if (t.isEvTimeTOF()) { // TOF Ev. Time + histos.fill(HIST(hnsigma_evtime_tof[id]), t.p(), nsigma); + if (splitSignalPerCharge) { + histos.fill(HIST(hnsigma_pt_evtime_tof[id]), t.pt(), nsigma, t.sign()); + } else { + histos.fill(HIST(hnsigma_pt_evtime_tof[id]), t.pt(), nsigma); + } + } else { // No Ev. Time -> Fill Ev. Time + histos.fill(HIST(hnsigma_evtime_fill[id]), t.p(), nsigma); + if (splitSignalPerCharge) { + histos.fill(HIST(hnsigma_pt_evtime_fill[id]), t.pt(), nsigma, t.sign()); + } else { + histos.fill(HIST(hnsigma_pt_evtime_fill[id]), t.pt(), nsigma); + } + } + } + + if constexpr (fillFullHistograms) { + const float& tof = t.tofSignal() - t.tofEvTime(); + const auto& diff = o2::aod::pidutils::tofExpTime(t); + + // Fill histograms + histos.fill(HIST(hexpected[id]), t.p(), tof - diff); + histos.fill(HIST(hdelta[id]), t.p(), diff); + if (splitSignalPerCharge) { + histos.fill(HIST(hdelta_pt[id]), t.pt(), diff, t.sign()); + } else { + histos.fill(HIST(hdelta_pt[id]), t.pt(), diff); + } + + if (produceDeltaTEtaPhiMap) { + if (t.pt() > ptDeltaTEtaPhiMapMin && t.pt() < ptDeltaTEtaPhiMapMax) { + histos.fill(HIST(hdelta_etaphi[id]), t.eta(), t.phi(), diff); + } + } + histos.fill(HIST(hexpsigma[id]), t.p(), t.tofExpSigmaDyn(id)); + + // Filling info split per ev. time + if (enableEvTimeSplitting) { + if (t.isEvTimeTOF() && t.isEvTimeT0AC()) { // TOF + FT0 Ev. Time + if (enableVsMomentumHistograms == 1) { + histos.fill(HIST(hdelta_evtime_tofft0[id]), t.p(), diff); + } else if (enableVsMomentumHistograms == 2) { + histos.fill(HIST(hdelta_evtime_tofft0[id]), t.p(), t.eta(), diff); + } + if (splitSignalPerCharge) { + histos.fill(HIST(hdelta_pt_evtime_tofft0[id]), t.pt(), diff, t.sign()); + } else { + histos.fill(HIST(hdelta_pt_evtime_tofft0[id]), t.pt(), diff); + } + } else if (t.isEvTimeT0AC()) { // FT0 Ev. Time + if (enableVsMomentumHistograms == 1) { + histos.fill(HIST(hdelta_evtime_ft0[id]), t.p(), diff); + } else if (enableVsMomentumHistograms == 2) { + histos.fill(HIST(hdelta_evtime_ft0[id]), t.p(), t.eta(), diff); + } + if (splitSignalPerCharge) { + histos.fill(HIST(hdelta_pt_evtime_ft0[id]), t.pt(), diff, t.sign()); + } else { + histos.fill(HIST(hdelta_pt_evtime_ft0[id]), t.pt(), diff); + } + } else if (t.isEvTimeTOF()) { // TOF Ev. Time + if (enableVsMomentumHistograms == 1) { + histos.fill(HIST(hdelta_evtime_tof[id]), t.p(), diff); + } else if (enableVsMomentumHistograms == 2) { + histos.fill(HIST(hdelta_evtime_tof[id]), t.p(), t.eta(), diff); + } + if (splitSignalPerCharge) { + histos.fill(HIST(hdelta_pt_evtime_tof[id]), t.pt(), diff, t.sign()); + } else { + histos.fill(HIST(hdelta_pt_evtime_tof[id]), t.pt(), diff); + } + } else { // No Ev. Time -> Fill Ev. Time + if (enableVsMomentumHistograms == 1) { + histos.fill(HIST(hdelta_evtime_fill[id]), t.p(), diff); + } else if (enableVsMomentumHistograms == 2) { + histos.fill(HIST(hdelta_evtime_fill[id]), t.p(), t.eta(), diff); + } + if (splitSignalPerCharge) { + histos.fill(HIST(hdelta_pt_evtime_fill[id]), t.pt(), diff, t.sign()); + } else { + histos.fill(HIST(hdelta_pt_evtime_fill[id]), t.pt(), diff); + } + } + } + } + } + } + + // QA of nsigma only tables +#define makeProcessFunction(inputPid, particleId) \ + void process##particleId(CollisionCandidate const& collision, \ + TrackCandidates const& tracks) \ + { \ + auto tracksWithPid = soa::Attach(tracks); \ + processSingleParticle(collision, tracksWithPid); \ + } \ + PROCESS_SWITCH(tofPidQaDynamic, process##particleId, Form("Process for the %s hypothesis for TOF NSigma QA", #particleId), false); + + makeProcessFunction(El, Electron); + makeProcessFunction(Mu, Muon); + makeProcessFunction(Pi, Pion); + makeProcessFunction(Ka, Kaon); + makeProcessFunction(Pr, Proton); + makeProcessFunction(De, Deuteron); + makeProcessFunction(Tr, Triton); + makeProcessFunction(He, Helium3); + makeProcessFunction(Al, Alpha); +#undef makeProcessFunction + +// QA of full tables +#define makeProcessFunction(inputPid, particleId) \ + void processFull##particleId(CollisionCandidate const& collision, \ + soa::Filtered const& tracks) \ + { \ + auto tracksWithPid = soa::Attach(tracks); \ + processSingleParticle(collision, tracksWithPid); \ + } \ + PROCESS_SWITCH(tofPidQaDynamic, processFull##particleId, Form("Process for the %s hypothesis for full TOF PID QA", #particleId), false); + + makeProcessFunction(El, Electron); + makeProcessFunction(Mu, Muon); + makeProcessFunction(Pi, Pion); + makeProcessFunction(Ka, Kaon); + makeProcessFunction(Pr, Proton); + makeProcessFunction(De, Deuteron); + makeProcessFunction(Tr, Triton); + makeProcessFunction(He, Helium3); + makeProcessFunction(Al, Alpha); +#undef makeProcessFunction + + using TrkPID = soa::Join; + void processDiff(TrkPID const& tracks, aod::Collisions const&) + { + auto tracksWithPid = soa::Attach(tracks); + if (tracks.size() != tracksWithPid.size()) { + LOG(fatal) << "Mismatch in track table size!" << tracks.size() << " vs " << tracksWithPid.size(); + } + for (const auto& t : tracksWithPid) { + if (!t.has_collision()) { // Track was not assigned, cannot compute NSigma (no event time) -> filling with empty table + continue; + } + histos.fill(HIST("check/beta"), t.beta() - t.tofBeta()); + histos.fill(HIST("check/mass"), t.mass() - t.tofMass()); + const float offset = tofResponse->parameters.getTimeShift(t.eta(), t.sign()); + + const auto& trk = tracks.iteratorAt(t.globalIndex()); + if (!trk.hasTOF()) { + continue; + } + histos.fill(HIST("check/El/reso"), t.tofExpSigmaEl() - t.tofExpSigmaDynEl()); + histos.fill(HIST("check/El/exp"), t.tofExpSignalEl(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeEl() - offset); + histos.fill(HIST("check/El/delta"), t.tofExpSignalDiffEl() + t.tofExpTimeEl() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/El/nsigma"), t.tofNSigmaEl() - t.tofNSigmaDynEl()); + + histos.fill(HIST("check/Mu/reso"), t.tofExpSigmaMu() - t.tofExpSigmaDynMu()); + histos.fill(HIST("check/Mu/exp"), t.tofExpSignalMu(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeMu() - offset); + histos.fill(HIST("check/Mu/delta"), t.tofExpSignalDiffMu() + t.tofExpTimeMu() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/Mu/nsigma"), t.tofNSigmaMu() - t.tofNSigmaDynMu()); + + histos.fill(HIST("check/Pi/reso"), t.tofExpSigmaPi() - t.tofExpSigmaDynPi()); + histos.fill(HIST("check/Pi/exp"), t.tofExpSignalPi(t.tofSignal() - t.tofEvTime()) - t.tofExpTimePi() - offset); + histos.fill(HIST("check/Pi/delta"), t.tofExpSignalDiffPi() + t.tofExpTimePi() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/Pi/nsigma"), t.tofNSigmaPi() - t.tofNSigmaDynPi()); + + histos.fill(HIST("check/Ka/reso"), t.tofExpSigmaKa() - t.tofExpSigmaDynKa()); + histos.fill(HIST("check/Ka/exp"), t.tofExpSignalKa(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeKa() - offset); + histos.fill(HIST("check/Ka/delta"), t.tofExpSignalDiffKa() + t.tofExpTimeKa() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/Ka/nsigma"), t.tofNSigmaKa() - t.tofNSigmaDynKa()); + + histos.fill(HIST("check/Pr/reso"), t.tofExpSigmaPr() - t.tofExpSigmaDynPr()); + histos.fill(HIST("check/Pr/exp"), t.tofExpSignalPr(t.tofSignal() - t.tofEvTime()) - t.tofExpTimePr() - offset); + histos.fill(HIST("check/Pr/delta"), t.tofExpSignalDiffPr() + t.tofExpTimePr() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/Pr/nsigma"), t.tofNSigmaPr() - t.tofNSigmaDynPr()); + + histos.fill(HIST("check/De/reso"), t.tofExpSigmaDe() - t.tofExpSigmaDynDe()); + histos.fill(HIST("check/De/exp"), t.tofExpSignalDe(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeDe() - offset); + histos.fill(HIST("check/De/delta"), t.tofExpSignalDiffDe() + t.tofExpTimeDe() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/De/nsigma"), t.tofNSigmaDe() - t.tofNSigmaDynDe()); + + histos.fill(HIST("check/Tr/reso"), t.tofExpSigmaTr() - t.tofExpSigmaDynTr()); + histos.fill(HIST("check/Tr/exp"), t.tofExpSignalTr(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeTr() - offset); + histos.fill(HIST("check/Tr/delta"), t.tofExpSignalDiffTr() + t.tofExpTimeTr() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/Tr/nsigma"), t.tofNSigmaTr() - t.tofNSigmaDynTr()); + + histos.fill(HIST("check/He/reso"), t.tofExpSigmaHe() - t.tofExpSigmaDynHe()); + histos.fill(HIST("check/He/exp"), t.tofExpSignalHe(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeHe() - offset); + histos.fill(HIST("check/He/delta"), t.tofExpSignalDiffHe() + t.tofExpTimeHe() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/He/nsigma"), t.tofNSigmaHe() - t.tofNSigmaDynHe()); + + histos.fill(HIST("check/Al/reso"), t.tofExpSigmaAl() - t.tofExpSigmaDynAl()); + histos.fill(HIST("check/Al/exp"), t.tofExpSignalAl(t.tofSignal() - t.tofEvTime()) - t.tofExpTimeAl() - offset); + histos.fill(HIST("check/Al/delta"), t.tofExpSignalDiffAl() + t.tofExpTimeAl() - t.tofSignal() + t.tofEvTime()); + histos.fill(HIST("check/Al/nsigma"), t.tofNSigmaAl() - t.tofNSigmaDynAl()); + } + } + PROCESS_SWITCH(tofPidQaDynamic, processDiff, "Process diff between Dyn and not Dyn", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + o2::pid::tof::TOFResponseImpl::metadataInfo.initMetadata(cfgc); + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From f5cfa4f2f13d883db9f364081388ab3a5c4e8dd2 Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Tue, 7 Apr 2026 15:30:42 +0200 Subject: [PATCH 191/282] [PWGLF] deuteron proton correlation: change SE and ME strategy and general improvements (#15672) --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 1676 ++++++----------- 1 file changed, 543 insertions(+), 1133 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index f18e85682fd..5aa01f018ab 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -17,11 +17,18 @@ #include "PWGCF/Femto3D/DataModel/singletrackselector.h" #include "Common/Core/RecoDecay.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 "Common/DataModel/TrackSelectionTables.h" #include "CCDB/BasicCCDBManager.h" #include "CCDB/CcdbApi.h" +#include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/DataTypes.h" @@ -29,8 +36,10 @@ #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/StaticFor.h" +#include "Framework/StepTHn.h" #include "Framework/runDataProcessing.h" #include "MathUtils/Utils.h" +#include "ReconstructionDataFormats/Track.h" #include "TGrid.h" #include @@ -53,11 +62,22 @@ using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; +enum Modes { + kDbarPbar = 0, + kDP, + kDbarP, + kDPbar, + kPbarP, + kPbarPbar, + kPP, + kPPbar +}; + struct hadronnucleicorrelation { - // PDG codes and masses used in this analysis - static constexpr int pdgProton = 2212; - static constexpr int pdgDeuteron = 1000010020; + static constexpr int betahasTOFthr = -100; + + SliceCache cache; Configurable mode{"mode", 0, "0: antid-antip, 1: d-p, 2: antid-p, 3: d-antip, 4: antip-p, 5: antip-antip, 6: p-p, 7: p-antip"}; @@ -90,6 +110,9 @@ struct hadronnucleicorrelation { Configurable nsigmaElPr{"nsigmaElPr", 1.0f, "cut nsigma TPC El for protons"}; Configurable nsigmaElDe{"nsigmaElDe", 3.0f, "cut nsigma TPC El for protons"}; Configurable nsigmaTOF{"nsigmaTOF", 3.5f, "cut nsigma TOF"}; + Configurable nsigmaITSPr{"nsigmaITSPr", -2.0f, "cut nsigma ITS Pr"}; + Configurable nsigmaITSDe{"nsigmaITSDe", -2.0f, "cut nsigma ITS De"}; + Configurable doITSPID{"doITSPID", true, "do ITS PID"}; Configurable pTthrpr_TOF{"pTthrpr_TOF", 0.8f, "threshold pT proton to use TOF"}; Configurable pTthrpr_TPCEl{"pTthrpr_TPCEl", 1.0f, "threshold pT proton to use TPC El rejection"}; Configurable pTthrde_TOF{"pTthrde_TOF", 1.0f, "threshold pT deuteron to use TOF"}; @@ -103,9 +126,10 @@ struct hadronnucleicorrelation { Configurable dphi{"dphi", 0.01, "minimum allowed defference in phi_star between two tracks in a pair"}; // Mixing parameters - Configurable _vertexNbinsToMix{"vertexNbinsToMix", 10, "Number of vertexZ bins for the mixing"}; - Configurable _multNsubBins{"multSubBins", 10, "number of sub-bins to perform the mixing within"}; - Configurable maxmultmix{"maxmultmix", 20, "maximum multiplicity to mix"}; + ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 50.0f, 100.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"}; + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; + ColumnBinningPolicy colBinningGen{{confVtxBins, confMultBins}, true}; // pT/A bins Configurable> pTBins{"pTBins", {0.6f, 1.0f, 1.2f, 2.f}, "p_{T} bins"}; @@ -114,7 +138,7 @@ struct hadronnucleicorrelation { ConfigurableAxis DeltaPhiAxis = {"DeltaPhiAxis", {46, -1 * o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf}, "#Delta#phi (rad)"}; using FilteredCollisions = soa::Filtered; - using SimCollisions = aod::McCollisions; + using SimCollisions = soa::Join; using SimParticles = aod::McParticles; using FilteredTracks = soa::Filtered>; // new tables (v3) using FilteredTracksMC = soa::Filtered>; // new tables (v3) @@ -122,34 +146,10 @@ struct hadronnucleicorrelation { HistogramRegistry registry{"registry"}; HistogramRegistry QA{"QA"}; - typedef std::shared_ptr trkType; - typedef std::shared_ptr trkTypeMC; - typedef std::shared_ptr partTypeMC; - typedef std::shared_ptr colType; - typedef std::shared_ptr MCcolType; - - // key: int64_t - value: vector of trkType objects - std::map> selectedtracks_p; - std::map> selectedtracks_d; - std::map> selectedtracks_antid; - std::map> selectedtracks_antip; - - // key: int64_t - value: vector of trkType objects - std::map> selectedparticlesMC_d; - std::map> selectedparticlesMC_p; - std::map> selectedparticlesMC_antid; - std::map> selectedparticlesMC_antip; - - // key: pair of an integer and a float - value: vector of colType objects - // for each key I have a vector of collisions - std::map, std::vector> mixbins_antid; - std::map, std::vector> mixbins_d; - std::map, std::vector> mixbins_antip; - std::map, std::vector> mixbins_p; - std::map, std::vector> mixbinsMC_antid; - std::map, std::vector> mixbinsMC_d; - std::map, std::vector> mixbinsMC_antip; - std::map, std::vector> mixbinsMC_p; + using trkType = const FilteredTracks::iterator*; + using trkTypeMC = const FilteredTracksMC::iterator*; + // typedef std::shared_ptr colType; + // typedef std::shared_ptr MCcolType; std::unique_ptr> Pair = std::make_unique>(); std::unique_ptr> PairMC = std::make_unique>(); @@ -160,22 +160,6 @@ struct hadronnucleicorrelation { std::vector> hCorrEtaPhi_SE; std::vector> hCorrEtaPhi_ME; - // MC histograms - std::vector> hEtaPhiGen_AntiDeAntiPr_SE; - std::vector> hEtaPhiGen_AntiDeAntiPr_ME; - std::vector> hEtaPhiGen_AntiPrAntiPr_SE; - std::vector> hEtaPhiGen_AntiPrAntiPr_ME; - std::vector> hEtaPhiGen_PrPr_SE; - std::vector> hEtaPhiGen_PrPr_ME; - std::vector> hEtaPhiGen_AntiPrPr_SE; - std::vector> hEtaPhiGen_AntiPrPr_ME; - std::vector> hEtaPhiGen_AntiDePr_SE; - std::vector> hEtaPhiGen_AntiDePr_ME; - std::vector> hEtaPhiGen_DeAntiPr_SE; - std::vector> hEtaPhiGen_DeAntiPr_ME; - std::vector> hEtaPhiGen_DePr_SE; - std::vector> hEtaPhiGen_DePr_ME; - int nBinspT; TH2F* hEffpTEta_proton; TH2F* hEffpTEta_antiproton; @@ -215,136 +199,12 @@ struct hadronnucleicorrelation { registry.add("hNEvents", "hNEvents", {HistType::kTH1D, {{7, 0.f, 7.f}}}); registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(1, "Selected"); - registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "events with #bar{d}-#bar{p}"); - registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(3, "events with d-p"); - registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(4, "events with #bar{d}"); - registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(5, "events with d"); - registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(6, "events with #bar{p}"); - registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(7, "events with p"); + registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "Mixing"); registry.add("hNtrig_total", "hNtrig_total", {HistType::kTH1D, {ptBinnedAxis}}); nBinspT = pTBins.value.size() - 1; - if (isMCGen) { - for (int i = 0; i < nBinspT; i++) { - - if (dorapidity) { - // antid-antip - auto htempSEGen_AntiDeAntiPr = registry.add(Form("hEtaPhiGen_AntiDeAntiPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiDeAntiPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrAntiPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrAntiPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_PrPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_PrPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_DePr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_DePr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiDePr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiDePr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_DeAntiPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_DeAntiPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta y #Delta#phi (%.1f(Form("hEtaPhiGen_AntiDeAntiPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiDeAntiPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrAntiPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrAntiPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_PrPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_PrPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiPrPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_DePr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_DePr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiDePr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_AntiDePr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_DeAntiPr_SE_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f(Form("hEtaPhiGen_DeAntiPr_ME_pt%02.0f%02.0f", pTBins.value.at(i) * 10, pTBins.value.at(i + 1) * 10), - Form("Gen #Delta#eta#Delta#phi (%.1f= nsigmaElPr; + bool isITSPID = track.itsNSigmaPr() > nsigmaITSPr; - if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC) { + if (isTPCPID) { if (track.pt() < pTthrpr_TOF) { - if (sign > 0) { - if (track.sign() > 0) { - isProton = true; - } else if (track.sign() < 0) { - isProton = false; - } - } else if (sign < 0) { - if (track.sign() > 0) { - isProton = false; - } else if (track.sign() < 0) { - isProton = true; + if (!doITSPID || isITSPID) { + if (sign > 0) { + if (track.sign() > 0) { + isProton = true; + } else if (track.sign() < 0) { + isProton = false; + } + } else if (sign < 0) { + if (track.sign() > 0) { + isProton = false; + } else if (track.sign() < 0) { + isProton = true; + } } } - } else if (rejectionEl && track.beta() < -100 && track.pt() < pTthrpr_TPCEl && track.tpcNSigmaEl() >= nsigmaElPr) { + } else if (isTPCElRejection) { if (sign > 0) { if (track.sign() > 0) { isProton = true; @@ -594,7 +464,7 @@ struct hadronnucleicorrelation { isProton = true; } } - } else if (std::abs(track.tofNSigmaPr()) < nsigmaTOF) { + } else if (isTOFPID) { if (sign > 0) { if (track.sign() > 0) { isProton = true; @@ -617,23 +487,29 @@ struct hadronnucleicorrelation { bool IsDeuteron(Type const& track, int sign) { bool isDeuteron = false; + bool isTPCPID = std::abs(track.tpcNSigmaDe()) < nsigmaTPC; + bool isTOFPID = std::abs(track.tofNSigmaDe()) < nsigmaTOF; + bool isTPCElRejection = rejectionEl && track.beta() < betahasTOFthr && track.pt() < pTthrde_TPCEl && track.tpcNSigmaEl() >= nsigmaElDe; + bool isITSPID = track.itsNSigmaDe() > nsigmaITSDe; - if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC) { + if (isTPCPID) { if (track.pt() < pTthrde_TOF) { - if (sign > 0) { - if (track.sign() > 0) { - isDeuteron = true; - } else if (track.sign() < 0) { - isDeuteron = false; - } - } else if (sign < 0) { - if (track.sign() > 0) { - isDeuteron = false; - } else if (track.sign() < 0) { - isDeuteron = true; + if (!doITSPID || isITSPID) { + if (sign > 0) { + if (track.sign() > 0) { + isDeuteron = true; + } else if (track.sign() < 0) { + isDeuteron = false; + } + } else if (sign < 0) { + if (track.sign() > 0) { + isDeuteron = false; + } else if (track.sign() < 0) { + isDeuteron = true; + } } } - } else if (rejectionEl && track.beta() < -100 && track.pt() < pTthrde_TPCEl && track.tpcNSigmaEl() >= nsigmaElDe) { + } else if (isTPCElRejection) { if (sign > 0) { if (track.sign() > 0) { isDeuteron = true; @@ -647,7 +523,7 @@ struct hadronnucleicorrelation { isDeuteron = true; } } - } else if (std::abs(track.tofNSigmaDe()) < nsigmaTOF) { + } else if (isTOFPID) { if (sign > 0) { if (track.sign() > 0) { isDeuteron = true; @@ -679,183 +555,97 @@ struct hadronnucleicorrelation { return passcut; } - template - void mixTracks(Type const& tracks1, Type const& tracks2, bool isIdentical, bool dorapidity) - { // last value: 0 -- SE; 1 -- ME - for (auto const& it1 : tracks1) { - for (auto const& it2 : tracks2) { - - Pair->SetPair(it1, it2); - Pair->SetIdentical(isIdentical); + template + void fillHistograms(T1 const& part0, T1 const& part1, bool ME, bool isIdentical) + { + Pair->SetPair(&part0, &part1); + Pair->SetIdentical(isIdentical); + if (isIdentical && Pair->IsClosePair(deta, dphi, radiusTPC)) { + QA.fill(HIST("QA/hdetadphistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff()); + return; + } - // if Identical (pp and antip-antip) - if (isIdentical && Pair->IsClosePair(deta, dphi, radiusTPC)) { - QA.fill(HIST("QA/hdetadphistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff()); - continue; + float deltaEta = part0.eta() - part1.eta(); + float deltaPhi = part0.phi() - part1.phi(); + deltaPhi = RecoDecay::constrainAngle(deltaPhi, -1 * o2::constants::math::PIHalf); + + for (int k = 0; k < nBinspT; k++) { + + if (part0.pt() >= pTBins.value.at(k) && part0.pt() < pTBins.value.at(k + 1)) { + + float corr0 = 1, corr1 = 1; + + if (docorrection) { // Apply corrections + switch (mode) { + case 0: + corr0 = hEffpTEta_antideuteron->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_antiproton->Interpolate(part1.pt(), part1.eta()); + break; + case 1: + corr0 = hEffpTEta_deuteron->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_proton->Interpolate(part1.pt(), part1.eta()); + break; + case 2: + corr0 = hEffpTEta_antideuteron->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_proton->Interpolate(part1.pt(), part1.eta()); + break; + case 3: + corr0 = hEffpTEta_deuteron->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_antiproton->Interpolate(part1.pt(), part1.eta()); + break; + case 4: + corr0 = hEffpTEta_antiproton->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_proton->Interpolate(part1.pt(), part1.eta()); + break; + case 5: + corr0 = hEffpTEta_antiproton->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_antiproton->Interpolate(part1.pt(), part1.eta()); + break; + case 6: + corr0 = hEffpTEta_proton->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_proton->Interpolate(part1.pt(), part1.eta()); + break; + case 7: + corr0 = hEffpTEta_proton->Interpolate(part0.pt(), part0.eta()); + corr1 = hEffpTEta_antiproton->Interpolate(part1.pt(), part1.eta()); + break; + } } - float mass1 = 0.f, mass2 = 0.f; - - if (mode < 4) { - // Deuteron-Proton combinations - mass1 = o2::constants::physics::MassDeuteron; - mass2 = o2::constants::physics::MassProton; + if (ME) { + hEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, part1.pt()); + hCorrEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, part1.pt(), 1. / (corr0 * corr1)); } else { - // Proton-Proton combinations - mass1 = o2::constants::physics::MassProton; - mass2 = o2::constants::physics::MassProton; - } + hEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, part1.pt()); + hCorrEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, part1.pt(), 1. / (corr0 * corr1)); + } // SE + } // pT condition + } // nBinspT loop - // Calculate Delta-eta Delta-phi (reco) - float deltaEta = it1->eta() - it2->eta(); - float deltaRap = it1->rapidity(mass1) - it2->rapidity(mass2); - if (dorapidity) { - deltaEta = deltaRap; - } - float deltaPhi = it1->phi() - it2->phi(); - deltaPhi = RecoDecay::constrainAngle(deltaPhi, -1 * o2::constants::math::PIHalf); - - for (int k = 0; k < nBinspT; k++) { - - if (it1->pt() >= pTBins.value.at(k) && it1->pt() < pTBins.value.at(k + 1)) { - - float corr1 = 1, corr2 = 1; - - if (docorrection) { // Apply corrections - switch (mode) { - case 0: - corr1 = hEffpTEta_antideuteron->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_antiproton->Interpolate(it2->pt(), it2->eta()); - break; - case 1: - corr1 = hEffpTEta_deuteron->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_proton->Interpolate(it2->pt(), it2->eta()); - break; - case 2: - corr1 = hEffpTEta_antideuteron->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_proton->Interpolate(it2->pt(), it2->eta()); - break; - case 3: - corr1 = hEffpTEta_deuteron->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_antiproton->Interpolate(it2->pt(), it2->eta()); - break; - case 4: - corr1 = hEffpTEta_antiproton->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_proton->Interpolate(it2->pt(), it2->eta()); - break; - case 5: - corr1 = hEffpTEta_antiproton->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_antiproton->Interpolate(it2->pt(), it2->eta()); - break; - case 6: - corr1 = hEffpTEta_proton->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_proton->Interpolate(it2->pt(), it2->eta()); - break; - case 7: - corr1 = hEffpTEta_proton->Interpolate(it1->pt(), it1->eta()); - corr2 = hEffpTEta_antiproton->Interpolate(it2->pt(), it2->eta()); - break; - } - } - - if (ME) { - hEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, it2->pt()); - hCorrEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, it2->pt(), 1. / (corr1 * corr2)); - } else { - hEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, it2->pt()); - hCorrEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, it2->pt(), 1. / (corr1 * corr2)); - } // SE - } // pT condition - } // nBinspT loop - - Pair->ResetPair(); - - } // tracks 2 - } // tracks 1 + Pair->ResetPair(); } - template - void mixMCParticles(Type const& particles1, Type const& particles2, int mode, bool dorapidity) + template + void fillHistogramsGen(T1 const& part0, T1 const& part1, bool ME) { - for (auto const& it1 : particles1) { - for (auto const& it2 : particles2) { - // Calculate Delta-eta Delta-phi (gen) - float deltaEtaGen = it1->eta() - it2->eta(); - float deltaPhiGen = RecoDecay::constrainAngle(it1->phi() - it2->phi(), -1 * o2::constants::math::PIHalf); - float deltaRapGen = it1->y() - it2->y(); - if (dorapidity) { - deltaEtaGen = deltaRapGen; - } - - // Loop over pT bins - for (int k = 0; k < nBinspT; k++) { - if (it1->pt() >= pTBins.value.at(k) && it1->pt() < pTBins.value.at(k + 1)) { - // Use correct histogram based on ME flag - if constexpr (ME) { - if (mode == 0) - hEtaPhiGen_AntiPrPr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 1) - hEtaPhiGen_AntiDeAntiPr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 2) - hEtaPhiGen_AntiDePr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 3) - hEtaPhiGen_DeAntiPr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 4) - hEtaPhiGen_DePr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - } else { - if (mode == 0) - hEtaPhiGen_AntiPrPr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 1) - hEtaPhiGen_AntiDeAntiPr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 2) - hEtaPhiGen_AntiDePr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 3) - hEtaPhiGen_DeAntiPr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else if (mode == 4) - hEtaPhiGen_DePr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - } - } - } - } - } - } - template - void mixMCParticlesIdentical(Type const& particles1, Type const& particles2, bool ismatter, bool dorapidity) - { - for (auto const& it1 : particles1) { - for (auto const& it2 : particles2) { - // Calculate Delta-eta Delta-phi (gen) - float deltaEtaGen = it1->eta() - it2->eta(); - float deltaPhiGen = RecoDecay::constrainAngle(it1->phi() - it2->phi(), -1 * o2::constants::math::PIHalf); - float deltaRapGen = it1->y() - it2->y(); - if (dorapidity) { - deltaEtaGen = deltaRapGen; - } + float deltaEta = part0.eta() - part1.eta(); + float deltaPhi = part0.phi() - part1.phi(); + deltaPhi = RecoDecay::constrainAngle(deltaPhi, -1 * o2::constants::math::PIHalf); - if (!ME && std::abs(deltaPhiGen) < 0.0001 && std::abs(deltaEtaGen) < 0.0001) { - continue; - } + for (int k = 0; k < nBinspT; k++) { - // Loop over pT bins - for (int k = 0; k < nBinspT; k++) { - if (it1->pt() >= pTBins.value.at(k) && it1->pt() < pTBins.value.at(k + 1)) { - // Use correct histogram based on ME flag - if constexpr (ME) { - if (ismatter) - hEtaPhiGen_PrPr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else - hEtaPhiGen_AntiPrAntiPr_ME[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - } else { - if (ismatter) - hEtaPhiGen_PrPr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - else - hEtaPhiGen_AntiPrAntiPr_SE[k]->Fill(deltaEtaGen, deltaPhiGen, it2->pt()); - } - } - } - } - } + if (part0.pt() >= pTBins.value.at(k) && part0.pt() < pTBins.value.at(k + 1)) { + + if (ME) { + hEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, part1.pt()); + hCorrEtaPhi_ME[k]->Fill(deltaEta, deltaPhi, part1.pt()); + } else { + hEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, part1.pt()); + hCorrEtaPhi_SE[k]->Fill(deltaEta, deltaPhi, part1.pt()); + } // SE + } // pT condition + } // nBinspT loop } void GetCorrection(o2::framework::Service const& ccdbObj, TString filepath, TString histname) @@ -891,12 +681,16 @@ struct hadronnucleicorrelation { LOGP(info, "Opened histogram {}", Form("%s_antideuteron", histname.Data())); } - void processData(FilteredCollisions const& collisions, FilteredTracks const& tracks) + void processSameEvent(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks) { - for (auto track : tracks) { - if (std::abs(track.template singleCollSel_as().posZ()) > cutzvertex) - continue; + if (std::abs(collision.posZ()) > cutzvertex) + return; + + registry.fill(HIST("hNEvents"), 0.5); + registry.fill(HIST("hMult"), collision.mult()); + + for (const auto& track : tracks) { if (track.tpcFractionSharedCls() > max_tpcSharedCls) continue; if (track.itsNCls() < min_itsNCls) @@ -923,445 +717,240 @@ struct hadronnucleicorrelation { QA.fill(HIST("QA/hDCAxy"), track.dcaXY(), track.pt()); QA.fill(HIST("QA/hDCAz"), track.dcaZ(), track.pt()); QA.fill(HIST("QA/TPCChi2VsPZ"), track.tpcInnerParam() / track.sign(), track.tpcChi2NCl()); - QA.fill(HIST("QA/hVtxZ_trk"), track.template singleCollSel_as().posZ()); + QA.fill(HIST("QA/hVtxZ_trk"), collision.posZ()); QA.fill(HIST("QA/hnSigmaTPCVsPt_El"), track.pt() * track.sign(), track.tpcNSigmaEl()); QA.fill(HIST("QA/hnSigmaTPCVsPt_Pr"), track.pt() * track.sign(), track.tpcNSigmaPr()); QA.fill(HIST("QA/hnSigmaTPCVsPt_De"), track.pt() * track.sign(), track.tpcNSigmaDe()); QA.fill(HIST("QA/hnSigmaTOFVsPt_Pr"), track.pt() * track.sign(), track.tofNSigmaPr()); QA.fill(HIST("QA/hnSigmaTOFVsPt_De"), track.pt() * track.sign(), track.tofNSigmaDe()); - } - - // Discard candidates outside pT of interest - if (track.pt() > pTBins.value.at(nBinspT) || track.pt() < pTBins.value.at(0)) - continue; - - bool isPr = IsProton(track, +1); - bool isAntiPr = IsProton(track, -1); - bool isDe = IsDeuteron(track, +1); - bool isAntiDe = IsDeuteron(track, -1); - - if (!isPr && !isAntiPr && !isDe && !isAntiDe) - continue; - - if (isPr && isDe) { - isDe = 0; - } - if (isAntiPr && isAntiDe) { - isAntiDe = 0; - } + QA.fill(HIST("QA/hnSigmaITSVsPt_Pr"), track.pt() * track.sign(), track.itsNSigmaPr()); + QA.fill(HIST("QA/hnSigmaITSVsPt_De"), track.pt() * track.sign(), track.itsNSigmaDe()); - float corr = 1.; - - // Deuterons Fill & QA - if (isAntiDe) { - selectedtracks_antid[track.singleCollSelId()].push_back(std::make_shared(track)); - - if (mode == 0 || mode == 2) { - - if (docorrection && hEffpTEta_antideuteron->Interpolate(track.pt(), track.eta()) > 0) { - corr = 1. / hEffpTEta_antideuteron->Interpolate(track.pt(), track.eta()); - } - registry.fill(HIST("hNtrig_total"), track.pt(), corr); + if (IsProton(track, +1)) { + QA.fill(HIST("QA/hEtaAntiPr"), track.eta()); + QA.fill(HIST("QA/hPhiAntiPr"), track.phi()); + QA.fill(HIST("QA/hnSigmaTOFVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tofNSigmaPr()); + QA.fill(HIST("QA/hnSigmaTPCVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tpcNSigmaPr()); + QA.fill(HIST("QA/hnSigmaITSVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.itsNSigmaPr()); } - - if (doQA) { + if (IsProton(track, -1)) { + QA.fill(HIST("QA/hEtaPr"), track.eta()); + QA.fill(HIST("QA/hPhiPr"), track.phi()); + QA.fill(HIST("QA/hnSigmaTOFVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tofNSigmaPr()); + QA.fill(HIST("QA/hnSigmaTPCVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tpcNSigmaPr()); + QA.fill(HIST("QA/hnSigmaITSVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.itsNSigmaPr()); + } + if (IsDeuteron(track, +1)) { QA.fill(HIST("QA/hEtaAntiDe"), track.eta()); QA.fill(HIST("QA/hPhiAntiDe"), track.phi()); QA.fill(HIST("QA/hnSigmaTOFVsPt_De_AfterSel"), track.pt() * track.sign(), track.tofNSigmaDe()); QA.fill(HIST("QA/hnSigmaTPCVsPt_De_AfterSel"), track.pt() * track.sign(), track.tpcNSigmaDe()); + QA.fill(HIST("QA/hnSigmaITSVsPt_De_AfterSel"), track.pt() * track.sign(), track.itsNSigmaDe()); } - } - if (isDe) { - selectedtracks_d[track.singleCollSelId()].push_back(std::make_shared(track)); - - if (mode == 1 || mode == 3) { - - corr = 1.; - if (docorrection && hEffpTEta_deuteron->Interpolate(track.pt(), track.eta()) > 0) { - corr = 1. / hEffpTEta_deuteron->Interpolate(track.pt(), track.eta()); - } - registry.fill(HIST("hNtrig_total"), track.pt(), corr); - } - - if (doQA) { + if (IsDeuteron(track, -1)) { QA.fill(HIST("QA/hEtaDe"), track.eta()); QA.fill(HIST("QA/hPhiDe"), track.phi()); QA.fill(HIST("QA/hnSigmaTOFVsPt_De_AfterSel"), track.pt() * track.sign(), track.tofNSigmaDe()); QA.fill(HIST("QA/hnSigmaTPCVsPt_De_AfterSel"), track.pt() * track.sign(), track.tpcNSigmaDe()); + QA.fill(HIST("QA/hnSigmaITSVsPt_De_AfterSel"), track.pt() * track.sign(), track.itsNSigmaDe()); } } - - // Protons Fill & QA - if (isPr) { - selectedtracks_p[track.singleCollSelId()].push_back(std::make_shared(track)); - - if (mode == 6 || mode == 7) { - - corr = 1.; - if (docorrection && hEffpTEta_proton->Interpolate(track.pt(), track.eta()) > 0) { - corr = 1. / hEffpTEta_proton->Interpolate(track.pt(), track.eta()); - } - registry.fill(HIST("hNtrig_total"), track.pt(), corr); - } - - if (doQA) { - QA.fill(HIST("QA/hEtaPr"), track.eta()); - QA.fill(HIST("QA/hPhiPr"), track.phi()); - QA.fill(HIST("QA/hnSigmaTPCVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tpcNSigmaPr()); - QA.fill(HIST("QA/hnSigmaTOFVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tofNSigmaPr()); - } - } else if (isAntiPr) { - selectedtracks_antip[track.singleCollSelId()].push_back(std::make_shared(track)); - - if (mode == 4 || mode == 5) { - corr = 1.; - if (docorrection && hEffpTEta_antiproton->Interpolate(track.pt(), track.eta()) > 0) { - corr = 1. / hEffpTEta_antiproton->Interpolate(track.pt(), track.eta()); - } - registry.fill(HIST("hNtrig_total"), track.pt(), corr); - } - - if (doQA) { - QA.fill(HIST("QA/hEtaAntiPr"), track.eta()); - QA.fill(HIST("QA/hPhiAntiPr"), track.phi()); - QA.fill(HIST("QA/hnSigmaTPCVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tpcNSigmaPr()); - QA.fill(HIST("QA/hnSigmaTOFVsPt_Pr_AfterSel"), track.pt() * track.sign(), track.tofNSigmaPr()); - } - } - } - - for (auto collision : collisions) { - - if (std::abs(collision.posZ()) > cutzvertex) - continue; - - registry.fill(HIST("hNEvents"), 0.5); - registry.fill(HIST("hMult"), collision.mult()); - - if (selectedtracks_antid.find(collision.globalIndex()) != selectedtracks_antid.end() && - selectedtracks_antip.find(collision.globalIndex()) != selectedtracks_antip.end()) { - registry.fill(HIST("hNEvents"), 1.5); - } - - if (selectedtracks_d.find(collision.globalIndex()) != selectedtracks_d.end() && - selectedtracks_p.find(collision.globalIndex()) != selectedtracks_p.end()) { - registry.fill(HIST("hNEvents"), 2.5); - } - - int vertexBinToMix = std::floor((collision.posZ() + cutzvertex) / (2 * cutzvertex / _vertexNbinsToMix)); - int centBinToMix = std::floor(collision.multPerc() / (100.0 / _multNsubBins)); - - if (selectedtracks_antid.find(collision.globalIndex()) != selectedtracks_antid.end()) { - registry.fill(HIST("hNEvents"), 3.5); - mixbins_antid[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision)); - } - if (selectedtracks_d.find(collision.globalIndex()) != selectedtracks_d.end()) { - registry.fill(HIST("hNEvents"), 4.5); - mixbins_d[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision)); - } - if (selectedtracks_antip.find(collision.globalIndex()) != selectedtracks_antip.end()) { - registry.fill(HIST("hNEvents"), 5.5); - mixbins_antip[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision)); - } - if (selectedtracks_p.find(collision.globalIndex()) != selectedtracks_p.end()) { - registry.fill(HIST("hNEvents"), 6.5); - mixbins_p[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision)); - } - - Pair->SetMagField1(collision.magField()); - Pair->SetMagField2(collision.magField()); } - if (mode == 0 && !mixbins_antid.empty()) { - - for (auto i = mixbins_antid.begin(); i != mixbins_antid.end(); i++) { // iterating over all vertex&mult bins + if (mode == kPbarPbar || mode == kPP) { // Identical particle combinations - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin + for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(tracks, tracks))) { - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedtracks_antip.find(col1->index()) != selectedtracks_antip.end()) { - mixTracks<0>(selectedtracks_antid[col1->index()], selectedtracks_antip[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = value[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedtracks_antip.find(col2->index()) != selectedtracks_antip.end()) { - mixTracks<1>(selectedtracks_antid[col1->index()], selectedtracks_antip[col2->index()], 0, dorapidity); // mixing ME - } - } - } - } - } - - if (mode == 1 && !mixbins_d.empty()) { - - for (auto i = mixbins_d.begin(); i != mixbins_d.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedtracks_p.find(col1->index()) != selectedtracks_p.end()) { - mixTracks<0>(selectedtracks_d[col1->index()], selectedtracks_p[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = value[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedtracks_p.find(col2->index()) != selectedtracks_p.end()) { - mixTracks<1>(selectedtracks_d[col1->index()], selectedtracks_p[col2->index()], 0, dorapidity); // mixing ME - } - } - } - } - } - - if (mode == 2 && !mixbins_antid.empty()) { - - for (auto i = mixbins_antid.begin(); i != mixbins_antid.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedtracks_p.find(col1->index()) != selectedtracks_p.end()) { - mixTracks<0>(selectedtracks_antid[col1->index()], selectedtracks_p[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = value[indx2]; + if (part0.tpcFractionSharedCls() > max_tpcSharedCls) + continue; + if (part0.itsNCls() < min_itsNCls) + continue; + if (part1.tpcFractionSharedCls() > max_tpcSharedCls) + continue; + if (part1.itsNCls() < min_itsNCls) + continue; - if (col1 == col2) { - continue; - } + if (!applyDCAcut(part0)) + continue; + if (!applyDCAcut(part1)) + continue; - if (selectedtracks_p.find(col2->index()) != selectedtracks_p.end()) { - mixTracks<1>(selectedtracks_antid[col1->index()], selectedtracks_p[col2->index()], 0, dorapidity); // mixing ME - } - } + // mode 6 + if (mode == kPP) { + if (!IsProton(part0, +1)) + continue; + if (!IsProton(part1, +1)) + continue; } - } - } - - if (mode == 3 && !mixbins_d.empty()) { - - for (auto i = mixbins_d.begin(); i != mixbins_d.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedtracks_antip.find(col1->index()) != selectedtracks_antip.end()) { - mixTracks<0>(selectedtracks_d[col1->index()], selectedtracks_antip[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = value[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedtracks_antip.find(col2->index()) != selectedtracks_antip.end()) { - mixTracks<1>(selectedtracks_d[col1->index()], selectedtracks_antip[col2->index()], 0, dorapidity); // mixing ME - } - } + // mode 5 + if (mode == kPbarPbar) { + if (!IsProton(part0, -1)) + continue; + if (!IsProton(part1, -1)) + continue; } - } - } - if (mode == 4 && !mixbins_antip.empty()) { - - for (auto i = mixbins_antip.begin(); i != mixbins_antip.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedtracks_p.find(col1->index()) != selectedtracks_p.end()) { - mixTracks<0>(selectedtracks_antip[col1->index()], selectedtracks_p[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = value[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedtracks_p.find(col2->index()) != selectedtracks_p.end()) { - mixTracks<1>(selectedtracks_antip[col1->index()], selectedtracks_p[col2->index()], 0, dorapidity); // mixing ME - } - } - } + fillHistograms(part0, part1, false, true); } - } - - if (mode == 5 && !mixbins_antip.empty()) { - - for (auto i = mixbins_antip.begin(); i != mixbins_antip.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedtracks_antip.find(col1->index()) != selectedtracks_antip.end()) { - mixTracks<0>(selectedtracks_antip[col1->index()], selectedtracks_antip[col1->index()], 1, dorapidity); // mixing SE - } + } else { - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin + for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { - auto col2 = value[indx2]; + if (part0.tpcFractionSharedCls() > max_tpcSharedCls) + continue; + if (part0.itsNCls() < min_itsNCls) + continue; + if (part1.tpcFractionSharedCls() > max_tpcSharedCls) + continue; + if (part1.itsNCls() < min_itsNCls) + continue; - if (col1 == col2) { - continue; - } + if (!applyDCAcut(part0)) + continue; + if (!applyDCAcut(part1)) + continue; - if (selectedtracks_antip.find(col2->index()) != selectedtracks_antip.end()) { - mixTracks<1>(selectedtracks_antip[col1->index()], selectedtracks_antip[col2->index()], 1, dorapidity); // mixing ME - } - } - } + // modes 0,1,2,3,4,7 + if (mode == kDbarPbar) { + if (!IsDeuteron(part0, -1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + if (mode == kDP) { + if (!IsDeuteron(part0, +1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kDbarP) { + if (!IsDeuteron(part0, -1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kDPbar) { + if (!IsDeuteron(part0, +1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + if (mode == kPbarP) { + if (!IsProton(part0, -1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kPPbar) { + if (!IsProton(part0, +1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + + fillHistograms(part0, part1, false, false); } } + } + PROCESS_SWITCH(hadronnucleicorrelation, processSameEvent, "processSameEvent", true); - if (mode == 6 && !mixbins_p.empty()) { - - for (auto i = mixbins_p.begin(); i != mixbins_p.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin + void processMixedEvent(FilteredCollisions const& collisions, FilteredTracks const& tracks) + { - auto col1 = value[indx1]; + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, collisions, collisions)) { - if (selectedtracks_p.find(col1->index()) != selectedtracks_p.end()) { - mixTracks<0>(selectedtracks_p[col1->index()], selectedtracks_p[col1->index()], 1, dorapidity); // mixing SE - } + // LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.mult(), collision2.mult()); - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin + auto groupPartsOne = tracks.sliceByCached(o2::aod::singletrackselector::singleCollSelId, collision1.globalIndex(), cache); + auto groupPartsTwo = tracks.sliceByCached(o2::aod::singletrackselector::singleCollSelId, collision2.globalIndex(), cache); - auto col2 = value[indx2]; + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); - if (col1 == col2) { - continue; - } - - if (selectedtracks_p.find(col2->index()) != selectedtracks_p.end()) { - mixTracks<1>(selectedtracks_p[col1->index()], selectedtracks_p[col2->index()], 1, dorapidity); // mixing ME - } - } - } + if (magFieldTesla1 != magFieldTesla2) { + continue; } - } - - if (mode == 7 && !mixbins_p.empty()) { - - for (auto i = mixbins_p.begin(); i != mixbins_p.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin + for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - auto col1 = value[indx1]; - - if (selectedtracks_antip.find(col1->index()) != selectedtracks_antip.end()) { - mixTracks<0>(selectedtracks_p[col1->index()], selectedtracks_antip[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = 0; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = value[indx2]; + if (part0.tpcFractionSharedCls() > max_tpcSharedCls) + continue; + if (part0.itsNCls() < min_itsNCls) + continue; + if (part1.tpcFractionSharedCls() > max_tpcSharedCls) + continue; + if (part1.itsNCls() < min_itsNCls) + continue; - if (col1 == col2) { - continue; - } + if (!applyDCAcut(part0)) + continue; + if (!applyDCAcut(part1)) + continue; - if (selectedtracks_antip.find(col2->index()) != selectedtracks_antip.end()) { - mixTracks<1>(selectedtracks_p[col1->index()], selectedtracks_antip[col2->index()], 0, dorapidity); // mixing ME - } - } - } + //{"mode", 0, "0: antid-antip, 1: d-p, 2: antid-p, 3: d-antip, 4: antip-p, 5: antip-antip, 6: p-p, 7: p-antip"}; + if (mode == kDbarPbar) { + if (!IsDeuteron(part0, -1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + if (mode == kDP) { + if (!IsDeuteron(part0, +1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kDbarP) { + if (!IsDeuteron(part0, -1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kDPbar) { + if (!IsDeuteron(part0, +1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + if (mode == kPbarP) { + if (!IsProton(part0, -1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kPbarPbar) { + if (!IsProton(part0, -1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + if (mode == kPP) { + if (!IsProton(part0, +1)) + continue; + if (!IsProton(part1, +1)) + continue; + } + if (mode == kPPbar) { + if (!IsProton(part0, +1)) + continue; + if (!IsProton(part1, -1)) + continue; + } + + bool isIdentical = false; + if (mode == kPbarPbar || mode == kPP) + isIdentical = true; + + fillHistograms(part0, part1, true, isIdentical); } } - - // clearing up - for (auto i = selectedtracks_antid.begin(); i != selectedtracks_antid.end(); i++) - (i->second).clear(); - selectedtracks_antid.clear(); - - for (auto i = selectedtracks_antip.begin(); i != selectedtracks_antip.end(); i++) - (i->second).clear(); - selectedtracks_antip.clear(); - - for (auto i = selectedtracks_p.begin(); i != selectedtracks_p.end(); i++) - (i->second).clear(); - selectedtracks_p.clear(); - - for (auto i = selectedtracks_d.begin(); i != selectedtracks_d.end(); i++) - (i->second).clear(); - selectedtracks_d.clear(); - - for (auto& pair : mixbins_antid) { - pair.second.clear(); // Clear the vector associated with the key - } - mixbins_antid.clear(); // Then clear the map itself - - for (auto& pair : mixbins_d) { - pair.second.clear(); // Clear the vector associated with the key - } - mixbins_d.clear(); // Then clear the map itself - - for (auto& pair : mixbins_antip) { - pair.second.clear(); // Clear the vector associated with the key - } - mixbins_antip.clear(); // Then clear the map itself - - for (auto& pair : mixbins_p) { - pair.second.clear(); // Clear the vector associated with the key - } - mixbins_p.clear(); // Then clear the map itself } - PROCESS_SWITCH(hadronnucleicorrelation, processData, "processData", true); + PROCESS_SWITCH(hadronnucleicorrelation, processMixedEvent, "processMixedEvent", true); void processMC(FilteredCollisions const&, FilteredTracksMC const& tracks) { - for (auto track : tracks) { + for (const auto& track : tracks) { if (std::abs(track.template singleCollSel_as().posZ()) > cutzvertex) continue; @@ -1370,7 +959,7 @@ struct hadronnucleicorrelation { if (track.itsNCls() < min_itsNCls) continue; - if (IsProton(track, +1) && track.pdgCode() == pdgProton) { + if (IsProton(track, +1) && track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hPrDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimPrDCAxy"), track.dcaXY(), track.pt()); @@ -1379,7 +968,7 @@ struct hadronnucleicorrelation { if (track.origin() == 2) registry.fill(HIST("hSecMatPrDCAxy"), track.dcaXY(), track.pt()); } - if (IsProton(track, -1) && track.pdgCode() == -pdgProton) { + if (IsProton(track, -1) && track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hAntiPrDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimAntiPrDCAxy"), track.dcaXY(), track.pt()); @@ -1388,7 +977,7 @@ struct hadronnucleicorrelation { if (track.origin() == 2) registry.fill(HIST("hSecMatAntiPrDCAxy"), track.dcaXY(), track.pt()); } - if (IsDeuteron(track, +1) && track.pdgCode() == pdgDeuteron) { + if (IsDeuteron(track, +1) && track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hDeDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimDeDCAxy"), track.dcaXY(), track.pt()); @@ -1397,7 +986,7 @@ struct hadronnucleicorrelation { if (track.origin() == 2) registry.fill(HIST("hSecMatDeDCAxy"), track.dcaXY(), track.pt()); } - if (IsDeuteron(track, -1) && track.pdgCode() == -pdgDeuteron) { + if (IsDeuteron(track, -1) && track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hAntiDeDCAxy"), track.dcaXY(), track.pt()); if (track.origin() == 0) registry.fill(HIST("hPrimAntiDeDCAxy"), track.dcaXY(), track.pt()); @@ -1411,7 +1000,7 @@ struct hadronnucleicorrelation { continue; // Keep only protons and deuterons - // if (std::abs(track.pdgCode()) != pdgProton && std::abs(track.pdgCode()) != pdgDeuteron) + // if (std::abs(track.pdgCode()) != PDG_t::kProton && std::abs(track.pdgCode()) != o2::constants::physics::Pdg::kDeuteron) // continue; if (doQA) { @@ -1430,10 +1019,10 @@ struct hadronnucleicorrelation { QA.fill(HIST("QA/hnSigmaTOFVsPt_De"), track.pt() * track.sign(), track.tofNSigmaDe()); } - bool isPr = (IsProton(track, +1) && track.pdgCode() == pdgProton); - bool isAntiPr = (IsProton(track, -1) && track.pdgCode() == -pdgProton); - bool isDe = (IsDeuteron(track, +1) && track.pdgCode() == pdgDeuteron); - bool isAntiDe = (IsDeuteron(track, -1) && track.pdgCode() == -pdgDeuteron); + bool isPr = (IsProton(track, +1) && track.pdgCode() == PDG_t::kProton); + bool isAntiPr = (IsProton(track, -1) && track.pdgCode() == -PDG_t::kProton); + bool isDe = (IsDeuteron(track, +1) && track.pdgCode() == o2::constants::physics::Pdg::kDeuteron); + bool isAntiDe = (IsDeuteron(track, -1) && track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron); if (isPr) { registry.fill(HIST("hPrimSec_EtaPhiPt_Proton"), track.eta(), track.phi(), track.pt() * +1); @@ -1451,7 +1040,7 @@ struct hadronnucleicorrelation { if (track.origin() != 0) continue; - if (track.pdgCode() == pdgProton) { + if (track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hReco_EtaPhiPt_Proton"), track.eta(), track.phi(), track.pt()); registry.fill(HIST("hReco_EtaPhiPtMC_Proton"), track.eta_MC(), track.phi_MC(), track.pt_MC()); registry.fill(HIST("hResPt_Proton"), track.pt_MC(), track.pt() - track.pt_MC()); @@ -1465,7 +1054,7 @@ struct hadronnucleicorrelation { registry.fill(HIST("hnSigmaTPCVsPt_Pr_MC"), track.pt(), track.tpcNSigmaPr()); registry.fill(HIST("hnSigmaTOFVsPt_Pr_MC"), track.pt(), track.tofNSigmaPr()); } - if (track.pdgCode() == -pdgProton) { + if (track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hReco_EtaPhiPt_Proton"), track.eta(), track.phi(), track.pt() * -1); registry.fill(HIST("hReco_EtaPhiPtMC_Proton"), track.eta_MC(), track.phi_MC(), track.pt_MC() * -1); registry.fill(HIST("hResPt_AntiProton"), track.pt_MC(), track.pt() - track.pt_MC()); @@ -1479,7 +1068,7 @@ struct hadronnucleicorrelation { registry.fill(HIST("hnSigmaTPCVsPt_Pr_MC"), track.pt() * -1, track.tpcNSigmaPr()); registry.fill(HIST("hnSigmaTOFVsPt_Pr_MC"), track.pt() * -1, track.tofNSigmaPr()); } - if (track.pdgCode() == pdgDeuteron) { + if (track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hReco_EtaPhiPt_Deuteron"), track.eta(), track.phi(), track.pt()); registry.fill(HIST("hReco_EtaPhiPtMC_Deuteron"), track.eta_MC(), track.phi_MC(), track.pt_MC()); registry.fill(HIST("hResPt_Deuteron"), track.pt_MC(), track.pt() - track.pt_MC()); @@ -1493,7 +1082,7 @@ struct hadronnucleicorrelation { registry.fill(HIST("hnSigmaTPCVsPt_De_MC"), track.pt(), track.tpcNSigmaDe()); registry.fill(HIST("hnSigmaTOFVsPt_De_MC"), track.pt(), track.tofNSigmaDe()); } - if (track.pdgCode() == -pdgDeuteron) { + if (track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hReco_EtaPhiPt_Deuteron"), track.eta(), track.phi(), track.pt() * -1); registry.fill(HIST("hReco_EtaPhiPtMC_Deuteron"), track.eta_MC(), track.phi_MC(), track.pt_MC() * -1); registry.fill(HIST("hResPt_AntiDeuteron"), track.pt_MC(), track.pt() - track.pt_MC()); @@ -1537,113 +1126,113 @@ struct hadronnucleicorrelation { if (doMCQA) { // Proton - if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == pdgProton) { + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPC"), track.pt()); registry.fill(HIST("hReco_Pt_Proton_TPC"), track.pt()); } if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF && - track.pdgCode() == pdgProton) { + track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPCTOF"), track.pt()); registry.fill(HIST("hReco_Pt_Proton_TPCTOF"), track.pt()); } - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == pdgProton) { + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPC_or_TOF"), track.pt()); registry.fill(HIST("hReco_Pt_Proton_TPC_or_TOF"), track.pt()); } if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && - track.tpcNSigmaEl() >= nsigmaElPr && track.pdgCode() == pdgProton) { + track.tpcNSigmaEl() >= nsigmaElPr && track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPCEl"), track.pt()); registry.fill(HIST("hReco_Pt_Proton_TPCEl"), track.pt()); } - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == pdgProton) { + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + track.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPCEl_or_TOF"), track.pt()); registry.fill(HIST("hReco_Pt_Proton_TPCEl_or_TOF"), track.pt()); } // AntiProton - if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == -pdgProton) { + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPC"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Proton_TPC"), track.pt() * -1); } if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF && - track.pdgCode() == -pdgProton) { + track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPCTOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Proton_TPCTOF"), track.pt() * -1); } - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == -pdgProton) { + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPC_or_TOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Proton_TPC_or_TOF"), track.pt() * -1); } if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && - track.tpcNSigmaEl() >= nsigmaElPr && track.pdgCode() == -pdgProton) { + track.tpcNSigmaEl() >= nsigmaElPr && track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPCEl"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Proton_TPCEl"), track.pt() * -1); } - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && - track.pdgCode() == -pdgProton) { + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + track.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hNumeratorPurity_Proton_TPCEl_or_TOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Proton_TPCEl_or_TOF"), track.pt() * -1); } // Deuteron - if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.pdgCode() == pdgDeuteron) { + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPC"), track.pt()); registry.fill(HIST("hReco_Pt_Deuteron_TPC"), track.pt()); } if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF && - track.pdgCode() == pdgDeuteron) { + track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCTOF"), track.pt()); registry.fill(HIST("hReco_Pt_Deuteron_TPCTOF"), track.pt()); } - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == pdgDeuteron) { + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPC_or_TOF"), track.pt()); registry.fill(HIST("hReco_Pt_Deuteron_TPC_or_TOF"), track.pt()); } if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && - track.tpcNSigmaEl() >= nsigmaElDe && track.pdgCode() == pdgDeuteron) { + track.tpcNSigmaEl() >= nsigmaElDe && track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCEl"), track.pt()); registry.fill(HIST("hReco_Pt_Deuteron_TPCEl"), track.pt()); } - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == pdgDeuteron) { + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + track.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCEl_or_TOF"), track.pt()); registry.fill(HIST("hReco_Pt_Deuteron_TPCEl_or_TOF"), track.pt()); } // AntiDeuteron - if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.pdgCode() == -pdgDeuteron) { + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPC"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Deuteron_TPC"), track.pt() * -1); } if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF && - track.pdgCode() == -pdgDeuteron) { + track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCTOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Deuteron_TPCTOF"), track.pt() * -1); } - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == -pdgDeuteron) { + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPC_or_TOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Deuteron_TPC_or_TOF"), track.pt() * -1); } if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && - track.tpcNSigmaEl() >= nsigmaElDe && track.pdgCode() == -pdgDeuteron) { + track.tpcNSigmaEl() >= nsigmaElDe && track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCEl"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Deuteron_TPCEl"), track.pt() * -1); } - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && - track.pdgCode() == -pdgDeuteron) { + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + track.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hNumeratorPurity_Deuteron_TPCEl_or_TOF"), track.pt() * -1); registry.fill(HIST("hReco_Pt_Deuteron_TPCEl_or_TOF"), track.pt() * -1); } @@ -1653,16 +1242,16 @@ struct hadronnucleicorrelation { registry.fill(HIST("hDenominatorPurity_Proton_TPC"), track.pt()); if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF && track.sign() > 0) registry.fill(HIST("hDenominatorPurity_Proton_TPCTOF"), track.pt()); - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && track.sign() > 0) registry.fill(HIST("hDenominatorPurity_Proton_TPC_or_TOF"), track.pt()); if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.sign() > 0) { registry.fill(HIST("hDenominatorPurity_Proton_TPCEl"), track.pt()); } - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && track.sign() > 0) { registry.fill(HIST("hDenominatorPurity_Proton_TPCEl_or_TOF"), track.pt()); } @@ -1671,16 +1260,16 @@ struct hadronnucleicorrelation { registry.fill(HIST("hDenominatorPurity_Proton_TPC"), track.pt() * -1); if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF && track.sign() < 0) registry.fill(HIST("hDenominatorPurity_Proton_TPCTOF"), track.pt() * -1); - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && track.sign() < 0) registry.fill(HIST("hDenominatorPurity_Proton_TPC_or_TOF"), track.pt() * -1); if (std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.sign() < 0) { registry.fill(HIST("hDenominatorPurity_Proton_TPCEl"), track.pt() * -1); } - if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaPr()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElPr && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaPr()) < nsigmaTPC && std::abs(track.tofNSigmaPr()) < nsigmaTOF)) && track.sign() < 0) { registry.fill(HIST("hDenominatorPurity_Proton_TPCEl_or_TOF"), track.pt() * -1); } @@ -1689,8 +1278,8 @@ struct hadronnucleicorrelation { registry.fill(HIST("hDenominatorPurity_Deuteron_TPC"), track.pt()); if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF && track.sign() > 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPCTOF"), track.pt()); - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && track.sign() > 0) { registry.fill(HIST("hDenominatorPurity_Deuteron_TPC_or_TOF"), track.pt()); } @@ -1698,8 +1287,8 @@ struct hadronnucleicorrelation { track.tpcNSigmaEl() >= nsigmaElDe && track.sign() > 0) { registry.fill(HIST("hDenominatorPurity_Deuteron_TPCEl"), track.pt()); } - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && track.sign() > 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPCEl_or_TOF"), track.pt()); @@ -1708,16 +1297,16 @@ struct hadronnucleicorrelation { if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF && track.sign() < 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPCTOF"), track.pt() * -1); if (( - (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && track.sign() < 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPC_or_TOF"), track.pt() * -1); if (std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.sign() < 0) { registry.fill(HIST("hDenominatorPurity_Deuteron_TPCEl"), track.pt() * -1); } - if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < -100) || - (track.beta() > -100 && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && + if (((std::abs(track.tpcNSigmaDe()) < nsigmaTPC && track.tpcNSigmaEl() >= nsigmaElDe && track.beta() < betahasTOFthr) || + (track.beta() > betahasTOFthr && std::abs(track.tpcNSigmaDe()) < nsigmaTPC && std::abs(track.tofNSigmaDe()) < nsigmaTOF)) && track.sign() < 0) registry.fill(HIST("hDenominatorPurity_Deuteron_TPCEl_or_TOF"), track.pt() * -1); } @@ -1725,378 +1314,199 @@ struct hadronnucleicorrelation { } PROCESS_SWITCH(hadronnucleicorrelation, processMC, "processMC", false); - Preslice perMCCol = aod::mcparticle::mcCollisionId; - - void processGen(SimCollisions const& mcCollisions, - SimParticles const& mcParticles) + void processSameEventGen(SimCollisions::iterator const& mcCollision, SimParticles const& mcParticles) { - for (auto particle : mcParticles) { - if (std::abs(particle.template mcCollision_as().posZ()) > cutzvertex) - continue; + if (std::abs(mcCollision.posZ()) > cutzvertex) + return; + + registry.fill(HIST("Generated/hNEventsMC"), 0.5); - if (particle.pdgCode() == pdgProton) { + for (const auto& particle : mcParticles) { + + if (particle.pdgCode() == PDG_t::kProton) { registry.fill(HIST("Generated/hQAProtons"), 0.5); } - if (particle.pdgCode() == pdgDeuteron) { + if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("Generated/hQADeuterons"), 0.5); } if (isPrim && !particle.isPhysicalPrimary()) { continue; } - if (particle.pdgCode() == pdgProton) { + if (particle.pdgCode() == PDG_t::kProton) { registry.fill(HIST("Generated/hQAProtons"), 1.5); } - if (particle.pdgCode() == pdgDeuteron) { + if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("Generated/hQADeuterons"), 1.5); } - if (particle.pdgCode() == pdgDeuteron && std::abs(particle.y()) < 0.5) { + if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron && std::abs(particle.y()) < 0.5) { registry.fill(HIST("Generated/hDeuteronsVsPt"), particle.pt()); } - if (particle.pdgCode() == -pdgDeuteron && std::abs(particle.y()) < 0.5) { + if (particle.pdgCode() == -o2::constants::physics::Pdg::kDeuteron && std::abs(particle.y()) < 0.5) { registry.fill(HIST("Generated/hAntiDeuteronsVsPt"), particle.pt()); } if (std::abs(particle.eta()) > etacut) { continue; } - if (particle.pdgCode() == pdgProton) { + if (particle.pdgCode() == PDG_t::kProton) { registry.fill(HIST("Generated/hQAProtons"), 2.5); } - if (particle.pdgCode() == pdgDeuteron) { + if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("Generated/hQADeuterons"), 2.5); } - if (particle.pdgCode() == pdgDeuteron) { + if (particle.pdgCode() == o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hGen_EtaPhiPt_Deuteron"), particle.eta(), particle.phi(), particle.pt()); - selectedparticlesMC_d[particle.mcCollisionId()].push_back(std::make_shared(particle)); } - if (particle.pdgCode() == -pdgDeuteron) { + if (particle.pdgCode() == -o2::constants::physics::Pdg::kDeuteron) { registry.fill(HIST("hGen_EtaPhiPt_Deuteron"), particle.eta(), particle.phi(), -1. * particle.pt()); - selectedparticlesMC_antid[particle.mcCollisionId()].push_back(std::make_shared(particle)); } - if (particle.pdgCode() == pdgProton) { + if (particle.pdgCode() == PDG_t::kProton) { registry.fill(HIST("hGen_EtaPhiPt_Proton"), particle.eta(), particle.phi(), particle.pt()); - selectedparticlesMC_p[particle.mcCollisionId()].push_back(std::make_shared(particle)); } - if (particle.pdgCode() == -pdgProton) { + if (particle.pdgCode() == -PDG_t::kProton) { registry.fill(HIST("hGen_EtaPhiPt_Proton"), particle.eta(), particle.phi(), -1. * particle.pt()); - selectedparticlesMC_antip[particle.mcCollisionId()].push_back(std::make_shared(particle)); } } - for (auto collision1 : mcCollisions) { // loop on collisions - - registry.fill(HIST("Generated/hNEventsMC"), 0.5); - - if (std::abs(collision1.posZ()) > cutzvertex) { - continue; - } + if (mode == kPbarPbar || mode == kPP) { // Identical particle combinations - const auto particlesInCollision = mcParticles.sliceBy(perMCCol, collision1.globalIndex()); + for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(mcParticles, mcParticles))) { - float Ncharged = 0.; - for (auto& mcParticle : particlesInCollision) { - - if (!mcParticle.isPhysicalPrimary()) { - continue; + // mode 6 + if (mode == kPP) { + if (part0.pdgCode() != PDG_t::kProton) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; } - - if (std::abs(mcParticle.eta()) > 0.5f) { - continue; + // mode 5 + if (mode == kPbarPbar) { + if (part0.pdgCode() != -PDG_t::kProton) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; } - TParticlePDG* p = pdgDB->GetParticle(mcParticle.pdgCode()); - if (std::abs(p->Charge()) > 1E-3) { - Ncharged++; - } + fillHistogramsGen(part0, part1, false); } - registry.fill(HIST("hMult"), Ncharged); - - int vertexBinToMix = std::floor((collision1.posZ() + cutzvertex) / (2 * cutzvertex / _vertexNbinsToMix)); - int centBinToMix = std::floor(Ncharged / (maxmultmix / _multNsubBins)); - - if (Ncharged > maxmultmix) - centBinToMix = _multNsubBins - 1; // to avoid overflow in centrality bin - if (centBinToMix < 0) - centBinToMix = 0; // to avoid underflow in centrality bin - - if (selectedparticlesMC_antid.find(collision1.globalIndex()) != selectedparticlesMC_antid.end()) { - mixbinsMC_antid[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision1)); - } + } else { - if (selectedparticlesMC_d.find(collision1.globalIndex()) != selectedparticlesMC_d.end()) { - mixbinsMC_d[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision1)); - } + for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(mcParticles, mcParticles))) { - if (selectedparticlesMC_antip.find(collision1.globalIndex()) != selectedparticlesMC_antip.end()) { - mixbinsMC_antip[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision1)); - } + if (mode == kDbarPbar) { + if (part0.pdgCode() != -o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; + } + if (mode == kDP) { + if (part0.pdgCode() != o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; + } + if (mode == kDbarP) { + if (part0.pdgCode() != -o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; + } + if (mode == kDPbar) { + if (part0.pdgCode() != o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; + } + if (mode == kPbarP) { + if (part0.pdgCode() != -PDG_t::kProton) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; + } + if (mode == kPPbar) { + if (part0.pdgCode() != PDG_t::kProton) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; + } - if (selectedparticlesMC_p.find(collision1.globalIndex()) != selectedparticlesMC_p.end()) { - mixbinsMC_p[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision1)); + fillHistogramsGen(part0, part1, false); } + } + } + PROCESS_SWITCH(hadronnucleicorrelation, processSameEventGen, "processSameEventGen", false); - } // coll - - if (!mixbinsMC_antip.empty()) { - - // antip-antip - for (auto i = mixbinsMC_antip.begin(); i != mixbinsMC_antip.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; + void processMixedEventGen(SimCollisions const& mcCollisions, SimParticles const& mcParticles) + { - if (selectedparticlesMC_antip.find(col1->index()) != selectedparticlesMC_antip.end()) { - mixMCParticlesIdentical<0>(selectedparticlesMC_antip[col1->index()], selectedparticlesMC_antip[col1->index()], 0, dorapidity); // mixing SE - } + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningGen, 5, -1, mcCollisions, mcCollisions)) { - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin + // LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.mult(), collision2.mult()); - auto col2 = (i->second)[indx2]; + auto groupPartsOne = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision2.globalIndex(), cache); - if (col1 == col2) { - continue; - } + for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (selectedparticlesMC_antip.find(col2->index()) != selectedparticlesMC_antip.end()) { - mixMCParticlesIdentical<1>(selectedparticlesMC_antip[col1->index()], selectedparticlesMC_antip[col2->index()], 0, dorapidity); // mixing SE - } - } + if (mode == kDbarPbar) { + if (part0.pdgCode() != -o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; } - } - - // antip-p - for (auto i = mixbinsMC_antip.begin(); i != mixbinsMC_antip.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedparticlesMC_antip.find(col1->index()) != selectedparticlesMC_antip.end()) { - mixMCParticles<0>(selectedparticlesMC_antip[col1->index()], selectedparticlesMC_p[col1->index()], 0, dorapidity); // mixing SE - } - - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = (i->second)[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedparticlesMC_antip.find(col2->index()) != selectedparticlesMC_antip.end()) { - mixMCParticles<1>(selectedparticlesMC_antip[col1->index()], selectedparticlesMC_p[col2->index()], 0, dorapidity); // mixing SE - } - } + if (mode == kDP) { + if (part0.pdgCode() != o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; } - } - - } // mixbinsMC_antip - - if (!mixbinsMC_p.empty()) { - - // p-p - for (auto i = mixbinsMC_p.begin(); i != mixbinsMC_p.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedparticlesMC_p.find(col1->index()) != selectedparticlesMC_p.end()) { - mixMCParticlesIdentical<0>(selectedparticlesMC_p[col1->index()], selectedparticlesMC_p[col1->index()], 1, dorapidity); // mixing SE - } - - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = (i->second)[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedparticlesMC_p.find(col2->index()) != selectedparticlesMC_p.end()) { - mixMCParticlesIdentical<1>(selectedparticlesMC_p[col1->index()], selectedparticlesMC_p[col2->index()], 1, dorapidity); // mixing SE - } - } + if (mode == kDbarP) { + if (part0.pdgCode() != -o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; } - } - } // mixbinsMC_p - - if (!mixbinsMC_antid.empty()) { - - // antid-antip - for (auto i = mixbinsMC_antid.begin(); i != mixbinsMC_antid.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedparticlesMC_antid.find(col1->index()) != selectedparticlesMC_antid.end()) { - mixMCParticles<0>(selectedparticlesMC_antid[col1->index()], selectedparticlesMC_antip[col1->index()], 1, dorapidity); // mixing SE - } - - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = (i->second)[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedparticlesMC_antid.find(col2->index()) != selectedparticlesMC_antid.end()) { - mixMCParticles<1>(selectedparticlesMC_antid[col1->index()], selectedparticlesMC_antip[col2->index()], 1, dorapidity); // mixing SE - } - } + if (mode == kDPbar) { + if (part0.pdgCode() != o2::constants::physics::Pdg::kDeuteron) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; } - } - - // antid-p - for (auto i = mixbinsMC_antid.begin(); i != mixbinsMC_antid.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedparticlesMC_antid.find(col1->index()) != selectedparticlesMC_antid.end()) { - mixMCParticles<0>(selectedparticlesMC_antid[col1->index()], selectedparticlesMC_p[col1->index()], 2, dorapidity); // mixing SE - } - - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = (i->second)[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedparticlesMC_antid.find(col2->index()) != selectedparticlesMC_antid.end()) { - mixMCParticles<1>(selectedparticlesMC_antid[col1->index()], selectedparticlesMC_p[col2->index()], 2, dorapidity); // mixing SE - } - } + if (mode == kPbarP) { + if (part0.pdgCode() != -PDG_t::kProton) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; } - } - - } // mixbinsMC_antid - - if (!mixbinsMC_d.empty()) { - - // d-antip - for (auto i = mixbinsMC_d.begin(); i != mixbinsMC_d.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedparticlesMC_d.find(col1->index()) != selectedparticlesMC_d.end()) { - mixMCParticles<0>(selectedparticlesMC_d[col1->index()], selectedparticlesMC_antip[col1->index()], 3, dorapidity); // mixing SE - } - - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = (i->second)[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedparticlesMC_d.find(col2->index()) != selectedparticlesMC_d.end()) { - mixMCParticles<1>(selectedparticlesMC_d[col1->index()], selectedparticlesMC_antip[col2->index()], 3, dorapidity); // mixing SE - } - } + if (mode == kPbarPbar) { + if (part0.pdgCode() != -PDG_t::kProton) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; } - } - - // d-p - for (auto i = mixbinsMC_d.begin(); i != mixbinsMC_d.end(); i++) { // iterating over all vertex&mult bins - - std::vector value = i->second; - int EvPerBin = value.size(); // number of collisions in each vertex&mult bin - - for (int indx1 = 0; indx1 < EvPerBin; indx1++) { // loop over all the events in each vertex&mult bin - - auto col1 = value[indx1]; - - if (selectedparticlesMC_d.find(col1->index()) != selectedparticlesMC_d.end()) { - mixMCParticles<0>(selectedparticlesMC_d[col1->index()], selectedparticlesMC_p[col1->index()], 4, dorapidity); // mixing SE - } - - for (int indx2 = indx1 + 1; indx2 < EvPerBin; indx2++) { // nested loop for all the combinations of collisions in a chosen mult/vertex bin - - auto col2 = (i->second)[indx2]; - - if (col1 == col2) { - continue; - } - - if (selectedparticlesMC_d.find(col2->index()) != selectedparticlesMC_d.end()) { - mixMCParticles<1>(selectedparticlesMC_d[col1->index()], selectedparticlesMC_p[col2->index()], 4, dorapidity); // mixing SE - } - } + if (mode == kPP) { + if (part0.pdgCode() != PDG_t::kProton) + continue; + if (part1.pdgCode() != PDG_t::kProton) + continue; + } + if (mode == kPPbar) { + if (part0.pdgCode() != PDG_t::kProton) + continue; + if (part1.pdgCode() != -PDG_t::kProton) + continue; } - } - - } // mixbinsMC_d - - // clearing up - for (auto i = selectedparticlesMC_antid.begin(); i != selectedparticlesMC_antid.end(); i++) - (i->second).clear(); - selectedparticlesMC_antid.clear(); - - for (auto i = selectedparticlesMC_d.begin(); i != selectedparticlesMC_d.end(); i++) - (i->second).clear(); - selectedparticlesMC_d.clear(); - - for (auto i = selectedparticlesMC_antip.begin(); i != selectedparticlesMC_antip.end(); i++) - (i->second).clear(); - selectedparticlesMC_antip.clear(); - - for (auto i = selectedparticlesMC_p.begin(); i != selectedparticlesMC_p.end(); i++) - (i->second).clear(); - selectedparticlesMC_p.clear(); - - for (auto& pair : mixbinsMC_antip) { - pair.second.clear(); // clear the vector associated with the key - } - mixbinsMC_antip.clear(); // clear the map - - for (auto& pair : mixbinsMC_p) { - pair.second.clear(); // clear the vector associated with the key - } - mixbinsMC_p.clear(); // clear the map - for (auto& pair : mixbinsMC_antid) { - pair.second.clear(); // clear the vector associated with the key - } - mixbinsMC_antid.clear(); // clear the map - for (auto& pair : mixbinsMC_d) { - pair.second.clear(); // clear the vector associated with the key + fillHistogramsGen(part0, part1, true); + } } - mixbinsMC_d.clear(); // clear the map } - PROCESS_SWITCH(hadronnucleicorrelation, processGen, "processGen", false); + PROCESS_SWITCH(hadronnucleicorrelation, processMixedEventGen, "processMixedEventGen", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From bc95809a815bbb8b53cdd39ef912387aef21785a Mon Sep 17 00:00:00 2001 From: Giorgio Alberto Lucia <87222843+GiorgioAlbertoLucia@users.noreply.github.com> Date: Tue, 7 Apr 2026 06:32:16 -0700 Subject: [PATCH 192/282] [PWGLF] logic flow uniformed to nucleiSpectra for cross check (#15623) --- PWGLF/TableProducer/QC/nucleiQC.cxx | 148 +++++++++++++++------------- 1 file changed, 81 insertions(+), 67 deletions(-) diff --git a/PWGLF/TableProducer/QC/nucleiQC.cxx b/PWGLF/TableProducer/QC/nucleiQC.cxx index a6597d45137..7ed749b2c44 100644 --- a/PWGLF/TableProducer/QC/nucleiQC.cxx +++ b/PWGLF/TableProducer/QC/nucleiQC.cxx @@ -110,6 +110,7 @@ struct nucleiQC { Configurable cfgTrackTunerConfigSource{"cfgTrackTunerConfigSource", aod::track_tuner::InputString, "1: input string; 2: TrackTuner Configurables"}; ConfigurableAxis cfgAxisPtQA{"axisPtQA", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for QA histograms"}; + Configurable cfgRapidityToggle{"cfgRapidityToggle", false, "If true, cut on rapidity for reconstructed particles"}; Configurable cfgRapidityMin{"cfgRapidityMin", -1., "Minimum rapidity value"}; Configurable cfgRapidityMax{"cfgRapidityMax", 1., "Maximum rapidity value"}; Configurable cfgRapidityCenterMass{"cfgRapidityCenterMass", 0.0f, "Center of mass rapidity"}; @@ -347,10 +348,8 @@ struct nucleiQC { } } - template - void fillNucleusFlagsPdgs(const int iSpecies, const Tcollision& collision, const Ttrack& track, nuclei::SlimCandidate& candidate) + void fillSpeciesFlags(const int iSpecies, nuclei::SlimCandidate& candidate) { - candidate.flags = static_cast((track.pidForTracking() & 0xF) << 12); switch (iSpecies) { case nuclei::Species::kPr: @@ -372,6 +371,14 @@ struct nucleiQC { candidate.flags |= 0; break; } + } + + template + void fillNucleusFlagsPdgs(const int iSpecies, const Tcollision& collision, const Ttrack& track, nuclei::SlimCandidate& candidate) + { + candidate.flags = static_cast((track.pidForTracking() & 0xF) << 12); + + fillSpeciesFlags(iSpecies, candidate); if (track.hasTOF()) candidate.flags |= nuclei::Flags::kHasTOF; @@ -508,110 +515,117 @@ struct nucleiQC { } } - void processMc(const Collision& collision, const TrackCandidatesMC& tracks, const aod::BCsWithTimestamps&, const aod::McParticles& mcParticles) + void processMc(const Collisions& collisions, const TrackCandidatesMC& tracks, const aod::BCsWithTimestamps&, const aod::McParticles& mcParticles) { - gRandom->SetSeed(67); mNucleiCandidates.clear(); - mFilledMcParticleIds.clear(); + std::vector reconstructedMcParticles(mcParticles.size(), false); - auto bc = collision.template bc_as(); - initCCDB(bc); + for (const auto& collision : collisions) { - if (!nuclei::eventSelection(collision, mHistograms, cfgEventSelections, cfgCutVertex)) - return; + auto bc = collision.template bc_as(); + initCCDB(bc); - bool anyTrackTuner = false; - for (int iSpecies = 0; iSpecies < static_cast(nuclei::Species::kNspecies); iSpecies++) { - anyTrackTuner = anyTrackTuner || cfgUseTrackTuner->get(iSpecies); - } - if (anyTrackTuner && mTrackTuner.autoDetectDcaCalib && !mTrackTuner.areGraphsConfigured) { + if (!nuclei::eventSelection(collision, mHistograms, cfgEventSelections, cfgCutVertex)) + continue; - mTrackTuner.setRunNumber(mRunNumber); + bool anyTrackTuner = false; + for (int iSpecies = 0; iSpecies < static_cast(nuclei::Species::kNspecies); iSpecies++) { + anyTrackTuner = anyTrackTuner || cfgUseTrackTuner->get(iSpecies); + } + if (anyTrackTuner && mTrackTuner.autoDetectDcaCalib && !mTrackTuner.areGraphsConfigured) { - /// setup the "auto-detected" path based on the run number - mTrackTuner.getPathInputFileAutomaticFromCCDB(); - mHistTrackTunedTracks->SetTitle(mTrackTuner.outputString.c_str()); - mTrackTuner.getDcaGraphs(); - } + mTrackTuner.setRunNumber(mRunNumber); + + /// setup the "auto-detected" path based on the run number + mTrackTuner.getPathInputFileAutomaticFromCCDB(); + mHistTrackTunedTracks->SetTitle(mTrackTuner.outputString.c_str()); + mTrackTuner.getDcaGraphs(); + } + + auto tracksThisCollision = tracks.sliceBy(mTracksPerCollision, collision.globalIndex()); + for (const auto& track : tracksThisCollision) { - auto tracksThisCollision = tracks.sliceBy(mTracksPerCollision, collision.globalIndex()); - tracksThisCollision.bindExternalIndices(&tracks); + static_for<0, nuclei::kNspecies - 1>([&](auto iSpecies) { + constexpr int kSpeciesCt = decltype(iSpecies)::value; + const int kSpeciesRt = kSpeciesCt; - for (const auto& track : tracks) { + if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), kSpeciesRt) == mSpeciesToProcess.end()) + return; - static_for<0, nuclei::kNspecies - 1>([&](auto iSpecies) { - constexpr int kSpeciesCt = decltype(iSpecies)::value; - const int kSpeciesRt = kSpeciesCt; + if (!track.has_mcParticle()) + return; - if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), kSpeciesRt) == mSpeciesToProcess.end()) - return; + if (track.mcParticleId() < -1 || track.mcParticleId() >= mcParticles.size()) + return; + const auto& particle = mcParticles.iteratorAt(track.mcParticleId()); - if (!track.has_mcParticle()) - return; + if (cfgDoCheckPdgCode) { + if (std::abs(particle.pdgCode()) != nuclei::pdgCodes[kSpeciesRt]) + return; + } - const auto& particle = track.mcParticle(); - if (cfgDoCheckPdgCode) { - if (std::abs(particle.pdgCode()) != nuclei::pdgCodes[kSpeciesRt]) + if (cfgDownscalingFactor->get(kSpeciesRt) < 1.) { + if ((gRandom->Uniform()) > cfgDownscalingFactor->get(kSpeciesRt)) + return; + } + + if (cfgRapidityToggle && ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax)) return; - } - if (cfgDownscalingFactor->get(kSpeciesRt) < 1.) { - if ((gRandom->Uniform()) > cfgDownscalingFactor->get(kSpeciesRt)) + if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) return; - } - if ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax) - return; + LOG(info) << "track passed physical primary cut"; - if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) - return; + mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kNoCuts); + if (!trackSelection(track)) + return; + mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kTrackCuts); - mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kNoCuts); - if (!trackSelection(track)) - return; - mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kTrackCuts); + if (!pidSelection(track, collision)) + return; + mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kPidCuts); - if (!pidSelection(track, collision)) - return; - mHistograms.fill(HIST(nuclei::cNames[kSpeciesCt]) + HIST("/hTrackSelections"), nuclei::trackSelection::kPidCuts); + nuclei::SlimCandidate candidate; + candidate = fillCandidate(kSpeciesCt, collision, track); - nuclei::SlimCandidate candidate; - candidate = fillCandidate(kSpeciesCt, collision, track); + mNucleiCandidates.emplace_back(candidate); + reconstructedMcParticles[particle.globalIndex()] = true; - mNucleiCandidates.emplace_back(candidate); - mFilledMcParticleIds.emplace_back(particle.globalIndex()); - dispatchFillHistograms(kSpeciesRt, candidate); - dispatchFillHistograms(kSpeciesRt, candidate); - }); + dispatchFillHistograms(kSpeciesRt, candidate); + dispatchFillHistograms(kSpeciesRt, candidate); + }); + } } - const int mcCollisionId = collision.mcCollisionId(); - auto mcParticlesThisCollision = mcParticles.sliceBy(mMcParticlesPerCollision, mcCollisionId); - mcParticlesThisCollision.bindExternalIndices(&mcParticles); + int mcIndex = -1; + for (const auto& particle : mcParticles) { - for (const auto& particle : mcParticlesThisCollision) { + mcIndex++; - if (std::find(mFilledMcParticleIds.begin(), mFilledMcParticleIds.end(), particle.globalIndex()) != mFilledMcParticleIds.end()) + int iSpecies = nuclei::getSpeciesFromPdg(particle.pdgCode()); + if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), iSpecies) == mSpeciesToProcess.end()) continue; - if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) + if ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax) continue; - if ((particle.y() - cfgRapidityCenterMass) < cfgRapidityMin || (particle.y() - cfgRapidityCenterMass) > cfgRapidityMax) + if (reconstructedMcParticles[mcIndex]) continue; - int iSpecies = nuclei::getSpeciesFromPdg(particle.pdgCode()); - if (std::find(mSpeciesToProcess.begin(), mSpeciesToProcess.end(), iSpecies) == mSpeciesToProcess.end()) + if (cfgFillOnlyPhysicalPrimaries && !particle.isPhysicalPrimary()) continue; if (cfgDownscalingFactor->get(iSpecies) < 1.) { if ((gRandom->Uniform()) > cfgDownscalingFactor->get(iSpecies)) - return; + continue; } nuclei::SlimCandidate candidate; - candidate.centrality = nuclei::getCentrality(collision, cfgCentralityEstimator, mHistFailCentrality); + // candidate.centrality = nuclei::getCentrality(collision, cfgCentralityEstimator, mHistFailCentrality); + candidate.centrality = -1.f; // centrality is not well defined for non-reconstructed particles, set to -1 for now + fillSpeciesFlags(iSpecies, candidate); fillNucleusFlagsPdgsMc(particle, candidate); fillNucleusGeneratedVariables(particle, candidate); From 2eeaaeeaec9aa53b674b431732afa804b4fca2dd Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore <89481844+giovannimalfattore@users.noreply.github.com> Date: Tue, 7 Apr 2026 15:32:56 +0200 Subject: [PATCH 193/282] [PWGLF] NucleiTask - Fix ITSHe applied to all tracks (#15594) --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 37 ++++++++++++--------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 80b50320ea6..a8a4363432d 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -2392,7 +2392,7 @@ struct LFNucleiBATask { return; } - if (centFT0M <= cfgMultCutLow || centFT0M > cfgMultCutHigh) { + if (enableCentrality && (centFT0M <= cfgMultCutLow || centFT0M > cfgMultCutHigh)) { return; } if (enableCentrality) @@ -2699,8 +2699,10 @@ struct LFNucleiBATask { isDeuteron = enableDe && deRapCut; isHelium = enableHe && heRapCut; - isDe = isDeuteron && track.sign() > 0; - isAntiDe = isDeuteron && track.sign() < 0; + + // ITS PID cut + bool passITSDeCut = !nsigmaITSvar.useITSDeCut || (nITSDe > nsigmaITSvar.nsigmaITSDe); + bool passITSHeCut = !nsigmaITSvar.useITSHeCut || (nITSHe > nsigmaITSvar.nsigmaITSHe); if constexpr (IsMC && !IsFilteredData) { int pdgCheck = track.mcParticle().pdgCode(); @@ -2710,25 +2712,19 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/hItsDeHeChecker"), 1); } - // nSigmaITSHe cut - if (nsigmaITSvar.useITSDeCut && (nITSDe <= nsigmaITSvar.nsigmaITSDe)) { - continue; - } - - if (nsigmaITSvar.useITSHeCut && (nITSHe <= nsigmaITSvar.nsigmaITSHe)) { - continue; - } - if constexpr (IsMC && !IsFilteredData) { int pdgCheck = track.mcParticle().pdgCode(); - if (std::abs(pdgCheck) == PDGDeuteron) + if ((std::abs(pdgCheck) == PDGDeuteron) && passITSDeCut) histos.fill(HIST("tracks/hItsDeHeChecker"), 2); - if (std::abs(pdgCheck) == PDGHelium) + if ((std::abs(pdgCheck) == PDGHelium) && passITSHeCut) histos.fill(HIST("tracks/hItsDeHeChecker"), 3); } - isHe = isHelium && track.sign() > 0; - isAntiHe = isHelium && track.sign() < 0; + isDe = isDeuteron && passITSDeCut && track.sign() > 0; + isAntiDe = isDeuteron && passITSDeCut && track.sign() < 0; + + isHe = isHelium && passITSHeCut && track.sign() > 0; + isAntiHe = isHelium && passITSHeCut && track.sign() < 0; isDeWoDCAxy = isDe && passDCAzCutDe; isAntiDeWoDCAxy = isAntiDe && passDCAzCutAntiDe; @@ -4637,7 +4633,6 @@ struct LFNucleiBATask { // TOF if (outFlagOptions.doTOFplots) { - if (isDeWTPCpid) { switch (useHasTRDConfig) { case 0: @@ -4913,7 +4908,8 @@ struct LFNucleiBATask { } if (isHeWTPCpid) { - histos.fill(HIST("tracks/helium/TOF/h2HeliumSpectraVsMult_Z2"), 2 * hePt, centFT0M); + if (enableCentrality) + histos.fill(HIST("tracks/helium/TOF/h2HeliumSpectraVsMult_Z2"), 2 * hePt, centFT0M); histos.fill(HIST("tracks/helium/h2HeliumTOFbetaVsP"), heP, track.beta()); if (outFlagOptions.enableEffPlots) { histos.fill(HIST("tracks/eff/helium/h2pVsTOFExpMomentumHe"), track.tofExpMom(), heP); @@ -4922,7 +4918,8 @@ struct LFNucleiBATask { } if (isAntiHeWTPCpid) { - histos.fill(HIST("tracks/helium/TOF/h2antiHeliumSpectraVsMult_Z2"), 2 * antihePt, centFT0M); + if (enableCentrality) + histos.fill(HIST("tracks/helium/TOF/h2antiHeliumSpectraVsMult_Z2"), 2 * antihePt, centFT0M); histos.fill(HIST("tracks/helium/h2antiHeliumTOFbetaVsP"), antiheP, track.beta()); if (outFlagOptions.enableEffPlots) { histos.fill(HIST("tracks/eff/helium/h2pVsTOFExpMomentumantiHe"), track.tofExpMom(), antiheP); @@ -6387,7 +6384,7 @@ struct LFNucleiBATask { return; } - if (mcCollision.centFT0M() < cfgMultCutLow || mcCollision.centFT0M() > cfgMultCutHigh) + if (enableCentrality && (mcCollision.centFT0M() < cfgMultCutLow || mcCollision.centFT0M() > cfgMultCutHigh)) return; if (evselOptions.enableGenVzCut) { From 772971d28a73172736a9a767a52999e9eb6e5ff5 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:22:02 +0200 Subject: [PATCH 194/282] [PWGCF] FemtoUniverse: Fix bug in using randomised pairs in CPR (#15673) --- ...toUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 7242f0ceea9..a1891f20ecf 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -641,11 +641,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { + if (pairCloseRejection.isClosePairkT(part1, part2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { continue; } if (twotracksconfigs.confIsCPRFraction) { - if (pairCloseRejection.isClosePairFractionkT(p1, p2, femto_universe_container::EventType::same, kT, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + if (pairCloseRejection.isClosePairFractionkT(part1, part2, femto_universe_container::EventType::same, kT, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } @@ -1009,11 +1009,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { + if (pairCloseRejection.isClosePairkT(part1, part2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsfilldEtadPhiTPCcls, pairFractionTPCsCls)) { continue; } if (twotracksconfigs.confIsCPRFraction) { - if (pairCloseRejection.isClosePairFractionkT(p1, p2, femto_universe_container::EventType::mixed, kT, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { + if (pairCloseRejection.isClosePairFractionkT(part1, part2, femto_universe_container::EventType::mixed, kT, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } From ff905f9523dd96f7bf7921acb036b12f2ab9f416 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 7 Apr 2026 18:26:10 +0200 Subject: [PATCH 195/282] [PWGEM/Dilepton] fix dimuon producer (#15674) --- PWGEM/Dilepton/Core/CMakeLists.txt | 2 +- PWGEM/Dilepton/Core/DileptonProducer.h | 27 ++++++++----------- PWGEM/Dilepton/DataModel/dileptonTables.h | 3 ++- PWGEM/Dilepton/Tasks/dileptonPolarization.cxx | 6 ++--- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/PWGEM/Dilepton/Core/CMakeLists.txt b/PWGEM/Dilepton/Core/CMakeLists.txt index 97501004c4a..137845c45ea 100644 --- a/PWGEM/Dilepton/Core/CMakeLists.txt +++ b/PWGEM/Dilepton/Core/CMakeLists.txt @@ -14,7 +14,7 @@ o2physics_add_library(PWGEMDileptonCore DielectronCut.cxx DimuonCut.cxx EMTrackCut.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::MLCore) + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore) o2physics_target_root_dictionary(PWGEMDileptonCore HEADERS EMEventCut.h diff --git a/PWGEM/Dilepton/Core/DileptonProducer.h b/PWGEM/Dilepton/Core/DileptonProducer.h index fd4eb783f89..1b4ca326472 100644 --- a/PWGEM/Dilepton/Core/DileptonProducer.h +++ b/PWGEM/Dilepton/Core/DileptonProducer.h @@ -22,7 +22,6 @@ #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" -#include "PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" @@ -65,7 +64,7 @@ #include #include -using MyCollisions = o2::soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; using MyElectrons = o2::soa::Join; @@ -73,7 +72,7 @@ using MyElectron = MyElectrons::iterator; using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = o2::soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; @@ -251,7 +250,10 @@ struct DileptonProducer { o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; @@ -291,7 +293,6 @@ struct DileptonProducer { engine = std::mt19937(seed_gen()); DefineEMEventCut(); - addhistograms(); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { DefineDielectronCut(); leptonM1 = o2::constants::physics::MassElectron; @@ -346,13 +347,7 @@ struct DileptonProducer { fDielectronCut.SetTrackPhiPositionRange(dielectroncuts.cfg_min_phiposition_track, dielectroncuts.cfg_max_phiposition_track, dielectroncuts.cfgRefR, d_bz, dielectroncuts.cfg_mirror_phi_track); } - ~DileptonProducer() - { - } - - void addhistograms() - { - } + ~DileptonProducer() {} void DefineEMEventCut() { @@ -376,7 +371,6 @@ struct DileptonProducer { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } - o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; void DefineDielectronCut() { fDielectronCut = DielectronCut("fDielectronCut", "fDielectronCut"); @@ -456,7 +450,8 @@ struct DileptonProducer { fDimuonCut.SetNClustersMCHMID(dimuoncuts.cfg_min_ncluster_mch, 20); fDimuonCut.SetChi2(0.f, dimuoncuts.cfg_max_chi2); fDimuonCut.SetChi2MFT(0.f, dimuoncuts.cfg_max_chi2mft); - fDimuonCut.SetMatchingChi2MCHMFT(0.f, dimuoncuts.cfg_max_matching_chi2_mftmch); + // fDimuonCut.SetMatchingChi2MCHMFT(0.f, dimuoncuts.cfg_max_matching_chi2_mftmch); + fDimuonCut.SetMaxMatchingChi2MCHMFTPtDep([&](float pt) { return (pt < dimuoncuts.cfg_border_pt_for_chi2mchmft ? dimuoncuts.cfg_max_matching_chi2_mftmch_lowPt : dimuoncuts.cfg_max_matching_chi2_mftmch_highPt); }); fDimuonCut.SetMatchingChi2MCHMID(0.f, dimuoncuts.cfg_max_matching_chi2_mchmid); fDimuonCut.SetDCAxy(0.f, dimuoncuts.cfg_max_dcaxy); fDimuonCut.SetRabs(dimuoncuts.cfg_min_rabs, dimuoncuts.cfg_max_rabs); @@ -588,7 +583,7 @@ struct DileptonProducer { continue; } - float eventplanes_2_for_mix[6] = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + float eventplanes_2_for_mix[7] = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg(), collision.ep2fv0a()}; float ep2 = eventplanes_2_for_mix[cfgEP2Estimator_for_Mix]; if (!fEMEventCut.IsSelected(collision)) { @@ -627,7 +622,7 @@ struct DileptonProducer { } if (nuls > 0 || nlspp > 0 || nlsmm > 0) { - eventTable(collision.runNumber(), collision.globalBC(), collision.timestamp(), collision.posZ(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), collision.centFT0C(), ep2); + eventTable(collision.runNumber(), collision.globalBC(), collision.timestamp(), collision.posZ(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), centralities[cfgCentEstimator], ep2); } } // end of collision loop } // end of DF diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 7768db5327c..73196abc058 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -1222,10 +1222,11 @@ using EMPrimaryTrackEMEventIdTMP = EMPrimaryTrackEMEventIdsTMP::iterator; namespace emthinevent { DECLARE_SOA_COLUMN(EP2, ep2, float); //! +DECLARE_SOA_COLUMN(Centrality, centrality, float); //! } // namespace emthinevent DECLARE_SOA_TABLE_VERSIONED(EMThinEvents_000, "AOD", "EMTHINEVENT", 0, //! Thin event information table o2::soa::Index<>, bc::RunNumber, bc::GlobalBC, timestamp::Timestamp, collision::PosZ, - evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, cent::CentFT0C, emthinevent::EP2); + evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, emthinevent::Centrality, emthinevent::EP2); using EMThinEvents = EMThinEvents_000; using EMThinEvent = EMThinEvents::iterator; diff --git a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx index 3595dbf8354..6f650da4771 100644 --- a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx +++ b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx @@ -490,7 +490,7 @@ struct DileptonPolarization { } // end of pair1 loop } - Filter collisionFilter_centrality = eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax; + Filter collisionFilter_centrality = eventcuts.cfgCentMin < o2::aod::emthinevent::centrality && o2::aod::emthinevent::centrality < eventcuts.cfgCentMax; Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; using filteredCollisions = soa::Filtered; @@ -516,7 +516,7 @@ struct DileptonPolarization { { for (const auto& collision : collisions) { initCCDB(collision); - float centrality = collision.centFT0C(); + float centrality = collision.centrality(); if (centrality < eventcuts.cfgCentMin || eventcuts.cfgCentMax < centrality) { continue; } @@ -525,7 +525,7 @@ struct DileptonPolarization { fRegistry.fill(HIST("Event/after/hZvtx"), collision.posZ()); fRegistry.fill(HIST("Event/after/hCollisionCounter"), 9); fRegistry.fill(HIST("Event/after/hCorrOccupancy"), collision.ft0cOccupancyInTimeRange(), collision.trackOccupancyInTimeRange()); - fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); + fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), centrality, ep2); // event mixing int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1; From d8e488f64d6bcb7754722f91c81b7ca5e97ef3ca 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: Tue, 7 Apr 2026 13:39:07 -0600 Subject: [PATCH 196/282] [PWGLF,PWGMM] Add Collision posZ configurable (#15670) --- PWGMM/UE/Tasks/uecharged.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 5f8908db124..8fef7ee4a8b 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -13,7 +13,7 @@ /// \file uecharged.cxx /// \brief Underlying event analysis task /// \since November 2021 -/// \last update: March 2026 +/// \last update: April 2026 #include "PWGLF/Utils/inelGt.h" @@ -61,6 +61,7 @@ struct ueCharged { Configurable sel8{"event_sel8", true, "Apply the sel8 event selection"}; Configurable removeITSROFBorder{"event_removeITSROFBorder", false, "Remove ITS Read-Out Frame border and only apply kIsTriggerTVX & kNoTimeFrameBorder (recommended for MC)"}; Configurable cfgINELCut{"event_cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; + Configurable CollPosZ{"event_CollPosZ", 10.f, "Cut on the z component of the vertex position"}; Configurable analyzeEvandTracksel{"analyzeEvandTracksel", true, "Analyze the event and track selection"}; // Track selection configurables @@ -418,7 +419,7 @@ struct ueCharged { ue.fill(HIST("hCounter"), 4); ue.fill(HIST("hStat"), collision.size()); - if ((std::abs(collision.posZ()) > 10.f)) { + if ((std::abs(collision.posZ()) > CollPosZ)) { return false; } @@ -464,7 +465,7 @@ struct ueCharged { ue.fill(HIST("hCounter"), 4); ue.fill(HIST("hStat"), collision.size()); - if ((std::abs(collision.posZ()) > 10.f)) { + if ((std::abs(collision.posZ()) > CollPosZ)) { return false; } @@ -665,7 +666,7 @@ struct ueCharged { if (cfgINELCut == 2 && !o2::pwglf::isINELgt1mc(GenParticles, pdg)) { return; } - if (std::abs(mcCollision.posZ()) > 10.f) { + if (std::abs(mcCollision.posZ()) > CollPosZ) { return; } ue.fill(HIST("hStat"), mcCollision.size()); @@ -1010,7 +1011,7 @@ struct ueCharged { if (cfgINELCut == 2 && !o2::pwglf::isINELgt1mc(GenParticles, pdg)) { return; } - if (std::abs(mcCollision.posZ()) > 10.f) { + if (std::abs(mcCollision.posZ()) > CollPosZ) { return; } @@ -1147,7 +1148,7 @@ struct ueCharged { ue.fill(HIST("hVtxFT0VsVtxCol_afterGoodZvtx"), foundBC.ft0().posZ(), collision.posZ()); } - if (std::abs(collision.posZ()) > 10.f) { + if (std::abs(collision.posZ()) > CollPosZ) { return; } From 272ed1c9ea3830a81f81508cb9a05afc87938763 Mon Sep 17 00:00:00 2001 From: Paola Vargas Torres <88360333+PaolaVT@users.noreply.github.com> Date: Tue, 7 Apr 2026 15:08:19 -0600 Subject: [PATCH 197/282] [PWGLF] Fix PDG-related bug (#15669) Co-authored-by: Paola Vargas Torres Co-authored-by: Paola Vargas Torres --- PWGLF/Tasks/Nuspex/multiplicityPt.cxx | 837 ++++++++++---------------- 1 file changed, 326 insertions(+), 511 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx index 1a71c04db8b..6d9e1ca4fdf 100644 --- a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx +++ b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx @@ -11,7 +11,7 @@ /// \author Dushmanta Sahu (dushmanta.sahu@cern.ch) /// \file multiplicityPt.cxx -/// \brief Analysis to do PID with MC +/// \brief Analysis to do PID with MC - Full correction factors for pions, kaons, protons #include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/DataModel/mcCentrality.h" // For McCentFT0Ms @@ -50,7 +50,7 @@ #include #include #include -#include // For std::accumulate +#include #include #include #include @@ -66,7 +66,6 @@ using BCsRun3 = soa::Join pdg; Service ccdb; static constexpr int CentBinMax = 100; @@ -79,7 +78,6 @@ struct MultiplicityPt { INEL = 0, INELgt0 = 1, INELgt1 = 2 - }; Configurable isRun3{"isRun3", true, "is Run3 dataset"}; @@ -99,7 +97,6 @@ struct MultiplicityPt { Configurable requireTrdOnly{"requireTrdOnly", false, "Require only tracks from TRD"}; Configurable requireNoTrd{"requireNoTrd", false, "Require tracks without TRD"}; - // Analysis switches Configurable enableDCAHistograms{"enableDCAHistograms", false, "Enable DCA histograms"}; Configurable enablePIDHistograms{"enablePIDHistograms", true, "Enable PID histograms"}; Configurable useCustomTrackCuts{"useCustomTrackCuts", true, "Flag to use custom track cuts"}; @@ -119,7 +116,6 @@ struct MultiplicityPt { Configurable nClTPCFoundCut{"nClTPCFoundCut", false, "Apply TPC found clusters cut"}; Configurable nClTPCPIDCut{"nClTPCPIDCut", true, "Apply TPC clusters for PID cut"}; - // Phi cut parameters Configurable applyPhiCut{"applyPhiCut", false, "Apply phi sector cut to remove problematic TPC regions"}; Configurable pTthresholdPhiCut{"pTthresholdPhiCut", 2.0f, "pT threshold above which to apply phi cut"}; Configurable phiCutLowParam1{"phiCutLowParam1", 0.119297, "First parameter for low phi cut"}; @@ -127,58 +123,37 @@ struct MultiplicityPt { Configurable phiCutHighParam1{"phiCutHighParam1", 0.16685, "First parameter for high phi cut"}; Configurable phiCutHighParam2{"phiCutHighParam2", 0.00981942, "Second parameter for high phi cut"}; - // Basic track cuts Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; - // PID selection - make them configurable per particle Configurable cfgCutNsigmaPi{"cfgCutNsigmaPi", 3.0f, "nsigma cut for pions"}; Configurable cfgCutNsigmaKa{"cfgCutNsigmaKa", 2.5f, "nsigma cut for kaons"}; Configurable cfgCutNsigmaPr{"cfgCutNsigmaPr", 2.5f, "nsigma cut for protons"}; - // Custom track cuts matching spectraTOF TrackSelection customTrackCuts; - // TF1 pointers for phi cuts TF1* fphiCutLow = nullptr; TF1* fphiCutHigh = nullptr; - // Histogram Registry HistogramRegistry ue; - // Data collisions (not used but kept for completeness) using CollisionTableData = soa::Join; - - // Track tables using TrackTableData = soa::Join; using TrackTableMC = soa::Join; - - // MC particles table using ParticlesMC = aod::McParticles; - - // MC collisions table using McCollisions = aod::McCollisions; - - // Reconstructed collisions (without joins that cause size mismatch) using RecoCollisions = aod::Collisions; - // Preslice for MC particles Preslice perMCCol = aod::mcparticle::mcCollisionId; enum ParticleSpecies : int { - kPion = 0, - kKaon = 1, - kProton = 2, - kNSpecies = 3 + PartPion = 0, + PartKaon = 1, + PartProton = 2, }; - static constexpr int PDGPion = kPiPlus; - static constexpr int PDGKaon = kKPlus; - static constexpr int PDGProton = kProton; - - // Get magnetic field from CCDB int getMagneticField(uint64_t timestamp) { static o2::parameters::GRPMagField* grpo = nullptr; @@ -193,7 +168,6 @@ struct MultiplicityPt { return grpo->getNominalL3Field(); } - // Get transformed phi for phi cut (with magnetic field) float getTransformedPhi(const float phi, const int charge, const float magField) const { float transformedPhi = phi; @@ -208,36 +182,28 @@ struct MultiplicityPt { return transformedPhi; } - // Phi cut function (with magnetic field) template bool passedPhiCut(const TrackType& track, float magField) const { - if (!applyPhiCut.value) { + if (!applyPhiCut.value) return true; - } - - if (track.pt() < pTthresholdPhiCut.value) { + if (track.pt() < pTthresholdPhiCut.value) return true; - } float pt = track.pt(); float phi = track.phi(); int charge = track.sign(); - if (magField < 0) { + if (magField < 0) phi = o2::constants::math::TwoPI - phi; - } - if (charge < 0) { + if (charge < 0) phi = o2::constants::math::TwoPI - phi; - } phi += o2::constants::math::PI / 18.0f; phi = std::fmod(phi, o2::constants::math::PI / 9.0f); - if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt)) { + if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt)) return false; - } - return true; } @@ -249,16 +215,12 @@ struct MultiplicityPt { auto pdgParticle = pdg->GetParticle(particle.pdgCode()); if (!pdgParticle || pdgParticle->Charge() == 0.) continue; - if (!particle.isPhysicalPrimary()) continue; - if (std::abs(particle.eta()) > etaMax) continue; - if (particle.pt() < ptMin) continue; - count++; } return count; @@ -267,17 +229,13 @@ struct MultiplicityPt { template bool passedNClTPCFoundCut(const T& trk) const { - if (!nClTPCFoundCut.value) - return true; - return trk.tpcNClsFound() >= minTPCNClsFound.value; + return !nClTPCFoundCut.value || trk.tpcNClsFound() >= minTPCNClsFound.value; } template bool passedNClTPCPIDCut(const T& trk) const { - if (!nClTPCPIDCut.value) - return true; - return trk.tpcNClsPID() >= minTPCNClsPID.value; + return !nClTPCPIDCut.value || trk.tpcNClsPID() >= minTPCNClsPID.value; } template @@ -286,12 +244,10 @@ struct MultiplicityPt { if (useCustomTrackCuts.value) { for (int i = 0; i < static_cast(TrackSelection::TrackCuts::kNCuts); i++) { if (i == static_cast(TrackSelection::TrackCuts::kDCAxy) || - i == static_cast(TrackSelection::TrackCuts::kDCAz)) { + i == static_cast(TrackSelection::TrackCuts::kDCAz)) continue; - } - if (!customTrackCuts.IsSelected(track, static_cast(i))) { + if (!customTrackCuts.IsSelected(track, static_cast(i))) return false; - } } return true; } @@ -302,9 +258,8 @@ struct MultiplicityPt { bool passesDCAxyCut(TrackType const& track) const { if (useCustomTrackCuts.value) { - if (!passesCutWoDCA(track)) { + if (!passesCutWoDCA(track)) return false; - } constexpr float DcaXYConst = 0.0105f; constexpr float DcaXYPtScale = 0.0350f; constexpr float DcaXYPtPower = 1.1f; @@ -319,26 +274,18 @@ struct MultiplicityPt { { if (track.eta() < cfgCutEtaMin.value || track.eta() > cfgCutEtaMax.value) return false; - if (track.tpcChi2NCl() < minChi2PerClusterTPC.value || track.tpcChi2NCl() > maxChi2PerClusterTPC.value) return false; - if (!passesCutWoDCA(track)) return false; - if (!passesDCAxyCut(track)) return false; - if (!passedNClTPCFoundCut(track)) return false; - if (!passedNClTPCPIDCut(track)) return false; - - // Add phi cut with magnetic field if (!passedPhiCut(track, magField)) return false; - return true; } @@ -346,21 +293,19 @@ struct MultiplicityPt { bool passesPIDSelection(TrackType const& track) const { float nsigmaTPC = 0.f; - - if constexpr (species == kPion) { + if constexpr (species == PartPion) nsigmaTPC = track.tpcNSigmaPi(); - } else if constexpr (species == kKaon) { + else if constexpr (species == PartKaon) nsigmaTPC = track.tpcNSigmaKa(); - } else if constexpr (species == kProton) { + else if constexpr (species == PartProton) nsigmaTPC = track.tpcNSigmaPr(); - } float cutValue = cfgCutNsigma.value; - if constexpr (species == kPion) + if constexpr (species == PartPion) cutValue = cfgCutNsigmaPi.value; - if constexpr (species == kKaon) + if constexpr (species == PartKaon) cutValue = cfgCutNsigmaKa.value; - if constexpr (species == kProton) + if constexpr (species == PartProton) cutValue = cfgCutNsigmaPr.value; return (std::abs(nsigmaTPC) < cutValue); @@ -378,17 +323,16 @@ struct MultiplicityPt { if (nsigmaPi < cfgCutNsigmaPi.value && nsigmaPi < minNSigma) { minNSigma = nsigmaPi; - bestSpecies = kPion; + bestSpecies = PartPion; } if (nsigmaKa < cfgCutNsigmaKa.value && nsigmaKa < minNSigma) { minNSigma = nsigmaKa; - bestSpecies = kKaon; + bestSpecies = PartKaon; } if (nsigmaPr < cfgCutNsigmaPr.value && nsigmaPr < minNSigma) { minNSigma = nsigmaPr; - bestSpecies = kProton; + bestSpecies = PartProton; } - return bestSpecies; } @@ -398,44 +342,24 @@ struct MultiplicityPt { auto pdgParticle = pdg->GetParticle(particle.pdgCode()); if (!pdgParticle || pdgParticle->Charge() == 0.) return false; - if (!particle.isPhysicalPrimary()) return false; - if (std::abs(particle.eta()) >= cfgCutEtaMax.value) return false; if (particle.pt() < cfgTrkLowPtCut.value) return false; - return true; } - void processData(CollisionTableData::iterator const& collision, - TrackTableData const& tracks, - BCsRun3 const& bcs); + void processData(CollisionTableData::iterator const& collision, TrackTableData const& tracks, BCsRun3 const& bcs); PROCESS_SWITCH(MultiplicityPt, processData, "process data", false); - void processMC(TrackTableMC const& tracks, - aod::McParticles const& particles, - aod::McCollisions const& mcCollisions, - RecoCollisions const& collisions, - aod::McCollisionLabels const& labels, - aod::McCentFT0Ms const& centTable, - BCsRun3 const& bcs); + void processMC(TrackTableMC const& tracks, aod::McParticles const& particles, aod::McCollisions const& mcCollisions, + RecoCollisions const& collisions, aod::McCollisionLabels const& labels, aod::McCentFT0Ms const& centTable, BCsRun3 const& bcs); PROCESS_SWITCH(MultiplicityPt, processMC, "process MC", true); void init(InitContext const&); - - void endOfStream(EndOfStreamContext& /*eos*/) - { - LOG(info) << "\n=== END OF STREAM: Writing histograms to output ==="; - auto hGenMult = ue.get(HIST("MC/EventLoss/GenMultVsCent")); - if (hGenMult) { - LOG(info) << "GenMultVsCent: Entries=" << hGenMult->GetEntries() - << ", Integral=" << hGenMult->Integral(); - } - LOG(info) << "=== END OF STREAM COMPLETE ==="; - } + void endOfStream(EndOfStreamContext& /*eos*/) {} }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) @@ -446,32 +370,16 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) void MultiplicityPt::init(InitContext const&) { LOG(info) << "=================================================="; - LOG(info) << "Initializing MultiplicityPt task with full centrality diagnostics"; + LOG(info) << "Initializing MultiplicityPt task - FULL CORRECTION FACTORS"; LOG(info) << "=================================================="; - // Initialize phi cut functions if (applyPhiCut.value) { - fphiCutLow = new TF1("StandardPhiCutLow", - Form("%f/x/x+pi/18.0-%f", - phiCutLowParam1.value, phiCutLowParam2.value), - 0, 50); - fphiCutHigh = new TF1("StandardPhiCutHigh", - Form("%f/x+pi/18.0+%f", - phiCutHighParam1.value, phiCutHighParam2.value), - 0, 50); - - LOGF(info, "=== Phi Cut Parameters ==="); - LOGF(info, "Low cut: %.6f/x² + pi/18 - %.6f", - phiCutLowParam1.value, phiCutLowParam2.value); - LOGF(info, "High cut: %.6f/x + pi/18 + %.6f", - phiCutHighParam1.value, phiCutHighParam2.value); - LOGF(info, "Applied for pT > %.1f GeV/c", pTthresholdPhiCut.value); + fphiCutLow = new TF1("StandardPhiCutLow", Form("%f/x/x+pi/18.0-%f", phiCutLowParam1.value, phiCutLowParam2.value), 0, 50); + fphiCutHigh = new TF1("StandardPhiCutHigh", Form("%f/x+pi/18.0+%f", phiCutHighParam1.value, phiCutHighParam2.value), 0, 50); } if (useCustomTrackCuts.value) { - LOG(info) << "Using custom track cuts matching spectraTOF approach"; customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(itsPattern.value); - customTrackCuts.SetRequireITSRefit(requireITS.value); customTrackCuts.SetRequireTPCRefit(requireTPC.value); customTrackCuts.SetRequireGoldenChi2(requireGoldenChi2.value); @@ -482,80 +390,50 @@ void MultiplicityPt::init(InitContext const&) customTrackCuts.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); customTrackCuts.SetMaxDcaXYPtDep([](float /*pt*/) { return 10000.f; }); customTrackCuts.SetMaxDcaZ(maxDcaZ.value); - customTrackCuts.print(); } - // Axis definitions ConfigurableAxis ptBinning{"ptBinning", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT bin limits"}; - AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; std::vector centBinningStd = {0., 1., 5., 10., 15., 20., 30., 40., 50., 60., 70., 80., 90., 100.}; - - // Fine centrality binning for diagnostics (100 bins, guaranteed increasing) std::vector centBinningFine; - for (int i = 0; i <= CentBinMax; i++) { + for (int i = 0; i <= CentBinMax; i++) centBinningFine.push_back(static_cast(i)); - } AxisSpec centAxis = {centBinningStd, "FT0M Centrality (%)"}; AxisSpec centFineAxis = {centBinningFine, "FT0M Centrality (%)"}; - // Multiplicity axes - properly defined std::vector multBins; - for (int i = 0; i <= MultBinMax; i++) { + for (int i = 0; i <= MultBinMax; i++) multBins.push_back(static_cast(i)); - } AxisSpec multAxis = {multBins, "N_{ch}^{gen} (|#eta|<0.8)"}; - // Reconstructed multiplicity axis - properly defined with explicit bin edges std::vector recoMultBins; - for (int i = 0; i <= RecMultBinMax; i++) { + for (int i = 0; i <= RecMultBinMax; i++) recoMultBins.push_back(static_cast(i)); - } AxisSpec recoMultAxis = {recoMultBins, "N_{ch}^{reco}"}; - // Centrality diagnostic histograms - USE FINE BINNING - ue.add("Centrality/hCentRaw", "Raw FT0M Centrality (no cuts);Centrality (%);Counts", - HistType::kTH1D, {centFineAxis}); - ue.add("Centrality/hCentAfterVtx", "Centrality after vertex cut;Centrality (%);Counts", - HistType::kTH1D, {centFineAxis}); - ue.add("Centrality/hCentAfterINEL", "Centrality after INEL cut;Centrality (%);Counts", - HistType::kTH1D, {centFineAxis}); - ue.add("Centrality/hCentAfterAll", "Centrality after all cuts;Centrality (%);Counts", - HistType::kTH1D, {centFineAxis}); - - // 2D correlations - USE FINE BINNING FOR DIAGNOSTICS - ue.add("Centrality/hCentVsMult", "Centrality vs Generated Multiplicity;Centrality (%);N_{ch}^{gen}", - HistType::kTH2D, {centFineAxis, multAxis}); - ue.add("Centrality/hMultVsCent", "Generated Multiplicity vs Centrality;N_{ch}^{gen};Centrality (%)", - HistType::kTH2D, {multAxis, centFineAxis}); - ue.add("Centrality/hCentVsVz", "Centrality vs Vertex Z;Centrality (%);V_{z} (cm)", - HistType::kTH2D, {centFineAxis, {40, -20, 20}}); - ue.add("Centrality/hRecoMultVsCent", "Reconstructed Track Multiplicity vs Centrality;Centrality (%);N_{tracks}^{reco}", - HistType::kTH2D, {centFineAxis, recoMultAxis}); - ue.add("Centrality/hGenMultPerCent", "Generated Multiplicity Distribution per Centrality Bin;Centrality (%);", - HistType::kTH2D, {centFineAxis, multAxis}); - - // Vertex resolution vs centrality - ue.add("Centrality/hVertexResVsCent", "Vertex Resolution vs Centrality;Centrality (%);V_{z} resolution (cm)", - HistType::kTH2D, {centFineAxis, {100, -1, 1}}); - - // INEL class distributions - ue.add("INEL/hINELClass", "INEL Class for MC Collisions;INEL Class;Counts", - HistType::kTH1D, {{3, 0.5, 3.5}}); + ue.add("Centrality/hCentRaw", "Raw FT0M Centrality (no cuts);Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterVtx", "Centrality after vertex cut;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterINEL", "Centrality after INEL cut;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterAll", "Centrality after all cuts;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentVsMult", "Centrality vs Generated Multiplicity;Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centFineAxis, multAxis}); + ue.add("Centrality/hMultVsCent", "Generated Multiplicity vs Centrality;N_{ch}^{gen};Centrality (%)", HistType::kTH2D, {multAxis, centFineAxis}); + ue.add("Centrality/hCentVsVz", "Centrality vs Vertex Z;Centrality (%);V_{z} (cm)", HistType::kTH2D, {centFineAxis, {40, -20, 20}}); + ue.add("Centrality/hRecoMultVsCent", "Reconstructed Track Multiplicity vs Centrality;Centrality (%);N_{tracks}^{reco}", HistType::kTH2D, {centFineAxis, recoMultAxis}); + ue.add("Centrality/hGenMultPerCent", "Generated Multiplicity Distribution per Centrality Bin;Centrality (%);", HistType::kTH2D, {centFineAxis, multAxis}); + ue.add("Centrality/hVertexResVsCent", "Vertex Resolution vs Centrality;Centrality (%);V_{z} resolution (cm)", HistType::kTH2D, {centFineAxis, {100, -1, 1}}); + + ue.add("INEL/hINELClass", "INEL Class for MC Collisions;INEL Class;Counts", HistType::kTH1D, {{3, 0.5, 3.5}}); auto hINEL = ue.get(HIST("INEL/hINELClass")); hINEL->GetXaxis()->SetBinLabel(1, "INEL0"); hINEL->GetXaxis()->SetBinLabel(2, "INEL>0"); hINEL->GetXaxis()->SetBinLabel(3, "INEL>1"); - ue.add("INEL/hINELVsCent", "INEL Class vs Centrality;Centrality (%);INEL Class", - HistType::kTH2D, {centFineAxis, {3, 0.5, 3.5}}); + ue.add("INEL/hINELVsCent", "INEL Class vs Centrality;Centrality (%);INEL Class", HistType::kTH2D, {centFineAxis, {3, 0.5, 3.5}}); - // Cut flow - ue.add("CutFlow/hCutStats", "Cut Statistics;Cut Stage;Counts", - HistType::kTH1D, {{6, 0.5, 6.5}}); + ue.add("CutFlow/hCutStats", "Cut Statistics;Cut Stage;Counts", HistType::kTH1D, {{6, 0.5, 6.5}}); auto hCut = ue.get(HIST("CutFlow/hCutStats")); hCut->GetXaxis()->SetBinLabel(1, "All reco events"); hCut->GetXaxis()->SetBinLabel(2, "Has MC match"); @@ -564,180 +442,136 @@ void MultiplicityPt::init(InitContext const&) hCut->GetXaxis()->SetBinLabel(5, "Pass INEL"); hCut->GetXaxis()->SetBinLabel(6, "Selected"); - ue.add("CutFlow/hCentPerCut", "Centrality Distribution at Each Cut;Cut Stage;Centrality (%)", - HistType::kTH2D, {{6, 0.5, 6.5}, centFineAxis}); + ue.add("CutFlow/hCentPerCut", "Centrality Distribution at Each Cut;Cut Stage;Centrality (%)", HistType::kTH2D, {{6, 0.5, 6.5}, centFineAxis}); - ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", - HistType::kTH1D, {{10, 0.5, 10.5}}); + ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", HistType::kTH1D, {{10, 0.5, 10.5}}); auto hColl = ue.get(HIST("MC/GenRecoCollisions")); hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); hColl->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); hColl->GetXaxis()->SetBinLabel(3, "INEL>0"); hColl->GetXaxis()->SetBinLabel(4, "INEL>1"); - ue.add("hEventLossBreakdown", "Event loss breakdown", - HistType::kTH1D, {{4, 0.5, 4.5}}); + ue.add("hEventLossBreakdown", "Event loss breakdown", HistType::kTH1D, {{4, 0.5, 4.5}}); auto hLoss = ue.get(HIST("hEventLossBreakdown")); hLoss->GetXaxis()->SetBinLabel(1, "Physics selected"); hLoss->GetXaxis()->SetBinLabel(2, "Reconstructed"); hLoss->GetXaxis()->SetBinLabel(3, "Selected"); hLoss->GetXaxis()->SetBinLabel(4, "Final efficiency"); - // Multiplicity histograms - ue.add("MC/EventLoss/NchGenerated", "Generated charged multiplicity;N_{ch}^{gen} (|#eta|<0.8);Counts", - HistType::kTH1D, {{200, 0, 200}}); - ue.add("MC/EventLoss/NchGenerated_PhysicsSelected", "Generated charged multiplicity (physics selected);N_{ch}^{gen} (|#eta|<0.8);Counts", - HistType::kTH1D, {{200, 0, 200}}); - ue.add("MC/EventLoss/NchGenerated_Reconstructed", "Generated charged multiplicity (reconstructed);N_{ch}^{gen} (|#eta|<0.8);Counts", - HistType::kTH1D, {{200, 0, 200}}); - - // pT vs Multiplicity - ue.add("MC/GenPtVsNch", "Generated pT vs Multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", - HistType::kTH2D, {ptAxis, {200, 0, 200}}); - ue.add("MC/GenPtVsNch_PhysicsSelected", "Generated pT vs Multiplicity (physics selected);#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", - HistType::kTH2D, {ptAxis, {200, 0, 200}}); - - // Centrality vs Multiplicity correlations - USE STANDARD BINNING FOR THESE - ue.add("MC/EventLoss/GenMultVsCent", "Generated charged particles vs FT0M centrality;FT0M Centrality (%);N_{ch}^{gen} (|#eta|<0.8)", - HistType::kTH2D, {centAxis, multAxis}); - ue.add("MC/EventLoss/GenMultVsCent_Selected", "Generated vs FT0M centrality (selected events);FT0M Centrality (%);N_{ch}^{gen}", - HistType::kTH2D, {centAxis, multAxis}); - ue.add("MC/EventLoss/GenMultVsCent_Rejected", "Generated vs FT0M centrality (rejected events);FT0M Centrality (%);N_{ch}^{gen}", - HistType::kTH2D, {centAxis, multAxis}); - - // TPC cluster histograms - ue.add("hNclFoundTPC", "Number of TPC found clusters", - HistType::kTH1D, {{200, 0, 200, "N_{cl, found}"}}); - ue.add("hNclPIDTPC", "Number of TPC PID clusters", - HistType::kTH1D, {{200, 0, 200, "N_{cl, PID}"}}); - ue.add("hNclFoundTPCvsPt", "TPC found clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,found}", - HistType::kTH2D, {ptAxis, {200, 0., 200.}}); - ue.add("hNclPIDTPCvsPt", "TPC PID clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,PID}", - HistType::kTH2D, {ptAxis, {200, 0., 200.}}); - - // Inclusive histograms - ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - - ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - - ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - - ue.add("Inclusive/hPtMeasuredVsCent", "All measured tracks (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", - HistType::kTH2D, {ptAxis, centAxis}); - - // Phi cut monitoring histograms - if (applyPhiCut.value) { - ue.add("PhiCut/hPtVsPhiPrimeBefore", "pT vs φ' before cut;p_{T} (GeV/c);φ'", - HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hPtVsPhiPrimeAfter", "pT vs φ' after cut;p_{T} (GeV/c);φ'", - HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hRejectionRate", "Track rejection rate by phi cut;p_{T} (GeV/c);Rejection Rate", - HistType::kTProfile, {{100, 0, 10}}); - } - - // Particle-specific histograms - const std::array particleNames = {"Pion", "Kaon", "Proton"}; - const std::array particleSymbols = {"#pi^{#pm}", "K^{#pm}", "p+#bar{p}"}; - - for (int iSpecies = 0; iSpecies < kNSpecies; ++iSpecies) { - const auto& name = particleNames[iSpecies]; - const auto& symbol = particleSymbols[iSpecies]; - - ue.add(Form("%s/hPtPrimGenAll", name.c_str()), - Form("All generated %s (no cuts);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimBadVertex", name.c_str()), - Form("Generated %s (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimGen", name.c_str()), - Form("Generated %s (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimRecoEv", name.c_str()), - Form("Generated %s (reco events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimGoodEv", name.c_str()), - Form("Generated %s (good events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtNumEff", name.c_str()), - Form("%s tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtDenEff", name.c_str()), - Form("%s tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtAllReco", name.c_str()), - Form("All reconstructed %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimReco", name.c_str()), - Form("Reconstructed primary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtSecReco", name.c_str()), - Form("Reconstructed secondary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtMeasuredVsCent", name.c_str()), - Form("Measured %s (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, centAxis}); - - if (enablePIDHistograms) { - ue.add(Form("%s/hNsigmaTPC", name.c_str()), - Form("TPC n#sigma %s;#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", symbol.c_str()), - HistType::kTH2D, {ptAxis, {200, -10, 10}}); - } - } - - // Event selection histogram - constexpr int NEvSelBins = 20; - constexpr float EvSelMin = 0.5f; - constexpr float EvSelMax = 20.5f; - ue.add("evsel", "Event selection", HistType::kTH1D, {{NEvSelBins, EvSelMin, EvSelMax}}); - auto h = ue.get(HIST("evsel")); - h->GetXaxis()->SetBinLabel(1, "Events read"); - h->GetXaxis()->SetBinLabel(4, "Trigger passed"); - h->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); - h->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); - h->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); - h->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); - h->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); - h->GetXaxis()->SetBinLabel(13, "posZ passed"); - - // Basic tracking histograms + ue.add("MC/EventLoss/NchGenerated", "Generated charged multiplicity;N_{ch}^{gen};Counts", HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/NchGenerated_PhysicsSelected", "Generated charged multiplicity (physics selected);N_{ch}^{gen};Counts", HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/NchGenerated_Reconstructed", "Generated charged multiplicity (reconstructed);N_{ch}^{gen};Counts", HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/GenMultVsCent", "Generated charged particles vs FT0M centrality;FT0M Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centAxis, multAxis}); + ue.add("MC/EventLoss/GenMultVsCent_Selected", "Generated vs FT0M centrality (selected events);FT0M Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centAxis, multAxis}); + ue.add("MC/EventLoss/GenMultVsCent_Rejected", "Generated vs FT0M centrality (rejected events);FT0M Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centAxis, multAxis}); + + ue.add("MC/GenPtVsNch", "Generated pT vs Multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, {200, 0, 200}}); + ue.add("MC/GenPtVsNch_PhysicsSelected", "Generated pT vs Multiplicity (physics selected);#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, {200, 0, 200}}); + + ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + + // Tracking efficiency + ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator (generated primaries in selected events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator (reconstructed primaries matched to generated);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + + // Primary fraction + ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + + // Multiplicity-dependent + ue.add("Inclusive/hPtDenEffVsCent", "Generated primaries vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Inclusive/hPtNumEffVsCent", "Reconstructed primaries matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Inclusive/hPtPrimRecoVsCent", "Reconstructed primaries vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Inclusive/hPtAllRecoVsCent", "All reconstructed tracks vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Inclusive/hPtMeasuredVsCent", "All measured tracks (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + + ue.add("Pion/hPtPrimGenAll", "All generated #pi^{#pm} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimGen", "Generated #pi^{#pm} (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimBadVertex", "Generated #pi^{#pm} (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimRecoEv", "Generated #pi^{#pm} (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimGoodEv", "Generated #pi^{#pm} (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtDenEff", "#pi^{#pm} tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtNumEff", "#pi^{#pm} tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtAllReco", "All reconstructed #pi^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimReco", "Reconstructed primary #pi^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtSecReco", "Reconstructed secondary #pi^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtDenEffVsCent", "Generated #pi^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Pion/hPtNumEffVsCent", "Reconstructed #pi^{#pm} matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Pion/hPtPrimRecoVsCent", "Reconstructed primary #pi^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Pion/hPtAllRecoVsCent", "All reconstructed #pi^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Pion/hPtMeasuredVsCent", "Measured #pi^{#pm} (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + if (enablePIDHistograms) + ue.add("Pion/hNsigmaTPC", "TPC n#sigma #pi^{#pm};#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", HistType::kTH2D, {ptAxis, {200, -10, 10}}); + + ue.add("Kaon/hPtPrimGenAll", "All generated K^{#pm} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtPrimGen", "Generated K^{#pm} (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtPrimBadVertex", "Generated K^{#pm} (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtPrimRecoEv", "Generated K^{#pm} (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtPrimGoodEv", "Generated K^{#pm} (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtDenEff", "K^{#pm} tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtNumEff", "K^{#pm} tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtAllReco", "All reconstructed K^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtPrimReco", "Reconstructed primary K^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtSecReco", "Reconstructed secondary K^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtDenEffVsCent", "Generated K^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Kaon/hPtNumEffVsCent", "Reconstructed K^{#pm} matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Kaon/hPtPrimRecoVsCent", "Reconstructed primary K^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Kaon/hPtAllRecoVsCent", "All reconstructed K^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Kaon/hPtMeasuredVsCent", "Measured K^{#pm} (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + if (enablePIDHistograms) + ue.add("Kaon/hNsigmaTPC", "TPC n#sigma K^{#pm};#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", HistType::kTH2D, {ptAxis, {200, -10, 10}}); + + ue.add("Proton/hPtPrimGenAll", "All generated p+#bar{p} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtPrimGen", "Generated p+#bar{p} (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtPrimBadVertex", "Generated p+#bar{p} (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtPrimRecoEv", "Generated p+#bar{p} (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtPrimGoodEv", "Generated p+#bar{p} (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtDenEff", "p+#bar{p} tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtNumEff", "p+#bar{p} tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtAllReco", "All reconstructed p+#bar{p};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtPrimReco", "Reconstructed primary p+#bar{p};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtSecReco", "Reconstructed secondary p+#bar{p};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtDenEffVsCent", "Generated p+#bar{p} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Proton/hPtNumEffVsCent", "Reconstructed p+#bar{p} matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Proton/hPtPrimRecoVsCent", "Reconstructed primary p+#bar{p} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Proton/hPtAllRecoVsCent", "All reconstructed p+#bar{p} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Proton/hPtMeasuredVsCent", "Measured p+#bar{p} (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + if (enablePIDHistograms) + ue.add("Proton/hNsigmaTPC", "TPC n#sigma p+#bar{p};#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", HistType::kTH2D, {ptAxis, {200, -10, 10}}); + + ue.add("hNclFoundTPC", "Number of TPC found clusters", HistType::kTH1D, {{200, 0, 200}}); + ue.add("hNclPIDTPC", "Number of TPC PID clusters", HistType::kTH1D, {{200, 0, 200}}); + ue.add("hNclFoundTPCvsPt", "TPC found clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,found}", HistType::kTH2D, {ptAxis, {200, 0., 200.}}); + ue.add("hNclPIDTPCvsPt", "TPC PID clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,PID}", HistType::kTH2D, {ptAxis, {200, 0., 200.}}); ue.add("hEta", "Track eta;#eta;Counts", HistType::kTH1D, {{20, -0.8, 0.8}}); ue.add("hPhi", "Track phi;#varphi (rad);Counts", HistType::kTH1D, {{64, 0, TwoPI}}); ue.add("hvtxZ", "Vertex Z (data);Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); ue.add("hvtxZmc", "MC vertex Z;Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - LOG(info) << "=== Initialized MultiplicityPt task with full centrality diagnostics ==="; - LOG(info) << "Standard centrality binning: " << centBinningStd.size() - 1 << " bins (0-100%)"; - LOG(info) << "Fine centrality binning: " << centBinningFine.size() - 1 << " bins (0-100%)"; + ue.add("evsel", "Event selection", HistType::kTH1D, {{20, 0.5, 20.5}}); + auto hEvSel = ue.get(HIST("evsel")); + hEvSel->GetXaxis()->SetBinLabel(1, "Events read"); + hEvSel->GetXaxis()->SetBinLabel(4, "Trigger passed"); + hEvSel->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); + hEvSel->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); + hEvSel->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); + hEvSel->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); + hEvSel->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); + hEvSel->GetXaxis()->SetBinLabel(13, "posZ passed"); + + // Phi cut monitoring if (applyPhiCut.value) { - LOG(info) << "Phi cut ENABLED for pT > " << pTthresholdPhiCut.value << " GeV/c"; + ue.add("PhiCut/hPtVsPhiPrimeBefore", "pT vs φ' before cut;p_{T} (GeV/c);φ'", HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); + ue.add("PhiCut/hPtVsPhiPrimeAfter", "pT vs φ' after cut;p_{T} (GeV/c);φ'", HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); + ue.add("PhiCut/hRejectionRate", "Track rejection rate by phi cut;p_{T} (GeV/c);Rejection Rate", HistType::kTProfile, {{100, 0, 10}}); } -} -void MultiplicityPt::processData(CollisionTableData::iterator const& /*collision*/, - TrackTableData const& /*tracks*/, - BCsRun3 const& /*bcs*/) -{ - // Intentionally empty - data processing disabled + LOG(info) << "=== Initialization complete - All correction factor histograms defined ==="; } void MultiplicityPt::processMC(TrackTableMC const& tracks, @@ -749,228 +583,203 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, BCsRun3 const& /*bcs*/) { LOG(info) << "\n=== processMC START ==="; - LOG(info) << "Total MC collisions (generated): " << mcCollisions.size(); - LOG(info) << "Total reconstructed collisions: " << collisions.size(); - LOG(info) << "Total collision labels: " << labels.size(); - LOG(info) << "Total centrality entries: " << centTable.size(); - - LOG(info) << "\n=== CENTRALITY DEBUG - RAW DATA ==="; - LOG(info) << "First 20 centrality values from centTable:"; - int debugCount = 0; - float minCent = 999.0f, maxCent = -999.0f; - std::map centDistribution; - - for (const auto& cent : centTable) { - float c = cent.centFT0M(); - if (debugCount < DebugCountMax) { - LOG(info) << " Cent entry " << debugCount << ": " << c; - } - minCent = std::min(minCent, c); - maxCent = std::max(maxCent, c); - - int bin10 = static_cast(c / 10) * 10; - centDistribution[bin10]++; - debugCount++; - } - - LOG(info) << "Centrality range: [" << minCent << ", " << maxCent << "]"; - LOG(info) << "Distribution by 10% bins:"; - for (int i = 0; i < CentBinMax; i += 10) { - LOG(info) << " " << i << "-" << i + 10 << "%: " << centDistribution[i]; - } - - // Check if centrality is inverted (0 = peripheral, 100 = central) - // If minCent is near 0 and maxCent near 100, check correlation with multiplicity - LOG(info) << "Checking if centrality might be inverted..."; - LOG(info) << "Will check correlation with multiplicity in the next step."; std::map mcCollisionToNch; std::map mcCollisionVz; std::set physicsSelectedMCCollisions; - std::map mcCollisionToINELClass; // 0=INEL0, 1=INEL>0, 2=INEL>1 + std::map mcCollisionToINELClass; ue.fill(HIST("MC/GenRecoCollisions"), 1.f, mcCollisions.size()); - ue.fill(HIST("MC/GenRecoCollisions"), 2.f, collisions.size()); - - LOG(info) << "\n--- FIRST PASS: Building MC collision maps ---"; - - int mcWithParticles = 0; - int mcINELgt0 = 0, mcINELgt1 = 0; for (const auto& mcCollision : mcCollisions) { int64_t mcCollId = mcCollision.globalIndex(); auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); int nGenCharged = countGeneratedChargedPrimaries(particlesInCollision, cfgCutEtaMax.value, cfgTrkLowPtCut.value); - mcCollisionToNch[mcCollId] = nGenCharged; mcCollisionVz[mcCollId] = mcCollision.posZ(); - // Determine INEL class bool inel0 = o2::pwglf::isINELgt0mc(particlesInCollision, pdg); bool inel1 = o2::pwglf::isINELgt1mc(particlesInCollision, pdg); - - int inelClass = 0; - if (inel1) - inelClass = 2; - else if (inel0) - inelClass = 1; + int inelClass = inel1 ? 2 : (inel0 ? 1 : 0); mcCollisionToINELClass[mcCollId] = inelClass; ue.fill(HIST("INEL/hINELClass"), inelClass); - - if (inel0) - mcINELgt0++; - if (inel1) - mcINELgt1++; - if (nGenCharged > 0) - mcWithParticles++; - ue.fill(HIST("MC/EventLoss/NchGenerated"), nGenCharged); - // Physics selection based on vertex and INEL cuts - bool physicsSelected = true; - - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { - physicsSelected = false; - } - - // Apply INEL cut based on configuration - if (cfgINELCut.value == INELgt0 && !inel0) { + bool physicsSelected = (std::abs(mcCollision.posZ()) <= cfgCutVertex.value); + if (cfgINELCut.value == INELgt0 && !inel0) physicsSelected = false; - } - if (cfgINELCut.value == INELgt1 && !inel1) { + if (cfgINELCut.value == INELgt1 && !inel1) physicsSelected = false; - } if (physicsSelected) { physicsSelectedMCCollisions.insert(mcCollId); ue.fill(HIST("MC/EventLoss/NchGenerated_PhysicsSelected"), nGenCharged); - - if (inel0) { + if (inel0) ue.fill(HIST("MC/GenRecoCollisions"), 3.f); - } - if (inel1) { + if (inel1) ue.fill(HIST("MC/GenRecoCollisions"), 4.f); + } + } + + // DEBUG: Count raw protons in MC (no cuts) + { + int nProtonsRaw = 0; + int nProtonsTotal = 0; + int nProtonsPassEta = 0; + int nProtonsPassPt = 0; + int nProtonsPassBoth = 0; + + for (const auto& mcCollision : mcCollisions) { + auto particlesInCollision = particles.sliceBy(perMCCol, mcCollision.globalIndex()); + for (const auto& particle : particlesInCollision) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + continue; + + int pdgCode = std::abs(particle.pdgCode()); + if (pdgCode == PDG_t::kProton) { + nProtonsRaw++; // Count ALL protons regardless of status + + if (!particle.isPhysicalPrimary()) + continue; + nProtonsTotal++; + + bool passEta = (std::abs(particle.eta()) < cfgCutEtaMax.value); + bool passPt = (particle.pt() >= cfgTrkLowPtCut.value); + if (passEta) + nProtonsPassEta++; + if (passPt) + nProtonsPassPt++; + if (passEta && passPt) + nProtonsPassBoth++; + } } } + LOG(info) << "=== PROTON DEBUG ==="; + LOG(info) << "RAW protons in MC (any status): " << nProtonsRaw; + LOG(info) << "Physical primary protons: " << nProtonsTotal; + LOG(info) << "Protons passing eta cut (|eta|<" << cfgCutEtaMax.value << "): " << nProtonsPassEta; + LOG(info) << "Protons passing pT cut (pT>=" << cfgTrkLowPtCut.value << "): " << nProtonsPassPt; + LOG(info) << "Protons passing both cuts: " << nProtonsPassBoth; + if (nProtonsRaw == 0) { + LOG(warning) << "NO PROTONS FOUND IN MC! Check your MC generator settings."; + } } - LOG(info) << "\n--- FIRST PASS SUMMARY ---"; - LOG(info) << "Total MC collisions processed: " << mcCollisions.size(); - LOG(info) << "MC collisions with particles: " << mcWithParticles; - LOG(info) << "INEL0: " << (mcCollisions.size() - mcINELgt0); - LOG(info) << "INEL>0: " << mcINELgt0; - LOG(info) << "INEL>1: " << mcINELgt1; - LOG(info) << "Physics-selected MC collisions: " << physicsSelectedMCCollisions.size(); + LOG(info) << "\n--- FILLING GENERATED PARTICLE SPECTRA ---"; + + for (const auto& mcCollision : mcCollisions) { + int64_t mcCollId = mcCollision.globalIndex(); + auto nchIt = mcCollisionToNch.find(mcCollId); + if (nchIt == mcCollisionToNch.end()) + continue; + int nGenCharged = nchIt->second; + bool isPhysicsSelected = (physicsSelectedMCCollisions.find(mcCollId) != physicsSelectedMCCollisions.end()); + auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); + + for (const auto& particle : particlesInCollision) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + continue; + if (!particle.isPhysicalPrimary()) + continue; + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + continue; + if (particle.pt() < cfgTrkLowPtCut.value) + continue; + + int pdgCode = std::abs(particle.pdgCode()); + float pt = particle.pt(); + + // All generated (no cuts) - SIGNAL LOSS DENOMINATOR + ue.fill(HIST("Inclusive/hPtPrimGenAll"), pt); + ue.fill(HIST("MC/GenPtVsNch"), pt, nGenCharged); + if (pdgCode == PDG_t::kPiPlus) + ue.fill(HIST("Pion/hPtPrimGenAll"), pt); + else if (pdgCode == PDG_t::kKPlus) + ue.fill(HIST("Kaon/hPtPrimGenAll"), pt); + else if (pdgCode == PDG_t::kProton) + ue.fill(HIST("Proton/hPtPrimGenAll"), pt); + + // Physics selected - SIGNAL LOSS NUMERATOR & EFFICIENCY DENOMINATOR + if (isPhysicsSelected) { + ue.fill(HIST("Inclusive/hPtPrimGen"), pt); + ue.fill(HIST("Inclusive/hPtDenEff"), pt); + ue.fill(HIST("MC/GenPtVsNch_PhysicsSelected"), pt, nGenCharged); + if (pdgCode == PDG_t::kPiPlus) { + ue.fill(HIST("Pion/hPtPrimGen"), pt); + ue.fill(HIST("Pion/hPtDenEff"), pt); + } else if (pdgCode == PDG_t::kKPlus) { + ue.fill(HIST("Kaon/hPtPrimGen"), pt); + ue.fill(HIST("Kaon/hPtDenEff"), pt); + } else if (pdgCode == PDG_t::kProton) { + ue.fill(HIST("Proton/hPtPrimGen"), pt); + ue.fill(HIST("Proton/hPtDenEff"), pt); + } + } + + // Bad vertex for signal loss study + if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { + ue.fill(HIST("Inclusive/hPtPrimBadVertex"), pt); + if (pdgCode == PDG_t::kPiPlus) + ue.fill(HIST("Pion/hPtPrimBadVertex"), pt); + else if (pdgCode == PDG_t::kKPlus) + ue.fill(HIST("Kaon/hPtPrimBadVertex"), pt); + else if (pdgCode == PDG_t::kProton) + ue.fill(HIST("Proton/hPtPrimBadVertex"), pt); + } + } + } std::map recoToMcMap; std::map recoToCentMap; - size_t nCollisions = collisions.size(); - - // Associate labels with collisions by index size_t iLabel = 0; + size_t nCollisions = collisions.size(); for (const auto& label : labels) { if (iLabel < nCollisions) { const auto& collision = collisions.iteratorAt(iLabel); - int64_t recoCollId = collision.globalIndex(); - int64_t mcCollId = label.mcCollisionId(); - recoToMcMap[recoCollId] = mcCollId; + recoToMcMap[collision.globalIndex()] = label.mcCollisionId(); } iLabel++; } - // Associate centrality with collisions by index size_t iCent = 0; for (const auto& cent : centTable) { if (iCent < nCollisions) { const auto& collision = collisions.iteratorAt(iCent); - int64_t recoCollId = collision.globalIndex(); float centValue = cent.centFT0M(); - - // Fill raw centrality histogram + recoToCentMap[collision.globalIndex()] = centValue; ue.fill(HIST("Centrality/hCentRaw"), centValue); - - recoToCentMap[recoCollId] = centValue; } iCent++; } - LOG(info) << "\n--- MAP SIZES ---"; - LOG(info) << "recoToMcMap size: " << recoToMcMap.size(); - LOG(info) << "recoToCentMap size: " << recoToCentMap.size(); - - LOG(info) << "\n=== CENTRALITY VS MULTIPLICITY DEBUG ==="; - - // Create temporary vectors to check correlation - std::vector> centMultPairs; - for (const auto& collision : collisions) { - int64_t collId = collision.globalIndex(); - - auto mcIt = recoToMcMap.find(collId); - if (mcIt == recoToMcMap.end()) - continue; - - auto centIt = recoToCentMap.find(collId); - if (centIt == recoToCentMap.end()) - continue; - - auto nchIt = mcCollisionToNch.find(mcIt->second); - if (nchIt == mcCollisionToNch.end()) - continue; - - centMultPairs.push_back({centIt->second, nchIt->second}); - } - - // Sort by centrality - std::sort(centMultPairs.begin(), centMultPairs.end()); - - LOG(info) << "Correlation between centrality and multiplicity:"; - LOG(info) << " If centrality is normal (0=central, 100=peripheral), multiplicity should decrease with centrality"; - LOG(info) << " If inverted (0=peripheral, 100=central), multiplicity should increase with centrality"; - - // Print a few samples across the range - if (centMultPairs.size() > CentMultClasses) { - for (size_t i = 0; i < centMultPairs.size(); i += centMultPairs.size() / 10) { - LOG(info) << " Cent: " << centMultPairs[i].first - << "%, Mult: " << centMultPairs[i].second; - } - } - - //=========================================================================== - // SECOND PASS: Process reconstructed collisions with detailed cut accounting - //=========================================================================== - - LOG(info) << "\n--- SECOND PASS: Processing reconstructed collisions ---"; + LOG(info) << "\n--- PROCESSING RECONSTRUCTED COLLISIONS ---"; std::set reconstructedMCCollisions; std::set selectedMCCollisions; + // For cut statistics + std::vector centAll, centVertex, centINEL, centSelected; int nRecoCollisions = 0; int nSelectedEvents = 0; int nRejectedEvents = 0; int nNoMCMatch = 0; int nNoCent = 0; int nInvalidCent = 0; - - // Cut counters int nPassVertex = 0; int nPassINEL = 0; int nPassAll = 0; - // For mean calculations - std::vector centAll, centVertex, centINEL, centSelected; - for (const auto& collision : collisions) { nRecoCollisions++; - int64_t collId = collision.globalIndex(); - // Fill cut flow ue.fill(HIST("CutFlow/hCutStats"), 1); - // Get MC collision ID from labels map auto mcIt = recoToMcMap.find(collId); if (mcIt == recoToMcMap.end()) { nNoMCMatch++; @@ -979,27 +788,20 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, ue.fill(HIST("CutFlow/hCutStats"), 2); int64_t mcCollId = mcIt->second; - - // Get generated multiplicity for this MC collision auto nchIt = mcCollisionToNch.find(mcCollId); - if (nchIt == mcCollisionToNch.end()) { + if (nchIt == mcCollisionToNch.end()) continue; - } - int nGenCharged = nchIt->second; - // Get INEL class auto inelIt = mcCollisionToINELClass.find(mcCollId); int inelClass = (inelIt != mcCollisionToINELClass.end()) ? inelIt->second : 0; - // Get centrality from cent map auto centIt = recoToCentMap.find(collId); if (centIt == recoToCentMap.end()) { nNoCent++; continue; } ue.fill(HIST("CutFlow/hCutStats"), 3); - float cent = centIt->second; if (cent < 0 || cent > CentBinMax) { nInvalidCent++; @@ -1023,13 +825,11 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, nPassVertex++; } - // Check INEL selection at generator level bool passINEL = true; if (cfgINELCut.value == INELgt0 && inelClass < INELgt0) passINEL = false; if (cfgINELCut.value == INELgt1 && inelClass < INELgt1) passINEL = false; - if (passINEL) { centINEL.push_back(cent); ue.fill(HIST("Centrality/hCentAfterINEL"), cent); @@ -1038,15 +838,11 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, nPassINEL++; } - // Fill GenMultVsCent for all reconstructed events ue.fill(HIST("MC/EventLoss/GenMultVsCent"), cent, nGenCharged); ue.fill(HIST("MC/EventLoss/NchGenerated_Reconstructed"), nGenCharged); - reconstructedMCCollisions.insert(mcCollId); - // Apply all cuts bool passedAll = passVertex && passINEL; - if (!passedAll) { ue.fill(HIST("MC/EventLoss/GenMultVsCent_Rejected"), cent, nGenCharged); nRejectedEvents++; @@ -1085,9 +881,8 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, ue.fill(HIST("PhiCut/hPtVsPhiPrimeBefore"), track.pt(), phiPrime); } - if (!passesTrackSelection(track, magField)) { + if (!passesTrackSelection(track, magField)) continue; - } // Fill phi cut monitoring after cut if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { @@ -1103,65 +898,81 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, ue.fill(HIST("hNclFoundTPCvsPt"), track.pt(), track.tpcNClsFound()); ue.fill(HIST("hNclPIDTPCvsPt"), track.pt(), track.tpcNClsPID()); + // Inclusive histograms - ALWAYS fill for ALL tracks ue.fill(HIST("Inclusive/hPtAllReco"), track.pt()); + ue.fill(HIST("Inclusive/hPtAllRecoVsCent"), track.pt(), cent); ue.fill(HIST("Inclusive/hPtMeasuredVsCent"), track.pt(), cent); ue.fill(HIST("hEta"), track.eta()); ue.fill(HIST("hPhi"), track.phi()); + // MC matching - FIXED: NO PID requirement for efficiency numerator if (track.has_mcParticle()) { const auto& particle = track.mcParticle(); int pdgCode = std::abs(particle.pdgCode()); if (particle.isPhysicalPrimary()) { + // Fill efficiency numerator for ALL primaries regardless of PID ue.fill(HIST("Inclusive/hPtNumEff"), particle.pt()); + ue.fill(HIST("Inclusive/hPtNumEffVsCent"), particle.pt(), cent); ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); + ue.fill(HIST("Inclusive/hPtPrimRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Inclusive/hPtPrimRecoEv"), particle.pt()); - if (pdgCode == PDGPion) { + // Per-species efficiency numerator - NO PID requirement! + if (pdgCode == PDG_t::kPiPlus) { ue.fill(HIST("Pion/hPtNumEff"), particle.pt()); + ue.fill(HIST("Pion/hPtNumEffVsCent"), particle.pt(), cent); ue.fill(HIST("Pion/hPtPrimReco"), track.pt()); - } else if (pdgCode == PDGKaon) { + ue.fill(HIST("Pion/hPtPrimRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Pion/hPtPrimRecoEv"), particle.pt()); + } else if (pdgCode == PDG_t::kKPlus) { ue.fill(HIST("Kaon/hPtNumEff"), particle.pt()); + ue.fill(HIST("Kaon/hPtNumEffVsCent"), particle.pt(), cent); ue.fill(HIST("Kaon/hPtPrimReco"), track.pt()); - } else if (pdgCode == PDGProton) { + ue.fill(HIST("Kaon/hPtPrimRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Kaon/hPtPrimRecoEv"), particle.pt()); + } else if (pdgCode == PDG_t::kProton) { ue.fill(HIST("Proton/hPtNumEff"), particle.pt()); + ue.fill(HIST("Proton/hPtNumEffVsCent"), particle.pt(), cent); ue.fill(HIST("Proton/hPtPrimReco"), track.pt()); + ue.fill(HIST("Proton/hPtPrimRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Proton/hPtPrimRecoEv"), particle.pt()); } } else { + // Secondaries (non-primary particles) ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); - - if (pdgCode == PDGPion) { + if (pdgCode == PDG_t::kPiPlus) ue.fill(HIST("Pion/hPtSecReco"), track.pt()); - } else if (pdgCode == PDGKaon) { + else if (pdgCode == PDG_t::kKPlus) ue.fill(HIST("Kaon/hPtSecReco"), track.pt()); - } else if (pdgCode == PDGProton) { + else if (pdgCode == PDG_t::kProton) ue.fill(HIST("Proton/hPtSecReco"), track.pt()); - } } } + // PID selection - fill denominator for primary fraction and measured spectra int bestSpecies = getBestPIDHypothesis(track); - - if (bestSpecies == kPion) { - ue.fill(HIST("Pion/hPtMeasuredVsCent"), track.pt(), cent); + if (bestSpecies == PartPion) { + // Denominator for pion primary fraction: all tracks identified as pions ue.fill(HIST("Pion/hPtAllReco"), track.pt()); - - if (enablePIDHistograms) { + ue.fill(HIST("Pion/hPtAllRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Pion/hPtMeasuredVsCent"), track.pt(), cent); + if (enablePIDHistograms) ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } - } else if (bestSpecies == kKaon) { - ue.fill(HIST("Kaon/hPtMeasuredVsCent"), track.pt(), cent); + } else if (bestSpecies == PartKaon) { + // Denominator for kaon primary fraction: all tracks identified as kaons ue.fill(HIST("Kaon/hPtAllReco"), track.pt()); - - if (enablePIDHistograms) { + ue.fill(HIST("Kaon/hPtAllRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Kaon/hPtMeasuredVsCent"), track.pt(), cent); + if (enablePIDHistograms) ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } - } else if (bestSpecies == kProton) { - ue.fill(HIST("Proton/hPtMeasuredVsCent"), track.pt(), cent); + } else if (bestSpecies == PartProton) { + // Denominator for proton primary fraction: all tracks identified as protons ue.fill(HIST("Proton/hPtAllReco"), track.pt()); - - if (enablePIDHistograms) { + ue.fill(HIST("Proton/hPtAllRecoVsCent"), track.pt(), cent); + ue.fill(HIST("Proton/hPtMeasuredVsCent"), track.pt(), cent); + if (enablePIDHistograms) ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); - } } } @@ -1169,7 +980,6 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, ue.fill(HIST("Centrality/hRecoMultVsCent"), cent, nTracksInEvent); } - // Calculate and display cut statistics LOG(info) << "\n=== CUT STATISTICS ==="; LOG(info) << "Total collisions with valid info: " << centAll.size(); LOG(info) << "Pass vertex cut: " << nPassVertex << " (" @@ -1202,7 +1012,6 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, ue.fill(HIST("hEventLossBreakdown"), 1.f, physicsSelectedMCCollisions.size()); ue.fill(HIST("hEventLossBreakdown"), 2.f, reconstructedMCCollisions.size()); ue.fill(HIST("hEventLossBreakdown"), 3.f, selectedMCCollisions.size()); - float efficiency = physicsSelectedMCCollisions.size() > 0 ? 100.f * selectedMCCollisions.size() / physicsSelectedMCCollisions.size() : 0; ue.fill(HIST("hEventLossBreakdown"), 4.f, efficiency); @@ -1213,3 +1022,9 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, LOG(info) << "Efficiency: " << efficiency << "%"; LOG(info) << "=== processMC END ==="; } + +void MultiplicityPt::processData(CollisionTableData::iterator const& /*collision*/, + TrackTableData const& /*tracks*/, + BCsRun3 const& /*bcs*/) +{ +} From 91561eb8a5b426e599bac82ba513b096aa7ebc6d Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Tue, 7 Apr 2026 23:14:34 +0200 Subject: [PATCH 198/282] [PWGLF] Add new task multiplicity analysis in pp (#15678) --- .../GlobalEventProperties/CMakeLists.txt | 5 + .../GlobalEventProperties/nchStudypp.cxx | 602 ++++++++++++++++++ 2 files changed, 607 insertions(+) create mode 100644 PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx diff --git a/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt index c622a91ee37..cde1964f9e2 100644 --- a/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt +++ b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt @@ -38,3 +38,8 @@ o2physics_add_dpl_workflow(ptmult-corr SOURCES ptmultCorr.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(nch-studypp + SOURCES nchStudypp.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx b/PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx new file mode 100644 index 00000000000..caba7146363 --- /dev/null +++ b/PWGLF/Tasks/GlobalEventProperties/nchStudypp.cxx @@ -0,0 +1,602 @@ +// 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. +/// +/// \file nchStudypp.cxx +/// +/// \brief task for analysis of charged-particle pseudorapidity density at midrapidity in pp collisions +/// \author Abhi Modak (abhi.modak@cern.ch) +/// \since April 06, 2026 + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/mcCentrality.h" +#include "PWGLF/Utils/inelGt.h" +#include "PWGMM/Mult/DataModel/Index.h" +#include "PWGMM/Mult/DataModel/bestCollisionTable.h" + +#include "Common/CCDB/EventSelectionParams.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 "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/MathConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Configurable.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "ReconstructionDataFormats/Track.h" + +#include + +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::track; +using namespace o2::aod::evsel; + +using CollisionDataTable = soa::Join; +using TrackDataTable = soa::Join; +using FilTrackDataTable = soa::Filtered; +using CollisionMCTrueTable = aod::McCollisions; +using TrackMCTrueTable = aod::McParticles; +using CollisionMCRecTable = soa::SmallGroups>; +using TrackMCRecTable = soa::Join; +using FilTrackMCRecTable = soa::Filtered; +using V0TrackCandidates = soa::Join; + +enum { + kTrackTypebegin = 0, + kGlobalplusITS = 1, + kGlobalonly, + kITSonly, + kTrackTypeend +}; + +enum { + kGenpTbegin = 0, + kNoGenpTVar = 1, + kGenpTup, + kGenpTdown, + kGenpTend +}; + +enum { + kGenTrkTypebegin = 0, + kGenAll = 1, + kGenPion, + kGenKaon, + kGenProton, + kGenOther, + kGenTrkTypeend +}; + +enum { + kRecTrkTypebegin = 0, + kRecoAll = 1, + kRecoPion, + kRecoKaon, + kRecoProton, + kRecoOther, + kRecoSecondary, + kRecoWeakDecay, + kRecoFake, + kRecoBkg, + kRecTrkTypeend +}; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionIts = + TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | + TrackSelectionFlags::kITSHits; +static constexpr TrackSelectionFlags::flagtype TrackSelectionTpc = + TrackSelectionFlags::kTPCNCls | + TrackSelectionFlags::kTPCCrossedRowsOverNCls | + TrackSelectionFlags::kTPCChi2NDF; +static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = + TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; +static constexpr TrackSelectionFlags::flagtype TrackSelectionDcaxyOnly = + TrackSelectionFlags::kDCAxy; + +AxisSpec axisEvent{15, 0.5, 15.5, "#Event", "EventAxis"}; +AxisSpec axisVtxZ{40, -20, 20, "Vertex Z", "VzAxis"}; +AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"}; +AxisSpec axisPhi{{0, o2::constants::math::PIQuarter, o2::constants::math::PIHalf, o2::constants::math::PIQuarter * 3., o2::constants::math::PI, o2::constants::math::PIQuarter * 5., o2::constants::math::PIHalf * 3., o2::constants::math::PIQuarter * 7., o2::constants::math::TwoPI}, "#phi", "PhiAxis"}; +AxisSpec axisPhi2{629, 0, o2::constants::math::TwoPI, "#phi"}; +AxisSpec axisCent{100, 0, 100, "#Cent"}; +AxisSpec axisTrackType = {kTrackTypeend - 1, +kTrackTypebegin + 0.5, +kTrackTypeend - 0.5, "", "TrackTypeAxis"}; +AxisSpec axisGenPtVary = {kGenpTend - 1, +kGenpTbegin + 0.5, +kGenpTend - 0.5, "", "GenpTVaryAxis"}; +AxisSpec axisGenTrkType = {kGenTrkTypeend - 1, +kGenTrkTypebegin + 0.5, +kGenTrkTypeend - 0.5, "", "GenTrackTypeAxis"}; +AxisSpec axisRecTrkType = {kRecTrkTypeend - 1, +kRecTrkTypebegin + 0.5, +kRecTrkTypeend - 0.5, "", "RecTrackTypeAxis"}; +AxisSpec axisMassK0s = {200, 0.4, 0.6, "K0sMass", "K0sMass"}; +AxisSpec axisMassLambda = {200, 1.07, 1.17, "Lambda/AntiLamda Mass", "Lambda/AntiLamda Mass"}; +auto static constexpr KminCharge = 3.f; +auto static constexpr KminPtCut = 0.1f; + +struct NchStudypp { + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + Service pdg; + Preslice perCollision = aod::track::collisionId; + + Configurable etaRange{"etaRange", 1.0f, "Eta range to consider"}; + Configurable vtxRange{"vtxRange", 10.0f, "Vertex Z range to consider"}; + Configurable dcaZ{"dcaZ", 0.2f, "Custom DCA Z cut (ignored if negative)"}; + Configurable v0radiusK0SCut{"v0radiusK0SCut", 1.2f, "K0S RadiusCut"}; + Configurable dcapostopvK0SCut{"dcapostopvK0SCut", 0.05f, "K0S dcapostopvCut"}; + Configurable dcanegtopvK0SCut{"dcanegtopvK0SCut", 0.05f, "K0S dcanegtopvCut"}; + Configurable v0cospaK0SCut{"v0cospaK0SCut", 0.995f, "K0S v0cospaCut"}; + Configurable dcav0daughterK0Scut{"dcav0daughterK0Scut", 1.0f, "K0S dcav0daughtercut"}; + Configurable minTPCnClsK0SCut{"minTPCnClsK0SCut", 50.0f, "K0S minTPCnClsCut"}; + Configurable nSigmaTpcK0SCut{"nSigmaTpcK0SCut", 5.0f, "K0S nSigmaTpcCut"}; + Configurable v0etaK0SCut{"v0etaK0SCut", 0.9f, "K0S v0etaCut"}; + Configurable v0radiusLambdaCut{"v0radiusLambdaCut", 1.2f, "Lambda RadiusCut"}; + Configurable dcapostopvLambdaCut{"dcapostopvLambdaCut", 0.05f, "Lambda dcapostopvCut"}; + Configurable dcanegtopvLambdaCut{"dcanegtopvLambdaCut", 0.05f, "Lambda dcanegtopvCut"}; + Configurable v0cospaLambdaCut{"v0cospaLambdaCut", 0.995f, "Lambda v0cospaCut"}; + Configurable dcav0daughterLambdacut{"dcav0daughterLambdacut", 1.0f, "Lambda dcav0daughtercut"}; + Configurable minTPCnClsLambdaCut{"minTPCnClsLambdaCut", 50.0f, "Lambda minTPCnClsCut"}; + Configurable nSigmaTpcLambdaCut{"nSigmaTpcLambdaCut", 5.0f, "Lambda nSigmaTpcCut"}; + Configurable v0etaLambdaCut{"v0etaLambdaCut", 0.9f, "Lambda v0etaCut"}; + Configurable extraphicut1{"extraphicut1", 3.07666f, "Extra Phi cut 1"}; + Configurable extraphicut2{"extraphicut2", 3.12661f, "Extra Phi cut 2"}; + Configurable extraphicut3{"extraphicut3", 0.03f, "Extra Phi cut 3"}; + Configurable extraphicut4{"extraphicut4", 6.253f, "Extra Phi cut 4"}; + ConfigurableAxis multHistBin{"multHistBin", {501, -0.5, 500.5}, ""}; + ConfigurableAxis pvHistBin{"pvHistBin", {501, -0.5, 500.5}, ""}; + ConfigurableAxis fv0aMultHistBin{"fv0aMultHistBin", {501, -0.5, 500.5}, ""}; + ConfigurableAxis ft0aMultHistBin{"ft0aMultHistBin", {501, -0.5, 500.5}, ""}; + ConfigurableAxis ft0cMultHistBin{"ft0cMultHistBin", {501, -0.5, 500.5}, ""}; + ConfigurableAxis ptHistBin{"ptHistBin", {200, 0., 20.}, ""}; + ConfigurableAxis centralityBinning{"centralityBinning", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, ""}; + ConfigurableAxis binsMult{"binsMult", {500, 0.0f, +500.0f}, ""}; + ConfigurableAxis binsDCA{"binsDCA", {500, -10.0f, 10.0f}, ""}; + + Configurable isApplyTFcut{"isApplyTFcut", true, "Enable TimeFrameBorder cut"}; + Configurable isApplyITSROcut{"isApplyITSROcut", true, "Enable ITS ReadOutFrameBorder cut"}; + Configurable isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"}; + Configurable isApplyGoodZvtxFT0vsPV{"isApplyGoodZvtxFT0vsPV", true, "Enable GoodZvtxFT0vsPV cut"}; + Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; + Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; + + void init(InitContext const&) + { + AxisSpec axisMult = {multHistBin, "Mult", "MultAxis"}; + AxisSpec axisPV = {pvHistBin, "PV", "PVAxis"}; + AxisSpec axisFv0aMult = {fv0aMultHistBin, "fv0a", "FV0AMultAxis"}; + AxisSpec axisFt0aMult = {ft0aMultHistBin, "ft0a", "FT0AMultAxis"}; + AxisSpec axisFt0cMult = {ft0cMultHistBin, "ft0c", "FT0CMultAxis"}; + AxisSpec centAxis = {centralityBinning, "Centrality", "CentralityAxis"}; + AxisSpec axisPt = {ptHistBin, "pT", "pTAxis"}; + AxisSpec dcaAxis = {binsDCA, "DCA vs PV"}; + AxisSpec multAxis = {binsMult, "Multiplicity #eta<0.5"}; + + histos.add("EventHist", "EventHist", kTH1D, {axisEvent}, false); + histos.add("VtxZHist", "VtxZHist", kTH1D, {axisVtxZ}, false); + + auto hstat = histos.get(HIST("EventHist")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(1, "All events"); + x->SetBinLabel(2, "kIsTriggerTVX"); + x->SetBinLabel(3, "kNoTimeFrameBorder"); + x->SetBinLabel(4, "kNoITSROFrameBorder"); + x->SetBinLabel(5, "kNoSameBunchPileup"); // reject collisions in case of pileup with another collision in the same foundBC + x->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); // small difference between z-vertex from PV and from FT0 + x->SetBinLabel(7, "INEL > 0"); + + if (doprocessData) { + histos.add("hdcaxy", "dca to pv in the xy plane", kTH1D, {dcaAxis}, false); + histos.add("hdcaz", "dca to pv in the z axis", kTH1D, {dcaAxis}, false); + histos.add("CentPercentileHist", "CentPercentileHist", kTH1D, {axisCent}, false); + histos.add("hdatazvtxcent", "hdatazvtxcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2D, {axisPhi2, axisEta}, false); + histos.add("hdatadndeta", "hdatadndeta", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisTrackType}, false); + histos.add("hdatadndetaMB", "hdatadndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi}, false); + } + + if (doprocessCorrelation) { + histos.add("GlobalMult_vs_FT0A", "GlobalMult_vs_FT0A", kTH2F, {axisMult, axisFt0aMult}, true); + histos.add("GlobalMult_vs_FT0C", "GlobalMult_vs_FT0C", kTH2F, {axisMult, axisFt0cMult}, true); + histos.add("GlobalMult_vs_FV0A", "GlobalMult_vs_FV0A", kTH2F, {axisMult, axisFv0aMult}, true); + histos.add("GlobalMult_vs_NPVtracks", "GlobalMult_vs_NPVtracks", kTH2F, {axisMult, axisPV}, true); + histos.add("NPVtracks_vs_FT0C", "NPVtracks_vs_FT0C", kTH2F, {axisPV, axisFt0cMult}, true); + } + + if (doprocessStrangeYield) { + histos.add("hzvtxcent", "hzvtxcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("K0sCentEtaMass", "K0sCentEtaMass", kTH3D, {centAxis, axisEta, axisMassK0s}, false); + histos.add("LambdaCentEtaMass", "LambdaCentEtaMass", kTH3D, {centAxis, axisEta, axisMassLambda}, false); + histos.add("AntiLambdaCentEtaMass", "AntiLambdaCentEtaMass", kTH3D, {centAxis, axisEta, axisMassLambda}, false); + } + + if (doprocessMCeff) { + histos.add("hmcdcaxy", "dca to pv in the xy plane", kTH1D, {dcaAxis}, false); + histos.add("hmcdcaz", "dca to pv in the z axis", kTH1D, {dcaAxis}, false); + histos.add("hGenMCvertexZ", "hGenMCvertexZ", kTH1D, {axisVtxZ}, false); + histos.add("hGenMCvtxzcent", "hGenMCvtxzcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("hGenMCAssoRecvertexZ", "hGenMCAssoRecvertexZ", kTH1D, {axisVtxZ}, false); + histos.add("hGenMCAssoRecvtxzcent", "hGenMCAssoRecvtxzcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("hGenMCdndeta", "hGenMCdndeta", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi}, false); + histos.add("hGenMCAssoRecdndeta", "hGenMCAssoRecdndeta", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisGenTrkType, axisGenPtVary}, false); + + histos.add("hRecMCvertexZ", "hRecMCvertexZ", kTH1D, {axisVtxZ}, false); + histos.add("hRecMCvtxzcent", "hRecMCvtxzcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("hRecMCcentrality", "hRecMCcentrality", kTH1D, {axisCent}, false); + histos.add("hRecMCphivseta", "hRecMCphivseta", kTH2D, {axisPhi2, axisEta}, false); + histos.add("hRecMCdndeta", "hRecMCdndeta", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisRecTrkType}, false); + histos.add("hRecMCdndetaMB", "hRecMCdndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi, axisRecTrkType}, false); + histos.add("hGenMCAssoRecdndetaMB", "hGenMCAssoRecdndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi, axisGenTrkType}, false); + } + + if (doprocessEvtLossSigLossMC) { + histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); + auto hstat = histos.get(HIST("MCEventHist")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(1, "All MC events"); + x->SetBinLabel(2, "MC events with reco event after event selection"); + histos.add("hMultEta05Gen", "multiplicity in eta<0.5 of generated MC events", kTH1F, {multAxis}); + histos.add("hMultEta05GenAssoRec", "multiplicity in eta<0.5 of selected MC events", kTH1F, {multAxis}); + histos.add("hgendndetaVsMultEta05BeforeEvtSel", "hgendndetaBeforeEvtSel vs multiplicity in eta<0.5", kTH2F, {axisEta, multAxis}); + histos.add("hgendndetaVsMultEta05AfterEvtSel", "hgendndetaAfterEvtSel vs multiplicity in eta<0.5", kTH2F, {axisEta, multAxis}); + histos.add("hGenCent", "Centrality of generated MC events", kTH1F, {axisCent}); + histos.add("hGenAssoRecCent", "Centrality of selected MC events", kTH1F, {axisCent}); + histos.add("hgendndetaBeforeEvtSel", "Eta of all generated particles", kTH1F, {axisEta}); + histos.add("hgendndetaAfterEvtSel", "Eta of generated particles after EvtSel", kTH1F, {axisEta}); + histos.add("hgendndetaVscentBeforeEvtSel", "hgendndetaBeforeEvtSel vs centrality", kTH2F, {axisEta, centAxis}); + histos.add("hgendndetaVscentAfterEvtSel", "hgendndetaAfterEvtSel vs centrality", kTH2F, {axisEta, centAxis}); + } + } + + template + bool isEventSelected(CheckCol const& col) + { + histos.fill(HIST("EventHist"), 1); + if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + return false; + } + histos.fill(HIST("EventHist"), 2); + if (isApplyTFcut && !col.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + return false; + } + histos.fill(HIST("EventHist"), 3); + if (isApplyITSROcut && !col.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + return false; + } + histos.fill(HIST("EventHist"), 4); + if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return false; + } + histos.fill(HIST("EventHist"), 5); + if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + histos.fill(HIST("EventHist"), 6); + if (isApplyInelgt0 && !col.isInelGt0()) { + return false; + } + histos.fill(HIST("EventHist"), 7); + return true; + } + + template + bool isTrackSelected(CheckTrack const& track) + { + if (std::abs(track.eta()) >= etaRange) { + return false; + } + if (isApplyExtraPhiCut && ((track.phi() > extraphicut1 && track.phi() < extraphicut2) || track.phi() <= extraphicut3 || track.phi() >= extraphicut4)) { + return false; + } + return true; + } + + template + bool isGenTrackSelected(CheckGenTrack const& track) + { + if (!track.isPhysicalPrimary()) { + return false; + } + if (!track.producedByGenerator()) { + return false; + } + auto pdgTrack = pdg->GetParticle(track.pdgCode()); + if (pdgTrack == nullptr) { + return false; + } + if (std::abs(pdgTrack->Charge()) < KminCharge) { + return false; + } + if (std::abs(track.eta()) >= etaRange) { + return false; + } + if (isApplyExtraPhiCut && ((track.phi() > extraphicut1 && track.phi() < extraphicut2) || track.phi() <= extraphicut3 || track.phi() >= extraphicut4)) { + return false; + } + return true; + } + + Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) && + ncheckbit(aod::track::trackCutFlag, TrackSelectionIts); + Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC), + ncheckbit(aod::track::trackCutFlag, TrackSelectionTpc), true); + Filter fTrackSelectionDCA = ifnode(dcaZ.node() > 0.f, nabs(aod::track::dcaZ) <= dcaZ && ncheckbit(aod::track::trackCutFlag, TrackSelectionDcaxyOnly), + ncheckbit(aod::track::trackCutFlag, TrackSelectionDca)); + + void processData(CollisionDataTable::iterator const& collision, FilTrackDataTable const& tracks) + { + if (!isEventSelected(collision)) { + return; + } + histos.fill(HIST("VtxZHist"), collision.posZ()); + histos.fill(HIST("CentPercentileHist"), collision.centFT0M()); + histos.fill(HIST("hdatazvtxcent"), collision.posZ(), collision.centFT0M()); + + for (const auto& track : tracks) { + if (!isTrackSelected(track)) { + continue; + } + histos.fill(HIST("hdcaxy"), track.dcaXY()); + histos.fill(HIST("hdcaz"), track.dcaZ()); + histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); + histos.fill(HIST("hdatadndeta"), collision.posZ(), collision.centFT0M(), track.eta(), track.phi(), kGlobalplusITS); + histos.fill(HIST("hdatadndetaMB"), collision.posZ(), track.eta(), track.phi()); + if (track.hasTPC()) { + histos.fill(HIST("hdatadndeta"), collision.posZ(), collision.centFT0M(), track.eta(), track.phi(), kGlobalonly); + } else { + histos.fill(HIST("hdatadndeta"), collision.posZ(), collision.centFT0M(), track.eta(), track.phi(), kITSonly); + } + } + } + + void processCorrelation(CollisionDataTable::iterator const& collision, FilTrackDataTable const& tracks) + { + if (!isEventSelected(collision)) { + return; + } + if (std::abs(collision.posZ()) >= vtxRange) { + return; + } + histos.fill(HIST("VtxZHist"), collision.posZ()); + + auto nchTracks = 0; + for (const auto& track : tracks) { + if (std::abs(track.eta()) >= etaRange) { + continue; + } + nchTracks++; + } + + histos.fill(HIST("GlobalMult_vs_FT0A"), nchTracks, collision.multFT0A()); + histos.fill(HIST("GlobalMult_vs_FT0C"), nchTracks, collision.multFT0C()); + histos.fill(HIST("GlobalMult_vs_FV0A"), nchTracks, collision.multFV0A()); + histos.fill(HIST("GlobalMult_vs_NPVtracks"), nchTracks, collision.multNTracksPV()); + histos.fill(HIST("NPVtracks_vs_FT0C"), collision.multNTracksPV(), collision.multFT0C()); + } + + void processStrangeYield(CollisionDataTable::iterator const& collision, V0TrackCandidates const&, aod::V0Datas const& v0data) + { + if (!isEventSelected(collision)) { + return; + } + if (std::abs(collision.posZ()) >= vtxRange) { + return; + } + histos.fill(HIST("hzvtxcent"), collision.posZ(), collision.centFT0M()); + for (const auto& v0track : v0data) { + auto v0pTrack = v0track.template posTrack_as(); + auto v0nTrack = v0track.template negTrack_as(); + if (std::abs(v0pTrack.eta()) <= v0etaK0SCut && std::abs(v0nTrack.eta()) <= v0etaK0SCut && v0pTrack.tpcNClsFound() >= minTPCnClsK0SCut && v0nTrack.tpcNClsFound() >= minTPCnClsK0SCut && std::abs(v0track.dcapostopv()) >= dcapostopvK0SCut && std::abs(v0track.dcanegtopv()) >= dcanegtopvK0SCut && v0track.v0radius() >= v0radiusK0SCut && v0track.v0cosPA() >= v0cospaK0SCut && std::abs(v0track.dcaV0daughters()) <= dcav0daughterK0Scut && std::abs(v0pTrack.tpcNSigmaPi()) <= nSigmaTpcK0SCut && std::abs(v0nTrack.tpcNSigmaPi()) <= nSigmaTpcK0SCut) { + + histos.fill(HIST("K0sCentEtaMass"), collision.centFT0M(), v0track.eta(), v0track.mK0Short()); + } + if (std::abs(v0pTrack.eta()) <= v0etaLambdaCut && std::abs(v0nTrack.eta()) <= v0etaLambdaCut && v0pTrack.tpcNClsFound() >= minTPCnClsLambdaCut && v0nTrack.tpcNClsFound() >= minTPCnClsLambdaCut && std::abs(v0track.dcapostopv()) >= dcapostopvLambdaCut && std::abs(v0track.dcanegtopv()) >= dcanegtopvLambdaCut && v0track.v0radius() >= v0radiusLambdaCut && v0track.v0cosPA() >= v0cospaLambdaCut && std::abs(v0track.dcaV0daughters()) <= dcav0daughterLambdacut) { + + if (std::abs(v0pTrack.tpcNSigmaPr()) <= nSigmaTpcLambdaCut && std::abs(v0nTrack.tpcNSigmaPi()) <= nSigmaTpcLambdaCut) { + histos.fill(HIST("LambdaCentEtaMass"), collision.centFT0M(), v0track.eta(), v0track.mLambda()); + } + if (std::abs(v0pTrack.tpcNSigmaPi()) <= nSigmaTpcLambdaCut && std::abs(v0nTrack.tpcNSigmaPr()) <= nSigmaTpcLambdaCut) { + histos.fill(HIST("AntiLambdaCentEtaMass"), collision.centFT0M(), v0track.eta(), v0track.mAntiLambda()); + } + } + } + } + + void processMCeff(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + { + auto gencent = -999; + bool atLeastOne = false; + + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + atLeastOne = true; + gencent = RecCol.centFT0M(); + } + + histos.fill(HIST("hGenMCvertexZ"), mcCollision.posZ()); + histos.fill(HIST("hGenMCvtxzcent"), mcCollision.posZ(), gencent); + + if (atLeastOne) { + histos.fill(HIST("hGenMCAssoRecvertexZ"), mcCollision.posZ()); + histos.fill(HIST("hGenMCAssoRecvtxzcent"), mcCollision.posZ(), gencent); + } + + for (const auto& particle : GenParticles) { + if (!isGenTrackSelected(particle)) { + continue; + } + histos.fill(HIST("hGenMCdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi()); + if (atLeastOne) { + histos.fill(HIST("hGenMCAssoRecdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi(), static_cast(kGenAll), kNoGenpTVar); + histos.fill(HIST("hGenMCAssoRecdndetaMB"), mcCollision.posZ(), particle.eta(), particle.phi(), static_cast(kGenAll)); + if (particle.pt() < KminPtCut) { + histos.fill(HIST("hGenMCAssoRecdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi(), static_cast(kGenAll), kGenpTup, -10.0 * particle.pt() + 2); + histos.fill(HIST("hGenMCAssoRecdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi(), static_cast(kGenAll), kGenpTdown, 5.0 * particle.pt() + 0.5); + } else { + histos.fill(HIST("hGenMCAssoRecdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi(), static_cast(kGenAll), kGenpTup); + histos.fill(HIST("hGenMCAssoRecdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi(), static_cast(kGenAll), kGenpTdown); + } + int pid = 0; + switch (std::abs(particle.pdgCode())) { + case PDG_t::kPiPlus: + pid = kGenPion; + break; + case PDG_t::kKPlus: + pid = kGenKaon; + break; + case PDG_t::kProton: + pid = kGenProton; + break; + default: + pid = kGenOther; + break; + } + histos.fill(HIST("hGenMCAssoRecdndeta"), mcCollision.posZ(), gencent, particle.eta(), particle.phi(), static_cast(pid), kNoGenpTVar); + histos.fill(HIST("hGenMCAssoRecdndetaMB"), mcCollision.posZ(), particle.eta(), particle.phi(), static_cast(pid)); + } // Associated with reco col + } // track (mcgen) loop + + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + histos.fill(HIST("hRecMCvertexZ"), RecCol.posZ()); + histos.fill(HIST("hRecMCcentrality"), RecCol.centFT0M()); + histos.fill(HIST("hRecMCvtxzcent"), RecCol.posZ(), RecCol.centFT0M()); + + auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); + std::vector mclabels; + for (const auto& Rectrack : recTracksPart) { + if (!isTrackSelected(Rectrack)) { + continue; + } + if (!Rectrack.has_mcParticle()) { + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); + histos.fill(HIST("hRecMCdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); + continue; + } + auto mcpart = Rectrack.mcParticle(); + if (RecCol.mcCollisionId() != mcpart.mcCollisionId()) { + continue; + } + histos.fill(HIST("hmcdcaxy"), Rectrack.dcaXY()); + histos.fill(HIST("hmcdcaz"), Rectrack.dcaZ()); + histos.fill(HIST("hRecMCphivseta"), Rectrack.phi(), Rectrack.eta()); + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoAll)); + histos.fill(HIST("hRecMCdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoAll)); + + int pid = 0; + if (mcpart.isPhysicalPrimary()) { + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kRecoPion; + break; + case PDG_t::kKPlus: + pid = kRecoKaon; + break; + case PDG_t::kProton: + pid = kRecoProton; + break; + default: + pid = kRecoOther; + break; + } + } else { + pid = kRecoSecondary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kRecoWeakDecay; + } + } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kRecoFake; + } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), RecCol.centFT0M(), mcpart.eta(), mcpart.phi(), static_cast(pid)); + histos.fill(HIST("hRecMCdndetaMB"), RecCol.posZ(), mcpart.eta(), mcpart.phi(), static_cast(pid)); + } // track (mcrec) loop + } // collision loop + } + + void processEvtLossSigLossMC(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles) + { + + if (isApplyInelgt0 && !mcCollision.isInelGt0()) { + return; + } + if (std::abs(mcCollision.posZ()) >= vtxRange) { + return; + } + // All generated events + histos.fill(HIST("MCEventHist"), 1); + histos.fill(HIST("hGenCent"), mcCollision.centFT0M()); + histos.fill(HIST("hMultEta05Gen"), mcCollision.multMCNParticlesEta05()); + bool atLeastOne = false; + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + atLeastOne = true; + } + // Generated events with at least one reconstructed collision (event loss estimation) + if (atLeastOne) { + histos.fill(HIST("MCEventHist"), 2); + histos.fill(HIST("hGenAssocRecCent"), mcCollision.centFT0M()); + histos.fill(HIST("hMultEta05GenAssoRec"), mcCollision.multMCNParticlesEta05()); + } + for (const auto& particle : GenParticles) { + if (!isGenTrackSelected(particle)) { + continue; + } + // All generated particles + histos.fill(HIST("hgendndetaBeforeEvtSel"), particle.eta()); + histos.fill(HIST("hgendndetaVscentBeforeEvtSel"), particle.eta(), mcCollision.centFT0M()); + histos.fill(HIST("hgendndetaVsMultEta05BeforeEvtSel"), particle.eta(), mcCollision.multMCNParticlesEta05()); + if (atLeastOne) { + // All generated particles with at least one reconstructed collision (signal loss estimation) + histos.fill(HIST("hgendndetaAfterEvtSel"), particle.eta()); + histos.fill(HIST("hgendndetaVscentAfterEvtSel"), particle.eta(), mcCollision.centFT0M()); + histos.fill(HIST("hgendndetaVsMultEta05AfterEvtSel"), particle.eta(), mcCollision.multMCNParticlesEta05()); + } + } + } + PROCESS_SWITCH(NchStudypp, processData, "process data CentFT0C", false); + PROCESS_SWITCH(NchStudypp, processCorrelation, "do correlation study in data/MC", false); + PROCESS_SWITCH(NchStudypp, processStrangeYield, "Strange particle yield", false); + PROCESS_SWITCH(NchStudypp, processMCeff, "process MC efficiency function", false); + PROCESS_SWITCH(NchStudypp, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From f620c3e895d67a618efcc0f4509f6ba95f1e93ac Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Wed, 8 Apr 2026 08:57:36 +0200 Subject: [PATCH 199/282] [PWGDQ] Adding missing flag for event selection (#15677) Co-authored-by: Lucamicheletti93 --- PWGDQ/Core/VarManager.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 594317a5cd4..6733583a21d 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -2085,6 +2085,9 @@ void VarManager::FillEvent(T const& event, float* values) if (fgUsedVars[kIsNoSameBunch]) { values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0); } + if (fgUsedVars[kIsTriggerZNAZNC]) { + values[kIsTriggerZNAZNC] = event.selection_bit(o2::aod::evsel::kIsBBZNA) && event.selection_bit(o2::aod::evsel::kIsBBZNC); + } if (fgUsedVars[kIsGoodZvtxFT0vsPV]) { values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0); } From 2f9bba40f022f07ce3723e263e8333257c33725a Mon Sep 17 00:00:00 2001 From: mj525 <99000728+mjkim525@users.noreply.github.com> Date: Wed, 8 Apr 2026 18:11:04 +0900 Subject: [PATCH 200/282] [PWGLF] Update on Xi1530 and Reso-init (#15668) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFResonanceTables.h | 8 ++ .../Resonances/resonanceInitializer.cxx | 20 ++-- .../Resonances/resonanceModuleInitializer.cxx | 5 + PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx | 98 ++++++++++++------- 4 files changed, 89 insertions(+), 42 deletions(-) diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index 675b7265d4b..bb1c1586485 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -231,6 +231,9 @@ DECLARE_SOA_COLUMN(DaughterTOFNSigmaNegPr10, daughterTOFNSigmaNegPr10, int8_t); DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachPi10, daughterTOFNSigmaBachPi10, int8_t); //! TOF PID x10 of the bachelor daughter as Pion DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachKa10, daughterTOFNSigmaBachKa10, int8_t); //! TOF PID x10 of the bachelor daughter as Kaon DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachPr10, daughterTOFNSigmaBachPr10, int8_t); //! TOF PID x10 of the bachelor daughter as Proton +DECLARE_SOA_COLUMN(NCrossedRowsPos, nCrossedRowsPos, uint8_t); //! Number of TPC crossed rows of the positive daughter +DECLARE_SOA_COLUMN(NCrossedRowsNeg, nCrossedRowsNeg, uint8_t); //! Number of TPC crossed rows of the negative daughter +DECLARE_SOA_COLUMN(NCrossedRowsBach, nCrossedRowsBach, uint8_t); //! Number of TPC crossed rows of the bachelor daughter // For MC DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! Index of the corresponding MC particle DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); @@ -643,6 +646,8 @@ DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0", v0data::DCAPosToPV, v0data::DCANegToPV, v0data::DCAV0ToPV, + resodaughter::NCrossedRowsPos, + resodaughter::NCrossedRowsNeg, resodaughter::MLambda, resodaughter::MAntiLambda, resodaughter::MK0Short, @@ -710,6 +715,9 @@ DECLARE_SOA_TABLE(ResoCascades, "AOD", "RESOCASCADE", cascdata::DCAXYCascToPV, cascdata::DCAZCascToPV, cascdata::Sign, + resodaughter::NCrossedRowsPos, + resodaughter::NCrossedRowsNeg, + resodaughter::NCrossedRowsBach, resodaughter::MLambda, resodaughter::MXi, resodaughter::TransRadius, diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 03c28a9b701..760360a497c 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -796,6 +796,8 @@ struct ResonanceInitializer { v0.dcapostopv(), v0.dcanegtopv(), v0.dcav0topv(), + static_cast(v0.template posTrack_as().tpcNClsCrossedRows()), + static_cast(v0.template negTrack_as().tpcNClsCrossedRows()), v0.mLambda(), v0.mAntiLambda(), v0.mK0Short(), @@ -858,6 +860,9 @@ struct ResonanceInitializer { casc.dcaXYCascToPV(), casc.dcaZCascToPV(), casc.sign(), + static_cast(casc.template posTrack_as().tpcNClsCrossedRows()), + static_cast(casc.template negTrack_as().tpcNClsCrossedRows()), + static_cast(casc.template bachelor_as().tpcNClsCrossedRows()), casc.mLambda(), casc.mXi(), casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z()); @@ -1736,6 +1741,9 @@ struct ResonanceInitializer { resoSpheroCollisions(computeSpherocity(tracks, trackSphMin, trackSphDef)); resoEvtPlCollisions(0, 0, 0, 0); fillMCCollision(collision, mcParticles); + // Loop over all MC particles + auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); + fillMCParticles(mcParts, mcParticles); // Loop over tracks if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) { @@ -1746,10 +1754,6 @@ struct ResonanceInitializer { fillMicroTracks(collision, tracks); } fillV0s(collision, V0s, tracks); - - // Loop over all MC particles - auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); - fillMCParticles(mcParts, mcParticles); } PROCESS_SWITCH(ResonanceInitializer, processTrackV0MC, "Process for MC", false); @@ -1825,6 +1829,9 @@ struct ResonanceInitializer { mult = mcCollision.multMCNParticlesEta10(); fillMCCollision(collision, mcParticles, impactpar, mult); + // Loop over all MC particles + auto mcParts = selectedMCParticles->sliceBy(perMcCollision, mcId); + fillMCParticles(mcParts, mcParticles); // Loop over tracks if (FilterForDerivedTables.cfgBypassNoPairV0s && (V0s.size() < 1)) { @@ -1839,16 +1846,11 @@ struct ResonanceInitializer { } fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); - - // Loop over all MC particles - auto mcParts = selectedMCParticles->sliceBy(perMcCollision, mcId); - fillMCParticles(mcParts, mcParticles); } PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascMC, "Process for MC", false); // Following the discussions at the PAG meeting (https://indico.cern.ch/event/1583408/) // we have introduced an auxiliary task that, when the resonanceInitializer.cxx is used, - // Only consider N_rec / N_gen i.e. not consider level of N_gen at least once void processMCgen(soa::Join::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups>& collisions, diff --git a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx index 358703eaf13..0049c9ce6ad 100644 --- a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx @@ -1034,6 +1034,8 @@ struct ResonanceDaughterInitializer { v0.dcapostopv(), v0.dcanegtopv(), v0.dcav0topv(), + 0, + 0, v0.mLambda(), v0.mAntiLambda(), v0.mK0Short(), @@ -1206,6 +1208,9 @@ struct ResonanceDaughterInitializer { casc.dcaXYCascToPV(), casc.dcaZCascToPV(), casc.sign(), + 0, + 0, + 0, casc.mLambda(), casc.mXi(), casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z()); diff --git a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx index 64dd2ed25f9..d2802812064 100644 --- a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx +++ b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx @@ -181,6 +181,9 @@ struct Xi1530Analysisqa { Configurable cMassXiminus{"cMassXiminus", 1.32171, "Mass of Xi baryon"}; Configurable cMaxProperLifetimeCut{"cMaxProperLifetimeCut", 4.7, "Maximum proper lifetime cut for Xi- candidates"}; + Configurable cMinNCrossedRowsTPCPos{"cMinNCrossedRowsTPCPos", 50, "Minimum number of crossed rows in TPC for positive track in cascade"}; + Configurable cMinNCrossedRowsTPCNeg{"cMinNCrossedRowsTPCNeg", 50, "Minimum number of crossed rows in TPC for negative track in cascade"}; + Configurable cMinNCrossedRowsTPCBach{"cMinNCrossedRowsTPCBach", 50, "Minimum number of crossed rows in TPC for bachelor track in cascade"}; } cascadeConfig; @@ -335,16 +338,16 @@ struct Xi1530Analysisqa { if (histoConfig.additionalQAplots) { // DCA QA to candidates for first pion and Xi- histos.add("QAbefore/trkDCAxy_pi", "DCAxy distribution of pion track candidates", HistType::kTH2F, {ptAxis, dcaxyAxis}); - histos.add("QAbefore/trkDCAxy_Xi", "DCAxy distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcaxyAxis}); + histos.add("QAbefore/trkDCAxy_xi", "DCAxy distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcaxyAxis}); histos.add("QAbefore/trkDCAz_pi", "DCAz distribution of pion track candidates", HistType::kTH2F, {ptAxis, dcazAxis}); - histos.add("QAbefore/trkDCAz_Xi", "DCAz distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcazAxis}); + histos.add("QAbefore/trkDCAz_xi", "DCAz distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcazAxis}); histos.add("QAafter/trkDCAxy_pi", "DCAxy distribution of pion track candidates", HistType::kTH2F, {ptAxis, dcaxyAxis}); - histos.add("QAafter/trkDCAxy_Xi", "DCAxy distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcaxyAxis}); + histos.add("QAafter/trkDCAxy_xi", "DCAxy distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcaxyAxis}); histos.add("QAafter/trkDCAz_pi", "DCAz distribution of pion track candidates", HistType::kTH2F, {ptAxis, dcazAxis}); - histos.add("QAafter/trkDCAz_Xi", "DCAz distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcazAxis}); + histos.add("QAafter/trkDCAz_xi", "DCAz distribution of Xi- track candidates", HistType::kTH2F, {ptAxis, dcazAxis}); } if (histoConfig.pidPlots) { @@ -402,7 +405,7 @@ struct Xi1530Analysisqa { histos.add("h3Xi1530invmassLSAnti", "Invariant mass of Anti-Xi(1530)0 same sign", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); histos.add("h3Xi1530invmassRotDSAnti", "Invariant mass of Anti-Xi(1530)0 rotated DS", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); - if (doprocessMEDF || doprocessMEMicro) { + if (doprocessMEMicro) { histos.add("h3Xi1530invmassME_DS", "Invariant mass of Xi(1530)0 mixed event DS", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); histos.add("h3Xi1530invmassME_DSAnti", "Invariant mass of Xi(1530)0 mixed event DSAnti", kTHnSparseF, {centAxis, ptAxis, invMassAxis, flagAxis}); } @@ -464,6 +467,9 @@ struct Xi1530Analysisqa { histos.add("QAbefore/V0Radius", "V0 Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); histos.add("QAbefore/CascRadius", "Casc Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); histos.add("QAbefore/ProperLifetime", "Proper Lifetime distribution as pt", HistType::kTH2F, {ptAxis, properLifetimeAxis}); + histos.add("QAbefore/NCrossedRowsPos", "Number of crossed rows in TPC for positive daughter in V0s", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); + histos.add("QAbefore/NCrossedRowsNeg", "Number of crossed rows in TPC for negative daughter in V0s", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); + histos.add("QAbefore/NCrossedRowsBach", "Number of crossed rows in TPC for bachelor in Cascades", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); histos.add("QAafter/V0DCATopPV", "V0s DCA to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaxyAxis}); histos.add("QAafter/V0DCADoughter", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); @@ -478,6 +484,9 @@ struct Xi1530Analysisqa { histos.add("QAafter/V0Radius", "V0 Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); histos.add("QAafter/CascRadius", "Casc Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); histos.add("QAafter/ProperLifetime", "Proper Lifetime distribution as pt", HistType::kTH2F, {ptAxis, properLifetimeAxis}); + histos.add("QAafter/NCrossedRowsPos", "Number of crossed rows in TPC for positive daughter in V0s", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); + histos.add("QAafter/NCrossedRowsNeg", "Number of crossed rows in TPC for negative daughter in V0s", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); + histos.add("QAafter/NCrossedRowsBach", "Number of crossed rows in TPC for bachelor in Cascades", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); histos.add("QAMCTrue/V0DCATopPV", "V0s DCA to PV distribution as pt", HistType::kTH2F, {ptAxis, dcaxyAxis}); histos.add("QAMCTrue/V0DCADoughter", "V0s DCA Doughter distribution as pt", HistType::kTH2F, {ptAxis, dcaDaugAxis}); @@ -492,6 +501,9 @@ struct Xi1530Analysisqa { histos.add("QAMCTrue/V0Radius", "V0 Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); histos.add("QAMCTrue/CascRadius", "Casc Radius distribution as pt", HistType::kTH2F, {ptAxis, transRadiusAxis}); histos.add("QAMCTrue/ProperLifetime", "Proper Lifetime distribution as pt", HistType::kTH2F, {ptAxis, properLifetimeAxis}); + histos.add("QAMCTrue/NCrossedRowsPos", "Number of crossed rows in TPC for positive daughter in V0s", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); + histos.add("QAMCTrue/NCrossedRowsNeg", "Number of crossed rows in TPC for negative daughter in V0s", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); + histos.add("QAMCTrue/NCrossedRowsBach", "Number of crossed rows in TPC for bachelor in Cascades", HistType::kTH2F, {ptAxis, {200, 0, 200, "N crossed rows"}}); } } @@ -552,6 +564,12 @@ struct Xi1530Analysisqa { return false; if (std::abs(track.pt()) <= primarytrackConfig.cMinPtcut) return false; + if (track.nCrossedRowsPos() <= cascadeConfig.cMinNCrossedRowsTPCPos) + return false; + if (track.nCrossedRowsNeg() <= cascadeConfig.cMinNCrossedRowsTPCNeg) + return false; + if (track.nCrossedRowsBach() <= cascadeConfig.cMinNCrossedRowsTPCBach) + return false; if (primarytrackConfig.cDCAxyToPVAsPtForCasc) { if (std::abs(track.dcaXYCascToPV()) >= (primarytrackConfig.cDCAxyToPVByPtCascP0 + primarytrackConfig.cDCAxyToPVByPtCascExp * track.pt())) return false; @@ -855,6 +873,9 @@ struct Xi1530Analysisqa { auto trk2CascCosPA = trk2.cascCosPA(); auto trk2V0Radius = trk2.transRadius(); auto trk2CascRadius = trk2.cascTransRadius(); + auto trks2NCrossedRowsPos = trk2.nCrossedRowsPos(); + auto trks2NCrossedRowsNeg = trk2.nCrossedRowsNeg(); + auto trks2NCrossedRowsBach = trk2.nCrossedRowsBach(); // QA before selections float trk2NSigmaPiBachelorTPC = trk2.daughterTPCNSigmaBachPi(); @@ -906,8 +927,8 @@ struct Xi1530Analysisqa { if (histoConfig.additionalQAplots) { histos.fill(HIST("QAbefore/V0DCATopPV"), trk2ptXi, trk2DCAV0TopPV); - histos.fill(HIST("QAbefore/trkDCAxy_Xi"), trk2ptXi, trk2DCAXY); - histos.fill(HIST("QAbefore/trkDCAz_Xi"), trk2ptXi, trk2DCAZ); + histos.fill(HIST("QAbefore/trkDCAxy_xi"), trk2ptXi, trk2DCAXY); + histos.fill(HIST("QAbefore/trkDCAz_xi"), trk2ptXi, trk2DCAZ); histos.fill(HIST("QAbefore/V0DCADoughter"), trk2ptXi, trk2DCAV0sDougthers); histos.fill(HIST("QAbefore/CascDCADoughter"), trk2ptXi, trk2DCACascDougthers); histos.fill(HIST("QAbefore/CascDCABachPV"), trk2ptXi, trk2DCABachPV); @@ -920,6 +941,9 @@ struct Xi1530Analysisqa { histos.fill(HIST("QAbefore/V0Mass"), trk2ptXi, massLambdaCand); histos.fill(HIST("QAbefore/CascMass"), trk2ptXi, massXiCand); histos.fill(HIST("QAbefore/ProperLifetime"), trk2ptXi, trk2ProperLifetime); + histos.fill(HIST("QAbefore/NCrossedRowsPos"), trk2ptXi, trks2NCrossedRowsPos); + histos.fill(HIST("QAbefore/NCrossedRowsNeg"), trk2ptXi, trks2NCrossedRowsNeg); + histos.fill(HIST("QAbefore/NCrossedRowsBach"), trk2ptXi, trks2NCrossedRowsBach); } } @@ -982,8 +1006,8 @@ struct Xi1530Analysisqa { } if (histoConfig.additionalQAplots) { histos.fill(HIST("QAafter/V0DCATopPV"), trk2ptXi, trk2DCAV0TopPV); - histos.fill(HIST("QAafter/trkDCAxy_Xi"), trk2ptXi, trk2DCAXY); - histos.fill(HIST("QAafter/trkDCAz_Xi"), trk2ptXi, trk2DCAZ); + histos.fill(HIST("QAafter/trkDCAxy_xi"), trk2ptXi, trk2DCAXY); + histos.fill(HIST("QAafter/trkDCAz_xi"), trk2ptXi, trk2DCAZ); histos.fill(HIST("QAafter/V0DCADoughter"), trk2ptXi, trk2DCAV0sDougthers); histos.fill(HIST("QAafter/CascDCADoughter"), trk2ptXi, trk2DCACascDougthers); histos.fill(HIST("QAafter/CascDCABachPV"), trk2ptXi, trk2DCABachPV); @@ -996,6 +1020,9 @@ struct Xi1530Analysisqa { histos.fill(HIST("QAafter/V0Mass"), trk2ptXi, massLambdaCand); histos.fill(HIST("QAafter/CascMass"), trk2ptXi, massXiCand); histos.fill(HIST("QAafter/ProperLifetime"), trk2ptXi, trk2ProperLifetime); + histos.fill(HIST("QAafter/NCrossedRowsPos"), trk2ptXi, trks2NCrossedRowsPos); + histos.fill(HIST("QAafter/NCrossedRowsNeg"), trk2ptXi, trks2NCrossedRowsNeg); + histos.fill(HIST("QAafter/NCrossedRowsBach"), trk2ptXi, trks2NCrossedRowsBach); } if (additionalConfig.studyStableXi) { @@ -1149,6 +1176,9 @@ struct Xi1530Analysisqa { auto trk2CascCosPA = xiCand.cascCosPA(); auto trk2V0Radius = xiCand.transRadius(); auto trk2CascRadius = xiCand.cascTransRadius(); + auto trks2NCrossedRowsPos = xiCand.nCrossedRowsPos(); + auto trks2NCrossedRowsNeg = xiCand.nCrossedRowsNeg(); + auto trks2NCrossedRowsBach = xiCand.nCrossedRowsBach(); // auto trk2ptPiBachelor = xiCand.pt(); float trk2NSigmaPiBachelorTPC = xiCand.daughterTPCNSigmaBachPi(); @@ -1170,8 +1200,8 @@ struct Xi1530Analysisqa { histos.fill(HIST("QAMCTrue/trkDCAxy_pi"), pionCandPt, trk1DCAXY); histos.fill(HIST("QAMCTrue/trkDCAz_pi"), pionCandPt, trk1DCAZ); histos.fill(HIST("QAMCTrue/V0DCATopPV"), xiCandPt, trk2DCAV0TopPV); - histos.fill(HIST("QAMCTrue/trkDCAxy_Xi"), xiCandPt, trk2DCAXY); - histos.fill(HIST("QAMCTrue/trkDCAz_Xi"), xiCandPt, trk2DCAZ); + histos.fill(HIST("QAMCTrue/trkDCAxy_xi"), xiCandPt, trk2DCAXY); + histos.fill(HIST("QAMCTrue/trkDCAz_xi"), xiCandPt, trk2DCAZ); histos.fill(HIST("QAMCTrue/V0DCADoughter"), xiCandPt, trk2DCAV0sDougthers); histos.fill(HIST("QAMCTrue/CascDCADoughter"), xiCandPt, trk2DCACascDougthers); @@ -1185,6 +1215,9 @@ struct Xi1530Analysisqa { histos.fill(HIST("QAMCTrue/V0Mass"), xiCandPt, massLambdaCand); histos.fill(HIST("QAMCTrue/CascMass"), xiCandPt, massXiCand); histos.fill(HIST("QAMCTrue/ProperLifetime"), xiCandPt, trk2ProperLifetime); + histos.fill(HIST("QAMCTrue/NCrossedRowsPos"), xiCandPt, trks2NCrossedRowsPos); + histos.fill(HIST("QAMCTrue/NCrossedRowsNeg"), xiCandPt, trks2NCrossedRowsNeg); + histos.fill(HIST("QAMCTrue/NCrossedRowsBach"), xiCandPt, trks2NCrossedRowsBach); histos.fill(HIST("QAMCTrue/TPC_Nsigma_pi_first_all"), Cent, pionCandPt, trk1NSigmaPiTPC); if (hasSubsystemInfo(trk1NSigmaPiTOF)) { @@ -1316,13 +1349,10 @@ struct Xi1530Analysisqa { if (!pass1 || !pass2) continue; - if (resoCollision.isInAfterAllCuts()) // after all event selection - { - if (part.pdgCode() > 0) - histos.fill(HIST("h3Xi1530Gen"), part.pt(), inCent, multiplicity); - else - histos.fill(HIST("h3Xi1530GenAnti"), part.pt(), inCent, multiplicity); - } + if (part.pdgCode() > 0) + histos.fill(HIST("h3Xi1530Gen"), part.pt(), inCent, multiplicity); + else + histos.fill(HIST("h3Xi1530GenAnti"), part.pt(), inCent, multiplicity); } } @@ -1376,31 +1406,33 @@ struct Xi1530Analysisqa { fillHistograms(collision1, inCent, tracks1, tracks2); } } - void processMEDF(aod::ResoCollisionDFs const& resoCollisions, aod::ResoTrackDFs const& resotracks, aod::ResoCascadeDFs const& cascTracks) - { + // void processMEDF(aod::ResoCollisionDFs const& resoCollisions, aod::ResoTrackDFs const& resotracks, aod::ResoCascadeDFs const& cascTracks) + // { - auto tracksTuple = std::make_tuple(resotracks, cascTracks); + /* Will be implemented once the DataFrame for cascade is ready. */ - BinningTypeVtxZT0M colBinning{{mixingConfig.cfgVtxBins, mixingConfig.cfgMultBins}, true}; - Pair pairs{colBinning, mixingConfig.nEvtMixing, -1, resoCollisions, tracksTuple, &cache}; + // auto tracksTuple = std::make_tuple(resotracks, cascTracks); - for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { + // BinningTypeVtxZT0M colBinning{{mixingConfig.cfgVtxBins, mixingConfig.cfgMultBins}, true}; + // Pair pairs{colBinning, mixingConfig.nEvtMixing, -1, resoCollisions, tracksTuple, &cache}; - float multiplicity = 0.f; - auto inCent = collision1.cent(); - if (histoConfig.multQA) { - histos.fill(HIST("multQA/h2MultCent"), inCent, multiplicity); - } - fillHistograms(collision1, inCent, tracks1, tracks2); - } - } + // for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { + + // float multiplicity = 0.f; + // auto inCent = collision1.cent(); + // if (histoConfig.multQA) { + // histos.fill(HIST("multQA/h2MultCent"), inCent, multiplicity); + // } + // fillHistograms(collision1, inCent, tracks1, tracks2); + // } + // } PROCESS_SWITCH(Xi1530Analysisqa, processData, "Process Event for Data", false); PROCESS_SWITCH(Xi1530Analysisqa, processMC, "Process Event for MC (Reconstructed)", false); PROCESS_SWITCH(Xi1530Analysisqa, processMCTrue, "Process Event for MC (Generated)", false); PROCESS_SWITCH(Xi1530Analysisqa, processDataMicro, "Process Event for Data (MicroTrack)", false); PROCESS_SWITCH(Xi1530Analysisqa, processMEMicro, "Process EventMixing (MicroTrack) ", false); - PROCESS_SWITCH(Xi1530Analysisqa, processMEDF, "Process EventMixing (DataFrame) ", false); + // PROCESS_SWITCH(Xi1530Analysisqa, processMEDF, "Process EventMixing (DataFrame) ", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From af98f0c302f79910ef501cc19aef6a31fa521d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 8 Apr 2026 12:14:54 +0200 Subject: [PATCH 201/282] [Common] Fix compilation errors in macros (#15630) --- Common/CCDB/macros/ctpRateF.C | 6 ++-- .../macros/upload_event_selection_params.C | 30 +++++++++---------- Common/Core/macros/testMetadataHelper.C | 5 ++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Common/CCDB/macros/ctpRateF.C b/Common/CCDB/macros/ctpRateF.C index 32b93e4aa6b..7890033cb3a 100644 --- a/Common/CCDB/macros/ctpRateF.C +++ b/Common/CCDB/macros/ctpRateF.C @@ -52,7 +52,7 @@ void ctpRateFetcher::getCTPconfig(o2::ccdb::BasicCCDBManager* ccdb, uint64_t tim if (runNumber == mRunNumber && mConfig != nullptr) { return; } - std::map metadata; + std::map metadata; metadata["runNumber"] = std::to_string(runNumber); mConfig = ccdb->getSpecific("CTP/Config/Config", timeStamp, metadata); if (mConfig == nullptr) { @@ -64,7 +64,7 @@ void ctpRateFetcher::getLHCIFdata(o2::ccdb::BasicCCDBManager* ccdb, uint64_t tim if (runNumber == mRunNumber && mLHCIFdata != nullptr) { return; } - std::map metadata; + std::map metadata; mLHCIFdata = ccdb->getSpecific("GLO/Config/GRPLHCIF", timeStamp, metadata); if (mLHCIFdata == nullptr) { LOG(fatal) << "GRPLHCIFData not in database, timestamp:" << timeStamp; @@ -75,7 +75,7 @@ void ctpRateFetcher::getCTPscalers(o2::ccdb::BasicCCDBManager* ccdb, uint64_t ti if (runNumber == mRunNumber && mScalers != nullptr) { return; } - std::map metadata; + std::map metadata; metadata["runNumber"] = std::to_string(runNumber); mScalers = ccdb->getSpecific("CTP/Calib/Scalers", timeStamp, metadata); if (mScalers == nullptr) { diff --git a/Common/CCDB/macros/upload_event_selection_params.C b/Common/CCDB/macros/upload_event_selection_params.C index cafc863ab03..cb137bacbfd 100644 --- a/Common/CCDB/macros/upload_event_selection_params.C +++ b/Common/CCDB/macros/upload_event_selection_params.C @@ -84,14 +84,14 @@ void upload_event_selection_params() n++; period[n] = "lhc15f_isolated_bunches"; par[n] = new EventSelectionParams(0); - par[n]->DisableOutOfBunchPileupCuts(); + par[n]->disableOutOfBunchPileupCuts(); runFirst[n] = 225000; runLast[n] = 225719; n++; period[n] = "lhc15f_isolated_bunches2"; par[n] = new EventSelectionParams(0); - par[n]->DisableOutOfBunchPileupCuts(); + par[n]->disableOutOfBunchPileupCuts(); runFirst[n] = 226062; runLast[n] = 226500; @@ -100,12 +100,12 @@ void upload_event_selection_params() par[n] = new EventSelectionParams(0); runFirst[n] = 225753; runLast[n] = 225768; - par[n]->SetOnVsOfParams(-372.579114, 9.415265, -6.65857, 0.546801); + par[n]->setOnVsOfParams(-372.579114, 9.415265, -6.65857, 0.546801); n++; period[n] = "lhc15f_50ns_trains2_missing_V0C3"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-372.579114, 9.415265, -6.65857, 0.546801); + par[n]->setOnVsOfParams(-372.579114, 9.415265, -6.65857, 0.546801); par[n]->fV0CasymA = 0; par[n]->fV0CasymB = 0; runFirst[n] = 226530; @@ -114,42 +114,42 @@ void upload_event_selection_params() n++; period[n] = "lhc15h"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-245.12, 6.86754, -6.65857, 0.546801); + par[n]->setOnVsOfParams(-245.12, 6.86754, -6.65857, 0.546801); runFirst[n] = 232914; runLast[n] = 233859; n++; period[n] = "lhc15h_isolated_bunches"; par[n] = new EventSelectionParams(0); - par[n]->DisableOutOfBunchPileupCuts(); + par[n]->disableOutOfBunchPileupCuts(); runFirst[n] = 233912; runLast[n] = 234050; n++; period[n] = "lhc15i"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-223.155660, 7.117266, -6.218793, 0.543201); + par[n]->setOnVsOfParams(-223.155660, 7.117266, -6.218793, 0.543201); runFirst[n] = 235196; runLast[n] = 236866; n++; period[n] = "lhc15j"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-222.631866, 7.431432, -6.610850, 0.587165); + par[n]->setOnVsOfParams(-222.631866, 7.431432, -6.610850, 0.587165); runFirst[n] = 236892; runLast[n] = 238621; n++; period[n] = "lhc15l"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-198.639921, 7.454714, -5.018572, 0.585245); + par[n]->setOnVsOfParams(-198.639921, 7.454714, -5.018572, 0.585245); runFirst[n] = 239188; runLast[n] = 241544; n++; period[n] = "lhc15n"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-336.279729, 10.694535, -4.144493, 0.851104); + par[n]->setOnVsOfParams(-336.279729, 10.694535, -4.144493, 0.851104); runFirst[n] = 244340; runLast[n] = 244628; @@ -176,7 +176,7 @@ void upload_event_selection_params() n++; period[n] = "lhc16do"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-65.42, 7.43, -5.62, 0.85); + par[n]->setOnVsOfParams(-65.42, 7.43, -5.62, 0.85); runFirst[n] = 252235; runLast[n] = 264035; @@ -201,7 +201,7 @@ void upload_event_selection_params() n++; period[n] = "pp2017"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-70, 5.2, -3.0, 0.76); + par[n]->setOnVsOfParams(-70, 5.2, -3.0, 0.76); runFirst[n] = 270531; runLast[n] = 280140; @@ -214,21 +214,21 @@ void upload_event_selection_params() n++; period[n] = "pp2017pqr"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-70, 5.2, -3.0, 0.76); + par[n]->setOnVsOfParams(-70, 5.2, -3.0, 0.76); runFirst[n] = 282008; runLast[n] = 282704; n++; period[n] = "lhc18b_isolated_bunches"; par[n] = new EventSelectionParams(0); - par[n]->DisableOutOfBunchPileupCuts(); + par[n]->disableOutOfBunchPileupCuts(); runFirst[n] = 284706; runLast[n] = 285015; n++; period[n] = "lhc18b_trains"; par[n] = new EventSelectionParams(0); - par[n]->SetOnVsOfParams(-65., 4.3, -5.62, 0.85); + par[n]->setOnVsOfParams(-65., 4.3, -5.62, 0.85); runFirst[n] = 285064; runLast[n] = 285203; diff --git a/Common/Core/macros/testMetadataHelper.C b/Common/Core/macros/testMetadataHelper.C index 27371aaf0e3..fcd79f0a491 100644 --- a/Common/Core/macros/testMetadataHelper.C +++ b/Common/Core/macros/testMetadataHelper.C @@ -120,8 +120,9 @@ std::map buildMapForCommitHash(const std::string& hash) return results; } -void populateCCDBWithCommitAvailability(std::map hasHashMap, - const std::string commitHash const std::string ccdbUrl = "http://ccdb-test.cern.ch:8080/") +void populateCCDBWithCommitAvailability(std::map hasHashMap, + const std::string commitHash, + const std::string ccdbUrl = "http://ccdb-test.cern.ch:8080/") { // First, init the CCDB manager to test if the ccdb is already populated o2::ccdb::CcdbApi api; From 1c0a2321ee7ec8ce269fbda4204a063fa8ff83cc Mon Sep 17 00:00:00 2001 From: aimeric-landou <46970521+aimeric-landou@users.noreply.github.com> Date: Wed, 8 Apr 2026 14:26:38 +0100 Subject: [PATCH 202/282] [PWGJE] jetFinderQA: quickfix (#15682) --- PWGJE/Tasks/jetFinderQA.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index c7c9e359a51..87315fc0819 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -1493,7 +1493,7 @@ struct JetFinderQATask { void processQcMultCutCheck(soa::Filtered>::iterator const& collision, soa::Join const&, - // soa::Join const& aodMcCollisions, + soa::Join const&, soa::Join const& mcdjets, soa::Filtered> const& tracks, soa::Filtered const& mcparticles) From e872c7a6fbd3c1b4637b5ec9afa0885dd00d76ec Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Wed, 8 Apr 2026 15:47:20 +0200 Subject: [PATCH 203/282] [PWGEM/Dilepton] update dimuon producer (#15680) --- PWGEM/Dilepton/Core/DileptonProducer.h | 47 +++++++++++++------------ PWGEM/Dilepton/Utils/EMTrackUtilities.h | 35 ++---------------- 2 files changed, 27 insertions(+), 55 deletions(-) diff --git a/PWGEM/Dilepton/Core/DileptonProducer.h b/PWGEM/Dilepton/Core/DileptonProducer.h index 1b4ca326472..93077f63c32 100644 --- a/PWGEM/Dilepton/Core/DileptonProducer.h +++ b/PWGEM/Dilepton/Core/DileptonProducer.h @@ -27,6 +27,7 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include @@ -57,10 +58,8 @@ #include #include #include -#include #include -#include -#include +#include #include #include @@ -272,9 +271,7 @@ struct DileptonProducer { float d_bz; o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; - static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; - std::mt19937 engine; float leptonM1 = 0.f; float leptonM2 = 0.f; @@ -289,9 +286,6 @@ struct DileptonProducer { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - std::random_device seed_gen; - engine = std::mt19937(seed_gen()); - DefineEMEventCut(); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { DefineDielectronCut(); @@ -461,7 +455,7 @@ struct DileptonProducer { } template - bool fillPairInfo(TCollision const&, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks) + bool fillPairInfo(TCollision const&, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { @@ -477,13 +471,16 @@ struct DileptonProducer { if (!cut.template IsSelectedTrack(t1) || !cut.template IsSelectedTrack(t2)) { return false; } - - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { - return false; - } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + if (!map_best_match_globalmuon[t1.globalIndex()] || !map_best_match_globalmuon[t2.globalIndex()]) { return false; } + + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + // return false; + // } + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + // return false; + // } } if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -539,6 +536,7 @@ struct DileptonProducer { o2::framework::SliceCache cache; o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && @@ -571,7 +569,6 @@ struct DileptonProducer { o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); - int ndf = 0; template void runPairing(TCollisions const& collisions, TLeptons const& posTracks, TLeptons const& negTracks, TPresilce const& perCollision, TCut const& cut, TAllTracks const& tracks) { @@ -628,7 +625,7 @@ struct DileptonProducer { } // end of DF template - bool isPairOK(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const& tracks) + bool isPairOK(TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { @@ -644,13 +641,16 @@ struct DileptonProducer { if (!cut.IsSelectedTrack(t1) || !cut.IsSelectedTrack(t2)) { return false; } - - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { - return false; - } - if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + if (!map_best_match_globalmuon[t1.globalIndex()] || !map_best_match_globalmuon[t2.globalIndex()]) { return false; } + + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t1, cut, tracks)) { + // return false; + // } + // if (!o2::aod::pwgem::dilepton::utils::emtrackutil::isBestMatch(t2, cut, tracks)) { + // return false; + // } } if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -742,6 +742,8 @@ struct DileptonProducer { passed_pairIds.shrink_to_fit(); } + std::unordered_map map_best_match_globalmuon; + void processAnalysis(FilteredMyCollisions const& collisions, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -752,13 +754,14 @@ struct DileptonProducer { runPairing(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } runPairing(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } map_weight.clear(); - ndf++; + map_best_match_globalmuon.clear(); } PROCESS_SWITCH(DileptonProducer, processAnalysis, "run dilepton analysis", true); diff --git a/PWGEM/Dilepton/Utils/EMTrackUtilities.h b/PWGEM/Dilepton/Utils/EMTrackUtilities.h index ba9953f48b1..c06903b1eee 100644 --- a/PWGEM/Dilepton/Utils/EMTrackUtilities.h +++ b/PWGEM/Dilepton/Utils/EMTrackUtilities.h @@ -162,7 +162,7 @@ bool isBestMatch(TTrack const& track, TCut const& cut, TTracks const& tracks) for (const auto& glmuonId : track.globalMuonsWithSameMFTIds()) { auto candidate = tracks.rawIteratorAt(glmuonId); if (candidate.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && candidate.emeventId() == track.emeventId() && candidate.mchtrackId() != track.mchtrackId()) { - if (cut.template IsSelectedTrack(candidate)) { + if (cut.template IsSelectedTrack(candidate)) { map_chi2MCHMFT[candidate.globalIndex()] = candidate.chi2MatchMCHMFT(); } } @@ -181,7 +181,7 @@ bool isBestMatch(TTrack const& track, TCut const& cut, TTracks const& tracks) for (const auto& glmuonId : track.globalMuonsWithSameMCHMIDIds()) { auto candidate = tracks.rawIteratorAt(glmuonId); if (candidate.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && candidate.emeventId() == track.emeventId() && candidate.mfttrackId() != track.mfttrackId()) { - if (cut.template IsSelectedTrack(candidate)) { + if (cut.template IsSelectedTrack(candidate)) { map_chi2MCHMFT[candidate.globalIndex()] = candidate.chi2MatchMCHMFT(); } } @@ -211,36 +211,5 @@ std::unordered_map findBestMatchMap(TTracks const& tracks, TCut const return map; } //_______________________________________________________________________ -// template -// float sigmaPt(T const& track) -// { -// return std::sqrt(track.c1Pt21Pt2()) / std::pow(track.signed1Pt(), 2); // pT resolution -// } -// //_______________________________________________________________________ -// template -// float sigmaPhi(T const& track) -// { -// return std::sqrt(track.cSnpSnp()) / std::sqrt(1.f - std::pow(track.snp(), 2)); // phi resolution -// } -// //_______________________________________________________________________ -// template -// float sigmaTheta(T const& track) -// { -// return std::sqrt(track.cTglTgl()) / (1.f + std::pow(track.tgl(), 2)); // theta resolution = lambda resolution. // lambda = pi/2 - theta. theta is polar angle. -// } -// //_______________________________________________________________________ -// template -// float sigmaEta(T const& track) -// { -// return std::sqrt(track.cTglTgl()) / std::sqrt(1.f + std::pow(track.tgl(), 2)); -// } -// //_______________________________________________________________________ -// template -// float sigmaP(T const& track) -// { -// // p = 1/1/pT x 1/cos(lambda); -// return std::sqrt(std::pow(1.f / track.signed1Pt(), 4) * ((1.f + std::pow(track.tgl(), 2)) * track.c1Pt21Pt2() + 1.f / (1.f + std::pow(track.tgl(), 2)) * std::pow(track.signed1Pt() * track.tgl(), 2) * track.cTglTgl() - 2.f * track.signed1Pt() * track.tgl() * track.c1PtTgl())); -// } -//_______________________________________________________________________ } // namespace o2::aod::pwgem::dilepton::utils::emtrackutil #endif // PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ From e82901d8c4207684e5a8daefaf43e96c044ff1bb Mon Sep 17 00:00:00 2001 From: gengjiabin12 <997406694@qq.com> Date: Wed, 8 Apr 2026 23:50:58 +0800 Subject: [PATCH 204/282] [PWGLF] Added a switch for the pbpb collision selection (#15685) --- PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 0c0c04f1448..c0a43472ed2 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -86,6 +86,8 @@ struct HStrangeCorrelation { Configurable selectINELgtZERO{"selectINELgtZERO", true, "select INEL>0 events"}; Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; Configurable requireAllGoodITSLayers{"requireAllGoodITSLayers", false, " require that in the event all ITS are good"}; + Configurable requireGoodTriggerTVX{"requireGoodTriggerTVX", false, " require acceptable FT0C-FT0A time difference"}; + Configurable requireGoodZvtxFT0vsPV{"requireGoodZvtxFT0vsPV", false, " require small difference between z-vertex from PV and from FT0"}; Configurable skipUnderOverflowInTHn{"skipUnderOverflowInTHn", false, "skip under/overflow in THns"}; Configurable mixingParameter{"mixingParameter", 10, "how many events are mixed"}; Configurable doMCassociation{"doMCassociation", false, "fill everything only for MC associated"}; @@ -1912,7 +1914,7 @@ struct HStrangeCorrelation { if (fillHists) histos.fill(HIST("hEventSelection"), 1.5 /* collisions after sel8*/); - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && masterConfigurations.requireGoodTriggerTVX) { return false; } if (fillHists) @@ -1924,14 +1926,14 @@ struct HStrangeCorrelation { if (fillHists) histos.fill(HIST("hEventSelection"), 3.5 /* collisions after sel pvz sel*/); - if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { + if (!collision.selection_bit(aod::evsel::kIsGoodITSLayersAll) && masterConfigurations.requireAllGoodITSLayers) { // cut time intervals with dead ITS staves return false; } if (fillHists) histos.fill(HIST("hEventSelection"), 4.5 /* collisions after cut time intervals with dead ITS staves*/); - if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) && masterConfigurations.requireGoodZvtxFT0vsPV) { // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference // use this cut at low multiplicities with caution return false; From b7e2a5503678c747a15e8e333e7658b134e0358c Mon Sep 17 00:00:00 2001 From: Marta Urioni <78807256+murioni@users.noreply.github.com> Date: Wed, 8 Apr 2026 18:23:25 +0200 Subject: [PATCH 205/282] [PWGLF] small change in heavyionMultiplicity.cxx (#15687) --- PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index 167db95f0e5..ac1e8841006 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -85,9 +85,9 @@ enum { kSpOther, kSpStrangeDecay, kBkg, - kFake, kSpNotPrimary, kSpAll, + kFake, kSpeciesend }; From 221a6c686c3606b136c82d3e5dcb7dc1834f0ed1 Mon Sep 17 00:00:00 2001 From: ynishida-style Date: Thu, 9 Apr 2026 15:30:19 +0900 Subject: [PATCH 206/282] [PWGJE] Add random cone method (#15689) --- PWGJE/Tasks/jetShape.cxx | 227 +++++++++++++++++++++++++++------------ 1 file changed, 159 insertions(+), 68 deletions(-) diff --git a/PWGJE/Tasks/jetShape.cxx b/PWGJE/Tasks/jetShape.cxx index c48fad2f35c..a5d8e9687a5 100644 --- a/PWGJE/Tasks/jetShape.cxx +++ b/PWGJE/Tasks/jetShape.cxx @@ -13,30 +13,28 @@ /// \author Yuto Nishida /// \brief Task for measuring the dependence of the jet shape function rho(r) on the distance r from the jet axis. +#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" +#include "PWGLF/DataModel/mcCentrality.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" #include +#include #include -#include #include #include @@ -78,6 +76,39 @@ struct JetShapeTask { Configurable tpcNSigmaPrMax{"tpcNSigmaPrMax", 0.5f, "Max value of tpcNsigmaProton"}; Configurable tpcNSigmaPiMin{"tpcNSigmaPiMin", -0.5f, "Min value of tpcNsigmaPion"}; Configurable tpcNSigmaPiMax{"tpcNSigmaPiMax", 3.5f, "Max value of tpcNsigmaPion"}; + Configurable randomConeDeltaPhiMin{"randomConeDeltaPhiMin", static_cast(o2::constants::math::PIThird), "Minimum delta phi for random cone"}; + Configurable randomConeDeltaPhiMax{"randomConeDeltaPhiMax", static_cast(2.0f * o2::constants::math::PIThird), "Maximum delta phi for random cone"}; + + Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; + + Configurable jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; + Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; + + Configurable eventSelections{"eventSelections", "sel8", + "choose event selection"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + + Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; + Configurable leadingConstituentPtMin{"leadingConstituentPtMin", 5.0, "minimum pT selection on jet constituent"}; + Configurable leadingConstituentPtMax{"leadingConstituentPtMax", 9999.0, "maximum pT selection on jet constituent"}; + + // for jet shape + Configurable> distanceCategory{"distanceCategory", {0.00f, 0.05f, 0.10f, 0.15f, 0.20f, 0.25f, 0.30f, 0.35f, 0.40f, 0.45f, 0.50f, 0.55f, 0.60f, 0.65f, 0.70f}, "distance of category"}; + + // for ppi production + Configurable etaTrUp{"etaTrUp", 0.7f, "maximum track eta"}; + Configurable dcaxyCutMax{"dcaxyCutMax", 2.0f, "maximum DCA xy"}; + Configurable chi2ItsMax{"chi2ItsMax", 15.0f, "its chi2 cut"}; + Configurable chi2TpcMax{"chi2TpcMax", 4.0f, "tpc chi2 cut"}; + Configurable nclItsMin{"nclItsMin", 2.0f, "its # of cluster cut"}; + Configurable nclTpcMin{"nclTpcMin", 100.0f, "tpc # if cluster cut"}; + Configurable nclcrossTpcMin{"nclcrossTpcMin", 70.0f, "tpc # of crossedRows cut"}; + Configurable mcRapidityMax{"mcRapidityMax", 0.5f, "maximum mctrack y"}; + Configurable epsilon{"epsilon", 1e-6, "standard for aboid division of zero"}; + Configurable maxDeltaEtaSafe{"maxDeltaEtaSafe", 0.9f, "maximum track eta for cut"}; + Configurable nSigmaMaxForDcaxy{"nSigmaMaxForDcaxy", 4.0f, "maximum nSigma for DCAxy"}; + + 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"}; HistogramRegistry registry{ "registry", @@ -101,27 +132,33 @@ struct JetShapeTask { {"trackItsNCls", "trackItsNCls", {HistType::kTH1F, {{10, 0, 10}}}}, {"jetTpcTofPi", "jetTpcTofPi", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsDistance, 0, distanceMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"jetTpcTofPr", "jetTpcTofPr", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsDistance, 0, distanceMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, - {"tpcTofPiOutOfJet", "tpcTofPiOutOfJet", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, - {"tpcTofPrOutOfJet", "tpcTofPrOutOfJet", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"tpcTofPiPerpJet", "tpcTofPiPerpJet", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"tpcTofPrPerpJet", "tpcTofPrPerpJet", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"jetTpcPi", "jetTpcPi", {HistType::kTH2F, {{nBinsP, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}}}}, {"jetTofPi", "jetTofPi", {HistType::kTH2F, {{nBinsPt, 0, ptMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}}}}, {"jetTpcPr", "jetTpcPr", {HistType::kTH2F, {{nBinsP, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}}}}, {"jetTofPr", "jetTofPr", {HistType::kTH2F, {{nBinsPt, 0, ptMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}}}}, {"jetTpcDedx", "jetTpcDedx", {HistType::kTHnSparseD, {{nBinsPForDedx, 0, pMax}, {nBinsTpcDedx, 0, 1000}, {nBinsDistance, 0, distanceMax}}}}, - {"tpcDedxOutOfJet", "tpcDedxOutOfJet", {HistType::kTH2F, {{nBinsPForDedx, 0, pMax}, {nBinsTpcDedx, 0, 1000}}}}, + {"tpcDedxPerpJet", "tpcDedxPerpJet", {HistType::kTH2F, {{nBinsPForDedx, 0, pMax}, {nBinsTpcDedx, 0, 1000}}}}, {"jetTofBeta", "jetTofBeta", {HistType::kTH2F, {{nBinsPForBeta, 0, pMax}, {nBinsTofBeta, 0.4, 1.1}}}}, {"jetpVsPtForPr", "jetpVsPtForPr", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsDistance, 0, distanceMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"jetpVsPtForPi", "jetpVsPtPi", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsDistance, 0, distanceMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, - {"pVsPtForPrOutOfJet", "pVsPtForPrOutOfJet", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, - {"pVsPtForPiOutOfJet", "pVsPtPionOutOfJet", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"pVsPtForPrPerpJet", "pVsPtForPrPerpJet", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"pVsPtForPiPerpJet", "pVsPtPionPerpJet", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"jetDcaPr", "jetDcaPr", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsDistance, 0, distanceMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"jetDcaPi", "jetDcaPi", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsDistance, 0, distanceMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, - {"dcaPrOutOfJet", "dcaPrOutOfJet", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, - {"dcaPiOutOfJet", "dcaPiOutOfJet", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"dcaPrPerpJet", "dcaPrPerpJet", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"dcaPiPerpJet", "dcaPiPerpJet", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"tpcTofPiRandCone", "tpcTofPiRandCone", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"tpcTofPrRandCone", "tpcTofPrRandCone", {HistType::kTHnSparseD, {{nBinsPForCut, 0, pMax}, {nBinsNSigma, nSigmaMin, nSigmaMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"pVsPtForPrRandCone", "pVsPtForPrRandCone", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"pVsPtForPiRandCone", "pVsPtPionRandCone", {HistType::kTHnSparseD, {{nBinsP, 0, pMax}, {nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"dcaPrRandCone", "dcaPrRandCone", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"dcaPiRandCone", "dcaPiRandCone", {HistType::kTHnSparseD, {{nBinsPtForDca, 0, ptMax}, {nBinsDcaxyForData, dcaxyMin, dcaxyMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"jetPt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}}, {"jetEta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}}, {"jetPhi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}}, - {"area", "area", {HistType::kTH1F, {{100, 0, 4}}}}, + {"area", "area", {HistType::kTH2F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}, {100, 0, 2}}}}, {"rho", "rho", {HistType::kTH1F, {{120, 0, 300}}}}, {"ptCorr", "Corrected jet pT; p_{T}^{corr} (GeV/c); Counts", {HistType::kTH1F, {{200, 0, 200}}}}, {"ptCorrVsDistance", "ptcorr_vs_distance", {HistType::kTH2F, {{70, 0, 0.7}, {100, 0, 100}}}}, @@ -130,10 +167,11 @@ struct JetShapeTask { {"ptSumBg1", "ptSumBg1", {HistType::kTHnSparseD, {{14, 0, 0.7}, {nBinsJetShapeFunc, 0, jetShapeFuncMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"ptSumBg2", "ptSumBg2", {HistType::kTHnSparseD, {{14, 0, 0.7}, {nBinsJetShapeFunc, 0, jetShapeFuncMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"event/vertexz", ";Vtx_{z} (cm);Entries", {HistType::kTH1F, {{100, -20, 20}}}}, - {"eventCounterJetShape", "eventCounterJetShape", {HistType::kTH1F, {{1, 0, +1, ""}}}}, - {"eventCounterJet", "eventCounterJet", {HistType::kTH1F, {{1, 0, +1, ""}}}}, - {"eventCounterInc", "eventCounterInc", {HistType::kTH1F, {{1, 0, +1, ""}}}}, - {"eventCounterMc", "eventCounterMc", {HistType::kTH1F, {{1, 0, +1, ""}}}}, + {"eventCounterJetShape", "eventCounterJetShape", {HistType::kTH1F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"eventCounterJet", "eventCounterJet", {HistType::kTH1F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"eventCounterInc", "eventCounterInc", {HistType::kTH1F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"eventCounterRandCone", "Number of Random Cones;Centrality (%);Count", {HistType::kTH1F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, + {"eventCounterMc", "eventCounterMc", {HistType::kTH1F, {{nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"ptVsCentrality", "ptvscentrality", {HistType::kTH2F, {{100, 0, 100}, {300, 0, 300}}}}, {"ptResolution", "ptResolution", {HistType::kTH2F, {{nBinsPt, 0, ptMax}, {100, -1.0, +1.0}}}}, {"mcCentralityReco", "mcCentralityReco", {HistType::kTH1F, {{100, 0, 100}}}}, @@ -152,37 +190,6 @@ struct JetShapeTask { {"ptGeneratedKaon", "ptGeneratedKaon", {HistType::kTHnSparseD, {{nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}, {"ptGeneratedProton", "ptGeneratedProton", {HistType::kTHnSparseD, {{nBinsPt, 0, ptMax}, {nBinsJetPt, jetPtMinForCut, jetPtMaxForCut}, {nBinsCentrality, centralityMinForCut, centralityMaxForCut}}}}}}; - Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; - - Configurable jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; - Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; - - Configurable eventSelections{"eventSelections", "sel8", - "choose event selection"}; - Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; - - Configurable jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"}; - Configurable leadingConstituentPtMin{"leadingConstituentPtMin", 5.0, "minimum pT selection on jet constituent"}; - Configurable leadingConstituentPtMax{"leadingConstituentPtMax", 9999.0, "maximum pT selection on jet constituent"}; - - // for jet shape - Configurable> distanceCategory{"distanceCategory", {0.00f, 0.05f, 0.10f, 0.15f, 0.20f, 0.25f, 0.30f, 0.35f, 0.40f, 0.45f, 0.50f, 0.55f, 0.60f, 0.65f, 0.70f}, "distance of category"}; - - // for ppi production - Configurable etaTrUp{"etaTrUp", 0.7f, "maximum track eta"}; - Configurable dcaxyCutMax{"dcaxyCutMax", 2.0f, "maximum DCA xy"}; - Configurable chi2ItsMax{"chi2ItsMax", 15.0f, "its chi2 cut"}; - Configurable chi2TpcMax{"chi2TpcMax", 4.0f, "tpc chi2 cut"}; - Configurable nclItsMin{"nclItsMin", 2.0f, "its # of cluster cut"}; - Configurable nclTpcMin{"nclTpcMin", 100.0f, "tpc # if cluster cut"}; - Configurable nclcrossTpcMin{"nclcrossTpcMin", 70.0f, "tpc # of crossedRows cut"}; - Configurable mcRapidityMax{"mcRapidityMax", 0.5f, "maximum mctrack y"}; - Configurable epsilon{"epsilon", 1e-6, "standard for aboid division of zero"}; - Configurable maxDeltaEtaSafe{"maxDeltaEtaSafe", 0.9f, "maximum track eta for cut"}; - Configurable nSigmaMaxForDcaxy{"nSigmaMaxForDcaxy", 4.0f, "maximum nSigma for DCAxy"}; - - 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"}; - std::vector eventSelectionBits; int trackSelection = -1; std::vector triggerMaskBits; @@ -253,7 +260,7 @@ struct JetShapeTask { return; } - registry.fill(HIST("eventCounterJetShape"), 0.5); + registry.fill(HIST("eventCounterJetShape"), collision.centFT0M()); size_t nBins = distanceCategory->size() - 1; @@ -363,7 +370,6 @@ struct JetShapeTask { for (size_t i = 0; i < cachedJets.size(); ++i) { const auto& jet = cachedJets[i]; - registry.fill(HIST("area"), jet.area); registry.fill(HIST("rho"), rho); registry.fill(HIST("jetPt"), jet.pt); registry.fill(HIST("ptCorr"), jet.ptCorr); @@ -400,7 +406,7 @@ struct JetShapeTask { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - registry.fill(HIST("eventCounterJet"), 0.5); + registry.fill(HIST("eventCounterJet"), collision.centFT0M()); registry.fill(HIST("event/vertexz"), collision.posZ()); float rho = collision.rho(); @@ -425,11 +431,60 @@ struct JetShapeTask { registry.fill(HIST("jetEta"), jet.eta()); registry.fill(HIST("jetPhi"), jet.phi()); + registry.fill(HIST("area"), centrality, jet.area()); cachedJets.push_back( {jet.pt(), jet.eta(), jet.phi(), ptCorr, phiBg1, phiBg2}); } + bool isValidRC = false; + float rcEta = 0.0f; + float rcPhi = 0.0f; + + if (!cachedJets.empty()) { + constexpr unsigned int RandomSeed = 0; + TRandom3 randomNumber(RandomSeed); + + const auto& leadJet = cachedJets[0]; + + constexpr float MaxTrackEta = 0.9f; + constexpr int MaxAttempts = 100; // for RandomCone + constexpr float FlipProbability = 0.5f; + + // Range to generate + float rcEtaMin = -MaxTrackEta + distanceMax; + float rcEtaMax = MaxTrackEta - distanceMax; + + int attempts = 0; + while (!isValidRC && attempts < MaxAttempts) { + rcEta = randomNumber.Uniform(rcEtaMin, rcEtaMax); + + float dPhi = randomNumber.Uniform(randomConeDeltaPhiMin, randomConeDeltaPhiMax); + + // flipProbability (0.5) + if (randomNumber.Uniform() < FlipProbability) { + dPhi = -dPhi; + } + + rcPhi = RecoDecay::constrainAngle(leadJet.phi + dPhi); + + float dPhiLead = std::abs(rcPhi - leadJet.phi); + if (dPhiLead > o2::constants::math::PI) + dPhiLead = o2::constants::math::TwoPI - dPhiLead; + float dEtaLead = rcEta - leadJet.eta; + float distLead = std::sqrt(dEtaLead * dEtaLead + dPhiLead * dPhiLead); + + if (distLead > (jetR + distanceMax)) { + isValidRC = true; + } + attempts++; + } + + if (isValidRC) { + registry.fill(HIST("eventCounterRandCone"), centrality); + } + } + for (const auto& jetTrack : tracks) { if (!jetderiveddatautilities::selectTrack(jetTrack, trackSelection)) { continue; @@ -495,29 +550,65 @@ struct JetShapeTask { // --- Background Fill --- if (distBg1 < distanceMax || distBg2 < distanceMax) { - registry.fill(HIST("tpcDedxOutOfJet"), trkP, tpcSig); + registry.fill(HIST("tpcDedxPerpJet"), trkP, tpcSig); // dcaXY if (track.hasTOF()) { if (nSigmaSqPr < nSigmaMaxForDcaxy) { - registry.fill(HIST("dcaPrOutOfJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); + registry.fill(HIST("dcaPrPerpJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); } if (nSigmaSqPi < nSigmaMaxForDcaxy) { - registry.fill(HIST("dcaPiOutOfJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); + registry.fill(HIST("dcaPiPerpJet"), trkPt, track.dcaXY(), jet.ptCorr, centrality); } } if (hasTofPi) { - registry.fill(HIST("tpcTofPiOutOfJet"), trkP, tpcPi, jet.ptCorr, centrality); + registry.fill(HIST("tpcTofPiPerpJet"), trkP, tpcPi, jet.ptCorr, centrality); if (isTpcPiRange) { - registry.fill(HIST("pVsPtForPiOutOfJet"), trkP, trkPt, jet.ptCorr, centrality); + registry.fill(HIST("pVsPtForPiPerpJet"), trkP, trkPt, jet.ptCorr, centrality); } } if (hasTofPr) { - registry.fill(HIST("tpcTofPrOutOfJet"), trkP, tpcPr, jet.ptCorr, centrality); + registry.fill(HIST("tpcTofPrPerpJet"), trkP, tpcPr, jet.ptCorr, centrality); if (isTpcPrRange) { - registry.fill(HIST("pVsPtForPrOutOfJet"), trkP, trkPt, jet.ptCorr, centrality); + registry.fill(HIST("pVsPtForPrPerpJet"), trkP, trkPt, jet.ptCorr, centrality); + } + } + } + + if (isValidRC) { + const auto& leadJet = cachedJets[0]; + + float dEtaRC = trkEta - rcEta; + float dPhiRC = std::abs(trkPhi - rcPhi); + if (dPhiRC > o2::constants::math::PI) + dPhiRC = o2::constants::math::TwoPI - dPhiRC; + float distRC = std::sqrt(dEtaRC * dEtaRC + dPhiRC * dPhiRC); + + if (distRC < distanceMax) { + + // dcaXY + if (track.hasTOF()) { + if (nSigmaSqPr < nSigmaMaxForDcaxy) { + registry.fill(HIST("dcaPrRandCone"), trkPt, track.dcaXY(), leadJet.ptCorr, centrality); + } + if (nSigmaSqPi < nSigmaMaxForDcaxy) { + registry.fill(HIST("dcaPiRandCone"), trkPt, track.dcaXY(), leadJet.ptCorr, centrality); + } + } + + if (hasTofPi) { + registry.fill(HIST("tpcTofPiRandCone"), trkP, tpcPi, leadJet.ptCorr, centrality); + if (isTpcPiRange) { + registry.fill(HIST("pVsPtForPiRandCone"), trkP, trkPt, leadJet.ptCorr, centrality); + } + } + if (hasTofPr) { + registry.fill(HIST("tpcTofPrRandCone"), trkP, tpcPr, leadJet.ptCorr, centrality); + if (isTpcPrRange) { + registry.fill(HIST("pVsPtForPrRandCone"), trkP, trkPt, leadJet.ptCorr, centrality); + } } } } @@ -561,7 +652,7 @@ struct JetShapeTask { if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { return; } - registry.fill(HIST("eventCounterJet"), 0.5); + registry.fill(HIST("eventCounterInc"), collision.centFT0M()); // tracks conditions for (const auto& jetTrack : tracks) { From 7710233bd8a602d61e3021629c92b33fe2f385c1 Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Thu, 9 Apr 2026 09:31:37 +0200 Subject: [PATCH 207/282] [PWGLF] nuclei proton correlation: fix mixed event for identical pairs and O2linter (#15686) --- PWGLF/Tasks/Nuspex/CMakeLists.txt | 2 +- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 94 ++++++++++--------- 2 files changed, 53 insertions(+), 43 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 0609b38835e..71a38eb1c9f 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -114,7 +114,7 @@ o2physics_add_dpl_workflow(neutron-skin PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(hadronnucleicorrelation +o2physics_add_dpl_workflow(hadron-nuclei-correlation SOURCES hadronnucleicorrelation.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 5aa01f018ab..2ae84cca68d 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -73,7 +73,7 @@ enum Modes { kPPbar }; -struct hadronnucleicorrelation { +struct HadronNucleiCorrelation { static constexpr int betahasTOFthr = -100; @@ -87,14 +87,14 @@ struct hadronnucleicorrelation { Configurable isMC{"isMC", false, "is MC"}; Configurable isMCGen{"isMCGen", false, "is isMCGen"}; Configurable isPrim{"isPrim", true, "is isPrim"}; - Configurable docorrection{"docorrection", false, "do efficiency correction"}; + Configurable doCorrection{"doCorrection", false, "do efficiency correction"}; Configurable fCorrectionPath{"fCorrectionPath", "", "Correction path to file"}; Configurable fCorrectionHisto{"fCorrectionHisto", "", "Correction histogram"}; - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable cfgUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Event selection - Configurable cutzvertex{"cutzvertex", 10.0, "|vertexZ| value limit"}; + Configurable cutzVertex{"cutzVertex", 10.0, "|vertexZ| value limit"}; // Track selection Configurable par0{"par0", 0.004, "par 0"}; @@ -103,9 +103,9 @@ struct hadronnucleicorrelation { Configurable min_TPC_nCrossedRowsOverFindableCls{"min_TPC_nCrossedRowsOverFindableCls", 0.8, "n TPC Crossed Rows Over Findable Cls"}; Configurable max_chi2_TPC{"max_chi2_TPC", 4.0f, "maximum TPC chi^2/Ncls"}; Configurable max_chi2_ITS{"max_chi2_ITS", 36.0f, "maximum ITS chi^2/Ncls"}; - Configurable etacut{"etacut", 0.8f, "eta cut"}; - Configurable max_dcaxy{"max_dcaxy", 0.14f, "Maximum DCAxy"}; - Configurable max_dcaz{"max_dcaz", 0.1f, "Maximum DCAz"}; + Configurable etaCut{"etaCut", 0.8f, "eta cut"}; + Configurable max_DCAxy{"max_DCAxy", 0.14f, "Maximum DCAxy"}; + Configurable max_DCAz{"max_DCAz", 0.1f, "Maximum DCAz"}; Configurable nsigmaTPC{"nsigmaTPC", 3.0f, "cut nsigma TPC"}; Configurable nsigmaElPr{"nsigmaElPr", 1.0f, "cut nsigma TPC El for protons"}; Configurable nsigmaElDe{"nsigmaElDe", 3.0f, "cut nsigma TPC El for protons"}; @@ -122,14 +122,14 @@ struct hadronnucleicorrelation { Configurable min_itsNCls{"min_itsNCls", 0, "minimum allowed number of ITS clasters"}; Configurable maxmixcollsGen{"maxmixcollsGen", 100, "maxmixcollsGen"}; Configurable radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"}; - Configurable deta{"deta", 0.01, "minimum allowed defference in eta between two tracks in a pair"}; - Configurable dphi{"dphi", 0.01, "minimum allowed defference in phi_star between two tracks in a pair"}; + Configurable dEta{"dEta", 0.01, "minimum allowed difference in eta between two tracks in a pair"}; + Configurable dPhi{"dPhi", 0.01, "minimum allowed difference in phi_star between two tracks in a pair"}; // Mixing parameters ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 50.0f, 100.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"}; ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; - ColumnBinningPolicy colBinningGen{{confVtxBins, confMultBins}, true}; + ColumnBinningPolicy colBinningGen{{confVtxBins, confMultBins}, true}; // pT/A bins Configurable> pTBins{"pTBins", {0.6f, 1.0f, 1.2f, 2.f}, "p_{T} bins"}; @@ -147,12 +147,12 @@ struct hadronnucleicorrelation { HistogramRegistry QA{"QA"}; using trkType = const FilteredTracks::iterator*; - using trkTypeMC = const FilteredTracksMC::iterator*; + // using trkTypeMC = const FilteredTracksMC::iterator*; // typedef std::shared_ptr colType; // typedef std::shared_ptr MCcolType; std::unique_ptr> Pair = std::make_unique>(); - std::unique_ptr> PairMC = std::make_unique>(); + // std::unique_ptr> PairMC = std::make_unique>(); // Data histograms std::vector> hEtaPhi_SE; @@ -173,13 +173,13 @@ struct hadronnucleicorrelation { void init(o2::framework::InitContext&) { - ccdb->setURL(url.value); + ccdb->setURL(cfgUrl.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); ccdb->setFatalWhenNull(false); - if (docorrection) { + if (doCorrection) { GetCorrection(ccdb, TString(fCorrectionPath), TString(fCorrectionHisto)); } else { hEffpTEta_proton = nullptr; @@ -207,25 +207,25 @@ struct hadronnucleicorrelation { TString name = "AntiDeAntiPr"; switch (mode) { - case 1: + case kDP: name = "DePr"; break; - case 2: + case kDbarP: name = "AntiDePr"; break; - case 3: + case kDPbar: name = "DeAntiPr"; break; - case 4: + case kPbarP: name = "AntiPrPr"; break; - case 5: + case kPbarPbar: name = "AntiPrAntiPr"; break; - case 6: + case kPP: name = "PrPr"; break; - case 7: + case kPPbar: name = "PrAntiPr"; break; } @@ -283,7 +283,7 @@ struct hadronnucleicorrelation { QA.add("QA/hnSigmaTOFVsPt_De", "n#sigma TOF vs p_{T} for d hypothesis (all tracks); p_{T} (GeV/c); n#sigma TOF", {HistType::kTH2D, {pTAxis, AxisNSigma}}); QA.add("QA/hnSigmaITSVsPt_Pr", "n#sigma ITS vs p_{T} for p hypothesis (all tracks); p_{T} (GeV/c); n#sigma ITS", {HistType::kTH2D, {pTAxis, AxisNSigma}}); QA.add("QA/hnSigmaITSVsPt_De", "n#sigma ITS vs p_{T} for d hypothesis (all tracks); p_{T} (GeV/c); n#sigma ITS", {HistType::kTH2D, {pTAxis, AxisNSigma}}); - QA.add("QA/hdetadphistar", ";dphi*;deta ", {HistType::kTH2D, {{101, -0.2, 0.2, "dphi*"}, {101, -0.2, 0.2, "deta"}}}); + QA.add("QA/hdEtadPhistar", ";dPhi*;dEta ", {HistType::kTH2D, {{101, -0.2, 0.2, "dPhi*"}, {101, -0.2, 0.2, "dEta"}}}); if (!isMC) { QA.add("QA/hEtaPr", Form("#eta ditribution for p"), {HistType::kTH1F, {etaAxis}}); @@ -415,14 +415,14 @@ struct hadronnucleicorrelation { } // Filters - Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) <= cutzvertex; + Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) <= cutzVertex; Filter trackFilter = o2::aod::singletrackselector::tpcNClsFound >= min_TPC_nClusters && o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedTpcChi2NCl) <= max_chi2_TPC && o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedTpcCrossedRowsOverFindableCls) >= min_TPC_nCrossedRowsOverFindableCls && o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedItsChi2NCl) <= max_chi2_ITS && - nabs(o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedDcaXY)) <= max_dcaxy && - nabs(o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedDcaXY)) <= max_dcaz && - nabs(o2::aod::singletrackselector::eta) <= etacut; + nabs(o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedDcaXY)) <= max_DCAxy && + nabs(o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedDcaXY)) <= max_DCAz && + nabs(o2::aod::singletrackselector::eta) <= etaCut; template bool IsProton(Type const& track, int sign) @@ -560,8 +560,8 @@ struct hadronnucleicorrelation { { Pair->SetPair(&part0, &part1); Pair->SetIdentical(isIdentical); - if (isIdentical && Pair->IsClosePair(deta, dphi, radiusTPC)) { - QA.fill(HIST("QA/hdetadphistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff()); + if (isIdentical && Pair->IsClosePair(dEta, dPhi, radiusTPC)) { + QA.fill(HIST("QA/hdEtadPhistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff()); return; } @@ -575,7 +575,7 @@ struct hadronnucleicorrelation { float corr0 = 1, corr1 = 1; - if (docorrection) { // Apply corrections + if (doCorrection) { // Apply corrections switch (mode) { case 0: corr0 = hEffpTEta_antideuteron->Interpolate(part0.pt(), part0.eta()); @@ -684,7 +684,7 @@ struct hadronnucleicorrelation { void processSameEvent(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks) { - if (std::abs(collision.posZ()) > cutzvertex) + if (std::abs(collision.posZ()) > cutzVertex) return; registry.fill(HIST("hNEvents"), 0.5); @@ -757,6 +757,9 @@ struct hadronnucleicorrelation { } } + Pair->SetMagField1(collision.magField()); + Pair->SetMagField2(collision.magField()); + if (mode == kPbarPbar || mode == kPP) { // Identical particle combinations for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(tracks, tracks))) { @@ -853,7 +856,7 @@ struct hadronnucleicorrelation { } } } - PROCESS_SWITCH(hadronnucleicorrelation, processSameEvent, "processSameEvent", true); + PROCESS_SWITCH(HadronNucleiCorrelation, processSameEvent, "processSameEvent", true); void processMixedEvent(FilteredCollisions const& collisions, FilteredTracks const& tracks) { @@ -872,6 +875,9 @@ struct hadronnucleicorrelation { continue; } + Pair->SetMagField1(magFieldTesla1); + Pair->SetMagField2(magFieldTesla2); + for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { if (part0.tpcFractionSharedCls() > max_tpcSharedCls) @@ -946,12 +952,12 @@ struct hadronnucleicorrelation { } } } - PROCESS_SWITCH(hadronnucleicorrelation, processMixedEvent, "processMixedEvent", true); + PROCESS_SWITCH(HadronNucleiCorrelation, processMixedEvent, "processMixedEvent", true); void processMC(FilteredCollisions const&, FilteredTracksMC const& tracks) { for (const auto& track : tracks) { - if (std::abs(track.template singleCollSel_as().posZ()) > cutzvertex) + if (std::abs(track.template singleCollSel_as().posZ()) > cutzVertex) continue; if (track.tpcFractionSharedCls() > max_tpcSharedCls) @@ -1312,12 +1318,12 @@ struct hadronnucleicorrelation { } } // track } - PROCESS_SWITCH(hadronnucleicorrelation, processMC, "processMC", false); + PROCESS_SWITCH(HadronNucleiCorrelation, processMC, "processMC", false); void processSameEventGen(SimCollisions::iterator const& mcCollision, SimParticles const& mcParticles) { - if (std::abs(mcCollision.posZ()) > cutzvertex) + if (std::abs(mcCollision.posZ()) > cutzVertex) return; registry.fill(HIST("Generated/hNEventsMC"), 0.5); @@ -1348,7 +1354,7 @@ struct hadronnucleicorrelation { registry.fill(HIST("Generated/hAntiDeuteronsVsPt"), particle.pt()); } - if (std::abs(particle.eta()) > etacut) { + if (std::abs(particle.eta()) > etaCut) { continue; } if (particle.pdgCode() == PDG_t::kProton) { @@ -1439,17 +1445,21 @@ struct hadronnucleicorrelation { } } } - PROCESS_SWITCH(hadronnucleicorrelation, processSameEventGen, "processSameEventGen", false); + PROCESS_SWITCH(HadronNucleiCorrelation, processSameEventGen, "processSameEventGen", false); + + Preslice perMcCollision = o2::aod::mcparticle::mcCollisionId; void processMixedEventGen(SimCollisions const& mcCollisions, SimParticles const& mcParticles) { for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningGen, 5, -1, mcCollisions, mcCollisions)) { - // LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.mult(), collision2.mult()); + // LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.multMCNParticlesEta10(), collision2.multMCNParticlesEta10()); + + auto groupPartsOne = mcParticles.sliceBy(perMcCollision, collision1.globalIndex()); + auto groupPartsTwo = mcParticles.sliceBy(perMcCollision, collision2.globalIndex()); - auto groupPartsOne = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision1.globalIndex(), cache); - auto groupPartsTwo = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision2.globalIndex(), cache); + registry.fill(HIST("hMult"), collision1.multMCNParticlesEta10()); for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { @@ -1506,10 +1516,10 @@ struct hadronnucleicorrelation { } } } - PROCESS_SWITCH(hadronnucleicorrelation, processMixedEventGen, "processMixedEventGen", false); + PROCESS_SWITCH(HadronNucleiCorrelation, processMixedEventGen, "processMixedEventGen", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From b7bed75116713da62737c5827e698c8421063373 Mon Sep 17 00:00:00 2001 From: blacwovie Date: Thu, 9 Apr 2026 16:17:51 +0800 Subject: [PATCH 208/282] [PWGCF] add purity analysis process (#15654) Co-authored-by: ALICE Action Bot --- .../TableProducer/HadNucleiFemto.cxx | 245 +++++++++++------- 1 file changed, 154 insertions(+), 91 deletions(-) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx index 255f7674f1d..71594142229 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/HadNucleiFemto.cxx @@ -161,56 +161,52 @@ struct HadNucleiFemto { Produces mOutputHyperDataTable; Produces mOutputMultiplicityTable; - // Selections + // Particle species configuration Configurable settingHadPDGCode{"settingHadPDGCode", 211, "Hadron - PDG code"}; - + // Event selection and mixing configuration Configurable settingCutVertex{"settingCutVertex", 10.0f, "Accepted z-vertex range"}; - Configurable settingCutPinMinDe{"settingCutPinMinDe", 0.0f, "Minimum Pin for De"}; - Configurable settingCutEta{"settingCutEta", 0.8f, "Eta cut on daughter track"}; - Configurable settingCutChi2tpcLow{"settingCutChi2tpcLow", 0.0f, "Low cut on TPC chi2"}; - Configurable settingCutChi2tpcHigh{"settingCutChi2tpcHigh", 999.f, "High cut on TPC chi2"}; - Configurable settingCutChi2tpcLowPion{"settingCutChi2tpcLowPion", 0.5f, "Low cut on TPC chi2 only for pion"}; - Configurable settingCutChi2tpcHighPion{"settingCutChi2tpcHighPion", 4.f, "High cut on TPC chi2 only for pion"}; - Configurable settingCutInvMass{"settingCutInvMass", 0.0f, "Invariant mass upper limit"}; - Configurable settingCutPtMinDePi{"settingCutPtMinDePi", 0.0f, "Minimum PT cut on DePi4"}; - Configurable settingCutClSizeItsDe{"settingCutClSizeItsDe", 4.0f, "Minimum ITS cluster size for De"}; - Configurable settingCutNCls{"settingCutNCls", 5.0f, "Minimum ITS Ncluster for tracks"}; - Configurable settingCutTPCChi2He{"settingCutTPCChi2He", 0.0f, "Minimum tpcChi2He for Hyper He3"}; - Configurable settingCutAverClsSizeHe{"settingCutAverClsSizeHe", 0.0f, "Minimum averClusSizeHe for Hyper He3"}; - Configurable settingCutChi2NClITS{"settingCutChi2NClITS", 999.f, "Maximum ITS Chi2 for tracks"}; - Configurable settingCutChi2NClITSPion{"settingCutChi2NClITSPion", 36.f, "Maximum ITS Chi2 for tracks only for pion"}; - Configurable settingCutNsigmaTPCHad{"settingCutNsigmaTPCHad", 3.0f, "Value of the TPC Nsigma cut on Had"}; - Configurable settingCutNsigmaTOFHad{"settingCutNsigmaTOFHad", 3.0f, "Value of the hsdron TOF Nsigma cut"}; - Configurable settingCutNsigmaTPCDe{"settingCutNsigmaTPCDe", 2.5f, "Value of the TPC Nsigma cut on De"}; - Configurable settingCutNsigmaITSDe{"settingCutNsigmaITSDe", 2.5f, "Value of the ITD Nsigma cut on De"}; - Configurable settingCutPinMinTOFHad{"settingCutPinMinTOFHad", 0.5f, "Minimum Pin to apply the TOF cut on hadrons"}; - Configurable settingCutPinMinTOFITSDe{"settingCutPinMinTOFITSDe", 1.2f, "Minimum p to apply the TOF ITS cut on De"}; - Configurable settingCutNsigmaTOFTPCDe{"settingCutNsigmaTOFTPCDe", 2.5f, "Value of the De TOF TPC combNsigma cut"}; - Configurable settingCutNsigmaTOFTPCHad{"settingCutNsigmaTOFTPCHad", 3.0f, "Value of the hsdron TOF TPC combNsigma cut"}; Configurable settingNoMixedEvents{"settingNoMixedEvents", 5, "Number of mixed events per event"}; Configurable settingEnableBkgUS{"settingEnableBkgUS", false, "Enable US background"}; Configurable settingSaferME{"settingSaferME", false, "For Safer ME"}; - - Configurable settingFillTable{"settingFillTable", false, "Enable table filling"}; + Configurable settingSaveUSandLS{"settingSaveUSandLS", true, "Save All Pairs"}; + // Common track-quality cuts + Configurable settingCutEta{"settingCutEta", 0.8f, "Eta cut on daughter track"}; + Configurable settingCutNCls{"settingCutNCls", 5.0f, "Minimum ITS Ncluster for tracks"}; + Configurable settingCutChi2tpcLow{"settingCutChi2tpcLow", 0.5f, "Low cut on TPC chi2"}; + Configurable settingCutChi2tpcHigh{"settingCutChi2tpcHigh", 4.f, "High cut on TPC chi2"}; + Configurable settingCutChi2NClITS{"settingCutChi2NClITS", 36.f, "Maximum ITS Chi2 for tracks"}; + // Hadron purity and PID cuts Configurable settingCutHadptMin{"settingCutHadptMin", 0.14f, "Minimum PT cut on Had"}; Configurable settingCutHadptMax{"settingCutHadptMax", 4.0f, "Maximum PT cut on Had"}; - Configurable settingCutDeptMin{"settingCutDeptMin", 0.6f, "Minimum PT cut on De"}; - Configurable settingCutDeptMax{"settingCutDeptMax", 1.6f, "Maximum PT cut on De"}; Configurable settingCutHadDCAxyMin{"settingCutHadDCAxyMin", 0.3f, "DCAxy Min for Had"}; Configurable settingCutHadDCAzMin{"settingCutHadDCAzMin", 0.3f, "DCAz Min for Had"}; - Configurable settingCutDeDCAzMin{"settingCutDeDCAzMin", 0.2f, "DCAxy Min for De"}; + Configurable settingCutPinMinTOFHad{"settingCutPinMinTOFHad", 0.5f, "Minimum Pin to apply the TOF cut on hadrons"}; + Configurable settingCutNsigmaTPCHad{"settingCutNsigmaTPCHad", 3.0f, "Value of the TPC Nsigma cut on Had"}; + Configurable settingCutNsigmaTOFHad{"settingCutNsigmaTOFHad", 3.0f, "Value of the hsdron TOF Nsigma cut"}; + Configurable settingCutNsigmaTOFTPCHad{"settingCutNsigmaTOFTPCHad", 3.0f, "Value of the hsdron TOF TPC combNsigma cut"}; Configurable settingCutNsigTPCPrMin{"settingCutNsigTPCPrMin", 3.0f, "Minimum TPC Pr Nsigma cut for rejection"}; Configurable settingCutNsigTPCPiMin{"settingCutNsigTPCPiMin", 3.0f, "Minimum TPC Pi Nsigma cut for rejection"}; Configurable settingCutNsigTOFPrMin{"settingCutNsigTOFPrMin", 3.0f, "Minimum TOF Pr Nsigma cut for rejection"}; Configurable settingCutNsigTOFPiMin{"settingCutNsigTOFPiMin", 3.0f, "Minimum TOF Pi Nsigma cut for rejection"}; - - Configurable settingSaveUSandLS{"settingSaveUSandLS", true, "Save All Pairs"}; + // Deuteron purity and PID cuts + Configurable settingCutPinMinDe{"settingCutPinMinDe", 0.0f, "Minimum Pin for De"}; + Configurable settingCutClSizeItsDe{"settingCutClSizeItsDe", 4.0f, "Minimum ITS cluster size for De"}; + Configurable settingCutDeptMin{"settingCutDeptMin", 0.6f, "Minimum PT cut on De"}; + Configurable settingCutDeptMax{"settingCutDeptMax", 1.6f, "Maximum PT cut on De"}; + Configurable settingCutDeDCAzMin{"settingCutDeDCAzMin", 0.2f, "DCAxy Min for De"}; + Configurable settingCutPinMinTOFITSDe{"settingCutPinMinTOFITSDe", 1.2f, "Minimum p to apply the TOF ITS cut on De"}; + Configurable settingCutNsigmaTPCDe{"settingCutNsigmaTPCDe", 2.5f, "Value of the TPC Nsigma cut on De"}; + Configurable settingCutNsigmaITSDe{"settingCutNsigmaITSDe", 2.5f, "Value of the ITD Nsigma cut on De"}; + Configurable settingCutNsigmaTOFTPCDe{"settingCutNsigmaTOFTPCDe", 2.5f, "Value of the De TOF TPC combNsigma cut"}; + // Hypertriton-specific cuts + Configurable settingCutTPCChi2He{"settingCutTPCChi2He", 0.0f, "Minimum tpcChi2He for Hyper He3"}; + Configurable settingCutAverClsSizeHe{"settingCutAverClsSizeHe", 0.0f, "Minimum averClusSizeHe for Hyper He3"}; + // Output and QA controls + Configurable settingFillTable{"settingFillTable", false, "Enable table filling"}; Configurable settingFillMultiplicity{"settingFillMultiplicity", false, "Fill multiplicity table"}; Configurable settingUseBBcomputeDeNsigma{"settingUseBBcomputeDeNsigma", false, "Use BB params to compute De TPC Nsigma"}; - // Zorro Configurable settingSkimmedProcessing{"settingSkimmedProcessing", false, "Skimmed dataset processing"}; - // CCDB options Configurable settingDbz{"settingDbz", -999, "bz field, -999 is automatic"}; Configurable settingCcdburl{"settingCcdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -237,7 +233,6 @@ struct HadNucleiFemto { // Pair hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache}; std::array mBBparamsDe; - std::vector mRecoCollisionIDs; std::vector mGoodCollisions; std::vector mTrackPairs; @@ -252,68 +247,89 @@ struct HadNucleiFemto { HistogramRegistry mQaRegistry{ "QA", - {{"hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}}, + {// Event-level + {"hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}}, {"hNcontributor", "Number of primary vertex contributor", {HistType::kTH1F, {{2000, 0.0f, 2000.0f}}}}, {"hCentrality", "Centrality", {HistType::kTH1F, {{100, 0.0f, 100.0f}}}}, - {"hTrackSel", "Accepted tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast(Selections::kAll) - 0.5}}}}, {"hSkipReasons", "Why storedEvent skipped;Reason;Counts", {HistType::kTH1F, {{5, -0.5, 4.5}}}}, {"hEvents", "; Events;", {HistType::kTH1F, {{3, -0.5, 2.5}}}}, {"hEmptyPool", "svPoolCreator did not find track pairs false/true", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, + + // Candidate topology and kinematics + {"hTrackSel", "Accepted tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast(Selections::kAll) - 0.5}}}}, + {"hdcaxyNu", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hdcazNu", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, - {"hdcaxyHad", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, - {"hdcazHad", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hdcazNu_min", ";DCA_{z}-min (cm)", {HistType::kTH1F, {{20, -1.0f, 1.0f}}}}, {"hNClsNuITS", ";N_{ITS} Cluster", {HistType::kTH1F, {{20, -10.0f, 10.0f}}}}, - {"hNClsHadITS", ";N_{ITS} Cluster", {HistType::kTH1F, {{20, -10.0f, 10.0f}}}}, - {"hNuHadtInvMass", "; M(Nu + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{300, 3.74f, 4.34f}}}}, {"hNuPt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, - {"hHadPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"hSingleNuPt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, {"hNuPin", "#it{p} distribution; #it{p} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, - {"hHadPin", "P distribution; #it{p} (GeV/#it{c})", {HistType::kTH1F, {{120, -4.0f, 4.0f}}}}, {"hSingleNuPin", "#it{p} distribution; #it{p} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, - - {"hHe3TPCnsigma", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(He3)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {200, -5.0f, 5.0f}}}}, - {"hHe3P", "Pin distribution; p (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, - {"hHe3P_preselected", "Pin distribution_preselected; p (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"hNuEta", "eta distribution; #eta(Nu)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, - {"hHadEta", "eta distribution; #eta(had)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hNuPhi", "phi distribution; phi(Nu)", {HistType::kTH1F, {{600, -4.0f, 4.0f}}}}, + + {"hdcaxyHad", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, + {"hdcazHad", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, + {"hNClsHadITS", ";N_{ITS} Cluster", {HistType::kTH1F, {{20, -10.0f, 10.0f}}}}, + {"hHadPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, + {"hSingleHadPt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, + {"hHadPin", "P distribution; #it{p} (GeV/#it{c})", {HistType::kTH1F, {{120, -4.0f, 4.0f}}}}, + {"hHadEta", "eta distribution; #eta(had)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hHadPhi", "phi distribution; phi(had)", {HistType::kTH1F, {{600, -4.0f, 4.0f}}}}, + + // dE/dx {"h2dEdxNucandidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}}, {"h2dEdxHadcandidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}}, {"h2dEdx", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}}, + + // Deuteron PID {"h2NsigmaNuTPC", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {200, -5.0f, 5.0f}}}}, {"h2NsigmaNuComb", "NsigmaNu TPCTOF comb distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{comb}(Nu)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {100, 0.0f, 5.0f}}}}, - {"h2NsigmaHadComb", "NsigmaHad TPCTOF comb distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{comb}(had)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {100, 0.0f, 5.0f}}}}, {"h2NsigmaNuTPC_preselection", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, {"h2NsigmaNuTPC_preselecComp", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, {"h2NSigmaNuITS_preselection", "NsigmaNu ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} Nu", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}}}}, {"h2NSigmaNuITS", "NsigmaNu ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} Nu", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {120, -3.0f, 3.0f}}}}, + {"h2NsigmaNuTOF", "NsigmaNu TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(Nu)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaNuTOF_preselection", "NsigmaNu TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + + // Hadron PID + {"h2NsigmaHadComb", "NsigmaHad TPCTOF comb distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{comb}(had)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {100, 0.0f, 5.0f}}}}, {"h2NsigmaHadTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, {"h2NsigmaHadTPC_preselection", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, {"h2NsigmaHadTOF", "NsigmaHad TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaNuTOF", "NsigmaNu TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(Nu)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, {"h2NsigmaHadTOF_preselection", "NsigmaHad TOF distribution; #iit{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, - {"hkStaVsmTVsCent_LS_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2});Centrality", {HistType::kTH3F, {{300, 0.0f, 3.0f}, {100, 0.2, 3.2}, {100, 0.0f, 100.0f}}}}, - {"hkStaVsmTVsCent_LS_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2});Centrality", {HistType::kTH3F, {{300, 0.0f, 3.0f}, {100, 0.2, 3.2}, {100, 0.0f, 100.0f}}}}, - {"hkStaVsmTVsCent_US_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2});Centrality", {HistType::kTH3F, {{300, 0.0f, 3.0f}, {100, 0.2, 3.2}, {100, 0.0f, 100.0f}}}}, - {"hkStaVsmTVsCent_US_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2});Centrality", {HistType::kTH3F, {{300, 0.0f, 3.0f}, {100, 0.2, 3.2}, {100, 0.0f, 100.0f}}}}, - {"hkStaVsmT_LS_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, - {"hkStaVsmT_LS_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, - {"hkStaVsmT_US_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, - {"hkStaVsmT_US_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, + {"h2NsigmaHadPrTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadPiTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(pi)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadPrTOF", "NsigmaHad TOF distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadPiTOF", "NsigmaHad TOF distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(pi)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, + + // Purity + {"purity/h2NsigmaNuTPC_preselection", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"purity/h2NsigmaNuTPC_preselecComp", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"purity/h2NSigmaNuITS_preselection", "NsigmaNu ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} Nu", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}}}}, + {"purity/h2NsigmaNuTOF_preselection", "NsigmaNu TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"purity/h2NsigmaHadTPC_preselection", "NsigmaNu TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(Nu)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"purity/h2NsigmaHadTOF_preselection", "NsigmaHad TOF distribution; #iit{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + // Hypertriton + {"hHe3TPCnsigma", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(He3)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {200, -5.0f, 5.0f}}}}, + {"hHe3P", "Pin distribution; p (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, + {"hHe3P_preselected", "Pin distribution_preselected; p (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"hNHypsPerPrevColl", "Number of V0Hypers in previous collision used for mixing;N_{V0Hypers};Entries", {HistType::kTH2F, {{4000, 0.0f, 4000.0f}, {50, -0.5, 49.5}}}}, + + // Correlation observables {"hkStar_LS_M", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}}, {"hkStar_LS_A", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}}, {"hkStar_US_M", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}}, {"hkStar_US_A", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}}, - {"h2NsigmaHadPrTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadPiTPC", "NsigmaHad TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(pi)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadPrTOF", "NsigmaHad TOF distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadPiTOF", "NsigmaHad TOF distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(pi)", {HistType::kTH1F, {{200, -5.0f, 5.0f}}}}, + {"hkStaVsmT_LS_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, + {"hkStaVsmT_LS_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, + {"hkStaVsmT_US_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, + {"hkStaVsmT_US_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2})", {HistType::kTH2F, {{300, 0.0f, 3.0f}, {2000, 0.8, 2.0}}}}, + {"hNuHadtInvMass", "; M(Nu + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{300, 3.74f, 4.34f}}}}, + + // Mixed-event {"hisBkgEM", "; isBkgEM;", {HistType::kTH1F, {{3, -1, 2}}}}}, OutputObjHandlingPolicy::AnalysisObject, false, @@ -501,12 +517,12 @@ struct HadNucleiFemto { template bool selectionPIDKaon(const Ttrack& candidate) { + auto tpcNSigmaKa = candidate.tpcNSigmaKa(); float DeDCAxyMin = 0.004 + (0.013 / candidate.pt()); float DeDCAzMin = 0.004 + (0.013 / candidate.pt()); - if (abs(candidate.dcaXY()) > DeDCAxyMin || abs(candidate.dcaZ()) > DeDCAzMin) + if (std::abs(candidate.dcaXY()) > DeDCAxyMin || std::abs(candidate.dcaZ()) > DeDCAzMin) return false; - auto tpcNSigmaKa = candidate.tpcNSigmaKa(); mQaRegistry.fill(HIST("h2NsigmaHadTPC_preselection"), candidate.tpcInnerParam(), tpcNSigmaKa); if (std::abs(candidate.pt()) < settingCutHadptMin || std::abs(candidate.pt()) > settingCutHadptMax) return false; @@ -552,13 +568,11 @@ struct HadNucleiFemto { template bool selectionPIDPion(const Ttrack& candidate) { - if (candidate.tpcChi2NCl() > settingCutChi2tpcHighPion || candidate.tpcChi2NCl() < settingCutChi2tpcLowPion || candidate.itsChi2NCl() > settingCutChi2NClITSPion) - return false; - if (abs(candidate.dcaXY()) > settingCutHadDCAxyMin || abs(candidate.dcaZ()) > settingCutHadDCAzMin) + if (std::abs(candidate.dcaXY()) > settingCutHadDCAxyMin || std::abs(candidate.dcaZ()) > settingCutHadDCAzMin) return false; auto tpcNSigmaPi = candidate.tpcNSigmaPi(); - mQaRegistry.fill(HIST("h2NsigmaHadTPC_preselection"), candidate.tpcInnerParam(), tpcNSigmaPi); + mQaRegistry.fill(HIST("h2NsigmaHadTPC_preselection"), candidate.sign() * candidate.tpcInnerParam(), tpcNSigmaPi); if (std::abs(candidate.pt()) < settingCutHadptMin || std::abs(candidate.pt()) > settingCutHadptMax) return false; // reject protons @@ -574,9 +588,6 @@ struct HadNucleiFemto { auto combNsigma = std::sqrt(tofNSigmaPi * tofNSigmaPi + tpcNSigmaPi * tpcNSigmaPi); mQaRegistry.fill(HIST("h2NsigmaHadTOF_preselection"), candidate.pt(), tofNSigmaPi); - // if (combNsigma > settingCutNsigmaTOFTPCHad) { - // return false; - // } if (std::abs(tofNSigmaPi) > settingCutNsigmaTOFHad) { return false; } @@ -630,7 +641,7 @@ struct HadNucleiFemto { mQaRegistry.fill(HIST("h2dEdx"), candidate.sign() * tpcInnerParam, candidate.tpcSignal()); float DeDCAxyMin = 0.015 + 0.0305 / TMath::Power(candidate.pt(), 1.1); - if (abs(candidate.dcaXY()) > DeDCAxyMin || abs(candidate.dcaXY()) > settingCutDeDCAzMin) + if (std::abs(candidate.dcaXY()) > DeDCAxyMin || std::abs(candidate.dcaZ()) > settingCutDeDCAzMin) return false; if (std::abs(tpcInnerParam) < settingCutPinMinDe) { @@ -650,6 +661,7 @@ struct HadNucleiFemto { if (candidate.hasTOF() && candidate.tpcInnerParam() > settingCutPinMinTOFITSDe) { auto tofNSigmaDe = candidate.tofNSigmaDe(); auto combNsigma = std::sqrt(tofNSigmaDe * tofNSigmaDe + tpcNSigmaDe * tpcNSigmaDe); + mQaRegistry.fill(HIST("h2NsigmaNuTOF_preselection"), candidate.sign() * candidate.pt(), tofNSigmaDe); if (combNsigma > settingCutNsigmaTOFTPCDe) { return false; } @@ -670,7 +682,6 @@ struct HadNucleiFemto { } mQaRegistry.fill(HIST("h2NsigmaNuTPC"), candidate.sign() * candidate.pt(), tpcNSigmaDe); mQaRegistry.fill(HIST("h2NSigmaNuITS"), candidate.sign() * candidate.pt(), itsnSigmaDe); - // mQaRegistry.fill(HIST("h2NsigmaNuComb"), candidate.sign() * candidate.pt(), combNsigma); mQaRegistry.fill(HIST("h2dEdxNucandidates"), candidate.sign() * tpcInnerParam, candidate.tpcSignal()); return true; } @@ -765,15 +776,6 @@ struct HadNucleiFemto { hadNucand.momHad = std::array{trackHad.px(), trackHad.py(), trackHad.pz()}; float invMass = 0; invMass = RecoDecay::m(std::array, 2>{hadNucand.momNu, hadNucand.momHad}, std::array{static_cast(o2::constants::physics::MassDeuteron), MassHad}); - if (settingCutInvMass > 0 && invMass > settingCutInvMass) { - mQaRegistry.fill(HIST("hSkipReasons"), 3); - return false; - } - float ptDeHad = std::hypot(hadNucand.momNu[0] + hadNucand.momHad[0], hadNucand.momNu[1] + hadNucand.momHad[1]); - if (ptDeHad < settingCutPtMinDePi) { - mQaRegistry.fill(HIST("hSkipReasons"), 4); - return false; - } hadNucand.signNu = trackDe.sign(); hadNucand.signHad = trackHad.sign(); @@ -791,7 +793,7 @@ struct HadNucleiFemto { hadNucand.nTPCClustersNu = trackDe.tpcNClsFound(); hadNucand.nSigmaNu = computeNSigmaDe(trackDe); - hadNucand.nSigmaHad = trackHad.tpcNSigmaPi(); + // hadNucand.nSigmaHad = trackHad.tpcNSigmaPi(); hadNucand.chi2TPCNu = trackDe.tpcChi2NCl(); hadNucand.chi2TPCHad = trackHad.tpcChi2NCl(); @@ -862,9 +864,6 @@ struct HadNucleiFemto { float invMass = 0; invMass = RecoDecay::m(std::array, 2>{hadHypercand.momNu, hadHypercand.momHad}, std::array{static_cast(o2::constants::physics::MassHelium3), MassHad}); - if (settingCutInvMass > 0 && invMass > settingCutInvMass) { - return false; - } hadHypercand.signHad = trackHad.sign(); if (V0Hyper.isMatter()) { @@ -1104,33 +1103,29 @@ struct HadNucleiFemto { mQaRegistry.fill(HIST("hdcazNu"), hadNucand.dcazNu); mQaRegistry.fill(HIST("hdcaxyHad"), hadNucand.dcaxyHad); mQaRegistry.fill(HIST("hdcazHad"), hadNucand.dcazHad); - mQaRegistry.fill(HIST("hdcazNu_min"), (abs(hadNucand.dcazNu) - settingCutDeDCAzMin)); + mQaRegistry.fill(HIST("hdcazNu_min"), (std::abs(hadNucand.dcazNu) - settingCutDeDCAzMin)); mQaRegistry.fill(HIST("hNClsNuITS"), hadNucand.nClsItsNu); mQaRegistry.fill(HIST("hNClsHadITS"), hadNucand.nClsItsHad); mQaRegistry.fill(HIST("hisBkgEM"), hadNucand.isBkgEM); } template - void fillKstar(const HadNucandidate& hadNucand, const Tcoll& collision) + void fillKstar(const HadNucandidate& hadNucand, const Tcoll& /*collision*/) { if (hadNucand.isBkgUS == 0) { if (hadNucand.recoPtNu() > 0) { mQaRegistry.fill(HIST("hkStar_LS_M"), hadNucand.kstar); - mQaRegistry.fill(HIST("hkStaVsmTVsCent_LS_M"), hadNucand.kstar, hadNucand.mT, collision.centFT0C()); mQaRegistry.fill(HIST("hkStaVsmT_LS_M"), hadNucand.kstar, hadNucand.mT); } else { mQaRegistry.fill(HIST("hkStar_LS_A"), hadNucand.kstar); - mQaRegistry.fill(HIST("hkStaVsmTVsCent_LS_A"), hadNucand.kstar, hadNucand.mT, collision.centFT0C()); mQaRegistry.fill(HIST("hkStaVsmT_LS_A"), hadNucand.kstar, hadNucand.mT); } } else { if (hadNucand.recoPtNu() > 0) { mQaRegistry.fill(HIST("hkStar_US_M"), hadNucand.kstar); - mQaRegistry.fill(HIST("hkStaVsmTVsCent_US_M"), hadNucand.kstar, hadNucand.mT, collision.centFT0C()); mQaRegistry.fill(HIST("hkStaVsmT_US_M"), hadNucand.kstar, hadNucand.mT); } else { mQaRegistry.fill(HIST("hkStar_US_A"), hadNucand.kstar); - mQaRegistry.fill(HIST("hkStaVsmTVsCent_US_A"), hadNucand.kstar, hadNucand.mT, collision.centFT0C()); mQaRegistry.fill(HIST("hkStaVsmT_US_A"), hadNucand.kstar, hadNucand.mT); } } @@ -1358,6 +1353,74 @@ PROCESS_SWITCH(HadNucleiFemto, processMixedEventHyper, "Process Mixed event", fa fillPairsHyper(collisions, hadtracks, V0Hypers, /*isMixedEvent*/ true); } PROCESS_SWITCH(HadNucleiFemto, processMixedEventHyperPool, "Process Mixed event", false); + + void processPurity(const CollisionsFull& collisions, const TrackCandidates& tracks, const aod::BCsWithTimestamps& bcs) + { + o2::aod::ITSResponse itsResponse; + + for (const auto& collision : collisions) { + if (!selectCollision(collision, bcs)) { + continue; + } + + const uint64_t collIdx = collision.globalIndex(); + auto trackTableThisCollision = tracks.sliceBy(mPerCol, collIdx); + trackTableThisCollision.bindExternalIndices(&tracks); + + for (const auto& track : trackTableThisCollision) { + mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts); + + if (!selectTrack(track)) { + continue; + } + mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts); + + if (settingHadPDGCode == PDG_t::kPiPlus) { + const float tpcNSigmaHad = track.tpcNSigmaPi(); + mQaRegistry.fill(HIST("purity/h2NsigmaHadTPC_preselection"), track.sign() * track.pt(), tpcNSigmaHad); + if (track.hasTOF() && track.tpcInnerParam() >= settingCutPinMinTOFHad) { + const float tofNSigmaHad = track.tofNSigmaPi(); + mQaRegistry.fill(HIST("purity/h2NsigmaHadTOF_preselection"), track.sign() * track.pt(), tofNSigmaHad); + } + } else if (settingHadPDGCode == PDG_t::kKPlus) { + const float tpcNSigmaHad = track.tpcNSigmaKa(); + mQaRegistry.fill(HIST("purity/h2NsigmaHadTPC_preselection"), track.sign() * track.pt(), tpcNSigmaHad); + if (track.hasTOF() && track.tpcInnerParam() >= settingCutPinMinTOFHad) { + const float tofNSigmaHad = track.tofNSigmaKa(); + mQaRegistry.fill(HIST("purity/h2NsigmaHadTOF_preselection"), track.sign() * track.pt(), tofNSigmaHad); + } + } + + const float tpcNSigmaDe = settingUseBBcomputeDeNsigma ? computeNSigmaDe(track) : track.tpcNSigmaDe(); + mQaRegistry.fill(HIST("purity/h2NsigmaNuTPC_preselection"), track.sign() * track.pt(), tpcNSigmaDe); + mQaRegistry.fill(HIST("purity/h2NsigmaNuTPC_preselecComp"), track.sign() * track.pt(), track.tpcNSigmaDe()); + if (track.hasTOF() && track.tpcInnerParam() > settingCutPinMinTOFITSDe) { + const float tofNSigmaDe = track.tofNSigmaDe(); + mQaRegistry.fill(HIST("purity/h2NsigmaNuTOF_preselection"), track.sign() * track.pt(), tofNSigmaDe); + } else if (track.tpcInnerParam() <= settingCutPinMinTOFITSDe) { + const float itsNSigmaDe = itsResponse.nSigmaITS(track.itsClusterSizes(), track.p(), track.eta()); + mQaRegistry.fill(HIST("purity/h2NSigmaNuITS_preselection"), track.sign() * track.pt(), itsNSigmaDe); + } + + const bool isHadronSelected = selectionPIDHadron(track); + const bool isDeuteronSelected = selectionPIDDe(track); + if (!isHadronSelected && !isDeuteronSelected) { + continue; + } + mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID); + + if (isHadronSelected) { + mQaRegistry.fill(HIST("hSingleHadPt"), track.pt() * track.sign()); + } + + if (isDeuteronSelected) { + mQaRegistry.fill(HIST("hSingleNuPt"), track.pt() * track.sign()); + mQaRegistry.fill(HIST("hSingleNuPin"), track.tpcInnerParam() * track.sign()); + } + } + } + } + PROCESS_SWITCH(HadNucleiFemto, processPurity, "Process for pion and deuteron purity QA", false); }; WorkflowSpec defineDataProcessing(const ConfigContext& cfgc) From cfb19f2bd3fca7a0e2297db7657fb0ff9cd9ccde Mon Sep 17 00:00:00 2001 From: Rocco Liotino Date: Thu, 9 Apr 2026 10:59:41 +0200 Subject: [PATCH 209/282] [DPG] Fix chamber and cluster charge (#15684) --- .../AOTTrack/PID/HMPID/hmpidTableProducer.cxx | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx index e7cb03e25be..3c589016874 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx @@ -11,26 +11,32 @@ #include "tableHMPID.h" +#include "Common/Core/PID/PIDTOF.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/TableProducer/PID/pidTOFBase.h" -#include +#include "CCDB/BasicCCDBManager.h" +#include "CCDB/CcdbApi.h" #include +#include #include -#include #include -#include #include -#include -#include -#include +#include #include +#include +#include +#include +#include + +#include -#include #include #include @@ -135,6 +141,10 @@ struct HmpidTableProducer { float centrality = col.centFV0A(); + // check cluster size sign + if (t.hmpidClusSize() <= 0) + continue; + float hmpidPhotsCharge2[o2::aod::kDimPhotonsCharge]; for (int i = 0; i < o2::aod::kDimPhotonsCharge; i++) { From ddf163bc2e3af5a414b944335d783c9162c8a9df Mon Sep 17 00:00:00 2001 From: ffionda <33261977+ffionda@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:50:22 +0200 Subject: [PATCH 210/282] [PWGDQ] add decay length related variables for MCtruth pairs (#15634) Co-authored-by: ALICE Action Bot --- PWGDQ/Core/VarManager.h | 33 ++++++++++++++++++++++++++ PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 14 +++++++++++ 2 files changed, 47 insertions(+) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 6733583a21d..3129822100f 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -1330,6 +1330,8 @@ class VarManager : public TObject static void FillTrackCollision(T const& track, C const& collision, float* values = nullptr); template static void FillTrackCollisionMC(T1 const& track, T2 const& MotherTrack, C const& collision, float* values = nullptr); + template + static void FillTrackCollisionMC(T1 const& track, const std::array& collPos, float massHyp = -1., float* values = nullptr); template static void FillTrackCollisionMatCorr(T const& track, C const& collision, M const& materialCorr, P const& propagator, float* values = nullptr); template @@ -3304,6 +3306,37 @@ void VarManager::FillTrackCollisionMC(T1 const& track, T2 const& MotherTrack, C values[kMCVertexingTauxyzProjected] = values[kMCVertexingLxyzProjected] * m / (MotherTrack.p()); } +template +void VarManager::FillTrackCollisionMC(T1 const& track, const std::array& collPos, float massHyp, float* values) +{ + + if (!values) { + values = fgValues; + } + + float m = o2::constants::physics::MassJPsi; + if (massHyp) + m = massHyp; + + // displaced vertex is computed with decay product (track) and vertex collPos + values[kMCVertexingLxy] = (collPos[0] - track.vx()) * (collPos[0] - track.vx()) + + (collPos[1] - track.vy()) * (collPos[1] - track.vy()); + values[kMCVertexingLz] = (collPos[2] - track.vz()) * (collPos[2] - track.vz()); + values[kMCVertexingLxyz] = values[kMCVertexingLxy] + values[kMCVertexingLz]; + values[kMCVertexingLxy] = std::sqrt(values[kMCVertexingLxy]); + values[kMCVertexingLz] = std::sqrt(values[kMCVertexingLz]); + values[kMCVertexingLxyz] = std::sqrt(values[kMCVertexingLxyz]); + values[kMCVertexingTauz] = (collPos[2] - track.vz()) * m / (TMath::Abs(track.pz()) * o2::constants::physics::LightSpeedCm2NS); + values[kMCVertexingTauxy] = values[kMCVertexingLxy] * m / (track.pt() * o2::constants::physics::LightSpeedCm2NS); + + values[kMCVertexingLzProjected] = ((track.vz() - collPos[2]) * track.pz()) / TMath::Abs(track.pz()); + values[kMCVertexingLxyProjected] = (((track.vx() - collPos[0]) * track.px()) + ((track.vy() - collPos[1]) * track.py())) / TMath::Abs(track.pt()); + values[kMCVertexingLxyzProjected] = (((track.vx() - collPos[0]) * track.px()) + ((track.vy() - collPos[1]) * track.py()) + ((track.vz() - collPos[2]) * track.pz())) / track.p(); + values[kMCVertexingTauxyProjected] = values[kMCVertexingLxyProjected] * m / (track.pt()); + values[kMCVertexingTauzProjected] = values[kMCVertexingLzProjected] * m / TMath::Abs(track.pz()); + values[kMCVertexingTauxyzProjected] = values[kMCVertexingLxyzProjected] * m / (track.p()); +} + template void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values, float Translow, float Transhigh) { diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 62d9bc01b32..578e161bcdd 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -1397,6 +1398,9 @@ struct AnalysisSameEventPairing { Service fCCDB; + // PDG database + Service pdgDB; + // Filter filterEventSelected = aod::dqanalysisflags::isEventSelected & uint32_t(1); Filter eventFilter = aod::dqanalysisflags::isEventSelected > static_cast(0); @@ -2275,6 +2279,16 @@ struct AnalysisSameEventPairing { // cout << " Signal matched!" << endl; mcDecision |= (static_cast(1) << isig); VarManager::FillPairMC(t1_raw, t2_raw); + // check if t1_raw and t2_raw have same mother to compute decay length related variables + if (t1_raw.has_mothers() && t2_raw.has_mothers()) { + auto motherMCParticle_t1 = t1_raw.template mothers_first_as(); + auto motherMCParticle_t2 = t2_raw.template mothers_first_as(); + if (motherMCParticle_t1 == motherMCParticle_t2) { + auto mcEvent = mcEvents.rawIteratorAt(motherMCParticle_t1.reducedMCeventId()); + std::array collVtxPos = {mcEvent.mcPosX(), mcEvent.mcPosY(), mcEvent.mcPosZ()}; + VarManager::FillTrackCollisionMC(motherMCParticle_t1, collVtxPos, pdgDB->Mass(motherMCParticle_t1.pdgCode())); + } + } // cout << " Filled VarManager for the pair." << endl; fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues); fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s", sig->GetName()), VarManager::fgValues); From af24d0186c0948b60c0db9af5dcac3534b89af46 Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:57:55 +0200 Subject: [PATCH 211/282] [PWGDQ] Adding q-vector to table-maker (#15693) Co-authored-by: Lucamicheletti93 --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 3a32c5ca24a..a857be78aa8 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -38,6 +38,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" @@ -129,6 +130,7 @@ using MyEventsWithMultsAndRapidityGapFilter = soa::Join; using MyEventsWithCentAndMults = soa::Join; using MyEventsWithMultsExtra = soa::Join; +using MyEventsWithCentAndMultsQvect = soa::Join; using MyMuons = soa::Join; using MyMuonsWithCov = soa::Join; using MyMuonsRealignWithCov = soa::Join; @@ -149,6 +151,7 @@ constexpr static uint32_t gkEventFillMapWithMultsEventFilterZdc = VarManager::Ob constexpr static uint32_t gkEventFillMapWithMultsRapidityGapFilterZdcFit = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult | VarManager::ObjTypes::CollisionMultExtra | VarManager::ObjTypes::RapidityGapFilter | VarManager::ObjTypes::Zdc | VarManager::ObjTypes::Fit; // constexpr static uint32_t gkEventFillMapWithCent = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent; constexpr static uint32_t gkEventFillMapWithCentAndMults = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent | VarManager::CollisionMult | VarManager::ObjTypes::CollisionMultExtra; +constexpr static uint32_t gkEventFillMapWithCentAndMultsQvect = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent | VarManager::CollisionMult | VarManager::ObjTypes::CollisionMultExtra | VarManager::ObjTypes::CollisionQvectCentr; constexpr static uint32_t gkEventFillMapWithMultsExtra = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::CollisionMult | VarManager::ObjTypes::CollisionMultExtra; // constexpr static uint32_t gkEventFillMapWithCentRun2 = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCentRun2; // Unused variable // constexpr static uint32_t gkTrackFillMap = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackPID | VarManager::ObjTypes::TrackPIDExtra; @@ -183,6 +186,8 @@ struct TableMaker { Produces eventExtended; Produces eventVtxCov; Produces eventInfo; + Produces eventQvectorCentr; + Produces eventQvectorCentrExtra; Produces zdc; Produces fit; Produces multPV; @@ -467,7 +472,7 @@ struct TableMaker { context.mOptions.get("processPbPbWithFilterBarrelOnly") || context.mOptions.get("processPPBarrelOnlyWithV0s") || context.mOptions.get("processPbPbBarrelOnlyNoTOF"); bool enableMuonHistos = (context.mOptions.get("processPPWithFilter") || context.mOptions.get("processPPWithFilterMuonOnly") || context.mOptions.get("processPPWithFilterMuonMFT") || context.mOptions.get("processPPMuonOnly") || context.mOptions.get("processPPRealignedMuonOnly") || context.mOptions.get("processPPMuonMFT") || context.mOptions.get("processPPMuonMFTWithMultsExtra") || - context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbMuonOnly") || context.mOptions.get("processPbPbRealignedMuonOnly") || context.mOptions.get("processPbPbMuonMFT")); + context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbMuonOnly") || context.mOptions.get("processPbPbMuonOnlyWithQvect") || context.mOptions.get("processPbPbRealignedMuonOnly") || context.mOptions.get("processPbPbMuonMFT")); if (enableBarrelHistos) { // Barrel track histograms, before selections @@ -1053,6 +1058,9 @@ struct TableMaker { VarManager::ResetValues(0, VarManager::kNEventWiseVariables); VarManager::FillBC(bc); VarManager::FillEvent(collision); // extract event information and place it in the fValues array + if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionQvectCentr) > 0) { + VarManager::FillQVectorFromCentralFW(collision); + } if constexpr ((TEventFillMap & VarManager::ObjTypes::Zdc) > 0) { if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) { // The DQRapidityGapFilter contains the index of the bc we want to get ZDC info from @@ -1168,6 +1176,13 @@ struct TableMaker { multTPC, multFV0A, multFV0C, multFT0A, multFT0C, multFDDA, multFDDC, multZNA, multZNC, multTracklets, multTracksPV, centFT0C, centFT0A, centFT0M); eventVtxCov(collision.covXX(), collision.covXY(), collision.covXZ(), collision.covYY(), collision.covYZ(), collision.covZZ(), collision.chi2()); eventInfo(collision.globalIndex()); + + if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionQvectCentr) > 0) { + eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(), + collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg()); + eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall()); + } + if constexpr ((TEventFillMap & VarManager::ObjTypes::Zdc) > 0) { if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) { // The DQRapidityGapFilter contains the index of the bc we want to get ZDC info from @@ -1958,6 +1973,13 @@ struct TableMaker { fullSkimming(collisions, bcs, nullptr, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr, nullptr, ft0s, fv0as, fdds); } + // produce the muon only DQ skimmed data model typically for Pb-Pb (with centrality and flow), no subscribtion to the DQ event filter + void processPbPbMuonOnlyWithQvect(MyEventsWithCentAndMultsQvect const& collisions, MyBCs const& bcs, + MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + { + fullSkimming(collisions, bcs, nullptr, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr, nullptr, ft0s, fv0as, fdds); + } + // produce the realigned muon only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPbRealignedMuonOnly(MyEventsWithCentAndMults const& collisions, MyBCs const& bcs, MyMuonsRealignWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs) @@ -2010,6 +2032,7 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processPbPbBarrelOnlyWithV0Bits, "Build barrel only DQ skimmed data model typically for Pb-Pb, w/ V0 bits, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbBarrelOnlyWithV0BitsNoTOF, "Build barrel only DQ skimmed data model typically for Pb-Pb, w/ V0 bits, no TOF, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbMuonOnly, "Build muon only DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); + PROCESS_SWITCH(TableMaker, processPbPbMuonOnlyWithQvect, "Build muon only DQ skimmed data model for Pb-Pb, with event properties and flow", false); PROCESS_SWITCH(TableMaker, processPbPbRealignedMuonOnly, "Build realigned muon only DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbMuonMFT, "Build muon + mft DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processOnlyBCs, "Analyze the BCs to store sampled lumi", false); From 1afa02f3e4e20f9647cc355a444a2b4307953254 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 9 Apr 2026 12:02:16 +0200 Subject: [PATCH 212/282] [PWGEM/Dilepton] add option for vn{EP} (#15694) --- PWGEM/Dilepton/Core/Dilepton.h | 77 +++++++++++++++++++++----- PWGEM/Dilepton/Utils/EventHistograms.h | 64 ++++++++++++++++++++- PWGEM/Dilepton/Utils/PairUtilities.h | 6 +- 3 files changed, 129 insertions(+), 18 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index b5ba7dad68e..d9c4c3cf9b0 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -114,9 +114,10 @@ struct Dilepton { o2::framework::Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; o2::framework::Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; - o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5, kBootstrapv2:6"}; + o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2SP:2, kFlowV3SP:3, kPolarization:4, kHFll:5, kBootstrapv2:6, kFlowV2EP:7, kFlowV3EP:8"}; o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgEPEstimator{"cfgEPEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; @@ -619,7 +620,7 @@ struct Dilepton { } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kUPC)) { const o2::framework::AxisSpec axis_aco{10, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; const o2::framework::AxisSpec axis_asym_pt{10, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; - const o2::framework::AxisSpec axis_dphi_e_ee{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; + const o2::framework::AxisSpec axis_dphi_l_ll{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -630,14 +631,14 @@ struct Dilepton { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_cos_theta}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_l_ll, axis_cos_theta}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3)) { - if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2)) { + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2SP) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3SP)) { + if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2SP)) { nmod = 2; - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3)) { + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3SP)) { nmod = 3; } @@ -670,9 +671,9 @@ struct Dilepton { fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kHFll)) { - const o2::framework::AxisSpec axis_dphi_ee{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll - const o2::framework::AxisSpec axis_deta_ee{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ee, axis_deta_ee}, true); + const o2::framework::AxisSpec axis_dphi_ll{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll + const o2::framework::AxisSpec axis_deta_ll{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ll, axis_deta_ll}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -687,6 +688,23 @@ struct Dilepton { fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistogramsBootstrap(&fRegistry, cfgNumBootstrapSamples); + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2EP) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3EP)) { + if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2EP)) { + nmod = 2; + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3EP)) { + nmod = 3; + } + + // similar to Eq.1 in PRL 126, 162001 (2021) + const o2::framework::AxisSpec axis_ep{4, 0, 2 * M_PI / nmod, Form("#varphi_{ll} #minus #Psi_{%d}^{%s}", nmod, qvec_det_names[cfgQvecEstimator].data())}; + + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_ep}, true); + fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); + fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); + + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); + fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); } else { // same as kQC to avoid seg. fault fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); @@ -984,8 +1002,8 @@ struct Dilepton { o2::math_utils::bringToPMPi(dphi); float aco = 1.f - std::fabs(dphi) / M_PI; float asym = std::fabs(v1.Pt() - v2.Pt()) / (v1.Pt() + v2.Pt()); - float dphi_e_ee = v1.Phi() - v12.Phi(); - o2::math_utils::bringToPMPi(dphi_e_ee); + float dphi_l_ll = v1.Phi() - v12.Phi(); + o2::math_utils::bringToPMPi(dphi_l_ll); float cos_thetaPol = 999, phiPol = 999.f; auto arrM = std::array{static_cast(v12.Px()), static_cast(v12.Py()), static_cast(v12.Pz()), static_cast(v12.M())}; @@ -1000,13 +1018,13 @@ struct Dilepton { o2::math_utils::bringToPMPi(phiPol); if (t1.sign() * t2.sign() < 0) { // ULS - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_e_ee), cos_thetaPol, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_l_ll), cos_thetaPol, weight); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_e_ee), cos_thetaPol, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_l_ll), cos_thetaPol, weight); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_e_ee), cos_thetaPol, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_l_ll), cos_thetaPol, weight); } - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3)) { + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2SP) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3SP)) { std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; @@ -1129,6 +1147,35 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); } } + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV2EP) || cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kFlowV3EP)) { + if constexpr (ev_id == 0) { + std::vector> eventplanes = { + {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, // 0th harmonics + {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, // 1st harmonics + {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg(), collision.ep2fv0a()}, // 2nd harmonics + {collision.ep3ft0m(), collision.ep3ft0a(), collision.ep3ft0c(), collision.ep3btot(), collision.ep3bpos(), collision.ep3bneg(), collision.ep3fv0a()}, // 3rd harmonics + }; + + float ep = RecoDecay::constrainAngle(eventplanes[nmod][cfgEPEstimator], -o2::constants::math::PI / nmod, static_cast(nmod)); + float phi_ll = RecoDecay::constrainAngle(v12.Phi(), -o2::constants::math::PI / nmod, 1U); + float dphi_ll_ep = std::fabs(RecoDecay::constrainAngle(phi_ll - ep, 0.f, static_cast(nmod))); + + if (t1.sign() * t2.sign() < 0) { // ULS + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), dphi_ll_ep, weight); + } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), dphi_ll_ep, weight); + } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), dphi_ll_ep, weight); + } + } else if constexpr (ev_id == 1) { + if (t1.sign() * t2.sign() < 0) { // ULS + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } + } } else { // same as kQC to avoid seg. fault if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index fc4061610eb..154441cd5ba 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -32,6 +32,7 @@ namespace o2::aod::pwgem::dilepton::utils::eventhistogram { const int nbin_ev = 21; +static constexpr std::string_view event_types[2] = {"before/", "after/"}; template void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) { @@ -110,6 +111,22 @@ void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + + fRegistry->add("Event/before/hPrfCos2_Psi2FT0M_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0M_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2BPos_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{BPos} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{BPos} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2FT0C_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{FT0C}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2FT0C_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{FT0C}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + } else if constexpr (nmod == 3) { fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); @@ -148,6 +165,21 @@ void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + + fRegistry->add("Event/before/hPrfCos3_Psi3FT0M_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0M_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3BPos_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{BPos} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{BPos} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3FT0C_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{FT0C}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3FT0C_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{FT0C}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } fRegistry->addClone("Event/before/", "Event/after/"); } @@ -174,7 +206,6 @@ void addEventHistogramsBootstrap(o2::framework::HistogramRegistry* fRegistry, in template void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, const float /*weight*/ = 1.f) { - static constexpr std::string_view event_types[2] = {"before/", "after/"}; fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 1.0); if (collision.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 2.0); @@ -290,6 +321,22 @@ void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ2FV0AQ2BNeg_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q2fv0a, q2bneg)); fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ2FV0AQ2BTot_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q2fv0a, q2btot)); fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ2FV0AQ2FT0C_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q2fv0a, q2ft0c)); + + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0M_Psi2BPos_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0m() - collision.ep2bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0M_Psi2BNeg_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0m() - collision.ep2bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2BPos_Psi2BNeg_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2bpos() - collision.ep2bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0C_Psi2BPos_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0c() - collision.ep2bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0C_Psi2BNeg_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0c() - collision.ep2bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0C_Psi2BTot_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0c() - collision.ep2btot()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0A_Psi2BPos_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0a() - collision.ep2bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0A_Psi2BNeg_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0a() - collision.ep2bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0A_Psi2BTot_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0a() - collision.ep2btot()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FT0A_Psi2FT0C_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2ft0a() - collision.ep2ft0c()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FV0A_Psi2BPos_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2fv0a() - collision.ep2bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FV0A_Psi2BNeg_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2fv0a() - collision.ep2bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FV0A_Psi2BTot_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2fv0a() - collision.ep2btot()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos2_Psi2FV0A_Psi2FT0C_CentFT0C"), collision.centFT0C(), std::cos(2.f * (collision.ep2fv0a() - collision.ep2ft0c()))); + } else if constexpr (nmod == 3) { std::array q3ft0m = {collision.q3xft0m(), collision.q3yft0m()}; std::array q3ft0a = {collision.q3xft0a(), collision.q3yft0a()}; @@ -336,6 +383,21 @@ void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ3FV0AQ3BPos_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q3fv0a, q3bpos)); fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ3FV0AQ3BNeg_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q3fv0a, q3bneg)); fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ3FV0AQ3BTot_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q3fv0a, q3btot)); + + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0M_Psi3BPos_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0m() - collision.ep3bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0M_Psi3BNeg_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0m() - collision.ep3bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3BPos_Psi3BNeg_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3bpos() - collision.ep3bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0C_Psi3BPos_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0c() - collision.ep3bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0C_Psi3BNeg_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0c() - collision.ep3bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0C_Psi3BTot_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0c() - collision.ep3btot()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0A_Psi3BPos_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0a() - collision.ep3bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0A_Psi3BNeg_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0a() - collision.ep3bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0A_Psi3BTot_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0a() - collision.ep3btot()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FT0A_Psi3FT0C_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3ft0a() - collision.ep3ft0c()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FV0A_Psi3BPos_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3fv0a() - collision.ep3bpos()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FV0A_Psi3BNeg_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3fv0a() - collision.ep3bneg()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FV0A_Psi3BTot_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3fv0a() - collision.ep3btot()))); + fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfCos3_Psi3FV0A_Psi3FT0C_CentFT0C"), collision.centFT0C(), std::cos(3.f * (collision.ep3fv0a() - collision.ep3ft0c()))); } } template diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index 693045306eb..f250ef8aa98 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -45,11 +45,13 @@ enum class DileptonPairType : int { enum class DileptonAnalysisType : int { kQC = 0, kUPC = 1, - kFlowV2 = 2, - kFlowV3 = 3, + kFlowV2SP = 2, + kFlowV3SP = 3, kPolarization = 4, kHFll = 5, kBootstrapv2 = 6, + kFlowV2EP = 7, + kFlowV3EP = 8, }; enum class DileptonHadronAnalysisType : int { From 37818d7dae2fb6ebe486ee1345d2ad09dca81c86 Mon Sep 17 00:00:00 2001 From: Jesper Karlsson Gumprecht <113693781+jesgum@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:16:27 +0200 Subject: [PATCH 213/282] [Common] Add evsel isFlangeEvent to centrality study (#15593) --- Common/DataModel/Multiplicity.h | 36 ++++++++++++++++---------- Common/Tasks/centralityStudy.cxx | 34 +++++++++++++++++++----- Common/Tools/Multiplicity/MultModule.h | 12 ++++++--- 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 5337d5ffd59..023282d5b12 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -26,20 +26,19 @@ namespace o2::aod { namespace mult { -DECLARE_SOA_COLUMN(MultFV0A, multFV0A, float); //! -DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //! -DECLARE_SOA_COLUMN(MultFV0C, multFV0C, float); //! -DECLARE_SOA_COLUMN(MultFT0A, multFT0A, float); //! -DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); //! -DECLARE_SOA_COLUMN(MultFDDA, multFDDA, float); //! -DECLARE_SOA_COLUMN(MultFDDC, multFDDC, float); //! -DECLARE_SOA_COLUMN(MultZNA, multZNA, float); //! -DECLARE_SOA_COLUMN(MultZNC, multZNC, float); //! -DECLARE_SOA_COLUMN(MultZEM1, multZEM1, float); //! -DECLARE_SOA_COLUMN(MultZEM2, multZEM2, float); //! -DECLARE_SOA_COLUMN(MultZPA, multZPA, float); //! -DECLARE_SOA_COLUMN(MultZPC, multZPC, float); //! -DECLARE_SOA_DYNAMIC_COLUMN(MultFV0M, multFV0M, //! +DECLARE_SOA_COLUMN(MultFV0A, multFV0A, float); //! +DECLARE_SOA_COLUMN(MultFV0C, multFV0C, float); //! +DECLARE_SOA_COLUMN(MultFT0A, multFT0A, float); //! +DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); //! +DECLARE_SOA_COLUMN(MultFDDA, multFDDA, float); //! +DECLARE_SOA_COLUMN(MultFDDC, multFDDC, float); //! +DECLARE_SOA_COLUMN(MultZNA, multZNA, float); //! +DECLARE_SOA_COLUMN(MultZNC, multZNC, float); //! +DECLARE_SOA_COLUMN(MultZEM1, multZEM1, float); //! +DECLARE_SOA_COLUMN(MultZEM2, multZEM2, float); //! +DECLARE_SOA_COLUMN(MultZPA, multZPA, float); //! +DECLARE_SOA_COLUMN(MultZPC, multZPC, float); //! +DECLARE_SOA_DYNAMIC_COLUMN(MultFV0M, multFV0M, //! [](float multFV0A, float multFV0C) -> float { return multFV0A + multFV0C; }); DECLARE_SOA_DYNAMIC_COLUMN(MultFT0M, multFT0M, //! [](float multFT0A, float multFT0C) -> float { return multFT0A + multFT0C; }); @@ -100,6 +99,10 @@ DECLARE_SOA_COLUMN(TimeToPrevious, timeToPrevious, float); //! DECLARE_SOA_COLUMN(TimeToNext, timeToNext, float); //! DECLARE_SOA_COLUMN(TimeToNeNext, timeToNeNext, float); //! +// Extra information from FIT detectors +DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //! FV0 without innermost ring +DECLARE_SOA_COLUMN(FT0TriggerMask, ft0TriggerMask, uint8_t); //! + } // namespace mult DECLARE_SOA_TABLE(FV0Mults, "AOD", "FV0MULT", //! Multiplicity with the FV0 detector mult::MultFV0A, mult::MultFV0C, @@ -126,6 +129,11 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib mult::IsInelGt1); DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT mult::MFTNalltracks, mult::MFTNtracks); + +DECLARE_SOA_TABLE(FITExtraMults, "AOD", "FITEXTRAMULT", //! Extra information from FIT detectors + mult::MultFV0AOuter, + mult::FT0TriggerMask); + using BarrelMults = soa::Join; using Mults = soa::Join; using MultsRun3 = soa::Join; diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index e4a99dedb88..2b9ed353d6c 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -20,6 +20,7 @@ #include "Common/DataModel/Multiplicity.h" #include +#include #include #include #include @@ -91,6 +92,7 @@ struct centralityStudy { Configurable requireIsVertexTOFmatched{"requireIsVertexTOFmatched", false, "require events with at least one of vertex contributors matched to TOF"}; Configurable requireIsVertexTRDmatched{"requireIsVertexTRDmatched", false, "require events with at least one of vertex contributors matched to TRD"}; Configurable rejectSameBunchPileup{"rejectSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"}; + Configurable rejectIsFlangeEvent{"rejectIsFlangeEvent", false, "At least one channel with -350 TDC < time < -450 TDC"}; Configurable rejectITSinROFpileupStandard{"rejectITSinROFpileupStandard", false, "reject collisions in case of in-ROF ITS pileup (standard)"}; Configurable rejectITSinROFpileupStrict{"rejectITSinROFpileupStrict", false, "reject collisions in case of in-ROF ITS pileup (strict)"}; @@ -201,8 +203,12 @@ struct centralityStudy { histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(11, "Neighbour rejection"); histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(12, "no ITS in-ROF pileup (standard)"); histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(13, "no ITS in-ROF pileup (strict)"); + histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(14, "is UPC event"); + histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(15, "rejectCollInTimeRangeNarrow"); + histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(16, "em/upc rejection"); + histos.get(HIST("hCollisionSelection"))->GetXaxis()->SetBinLabel(17, "isFlangeEvent"); - histos.add("hFT0A_Collisions", "hFT0C_Collisions", kTH1D, {axisMultUltraFineFT0A}); + histos.add("hFT0A_Collisions", "hFT0A_Collisions", kTH1D, {axisMultUltraFineFT0A}); histos.add("hFT0C_Collisions", "hFT0C_Collisions", kTH1D, {axisMultUltraFineFT0C}); histos.add("hFT0M_Collisions", "hFT0M_Collisions", kTH1D, {axisMultUltraFineFT0M}); histos.add("hFV0A_Collisions", "hFV0A_Collisions", kTH1D, {axisMultUltraFineFV0A}); @@ -372,6 +378,10 @@ struct centralityStudy { getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(11, "Neighbour rejection"); getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(12, "no ITS in-ROF pileup (standard)"); getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(13, "no ITS in-ROF pileup (strict)"); + getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(14, "is UPC event"); + getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(15, "rejectCollInTimeRangeNarrow"); + getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(16, "em/upc rejection"); + getHist(TH1, histPath + "hCollisionSelection")->GetXaxis()->SetBinLabel(17, "isFlangeEvent"); histPointers.insert({histPath + "hFT0C_Collisions", histos.add((histPath + "hFT0C_Collisions").c_str(), "hFT0C_Collisions", {kTH1D, {{axisMultUltraFineFT0C}}})}); histPointers.insert({histPath + "hFT0A_Collisions", histos.add((histPath + "hFT0A_Collisions").c_str(), "hFT0A_Collisions", {kTH1D, {{axisMultUltraFineFT0A}}})}); @@ -608,7 +618,7 @@ struct centralityStudy { if (!passRejectCollInTimeRangeNarrow) { return; } - histos.fill(HIST("hCollisionSelection"), 14 /* Not ITS ROF pileup (strict) */); + histos.fill(HIST("hCollisionSelection"), 14 /* Reject collision in narrow time range */); getHist(TH1, histPath + "hCollisionSelection")->Fill(14); if (collision.multFT0C() < upcRejection.maxFT0CforZNACselection && @@ -627,6 +637,18 @@ struct centralityStudy { histos.fill(HIST("hCollisionSelection"), 15 /* pass em/upc rejection */); getHist(TH1, histPath + "hCollisionSelection")->Fill(15); + if (rejectIsFlangeEvent) { + if constexpr (requires { collision.ft0TriggerMask(); }) { + constexpr int IsFlangeEventId = 7; + std::bitset<8> ft0TriggerMask = collision.ft0TriggerMask(); + if (ft0TriggerMask[IsFlangeEventId]) { + return; + } + } + } + histos.fill(HIST("hCollisionSelection"), 16 /* reject flange events */); + getHist(TH1, histPath + "hCollisionSelection")->Fill(16); + // if we got here, we also finally fill the FT0C histogram, please histos.fill(HIST("hNPVContributors"), collision.multNTracksPV()); histos.fill(HIST("hFT0A_Collisions"), collision.multFT0A() * scaleSignalFT0C); @@ -789,22 +811,22 @@ struct centralityStudy { } } - void processCollisions(soa::Join::iterator const& collision, aod::MultBCs const&) + void processCollisions(soa::Join::iterator const& collision, aod::MultBCs const&) { genericProcessCollision(collision); } - void processCollisionsWithResolutionStudy(soa::Join::iterator const& collision, soa::Join const&) + void processCollisionsWithResolutionStudy(soa::Join::iterator const& collision, soa::Join const&) { genericProcessCollision(collision); } - void processCollisionsWithCentrality(soa::Join::iterator const& collision, aod::MultBCs const&) + void processCollisionsWithCentrality(soa::Join::iterator const& collision, aod::MultBCs const&) { genericProcessCollision(collision); } - void processCollisionsWithCentralityWithNeighbours(soa::Join::iterator const& collision) + void processCollisionsWithCentralityWithNeighbours(soa::Join::iterator const& collision) { genericProcessCollision(collision); } diff --git a/Common/Tools/Multiplicity/MultModule.h b/Common/Tools/Multiplicity/MultModule.h index 3fc13db0d7f..94c9deec697 100644 --- a/Common/Tools/Multiplicity/MultModule.h +++ b/Common/Tools/Multiplicity/MultModule.h @@ -145,7 +145,7 @@ static const int defaultParameters[nTablesConst][nParameters]{ // table index : match order above enum tableIndex { kFV0Mults, // standard - kFV0AOuterMults, // standard + kFITExtraMults, // standard kFT0Mults, // standard kFDDMults, // standard kZDCMults, // standard @@ -191,7 +191,8 @@ struct products : o2::framework::ProducesGroup { //__________________________________________________ // multiplicity tables o2::framework::Produces tableFV0; - o2::framework::Produces tableFV0AOuter; + o2::framework::Produces tableFITExtraMults; + o2::framework::Produces tableFV0AOuterMults; o2::framework::Produces tableFT0; o2::framework::Produces tableFDD; o2::framework::Produces tableZDC; @@ -256,6 +257,7 @@ struct multEntry { float multZPA = 0.0f; float multZPC = 0.0f; int multTracklets = 0; + uint8_t fitTriggerMask{}; int multNContribs = 0; // PVMult 0.8 int multNContribsEta1 = 0; // PVMult 1.0 @@ -705,6 +707,7 @@ class MultModule } if (collision.has_foundFT0()) { const auto& ft0 = collision.foundFT0(); + mults.fitTriggerMask = ft0.triggerMask(); for (const auto& amplitude : ft0.amplitudeA()) { mults.multFT0A += amplitude; } @@ -750,8 +753,9 @@ class MultModule if (internalOpts.mEnabledTables[kFV0Mults]) { cursors.tableFV0(mults.multFV0A, mults.multFV0C); } - if (internalOpts.mEnabledTables[kFV0AOuterMults]) { - cursors.tableFV0AOuter(mults.multFV0AOuter); + if (internalOpts.mEnabledTables[kFITExtraMults]) { + cursors.tableFITExtraMults(mults.multFV0AOuter, mults.fitTriggerMask); + cursors.tableFV0AOuterMults(mults.multFV0AOuter); // Keep for backwards compatibility } if (internalOpts.mEnabledTables[kFT0Mults]) { cursors.tableFT0(mults.multFT0A, mults.multFT0C); From e9080147d7f62acdc6e31656c0c614af1c8bc804 Mon Sep 17 00:00:00 2001 From: YazhenLin Date: Thu, 9 Apr 2026 20:07:35 +0800 Subject: [PATCH 214/282] [PWGDQ] Add and change some code for the energy correlator study (#15641) --- PWGDQ/Core/VarManager.cxx | 2 + PWGDQ/Core/VarManager.h | 39 +++--- PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx | 146 +++++++++++++++++----- 3 files changed, 137 insertions(+), 50 deletions(-) diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index bbe9f08f28b..d39cdc34a0f 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -2239,6 +2239,7 @@ void VarManager::SetDefaultVarNames() fgVarNamesMap["kMCPdgCode"] = kMCPdgCode; fgVarNamesMap["kMCCosTheta"] = kMCCosTheta; fgVarNamesMap["kMCHadronPdgCode"] = kMCHadronPdgCode; + fgVarNamesMap["kMCAccweight"] = kMCAccweight; fgVarNamesMap["kMCCosChi"] = kMCCosChi; fgVarNamesMap["kMCHadronPt"] = kMCHadronPt; fgVarNamesMap["kMCWeight_before"] = kMCWeight_before; @@ -2481,6 +2482,7 @@ void VarManager::SetDefaultVarNames() fgVarNamesMap["kDeltaPhiSym"] = kDeltaPhiSym; fgVarNamesMap["kCosTheta"] = kCosTheta; fgVarNamesMap["kCosChi"] = kCosChi; + fgVarNamesMap["kWeight"] = kWeight; fgVarNamesMap["kECWeight"] = kECWeight; fgVarNamesMap["kEWeight_before"] = kEWeight_before; fgVarNamesMap["kPtDau"] = kPtDau; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 3129822100f..32cb1ea8227 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -675,6 +675,7 @@ class VarManager : public TObject kMCHadronPdgCode, kMCCosTheta, kMCJpsiPt, + kMCAccweight, kMCCosChi, kMCdeltaphi, kMCdeltaeta, @@ -930,6 +931,7 @@ class VarManager : public TObject kCosChi, kEtaDau, kPhiDau, + kWeight, kECWeight, kPtDau, kCosTheta, @@ -1337,7 +1339,7 @@ class VarManager : public TObject template static void FillTrackMC(const U& mcStack, T const& track, float* values = nullptr); template - static void FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values = nullptr, float Translow = 1. / 3, float Transhigh = 2. / 3); + static void FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values = nullptr, float Translow = 1. / 3, float Transhigh = 2. / 3, float Accweight = 1.0f); template static void FillPairPropagateMuon(T1 const& muon1, T2 const& muon2, const C& collision, float* values = nullptr); template @@ -1371,9 +1373,9 @@ class VarManager : public TObject template static void FillDileptonHadron(T1 const& dilepton, T2 const& hadron, float* values = nullptr, float hadronMass = 0.0f); template - static void FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, float* values = nullptr, float Translow = 1. / 3, float Transhigh = 2. / 3, bool applyFitMass = false, float sidebandMass = 0.0f); + static void FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, float* values = nullptr, float Translow = 1. / 3, float Transhigh = 2. / 3, bool applyFitMass = false, float sidebandMass = 0.0f, float weight = 1.0f); template - static void FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values = nullptr, bool applyFitMass = false); + static void FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values = nullptr, bool applyFitMass = false, float Effweight_rec = 1.f, float Accweight_gen = 1.f); template static void FillDileptonPhoton(T1 const& dilepton, T2 const& photon, float* values = nullptr); template @@ -3338,7 +3340,7 @@ void VarManager::FillTrackCollisionMC(T1 const& track, const std::array -void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values, float Translow, float Transhigh) +void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* values, float Translow, float Transhigh, float Accweight) { // energy correlators float MassHadron; @@ -3355,8 +3357,9 @@ void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* va float E_boost = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2); float CosChi = LorentzTransformJpsihadroncosChi("coschi", v1, v2); float CosTheta = LorentzTransformJpsihadroncosChi("costheta", v1, v2); + values[kMCAccweight] = Accweight; values[kMCCosChi] = CosChi; - values[kMCWeight_before] = t1.pt() / o2::constants::physics::MassJPsi; + values[kMCWeight_before] = t1.pt() / o2::constants::physics::MassJPsi * Accweight; values[kMCCosTheta] = CosTheta; values[kMCdeltaphi] = deltaphi; values[kMCdeltaeta] = deltaeta; @@ -3386,15 +3389,15 @@ void VarManager::FillEnergyCorrelatorsMC(T const& track, T1 const& t1, float* va ROOT::Math::PtEtaPhiMVector v2_randomPhi_trans(v2.pt(), v2.eta(), randomPhi_trans, MassHadron); values[kMCCosChi_randomPhi_trans] = LorentzTransformJpsihadroncosChi("coschi", v1, v2_randomPhi_trans); - values[kMCWeight_randomPhi_trans] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_trans) / v1.M(); + values[kMCWeight_randomPhi_trans] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_trans) / v1.M() * Accweight; ROOT::Math::PtEtaPhiMVector v2_randomPhi_toward(v2.pt(), v2.eta(), randomPhi_toward, MassHadron); values[kMCCosChi_randomPhi_toward] = LorentzTransformJpsihadroncosChi("coschi", v1, v2_randomPhi_toward); - values[kMCWeight_randomPhi_toward] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_toward) / v1.M(); + values[kMCWeight_randomPhi_toward] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_toward) / v1.M() * Accweight; ROOT::Math::PtEtaPhiMVector v2_randomPhi_away(v2.pt(), v2.eta(), randomPhi_away, MassHadron); values[kMCCosChi_randomPhi_away] = LorentzTransformJpsihadroncosChi("coschi", v1, v2_randomPhi_away); - values[kMCWeight_randomPhi_away] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_away) / v1.M(); + values[kMCWeight_randomPhi_away] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_away) / v1.M() * Accweight; values[kMCdeltaphi_randomPhi_trans] = RecoDecay::constrainAngle(v1.phi() - randomPhi_trans, -o2::constants::math::PIHalf); values[kMCdeltaphi_randomPhi_toward] = RecoDecay::constrainAngle(v1.phi() - randomPhi_toward, -o2::constants::math::PIHalf); @@ -5831,7 +5834,7 @@ void VarManager::FillDileptonHadron(T1 const& dilepton, T2 const& hadron, float* } template -void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, float* values, float Translow, float Transhigh, bool applyFitMass, float sidebandMass) +void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, float* values, float Translow, float Transhigh, bool applyFitMass, float sidebandMass, float weight) { float m1 = o2::constants::physics::MassElectron; float m2 = o2::constants::physics::MassElectron; @@ -5854,9 +5857,10 @@ void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2 ROOT::Math::PtEtaPhiMVector v2(hadron.pt(), hadron.eta(), hadron.phi(), o2::constants::physics::MassPionCharged); values[kCosChi] = LorentzTransformJpsihadroncosChi("coschi", v1, v2); float E_boost = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2); - values[kECWeight] = E_boost / v1.M(); + values[kWeight] = weight; + values[kECWeight] = E_boost / v1.M() * weight; values[kCosTheta] = LorentzTransformJpsihadroncosChi("costheta", v1, v2); - values[kEWeight_before] = v2.Pt() / v1.M(); + values[kEWeight_before] = v2.Pt() / v1.M() * weight; values[kPtDau] = v2.pt(); values[kEtaDau] = v2.eta(); values[kPhiDau] = RecoDecay::constrainAngle(v2.phi(), -o2::constants::math::PIHalf); @@ -5883,15 +5887,14 @@ void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2 ROOT::Math::PtEtaPhiMVector v2_randomPhi_trans(v2.pt(), v2.eta(), randomPhi_trans, o2::constants::physics::MassPionCharged); values[kCosChi_randomPhi_trans] = LorentzTransformJpsihadroncosChi("coschi", v1, v2_randomPhi_trans); - values[kWeight_randomPhi_trans] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_trans) / v1.M(); + values[kWeight_randomPhi_trans] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_trans) / v1.M() * weight; ROOT::Math::PtEtaPhiMVector v2_randomPhi_toward(v2.pt(), v2.eta(), randomPhi_toward, o2::constants::physics::MassPionCharged); values[kCosChi_randomPhi_toward] = LorentzTransformJpsihadroncosChi("coschi", v1, v2_randomPhi_toward); - values[kWeight_randomPhi_toward] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_toward) / v1.M(); - + values[kWeight_randomPhi_toward] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_toward) / v1.M() * weight; ROOT::Math::PtEtaPhiMVector v2_randomPhi_away(v2.pt(), v2.eta(), randomPhi_away, o2::constants::physics::MassPionCharged); values[kCosChi_randomPhi_away] = LorentzTransformJpsihadroncosChi("coschi", v1, v2_randomPhi_away); - values[kWeight_randomPhi_away] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_away) / v1.M(); + values[kWeight_randomPhi_away] = LorentzTransformJpsihadroncosChi("weight_boost", v1, v2_randomPhi_away) / v1.M() * weight; values[kdeltaphi_randomPhi_trans] = RecoDecay::constrainAngle(v1.phi() - randomPhi_trans, -o2::constants::math::PIHalf); values[kdeltaphi_randomPhi_toward] = RecoDecay::constrainAngle(v1.phi() - randomPhi_toward, -o2::constants::math::PIHalf); @@ -5901,7 +5904,7 @@ void VarManager::FillEnergyCorrelatorTriple(T1 const& lepton1, T2 const& lepton2 } template -void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values, bool applyFitMass) +void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 const& lepton2, T3 const& hadron, T4 const& track, T5 const& t1, float* values, bool applyFitMass, float Effweight_rec, float Accweight_gen) { if (fgUsedVars[kMCCosChi_gen] || fgUsedVars[kMCWeight_gen] || fgUsedVars[kMCdeltaeta_gen] || fgUsedVars[kMCCosChi_rec] || fgUsedVars[kMCWeight_rec] || fgUsedVars[kMCdeltaeta_rec]) { // energy correlators @@ -5930,14 +5933,14 @@ void VarManager::FillEnergyCorrelatorsUnfoldingTriple(T1 const& lepton1, T2 cons float E_boost_gen = LorentzTransformJpsihadroncosChi("weight_boost", v1_gen, v2_gen); float CosChi_gen = LorentzTransformJpsihadroncosChi("coschi", v1_gen, v2_gen); values[kMCCosChi_gen] = CosChi_gen; - values[kMCWeight_gen] = E_boost_gen / o2::constants::physics::MassJPsi; + values[kMCWeight_gen] = E_boost_gen / o2::constants::physics::MassJPsi * Accweight_gen; values[kMCdeltaeta_gen] = track.eta() - t1.eta(); ROOT::Math::PtEtaPhiMVector v1_rec(dilepton.pt(), dilepton.eta(), dilepton.phi(), dileptonmass); ROOT::Math::PtEtaPhiMVector v2_rec(hadron.pt(), hadron.eta(), hadron.phi(), o2::constants::physics::MassPionCharged); values[kMCCosChi_rec] = LorentzTransformJpsihadroncosChi("coschi", v1_rec, v2_rec); float E_boost_rec = LorentzTransformJpsihadroncosChi("weight_boost", v1_rec, v2_rec); - values[kMCWeight_rec] = E_boost_rec / v1_rec.M(); + values[kMCWeight_rec] = E_boost_rec / v1_rec.M() * Effweight_rec; values[kMCdeltaeta_rec] = dilepton.eta() - hadron.eta(); } } diff --git a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx index 8815bfa32d9..7084740cac6 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -20,28 +20,37 @@ #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" #include "PWGDQ/Core/MixingHandler.h" +#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/Core/PID/PIDTOFParamService.h" +#include "Common/Core/TableHelper.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/MathConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "Field/MagneticField.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "TGeoGlobalMagField.h" +#include +#include +#include +#include +#include #include #include @@ -128,6 +137,8 @@ struct AnalysisEnergyCorrelator { Configurable fConfigMCGenHadronPtMin{"cfgMCGenHadronPtMin", 0.1f, "minimum pt for the hadron"}; Configurable fConfigContainlepton{"cfgContainlepton", false, "If true, require the hadron to contain the lepton in its decay tree for the energy correlator study"}; Configurable fConfigUsePionMass{"cfgUsePionMass", false, "If true, use pion mass for the hadron in the energy correlator study"}; + Configurable fConfigApplyEfficiency{"cfgApplyEfficiency", false, "If true, apply efficiency correction for the energy correlator study"}; + Configurable fConfigApplyEfficiencyME{"cfgApplyEfficiencyME", false, "If true, apply efficiency correction for the energy correlator study"}; } fConfigDileptonHadronOptions; // Histogram configurables @@ -136,7 +147,7 @@ struct AnalysisEnergyCorrelator { // CCDB configurables Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "CCDB url"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "CCDB timestamp"}; - + Configurable fConfigAccCCDBPath{"AccCCDBPath", "Users/y/yalin/pptest/test2", "Path of the efficiency corrections"}; // Member variables HistogramManager* fHistMan = nullptr; MixingHandler* fMixHandler = nullptr; @@ -166,6 +177,12 @@ struct AnalysisEnergyCorrelator { using MixingBinning = ColumnBinningPolicy; std::unique_ptr fMixingBinning; + TH2F* hAcceptance_rec; + TH2F* hAcceptance_gen; + TH1F* hEfficiency_dilepton; + TH1F* hEfficiency_hadron; + TH1F* hMasswindow; + void init(o2::framework::InitContext& context) { std::vector zBins = fConfigEventOptions.fConfigZBins.value; @@ -416,14 +433,25 @@ struct AnalysisEnergyCorrelator { fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value); } + void initAccFromCCDB(uint64_t timestamp) + { + TList* listAccs = fCCDB->getForTimeStamp(fConfigAccCCDBPath, timestamp); + if (!listAccs) { + LOG(fatal) << "Problem getting TList object with efficiencies!"; + } + hEfficiency_dilepton = static_cast(listAccs->FindObject("hEfficiency_dilepton")); + hEfficiency_hadron = static_cast(listAccs->FindObject("hEfficiency_hadron")); + hAcceptance_rec = static_cast(listAccs->FindObject("hAcceptance_rec")); + hAcceptance_gen = static_cast(listAccs->FindObject("hAcceptance_gen")); + hMasswindow = static_cast(listAccs->FindObject("hMasswindow")); + if (!hAcceptance_rec || !hAcceptance_gen || !hEfficiency_dilepton || !hEfficiency_hadron || !hMasswindow) { + LOG(fatal) << "Problem getting histograms from the TList object with efficiencies!"; + } + } template void runDileptonHadron(TTrack1 const& track1, TTrack2 const& track2, int iEleCut, THadron const& hadron, TEvent const& event, aod::McParticles const& /*mcParticles*/) { - VarManager::ResetValues(0, VarManager::kNVars); // reset variables before filling - VarManager::FillEvent(event); - VarManager::FillTrack(hadron); - VarManager::FillTrackCollision(hadron, event); // Check that hadron is not one of the dilepton legs if (hadron.globalIndex() == track1.globalIndex() || hadron.globalIndex() == track2.globalIndex()) { @@ -444,13 +472,40 @@ struct AnalysisEnergyCorrelator { } } auto motherParticle = lepton1MC.template mothers_first_as(); + + float Effweight_rec = 1.0f; + float Accweight_gen = 1.0f; + if (fConfigDileptonHadronOptions.fConfigApplyEfficiency) { + float dilepton_eta = VarManager::fgValues[VarManager::kEta]; + float dilepton_phi = VarManager::fgValues[VarManager::kPhi]; + float hadron_eta = hadron.eta(); + float hadron_phi = hadron.phi(); + float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI); + Effweight_rec = hAcceptance_rec->Interpolate(dilepton_eta - hadron_eta, deltaphi); + Accweight_gen = hAcceptance_gen->Interpolate(dilepton_eta - hadron_eta, deltaphi); + float Effdilepton = hEfficiency_dilepton->Interpolate(VarManager::fgValues[VarManager::kPt]); + float Masswindow = hMasswindow->Interpolate(VarManager::fgValues[VarManager::kPt]); + float Effhadron = hEfficiency_hadron->Interpolate(hadron.pt()); + Accweight_gen = Accweight_gen * Effdilepton * Effhadron; + if (fConfigDileptonHadronOptions.fConfigApplyEfficiencyME) { + Effweight_rec = Effdilepton * Effhadron * Masswindow; // for the moment, apply the efficiency correction also for the mixed event pairs, but this can be changed in case we want to apply it only for the same event pairs + } else { + Effweight_rec = Effweight_rec * Effdilepton * Effhadron * Masswindow; // apply acceptance and efficiency correction for the real pairs + } + } + + VarManager::ResetValues(0, VarManager::kNVars); // reset variables before filling + VarManager::FillEvent(event); + VarManager::FillTrack(hadron); + VarManager::FillTrackCollision(hadron, event); + // Fill dilepton-hadron variables std::vector fTransRange = fConfigDileptonHadronOptions.fConfigTransRange; - VarManager::FillEnergyCorrelatorTriple(track1, track2, hadron, VarManager::fgValues, fTransRange[0], fTransRange[1], fConfigDileptonHadronOptions.fConfigApplyMassEC.value); + VarManager::FillEnergyCorrelatorTriple(track1, track2, hadron, VarManager::fgValues, fTransRange[0], fTransRange[1], fConfigDileptonHadronOptions.fConfigApplyMassEC.value, -1, 1. / Effweight_rec); if (fConfigDileptonHadronOptions.fConfigUsePionMass.value) { - VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); + VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value, 1. / Effweight_rec, 1. / Accweight_gen); } else { - VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value); + VarManager::FillEnergyCorrelatorsUnfoldingTriple(track1, track2, hadron, motherParticle, hadronMC, VarManager::fgValues, fConfigDileptonHadronOptions.fConfigApplyMassEC.value, 1. / Effweight_rec, 1. / Accweight_gen); } int iHadronCut = 0; @@ -538,6 +593,7 @@ struct AnalysisEnergyCorrelator { // CCDB initialization if (fCurrentRun != bcs.begin().runNumber()) { fCurrentRun = bcs.begin().runNumber(); + initAccFromCCDB(bcs.begin().timestamp()); } if (fConfigEventOptions.fConfigEventQA) { @@ -672,7 +728,7 @@ struct AnalysisEnergyCorrelator { } Filter eventFilter = nabs(aod::collision::posZ) < fConfigEventOptions.fConfigEventfilterVtz && aod::evsel::sel8 == true; - void processBarrelMixedEvent(soa::Filtered& events, aod::TrackAssoc const& assocs, MyBarrelTracksWithCov const& /*tracks*/, aod::McCollisions const& /*mcCollisions*/, aod::McParticles const& mcParticles, BCsWithTimestamps const& bcs) + void processBarrelMixedEvent(soa::Filtered const& events, aod::TrackAssoc const& assocs, MyBarrelTracksWithCov const& /*tracks*/, aod::McCollisions const& /*mcCollisions*/, aod::McParticles const& mcParticles, BCsWithTimestamps const& bcs) { if (events.size() == 0) { return; @@ -681,6 +737,7 @@ struct AnalysisEnergyCorrelator { // CCDB initialization if (fCurrentRun != bcs.begin().runNumber()) { fCurrentRun = bcs.begin().runNumber(); + initAccFromCCDB(bcs.begin().timestamp()); } fSelMap.clear(); @@ -839,8 +896,17 @@ struct AnalysisEnergyCorrelator { if (t2_raw.pt() < fConfigDileptonHadronOptions.fConfigMCGenHadronPtMin.value || std::abs(t2_raw.eta()) > fConfigDileptonHadronOptions.fConfigMCGenHadronEtaAbs.value) { continue; } + float acceptance = 1.0f; + if (fConfigDileptonHadronOptions.fConfigApplyEfficiency) { + float dilepton_eta = t1_raw.eta(); + float dilepton_phi = t1_raw.phi(); + float hadron_eta = t2_raw.eta(); + float hadron_phi = t2_raw.phi(); + float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI); + acceptance = hAcceptance_gen->Interpolate(dilepton_eta - hadron_eta, deltaphi); + } std::vector fTransRange = fConfigDileptonHadronOptions.fConfigTransRange; - VarManager::FillEnergyCorrelatorsMC(t1_raw, t2_raw, VarManager::fgValues, fTransRange[0], fTransRange[1]); + VarManager::FillEnergyCorrelatorsMC(t1_raw, t2_raw, VarManager::fgValues, fTransRange[0], fTransRange[1], 1. / acceptance); for (auto& sig : fGenMCSignals) { if (sig->CheckSignal(true, t1_raw)) { if (!MixedEvent && !PionMass) { @@ -861,8 +927,8 @@ struct AnalysisEnergyCorrelator { } } - void processMCGenEnergyCorrelators(soa::Filtered& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks) + void processMCGenEnergyCorrelators(soa::Filtered const& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -883,12 +949,16 @@ struct AnalysisEnergyCorrelator { if (fSavelessevents[0] > 1 && event.globalIndex() % fSavelessevents[0] == fSavelessevents[1]) { continue; } + if (fCurrentRun != bcs.begin().runNumber()) { + fCurrentRun = bcs.begin().runNumber(); + initAccFromCCDB(bcs.begin().timestamp()); + } runEnergyCorrelators(event, event, mcTracks); } } - void processMCGenEnergyCorrelatorsME(soa::Filtered& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks) + void processMCGenEnergyCorrelatorsME(soa::Filtered const& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -913,12 +983,16 @@ struct AnalysisEnergyCorrelator { if (fSavelessevents[0] > 1 && event1.globalIndex() % fSavelessevents[0] == fSavelessevents[1]) { continue; } + if (fCurrentRun != bcs.begin().runNumber()) { + fCurrentRun = bcs.begin().runNumber(); + initAccFromCCDB(bcs.begin().timestamp()); + } runEnergyCorrelators(event1, event2, mcTracks); } } - void processMCGenEnergyCorrelatorsPion(soa::Filtered& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks) + void processMCGenEnergyCorrelatorsPion(soa::Filtered const& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -939,12 +1013,16 @@ struct AnalysisEnergyCorrelator { if (fSavelessevents[0] > 1 && event.globalIndex() % fSavelessevents[0] == fSavelessevents[1]) { continue; } + if (fCurrentRun != bcs.begin().runNumber()) { + fCurrentRun = bcs.begin().runNumber(); + initAccFromCCDB(bcs.begin().timestamp()); + } runEnergyCorrelators(event, event, mcTracks); } } - void processMCGenEnergyCorrelatorsPionME(soa::Filtered& events, - McCollisions const& /*mcEvents*/, McParticles const& mcTracks) + void processMCGenEnergyCorrelatorsPionME(soa::Filtered const& events, + McCollisions const& /*mcEvents*/, McParticles const& mcTracks, BCsWithTimestamps const& bcs) { if (events.size() == 0) { LOG(warning) << "No events in this TF, going to the next one ..."; @@ -969,6 +1047,10 @@ struct AnalysisEnergyCorrelator { if (fSavelessevents[0] > 1 && event1.globalIndex() % fSavelessevents[0] == fSavelessevents[1]) { continue; } + if (fCurrentRun != bcs.begin().runNumber()) { + fCurrentRun = bcs.begin().runNumber(); + initAccFromCCDB(bcs.begin().timestamp()); + } runEnergyCorrelators(event1, event2, mcTracks); } } From a727717a888c791c7eb10a975cfe481243f15bad Mon Sep 17 00:00:00 2001 From: rolavick Date: Thu, 9 Apr 2026 15:40:27 +0200 Subject: [PATCH 215/282] [PWGUD] Modification to global muon producer (#15697) Co-authored-by: ALICE Action Bot --- .../upcCandProducerGlobalMuon.cxx | 121 ++++++++++-------- 1 file changed, 69 insertions(+), 52 deletions(-) diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index 744b4e8523a..42aa8108dd1 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -113,6 +113,12 @@ struct UpcCandProducerGlobalMuon { static constexpr double fCcenterMFT[3] = {0, 0, -61.4}; // Field evaluation point at center of MFT float fZShift{0}; // z-vertex shift for forward track propagation + // Named constants (avoid magic numbers in expressions) + static constexpr double kInvalidDCA = 999.; // Sentinel for "no valid DCA computed yet" + static constexpr double kBcTimeRoundingOffset = 1.; // Offset used when rounding trackTime to BC units + static constexpr uint16_t kMinTracksForPair = 2; // Minimum tracks required to compute a pair invariant mass + static constexpr uint16_t kMinTracksForCandidate = 1; // Minimum contributors required to save a candidate + void init(InitContext&) { fUpcCuts = (UPCCutparHolder)fUpcCutsConf; @@ -132,30 +138,28 @@ struct UpcCandProducerGlobalMuon { histRegistry.get(HIST("MuonsSelCounter"))->GetXaxis()->SetBinLabel(upchelpers::kFwdSelChi2 + 1, "Chi2"); // NEW: Add histograms for global track monitoring - if (fEnableMFT) { - const AxisSpec axisTrackType{5, -0.5, 4.5, "Track Type"}; - histRegistry.add("hTrackTypes", "Track type distribution", kTH1F, {axisTrackType}); - histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(1, "MuonStandalone"); - histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(2, "MCHStandalone"); - histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(3, "GlobalMuon"); - histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(4, "GlobalFwd"); - - const AxisSpec axisEta{100, -4.0, -2.0, "#eta"}; - histRegistry.add("hEtaGlobal", "Global track eta", kTH1F, {axisEta}); - - const AxisSpec axisDCAxy{200, 0., 10., "DCA_{xy} (cm)"}; - const AxisSpec axisDCAz{200, -10., 10., "DCA_{z} (cm)"}; - histRegistry.add("hDCAxyGlobal", "DCAxy of global tracks to best collision", kTH1F, {axisDCAxy}); - histRegistry.add("hDCAzGlobal", "DCAz of global tracks to best collision", kTH1F, {axisDCAz}); - histRegistry.add("hNCompatColls", "Number of compatible collisions per global track", kTH1F, {{21, -0.5, 20.5}}); - - const AxisSpec axisChi2Match{200, 0., 100., "#chi^{2}_{MCH-MFT}"}; - histRegistry.add("hChi2MatchMCHMFT", "Chi2 of MCH-MFT matching (before cut)", kTH1F, {axisChi2Match}); - - const AxisSpec axisMass{500, 0., 10., "m_{inv} (GeV/c^{2})"}; - histRegistry.add("hMassGlobalMuon", "Invariant mass from MCH-MID-MFT tracks only", kTH1F, {axisMass}); - histRegistry.add("hMassGlobalMuonWithMCHMFT", "Invariant mass from MCH-MID-MFT + MCH-MFT tracks", kTH1F, {axisMass}); - } + const AxisSpec axisTrackType{5, -0.5, 4.5, "Track Type"}; + histRegistry.add("hTrackTypes", "Track type distribution", kTH1F, {axisTrackType}); + histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(1, "MuonStandalone"); + histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(2, "MCHStandalone"); + histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(3, "GlobalMuon"); + histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(4, "GlobalFwd"); + + const AxisSpec axisEta{100, -4.0, -2.0, "#eta"}; + histRegistry.add("hEtaGlobal", "Global track eta", kTH1F, {axisEta}); + + const AxisSpec axisDCAxy{200, 0., 10., "DCA_{xy} (cm)"}; + const AxisSpec axisDCAz{200, -10., 10., "DCA_{z} (cm)"}; + histRegistry.add("hDCAxyGlobal", "DCAxy of global tracks to best collision", kTH1F, {axisDCAxy}); + histRegistry.add("hDCAzGlobal", "DCAz of global tracks to best collision", kTH1F, {axisDCAz}); + histRegistry.add("hNCompatColls", "Number of compatible collisions per global track", kTH1F, {{21, -0.5, 20.5}}); + + const AxisSpec axisChi2Match{200, 0., 100., "#chi^{2}_{MCH-MFT}"}; + histRegistry.add("hChi2MatchMCHMFT", "Chi2 of MCH-MFT matching (before cut)", kTH1F, {axisChi2Match}); + + const AxisSpec axisMass{500, 0., 10., "m_{inv} (GeV/c^{2})"}; + histRegistry.add("hMassGlobalMuon", "Invariant mass from MCH-MID-MFT tracks only", kTH1F, {axisMass}); + histRegistry.add("hMassGlobalMuonWithMCHMFT", "Invariant mass from MCH-MID-MFT + MCH-MFT tracks", kTH1F, {axisMass}); } bool cut(const o2::dataformats::GlobalFwdTrack& pft, const ForwardTracks::iterator& fwdTrack) @@ -393,13 +397,11 @@ struct UpcCandProducerGlobalMuon { float px, py, pz; int sign; - // NEW: Fill track type histogram if MFT enabled - if (fEnableMFT) { - histRegistry.fill(HIST("hTrackTypes"), track.trackType()); - if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || - track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack) { - histRegistry.fill(HIST("hEtaGlobal"), track.eta()); - } + // NEW: Fill track type histogram + histRegistry.fill(HIST("hTrackTypes"), track.trackType()); + if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || + track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack) { + histRegistry.fill(HIST("hEtaGlobal"), track.eta()); } if (fUpcCuts.getUseFwdCuts()) { @@ -476,11 +478,11 @@ struct UpcCandProducerGlobalMuon { } int newId = 0; - for (auto trackId : trackIds) { + for (const auto& trackId : trackIds) { auto it = clustersPerTrack.find(trackId); if (it != clustersPerTrack.end()) { const auto& clusters = it->second; - for (auto clsId : clusters) { + for (const auto& clsId : clusters) { const auto& clsInfo = fwdTrkCls.iteratorAt(clsId); udFwdTrkClusters(newId, clsInfo.x(), clsInfo.y(), clsInfo.z(), clsInfo.clInfo()); } @@ -502,6 +504,23 @@ struct UpcCandProducerGlobalMuon { return {dcaXY, dcaOrig[2], dcaOrig[0], dcaOrig[1]}; } + // Dispatch DCA computation: use MFT helix propagation when fEnableMFT is true, + // otherwise fall back to MCH extrapolation to (0,0,0) via propagateToZero. + // Returns {DCAxy, DCAz, DCAx, DCAy} + std::array propagateFwdToDCA(ForwardTracks::iterator const& track, + double colX, double colY, double colZ) + { + if (fEnableMFT) { + return propagateGlobalToDCA(track, colX, colY, colZ); + } + auto pft = propagateToZero(track); + double dcaX = pft.getX() - colX; + double dcaY = pft.getY() - colY; + double dcaXY = std::sqrt(dcaX * dcaX + dcaY * dcaY); + double dcaZ = pft.getZ() - colZ; + return {dcaXY, dcaZ, dcaX, dcaY}; + } + void createCandidates(ForwardTracks const& fwdTracks, o2::aod::FwdTrkCls const& fwdTrkCls, o2::aod::AmbiguousFwdTracks const& ambFwdTracks, @@ -610,18 +629,18 @@ struct UpcCandProducerGlobalMuon { auto trackId = fwdTrack.globalIndex(); int64_t indexBC = vAmbFwdTrackIndex[trackId] < 0 ? vColIndexBCs[fwdTrack.collisionId()] : vAmbFwdTrackIndexBCs[vAmbFwdTrackIndex[trackId]]; - auto globalBC = vGlobalBCs[indexBC] + TMath::FloorNint(fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + 1.); + auto globalBC = vGlobalBCs[indexBC] + TMath::FloorNint(fwdTrack.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + kBcTimeRoundingOffset); if (trackType == MuonStandaloneTrack) { // MCH-MID mapGlobalBcsWithMCHMIDTrackIds[globalBC].push_back(trackId); } else if (trackType == MCHStandaloneTrack) { // MCH-only mapGlobalBcsWithMCHTrackIds[globalBC].push_back(trackId); - } else if (fEnableMFT && trackType == GlobalMuonTrack) { // MCH-MID-MFT: good timing, used as anchor + } else if (trackType == GlobalMuonTrack) { // MCH-MID-MFT: good timing, used as anchor histRegistry.fill(HIST("hChi2MatchMCHMFT"), fwdTrack.chi2MatchMCHMFT()); if (fwdTrack.chi2MatchMCHMFT() > 0 && fwdTrack.chi2MatchMCHMFT() < fMaxChi2MatchMCHMFT) { mapGlobalBcsWithGlobalMuonTrackIds[globalBC].push_back(trackId); } - } else if (fEnableMFT && trackType == GlobalForwardTrack) { // MCH-MFT: poor timing, matched to anchors + } else if (trackType == GlobalForwardTrack) { // MCH-MFT: poor timing, matched to anchors histRegistry.fill(HIST("hChi2MatchMCHMFT"), fwdTrack.chi2MatchMCHMFT()); if (fwdTrack.chi2MatchMCHMFT() > 0 && fwdTrack.chi2MatchMCHMFT() < fMaxChi2MatchMCHMFT) { mapGlobalBcsWithMCHMFTTrackIds[globalBC].push_back(trackId); @@ -631,11 +650,9 @@ struct UpcCandProducerGlobalMuon { // Map global BC to collisions for DCA-based vertex assignment std::map> mapGlobalBCtoCollisions; - if (fEnableMFT) { - for (const auto& col : collisions) { - uint64_t gbc = vGlobalBCs[col.bcId()]; - mapGlobalBCtoCollisions[gbc].push_back(col.globalIndex()); - } + for (const auto& col : collisions) { + uint64_t gbc = vGlobalBCs[col.bcId()]; + mapGlobalBCtoCollisions[gbc].push_back(col.globalIndex()); } std::vector selTrackIds{}; // NEW: For cluster saving @@ -645,7 +662,7 @@ struct UpcCandProducerGlobalMuon { // Process global tracks: MCH-MID-MFT anchors + MCH-MFT in BC window // MCH-MID-MFT tracks have good timing (from MID) and serve as anchors. // MCH-MFT tracks have poor timing and are searched in a BC window around anchors. - if (fEnableMFT && !mapGlobalBcsWithGlobalMuonTrackIds.empty()) { + if (!mapGlobalBcsWithGlobalMuonTrackIds.empty()) { for (const auto& gbc_anchorids : mapGlobalBcsWithGlobalMuonTrackIds) { uint64_t globalBcAnchor = gbc_anchorids.first; auto itFv0Id = mapGlobalBcWithV0A.find(globalBcAnchor); @@ -675,7 +692,7 @@ struct UpcCandProducerGlobalMuon { // Step 1: Find best collision vertex using DCA-based propagation float bestVtxX = 0., bestVtxY = 0., bestVtxZ = 0.; - double bestAvgDCA = 999.; + double bestAvgDCA = kInvalidDCA; bool hasVertex = false; int nCompatColls = 0; @@ -684,18 +701,18 @@ struct UpcCandProducerGlobalMuon { auto itCol = mapGlobalBCtoCollisions.find(searchBC); if (itCol == mapGlobalBCtoCollisions.end()) continue; - for (auto colIdx : itCol->second) { + for (const auto& colIdx : itCol->second) { nCompatColls++; const auto& col = collisions.iteratorAt(colIdx); double sumDCAxy = 0.; int nTracks = 0; for (const auto& iglobal : allTrackIds) { const auto& trk = fwdTracks.iteratorAt(iglobal); - auto dca = propagateGlobalToDCA(trk, col.posX(), col.posY(), col.posZ()); + auto dca = propagateFwdToDCA(trk, col.posX(), col.posY(), col.posZ()); sumDCAxy += dca[0]; nTracks++; } - double avgDCA = nTracks > 0 ? sumDCAxy / nTracks : 999.; + double avgDCA = nTracks > 0 ? sumDCAxy / nTracks : kInvalidDCA; if (!hasVertex || avgDCA < bestAvgDCA) { bestAvgDCA = avgDCA; bestVtxX = col.posX(); @@ -715,7 +732,7 @@ struct UpcCandProducerGlobalMuon { for (const auto& ianchor : vAnchorIds) { if (hasVertex) { const auto& trk = fwdTracks.iteratorAt(ianchor); - auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); + auto dca = propagateFwdToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); if (dca[0] > static_cast(fMaxDCAxy)) @@ -735,7 +752,7 @@ struct UpcCandProducerGlobalMuon { // Fill invariant mass from MCH-MID-MFT anchors only uint16_t numContribAnch = numContrib; - if (numContribAnch >= 2) { + if (numContribAnch >= kMinTracksForPair) { double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; histRegistry.fill(HIST("hMassGlobalMuon"), mass2 > 0. ? std::sqrt(mass2) : 0.); } @@ -744,7 +761,7 @@ struct UpcCandProducerGlobalMuon { for (const auto& [imchMft, gbc] : mapMchMftIdBc) { if (hasVertex) { const auto& trk = fwdTracks.iteratorAt(imchMft); - auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); + auto dca = propagateFwdToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); if (dca[0] > static_cast(fMaxDCAxy)) @@ -763,12 +780,12 @@ struct UpcCandProducerGlobalMuon { } // Fill invariant mass including MCH-MFT tracks (only if MCH-MFT tracks were added) - if (numContrib > numContribAnch && numContrib >= 2) { + if (numContrib > numContribAnch && numContrib >= kMinTracksForPair) { double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; histRegistry.fill(HIST("hMassGlobalMuonWithMCHMFT"), mass2 > 0. ? std::sqrt(mass2) : 0.); } - if (numContrib < 1) + if (numContrib < kMinTracksForCandidate) continue; eventCandidates(globalBcAnchor, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); @@ -817,7 +834,7 @@ struct UpcCandProducerGlobalMuon { numContrib++; selTrackIds.push_back(imuon); } - if (numContrib < 1) // didn't save any MCH-MID tracks + if (numContrib < kMinTracksForCandidate) // didn't save any MCH-MID tracks continue; std::map mapMchIdBc{}; getMchTrackIds(globalBcMid, mapGlobalBcsWithMCHTrackIds, fBcWindowMCH, mapMchIdBc); From 704570580056fc81f7b468ec457a4add76a07979 Mon Sep 17 00:00:00 2001 From: Jerome Jung Date: Thu, 9 Apr 2026 17:31:11 +0200 Subject: [PATCH 216/282] [PWGEM] LMee: Adding more DCA correlation histograms to various signals. (#15602) --- PWGEM/Dilepton/Core/DileptonMC.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 83a56821628..f86454e1893 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -525,6 +525,14 @@ struct DileptonMC { fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/Eta/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + // fRegistry.add(std::format("Pair/sm/EtaPrime/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + // fRegistry.add(std::format("Pair/sm/Rho/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/Omega/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/Omega2ll/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/Phi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/Phi2ll/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); @@ -536,6 +544,12 @@ struct DileptonMC { fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lsmm/"); + if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { + for (const auto& strSign : pair_sign_types) { + fRegistry.add(std::format("Pair/ccbar/c2l_c2l/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + } + } + fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2l_b2l/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2c2l_b2c2l/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2c2l_b2l_sameb/"); @@ -565,6 +579,15 @@ struct DileptonMC { } } + if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { + for (const auto& strSign : pair_sign_types) { + fRegistry.add(std::format("Pair/bbbar/b2l_b2l/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/bbbar/b2c2l_b2c2l/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/bbbar/b2c2l_b2l_sameb/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/bbbar/b2c2l_b2l_diffb/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + } + } + // for correlated bkg due to mis-identified hadrons, and true combinatorial bkg fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lspp/"); From 61a25c457c62e3ce23a442ab53f31d9dcbcc5025 Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Thu, 9 Apr 2026 18:09:54 +0200 Subject: [PATCH 217/282] [PWGLF] deuteron proton correlation: include acceptance cut in generate process functions (#15695) --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 2ae84cca68d..0bfa461068d 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -138,7 +138,7 @@ struct HadronNucleiCorrelation { ConfigurableAxis DeltaPhiAxis = {"DeltaPhiAxis", {46, -1 * o2::constants::math::PIHalf, 3 * o2::constants::math::PIHalf}, "#Delta#phi (rad)"}; using FilteredCollisions = soa::Filtered; - using SimCollisions = soa::Join; + using SimCollisions = soa::Filtered>; using SimParticles = aod::McParticles; using FilteredTracks = soa::Filtered>; // new tables (v3) using FilteredTracksMC = soa::Filtered>; // new tables (v3) @@ -424,6 +424,8 @@ struct HadronNucleiCorrelation { nabs(o2::aod::singletrackselector::unPack(o2::aod::singletrackselector::storedDcaXY)) <= max_DCAz && nabs(o2::aod::singletrackselector::eta) <= etaCut; + Filter simvertexFilter = nabs(o2::aod::mccollision::posZ) <= cutzVertex; + template bool IsProton(Type const& track, int sign) { @@ -684,9 +686,6 @@ struct HadronNucleiCorrelation { void processSameEvent(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks) { - if (std::abs(collision.posZ()) > cutzVertex) - return; - registry.fill(HIST("hNEvents"), 0.5); registry.fill(HIST("hMult"), collision.mult()); @@ -1320,12 +1319,9 @@ struct HadronNucleiCorrelation { } PROCESS_SWITCH(HadronNucleiCorrelation, processMC, "processMC", false); - void processSameEventGen(SimCollisions::iterator const& mcCollision, SimParticles const& mcParticles) + void processSameEventGen(SimCollisions::iterator const&, SimParticles const& mcParticles) { - if (std::abs(mcCollision.posZ()) > cutzVertex) - return; - registry.fill(HIST("Generated/hNEventsMC"), 0.5); for (const auto& particle : mcParticles) { @@ -1382,6 +1378,19 @@ struct HadronNucleiCorrelation { for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(mcParticles, mcParticles))) { + if (isPrim && !part0.isPhysicalPrimary()) { + continue; + } + if (isPrim && !part1.isPhysicalPrimary()) { + continue; + } + if (std::abs(part0.eta()) > etaCut) { + continue; + } + if (std::abs(part1.eta()) > etaCut) { + continue; + } + // mode 6 if (mode == kPP) { if (part0.pdgCode() != PDG_t::kProton) @@ -1404,6 +1413,19 @@ struct HadronNucleiCorrelation { for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(mcParticles, mcParticles))) { + if (isPrim && !part0.isPhysicalPrimary()) { + continue; + } + if (isPrim && !part1.isPhysicalPrimary()) { + continue; + } + if (std::abs(part0.eta()) > etaCut) { + continue; + } + if (std::abs(part1.eta()) > etaCut) { + continue; + } + if (mode == kDbarPbar) { if (part0.pdgCode() != -o2::constants::physics::Pdg::kDeuteron) continue; @@ -1463,6 +1485,19 @@ struct HadronNucleiCorrelation { for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + if (isPrim && !part0.isPhysicalPrimary()) { + continue; + } + if (isPrim && !part1.isPhysicalPrimary()) { + continue; + } + if (std::abs(part0.eta()) > etaCut) { + continue; + } + if (std::abs(part1.eta()) > etaCut) { + continue; + } + if (mode == kDbarPbar) { if (part0.pdgCode() != -o2::constants::physics::Pdg::kDeuteron) continue; From 65476102198735ef9af12ebadd9881acc9264213 Mon Sep 17 00:00:00 2001 From: gengjiabin12 <997406694@qq.com> Date: Fri, 10 Apr 2026 01:43:29 +0800 Subject: [PATCH 218/282] [PWGLF] Added a switch for the collision selection filter. (#15699) --- .../Strangeness/hStrangeCorrelationFilter.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index f944b37749a..8e10eeefa21 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -79,6 +79,8 @@ struct HStrangeCorrelationFilter { Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; Configurable selectINELgtZERO{"selectINELgtZERO", true, "select INEL>0 events"}; Configurable requireAllGoodITSLayers{"requireAllGoodITSLayers", false, " require that in the event all ITS are good"}; + Configurable requireGoodTriggerTVX{"requireGoodTriggerTVX", false, " require acceptable FT0C-FT0A time difference"}; + Configurable requireGoodZvtxFT0vsPV{"requireGoodZvtxFT0vsPV", false, " require small difference between z-vertex from PV and from FT0"}; Configurable minCentPercent{"minCentPercent", 0, "minimum centrality percentage"}; Configurable maxCentPercent{"maxCentPercent", 100, "maximum centrality percentage"}; } eventSelections; @@ -366,11 +368,11 @@ struct HStrangeCorrelationFilter { template bool isCollisionSelectedPbPb(TCollision collision) { - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */ + if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) && eventSelections.requireGoodTriggerTVX) /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */ return false; - if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) // cut time intervals with dead ITS staves + if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll) && eventSelections.requireAllGoodITSLayers) // cut time intervals with dead ITS staves return false; - if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference + if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) && eventSelections.requireGoodZvtxFT0vsPV) // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference return false; auto occupancy = collision.trackOccupancyInTimeRange(); if (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh) /* Below min occupancy and Above max occupancy*/ From b9375c521efa1ba75e9cab0c1352b95371b3ad32 Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Thu, 9 Apr 2026 21:17:12 +0200 Subject: [PATCH 219/282] [PWGLF] Added process function for closure in MCGen (#15703) --- .../Strangeness/phiStrangeCorrelation.cxx | 249 +++++++++++++++++- 1 file changed, 246 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index 30cacfa6002..6f3dbf51da5 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -157,7 +158,7 @@ struct PhiStrangenessCorrelation { Configurable eventSelectionType{"eventSelectionType", 0, "Event selection type: 0 - default selection only, 1 - default + phi meson selection"}; // Configurable for analysis mode - Configurable analysisMode{"analysisMode", kMassvsMass, "Analysis mode: 0 - old method with online normalization, 1 - new method with offline normlization, 2 - deltay vs deltaphi"}; + Configurable analysisMode{"analysisMode", kDeltaYvsDeltaPhi, "Analysis mode: 0 - old method with online normalization, 1 - new method with offline normlization, 2 - deltay vs deltaphi"}; // Configurable for event selection Configurable cutZVertex{"cutZVertex", 10.0f, "Accepted z-vertex range (cm)"}; // TO BE REMOVED @@ -173,13 +174,13 @@ struct PhiStrangenessCorrelation { // Configurables for K0s selection struct : ConfigurableGroup { - Configurable selectK0sInSigRegion{"selectK0sInSigRegion", false, "Select K0s candidates in signal region"}; + Configurable selectK0sInSigRegion{"selectK0sInSigRegion", true, "Select K0s candidates in signal region"}; Configurable> rangeMK0sSignal{"rangeMK0sSignal", {0.47f, 0.53f}, "K0S mass range for signal extraction"}; } k0sConfigs; // Configurables for Pions selection struct : ConfigurableGroup { - Configurable selectPionInSigRegion{"selectPionInSigRegion", false, "Select Pion candidates in signal region"}; + Configurable selectPionInSigRegion{"selectPionInSigRegion", true, "Select Pion candidates in signal region"}; Configurable pidTPCMax{"pidTPCMax", 2.0f, "Maximum nSigma TPC"}; Configurable pidTOFMax{"pidTOFMax", 2.0f, "Maximum nSigma TOF"}; Configurable tofPIDThreshold{"tofPIDThreshold", 0.5f, "Minimum pT after which TOF PID is applicable"}; @@ -260,6 +261,24 @@ struct PhiStrangenessCorrelation { static constexpr std::array phiMassRegionLabels{"Signal", "Sideband"}; static constexpr std::array particleOfInterestLabels{"Phi", "K0S", "Pion" /*"PionTPC", "PionTPCTOF"*/}; + static constexpr std::array assocParticleLabels{"K0S", "Pi"}; + + // Light structures to store only the necessary information for the correlation analysis at MCGen level + struct MiniParticle { + float pt; + float y; + float phi; + }; + + struct MiniEvent { + float multiplicity; + std::vector phiParticles; + std::vector k0sParticles; + std::vector pionParticles; + }; + + // Buffer for mixed event, organized as a vector of deques, one for each multiplicity bin, containing the past events with their particles of interest needed for mixing + std::vector> eventBuffer; void init(InitContext&) { @@ -316,6 +335,12 @@ struct PhiStrangenessCorrelation { histos.add("pi/h3PiMCGen", "Pion in MC Gen", kTH3F, {binnedmultAxis, binnedpTPiAxis, yAxis}); histos.add("pi/h4PiMCGenAssocReco", "Pion in MC Gen Assoc Reco", kTHnSparseF, {vertexZAxis, binnedmultAxis, binnedpTPiAxis, yAxis}); + histos.add("phiK0S/h5PhiK0SClosureMCGen", "Deltay vs deltaphi for Phi and K0Short in MCGen", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTK0SAxis, deltayAxis, deltaphiAxis}); + histos.add("phiPi/h5PhiPiClosureMCGen", "Deltay vs deltaphi for Phi and Pion in MCGen", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, deltaphiAxis}); + + histos.add("phiK0S/h5PhiK0SClosureMCGenME", "Deltay vs deltaphi for Phi and K0Short in MCGen ME", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTK0SAxis, deltayAxis, deltaphiAxis}); + histos.add("phiPi/h5PhiPiClosureMCGenME", "Deltay vs deltaphi for Phi and Pion in MCGen ME", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, deltaphiAxis}); + // Load efficiency maps from CCDB if (applyEfficiency) { ccdb->setURL(ccdbUrl); @@ -327,6 +352,8 @@ struct PhiStrangenessCorrelation { loadEfficiencyMapFromCCDB(static_cast(i)); } } + + eventBuffer.resize(binsMult->size() - 1); } void loadEfficiencyMapFromCCDB(ParticleOfInterest poi) @@ -354,6 +381,15 @@ struct PhiStrangenessCorrelation { return RecoDecay::constrainAngle(phiTrigger - phiAssociated, -o2::constants::math::PIHalf); } + int getCentBin(float multiplicity) + { + if (multiplicity < binsMult->front() || multiplicity >= binsMult->back()) + return -1; + + auto it = std::upper_bound(binsMult->begin(), binsMult->end(), multiplicity); + return std::distance(binsMult->begin(), it) - 1; + } + template void processPhiK0SPionSE(TCollision const& collision, TPhiCands const& phiCandidates, TK0SCands const& k0sReduced, TPionCands const& pionTracks) { @@ -798,6 +834,213 @@ struct PhiStrangenessCorrelation { } PROCESS_SWITCH(PhiStrangenessCorrelation, processParticleEfficiency, "Process function for Efficiency Computation for Particles of Interest", false); + + /*void processMCGenClosureSE(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) + { + float multiplicity = mcCollision.centFT0M(); + + std::vector phiIndices; + std::vector k0sIndices; + std::vector pionIndices; + std::vector> assocIndices; + + auto inYAcceptance = [&](const auto& mcParticle) { + return std::abs(mcParticle.y()) <= yConfigs.cfgYAcceptance; + }; + + for (const auto& mcParticle : mcParticles) { + if (!inYAcceptance(mcParticle)) + continue; + + switch (std::abs(mcParticle.pdgCode())) { + case o2::constants::physics::Pdg::kPhi: + if (eventSelectionType == 0 && mcParticle.pt() >= minPtMcGenConfigs.minPhiPt) + phiIndices.push_back(mcParticle.globalIndex()); + break; + case PDG_t::kK0Short: + if (mcParticle.isPhysicalPrimary() && mcParticle.pt() >= minPtMcGenConfigs.v0SettingMinPt) + k0sIndices.push_back(mcParticle.globalIndex()); + break; + case PDG_t::kPiPlus: + if (mcParticle.isPhysicalPrimary() && mcParticle.pt() >= minPtMcGenConfigs.cMinPionPtcut) + pionIndices.push_back(mcParticle.globalIndex()); + break; + default: + break; + } + } + + assocIndices.push_back(k0sIndices); + assocIndices.push_back(pionIndices); + + for (std::size_t iTrigg{0}; iTrigg < phiIndices.size(); ++iTrigg) { + auto& phiParticle = mcParticles.rawIteratorAt(phiIndices[iTrigg]); + + static_for<0, assocIndices.size() - 1>([&](auto i_idx) { + constexpr unsigned int i = i_idx.value; + + for (std::size_t iAssoc{0}; iAssoc < assocIndices[i].size(); ++iAssoc) { + auto& assocParticle = mcParticles.rawIteratorAt(assocIndices[i][iAssoc]); + + histos.fill(HIST("mcGenClosure/h5Phi") + HIST(assocParticleLabels[i]) + HIST("ClosureGenSE"), multiplicity, phiParticle.pt(), assocParticle.pt(), phiParticle.y() - assocParticle.y(), getDeltaPhi(phiParticle.phi(), assocParticle.phi())); + } + }); + } + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processMCGenClosureSE, "Process function for MC Gen Closure Test in SE", false); + + void processMCGenClosureME(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) + { + float multiplicity = mcCollision.centFT0M(); + + std::vector phiParticles; + std::vector k0sParticles; + std::vector pionParticles; + + auto inYAcceptance = [&](const auto& mcParticle) { + return std::abs(mcParticle.y()) <= yConfigs.cfgYAcceptance; + }; + + for (const auto& mcParticle : mcParticles) { + if (!inYAcceptance(mcParticle)) + continue; + + switch (std::abs(mcParticle.pdgCode())) { + case o2::constants::physics::Pdg::kPhi: + if (eventSelectionType == 0 && mcParticle.pt() >= minPtMcGenConfigs.minPhiPt) + phiParticles.emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); + break; + case PDG_t::kK0Short: + if (mcParticle.isPhysicalPrimary() && mcParticle.pt() >= minPtMcGenConfigs.v0SettingMinPt) + k0sParticles.emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); + break; + case PDG_t::kPiPlus: + if (mcParticle.isPhysicalPrimary() && mcParticle.pt() >= minPtMcGenConfigs.cMinPionPtcut) + pionParticles.emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); + break; + default: + break; + } + } + + if (phiParticles.empty() && k0sParticles.empty() && pionParticles.empty()) + return; + + int multBin = getCentBin(multiplicity); + + // Loop over past events in the same multiplicity bin and fill histograms with all combinations of current phi particles and past K0S and pion particles + for (const auto& pastEvent : eventBuffer[multBin]) { + for (const auto& phiParticle : phiParticles) { + for (const auto& k0sParticle : pastEvent.k0sParticles) { + histos.fill(HIST("mcGenClosure/h5PhiK0SClosureGenME"), multiplicity, phiParticle.pt, k0sParticle.pt, phiParticle.y - k0sParticle.y, getDeltaPhi(phiParticle.phi, k0sParticle.phi)); + } + for (const auto& pionParticle : pastEvent.pionParticles) { + histos.fill(HIST("mcGenClosure/h5PhiPiClosureGenME"), multiplicity, phiParticle.pt, pionParticle.pt, phiParticle.y - pionParticle.y, getDeltaPhi(phiParticle.phi, pionParticle.phi)); + } + } + } + + // Add current event to buffer + MiniEvent currentEvent; + currentEvent.multiplicity = multiplicity; + currentEvent.phiParticles = std::move(phiParticles); + currentEvent.k0sParticles = std::move(k0sParticles); + currentEvent.pionParticles = std::move(pionParticles); + + eventBuffer[multBin].push_front(std::move(currentEvent)); + if (eventBuffer[multBin].size() > static_cast(cfgNoMixedEvents.value)) + eventBuffer[multBin].pop_back(); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processMCGenClosureME, "Process function for MC Gen Closure Test in ME", false);*/ + + void processMCGenClosure(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) + { + float multiplicity = mcCollision.centFT0M(); + + std::vector phiParticles; + std::vector k0sParticles; + std::vector pionParticles; + + auto inYAcceptance = [&](const auto& mcParticle) { + return std::abs(mcParticle.y()) <= yConfigs.cfgYAcceptance; + }; + + for (const auto& mcParticle : mcParticles) { + if (!inYAcceptance(mcParticle)) + continue; + + switch (std::abs(mcParticle.pdgCode())) { + case o2::constants::physics::Pdg::kPhi: + if (eventSelectionType == 0 && mcParticle.pt() >= minPtMcGenConfigs.minPhiPt) + phiParticles.emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); + break; + case PDG_t::kK0Short: + if (mcParticle.isPhysicalPrimary() && mcParticle.pt() >= minPtMcGenConfigs.v0SettingMinPt) + k0sParticles.emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); + break; + case PDG_t::kPiPlus: + if (mcParticle.isPhysicalPrimary() && mcParticle.pt() >= minPtMcGenConfigs.cMinPionPtcut) + pionParticles.emplace_back(mcParticle.pt(), mcParticle.y(), mcParticle.phi()); + break; + default: + break; + } + } + + if (phiParticles.empty() && k0sParticles.empty() && pionParticles.empty()) + return; + + int multBin = getCentBin(multiplicity); + if (multBin < 0) + return; + + std::vector* currentAssocParticles[] = {&k0sParticles, &pionParticles}; + + for (const auto& phiParticle : phiParticles) { + static_for<0, assocParticleLabels.size() - 1>([&](auto i_idx) { + constexpr unsigned int i = i_idx.value; + + for (const auto& assocParticle : *(currentAssocParticles[i])) { + histos.fill(HIST("phi") + HIST(assocParticleLabels[i]) + HIST("/h5Phi") + HIST(assocParticleLabels[i]) + HIST("ClosureMCGen"), + multiplicity, phiParticle.pt, assocParticle.pt, + phiParticle.y - assocParticle.y, + getDeltaPhi(phiParticle.phi, assocParticle.phi)); + } + }); + } + + for (const auto& pastEvent : eventBuffer[multBin]) { + const std::vector* pastAssocParticles[] = {&pastEvent.k0sParticles, &pastEvent.pionParticles}; + + // Loop over past events in the same multiplicity bin and fill histograms with all combinations of current phi particles and past associated particles + for (const auto& phiParticle : phiParticles) { + static_for<0, assocParticleLabels.size() - 1>([&](auto i_idx) { + constexpr unsigned int i = i_idx.value; + + for (const auto& assocParticle : *(pastAssocParticles[i])) { + histos.fill(HIST("phi") + HIST(assocParticleLabels[i]) + HIST("/h5Phi") + HIST(assocParticleLabels[i]) + HIST("ClosureMCGenME"), + multiplicity, phiParticle.pt, assocParticle.pt, + phiParticle.y - assocParticle.y, + getDeltaPhi(phiParticle.phi, assocParticle.phi)); + } + }); + } + } + + MiniEvent currentEvent; + currentEvent.multiplicity = multiplicity; + currentEvent.phiParticles = std::move(phiParticles); + currentEvent.k0sParticles = std::move(k0sParticles); + currentEvent.pionParticles = std::move(pionParticles); + + eventBuffer[multBin].push_front(std::move(currentEvent)); + if (eventBuffer[multBin].size() > static_cast(cfgNoMixedEvents.value)) + eventBuffer[multBin].pop_back(); + } + + PROCESS_SWITCH(PhiStrangenessCorrelation, processMCGenClosure, "Process function for MC Gen Closure Test in SE and ME", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 06b1675dea147275f39017c428d6c03a230ce83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 9 Apr 2026 22:20:30 +0200 Subject: [PATCH 220/282] [DPG] HMPID: Double revert fixes (#15696) --- .../AOTTrack/PID/HMPID/hmpidTableProducer.cxx | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx index 3c589016874..1b6cea53ef5 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx @@ -11,32 +11,26 @@ #include "tableHMPID.h" -#include "Common/Core/PID/PIDTOF.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" +#include #include -#include #include +#include #include +#include #include -#include +#include +#include +#include #include -#include -#include -#include -#include - -#include +#include #include #include From baf020c493f1d84426c48ee431b6ada938040ebd Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 9 Apr 2026 22:40:46 +0200 Subject: [PATCH 221/282] [PWGEM/Dilepton] update muon QA histograms (#15706) --- PWGEM/Dilepton/Core/SingleTrackQC.h | 8 ++++---- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index fc716d7798e..06cd401f60c 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -328,10 +328,10 @@ struct SingleTrackQC { fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {100, 0.0f, 50}}, false); fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index f202e0b94e5..bde658f6c28 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -374,10 +374,10 @@ struct SingleTrackQCMC { fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {100, 0.0f, 50}}, false); fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); From a8e1f2f4eeba42681b555a7955da0727de64057a Mon Sep 17 00:00:00 2001 From: Paola Vargas Torres <88360333+PaolaVT@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:54:17 -0600 Subject: [PATCH 222/282] [PWGLF] Update event selection, cuts, and histograms for analysis (#15692) Co-authored-by: Paola Vargas Torres Co-authored-by: Paola Vargas Torres --- PWGLF/Tasks/Nuspex/multiplicityPt.cxx | 753 ++++++++++---------------- 1 file changed, 280 insertions(+), 473 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx index 6d9e1ca4fdf..6edc236a27f 100644 --- a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx +++ b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx @@ -14,7 +14,7 @@ /// \brief Analysis to do PID with MC - Full correction factors for pions, kaons, protons #include "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/mcCentrality.h" // For McCentFT0Ms +#include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/DataModel/spectraTOF.h" #include "PWGLF/Utils/inelGt.h" @@ -71,8 +71,6 @@ struct MultiplicityPt { static constexpr int CentBinMax = 100; static constexpr int MultBinMax = 200; static constexpr int RecMultBinMax = 100; - static constexpr int DebugCountMax = 20; - static constexpr int CentMultClasses = 10; enum INELCutSelection : int { INEL = 0, @@ -83,21 +81,10 @@ struct MultiplicityPt { Configurable isRun3{"isRun3", true, "is Run3 dataset"}; Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; - Configurable askForCustomTVX{"askForCustomTVX", false, "Ask for custom TVX rather than sel8"}; - Configurable removeITSROFrameBorder{"removeITSROFrameBorder", false, "Remove ITS Read-Out Frame border"}; - Configurable removeNoSameBunchPileup{"removeNoSameBunchPileup", false, "Remove no same bunch pileup"}; - Configurable requireIsGoodZvtxFT0vsPV{"requireIsGoodZvtxFT0vsPV", false, "Require good Z vertex FT0 vs PV"}; - Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "Require vertex ITSTPC"}; - Configurable removeNoTimeFrameBorder{"removeNoTimeFrameBorder", false, "Remove no time frame border"}; Configurable cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; - Configurable cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"}; Configurable cfgCutNsigma{"cfgCutNsigma", 3.0f, "nsigma cut range for tracks"}; - Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to require in TRD"}; - Configurable requireTrdOnly{"requireTrdOnly", false, "Require only tracks from TRD"}; - Configurable requireNoTrd{"requireNoTrd", false, "Require tracks without TRD"}; - Configurable enableDCAHistograms{"enableDCAHistograms", false, "Enable DCA histograms"}; Configurable enablePIDHistograms{"enablePIDHistograms", true, "Enable PID histograms"}; Configurable useCustomTrackCuts{"useCustomTrackCuts", true, "Flag to use custom track cuts"}; Configurable itsPattern{"itsPattern", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; @@ -123,7 +110,6 @@ struct MultiplicityPt { Configurable phiCutHighParam1{"phiCutHighParam1", 0.16685, "First parameter for high phi cut"}; Configurable phiCutHighParam2{"phiCutHighParam2", 0.00981942, "Second parameter for high phi cut"}; - Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; Configurable cfgCutNsigmaPi{"cfgCutNsigmaPi", 3.0f, "nsigma cut for pions"}; @@ -131,7 +117,6 @@ struct MultiplicityPt { Configurable cfgCutNsigmaPr{"cfgCutNsigmaPr", 2.5f, "nsigma cut for protons"}; TrackSelection customTrackCuts; - TF1* fphiCutLow = nullptr; TF1* fphiCutHigh = nullptr; @@ -171,12 +156,10 @@ struct MultiplicityPt { float getTransformedPhi(const float phi, const int charge, const float magField) const { float transformedPhi = phi; - if (magField < 0) { + if (magField < 0) transformedPhi = o2::constants::math::TwoPI - transformedPhi; - } - if (charge < 0) { + if (charge < 0) transformedPhi = o2::constants::math::TwoPI - transformedPhi; - } transformedPhi += o2::constants::math::PI / 18.0f; transformedPhi = std::fmod(transformedPhi, o2::constants::math::PI / 9.0f); return transformedPhi; @@ -190,7 +173,6 @@ struct MultiplicityPt { if (track.pt() < pTthresholdPhiCut.value) return true; - float pt = track.pt(); float phi = track.phi(); int charge = track.sign(); @@ -198,11 +180,10 @@ struct MultiplicityPt { phi = o2::constants::math::TwoPI - phi; if (charge < 0) phi = o2::constants::math::TwoPI - phi; - phi += o2::constants::math::PI / 18.0f; phi = std::fmod(phi, o2::constants::math::PI / 9.0f); - if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt)) + if (phi < fphiCutHigh->Eval(track.pt()) && phi > fphiCutLow->Eval(track.pt())) return false; return true; } @@ -289,51 +270,24 @@ struct MultiplicityPt { return true; } - template - bool passesPIDSelection(TrackType const& track) const + template + bool passesPIDSelection(const TrackType& track, int species) const { float nsigmaTPC = 0.f; - if constexpr (species == PartPion) - nsigmaTPC = track.tpcNSigmaPi(); - else if constexpr (species == PartKaon) - nsigmaTPC = track.tpcNSigmaKa(); - else if constexpr (species == PartProton) - nsigmaTPC = track.tpcNSigmaPr(); + float cutValue = 0.f; - float cutValue = cfgCutNsigma.value; - if constexpr (species == PartPion) + if (species == PartPion) { + nsigmaTPC = track.tpcNSigmaPi(); cutValue = cfgCutNsigmaPi.value; - if constexpr (species == PartKaon) + } else if (species == PartKaon) { + nsigmaTPC = track.tpcNSigmaKa(); cutValue = cfgCutNsigmaKa.value; - if constexpr (species == PartProton) + } else if (species == PartProton) { + nsigmaTPC = track.tpcNSigmaPr(); cutValue = cfgCutNsigmaPr.value; - - return (std::abs(nsigmaTPC) < cutValue); - } - - template - int getBestPIDHypothesis(TrackType const& track) const - { - float nsigmaPi = std::abs(track.tpcNSigmaPi()); - float nsigmaKa = std::abs(track.tpcNSigmaKa()); - float nsigmaPr = std::abs(track.tpcNSigmaPr()); - - float minNSigma = 999.0f; - int bestSpecies = -1; - - if (nsigmaPi < cfgCutNsigmaPi.value && nsigmaPi < minNSigma) { - minNSigma = nsigmaPi; - bestSpecies = PartPion; - } - if (nsigmaKa < cfgCutNsigmaKa.value && nsigmaKa < minNSigma) { - minNSigma = nsigmaKa; - bestSpecies = PartKaon; } - if (nsigmaPr < cfgCutNsigmaPr.value && nsigmaPr < minNSigma) { - minNSigma = nsigmaPr; - bestSpecies = PartProton; - } - return bestSpecies; + + return std::abs(nsigmaTPC) < cutValue; } template @@ -393,15 +347,16 @@ void MultiplicityPt::init(InitContext const&) customTrackCuts.print(); } + // Axis definitions ConfigurableAxis ptBinning{"ptBinning", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT bin limits"}; AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; std::vector centBinningStd = {0., 1., 5., 10., 15., 20., 30., 40., 50., 60., 70., 80., 90., 100.}; + AxisSpec centAxis = {centBinningStd, "FT0M Centrality (%)"}; + std::vector centBinningFine; for (int i = 0; i <= CentBinMax; i++) centBinningFine.push_back(static_cast(i)); - - AxisSpec centAxis = {centBinningStd, "FT0M Centrality (%)"}; AxisSpec centFineAxis = {centBinningFine, "FT0M Centrality (%)"}; std::vector multBins; @@ -414,164 +369,98 @@ void MultiplicityPt::init(InitContext const&) recoMultBins.push_back(static_cast(i)); AxisSpec recoMultAxis = {recoMultBins, "N_{ch}^{reco}"}; - ue.add("Centrality/hCentRaw", "Raw FT0M Centrality (no cuts);Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentRaw", "Raw FT0M Centrality;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); ue.add("Centrality/hCentAfterVtx", "Centrality after vertex cut;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); - ue.add("Centrality/hCentAfterINEL", "Centrality after INEL cut;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); ue.add("Centrality/hCentAfterAll", "Centrality after all cuts;Centrality (%);Counts", HistType::kTH1D, {centFineAxis}); ue.add("Centrality/hCentVsMult", "Centrality vs Generated Multiplicity;Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centFineAxis, multAxis}); ue.add("Centrality/hMultVsCent", "Generated Multiplicity vs Centrality;N_{ch}^{gen};Centrality (%)", HistType::kTH2D, {multAxis, centFineAxis}); - ue.add("Centrality/hCentVsVz", "Centrality vs Vertex Z;Centrality (%);V_{z} (cm)", HistType::kTH2D, {centFineAxis, {40, -20, 20}}); ue.add("Centrality/hRecoMultVsCent", "Reconstructed Track Multiplicity vs Centrality;Centrality (%);N_{tracks}^{reco}", HistType::kTH2D, {centFineAxis, recoMultAxis}); - ue.add("Centrality/hGenMultPerCent", "Generated Multiplicity Distribution per Centrality Bin;Centrality (%);", HistType::kTH2D, {centFineAxis, multAxis}); - ue.add("Centrality/hVertexResVsCent", "Vertex Resolution vs Centrality;Centrality (%);V_{z} resolution (cm)", HistType::kTH2D, {centFineAxis, {100, -1, 1}}); - ue.add("INEL/hINELClass", "INEL Class for MC Collisions;INEL Class;Counts", HistType::kTH1D, {{3, 0.5, 3.5}}); - auto hINEL = ue.get(HIST("INEL/hINELClass")); - hINEL->GetXaxis()->SetBinLabel(1, "INEL0"); - hINEL->GetXaxis()->SetBinLabel(2, "INEL>0"); - hINEL->GetXaxis()->SetBinLabel(3, "INEL>1"); - - ue.add("INEL/hINELVsCent", "INEL Class vs Centrality;Centrality (%);INEL Class", HistType::kTH2D, {centFineAxis, {3, 0.5, 3.5}}); - - ue.add("CutFlow/hCutStats", "Cut Statistics;Cut Stage;Counts", HistType::kTH1D, {{6, 0.5, 6.5}}); + ue.add("CutFlow/hCutStats", "Cut Statistics;Cut Stage;Counts", HistType::kTH1D, {{5, 0.5, 5.5}}); auto hCut = ue.get(HIST("CutFlow/hCutStats")); - hCut->GetXaxis()->SetBinLabel(1, "All reco events"); + hCut->GetXaxis()->SetBinLabel(1, "All collisions"); hCut->GetXaxis()->SetBinLabel(2, "Has MC match"); hCut->GetXaxis()->SetBinLabel(3, "Has centrality"); hCut->GetXaxis()->SetBinLabel(4, "Pass vertex"); - hCut->GetXaxis()->SetBinLabel(5, "Pass INEL"); - hCut->GetXaxis()->SetBinLabel(6, "Selected"); - - ue.add("CutFlow/hCentPerCut", "Centrality Distribution at Each Cut;Cut Stage;Centrality (%)", HistType::kTH2D, {{6, 0.5, 6.5}, centFineAxis}); + hCut->GetXaxis()->SetBinLabel(5, "Selected"); - ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", HistType::kTH1D, {{10, 0.5, 10.5}}); - auto hColl = ue.get(HIST("MC/GenRecoCollisions")); - hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); - hColl->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); - hColl->GetXaxis()->SetBinLabel(3, "INEL>0"); - hColl->GetXaxis()->SetBinLabel(4, "INEL>1"); - - ue.add("hEventLossBreakdown", "Event loss breakdown", HistType::kTH1D, {{4, 0.5, 4.5}}); + ue.add("hEventLossBreakdown", "Event loss breakdown", HistType::kTH1D, {{3, 0.5, 3.5}}); auto hLoss = ue.get(HIST("hEventLossBreakdown")); hLoss->GetXaxis()->SetBinLabel(1, "Physics selected"); hLoss->GetXaxis()->SetBinLabel(2, "Reconstructed"); hLoss->GetXaxis()->SetBinLabel(3, "Selected"); - hLoss->GetXaxis()->SetBinLabel(4, "Final efficiency"); - ue.add("MC/EventLoss/NchGenerated", "Generated charged multiplicity;N_{ch}^{gen};Counts", HistType::kTH1D, {{200, 0, 200}}); - ue.add("MC/EventLoss/NchGenerated_PhysicsSelected", "Generated charged multiplicity (physics selected);N_{ch}^{gen};Counts", HistType::kTH1D, {{200, 0, 200}}); - ue.add("MC/EventLoss/NchGenerated_Reconstructed", "Generated charged multiplicity (reconstructed);N_{ch}^{gen};Counts", HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", HistType::kTH1D, {{5, 0.5, 5.5}}); + auto hColl = ue.get(HIST("MC/GenRecoCollisions")); + hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); + hColl->GetXaxis()->SetBinLabel(2, "INEL>0"); + hColl->GetXaxis()->SetBinLabel(3, "INEL>1"); + hColl->GetXaxis()->SetBinLabel(4, "Reconstructed"); + hColl->GetXaxis()->SetBinLabel(5, "Selected"); + ue.add("MC/EventLoss/GenMultVsCent", "Generated charged particles vs FT0M centrality;FT0M Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centAxis, multAxis}); ue.add("MC/EventLoss/GenMultVsCent_Selected", "Generated vs FT0M centrality (selected events);FT0M Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centAxis, multAxis}); - ue.add("MC/EventLoss/GenMultVsCent_Rejected", "Generated vs FT0M centrality (rejected events);FT0M Centrality (%);N_{ch}^{gen}", HistType::kTH2D, {centAxis, multAxis}); - ue.add("MC/GenPtVsNch", "Generated pT vs Multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, {200, 0, 200}}); - ue.add("MC/GenPtVsNch_PhysicsSelected", "Generated pT vs Multiplicity (physics selected);#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, {200, 0, 200}}); + ue.add("Inclusive/hPtGen", "Generated primaries (physics selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtReco", "All reconstructed tracks (track selection only);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries (MC matched);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries (MC matched);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - - // Tracking efficiency - ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator (generated primaries in selected events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator (reconstructed primaries matched to generated);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - - // Primary fraction - ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimGenAll", "All generated #pi^{#pm} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtGenINEL", "Generated #pi^{#pm} in INEL>0 events (|#eta|<0.8, p_{T}>0.15);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtGenRecoEvent", "Generated #pi^{#pm} in reconstructed events (|#eta|<0.8, p_{T}>0.15);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtGen", "Generated #pi^{#pm} (physics selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtReco", "Reconstructed #pi^{#pm} (MC matched, any status);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtPrimReco", "Reconstructed primary #pi^{#pm} (MC matched);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Pion/hPtMeasured", "Measured #pi^{#pm} (PID selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - // Multiplicity-dependent - ue.add("Inclusive/hPtDenEffVsCent", "Generated primaries vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Inclusive/hPtNumEffVsCent", "Reconstructed primaries matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Inclusive/hPtPrimRecoVsCent", "Reconstructed primaries vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Inclusive/hPtAllRecoVsCent", "All reconstructed tracks vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Inclusive/hPtMeasuredVsCent", "All measured tracks (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); + ue.add("Pion/hPtGenRecoEvent_Mult", "Generated #pi^{#pm} in reconstructed events vs multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, multAxis}); + ue.add("Pion/hPtGenINEL_Mult", "Generated #pi^{#pm} in INEL>0 events vs multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, multAxis}); - ue.add("Pion/hPtPrimGenAll", "All generated #pi^{#pm} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtPrimGen", "Generated #pi^{#pm} (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtPrimBadVertex", "Generated #pi^{#pm} (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtPrimRecoEv", "Generated #pi^{#pm} (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtPrimGoodEv", "Generated #pi^{#pm} (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtDenEff", "#pi^{#pm} tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtNumEff", "#pi^{#pm} tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtAllReco", "All reconstructed #pi^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtPrimReco", "Reconstructed primary #pi^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtSecReco", "Reconstructed secondary #pi^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Pion/hPtDenEffVsCent", "Generated #pi^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Pion/hPtNumEffVsCent", "Reconstructed #pi^{#pm} matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Pion/hPtPrimRecoVsCent", "Reconstructed primary #pi^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Pion/hPtAllRecoVsCent", "All reconstructed #pi^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Pion/hPtMeasuredVsCent", "Measured #pi^{#pm} (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - if (enablePIDHistograms) + if (enablePIDHistograms) { ue.add("Pion/hNsigmaTPC", "TPC n#sigma #pi^{#pm};#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", HistType::kTH2D, {ptAxis, {200, -10, 10}}); + } ue.add("Kaon/hPtPrimGenAll", "All generated K^{#pm} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtPrimGen", "Generated K^{#pm} (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtPrimBadVertex", "Generated K^{#pm} (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtPrimRecoEv", "Generated K^{#pm} (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtPrimGoodEv", "Generated K^{#pm} (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtDenEff", "K^{#pm} tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtNumEff", "K^{#pm} tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtAllReco", "All reconstructed K^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtPrimReco", "Reconstructed primary K^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtSecReco", "Reconstructed secondary K^{#pm};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Kaon/hPtDenEffVsCent", "Generated K^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Kaon/hPtNumEffVsCent", "Reconstructed K^{#pm} matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Kaon/hPtPrimRecoVsCent", "Reconstructed primary K^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Kaon/hPtAllRecoVsCent", "All reconstructed K^{#pm} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Kaon/hPtMeasuredVsCent", "Measured K^{#pm} (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - if (enablePIDHistograms) + ue.add("Kaon/hPtGenINEL", "Generated K^{#pm} in INEL>0 events (|#eta|<0.8, p_{T}>0.15);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtGenRecoEvent", "Generated K^{#pm} in reconstructed events (|#eta|<0.8, p_{T}>0.15);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtGen", "Generated K^{#pm} (physics selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtReco", "Reconstructed K^{#pm} (MC matched, any status);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtPrimReco", "Reconstructed primary K^{#pm} (MC matched);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Kaon/hPtMeasured", "Measured K^{#pm} (PID selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + + ue.add("Kaon/hPtGenRecoEvent_Mult", "Generated K^{#pm} in reconstructed events vs multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, multAxis}); + ue.add("Kaon/hPtGenINEL_Mult", "Generated K^{#pm} in INEL>0 events vs multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, multAxis}); + + if (enablePIDHistograms) { ue.add("Kaon/hNsigmaTPC", "TPC n#sigma K^{#pm};#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", HistType::kTH2D, {ptAxis, {200, -10, 10}}); + } ue.add("Proton/hPtPrimGenAll", "All generated p+#bar{p} (no cuts);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtPrimGen", "Generated p+#bar{p} (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtPrimBadVertex", "Generated p+#bar{p} (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtPrimRecoEv", "Generated p+#bar{p} (reco events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtPrimGoodEv", "Generated p+#bar{p} (good events);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtDenEff", "p+#bar{p} tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtNumEff", "p+#bar{p} tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtAllReco", "All reconstructed p+#bar{p};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtPrimReco", "Reconstructed primary p+#bar{p};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtSecReco", "Reconstructed secondary p+#bar{p};#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); - ue.add("Proton/hPtDenEffVsCent", "Generated p+#bar{p} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Proton/hPtNumEffVsCent", "Reconstructed p+#bar{p} matched vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Proton/hPtPrimRecoVsCent", "Reconstructed primary p+#bar{p} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Proton/hPtAllRecoVsCent", "All reconstructed p+#bar{p} vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - ue.add("Proton/hPtMeasuredVsCent", "Measured p+#bar{p} (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", HistType::kTH2D, {ptAxis, centAxis}); - if (enablePIDHistograms) + ue.add("Proton/hPtGenINEL", "Generated p+#bar{p} in INEL>0 events (|#eta|<0.8, p_{T}>0.15);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtGenRecoEvent", "Generated p+#bar{p} in reconstructed events (|#eta|<0.8, p_{T}>0.15);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtGen", "Generated p+#bar{p} (physics selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtReco", "Reconstructed p+#bar{p} (MC matched, any status);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtPrimReco", "Reconstructed primary p+#bar{p} (MC matched);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + ue.add("Proton/hPtMeasured", "Measured p+#bar{p} (PID selected);#it{p}_{T} (GeV/#it{c});Counts", HistType::kTH1D, {ptAxis}); + + ue.add("Proton/hPtGenRecoEvent_Mult", "Generated p+#bar{p} in reconstructed events vs multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, multAxis}); + ue.add("Proton/hPtGenINEL_Mult", "Generated p+#bar{p} in INEL>0 events vs multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", HistType::kTH2D, {ptAxis, multAxis}); + + if (enablePIDHistograms) { ue.add("Proton/hNsigmaTPC", "TPC n#sigma p+#bar{p};#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", HistType::kTH2D, {ptAxis, {200, -10, 10}}); + } + + ue.add("hEventsReco_Cent", "Reconstructed events vs centrality;FT0M Centrality (%);Counts", HistType::kTH1D, {centAxis}); + ue.add("hEventsINEL_Cent", "INEL>0 events vs centrality;FT0M Centrality (%);Counts", HistType::kTH1D, {centAxis}); ue.add("hNclFoundTPC", "Number of TPC found clusters", HistType::kTH1D, {{200, 0, 200}}); ue.add("hNclPIDTPC", "Number of TPC PID clusters", HistType::kTH1D, {{200, 0, 200}}); - ue.add("hNclFoundTPCvsPt", "TPC found clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,found}", HistType::kTH2D, {ptAxis, {200, 0., 200.}}); - ue.add("hNclPIDTPCvsPt", "TPC PID clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,PID}", HistType::kTH2D, {ptAxis, {200, 0., 200.}}); ue.add("hEta", "Track eta;#eta;Counts", HistType::kTH1D, {{20, -0.8, 0.8}}); ue.add("hPhi", "Track phi;#varphi (rad);Counts", HistType::kTH1D, {{64, 0, TwoPI}}); ue.add("hvtxZ", "Vertex Z (data);Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - ue.add("hvtxZmc", "MC vertex Z;Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - - ue.add("evsel", "Event selection", HistType::kTH1D, {{20, 0.5, 20.5}}); - auto hEvSel = ue.get(HIST("evsel")); - hEvSel->GetXaxis()->SetBinLabel(1, "Events read"); - hEvSel->GetXaxis()->SetBinLabel(4, "Trigger passed"); - hEvSel->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); - hEvSel->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); - hEvSel->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); - hEvSel->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); - hEvSel->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); - hEvSel->GetXaxis()->SetBinLabel(13, "posZ passed"); - - // Phi cut monitoring - if (applyPhiCut.value) { - ue.add("PhiCut/hPtVsPhiPrimeBefore", "pT vs φ' before cut;p_{T} (GeV/c);φ'", HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hPtVsPhiPrimeAfter", "pT vs φ' after cut;p_{T} (GeV/c);φ'", HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hRejectionRate", "Track rejection rate by phi cut;p_{T} (GeV/c);Rejection Rate", HistType::kTProfile, {{100, 0, 10}}); - } - LOG(info) << "=== Initialization complete - All correction factor histograms defined ==="; + LOG(info) << "=== Initialization complete ==="; } void MultiplicityPt::processMC(TrackTableMC const& tracks, @@ -582,12 +471,12 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, aod::McCentFT0Ms const& centTable, BCsRun3 const& /*bcs*/) { - LOG(info) << "\n=== processMC START ==="; std::map mcCollisionToNch; - std::map mcCollisionVz; std::set physicsSelectedMCCollisions; std::map mcCollisionToINELClass; + std::set inel0MCCollisions; + std::map mcCollToCentFromReco; // MC collision ID -> centrality from reco ue.fill(HIST("MC/GenRecoCollisions"), 1.f, mcCollisions.size()); @@ -595,18 +484,34 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, int64_t mcCollId = mcCollision.globalIndex(); auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); + // Check if event has at least 1 particle in acceptance (INEL>0) + bool hasParticleInAcceptance = false; + for (const auto& particle : particlesInCollision) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + continue; + if (!particle.isPhysicalPrimary()) + continue; + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + continue; + if (particle.pt() < cfgTrkLowPtCut.value) + continue; + hasParticleInAcceptance = true; + break; + } + + if (hasParticleInAcceptance) { + inel0MCCollisions.insert(mcCollId); + } + int nGenCharged = countGeneratedChargedPrimaries(particlesInCollision, cfgCutEtaMax.value, cfgTrkLowPtCut.value); mcCollisionToNch[mcCollId] = nGenCharged; - mcCollisionVz[mcCollId] = mcCollision.posZ(); bool inel0 = o2::pwglf::isINELgt0mc(particlesInCollision, pdg); bool inel1 = o2::pwglf::isINELgt1mc(particlesInCollision, pdg); int inelClass = inel1 ? 2 : (inel0 ? 1 : 0); mcCollisionToINELClass[mcCollId] = inelClass; - ue.fill(HIST("INEL/hINELClass"), inelClass); - ue.fill(HIST("MC/EventLoss/NchGenerated"), nGenCharged); - bool physicsSelected = (std::abs(mcCollision.posZ()) <= cfgCutVertex.value); if (cfgINELCut.value == INELgt0 && !inel0) physicsSelected = false; @@ -615,120 +520,68 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, if (physicsSelected) { physicsSelectedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/NchGenerated_PhysicsSelected"), nGenCharged); if (inel0) - ue.fill(HIST("MC/GenRecoCollisions"), 3.f); + ue.fill(HIST("MC/GenRecoCollisions"), 2.f); if (inel1) - ue.fill(HIST("MC/GenRecoCollisions"), 4.f); - } - } - - // DEBUG: Count raw protons in MC (no cuts) - { - int nProtonsRaw = 0; - int nProtonsTotal = 0; - int nProtonsPassEta = 0; - int nProtonsPassPt = 0; - int nProtonsPassBoth = 0; - - for (const auto& mcCollision : mcCollisions) { - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - for (const auto& particle : particlesInCollision) { - auto pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (!pdgParticle || pdgParticle->Charge() == 0.) - continue; - - int pdgCode = std::abs(particle.pdgCode()); - if (pdgCode == PDG_t::kProton) { - nProtonsRaw++; // Count ALL protons regardless of status - - if (!particle.isPhysicalPrimary()) - continue; - nProtonsTotal++; - - bool passEta = (std::abs(particle.eta()) < cfgCutEtaMax.value); - bool passPt = (particle.pt() >= cfgTrkLowPtCut.value); - if (passEta) - nProtonsPassEta++; - if (passPt) - nProtonsPassPt++; - if (passEta && passPt) - nProtonsPassBoth++; - } - } - } - LOG(info) << "=== PROTON DEBUG ==="; - LOG(info) << "RAW protons in MC (any status): " << nProtonsRaw; - LOG(info) << "Physical primary protons: " << nProtonsTotal; - LOG(info) << "Protons passing eta cut (|eta|<" << cfgCutEtaMax.value << "): " << nProtonsPassEta; - LOG(info) << "Protons passing pT cut (pT>=" << cfgTrkLowPtCut.value << "): " << nProtonsPassPt; - LOG(info) << "Protons passing both cuts: " << nProtonsPassBoth; - if (nProtonsRaw == 0) { - LOG(warning) << "NO PROTONS FOUND IN MC! Check your MC generator settings."; + ue.fill(HIST("MC/GenRecoCollisions"), 3.f); } - } - - LOG(info) << "\n--- FILLING GENERATED PARTICLE SPECTRA ---"; - - for (const auto& mcCollision : mcCollisions) { - int64_t mcCollId = mcCollision.globalIndex(); - auto nchIt = mcCollisionToNch.find(mcCollId); - if (nchIt == mcCollisionToNch.end()) - continue; - int nGenCharged = nchIt->second; - bool isPhysicsSelected = (physicsSelectedMCCollisions.find(mcCollId) != physicsSelectedMCCollisions.end()); - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); + // Fill generated particle spectra for (const auto& particle : particlesInCollision) { auto pdgParticle = pdg->GetParticle(particle.pdgCode()); if (!pdgParticle || pdgParticle->Charge() == 0.) continue; if (!particle.isPhysicalPrimary()) continue; - if (std::abs(particle.eta()) >= cfgCutEtaMax.value) - continue; - if (particle.pt() < cfgTrkLowPtCut.value) - continue; int pdgCode = std::abs(particle.pdgCode()); float pt = particle.pt(); - // All generated (no cuts) - SIGNAL LOSS DENOMINATOR - ue.fill(HIST("Inclusive/hPtPrimGenAll"), pt); - ue.fill(HIST("MC/GenPtVsNch"), pt, nGenCharged); - if (pdgCode == PDG_t::kPiPlus) + // Fill hPtPrimGenAll for ALL generated particles (NO CUTS) + if (pdgCode == PDG_t::kPiPlus) { ue.fill(HIST("Pion/hPtPrimGenAll"), pt); - else if (pdgCode == PDG_t::kKPlus) + } else if (pdgCode == PDG_t::kKPlus) { ue.fill(HIST("Kaon/hPtPrimGenAll"), pt); - else if (pdgCode == PDG_t::kProton) + } else if (pdgCode == PDG_t::kProton) { ue.fill(HIST("Proton/hPtPrimGenAll"), pt); + } + + // Fill hPtGenINEL for particles in INEL>0 events (with acceptance cuts) + if (hasParticleInAcceptance) { + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + continue; + if (particle.pt() < cfgTrkLowPtCut.value) + continue; - // Physics selected - SIGNAL LOSS NUMERATOR & EFFICIENCY DENOMINATOR - if (isPhysicsSelected) { - ue.fill(HIST("Inclusive/hPtPrimGen"), pt); - ue.fill(HIST("Inclusive/hPtDenEff"), pt); - ue.fill(HIST("MC/GenPtVsNch_PhysicsSelected"), pt, nGenCharged); if (pdgCode == PDG_t::kPiPlus) { - ue.fill(HIST("Pion/hPtPrimGen"), pt); - ue.fill(HIST("Pion/hPtDenEff"), pt); + ue.fill(HIST("Pion/hPtGenINEL"), pt); + ue.fill(HIST("Pion/hPtGenINEL_Mult"), pt, nGenCharged); } else if (pdgCode == PDG_t::kKPlus) { - ue.fill(HIST("Kaon/hPtPrimGen"), pt); - ue.fill(HIST("Kaon/hPtDenEff"), pt); + ue.fill(HIST("Kaon/hPtGenINEL"), pt); + ue.fill(HIST("Kaon/hPtGenINEL_Mult"), pt, nGenCharged); } else if (pdgCode == PDG_t::kProton) { - ue.fill(HIST("Proton/hPtPrimGen"), pt); - ue.fill(HIST("Proton/hPtDenEff"), pt); + ue.fill(HIST("Proton/hPtGenINEL"), pt); + ue.fill(HIST("Proton/hPtGenINEL_Mult"), pt, nGenCharged); } } - // Bad vertex for signal loss study - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { - ue.fill(HIST("Inclusive/hPtPrimBadVertex"), pt); - if (pdgCode == PDG_t::kPiPlus) - ue.fill(HIST("Pion/hPtPrimBadVertex"), pt); - else if (pdgCode == PDG_t::kKPlus) - ue.fill(HIST("Kaon/hPtPrimBadVertex"), pt); - else if (pdgCode == PDG_t::kProton) - ue.fill(HIST("Proton/hPtPrimBadVertex"), pt); + // Apply acceptance cuts for physics-selected spectra + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + continue; + if (particle.pt() < cfgTrkLowPtCut.value) + continue; + + // Fill generated spectra (physics selected only) + if (physicsSelected) { + ue.fill(HIST("Inclusive/hPtGen"), pt); + + if (pdgCode == PDG_t::kPiPlus) { + ue.fill(HIST("Pion/hPtGen"), pt); + } else if (pdgCode == PDG_t::kKPlus) { + ue.fill(HIST("Kaon/hPtGen"), pt); + } else if (pdgCode == PDG_t::kProton) { + ue.fill(HIST("Proton/hPtGen"), pt); + } } } } @@ -736,55 +589,34 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, std::map recoToMcMap; std::map recoToCentMap; - size_t iLabel = 0; - size_t nCollisions = collisions.size(); - for (const auto& label : labels) { - if (iLabel < nCollisions) { - const auto& collision = collisions.iteratorAt(iLabel); - recoToMcMap[collision.globalIndex()] = label.mcCollisionId(); - } - iLabel++; + size_t nPairs = std::min(labels.size(), collisions.size()); + for (size_t i = 0; i < nPairs; ++i) { + const auto& collision = collisions.iteratorAt(i); + const auto& label = labels.iteratorAt(i); + recoToMcMap[collision.globalIndex()] = label.mcCollisionId(); } - size_t iCent = 0; - for (const auto& cent : centTable) { - if (iCent < nCollisions) { - const auto& collision = collisions.iteratorAt(iCent); - float centValue = cent.centFT0M(); - recoToCentMap[collision.globalIndex()] = centValue; - ue.fill(HIST("Centrality/hCentRaw"), centValue); - } - iCent++; + size_t nCentPairs = std::min(centTable.size(), collisions.size()); + for (size_t i = 0; i < nCentPairs; ++i) { + const auto& collision = collisions.iteratorAt(i); + const auto& cent = centTable.iteratorAt(i); + float centValue = cent.centFT0M(); + recoToCentMap[collision.globalIndex()] = centValue; + ue.fill(HIST("Centrality/hCentRaw"), centValue); } - LOG(info) << "\n--- PROCESSING RECONSTRUCTED COLLISIONS ---"; - std::set reconstructedMCCollisions; std::set selectedMCCollisions; - // For cut statistics - std::vector centAll, centVertex, centINEL, centSelected; - int nRecoCollisions = 0; - int nSelectedEvents = 0; - int nRejectedEvents = 0; - int nNoMCMatch = 0; - int nNoCent = 0; - int nInvalidCent = 0; - int nPassVertex = 0; - int nPassINEL = 0; - int nPassAll = 0; - for (const auto& collision : collisions) { - nRecoCollisions++; - int64_t collId = collision.globalIndex(); - ue.fill(HIST("CutFlow/hCutStats"), 1); + int64_t collId = collision.globalIndex(); + + // MC matching auto mcIt = recoToMcMap.find(collId); - if (mcIt == recoToMcMap.end()) { - nNoMCMatch++; + if (mcIt == recoToMcMap.end()) continue; - } ue.fill(HIST("CutFlow/hCutStats"), 2); int64_t mcCollId = mcIt->second; @@ -796,69 +628,46 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, auto inelIt = mcCollisionToINELClass.find(mcCollId); int inelClass = (inelIt != mcCollisionToINELClass.end()) ? inelIt->second : 0; + // Centrality auto centIt = recoToCentMap.find(collId); - if (centIt == recoToCentMap.end()) { - nNoCent++; + if (centIt == recoToCentMap.end()) continue; - } ue.fill(HIST("CutFlow/hCutStats"), 3); + float cent = centIt->second; - if (cent < 0 || cent > CentBinMax) { - nInvalidCent++; + if (cent < 0 || cent > CentBinMax) continue; - } - // Store all events with valid info - centAll.push_back(cent); - ue.fill(HIST("Centrality/hCentVsMult"), cent, nGenCharged); - ue.fill(HIST("Centrality/hMultVsCent"), nGenCharged, cent); - ue.fill(HIST("Centrality/hCentVsVz"), cent, collision.posZ()); - ue.fill(HIST("INEL/hINELVsCent"), cent, inelClass); + // Store centrality for this MC collision (used later for MC truth plots) + mcCollToCentFromReco[mcCollId] = cent; - // Track cuts progressively + // Vertex cut bool passVertex = std::abs(collision.posZ()) <= cfgCutVertex.value; - if (passVertex) { - centVertex.push_back(cent); - ue.fill(HIST("Centrality/hCentAfterVtx"), cent); - ue.fill(HIST("CutFlow/hCutStats"), 4); - ue.fill(HIST("CutFlow/hCentPerCut"), 4, cent); - nPassVertex++; - } + if (!passVertex) + continue; + ue.fill(HIST("CutFlow/hCutStats"), 4); + ue.fill(HIST("Centrality/hCentAfterVtx"), cent); + // INEL cut bool passINEL = true; if (cfgINELCut.value == INELgt0 && inelClass < INELgt0) passINEL = false; if (cfgINELCut.value == INELgt1 && inelClass < INELgt1) passINEL = false; - if (passINEL) { - centINEL.push_back(cent); - ue.fill(HIST("Centrality/hCentAfterINEL"), cent); - ue.fill(HIST("CutFlow/hCutStats"), 5); - ue.fill(HIST("CutFlow/hCentPerCut"), 5, cent); - nPassINEL++; - } - - ue.fill(HIST("MC/EventLoss/GenMultVsCent"), cent, nGenCharged); - ue.fill(HIST("MC/EventLoss/NchGenerated_Reconstructed"), nGenCharged); - reconstructedMCCollisions.insert(mcCollId); - - bool passedAll = passVertex && passINEL; - if (!passedAll) { - ue.fill(HIST("MC/EventLoss/GenMultVsCent_Rejected"), cent, nGenCharged); - nRejectedEvents++; + if (!passINEL) continue; - } - // Event passed all selections - centSelected.push_back(cent); + // Event passed all cuts + ue.fill(HIST("CutFlow/hCutStats"), 5); ue.fill(HIST("Centrality/hCentAfterAll"), cent); - ue.fill(HIST("CutFlow/hCutStats"), 6); - ue.fill(HIST("CutFlow/hCentPerCut"), 6, cent); + ue.fill(HIST("MC/EventLoss/GenMultVsCent_Selected"), cent, nGenCharged); + ue.fill(HIST("Centrality/hCentVsMult"), cent, nGenCharged); + ue.fill(HIST("Centrality/hMultVsCent"), nGenCharged, cent); ue.fill(HIST("hvtxZ"), collision.posZ()); + selectedMCCollisions.insert(mcCollId); - nSelectedEvents++; - nPassAll++; + reconstructedMCCollisions.insert(mcCollId); // Get magnetic field for phi cut float magField = 0; @@ -867,160 +676,158 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks, magField = getMagneticField(bc.timestamp()); } - // Process tracks in selected events int nTracksInEvent = 0; + for (const auto& track : tracks) { if (!track.has_collision()) continue; if (track.collisionId() != collId) continue; - // Fill phi cut monitoring before cut - if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { - float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); - ue.fill(HIST("PhiCut/hPtVsPhiPrimeBefore"), track.pt(), phiPrime); - } - if (!passesTrackSelection(track, magField)) continue; - // Fill phi cut monitoring after cut - if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { - float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); - ue.fill(HIST("PhiCut/hPtVsPhiPrimeAfter"), track.pt(), phiPrime); - } - nTracksInEvent++; - // Fill TPC cluster histograms ue.fill(HIST("hNclFoundTPC"), track.tpcNClsFound()); ue.fill(HIST("hNclPIDTPC"), track.tpcNClsPID()); - ue.fill(HIST("hNclFoundTPCvsPt"), track.pt(), track.tpcNClsFound()); - ue.fill(HIST("hNclPIDTPCvsPt"), track.pt(), track.tpcNClsPID()); - - // Inclusive histograms - ALWAYS fill for ALL tracks - ue.fill(HIST("Inclusive/hPtAllReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtAllRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Inclusive/hPtMeasuredVsCent"), track.pt(), cent); ue.fill(HIST("hEta"), track.eta()); ue.fill(HIST("hPhi"), track.phi()); + ue.fill(HIST("Inclusive/hPtReco"), track.pt()); - // MC matching - FIXED: NO PID requirement for efficiency numerator if (track.has_mcParticle()) { const auto& particle = track.mcParticle(); int pdgCode = std::abs(particle.pdgCode()); - if (particle.isPhysicalPrimary()) { - // Fill efficiency numerator for ALL primaries regardless of PID - ue.fill(HIST("Inclusive/hPtNumEff"), particle.pt()); - ue.fill(HIST("Inclusive/hPtNumEffVsCent"), particle.pt(), cent); - ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtPrimRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Inclusive/hPtPrimRecoEv"), particle.pt()); - - // Per-species efficiency numerator - NO PID requirement! - if (pdgCode == PDG_t::kPiPlus) { - ue.fill(HIST("Pion/hPtNumEff"), particle.pt()); - ue.fill(HIST("Pion/hPtNumEffVsCent"), particle.pt(), cent); + if (pdgCode == PDG_t::kPiPlus) { + ue.fill(HIST("Pion/hPtReco"), track.pt()); + if (particle.isPhysicalPrimary()) { ue.fill(HIST("Pion/hPtPrimReco"), track.pt()); - ue.fill(HIST("Pion/hPtPrimRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Pion/hPtPrimRecoEv"), particle.pt()); - } else if (pdgCode == PDG_t::kKPlus) { - ue.fill(HIST("Kaon/hPtNumEff"), particle.pt()); - ue.fill(HIST("Kaon/hPtNumEffVsCent"), particle.pt(), cent); + ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); + } else { + ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); + } + } else if (pdgCode == PDG_t::kKPlus) { + ue.fill(HIST("Kaon/hPtReco"), track.pt()); + if (particle.isPhysicalPrimary()) { ue.fill(HIST("Kaon/hPtPrimReco"), track.pt()); - ue.fill(HIST("Kaon/hPtPrimRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Kaon/hPtPrimRecoEv"), particle.pt()); - } else if (pdgCode == PDG_t::kProton) { - ue.fill(HIST("Proton/hPtNumEff"), particle.pt()); - ue.fill(HIST("Proton/hPtNumEffVsCent"), particle.pt(), cent); + ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); + } else { + ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); + } + } else if (pdgCode == PDG_t::kProton) { + ue.fill(HIST("Proton/hPtReco"), track.pt()); + if (particle.isPhysicalPrimary()) { ue.fill(HIST("Proton/hPtPrimReco"), track.pt()); - ue.fill(HIST("Proton/hPtPrimRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Proton/hPtPrimRecoEv"), particle.pt()); + ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); + } else { + ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); } - } else { - // Secondaries (non-primary particles) - ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); - if (pdgCode == PDG_t::kPiPlus) - ue.fill(HIST("Pion/hPtSecReco"), track.pt()); - else if (pdgCode == PDG_t::kKPlus) - ue.fill(HIST("Kaon/hPtSecReco"), track.pt()); - else if (pdgCode == PDG_t::kProton) - ue.fill(HIST("Proton/hPtSecReco"), track.pt()); } } - // PID selection - fill denominator for primary fraction and measured spectra - int bestSpecies = getBestPIDHypothesis(track); - if (bestSpecies == PartPion) { - // Denominator for pion primary fraction: all tracks identified as pions - ue.fill(HIST("Pion/hPtAllReco"), track.pt()); - ue.fill(HIST("Pion/hPtAllRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Pion/hPtMeasuredVsCent"), track.pt(), cent); - if (enablePIDHistograms) + if (passesPIDSelection(track, PartPion)) { + ue.fill(HIST("Pion/hPtMeasured"), track.pt()); + if (enablePIDHistograms) { ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } else if (bestSpecies == PartKaon) { - // Denominator for kaon primary fraction: all tracks identified as kaons - ue.fill(HIST("Kaon/hPtAllReco"), track.pt()); - ue.fill(HIST("Kaon/hPtAllRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Kaon/hPtMeasuredVsCent"), track.pt(), cent); - if (enablePIDHistograms) + } + } + + if (passesPIDSelection(track, PartKaon)) { + ue.fill(HIST("Kaon/hPtMeasured"), track.pt()); + if (enablePIDHistograms) { ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } else if (bestSpecies == PartProton) { - // Denominator for proton primary fraction: all tracks identified as protons - ue.fill(HIST("Proton/hPtAllReco"), track.pt()); - ue.fill(HIST("Proton/hPtAllRecoVsCent"), track.pt(), cent); - ue.fill(HIST("Proton/hPtMeasuredVsCent"), track.pt(), cent); - if (enablePIDHistograms) + } + } + + if (passesPIDSelection(track, PartProton)) { + ue.fill(HIST("Proton/hPtMeasured"), track.pt()); + if (enablePIDHistograms) { ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); + } } } - // Fill event-level track multiplicity ue.fill(HIST("Centrality/hRecoMultVsCent"), cent, nTracksInEvent); } - LOG(info) << "\n=== CUT STATISTICS ==="; - LOG(info) << "Total collisions with valid info: " << centAll.size(); - LOG(info) << "Pass vertex cut: " << nPassVertex << " (" - << (centAll.size() > 0 ? 100.0 * nPassVertex / centAll.size() : 0.0) << "%)"; - LOG(info) << "Pass INEL cut: " << nPassINEL << " (" - << (centAll.size() > 0 ? 100.0 * nPassINEL / centAll.size() : 0.0) << "%)"; - LOG(info) << "Pass all cuts: " << nPassAll << " (" - << (centAll.size() > 0 ? 100.0 * nPassAll / centAll.size() : 0.0) << "%)"; - LOG(info) << "Reco collisions: " << nRecoCollisions; - LOG(info) << "Selected Events: " << nSelectedEvents; - LOG(info) << "Rejected Events: " << nRejectedEvents; - LOG(info) << "No Match: " << nNoMCMatch; - LOG(info) << "No Cent: " << nNoCent; - LOG(info) << "Invalid Cent: " << nInvalidCent; - - // Calculate mean centrality at each stage - if (!centAll.empty()) { - float meanAll = std::accumulate(centAll.begin(), centAll.end(), 0.0) / centAll.size(); - float meanVertex = centVertex.empty() ? 0 : std::accumulate(centVertex.begin(), centVertex.end(), 0.0) / centVertex.size(); - float meanINEL = centINEL.empty() ? 0 : std::accumulate(centINEL.begin(), centINEL.end(), 0.0) / centINEL.size(); - float meanSelected = centSelected.empty() ? 0 : std::accumulate(centSelected.begin(), centSelected.end(), 0.0) / centSelected.size(); - - LOG(info) << "\n=== CENTRALITY MEANS ==="; - LOG(info) << "Mean centrality (all): " << meanAll; - LOG(info) << "Mean centrality (after vertex): " << meanVertex; - LOG(info) << "Mean centrality (after INEL): " << meanINEL; - LOG(info) << "Mean centrality (selected): " << meanSelected; + for (const auto& mcCollision : mcCollisions) { + int64_t mcCollId = mcCollision.globalIndex(); + + if (reconstructedMCCollisions.find(mcCollId) == reconstructedMCCollisions.end()) + continue; + + auto centIt = mcCollToCentFromReco.find(mcCollId); + if (centIt == mcCollToCentFromReco.end()) + continue; + + auto nchIt = mcCollisionToNch.find(mcCollId); + int nGenCharged = (nchIt != mcCollisionToNch.end()) ? nchIt->second : 0; + + auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); + + for (const auto& particle : particlesInCollision) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + continue; + if (!particle.isPhysicalPrimary()) + continue; + + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + continue; + if (particle.pt() < cfgTrkLowPtCut.value) + continue; + + int pdgCode = std::abs(particle.pdgCode()); + float pt = particle.pt(); + + if (pdgCode == PDG_t::kPiPlus) { + ue.fill(HIST("Pion/hPtGenRecoEvent"), pt); + ue.fill(HIST("Pion/hPtGenRecoEvent_Mult"), pt, nGenCharged); + } else if (pdgCode == PDG_t::kKPlus) { + ue.fill(HIST("Kaon/hPtGenRecoEvent"), pt); + ue.fill(HIST("Kaon/hPtGenRecoEvent_Mult"), pt, nGenCharged); + } else if (pdgCode == PDG_t::kProton) { + ue.fill(HIST("Proton/hPtGenRecoEvent"), pt); + ue.fill(HIST("Proton/hPtGenRecoEvent_Mult"), pt, nGenCharged); + } + } + } + + for (const auto& mcCollId : inel0MCCollisions) { + auto centIt = mcCollToCentFromReco.find(mcCollId); + if (centIt != mcCollToCentFromReco.end()) { + float cent = centIt->second; + int nGenCharged = mcCollisionToNch[mcCollId]; + ue.fill(HIST("MC/EventLoss/GenMultVsCent"), cent, nGenCharged); + ue.fill(HIST("hEventsINEL_Cent"), cent); + } + } + + for (const auto& mcCollId : reconstructedMCCollisions) { + auto centIt = mcCollToCentFromReco.find(mcCollId); + if (centIt != mcCollToCentFromReco.end()) { + ue.fill(HIST("hEventsReco_Cent"), centIt->second); + } } ue.fill(HIST("hEventLossBreakdown"), 1.f, physicsSelectedMCCollisions.size()); ue.fill(HIST("hEventLossBreakdown"), 2.f, reconstructedMCCollisions.size()); ue.fill(HIST("hEventLossBreakdown"), 3.f, selectedMCCollisions.size()); - float efficiency = physicsSelectedMCCollisions.size() > 0 ? 100.f * selectedMCCollisions.size() / physicsSelectedMCCollisions.size() : 0; - ue.fill(HIST("hEventLossBreakdown"), 4.f, efficiency); - - LOG(info) << "\n=== FINAL EFFICIENCY ==="; - LOG(info) << "Physics selected: " << physicsSelectedMCCollisions.size(); - LOG(info) << "Reconstructed: " << reconstructedMCCollisions.size(); - LOG(info) << "Selected: " << selectedMCCollisions.size(); - LOG(info) << "Efficiency: " << efficiency << "%"; - LOG(info) << "=== processMC END ==="; + + ue.fill(HIST("MC/GenRecoCollisions"), 4.f, reconstructedMCCollisions.size()); + ue.fill(HIST("MC/GenRecoCollisions"), 5.f, selectedMCCollisions.size()); + + LOG(info) << "\n=== EVENT STATISTICS ==="; + LOG(info) << "INEL>0 MC collisions: " << inel0MCCollisions.size(); + LOG(info) << "Physics selected MC collisions: " << physicsSelectedMCCollisions.size(); + LOG(info) << "Reconstructed collisions: " << reconstructedMCCollisions.size(); + LOG(info) << "Selected collisions: " << selectedMCCollisions.size(); + + if (physicsSelectedMCCollisions.size() > 0) { + float efficiency = 100.f * selectedMCCollisions.size() / physicsSelectedMCCollisions.size(); + LOG(info) << "Final efficiency: " << efficiency << "%"; + } } void MultiplicityPt::processData(CollisionTableData::iterator const& /*collision*/, From 9ceb227a74c2b11e382ac7d2d46914b96d79a35d Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 10 Apr 2026 03:33:06 +0530 Subject: [PATCH 223/282] [PWGLF] Refactor event selection and add RCT flag checks (#15705) --- .../Resonances/lambda1520analysisinpp.cxx | 243 ++++++++++-------- 1 file changed, 134 insertions(+), 109 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index c2e148cd774..2418f442bf4 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -13,7 +13,6 @@ /// \brief This standalone task reconstructs track-track decay of lambda(1520) resonance candidate /// \author Hirak Kumar Koley -#include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" #include "Common/DataModel/Centrality.h" @@ -37,6 +36,7 @@ using namespace o2; using namespace o2::soa; using namespace o2::aod; +using namespace o2::aod::rctsel; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; @@ -85,23 +85,19 @@ struct Lambda1520analysisinpp { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Service pdg; - - /// Event cuts - o2::analysis::CollisonCuts colCuts; + RCTFlagsChecker rctChecker; struct : ConfigurableGroup { Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.0f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable cfgEvtOccupancyInTimeRangeMax{"cfgEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; - Configurable cfgEvtOccupancyInTimeRangeMin{"cfgEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; - Configurable cfgEvtSel8{"cfgEvtSel8", false, "Evt Sel 8 check for offline selection"}; Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", true, "Evt sel: triggerTVX selection (MB)"}; Configurable cfgEvtNoTFBorderCut{"cfgEvtNoTFBorderCut", true, "Evt sel: apply TF border cut"}; - Configurable cfgEvtIsVertexITSTPC{"cfgEvtIsVertexITSTPC", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; - Configurable cfgEvtIsGoodZvtxFT0vsPV{"cfgEvtIsGoodZvtxFT0vsPV", true, "Evt sel: apply Z-vertex time difference"}; - Configurable cfgEvtNoSameBunchPileup{"cfgEvtNoSameBunchPileup", false, "Evt sel: apply pileup rejection"}; Configurable cfgEvtNoITSROFrameBorderCut{"cfgEvtNoITSROFrameBorderCut", false, "Evt sel: apply NoITSRO border cut"}; - Configurable cfgEvtNoCollInTimeRangeStandard{"cfgEvtNoCollInTimeRangeStandard", false, "Evt sel: apply NoNoCollInTimeRangeStandard"}; - Configurable cfgEvtIsVertexTOFmatched{"cfgEvtIsVertexTOFmatched", true, "kIsVertexTOFmatched: apply vertex TOF matched"}; + Configurable cfgEvtIsRCTFlagpassed{"cfgEvtIsRCTFlagpassed", false, "Evt sel: apply RCT flag selection"}; + Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; + Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; + Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; + Configurable cfgEvtSel8{"cfgEvtSel8", false, "Evt Sel 8 check for offline selection"}; + Configurable cfgEvtIsINELgt0{"cfgEvtIsINELgt0", false, "Evt sel: apply INEL>0 selection"}; } configEvents; struct : ConfigurableGroup { @@ -238,18 +234,7 @@ struct Lambda1520analysisinpp { void init(framework::InitContext&) { - colCuts.setCuts(configEvents.cfgEvtZvtx, /* configEvents.cfgEvtTriggerCheck */ false, configEvents.cfgEvtSel8, /*checkRun3*/ true, /*triggerTVXsel*/ false, configEvents.cfgEvtOccupancyInTimeRangeMax, configEvents.cfgEvtOccupancyInTimeRangeMin); - - colCuts.init(&histos); - colCuts.setTriggerTVX(configEvents.cfgEvtTriggerTVXSel); - colCuts.setApplyTFBorderCut(configEvents.cfgEvtNoTFBorderCut); - colCuts.setApplyITSTPCvertex(configEvents.cfgEvtIsVertexITSTPC); - colCuts.setApplyZvertexTimedifference(configEvents.cfgEvtIsGoodZvtxFT0vsPV); - colCuts.setApplyPileupRejection(configEvents.cfgEvtNoSameBunchPileup); - colCuts.setApplyNoITSROBorderCut(configEvents.cfgEvtNoITSROFrameBorderCut); - colCuts.setApplyCollInTimeRangeStandard(configEvents.cfgEvtNoCollInTimeRangeStandard); - colCuts.setApplyVertexTOFmatched(configEvents.cfgEvtIsVertexTOFmatched); - colCuts.printCuts(); + rctChecker.init(configEvents.cfgEvtRCTFlagCheckerLabel, configEvents.cfgEvtRCTFlagCheckerZDCCheck, configEvents.cfgEvtRCTFlagCheckerLimitAcceptAsBad); // axes AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -270,10 +255,23 @@ struct Lambda1520analysisinpp { AxisSpec axisVtxMix{configBkg.cfgVtxBins, "Vertex Z (cm)"}; AxisSpec idxMCAxis = {26, -0.5f, 25.5f, "Index"}; + histos.add("CollCutCounts", "No. of event after cuts", kTH1I, {{10, 0, 10}}); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(1, "All Events"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(2, "|Vz| < cut"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(4, "kNoTimeFrameBorder"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(5, "kNoITSROFrameBorder"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(6, "rctChecker"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(7, "sel8"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(8, "IsINELgt0"); + histos.get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(9, "All Passed Events"); + + histos.add("Event/posZ", "; vtx_{z} (cm); Entries", HistType::kTH1F, {{250, -12.5, 12.5}}); + histos.add("Event/centFT0M", "; FT0M Percentile; Entries", HistType::kTH1F, {{110, 0, 110}}); + if (cFilladditionalQAeventPlots) { // event histograms if (doprocessData) { - histos.add("QAevent/hEvents", "INEL>0 Events", HistType::kTH1F, {{2, 0.5f, 2.5f}}); histos.add("QAevent/hPairsCounterSameE", "total valid no. of pairs sameE", HistType::kTH1F, {{1, 0.5f, 1.5f}}); histos.add("QAevent/hnTrksSameE", "n tracks per event SameE", HistType::kTH1F, {{1000, 0.0, 1000.0}}); } @@ -290,9 +288,6 @@ struct Lambda1520analysisinpp { histos.add("QAevent/hMultiplicityPercentMixedE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0f, 120.0f}}); histos.add("QAevent/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0f, 1000.0f}}); } - if (doprocessMCRec) { - histos.add("QAevent/hEventsMC", "INEL>0 Events MC", HistType::kTH1F, {{2, 0.5f, 2.5f}}); - } } if (doprocessData) { @@ -429,14 +424,14 @@ struct Lambda1520analysisinpp { histos.add("Result/MC/h3lambda1520Recoinvmass", "Invariant mass of Reconstructed MC #Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); histos.add("Result/MC/h3antilambda1520Recoinvmass", "Invariant mass of Reconstructed MC Anti-#Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); } - if (doprocessdummy) { - histos.add("Result/dummy/Genprotonpt", "pT distribution of #Lambda(1520) from Proton", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/dummy/Genlambdapt", "pT distribution of #Lambda(1520) from #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/dummy/Genxipt", "pT distribution of #Lambda(1520) from #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); - - histos.add("Result/dummy/GenTrueprotonpt", "pT distribution of True MC Proton", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/dummy/GenTruelambdapt", "pT distribution of True MC #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/dummy/GenTruexipt", "pT distribution of True MC #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); + if (doprocessSignalLoss) { + histos.add("Result/SignalLoss/Genprotonpt", "pT distribution of #Lambda(1520) from Proton", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/SignalLoss/Genlambdapt", "pT distribution of #Lambda(1520) from #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/SignalLoss/Genxipt", "pT distribution of #Lambda(1520) from #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); + + histos.add("Result/SignalLoss/GenTrueprotonpt", "pT distribution of True MC Proton", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/SignalLoss/GenTruelambdapt", "pT distribution of True MC #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/SignalLoss/GenTruexipt", "pT distribution of True MC #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); } // Print output histograms statistics @@ -469,6 +464,52 @@ struct Lambda1520analysisinpp { return returnValue; } + template + bool isSelected(const Coll& collision, bool fillHist = true) + { + auto applyCut = [&](bool enabled, bool condition, int bin) { + if (!enabled) + return true; + if (!condition) + return false; + if (fillHist) + histos.fill(HIST("CollCutCounts"), bin); + return true; + }; + + if (fillHist) + histos.fill(HIST("CollCutCounts"), 0); + + if (!applyCut(true, std::abs(collision.posZ()) <= configEvents.cfgEvtZvtx, 1)) + return false; + + if (!applyCut(configEvents.cfgEvtTriggerTVXSel, + collision.selection_bit(aod::evsel::kIsTriggerTVX), 2)) + return false; + + if (!applyCut(configEvents.cfgEvtNoTFBorderCut, + collision.selection_bit(aod::evsel::kNoTimeFrameBorder), 3)) + return false; + + if (!applyCut(configEvents.cfgEvtNoITSROFrameBorderCut, + collision.selection_bit(aod::evsel::kNoITSROFrameBorder), 4)) + return false; + + if (!applyCut(configEvents.cfgEvtIsRCTFlagpassed, rctChecker(collision), 5)) + return false; + + if (!applyCut(configEvents.cfgEvtSel8, collision.sel8(), 6)) + return false; + + if (!applyCut(configEvents.cfgEvtIsINELgt0, collision.isInelGt0(), 7)) + return false; + + if (fillHist) + histos.fill(HIST("CollCutCounts"), 8); + + return true; + } + template bool trackCut(const TrackType track) { @@ -1032,21 +1073,13 @@ struct Lambda1520analysisinpp { void processData(EventCandidates::iterator const& collision, TrackCandidates const& tracks) { - if (!colCuts.isSelected(collision)) // Default event selection - return; - - if (cFilladditionalQAeventPlots) { - histos.fill(HIST("QAevent/hEvents"), 1); - } - - if (!collision.isInelGt0()) // <-- + if (!isSelected(collision)) // Default event selection return; - if (cFilladditionalQAeventPlots) { - histos.fill(HIST("QAevent/hEvents"), 2); - } + auto centrality = centEst(collision); - colCuts.fillQA(collision); + histos.fill(HIST("Event/posZ"), collision.posZ()); + histos.fill(HIST("Event/centFT0M"), centrality); fillHistograms(collision, tracks, tracks); } @@ -1054,7 +1087,7 @@ struct Lambda1520analysisinpp { void processRotational(EventCandidates::iterator const& collision, TrackCandidates const& tracks) { - if (!colCuts.isSelected(collision, false)) // Default event selection + if (!isSelected(collision, false)) // Default event selection return; if (!collision.isInelGt0()) // <-- @@ -1068,21 +1101,13 @@ struct Lambda1520analysisinpp { aod::McCollisions const&, MCTrackCandidates const& tracks, aod::McParticles const&) { - if (!colCuts.isSelected(collision)) + if (!isSelected(collision)) return; - if (cFilladditionalQAeventPlots) { - histos.fill(HIST("QAevent/hEventsMC"), 1); - } - - if (!collision.isInelGt0()) // <-- - return; - - if (cFilladditionalQAeventPlots) { - histos.fill(HIST("QAevent/hEventsMC"), 2); - } + auto centrality = centEst(collision); - colCuts.fillQA(collision); + histos.fill(HIST("Event/posZ"), collision.posZ()); + histos.fill(HIST("Event/centFT0M"), centrality); fillHistograms(collision, tracks, tracks); } @@ -1092,7 +1117,7 @@ struct Lambda1520analysisinpp { void processMCGen(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { - bool isInAfterAllCuts = colCuts.isSelected(collision, false); + bool isInAfterAllCuts = isSelected(collision, false); bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = collision.sel8(); @@ -1264,10 +1289,10 @@ struct Lambda1520analysisinpp { // LOGF(info, "Mixed event tracks pair: (%d, %d) from events (%d, %d)", t1.index(), t2.index(), collision1.index(), collision2.index()); // } - if (!colCuts.isSelected(collision1, false)) // Default event selection + if (!isSelected(collision1, false)) // Default event selection continue; - if (!colCuts.isSelected(collision2, false)) // Default event selection + if (!isSelected(collision2, false)) // Default event selection continue; if (!collision1.isInelGt0()) // <-- @@ -1295,9 +1320,9 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processME, "Process EventMixing light without partition", false); - void processdummy(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) + void processSignalLoss(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { - bool isInAfterAllCuts = colCuts.isSelected(collision, false); + bool isInAfterAllCuts = isSelected(collision, false); bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = collision.sel8(); @@ -1329,25 +1354,25 @@ struct Lambda1520analysisinpp { if (std::abs(part.pdgCode()) == kProton) { // true proton - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 0, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 0, pt, centrality); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 1, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 1, pt, centrality); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 2, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 2, pt, centrality); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 3, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 3, pt, centrality); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 4, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 4, pt, centrality); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 5, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 5, pt, centrality); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/GenTrueprotonpt"), 6, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 6, pt, centrality); float ptL = computePtL(pt, massPr); if (ptL < 0) @@ -1358,49 +1383,49 @@ struct Lambda1520analysisinpp { else weight = 1.f; - histos.fill(HIST("Result/dummy/Genprotonpt"), 0, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 0, ptL, centrality, weight); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/Genprotonpt"), 1, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 1, ptL, centrality, weight); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/Genprotonpt"), 2, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 2, ptL, centrality, weight); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/Genprotonpt"), 3, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 3, ptL, centrality, weight); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/Genprotonpt"), 4, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 4, ptL, centrality, weight); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/Genprotonpt"), 5, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 5, ptL, centrality, weight); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/Genprotonpt"), 6, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 6, ptL, centrality, weight); } if (std::abs(part.pdgCode()) == kLambda0) { // true lambda - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 0, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 0, pt, centrality); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 1, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 1, pt, centrality); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 2, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 2, pt, centrality); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 3, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 3, pt, centrality); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 4, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 4, pt, centrality); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 5, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 5, pt, centrality); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/GenTruelambdapt"), 6, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 6, pt, centrality); float ptL = computePtL(pt, MassLambda0); if (ptL < 0) @@ -1411,49 +1436,49 @@ struct Lambda1520analysisinpp { else weight = 1.f; - histos.fill(HIST("Result/dummy/Genlambdapt"), 0, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 0, ptL, centrality, weight); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/Genlambdapt"), 1, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 1, ptL, centrality, weight); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/Genlambdapt"), 2, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 2, ptL, centrality, weight); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/Genlambdapt"), 3, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 3, ptL, centrality, weight); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/Genlambdapt"), 4, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 4, ptL, centrality, weight); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/Genlambdapt"), 5, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 5, ptL, centrality, weight); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/Genlambdapt"), 6, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 6, ptL, centrality, weight); } if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { // true Xi - histos.fill(HIST("Result/dummy/GenTruexipt"), 0, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 0, pt, centrality); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/GenTruexipt"), 1, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 1, pt, centrality); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/GenTruexipt"), 2, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 2, pt, centrality); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/GenTruexipt"), 3, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 3, pt, centrality); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/GenTruexipt"), 4, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 4, pt, centrality); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/GenTruexipt"), 5, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 5, pt, centrality); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/GenTruexipt"), 6, pt, centrality); + histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 6, pt, centrality); float ptL = computePtL(pt, MassXiMinus); if (ptL < 0) @@ -1464,29 +1489,29 @@ struct Lambda1520analysisinpp { else weight = 1.f; - histos.fill(HIST("Result/dummy/Genxipt"), 0, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 0, ptL, centrality, weight); if (inVtx10) // vtx10 - histos.fill(HIST("Result/dummy/Genxipt"), 1, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 1, ptL, centrality, weight); if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/dummy/Genxipt"), 2, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 2, ptL, centrality, weight); if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/dummy/Genxipt"), 3, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 3, ptL, centrality, weight); if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/dummy/Genxipt"), 4, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 4, ptL, centrality, weight); if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/dummy/Genxipt"), 5, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 5, ptL, centrality, weight); if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/dummy/Genxipt"), 6, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt"), 6, ptL, centrality, weight); } } } - PROCESS_SWITCH(Lambda1520analysisinpp, processdummy, "Process dummy", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processSignalLoss, "Process SignalLoss", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 3ffd34499c1cd4ecc6796f122315cccdf141d332 Mon Sep 17 00:00:00 2001 From: Jinhyun Park <125851562+jinhyunni@users.noreply.github.com> Date: Fri, 10 Apr 2026 13:26:27 +0900 Subject: [PATCH 224/282] [PWGHF] Xic0Omegac0: Fix bachelor Id in output table (#15698) Co-authored-by: Jinhyun Park --- .../TableProducer/candidateCreatorXic0Omegac0Qa.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx index 0be6fe96bc5..20b4fcaf307 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx @@ -773,7 +773,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { impactParameterCasc.getZ(), impactParameterCharmBach.getZ(), std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterCharmBach.getSigmaY2()), cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), - cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cascAodElement.bachelorId(), mLambda, mCasc, massCharmBaryonCand, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, @@ -802,7 +802,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { impactParameterCasc.getZ(), impactParameterCharmBach.getZ(), std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterCharmBach.getSigmaY2()), cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), - cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cascAodElement.bachelorId(), mLambda, mCasc, massCharmBaryonCand, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, @@ -831,7 +831,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { impactParameterCasc.getZ(), impactParameterCharmBach.getZ(), std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterCharmBach.getSigmaY2()), cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), - cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cascAodElement.bachelorId(), mLambda, mCasc, massCharmBaryonCand, cpaV0, cpaCharmBaryon, cpaCasc, cpaxyV0, cpaxyCharmBaryon, cpaxyCasc, @@ -1256,7 +1256,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { pVecV0DauPos[0], pVecV0DauPos[1], pVecV0DauPos[2], pVecV0DauNeg[0], pVecV0DauNeg[1], pVecV0DauNeg[2], cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), - cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cascAodElement.bachelorId(), massLam, massCasc, massCharmBaryon, cosPaV0ToPv, cosPaCascToPv, ctCasc, ctV0, ctCharmBaryon, @@ -1294,7 +1294,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { impactParameterCasc.getZ(), impactParameterCharmBachelor.getZ(), std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterCharmBachelor.getSigmaY2()), cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), - cand.cascadeId(), trackCharmBachelor.globalIndex(), cand.prong0Id(), + cand.cascadeId(), trackCharmBachelor.globalIndex(), cascAodElement.bachelorId(), massLam, massCasc, massCharmBaryon, cosPaV0ToPv, cosPaCharmBaryonToPv, cosPaCascToPv, cosPaXYV0ToPv, cosPaXYCharmBaryonToPv, cosPaXYCascToPv, ctCharmBaryon, ctCasc, ctV0, @@ -1347,7 +1347,7 @@ struct HfCandidateCreatorXic0Omegac0Qa { massLam, sigMassLam, massCasc, sigMassCasc, massCascRej, sigMassCascRej, massCharmBaryon, sigMassCharmBaryon, ptCharmBaryon, ptCharmBachelor, ptCasc, cosThetaStarKaFromOmegac0, cosThetaStarKaFromXic0, ctV0, ctCasc, ctCharmBaryon, - cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), cand.cascadeId(), cand.prong0Id(), trackCharmBachelor.globalIndex()); + cascAodElement.v0Id(), v0AodElement.posTrackId(), v0AodElement.negTrackId(), cand.cascadeId(), cascAodElement.bachelorId(), trackCharmBachelor.globalIndex()); } } // end candidate loop } // end of runCreator From 1f37453cae25a4df721e341a0ab5a2a0658cab73 Mon Sep 17 00:00:00 2001 From: MaolinZH <109225729+MaolinZH@users.noreply.github.com> Date: Fri, 10 Apr 2026 09:42:31 +0200 Subject: [PATCH 225/282] [PWGHF] add new classifications for like-sign muon pairs (#15683) --- PWGHF/HFL/Tasks/taskSingleMuonSource.cxx | 103 ++++++++++++++--------- 1 file changed, 61 insertions(+), 42 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index aea4ee26bea..e2d209966dc 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.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. -// -// \file taskSingleMuonSource.cxx -// \brief Task used to seperate single muons source in Monte Carlo simulation. -// \author Maolin Zhang , CCNU +/// +/// \file taskSingleMuonSource.cxx +/// \brief Task used to seperate single muons source in Monte Carlo simulation. +/// \author Maolin Zhang , CCNU #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include -#include #include #include @@ -78,6 +78,8 @@ struct HfTaskSingleMuonSource { Configurable charge{"charge", 0, "Muon track charge, validated values are 0, 1 and -1, 0 represents both 1 and -1"}; Configurable pairSource{"pairSource", true, "check also the source of like-sign muon pairs"}; + Service pdgDB; + double pDcaMax = 594.0; // p*DCA maximum value for small Rab double pDcaMax2 = 324.0; // p*DCA maximum value for large Rabs double rAbsMid = 26.5; // R at absorber end minimum value @@ -116,7 +118,7 @@ struct HfTaskSingleMuonSource { HistogramConfigSpec const h1ColNumber{HistType::kTH1F, {axisColNumber}}; HistogramConfigSpec const h1Pt{HistType::kTH1F, {axisPt}}; - HistogramConfigSpec h1Mass{HistType::kTH1F, {axisMass}}; + HistogramConfigSpec const h1Mass{HistType::kTH1F, {axisMass}}; HistogramConfigSpec const h2PtDCA{HistType::kTH2F, {axisPt, axisDCA}}; HistogramConfigSpec const h2PtChi2{HistType::kTH2F, {axisPt, axisChi2}}; HistogramConfigSpec const h2PtDeltaPt{HistType::kTH2F, {axisPt, axisDeltaPt}}; @@ -125,9 +127,11 @@ struct HfTaskSingleMuonSource { registry.add("h1MuBeforeCuts", "", h1Pt); registry.add("h1MuonMass", "", h1Mass); registry.add("h1BeautyMass", "", h1Mass); + registry.add("h1CorrBeautyMass", "", h1Mass); registry.add("h1OtherMass", "", h1Mass); registry.add("h1MuonMassGen", "", h1Mass); registry.add("h1BeautyMassGen", "", h1Mass); + registry.add("h1CorrBeautyMassGen", "", h1Mass); registry.add("h1OtherMassGen", "", h1Mass); for (const auto& src : muonSources) { registry.add(Form("h1%sPt", src.Data()), "", h1Pt); @@ -141,6 +145,8 @@ struct HfTaskSingleMuonSource { uint8_t getMask(const McMuons::iterator& muon) { uint8_t mask(0); + const int diquarkEdge = 1000; + const int hadronEdge = 10000; if (muon.has_mcParticle()) { SETBIT(mask, IsIdentified); } else { @@ -159,7 +165,7 @@ struct HfTaskSingleMuonSource { mcPart = *(mcPart.mothers_first_as()); const auto pdgAbs(std::abs(mcPart.pdgCode())); - if (pdgAbs < 10 || pdgAbs == 21) { + if (pdgAbs < kElectron || pdgAbs == kGluon) { break; // Quark and gluon } @@ -168,40 +174,39 @@ struct HfTaskSingleMuonSource { continue; } - if (pdgAbs == kTauMinus) { - // Tau + if (pdgAbs == kTauMinus) { // Tau SETBIT(mask, HasTauParent); continue; } const int pdgRem(pdgAbs % 100000); + const int pdgRemRem(pdgRem % 100); if (pdgRem == kProton) { continue; } // Beam particle - if ((pdgRem < 100) || (pdgRem >= 10000)) { + if ((pdgRem < kPi0) || (pdgRem >= hadronEdge)) { continue; } - if ((pdgRem % 100 == 1 || pdgRem % 100 == 3) && pdgRem > 1000) { // diquarks + if ((pdgRemRem == kDown || pdgRemRem == kStrange) && pdgRem > diquarkEdge) { // diquarks continue; } // compute the flavor of constituent quark const int flv(pdgRem / std::pow(10, static_cast(std::log10(pdgRem)))); - if (flv > 6) { + if (flv > kTop) { // no more than 6 flavors continue; } - if (flv < 4) { + if (flv < kCharm) { // light flavor SETBIT(mask, HasLightParent); continue; } - - auto* pdgData(TDatabasePDG::Instance()->GetParticle(mcPart.pdgCode())); + auto* pdgData = pdgDB->GetParticle(mcPart.pdgCode()); if ((pdgData != nullptr) && (pdgData->AntiParticle() == nullptr)) { SETBIT(mask, HasQuarkoniumParent); - } else if (flv == 4) { + } else if (flv == kCharm) { SETBIT(mask, HasCharmParent); } else { SETBIT(mask, HasBeautyParent); @@ -274,11 +279,13 @@ struct HfTaskSingleMuonSource { // fill the histograms of each particle types void fillHistograms(const McMuons::iterator& muon) { + const int type0 = 0; + const int type2 = 2; const auto mask(getMask(muon)); const auto pt(muon.pt()), chi2(muon.chi2MatchMCHMFT()); const auto dca(RecoDecay::sqrtSumOfSquares(muon.fwdDcaX(), muon.fwdDcaY())); - if (trackType == 0 || trackType == 2) { + if (trackType == type0 || trackType == type2) { if (!muon.has_matchMCHTrack()) { return; } @@ -344,6 +351,8 @@ struct HfTaskSingleMuonSource { int traceAncestor(const McMuons::iterator& muon, aod::McParticles const& mctracks) { int mcNum = 0; + const int hadronStatus = 80; + const int diquarkEdge = 1000; if (!muon.has_mcParticle()) { return 0; } @@ -353,36 +362,38 @@ struct HfTaskSingleMuonSource { } while (mcPart.has_mothers()) { // the first hadron after hadronization auto mother = mcPart.mothers_first_as(); - if (std::abs(mother.getGenStatusCode()) < 80) { + if (std::abs(mother.getGenStatusCode()) < hadronStatus) { break; } mcPart = mother; } int flv = mcPart.pdgCode() / std::pow(10, static_cast(std::log10(std::abs(mcPart.pdgCode())))); - if (abs(flv) == 5 && mcPart.pdgCode() < 1000) + if (std::abs(flv) == kBottom && mcPart.pdgCode() < diquarkEdge) { flv = -flv; + } for (int i = (mcPart.mothers_first_as()).globalIndex(); i <= (mcPart.mothers_last_as()).globalIndex(); i++) { // loop over the lund string - for (auto mctrack : mctracks) { + for (const auto& mctrack : mctracks) { if (mctrack.globalIndex() != i) { continue; } - if ((mctrack.pdgCode() != flv) && (abs(mctrack.pdgCode()) < abs(flv) * 1000)) { + if ((mctrack.pdgCode() != flv) && (std::abs(mctrack.pdgCode()) < std::abs(flv) * 1000)) { continue; } - while (mctrack.has_mothers()) { - int motherflv = (mctrack.mothers_first_as()).pdgCode() / std::pow(10, static_cast(std::log10(abs((mctrack.mothers_first_as()).pdgCode())))); // find the mother with same flavor - auto mother = (abs(motherflv) == abs(flv)) ? (mctrack.mothers_first_as()) : (mctrack.mothers_last_as()); - if ((mother.pdgCode() != mctrack.pdgCode()) && (abs(mctrack.pdgCode()) < 10)) { // both mother is not the the quark with same flavor - mcNum = mctrack.globalIndex(); + auto currentTrk = mctrack; + while (currentTrk.has_mothers()) { + int motherflv = (currentTrk.mothers_first_as()).pdgCode() / std::pow(10, static_cast(std::log10(std::abs((currentTrk.mothers_first_as()).pdgCode())))); // find the mother with same flavor + auto mother = (std::abs(motherflv) == std::abs(flv)) ? (currentTrk.mothers_first_as()) : (currentTrk.mothers_last_as()); + if ((mother.pdgCode() != currentTrk.pdgCode()) && (std::abs(currentTrk.pdgCode()) < kElectron)) { // both mother is not the the quark with same flavor + mcNum = currentTrk.globalIndex(); return mcNum; } - mctrack = mother; + currentTrk = mother; } } } return 0; } - bool Corr(const McMuons::iterator& muon1, const McMuons::iterator& muon2, aod::McParticles const& mcParts) + bool isCorr(const McMuons::iterator& muon1, const McMuons::iterator& muon2, aod::McParticles const& mcParts) { int moth11(0), moth12(0), moth21(1), moth22(1); @@ -391,7 +402,7 @@ struct HfTaskSingleMuonSource { if (anc1 == 0 || anc2 == 0) { return false; } - for (auto mcPart : mcParts) { + for (const auto& mcPart : mcParts) { if (mcPart.globalIndex() == anc1) { moth11 = (mcPart.mothers_first_as()).globalIndex(); moth12 = (mcPart.mothers_last_as()).globalIndex(); @@ -408,7 +419,8 @@ struct HfTaskSingleMuonSource { } void fillPairs(const McMuons::iterator& muon, const McMuons::iterator& muon2, aod::McParticles const& mcParts) { - if (trackType != 3) { + const int type3 = 3; + if (trackType != type3) { return; } float mm = o2::constants::physics::MassMuon; @@ -419,7 +431,7 @@ struct HfTaskSingleMuonSource { ROOT::Math::PtEtaPhiMVector mu1Vec(muon.pt(), muon.eta(), muon.phi(), mm); ROOT::Math::PtEtaPhiMVector mu2Vec(muon2.pt(), muon2.eta(), muon2.phi(), mm); ROOT::Math::PtEtaPhiMVector dimuVec = mu1Vec + mu2Vec; - auto InvM = dimuVec.M(); + auto invMass = dimuVec.M(); if (!muon.has_mcParticle() || !muon2.has_mcParticle()) { return; @@ -430,18 +442,22 @@ struct HfTaskSingleMuonSource { ROOT::Math::PtEtaPhiMVector mu1VecGen(mcPart1.pt(), mcPart1.eta(), mcPart1.phi(), mm); ROOT::Math::PtEtaPhiMVector mu2VecGen(mcPart2.pt(), mcPart2.eta(), mcPart2.phi(), mm); ROOT::Math::PtEtaPhiMVector dimuVecGen = mu1VecGen + mu2VecGen; - auto InvMGen = dimuVecGen.M(); + auto invMassGen = dimuVecGen.M(); if (isMuon(mask1) && isMuon(mask2)) { - registry.fill(HIST("h1MuonMass"), InvM); - registry.fill(HIST("h1MuonMassGen"), InvMGen); + registry.fill(HIST("h1MuonMass"), invMass); + registry.fill(HIST("h1MuonMassGen"), invMassGen); } - if (Corr(muon, muon2, mcParts) && isBeautyMu(mask1) && isBeautyMu(mask2)) { - registry.fill(HIST("h1BeautyMass"), InvM); - registry.fill(HIST("h1BeautyMassGen"), InvMGen); + if (isBeautyMu(mask1) && isBeautyMu(mask2)) { + registry.fill(HIST("h1BeautyMass"), invMass); + registry.fill(HIST("h1BeautyMassGen"), invMassGen); + if (isCorr(muon, muon2, mcParts)) { + registry.fill(HIST("h1CorrBeautyMass"), invMass); + registry.fill(HIST("h1CorrBeautyMassGen"), invMassGen); + } } else { - registry.fill(HIST("h1OtherMass"), InvM); - registry.fill(HIST("h1OtherMassGen"), InvMGen); + registry.fill(HIST("h1OtherMass"), invMass); + registry.fill(HIST("h1OtherMassGen"), invMassGen); } } @@ -477,7 +493,10 @@ struct HfTaskSingleMuonSource { continue; } } - if ((muon.chi2() >= 1e6) || (muon.chi2() < 0)) { + if (muon.chi2() < 0) { + continue; + } + if (muon.chi2MatchMCHMID() < 0) { continue; } if (charge != 0 && muon.sign() != charge) { @@ -517,10 +536,10 @@ struct HfTaskSingleMuonSource { } } - if ((muon2.chi2() >= 1e6) || (muon2.chi2() < 0)) { + if (muon2.chi2() < 0) { continue; } - if ((muon2.chi2MatchMCHMID() >= 1e6) || (muon2.chi2MatchMCHMID() < 0)) { + if (muon2.chi2MatchMCHMID() < 0) { continue; } fillPairs(muon, muon2, mcParts); From 2c40eb1e9125966cad6018fb58e446a996a8ee83 Mon Sep 17 00:00:00 2001 From: YazhenLin Date: Fri, 10 Apr 2026 17:09:27 +0800 Subject: [PATCH 226/282] [PWGDQ] Add some code in tableReader_withAssoc.cxx for the energy correlator study (#15709) --- PWGDQ/Tasks/tableReader_withAssoc.cxx | 71 ++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 5cbc6a50c62..27f6c17d839 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -3333,6 +3333,10 @@ struct AnalysisDileptonTrack { Configurable> fConfigFitmassEC{"cfgTFitmassEC", std::vector{-0.541438, 2.8, 3.2}, "parameter from the fit fuction and fit range"}; Configurable> fConfigTransRange{"cfgTransRange", std::vector{0.333333, 0.666667}, "Transverse region for the energy correlstor analysis"}; + Configurable fConfigApplyEfficiency{"cfgApplyEfficiency", false, "If true, apply efficiency correction for the energy correlator study"}; + Configurable fConfigApplyEfficiencyME{"cfgApplyEfficiencyME", false, "If true, apply efficiency correction for the energy correlator study"}; + Configurable fConfigAccCCDBPath{"AccCCDBPath", "Users/y/yalin/pptest/test2", "Path of the efficiency corrections"}; + int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. int fNCuts; // number of dilepton leg cuts int fNLegCuts; @@ -3366,6 +3370,12 @@ struct AnalysisDileptonTrack { TF1* fMassBkg = nullptr; + TH2F* hAcceptance_rec; + TH2F* hAcceptance_gen; + TH1F* hEfficiency_dilepton; + TH1F* hEfficiency_hadron; + TH1F* hMasswindow; + void init(o2::framework::InitContext& context) { bool isBarrel = context.mOptions.get("processBarrelSkimmed"); @@ -3623,6 +3633,22 @@ struct AnalysisDileptonTrack { } } + void initAccFromCCDB(uint64_t timestamp) + { + TList* listAccs = fCCDB->getForTimeStamp(fConfigAccCCDBPath, timestamp); + if (!listAccs) { + LOG(fatal) << "Problem getting TList object with efficiencies!"; + } + hEfficiency_dilepton = static_cast(listAccs->FindObject("hEfficiency_dilepton")); + hEfficiency_hadron = static_cast(listAccs->FindObject("hEfficiency_hadron")); + hAcceptance_rec = static_cast(listAccs->FindObject("hAcceptance_rec")); + hAcceptance_gen = static_cast(listAccs->FindObject("hAcceptance_gen")); + hMasswindow = static_cast(listAccs->FindObject("hMasswindow")); + if (!hAcceptance_rec || !hAcceptance_gen || !hEfficiency_dilepton || !hEfficiency_hadron || !hMasswindow) { + LOG(fatal) << "Problem getting histograms from the TList object with efficiencies!"; + } + } + // Template function to run pair - hadron combinations template void runDileptonHadron(TEvent const& event, TTrackAssocs const& assocs, TTracks const& tracks, TDileptons const& dileptons) @@ -3699,8 +3725,21 @@ struct AnalysisDileptonTrack { VarManager::FillDileptonTrackVertexing(event, lepton1, lepton2, track, fValuesHadron); // for the energy correlator analysis + float Effweight_rec = 1.0f; + if (fConfigApplyEfficiency) { + float dilepton_eta = dilepton.eta(); + float dilepton_phi = dilepton.phi(); + float hadron_eta = track.eta(); + float hadron_phi = track.phi(); + float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI); + Effweight_rec = hAcceptance_rec->Interpolate(dilepton_eta - hadron_eta, deltaphi); + float Effdilepton = hEfficiency_dilepton->Interpolate(dilepton.pt()); + float Masswindow = hMasswindow->Interpolate(dilepton.pt()); + float Effhadron = hEfficiency_hadron->Interpolate(track.pt()); + Effweight_rec = Effweight_rec * Effdilepton * Effhadron * Masswindow; + } std::vector fTransRange = fConfigTransRange; - VarManager::FillEnergyCorrelatorTriple(lepton1, lepton2, track, fValuesHadron, fTransRange[0], fTransRange[1], fConfigApplyMassEC, fMassBkg->GetRandom()); + VarManager::FillEnergyCorrelatorTriple(lepton1, lepton2, track, fValuesHadron, fTransRange[0], fTransRange[1], fConfigApplyMassEC, fMassBkg->GetRandom(), 1. / Effweight_rec); // table to be written out for ML analysis BmesonsTable(event.runNumber(), event.globalIndex(), event.timestamp(), fValuesHadron[VarManager::kPairMass], dilepton.mass(), fValuesHadron[VarManager::kDeltaMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kPairEta], fValuesHadron[VarManager::kPairPhi], fValuesHadron[VarManager::kPairRap], @@ -3805,6 +3844,9 @@ struct AnalysisDileptonTrack { } if (fCurrentRun != events.begin().runNumber()) { // start: runNumber initParamsFromCCDB(events.begin().timestamp()); + if (fConfigApplyEfficiency) { + initAccFromCCDB(events.begin().timestamp()); + } fCurrentRun = events.begin().runNumber(); } // end: runNumber for (auto& event : events) { @@ -3862,6 +3904,14 @@ struct AnalysisDileptonTrack { if (events.size() == 0) { return; } + + if (fCurrentRun != events.begin().runNumber()) { // start: runNumber + if (fConfigApplyEfficiency) { + initAccFromCCDB(events.begin().timestamp()); + } + fCurrentRun = events.begin().runNumber(); + } // end: runNumber + events.bindExternalIndices(&dileptons); events.bindExternalIndices(&assocs); @@ -3909,8 +3959,25 @@ struct AnalysisDileptonTrack { VarManager::FillDileptonHadron(dilepton, track, VarManager::fgValues); // for the energy correlator analysis + float Effweight_rec = 1.0f; + if (fConfigApplyEfficiency) { + float dilepton_eta = dilepton.eta(); + float dilepton_phi = dilepton.phi(); + float hadron_eta = track.eta(); + float hadron_phi = track.phi(); + float deltaphi = RecoDecay::constrainAngle(dilepton_phi - hadron_phi, -0.5 * o2::constants::math::PI); + Effweight_rec = hAcceptance_rec->Interpolate(dilepton_eta - hadron_eta, deltaphi); + float Effdilepton = hEfficiency_dilepton->Interpolate(dilepton.pt()); + float Masswindow = hMasswindow->Interpolate(dilepton.pt()); + float Effhadron = hEfficiency_hadron->Interpolate(track.pt()); + if (fConfigApplyEfficiencyME) { + Effweight_rec = Effdilepton * Effhadron * Masswindow; // for the moment, apply the efficiency correction also for the mixed event pairs, but this can be changed in case we want to apply it only for the same event pairs + } else { + Effweight_rec = Effweight_rec * Effdilepton * Effhadron * Masswindow; // apply acceptance and efficiency correction for the real pairs + } + } std::vector fTransRange = fConfigTransRange; - VarManager::FillEnergyCorrelatorTriple(lepton1, lepton2, track, fValuesHadron, fTransRange[0], fTransRange[1], fConfigApplyMassEC, fMassBkg->GetRandom()); + VarManager::FillEnergyCorrelatorTriple(lepton1, lepton2, track, fValuesHadron, fTransRange[0], fTransRange[1], fConfigApplyMassEC, fMassBkg->GetRandom(), 1. / Effweight_rec); // loop over dilepton leg cuts and track cuts and fill histograms separately for each combination for (int icut = 0; icut < fNCuts; icut++) { From dd0bcaa761d452d044f01eb05209b18bcef1bace Mon Sep 17 00:00:00 2001 From: tutripat <73981392+tutripat@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:51:29 +0200 Subject: [PATCH 227/282] [PWGLF] modifications for vertex association studies (#15707) Co-authored-by: ALICE Action Bot --- .../PseudorapidityDensityMFT.cxx | 1160 +++++++++-------- 1 file changed, 647 insertions(+), 513 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx index 370f7da75a9..fc7bc57cf19 100644 --- a/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx @@ -84,6 +84,9 @@ AxisSpec dcaYAxis = {6000, -30, 30}; // previous AxisSpec dcaYAxis = {2000, -10 // AxisSpec dcaZAxis = {600, -0.15f, 0.15f}; // AxisSpec dcaXAxis = {600, -0.15f, 0.15f}; // AxisSpec dcaYAxis = {600, -0.15f, 0.15f}; +// bin width 0.0005 cm: range [-30, 30] cm => 60/0.0005 = 120000 bins +// Keep bin width = 0.0005 cm (5 um): range [-1, 1] cm => 2.0/0.0005 = 4000 bins +// AxisSpec axisBinsDCA = {600, -0.15f, 0.15f, "#it{dca}_{xy} (cm)"}; AxisSpec centAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}}; @@ -113,16 +116,16 @@ static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = // replace your alias with the extension included: using FullBCs = soa::Join; -// using MFTTracksLabeled = -// soa::Join; using MFTTracksLabeled = soa::Join; +using MFTTracksLabeled3d = + soa::Join; + using MFTTracksLabeled2d = - soa::Join; using MFTTracksLabeledOrg = @@ -139,7 +142,6 @@ struct PseudorapidityDensityMFT { Preslice perCol = o2::aod::fwdtrack::collisionId; Preslice perMcCol = aod::mcparticle::mcCollisionId; Preslice perColCentral = aod::track::collisionId; - Service pdg; // --- CCDB magnetic field (needed for propagateToDCAhelix in this device) --- @@ -236,6 +238,14 @@ struct PseudorapidityDensityMFT { Selected, Rejected }; + enum class NeitherReasonBin : int { + NotTrueByLabel = 1, + BestColInvalid, + BestColMissingInRecoToMc, + ClassifiedRight, + ClassifiedWrong + }; + static constexpr float ForwardEtaMax = -2.0f; static constexpr float ForwardEtaMin = -3.9f; @@ -430,7 +440,7 @@ struct PseudorapidityDensityMFT { " ; DCA_{XY} (cm)", {HistType::kTH1F, {dcaXyAxis}}}); - if (doprocessGenReco || doprocessGenRecoTimeCom) { + if (doprocessGenReco3d || doprocessGenReco2d || doprocessGenRecoTimeCom) { registry.add({"EventsRecoCuts_GenReco", ";cut;events", {HistType::kTH1F, {{16, 0.5, 16.5}}}}); @@ -763,6 +773,15 @@ struct PseudorapidityDensityMFT { hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Neither), "neither"); hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Both), "both"); + registry.add("Purity/NeitherReason", "Purity/NeitherReason", kTH1D, {{5, 0.5, 5.5}}, false); + auto hNeitherReason = registry.get(HIST("Purity/NeitherReason")); + auto* xNeitherReason = hNeitherReason->GetXaxis(); + xNeitherReason->SetBinLabel(static_cast(NeitherReasonBin::NotTrueByLabel), "NotTrueByLabel"); + xNeitherReason->SetBinLabel(static_cast(NeitherReasonBin::BestColInvalid), "BestColInvalid"); + xNeitherReason->SetBinLabel(static_cast(NeitherReasonBin::BestColMissingInRecoToMc), "BestColMissingInRecoToMc"); + xNeitherReason->SetBinLabel(static_cast(NeitherReasonBin::ClassifiedRight), "ClassifiedRight"); + xNeitherReason->SetBinLabel(static_cast(NeitherReasonBin::ClassifiedWrong), "ClassifiedWrong"); + registry.add({"Purity/RightWrongLater", ";category;counts", {HistType::kTH1F, {{4, 0.5, 4.5}}}}); @@ -973,6 +992,9 @@ struct PseudorapidityDensityMFT { registry.add({"Purity/BestRecoColNotFound", ";events;counts", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/TrueColNotFound", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); } if (doprocessGen) { @@ -1643,7 +1665,6 @@ struct PseudorapidityDensityMFT { if (midtracks.size() > 0 && retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { uniqueCollisions.insert(collision.globalIndex()); } - if (retrack.ambDegree() != 0) { registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksEtaZvtx"), track.eta(), z); @@ -2027,26 +2048,70 @@ struct PseudorapidityDensityMFT { registry.fill(HIST("EventsRecoCuts_GenReco"), static_cast(bin)); }; fillGenRecoCut(GenRecoCutBin::AllRecoCollisions); + std::unordered_map recoToMc; - std::unordered_map> mcToReco; // MC collision id -> list of reco collision globalIndex + std::unordered_map> mcToReco; + std::unordered_set acceptedRecoCols; + std::unordered_set recoCollisionIds; + std::unordered_set trueMCCollisionIds; - for (const auto& collision : collisions) { - int nSavedRows = 0; - std::unordered_set uniqueRecoColsSaved; - int recoCol = collision.globalIndex(); // reconstructed vertex index - int mcCol = collision.mcCollisionId(); // true MC collision index + recoToMc.reserve(collisions.size()); + mcToReco.reserve(collisions.size()); + acceptedRecoCols.reserve(collisions.size()); + recoCollisionIds.reserve(collisions.size()); + trueMCCollisionIds.reserve(collisions.size()); + + const auto countAndPassEvSelGenReco = [&](auto const& collision) { + struct EvSelStep { + bool enabled; + decltype(aod::evsel::kIsTriggerTVX) bit; + GenRecoCutBin bin; + }; - if (mcCol >= 0) { - recoToMc[recoCol] = mcCol; - mcToReco[mcCol].push_back(recoCol); + const std::array steps = {{ + {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, + {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, + {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, + {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, + {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, + {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, + {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, + {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, + {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, + {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, + }}; + + if (!useEvSel) { + for (const auto& step : steps) { + fillGenRecoCut(step.bin); + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + return true; + } - ++nSavedRows; - uniqueRecoColsSaved.insert(recoCol); + for (const auto& step : steps) { + if (!step.enabled) { + fillGenRecoCut(step.bin); + continue; + } + + if (!collision.selection_bit(step.bit)) { + return false; + } + fillGenRecoCut(step.bin); } - registry.fill(HIST("Purity/HashTableRowCounts"), - static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); - registry.fill(HIST("Purity/HashTableRowCounts"), - static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + + if (useRctMFT && !myChecker(collision)) { + return false; + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + + return true; + }; + + for (const auto& collision : collisions) { + int nSavedRows = 0; + std::unordered_set uniqueRecoColsSaved; registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); @@ -2056,59 +2121,11 @@ struct PseudorapidityDensityMFT { fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); if (!collision.has_mcCollision()) { - LOGF(warning, "No MC collision found..."); - return; + LOGP(warning, "Reco collision {} has no MC collision label, skipping", collision.globalIndex()); + continue; } fillGenRecoCut(GenRecoCutBin::HasMcCollision); - auto countAndPassEvSelGenReco = [&](auto const& collision) { - struct EvSelStep { - bool enabled; - decltype(aod::evsel::kIsTriggerTVX) bit; - GenRecoCutBin bin; - }; - - const std::array steps = {{ - {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, - {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, - {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, - {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, - {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, - {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, - {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, - {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, - {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, - {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, - }}; - - if (!useEvSel) { - for (const auto& step : steps) { - fillGenRecoCut(step.bin); - } - fillGenRecoCut(GenRecoCutBin::RctMFT); - return true; - } - - for (const auto& step : steps) { - if (!step.enabled) { - fillGenRecoCut(step.bin); - continue; - } - - if (!collision.selection_bit(step.bit)) { - return false; - } - fillGenRecoCut(step.bin); - } - - if (useRctMFT && !myChecker(collision)) { - return false; - } - fillGenRecoCut(GenRecoCutBin::RctMFT); - - return true; - }; - if (!countAndPassEvSelGenReco(collision)) { continue; } @@ -2125,146 +2142,163 @@ struct PseudorapidityDensityMFT { } fillGenRecoCut(GenRecoCutBin::InelGt0); - // constexpr uint8_t kFakeMcMask = 1u << 7; - for (const auto& track : tracks) { - float ndf = getTrackNdf(track); - const float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - // const float dcaXyCut = track.bestDCAXY(); - // const float dcaZCut = track.bestDCAZ(); - const float ptCut = track.pt(); - o2::math_utils::bringTo02Pi(phi); + const int recoCol = collision.globalIndex(); + const int mcCol = collision.mcCollisionId(); - const bool failTrackCuts = - track.nClusters() < cfgnCluster || - track.eta() <= cfgnEta1 || - track.eta() >= cfgnEta2 || - chi2ndf >= cfgChi2NDFMax || - phi <= cfgPhiCut1 || - phi >= cfgPhiCut2 || - (usePhiCut && - ((phi <= PhiVetoLow) || - ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || - (phi >= PhiVetoHigh))) || - // (useDCAxyCut && dcaxyCut > maxDCAxy) || - // (useDCAzCut && std::abs(dcazCut) > maxDCAz) || - (usePtCut && ptCut > cfgnPt); + acceptedRecoCols.insert(recoCol); + recoCollisionIds.insert(recoCol); + trueMCCollisionIds.insert(mcCol); - if (failTrackCuts) { - continue; - } - const bool hasMcLabel = track.has_mcParticle(); - const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; - const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; - const bool hasNoMcLabel = !hasMcLabel; - const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); - const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); - const float eta = track.eta(); - if (!passGenRecoTrackMode(track)) { // 0-> All nonorphans, 1->Non-Amb, 2->Amb - continue; - } - int bin = static_cast(RightWrongBin::Neither); - bool recoOfTrueExists = false; + if (mcCol >= 0) { + recoToMc[recoCol] = mcCol; + mcToReco[mcCol].push_back(recoCol); + ++nSavedRows; + uniqueRecoColsSaved.insert(recoCol); + } + + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + } - if (isTrueByLabel) { - int recoCol = track.collisionId(); - auto itRecoToMc = recoToMc.find(recoCol); - const int mcOfTrack = track.mcParticle().mcCollisionId(); + for (const auto& track : tracks) { + float ndf = getTrackNdf(track); + const float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + const float ptCut = track.pt(); + o2::math_utils::bringTo02Pi(phi); + + const bool failTrackCuts = + track.nClusters() < cfgnCluster || + track.eta() <= cfgnEta1 || + track.eta() >= cfgnEta2 || + chi2ndf >= cfgChi2NDFMax || + phi <= cfgPhiCut1 || + phi >= cfgPhiCut2 || + (usePhiCut && + ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh))) || + (usePtCut && ptCut > cfgnPt); + + if (failTrackCuts) { + continue; + } - // Check whether any reco vertex exists for the true MC collision of this track - for (const auto& [recoId, mcId] : recoToMc) { - if (mcId == mcOfTrack) { - recoOfTrueExists = true; - break; - } - } + if (!passGenRecoTrackMode(track)) { + continue; + } - if (recoCol >= 0 && itRecoToMc != recoToMc.end()) { - int mcFromReco = itRecoToMc->second; - bin = (mcFromReco == mcOfTrack) - ? static_cast(RightWrongBin::Right) - : static_cast(RightWrongBin::Wrong); - } - } + const int recoCol = track.collisionId(); + if (acceptedRecoCols.find(recoCol) == acceptedRecoCols.end()) { + continue; + } - registry.fill(HIST("RightWrong"), bin); + const bool hasMcLabel = track.has_mcParticle(); + const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; + const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; + const bool hasNoMcLabel = !hasMcLabel; + const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); + const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); + const float eta = track.eta(); - if (bin == static_cast(RightWrongBin::Wrong)) { - registry.fill(HIST("Purity/WrongVertexRecoExists"), recoOfTrueExists ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); - } + int bin = static_cast(RightWrongBin::Neither); + bool recoOfTrueExists = false; - const auto fillTrackLabelSummary = [&](TrackLabelSummaryBin bin) { - registry.fill(HIST("Purity/TrackLabelSummary"), static_cast(bin)); - }; - const auto fillTrackEtaCategory = [&](TrackLabelSummaryBin bin) { - constexpr float EtaSentinel = -999.f; + /// const int bestColID = track.bestCollisionId(); + const int mcOfTrack = isTrueByLabel ? track.mcParticle().mcCollisionId() : InvalidCollisionId; - float etaAll = EtaSentinel; - float etaNoMc = EtaSentinel; - float etaFake = EtaSentinel; - float etaTrue = EtaSentinel; - float etaPrimary = EtaSentinel; - float etaSecondary = EtaSentinel; + if (isTrueByLabel) { + auto itRecoList = mcToReco.find(mcOfTrack); + if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + recoOfTrueExists = true; + } - switch (bin) { - case TrackLabelSummaryBin::AllTracks: - etaAll = eta; - break; - case TrackLabelSummaryBin::NoMcLabel: - etaNoMc = eta; - break; - case TrackLabelSummaryBin::FakeTracks: - etaFake = eta; - break; - case TrackLabelSummaryBin::TrueTracks: - etaTrue = eta; - break; - case TrackLabelSummaryBin::PrimaryTracks: - etaPrimary = eta; - break; - case TrackLabelSummaryBin::SecondaryTracks: - etaSecondary = eta; - break; - } + auto itRecoToMc = recoToMc.find(recoCol); + if (recoCol >= 0 && itRecoToMc != recoToMc.end()) { + const int mcFromReco = itRecoToMc->second; + bin = (mcFromReco == mcOfTrack) + ? static_cast(RightWrongBin::Right) + : static_cast(RightWrongBin::Wrong); + } + } - registry.fill(HIST("Purity/TrackEtaCategorySparse"), - etaAll, etaNoMc, etaFake, etaTrue, etaPrimary, etaSecondary); - }; + registry.fill(HIST("RightWrong"), bin); - // registry.fill(HIST("Purity/TrackLabelStatus"), hasMcLabel ? 1.0 : 0.0); - // registry.fill(HIST("Purity/TrackFakeStatus"), isFakeByLabel ? 1.0 : 0.0); + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/WrongVertexRecoExists"), + recoOfTrueExists ? static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists) + : static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing)); + } - fillTrackLabelSummary(TrackLabelSummaryBin::AllTracks); - fillTrackEtaCategory(TrackLabelSummaryBin::AllTracks); + const auto fillTrackLabelSummary = [&](TrackLabelSummaryBin binSummary) { + registry.fill(HIST("Purity/TrackLabelSummary"), static_cast(binSummary)); + }; - if (hasNoMcLabel) { - fillTrackLabelSummary(TrackLabelSummaryBin::NoMcLabel); - fillTrackEtaCategory(TrackLabelSummaryBin::NoMcLabel); - continue; + const auto fillTrackEtaCategory = [&](TrackLabelSummaryBin binSummary) { + constexpr float EtaSentinel = -999.f; + + float etaAll = EtaSentinel; + float etaNoMc = EtaSentinel; + float etaFake = EtaSentinel; + float etaTrue = EtaSentinel; + float etaPrimary = EtaSentinel; + float etaSecondary = EtaSentinel; + + switch (binSummary) { + case TrackLabelSummaryBin::AllTracks: + etaAll = eta; + break; + case TrackLabelSummaryBin::NoMcLabel: + etaNoMc = eta; + break; + case TrackLabelSummaryBin::FakeTracks: + etaFake = eta; + break; + case TrackLabelSummaryBin::TrueTracks: + etaTrue = eta; + break; + case TrackLabelSummaryBin::PrimaryTracks: + etaPrimary = eta; + break; + case TrackLabelSummaryBin::SecondaryTracks: + etaSecondary = eta; + break; } - if (isFakeByLabel) { - fillTrackLabelSummary(TrackLabelSummaryBin::FakeTracks); - fillTrackEtaCategory(TrackLabelSummaryBin::FakeTracks); - continue; - } + registry.fill(HIST("Purity/TrackEtaCategorySparse"), + etaAll, etaNoMc, etaFake, etaTrue, etaPrimary, etaSecondary); + }; - fillTrackLabelSummary(TrackLabelSummaryBin::TrueTracks); - fillTrackEtaCategory(TrackLabelSummaryBin::TrueTracks); + fillTrackLabelSummary(TrackLabelSummaryBin::AllTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::AllTracks); - if (isPrimaryCharged) { - fillTrackLabelSummary(TrackLabelSummaryBin::PrimaryTracks); - fillTrackEtaCategory(TrackLabelSummaryBin::PrimaryTracks); - } + if (hasNoMcLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::NoMcLabel); + fillTrackEtaCategory(TrackLabelSummaryBin::NoMcLabel); + continue; + } - if (isSecondaryCharged) { - fillTrackLabelSummary(TrackLabelSummaryBin::SecondaryTracks); - fillTrackEtaCategory(TrackLabelSummaryBin::SecondaryTracks); - } - // registry.fill(HIST("RightWrong"), bin); + if (isFakeByLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::FakeTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::FakeTracks); + continue; + } - } // Track loop 1 - } // Collision + fillTrackLabelSummary(TrackLabelSummaryBin::TrueTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::TrueTracks); + + if (isPrimaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::PrimaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::PrimaryTracks); + } + + if (isSecondaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::SecondaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::SecondaryTracks); + } + } } PROCESS_SWITCH(PseudorapidityDensityMFT, processGenRecoTimeCom, "Process for MC time compatible", false); @@ -2277,75 +2311,99 @@ struct PseudorapidityDensityMFT { // aod::McCollisions::iterator const& mcCollision // McCollisionsWithExtra::iterator const& mcCollision - // void processMCeff(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - // soa::Join::iterator const& mcCollision //This worked + template void processGenReco(McCollisionsWithExtra::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, FullBCs const& bcs, - MFTTracksLabeled const& tracks, + MFTTracksT const& tracks, FiCentralTracks const& midtracks, aod::McParticles const&) - { - const auto fillGenRecoCut = [&](GenRecoCutBin bin) { registry.fill(HIST("EventsRecoCuts_GenReco"), static_cast(bin)); }; fillGenRecoCut(GenRecoCutBin::AllRecoCollisions); - // if (maxGenRecoEvents >= 0 && nProcessedGenReco >= maxGenRecoEvents) { - // return; - // } - // ++nProcessedGenReco; // for HIR std::unordered_map recoToMc; - std::unordered_map> mcToReco; // MC collision id -> list of reco collision globalIndex - std::unordered_map recoToMcVZ; + std::unordered_map> mcToReco; + std::unordered_set acceptedRecoCols; std::unordered_map recoVtxX; std::unordered_map recoVtxY; std::unordered_map recoVtxZ; + std::unordered_set recoCollisionIds; + std::unordered_set trueMCCollisionIds; std::unordered_map> recoVtxByRecoId; std::unordered_map> recoVtxByMcId; + recoToMc.reserve(collisions.size()); + mcToReco.reserve(collisions.size()); + acceptedRecoCols.reserve(collisions.size()); + recoCollisionIds.reserve(collisions.size()); + trueMCCollisionIds.reserve(collisions.size()); recoVtxByRecoId.reserve(collisions.size()); recoVtxByMcId.reserve(collisions.size()); - mcToReco.reserve(collisions.size()); - // --- Make sure magnetic field exists in THIS device before any propagation --- - // IMPORTANT: calling collision.bc_as() requires the BC table to be subscribed. - // We subscribe by taking `FullBCs const& bcs` in the process signature and init once here. bool magInited = false; for (auto const& bc : bcs) { initMagField(bc); magInited = true; - break; // once is enough (initMagField is internally guarded) + break; } if (!magInited) { LOGF(fatal, "BC table is empty: cannot initialize magnetic field"); } - //_______________________________________________________________________________ + const auto countAndPassEvSelGenReco = [&](auto const& collision) { + struct EvSelStep { + bool enabled; + decltype(aod::evsel::kIsTriggerTVX) bit; + GenRecoCutBin bin; + }; - for (const auto& collision : collisions) { - int nSavedRows = 0; - std::unordered_set uniqueRecoColsSaved; - int recoCol = collision.globalIndex(); // reconstructed vertex index - int mcCol = collision.mcCollisionId(); // true MC collision index + const std::array steps = {{ + {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, + {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, + {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, + {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, + {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, + {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, + {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, + {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, + {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, + {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, + }}; + + if (!useEvSel) { + for (const auto& step : steps) { + fillGenRecoCut(step.bin); + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + return true; + } - if (mcCol >= 0) { - recoToMc[recoCol] = mcCol; - mcToReco[mcCol].push_back(recoCol); + for (const auto& step : steps) { + if (!step.enabled) { + fillGenRecoCut(step.bin); + continue; + } - ++nSavedRows; - uniqueRecoColsSaved.insert(recoCol); + if (!collision.selection_bit(step.bit)) { + return false; + } + fillGenRecoCut(step.bin); } - registry.fill(HIST("Purity/HashTableRowCounts"), - static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); - registry.fill(HIST("Purity/HashTableRowCounts"), - static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); - recoVtxX[recoCol] = collision.posX(); - recoVtxY[recoCol] = collision.posY(); - recoVtxZ[recoCol] = collision.posZ(); + if (useRctMFT && !myChecker(collision)) { + return false; + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + + return true; + }; + + for (const auto& collision : collisions) { + int nSavedRows = 0; + std::unordered_set uniqueRecoColsSaved; registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); @@ -2355,59 +2413,11 @@ struct PseudorapidityDensityMFT { fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); if (!collision.has_mcCollision()) { - LOGF(warning, "No MC collision found..."); - return; + LOGP(warning, "Reco collision {} has no MC collision label, skipping", collision.globalIndex()); + continue; } fillGenRecoCut(GenRecoCutBin::HasMcCollision); - auto countAndPassEvSelGenReco = [&](auto const& collision) { - struct EvSelStep { - bool enabled; - decltype(aod::evsel::kIsTriggerTVX) bit; - GenRecoCutBin bin; - }; - - const std::array steps = {{ - {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, - {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, - {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, - {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, - {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, - {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, - {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, - {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, - {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, - {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, - }}; - - if (!useEvSel) { - for (const auto& step : steps) { - fillGenRecoCut(step.bin); - } - fillGenRecoCut(GenRecoCutBin::RctMFT); - return true; - } - - for (const auto& step : steps) { - if (!step.enabled) { - fillGenRecoCut(step.bin); - continue; - } - - if (!collision.selection_bit(step.bit)) { - return false; - } - fillGenRecoCut(step.bin); - } - - if (useRctMFT && !myChecker(collision)) { - return false; - } - fillGenRecoCut(GenRecoCutBin::RctMFT); - - return true; - }; - if (!countAndPassEvSelGenReco(collision)) { continue; } @@ -2424,202 +2434,342 @@ struct PseudorapidityDensityMFT { } fillGenRecoCut(GenRecoCutBin::InelGt0); - //________________________________________________________________________________ + const int recoCol = collision.globalIndex(); + const int mcCol = collision.mcCollisionId(); + + acceptedRecoCols.insert(recoCol); + recoCollisionIds.insert(recoCol); + trueMCCollisionIds.insert(mcCol); + + if (mcCol >= 0) { + recoToMc[recoCol] = mcCol; + mcToReco[mcCol].push_back(recoCol); + ++nSavedRows; + uniqueRecoColsSaved.insert(recoCol); + } + + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + + recoVtxX[recoCol] = collision.posX(); + recoVtxY[recoCol] = collision.posY(); + recoVtxZ[recoCol] = collision.posZ(); + recoVtxByRecoId[recoCol] = {collision.posX(), collision.posY(), collision.posZ()}; + recoVtxByMcId[mcCol] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; registry.fill(HIST("Purity/xReco"), collision.posX()); registry.fill(HIST("Purity/xTrue"), mcCollision.posX()); registry.fill(HIST("Purity/yReco"), collision.posY()); - registry.fill(HIST("Purity/yTrue"), mcCollision.posY()); registry.fill(HIST("Purity/zReco"), collision.posZ()); registry.fill(HIST("Purity/zTrue"), mcCollision.posZ()); - - // --- Vertex position THnSparse: status axis (1=reco, 2=true) --- registry.fill(HIST("Purity/VtxXYZTruth"), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); registry.fill(HIST("Purity/VtxXYZReco"), collision.posX(), collision.posY(), collision.posZ()); - - // --- Delta vertex THnSparse (reco - true) --- registry.fill(HIST("Purity/DeltaVtxXYZ"), - collision.posX() - mcCollision.posX(), // Reco - Truth + collision.posX() - mcCollision.posX(), collision.posY() - mcCollision.posY(), collision.posZ() - mcCollision.posZ()); + } - recoVtxByRecoId[collision.globalIndex()] = {collision.posX(), collision.posY(), collision.posZ()}; - recoVtxByMcId[collision.mcCollisionId()] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; + int64_t woOrpCount = 0; + bool filledRight = false; + bool filledWrong = false; + int nMftSelectedAfterCuts = 0; + std::unordered_set uniqueBestRecoCols; - int64_t woOrpCount = 0; - bool filledRight = false; - bool filledWrong = false; - int nMftSelectedAfterCuts = 0; - std::unordered_set uniqueBestRecoCols; - // auto particle = templatedTrack.template mcParticle_as(); + if (tracks.size() > 0) { + bool countedPrimary = false; + for (const auto& track : tracks) { + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + float dcaXyCut = track.bestDCAXY(); + float dcaZCut = 0.f; + bool failDCAzCut = false; + float ptCut = track.pt(); + constexpr bool hasBestDCAZ = requires { track.bestDCAZ(); }; + + if constexpr (hasBestDCAZ) { + dcaZCut = track.bestDCAZ(); + failDCAzCut = useDCAzCut && (std::abs(dcaZCut) > maxDCAz); + } - if (tracks.size() > 0) { - bool countedPrimary = false; - for (const auto& track : tracks) { // track loop starts - // All compatible collisions assigned by track-to-collision-associator - if (!(midtracks.size() > 0)) - continue; - // std::cout <<" midtracks.size() " <= cfgnEta2 || + chi2ndf >= cfgChi2NDFMax || + phi <= cfgPhiCut1 || + phi >= cfgPhiCut2 || + (usePhiCut && + ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh))) || + (useDCAxyCut && dcaXyCut > maxDCAxy) || + failDCAzCut || + (usePtCut && ptCut > cfgnPt); - o2::math_utils::bringTo02Pi(phi); - const float etaReco = track.eta(); - const float dcaXYReco = dcaXyCut; // track.bestDCAXY() - const float dcaZReco = dcaZCut; // track.bestDCAZ() - const float dcaXReco = dcaXYReco * std::cos(phi); - const float dcaYReco = dcaXYReco * std::sin(phi); - - const bool failTrackCuts = - track.nClusters() < cfgnCluster || - etaReco <= cfgnEta1 || - etaReco >= cfgnEta2 || - chi2ndf >= cfgChi2NDFMax || - phi <= cfgPhiCut1 || - phi >= cfgPhiCut2 || - (usePhiCut && - ((phi <= PhiVetoLow) || - ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || - (phi >= PhiVetoHigh))) || - (useDCAxyCut && dcaXyCut > maxDCAxy) || - (useDCAzCut && std::abs(dcaZCut) > maxDCAz) || - (usePtCut && ptCut > cfgnPt); + if (failTrackCuts) { + continue; + } - if (failTrackCuts) { - continue; + if (!passGenRecoTrackMode(track)) { + continue; + } + + const int recoCol = track.collisionId(); + if (acceptedRecoCols.find(recoCol) == acceptedRecoCols.end()) { + continue; + } + + auto itRecoVz = recoVtxZ.find(recoCol); + if (itRecoVz == recoVtxZ.end()) { + continue; + } + const float z = itRecoVz->second; + + const bool hasMcLabel = track.has_mcParticle(); + const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; + const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; + const bool hasNoMcLabel = !hasMcLabel; + const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); + const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); + const auto fillTrackLabelSummary = [&](TrackLabelSummaryBin binSummary) { + registry.fill(HIST("Purity/TrackLabelSummary"), static_cast(binSummary)); + }; + + const auto fillTrackEtaCategory = [&](TrackLabelSummaryBin binSummary) { + constexpr float EtaSentinel = -999.f; + + float etaAll = EtaSentinel; + float etaNoMc = EtaSentinel; + float etaFake = EtaSentinel; + float etaTrue = EtaSentinel; + float etaPrimary = EtaSentinel; + float etaSecondary = EtaSentinel; + + switch (binSummary) { + case TrackLabelSummaryBin::AllTracks: + etaAll = etaReco; + break; + case TrackLabelSummaryBin::NoMcLabel: + etaNoMc = etaReco; + break; + case TrackLabelSummaryBin::FakeTracks: + etaFake = etaReco; + break; + case TrackLabelSummaryBin::TrueTracks: + etaTrue = etaReco; + break; + case TrackLabelSummaryBin::PrimaryTracks: + etaPrimary = etaReco; + break; + case TrackLabelSummaryBin::SecondaryTracks: + etaSecondary = etaReco; + break; } - const bool hasMcLabel = track.has_mcParticle(); - const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; - const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; - const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); - const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); - const auto mcColObj = track.mcParticle().mcCollision_as(); - const auto mcPart = track.mcParticle(); + registry.fill(HIST("Purity/TrackEtaCategorySparse"), + etaAll, etaNoMc, etaFake, etaTrue, etaPrimary, etaSecondary); + }; - if (!passGenRecoTrackMode(track)) { // - continue; + fillTrackLabelSummary(TrackLabelSummaryBin::AllTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::AllTracks); + + if (hasMcLabel) { + const auto mcPartForMother = track.mcParticle(); + if (!isPrimaryCharged && mcPartForMother.has_mothers()) { + auto mcpartMother = mcPartForMother.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || + std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + registry.fill(HIST("Purity/reco/weakStrange/SelectedTracksEta"), track.eta()); + registry.fill(HIST("Purity/reco/weakStrange/SelectedTracksEtaZvtx"), track.eta(), z); + } } - int bin = static_cast(RightWrongBin::Neither); - bool recoOfTrueExists = false; - bool recoOfTrueInCompatible = false; + } - const int bestColID = track.bestCollisionId(); // same as track.collisionId(); - if (isTrueByLabel) { - auto itRecoToMc = recoToMc.find(bestColID); - const int mcOfTrack = track.mcParticle().mcCollisionId(); - const auto compatibleIds = track.compatibleCollIds(); - auto itRecoList = mcToReco.find(mcOfTrack); - - // 1) First check whether the correct reco collision of the true MC collision - // is present in the compatible-collision list. - if (!compatibleIds.empty() && itRecoList != mcToReco.end() && !itRecoList->second.empty()) { - for (const auto& trueRecoId : itRecoList->second) { - for (const auto& compatibleId : compatibleIds) { - if (compatibleId == trueRecoId) { - recoOfTrueInCompatible = true; - break; - } - } - if (recoOfTrueInCompatible) { + if (hasNoMcLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::NoMcLabel); + fillTrackEtaCategory(TrackLabelSummaryBin::NoMcLabel); + } else if (isFakeByLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::FakeTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::FakeTracks); + } else { + fillTrackLabelSummary(TrackLabelSummaryBin::TrueTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::TrueTracks); + + if (isPrimaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::PrimaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::PrimaryTracks); + } + + if (isSecondaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::SecondaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::SecondaryTracks); + } + } + + int bin = static_cast(RightWrongBin::Neither); + bool recoOfTrueExists = false; + bool recoOfTrueInCompatible = false; + + const int bestColID = track.bestCollisionId(); + const int mcOfTrack = isTrueByLabel ? track.mcParticle().mcCollisionId() : InvalidCollisionId; + + const bool foundRecoColInRecoList = + recoCollisionIds.find(recoCol) != recoCollisionIds.end(); + const bool foundBestColInRecoList = + recoCollisionIds.find(bestColID) != recoCollisionIds.end(); + const bool foundInMCTrueList = + isTrueByLabel && (trueMCCollisionIds.find(mcOfTrack) != trueMCCollisionIds.end()); + + static constexpr int RecoColMissingBin = 1; + static constexpr int BestRecoColMissingBin = 2; + static constexpr int TrueColMissingBin = 1; + if (!foundRecoColInRecoList) { + registry.fill(HIST("Purity/BestRecoColNotFound"), RecoColMissingBin); + } + if (!foundBestColInRecoList) { + registry.fill(HIST("Purity/BestRecoColNotFound"), BestRecoColMissingBin); + } + if (isTrueByLabel && !foundInMCTrueList) { + registry.fill(HIST("Purity/TrueColNotFound"), TrueColMissingBin); + } + + if (!isTrueByLabel) { + registry.fill(HIST("Purity/NeitherReason"), + static_cast(NeitherReasonBin::NotTrueByLabel)); + } else { + auto itRecoToMc = recoToMc.find(bestColID); + const auto compatibleIds = track.compatibleCollIds(); + auto itRecoList = mcToReco.find(mcOfTrack); + + if (!compatibleIds.empty() && itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + for (const auto& trueRecoId : itRecoList->second) { + for (const auto& compatibleId : compatibleIds) { + if (compatibleId == trueRecoId) { + recoOfTrueInCompatible = true; break; } } + if (recoOfTrueInCompatible) { + break; + } } + } - // 2) Then check whether any reco collision for the true MC collision exists at all. - if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { - recoOfTrueExists = true; - } + if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + recoOfTrueExists = true; + } - // 3) Finally classify the actually chosen reco collision as right/wrong. - if (bestColID >= 0 && itRecoToMc != recoToMc.end()) { - const int mcFromReco = itRecoToMc->second; - bin = (mcFromReco == mcOfTrack) - ? static_cast(RightWrongBin::Right) - : static_cast(RightWrongBin::Wrong); + if (bestColID < 0) { + registry.fill(HIST("Purity/NeitherReason"), + static_cast(NeitherReasonBin::BestColInvalid)); + } else if (itRecoToMc == recoToMc.end()) { + registry.fill(HIST("Purity/NeitherReason"), + static_cast(NeitherReasonBin::BestColMissingInRecoToMc)); + } else { + const int mcFromReco = itRecoToMc->second; + if (mcFromReco == mcOfTrack) { + bin = static_cast(RightWrongBin::Right); + registry.fill(HIST("Purity/NeitherReason"), + static_cast(NeitherReasonBin::ClassifiedRight)); + } else { + bin = static_cast(RightWrongBin::Wrong); + registry.fill(HIST("Purity/NeitherReason"), + static_cast(NeitherReasonBin::ClassifiedWrong)); } } + } - registry.fill(HIST("RightWrong"), bin); - registry.fill(HIST("Purity/RecoOfTrueExists"), + registry.fill(HIST("RightWrong"), bin); + registry.fill(HIST("Purity/RecoOfTrueExists"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatible"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + + if (bestColID >= 0) { + uniqueBestRecoCols.insert(bestColID); + } + + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/WrongVertexRecoExists"), + recoOfTrueExists ? static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists) + : static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing)); + registry.fill(HIST("Purity/RecoOfTrueExistsW"), recoOfTrueExists ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); - registry.fill(HIST("Purity/RecoOfTrueInCompatible"), + registry.fill(HIST("Purity/RecoOfTrueInCompatibleW"), recoOfTrueInCompatible ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); + } - if (bin == static_cast(RightWrongBin::Wrong)) { - registry.fill(HIST("Purity/WrongVertexRecoExists"), - recoOfTrueExists ? static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists) - : static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing)); - registry.fill(HIST("Purity/RecoOfTrueExistsW"), - recoOfTrueExists ? static_cast(BoolBin::Yes) - : static_cast(BoolBin::No)); - registry.fill(HIST("Purity/RecoOfTrueInCompatibleW"), - recoOfTrueInCompatible ? static_cast(BoolBin::Yes) - : static_cast(BoolBin::No)); - } + if (bin == static_cast(RightWrongBin::Right)) { + registry.fill(HIST("Purity/RecoOfTrueExistsR"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatibleR"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } - if (bin == static_cast(RightWrongBin::Right)) { - registry.fill(HIST("Purity/RecoOfTrueExistsR"), - recoOfTrueExists ? static_cast(BoolBin::Yes) - : static_cast(BoolBin::No)); - registry.fill(HIST("Purity/RecoOfTrueInCompatibleR"), - recoOfTrueInCompatible ? static_cast(BoolBin::Yes) - : static_cast(BoolBin::No)); - } + registry.fill(HIST("Purity/RecoSparseAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); - registry.fill(HIST("Purity/RecoSparseAll"), + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparsePrimary"), etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } - if (isPrimaryCharged) { - registry.fill(HIST("Purity/RecoSparsePrimary"), - etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); - } else { - registry.fill(HIST("Purity/RecoSparseSecondary"), - etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); - } + registry.fill(HIST("RecoSparseAllBest"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); - registry.fill(HIST("RecoSparseAllBest"), - etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); - if (bin == static_cast(RightWrongBin::Wrong)) { - float vzBest = 999.; - float vzTrue = 999.; - auto itVzBest = recoVtxZ.find(bestColID); - if (itVzBest != recoVtxZ.end()) { - vzBest = itVzBest->second; - } - auto itVzTrue = recoToMcVZ.find(vzBest); - if (itVzTrue != recoToMcVZ.end()) { - vzTrue = itVzBest->second; - } - double_t vztrueParticle = mcColObj.posZ(); - double_t diff1 = vzBest - vztrueParticle; - double_t diff2 = vzBest - vzTrue; - registry.fill(HIST("deltaVZ_fromReco"), diff1); - registry.fill(HIST("deltaVZ_fromTrue"), diff2); - registry.fill(HIST("RecoSparseAllBestWrong"), - etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (bin == static_cast(RightWrongBin::Wrong)) { + float vzBest = 999.f; + float vzTrue = 999.f; + auto itVzBest = recoVtxZ.find(bestColID); + if (itVzBest != recoVtxZ.end()) { + vzBest = itVzBest->second; + } + auto itVzTrue = recoVtxZ.find(recoCol); + if (itVzTrue != recoVtxZ.end()) { + vzTrue = itVzTrue->second; } + double_t vztrueParticle = track.mcParticle().template mcCollision_as().posZ(); + double_t diff1 = vzBest - vztrueParticle; + double_t diff2 = vzBest - vzTrue; + registry.fill(HIST("deltaVZ_fromReco"), diff1); + registry.fill(HIST("deltaVZ_fromTrue"), diff2); + registry.fill(HIST("RecoSparseAllBestWrong"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } - // Truth DCA components w.r.t. MC collision vertex - const auto dcaXtruth = mcPart.vx() - mcColObj.posX(); // here mcColObj -> mcPart.mcCollision() + if (hasMcLabel) { + const auto mcColObj = track.mcParticle().template mcCollision_as(); + const auto mcPart = track.mcParticle(); + + const auto dcaXtruth = mcPart.vx() - mcColObj.posX(); const auto dcaYtruth = mcPart.vy() - mcColObj.posY(); - const auto dcaZtruth = mcPart.vz() - mcColObj.posZ(); - const auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + - dcaYtruth * dcaYtruth); + const auto dcaZtruth = hasBestDCAZ ? (mcPart.vz() - mcColObj.posZ()) : 0.f; + const auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + dcaYtruth * dcaYtruth); const float etaTruth = mcPart.eta(); const bool isPrimaryTruth = mcPart.isPhysicalPrimary(); - // Base truth histograms (independent of right/wrong vertex) registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthAll"), etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); if (isPrimaryTruth) { @@ -2632,82 +2782,68 @@ struct PseudorapidityDensityMFT { registry.fill(HIST("Purity/reco/woOrp/woOrpTracksEtaZvtx"), track.eta(), z); registry.fill(HIST("Purity/reco/woOrp/woOrpTracksPtZvtx"), track.pt(), z); - if (perCollisionSampleCentral.size() > 0) { - registry.fill(HIST("Purity/reco/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp/woOrpPtZvtx_gt0"), track.pt(), z); - registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAxyZvtx_gt0"), dcaXyCut, z); - registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAzZvtx_gt0"), dcaZCut, z); - } + registry.fill(HIST("Purity/reco/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpPtZvtx_gt0"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAxyZvtx_gt0"), dcaXyCut, z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAzZvtx_gt0"), dcaZCut, z); registry.fill(HIST("Purity/reco/woOrp/woOrpTracksPhiEta"), phi, track.eta()); if (isFakeByLabel) { - // std::cout << " track.eta() " < 0) { - registry.fill(HIST("Purity/reco/woOrp_fake/woOrpEtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp_fake/woOrpPtZvtx_gt0"), track.pt(), z); - } + registry.fill(HIST("Purity/reco/woOrp_fake/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_fake/woOrpPtZvtx_gt0"), track.pt(), z); } if (isTrueByLabel) { - // Has MC particle - // std::cout << " track.eta() has mc particle " < 0) { - registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpEtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpPtZvtx_gt0"), track.pt(), z); - } + registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpPtZvtx_gt0"), track.pt(), z); } if (isSecondaryCharged) { registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksEtaZvtx"), track.eta(), z); registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksPtZvtx"), track.pt(), z); registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksPhiEta"), phi, track.eta()); - if (perCollisionSampleCentral.size() > 0) { - registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpEtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpPtZvtx_gt0"), track.pt(), z); - } + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpPtZvtx_gt0"), track.pt(), z); } if (isPrimaryCharged) { registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksEtaZvtx"), track.eta(), z); registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksPtZvtx"), track.pt(), z); registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksPhiEta"), phi, track.eta()); - if (perCollisionSampleCentral.size() > 0) { - registry.fill(HIST("Purity/reco/woOrp_primary/woOrpEtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Purity/reco/woOrp_primary/woOrpPtZvtx_gt0"), track.pt(), z); - } + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpPtZvtx_gt0"), track.pt(), z); } ++woOrpCount; - // Category 2: all reco tracks after selections (woOrp) - // --- Primary vs Fake accounting --- const float xTrue = mcColObj.posX(); const float yTrue = mcColObj.posY(); const float zTrue = mcColObj.posZ(); std::array dcaInfOrig{999., 999., 999.}; - std::array dcaChosen{999., 999.}; // (DCAxy, DCAz) to chosen reco vertex - std::array dcaRight{999., 999.}; // (DCAxy, DCAz) to truth MC vertex (reference) - std::array dcaChosenXYZ{999., 999., 999.}; // (DCAx, DCAy, DCAz) to chosen reco vertex + std::array dcaChosen{999., 999.}; + std::array dcaRight{999., 999.}; + std::array dcaChosenXYZ{999., 999., 999.}; const double bZ = o2::base::Propagator::Instance()->getNominalBz(); - // Build forward track parameters once per track, then use a fresh copy for each vertex propagation - std::vector v1; // empty -> null cov + std::vector v1; SMatrix55 tcovs(v1.begin(), v1.end()); SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); o2::track::TrackParCovFwd trackPar0{track.z(), tpars, tcovs, track.chi2()}; - auto trackPar = trackPar0; // copy + auto trackPar = trackPar0; dcaInfOrig = {999., 999., 999.}; - const std::array vtxChosen{collision.posX(), collision.posY(), collision.posZ()}; - trackPar.propagateToDCAhelix(bZ, vtxChosen, dcaInfOrig); - dcaChosenXYZ = dcaInfOrig; // store (DCAx, DCAy, DCAz) - dcaChosen[0] = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); - dcaChosen[1] = dcaInfOrig[2]; + auto itVtxChosen = recoVtxByRecoId.find(bestColID); + if (itVtxChosen != recoVtxByRecoId.end()) { + trackPar.propagateToDCAhelix(bZ, itVtxChosen->second, dcaInfOrig); + dcaChosenXYZ = dcaInfOrig; + dcaChosen[0] = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + dcaChosen[1] = dcaInfOrig[2]; + } dcaInfOrig = {999., 999., 999.}; const std::array vtxTruth{xTrue, yTrue, zTrue}; @@ -2716,30 +2852,21 @@ struct PseudorapidityDensityMFT { dcaRight[1] = dcaInfOrig[2]; registry.fill(HIST("Purity/DCAyVsDCAx_Right"), dcaChosenXYZ[2], dcaChosenXYZ[1]); - // Fill only for WRONG-vertex tracks (the diagnostic you want) if (bin == static_cast(RightWrongBin::Wrong)) { - // std::cout <<"dcaxy choosen " << dcaXyCut<<" dcaxy calculated "<(RightWrongBin::Right)) { - // std::cout <<"dcaxy choosen " << dcaXyCut<<" dcaxy calculated "<(RightWrongBin::Right)) { - // Right-vertex: all / primary / secondary registry.fill(HIST("Purity/RecoSparseRightAll"), etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); if (!filledRight) { registry.fill(HIST("Purity/RecoSparseRightAll_EventCount"), static_cast(SingleCountBin::Count)); - filledRight = true; } if (isPrimaryCharged) { @@ -2750,7 +2877,6 @@ struct PseudorapidityDensityMFT { etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); } } else if (bin == static_cast(RightWrongBin::Wrong)) { - // Wrong-vertex: all / primary / secondary registry.fill(HIST("Purity/RecoSparseWrongAll"), etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); if (!filledWrong) { @@ -2765,45 +2891,38 @@ struct PseudorapidityDensityMFT { etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); } } - // Reconstructed vertex position for bestbestColID, if available - auto itVtxX = recoVtxX.find(bestColID); + auto itVtxX = recoVtxX.find(bestColID); if (itVtxX != recoVtxX.end()) { - const float xReco = itVtxX->second; const float yReco = recoVtxY[bestColID]; const float zReco = recoVtxZ[bestColID]; const bool recoVzIn = (zReco >= cfgVzCut1) && (zReco <= cfgVzCut2); const bool trueVzIn = (zTrue >= cfgVzCut1) && (zTrue <= cfgVzCut2); - if (!(recoVzIn && trueVzIn)) { - continue; // skip filling Delta* histos for this track - } - - const float deltaXvtx = xReco - xTrue; - const float deltaYvtx = yReco - yTrue; - const float deltaZvtx = zReco - zTrue; + if (recoVzIn && trueVzIn) { + const float deltaXvtx = xReco - xTrue; + const float deltaYvtx = yReco - yTrue; + const float deltaZvtx = zReco - zTrue; - // We are interested in how far the WRONG collisions are from the true one - if (bin == static_cast(RightWrongBin::Wrong)) { - registry.fill(HIST("Purity/DeltaXWrong"), deltaXvtx); - registry.fill(HIST("Purity/DeltaYWrong"), deltaYvtx); - registry.fill(HIST("Purity/DeltaZWrong"), deltaZvtx); - } - if (bin == static_cast(RightWrongBin::Right)) { - registry.fill(HIST("Purity/DeltaXRight"), deltaXvtx); - registry.fill(HIST("Purity/DeltaYRight"), deltaYvtx); - registry.fill(HIST("Purity/DeltaZRight"), deltaZvtx); + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/DeltaXWrong"), deltaXvtx); + registry.fill(HIST("Purity/DeltaYWrong"), deltaYvtx); + registry.fill(HIST("Purity/DeltaZWrong"), deltaZvtx); + } + if (bin == static_cast(RightWrongBin::Right)) { + registry.fill(HIST("Purity/DeltaXRight"), deltaXvtx); + registry.fill(HIST("Purity/DeltaYRight"), deltaYvtx); + registry.fill(HIST("Purity/DeltaZRight"), deltaZvtx); + } } } - // --- Delta-DCA components: truth minus reco --- const float deltaDCAxy = dcaXYtruth - dcaXYReco; const float deltaDCAz = dcaZtruth - dcaZReco; const float deltaDCAx = dcaXtruth - dcaXReco; const float deltaDCAy = dcaYtruth - dcaYReco; if (bin == static_cast(RightWrongBin::Right)) { - // Right-vertex: all / primary / secondary registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightAll"), deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); if (isPrimaryCharged) { @@ -2814,7 +2933,6 @@ struct PseudorapidityDensityMFT { deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); } } else { - // Wrong-vertex: all / primary / secondary registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongAll"), deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); if (isPrimaryCharged) { @@ -2826,42 +2944,58 @@ struct PseudorapidityDensityMFT { } } - // auto mcColObj = track.mcParticle().mcCollision_as(); - // True primary match (purity numerator) registry.fill(HIST("Purity/mc/PrimaryAll"), static_cast(SingleCountBin::Count)); registry.fill(HIST("Purity/mc/PrimaryAllEta"), mcPart.eta()); registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx"), mcPart.eta(), mcCollision.posZ()); - if (perCollisionSampleCentral.size() > 0) { - registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx_gt0"), mcPart.eta(), mcCollision.posZ()); - registry.fill(HIST("Purity/mc/PrimaryTracksPtZvtx_gt0"), mcPart.pt(), mcCollision.posZ()); - registry.fill(HIST("Purity/mc/PrimaryTracksDCAxyZvtx_gt0"), dcaXyCut, mcCollision.posZ()); - registry.fill(HIST("Purity/mc/PrimaryTracksDCAzZvtx_gt0"), dcaZCut, mcCollision.posZ()); - } + registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx_gt0"), mcPart.eta(), mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksPtZvtx_gt0"), mcPart.pt(), mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksDCAxyZvtx_gt0"), dcaXyCut, mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksDCAzZvtx_gt0"), dcaZCut, mcCollision.posZ()); registry.fill(HIST("Purity/mc/PrimaryTracksPhiEta"), mcPart.phi(), mcPart.eta()); registry.fill(HIST("Purity/SelectedAfterDCAxy/PrimaryAll"), static_cast(SingleCountBin::Count)); registry.fill(HIST("Purity/SelectedAfterDCAxy/PrimaryAllEta"), mcPart.eta()); countedPrimary = true; - // --- Purity profiles (mean of indicator gives purity) --- registry.fill(HIST("Purity/PurityOverall"), static_cast(SingleCountBin::Count), countedPrimary ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); - registry.fill(HIST("Purity/PurityVsEta"), track.eta(), countedPrimary ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); - } // track loop - registry.fill(HIST("Purity/HashTableRowCounts"), - static_cast(HashTableRowCountsBin::UniqueBestRecoCols), uniqueBestRecoCols.size()); + } } - registry.fill(HIST("Purity/reco/woOrp/nTrk"), woOrpCount); - registry.fill(HIST("Purity/reco/PNchMFT_afterCuts"), nMftSelectedAfterCuts); - } // collision + } + + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueBestRecoCols), uniqueBestRecoCols.size()); + registry.fill(HIST("Purity/reco/woOrp/nTrk"), woOrpCount); + registry.fill(HIST("Purity/reco/PNchMFT_afterCuts"), nMftSelectedAfterCuts); + } + void processGenReco3d(McCollisionsWithExtra::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + FullBCs const& bcs, + MFTTracksLabeled3d const& tracks, + FiCentralTracks const& midtracks, + aod::McParticles const& mcParticles) + { + processGenReco(mcCollision, collisions, bcs, tracks, midtracks, mcParticles); } - PROCESS_SWITCH(PseudorapidityDensityMFT, processGenReco, - "Process particle-level info of pt", false); + void processGenReco2d(McCollisionsWithExtra::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + FullBCs const& bcs, + MFTTracksLabeled2d const& tracks, + FiCentralTracks const& midtracks, + aod::McParticles const& mcParticles) + { + processGenReco(mcCollision, collisions, bcs, tracks, midtracks, mcParticles); + } + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenReco3d, + "Process gen-reco info with BestCollisionsFwd3d", true); + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenReco2d, + "Process gen-reco info with BestCollisionsFwd", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 441800c7a98db907987815b0966849ba8462236e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Jos=C3=A9?= <52935244+lucasjsilva@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:57:43 +0200 Subject: [PATCH 228/282] [PWGLF] Improvements in the track criteria selection (#15702) --- .../Tasks/GlobalEventProperties/studyPnch.cxx | 119 ++++++++++-------- 1 file changed, 65 insertions(+), 54 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index 62f5e93d830..35ad555d467 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -76,6 +76,7 @@ AxisSpec axisEvent{10, 0.5, 10.5, "#Event", "EventAxis"}; AxisSpec axisVtxZ{40, -20, 20, "Vertex Z", "VzAxis"}; AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"}; AxisSpec axisPhi{629, 0, o2::constants::math::TwoPI, "#phi"}; +AxisSpec axisCollSel{5, 0.5, 5.5, "#Event", "CollSelAxis"}; auto static constexpr kMinCharge = 3.f; struct StudyPnch { @@ -97,6 +98,7 @@ struct StudyPnch { ConfigurableAxis ft0aMultHistBin{"ft0aMultHistBin", {501, -0.5, 500.5}, ""}; ConfigurableAxis ft0cMultHistBin{"ft0cMultHistBin", {501, -0.5, 500.5}, ""}; ConfigurableAxis ptHistBin{"ptHistBin", {200, 0., 20.}, ""}; + ConfigurableAxis binsDCA{"binsDCA", {500, -10.0f, 10.0f}, ""}; ConfigurableAxis countNumberTracks{"countNumberTracks", {10, -0.5, 9.5}, ""}; Configurable isApplyTFcut{"isApplyTFcut", true, "Enable TimeFrameBorder cut"}; @@ -105,6 +107,8 @@ struct StudyPnch { Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; + Configurable isApplyCheckID{"isApplyCheckID", true, "Select Tracks evaluating Collision ID"}; + Configurable isApplyDuplicatedTrack{"isApplyDuplicatedTrack", true, "Select tracks that are not duplicated"}; void init(InitContext const&) { @@ -115,6 +119,7 @@ struct StudyPnch { AxisSpec axisFt0cMult = {ft0cMultHistBin, "ft0c", "FT0CMultAxis"}; AxisSpec axisPt = {ptHistBin, "pT", "pTAxis"}; AxisSpec axisCountNumberTracks = {countNumberTracks, "Count", "CountAxis"}; + AxisSpec dcaAxis = {binsDCA, "DCA vs PV"}; histos.add("EventHist", "EventHist", kTH1D, {axisEvent}, false); histos.add("VtxZHist", "VtxZHist", kTH1D, {axisVtxZ}, false); @@ -129,8 +134,19 @@ struct StudyPnch { x->SetBinLabel(6, "INEL > 0"); x->SetBinLabel(7, "|vz| < 10"); - if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessModifiedMonteCarlo) { + histos.add("SelCollsHist", "SelCollsHist", kTH1D, {axisCollSel}, false); + auto hstat_colls = histos.get(HIST("SelCollsHist")); + auto* xColls = hstat_colls->GetXaxis(); + xColls->SetBinLabel(1, "All collisions"); + xColls->SetBinLabel(2, "Best Collision Selection"); + xColls->SetBinLabel(3, "Has MC Collision Selection"); + + if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) { histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false); + histos.add("EtaHist", "EtaHist", kTH1D, {axisEta}, false); + histos.add("PhiHist", "PhiHist", kTH1D, {axisPhi}, false); + histos.add("hdcaxy", "dca to pv in the xy plane", kTH1D, {dcaAxis}, false); + histos.add("hdcaz", "dca to pv in the z axis", kTH1D, {dcaAxis}, false); } if (doprocessData) { histos.add("hMultiplicityData", "hMultiplicityData", kTH1F, {axisMult}, true); @@ -143,17 +159,14 @@ struct StudyPnch { histos.add("NPVtracks_vs_GlobalMult", "NPVtracks_vs_GlobalMult", kTH2F, {axisPV, axisMult}, true); } if (doprocessMonteCarlo) { + histos.add("PhiVsEtaGenHist", "PhiVsEtaGenHist", kTH2F, {axisPhi, axisEta}, false); + histos.add("EtaGenHist", "EtaGenHist", kTH1D, {axisEta}, false); + histos.add("PhiGenHist", "PhiGenHist", kTH1D, {axisPhi}, false); histos.add("hMultiplicityMCrec", "hMultiplicityMCrec", kTH1F, {axisMult}, true); histos.add("hMultiplicityMCgen", "hMultiplicityMCgen", kTH1F, {axisMult}, true); histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true); histos.add("hCountNTracks", "hCountNTracks", kTH1F, {axisCountNumberTracks}, true); } - if (doprocessModifiedMonteCarlo) { - histos.add("hMultiplicityMCrecMod", "hMultiplicityMCrecMod", kTH1F, {axisMult}, true); - histos.add("hMultiplicityMCgenMod", "hMultiplicityMCgenMod", kTH1F, {axisMult}, true); - histos.add("hResponseMatrixMod", "hResponseMatrixMod", kTH2F, {axisMult, axisMult}, true); - histos.add("hCountNTracksMod", "hCountNTracksMod", kTH1F, {axisCountNumberTracks}, true); - } if (doprocessEvtLossSigLossMC) { histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); auto hstat = histos.get(HIST("MCEventHist")); @@ -242,6 +255,10 @@ struct StudyPnch { if (!isTrackSelected(track)) { continue; } + histos.fill(HIST("hdcaxy"), track.dcaXY()); + histos.fill(HIST("hdcaz"), track.dcaZ()); + histos.fill(HIST("EtaHist"), track.eta()); + histos.fill(HIST("PhiHist"), track.phi()); histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); nTrk++; } @@ -256,11 +273,12 @@ struct StudyPnch { if (!isGenTrackSelected(track)) { continue; } - if (track.mcCollisionId() != McCol.globalIndex()) { + if (track.mcCollisionId() != McCol.mcCollisionId()) { continue; } - - histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); + histos.fill(HIST("EtaGenHist"), track.eta()); + histos.fill(HIST("PhiGenHist"), track.phi()); + histos.fill(HIST("PhiVsEtaGenHist"), track.phi(), track.eta()); nTrk++; } return nTrk; @@ -270,30 +288,28 @@ struct StudyPnch { int countNTracksMcCol(countTrk const& tracks, McColType const& McCol) { auto nTrk = 0; - std::unordered_map recoFrequencies; // Map that stores globalIndex and the times it appears + std::vector mcRecIDs; for (const auto& track : tracks) { if (!isTrackSelected(track)) { continue; } if (track.has_mcParticle()) { auto particle = track.mcParticle(); - if (particle.mcCollisionId() != McCol.mcCollisionId()) { + if (isApplyCheckID && particle.mcCollisionId() != McCol.mcCollisionId()) { continue; } - auto globalIndex = particle.globalIndex(); - recoFrequencies[globalIndex]++; // Increment the count for this globalIndex - } - histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); - } - // Loop to fill the histogram without cloned tracks - for (const auto& [globalIndex, frequency] : recoFrequencies) { - histos.fill(HIST("hCountNTracks"), frequency); - // Fill histogram with not cloned tracks - if (frequency == 1) { + if (isApplyDuplicatedTrack && find(mcRecIDs.begin(), mcRecIDs.end(), particle.globalIndex()) != mcRecIDs.end()) { + continue; + } + mcRecIDs.push_back(particle.globalIndex()); nTrk++; } + histos.fill(HIST("hdcaxy"), track.dcaXY()); + histos.fill(HIST("hdcaz"), track.dcaZ()); + histos.fill(HIST("EtaHist"), track.eta()); + histos.fill(HIST("PhiHist"), track.phi()); + histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); } - // return recoFrequencies; return nTrk; } @@ -328,47 +344,31 @@ struct StudyPnch { histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), mult); } - void processMonteCarlo(ColMCTrueTable::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; - } - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - auto multrec = countNTracksMcCol(recTracksPart, RecCol); - if (multrec > 0) { - histos.fill(HIST("hMultiplicityMCrec"), multrec); - } - auto multgen = countGenTracks(GenParticles, mcCollision); - if (multgen > 0 && multrec > 0) { - histos.fill(HIST("hMultiplicityMCgen"), multgen); - histos.fill(HIST("hResponseMatrix"), multrec, multgen); - } - } - } - - void processModifiedMonteCarlo(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMonteCarlo(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) { for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } + histos.fill(HIST("SelCollsHist"), 1); // Evaluation of reconstructed collisions with more than 1 contributor if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; } + histos.fill(HIST("SelCollsHist"), 2); if (!RecCol.has_mcCollision()) { continue; } + histos.fill(HIST("SelCollsHist"), 3); auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); auto multrec = countNTracksMcCol(recTracksPart, RecCol); if (multrec > 0) { - histos.fill(HIST("hMultiplicityMCrecMod"), multrec); + histos.fill(HIST("hMultiplicityMCrec"), multrec); } - auto multgen = countGenTracks(GenParticles, mcCollision); + auto multgen = countGenTracks(GenParticles, RecCol); if (multgen > 0 && multrec > 0) { - histos.fill(HIST("hMultiplicityMCgenMod"), multgen); - histos.fill(HIST("hResponseMatrixMod"), multrec, multgen); + histos.fill(HIST("hMultiplicityMCgen"), multgen); + histos.fill(HIST("hResponseMatrix"), multrec, multgen); } } } @@ -386,9 +386,15 @@ struct StudyPnch { } // All generated events histos.fill(HIST("MCEventHist"), 1); - auto multAll = countGenTracks(GenParticles, mcCollision); - if (multAll > 0) { - histos.fill(HIST("hMultiplicityMCgenAll"), multAll); + auto nTrk_multAll = 0; + for (const auto& GenParticle : GenParticles) { + if (!isGenTrackSelected(GenParticle)) { + continue; + } + nTrk_multAll++; + } + if (nTrk_multAll > 0) { + histos.fill(HIST("hMultiplicityMCgenAll"), nTrk_multAll); } bool atLeastOne = false; @@ -407,9 +413,15 @@ struct StudyPnch { if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); - auto multSel = countGenTracks(GenParticles, mcCollision); - if (multSel > 0) { - histos.fill(HIST("hMultiplicityMCgenSel"), multSel); + auto nTrk_multSel = 0; + for (const auto& GenParticle : GenParticles) { + if (!isGenTrackSelected(GenParticle)) { + continue; + } + nTrk_multSel++; + } + if (nTrk_multSel > 0) { + histos.fill(HIST("hMultiplicityMCgenSel"), nTrk_multSel); } } } @@ -417,7 +429,6 @@ struct StudyPnch { PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false); PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false); - PROCESS_SWITCH(StudyPnch, processModifiedMonteCarlo, "process MC CentFT0C", false); PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); }; From e915021d3fd537c5f08a936e04a6957ef325d108 Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:10:05 +0530 Subject: [PATCH 229/282] [PWGCF] Lambda BF Update (#15675) --- .../Tasks/lambdaR2Correlation.cxx | 477 +++++++----------- 1 file changed, 178 insertions(+), 299 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 0d0d75c58bb..d4a6304e172 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -75,9 +75,6 @@ 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(PrPx, prPx, float); -DECLARE_SOA_COLUMN(PrPy, prPy, float); -DECLARE_SOA_COLUMN(PrPz, prPz, float); DECLARE_SOA_COLUMN(PosTrackId, posTrackId, int64_t); DECLARE_SOA_COLUMN(NegTrackId, negTrackId, int64_t); DECLARE_SOA_COLUMN(CosPA, cosPA, float); @@ -96,9 +93,6 @@ DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::Phi, lambdatrack::Rap, lambdatrack::Mass, - lambdatrack::PrPx, - lambdatrack::PrPy, - lambdatrack::PrPz, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::CosPA, @@ -135,9 +129,6 @@ DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::Phi, lambdatrack::Rap, lambdatrack::Mass, - lambdatrack::PrPx, - lambdatrack::PrPy, - lambdatrack::PrPz, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, @@ -146,7 +137,6 @@ DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::V0PrmScd, lambdatrack::CorrFact); using LambdaMcGenTrack = LambdaMcGenTracks::iterator; - } // namespace o2::aod enum CollisionLabels { @@ -239,18 +229,21 @@ enum PrmScdPairType { }; struct LambdaTableProducer { - + // Table Producers Produces lambdaCollisionTable; Produces lambdaTrackTable; Produces lambdaMCGenCollisionTable; Produces lambdaMCGenTrackTable; + // Centrality Axis + ConfigurableAxis cCentBins{"cCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 50.f, 80.0f, 100.f}, "Variable Centrality Bins"}; + // Collisions - Configurable cCentEstimator{"cCentEstimator", 0, "Centrality Estimator : 0-FT0M, 1-FT0C"}; - Configurable cMinZVtx{"cMinZVtx", -10.0, "Min VtxZ cut"}; - Configurable cMaxZVtx{"cMaxZVtx", 10.0, "Max VtxZ cut"}; - Configurable cMinMult{"cMinMult", 0., "Minumum Multiplicity"}; - Configurable cMaxMult{"cMaxMult", 100.0, "Maximum Multiplicity"}; + Configurable cCentEstimator{"cCentEstimator", 1, "Centrality Estimator : 0-FT0M, 1-FT0C"}; + Configurable cMinZVtx{"cMinZVtx", -7.0, "Min VtxZ cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 7.0, "Max VtxZ cut"}; + Configurable cMinCent{"cMinCent", 0., "Minumum Centrality"}; + Configurable cMaxCent{"cMaxCent", 100.0, "Maximum Centrality"}; Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; Configurable cInt7Trig{"cInt7Trig", false, "kINT7 MB Trigger"}; Configurable cSel7Trig{"cSel7Trig", false, "Sel7 (V0A + V0C) Selection Run2"}; @@ -263,13 +256,10 @@ struct LambdaTableProducer { Configurable cIsGoodITSLayers{"cIsGoodITSLayers", false, "Good ITS Layers All"}; // Tracks - Configurable cTrackMinPt{"cTrackMinPt", 0.15, "p_{T} minimum"}; + Configurable cTrackMinPt{"cTrackMinPt", 0.1, "p_{T} minimum"}; Configurable cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} maximum"}; Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "TPC Min Crossed Rows"}; - Configurable cMinTpcCROverCls{"cMinTpcCROverCls", 0.8, "Tpc Min Crossed Rows Over Findable Clusters"}; - Configurable cMaxTpcSharedClusters{"cMaxTpcSharedClusters", 0.4, "Tpc Max Shared Clusters"}; - Configurable cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"}; Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"}; Configurable cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"}; @@ -289,35 +279,33 @@ struct LambdaTableProducer { Configurable cKshortRejFlag{"cKshortRejFlag", true, "K0short Mass Rej Flag"}; // V0s kinmatic acceptance - Configurable cMinV0Mass{"cMinV0Mass", 1.10, "V0 Mass Min"}; - Configurable cMaxV0Mass{"cMaxV0Mass", 1.12, "V0 Mass Min"}; - Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; - Configurable cMaxV0Pt{"cMaxV0Pt", 4.2, "Minimum V0 pT"}; + Configurable cV0MassWindow{"cV0MassWindow", 0.007, "V0 Mass Window"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.6, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 3.6, "Minimum V0 pT"}; Configurable cMaxV0Rap{"cMaxV0Rap", 0.5, "|rap| cut"}; Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Do Eta Analysis"}; - Configurable cV0TypeSelFlag{"cV0TypeSelFlag", false, "V0 Type Selection Flag"}; + Configurable cV0TypeSelFlag{"cV0TypeSelFlag", true, "V0 Type Selection Flag"}; Configurable cV0TypeSelection{"cV0TypeSelection", 1, "V0 Type Selection"}; // V0s MC Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; - Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; - Configurable cSelMCPSV0{"cSelMCPSV0", true, "Select Primary/Secondary V0"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", false, "Select True Lambda"}; + Configurable cSelMCPSV0{"cSelMCPSV0", false, "Select Primary/Secondary V0"}; Configurable cCheckRecoDauFlag{"cCheckRecoDauFlag", true, "Check for reco daughter PID"}; - Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; - Configurable cGenSecondaryLambda{"cGenSecondaryLambda", false, "Secondary Generated Lambda"}; Configurable cGenDecayChannel{"cGenDecayChannel", true, "Gen Level Decay Channel Flag"}; - Configurable cRecoMomResoFlag{"cRecoMomResoFlag", false, "Check effect of momentum space smearing on balance function"}; // Efficiency Correction Configurable cCorrectionFlag{"cCorrectionFlag", false, "Correction Flag"}; Configurable cGetEffFact{"cGetEffFact", false, "Get Efficiency Factor Flag"}; Configurable cGetPrimFrac{"cGetPrimFrac", false, "Get Primary Fraction Flag"}; + Configurable cGetMatchEff{"cGetMatchEff", false, "Get Matching Efficiency Flag"}; Configurable cCorrFactHist{"cCorrFactHist", 0, "Efficiency Factor Histogram"}; Configurable cPrimFracHist{"cPrimFracHist", 0, "Primary Fraction Histogram"}; // 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"}; + Configurable cUrlCCDB{"cUrlCCDB", "http://alice-ccdb.cern.ch", "ALICE CCDB URL"}; + Configurable cPathCCDB{"cPathCCDB", "Users/y/ypatley/LHC22oPass7/LambdaCorrectionFactor", "Path for ccdb-object"}; + Configurable cPathCCDBMatchEff{"cPathCCDBMatchEff", "Users/y/ypatley/LHC22oPass7/ITSTPCMatchEff", "Path for ccdb-object for matching efficiency"}; // Initialize CCDB Service Service ccdb; @@ -337,7 +325,6 @@ struct LambdaTableProducer { // Initialize Global Variables float cent = 0., mult = 0.; - float pt = 0., eta = 0., rap = 0., phi = 0.; void init(InitContext const&) { @@ -348,7 +335,9 @@ struct LambdaTableProducer { // initialize axis specifications const AxisSpec axisCols(5, 0.5, 5.5, ""); const AxisSpec axisTrks(30, 0.5, 30.5, ""); - const AxisSpec axisCent(100, 0, 100, "FT0M (%)"); + const AxisSpec axisCent(100, 0, 100, "Centrality(%)"); + const AxisSpec axisVarCent(cCentBins, "FT0C%"); + const AxisSpec axisPVMults(1000, 0, 1000, "N_{PV}"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); const AxisSpec axisPID(8000, -4000, 4000, "PdgCode"); @@ -369,6 +358,7 @@ struct LambdaTableProducer { const AxisSpec axisAlpha(40, -1, 1, "#alpha"); const AxisSpec axisQtarm(40, 0, 0.4, "q_{T}"); + const AxisSpec axisITSTPCTrackPt(100, 0, 10, "p_{T} (GeV/#it{c})"); const AxisSpec axisTrackPt(40, 0, 4, "p_{T} (GeV/#it{c})"); const AxisSpec axisTrackDCA(200, -1, 1, "dca_{XY} (cm)"); const AxisSpec axisMomPID(80, 0, 4, "p (GeV/#it{c})"); @@ -379,6 +369,7 @@ struct LambdaTableProducer { // Event histograms histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCols}); histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + histos.add("Events/h2f_pvmult_vs_cent", "PVMult Vs Cent", kTH2F, {axisCent, axisPVMults}); // QA histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisTrks}); @@ -386,6 +377,8 @@ struct LambdaTableProducer { 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}); + histos.add("Tracks/h2f_itstrack_centpt", "h2f_itstrack_centpt", kTH2F, {axisVarCent, axisITSTPCTrackPt}); + histos.add("Tracks/h2f_itstpctrack_centpt", "h2f_itstpctrack_centpt", kTH2F, {axisVarCent, axisITSTPCTrackPt}); // QA Lambda histos.add("QA/Lambda/h2f_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); @@ -404,6 +397,10 @@ struct LambdaTableProducer { 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_xisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("QA/Lambda/h2f_pos_prong_xisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("QA/Lambda/h2f_neg_prong_xisqperclustertpc", "#chi^{2}/cluster TPC", kTH2F, {axisTrackPt, {200, 0, 50}}); + histos.add("QA/Lambda/h2f_neg_prong_xisqperclusterits", "#chi^{2}/cluster ITS", kTH2F, {axisTrackPt, {200, 0, 50}}); 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}); @@ -429,7 +426,8 @@ struct LambdaTableProducer { // McReco Histos 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_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_primary_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_secondary_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos histos.add("McGen/h1f_collision_recgen", "# of Reco Collision Associated to One Mc Generator Collision", kTH1F, {axisMult}); @@ -515,7 +513,7 @@ struct LambdaTableProducer { } } - if (cent <= cMinMult || cent >= cMaxMult) { // select centrality percentile class + if (cent <= cMinCent || cent >= cMaxCent) { // select centrality percentile class return false; } @@ -548,7 +546,7 @@ struct LambdaTableProducer { } // Set Multiplicity - mult = col.multNTracksPV(); + mult = col.multTPC(); return true; } @@ -575,18 +573,6 @@ struct LambdaTableProducer { return false; } - if (track.tpcCrossedRowsOverFindableCls() < cMinTpcCROverCls) { - return false; - } - - if (track.tpcNClsShared() > cMaxTpcSharedClusters) { - return false; - } - - if (track.tpcChi2NCl() > cMaxChi2Tpc) { - return false; - } - return true; } @@ -693,13 +679,13 @@ struct LambdaTableProducer { bool lambdaFlag = false, antiLambdaFlag = false; // get v0 track as lambda - if ((v0.mLambda() > cMinV0Mass && v0.mLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + if ((std::abs(v0.mLambda() - MassLambda0) <= cV0MassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { lambdaFlag = true; v0type = kLambda; } // get v0 track as anti-lambda - if ((v0.mAntiLambda() > cMinV0Mass && v0.mAntiLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + if (((std::abs(v0.mAntiLambda() - MassLambda0) <= cV0MassWindow)) && (selLambdaDauWithTpcPid(postrack, negtrack))) { antiLambdaFlag = true; v0type = kAntiLambda; } @@ -842,8 +828,8 @@ struct LambdaTableProducer { return true; } - template - float getCorrectionFactors(V const& v0) + template + float getCorrectionFactors(V const& v0, T const&) { // Check for efficiency correction flag if (!cCorrectionFlag) { @@ -860,7 +846,7 @@ struct LambdaTableProducer { } // initialize efficiency factor and primary fraction values - float effCorrFact = 1., primFrac = 1.; + float effCorrFact = 1., primFrac = 1., matchEffFact = 1.; float rap = (cDoEtaAnalysis) ? v0.eta() : v0.yLambda(); // Get Efficiency Factor @@ -900,15 +886,32 @@ struct LambdaTableProducer { delete histPrm; } - return primFrac * effCorrFact; + // Get Matching Efficiency Correction + if (cGetMatchEff) { + auto posTrack = v0.template posTrack_as(); + auto negTrack = v0.template negTrack_as(); + auto ccdbObjMatchEff = ccdb->getForTimeStamp(cPathCCDBMatchEff.value, -1); + TObject* objMatchEff = reinterpret_cast(ccdbObjMatchEff->FindObject("hITSTPCMatchingEfficiency")); + TH1F* histMatchEff = reinterpret_cast(objMatchEff->Clone()); + float posTrackMatchEff = histMatchEff->GetBinContent(histMatchEff->FindBin(cent, posTrack.pt())); + float negTrackMatchEff = histMatchEff->GetBinContent(histMatchEff->FindBin(cent, negTrack.pt())); + matchEffFact = posTrackMatchEff * negTrackMatchEff; + delete histMatchEff; + } + + return primFrac * effCorrFact * matchEffFact; } template - void fillLambdaMothers(V const& v0, T const&) + void fillLambdaMothers(V const& v0, T const&, PrmScdType const& ps) { auto mcpart = v0.template mcParticle_as(); auto lambdaMothers = mcpart.template mothers_as(); - histos.fill(HIST("Tracks/h2f_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + if (ps == kPrimary) { + histos.fill(HIST("Tracks/h2f_primary_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + } else { + histos.fill(HIST("Tracks/h2f_secondary_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + } } template @@ -946,9 +949,13 @@ struct LambdaTableProducer { 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("h2f_pos_prong_xisqperclusterits"), postrack.pt(), postrack.itsChi2NCl()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_xisqperclustertpc"), postrack.pt(), postrack.tpcChi2NCl()); 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_neg_prong_xisqperclusterits"), negtrack.pt(), negtrack.itsChi2NCl()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_xisqperclustertpc"), negtrack.pt(), negtrack.tpcChi2NCl()); 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()); @@ -973,6 +980,27 @@ struct LambdaTableProducer { histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPhi"), phi); } + template + void getMatchEffHist(T const& tracks) + { + for (auto const& track : tracks) { + if constexpr (dmc == kMC) { // Check corresponding MC particle + if (!track.has_mcParticle()) { + continue; + } + } + if (track.pt() <= cTrackMinPt && std::abs(track.eta()) >= cTrackEtaCut) { // Kinematic selection + continue; + } + if (track.hasITS()) { // ITS only track + histos.fill(HIST("Tracks/h2f_itstrack_centpt"), cent, track.pt()); + } + if (track.hasITS() && track.hasTPC()) { // ITS + TPC track + histos.fill(HIST("Tracks/h2f_itstpctrack_centpt"), cent, track.pt()); + } + } + } + // Reconstructed Level Tables template void fillLambdaRecoTables(C const& collision, V const& v0tracks, T const& tracks) @@ -987,8 +1015,10 @@ struct LambdaTableProducer { } } + // Fill Collision Histograms histos.fill(HIST("Events/h1f_collisions_info"), kPassSelCol); histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); + histos.fill(HIST("Events/h2f_pvmult_vs_cent"), cent, collision.multNTracksPV()); // Fill Collision Table lambdaCollisionTable(cent, mult, collision.posX(), collision.posY(), collision.posZ()); @@ -997,13 +1027,17 @@ struct LambdaTableProducer { ParticleType v0Type = kLambda; PrmScdType v0PrmScdType = kPrimary; float mass = 0., corr_fact = 1.; - float prPx = 0., prPy = 0., prPz = 0.; + // Loop over V0s for (auto const& v0 : v0tracks) { + // daugthers + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + // check for corresponding MCGen Particle if constexpr (dmc == kMC) { histos.fill(HIST("Tracks/h1f_tracks_info"), kTracksBeforeHasMcParticle); - if (!v0.has_mcParticle()) { + if (!v0.has_mcParticle() || !postrack.has_mcParticle() || !negtrack.has_mcParticle()) { // check corresponding MC particle continue; } } @@ -1021,7 +1055,7 @@ struct LambdaTableProducer { continue; } - // we have v0 as lambda + // We have v0 as lambda histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed); // Remove lambda with ambiguous daughters (Only for run3) @@ -1033,10 +1067,6 @@ struct LambdaTableProducer { // Get Lambda mass and kinematic variables mass = (v0Type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); - pt = v0.pt(); - eta = v0.eta(); - rap = v0.yLambda(); - phi = v0.phi(); // do MC analysis if constexpr (dmc == kMC) { @@ -1053,46 +1083,23 @@ struct LambdaTableProducer { } // get mothers information - if (v0PrmScdType == kSecondary) { - fillLambdaMothers(v0, tracks); - } + fillLambdaMothers(v0, tracks, v0PrmScdType); histos.fill(HIST("Tracks/h1f_tracks_info"), kPassTrueLambdaSel); histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); - - if (cRecoMomResoFlag) { - auto mc = v0.template mcParticle_as(); - pt = mc.pt(); - eta = mc.eta(); - rap = mc.y(); - phi = mc.phi(); - float y = (cDoEtaAnalysis) ? eta : rap; - // apply kinematic selection (On Truth) - if (!kinCutSelection(pt, std::abs(y), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { - continue; - } - } } histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); // get correction factors - corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0) : getCorrectionFactors(v0); + corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0, tracks) : getCorrectionFactors(v0, tracks); // fill lambda qa if (v0Type == kLambda) { - // Assign proton Eta Phi - prPx = v0.template posTrack_as().px(); - prPy = v0.template posTrack_as().py(); - prPz = v0.template posTrack_as().pz(); histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); fillLambdaQAHistos(collision, v0, tracks); fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); } else { - // Assign proton Eta Phi - prPx = v0.template negTrack_as().px(); - prPy = v0.template negTrack_as().py(); - prPz = v0.template negTrack_as().pz(); histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); fillLambdaQAHistos(collision, v0, tracks); fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); @@ -1100,7 +1107,7 @@ struct LambdaTableProducer { // Fill Lambda/AntiLambda Table lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), - pt, eta, phi, rap, mass, prPx, prPy, prPz, + v0.pt(), v0.eta(), v0.phi(), v0.yLambda(), mass, v0.template posTrack_as().index(), v0.template negTrack_as().index(), v0.v0cosPA(), v0.dcaV0daughters(), (int8_t)v0Type, v0PrmScdType, corr_fact); } @@ -1117,8 +1124,8 @@ struct LambdaTableProducer { ParticleType v0Type = kLambda; PrmScdType v0PrmScdType = kPrimary; float rap = 0.; - float prPx = 0., prPy = 0., prPz = 0.; + // Loop over MC particles for (auto const& mcpart : mcParticles) { // check for Lambda first if (mcpart.pdgCode() == kLambda0) { @@ -1158,7 +1165,6 @@ struct LambdaTableProducer { auto dautracks = mcpart.template daughters_as(); std::vector daughterPDGs, daughterIDs; std::vector vDauPt, vDauEta, vDauRap, vDauPhi; - std::vector vDauPx, vDauPy, vDauPz; for (auto const& dautrack : dautracks) { daughterPDGs.push_back(dautrack.pdgCode()); daughterIDs.push_back(dautrack.globalIndex()); @@ -1166,9 +1172,6 @@ struct LambdaTableProducer { vDauEta.push_back(dautrack.eta()); vDauRap.push_back(dautrack.y()); vDauPhi.push_back(dautrack.phi()); - vDauPx.push_back(dautrack.px()); - vDauPy.push_back(dautrack.py()); - vDauPz.push_back(dautrack.pz()); } if (cGenDecayChannel) { // check decay channel if (v0Type == kLambda) { @@ -1185,10 +1188,6 @@ struct LambdaTableProducer { histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaToPrPi); if (v0Type == kLambda) { - // Assign proton p-vec - prPx = vDauPx[0]; - prPy = vDauPy[0]; - prPz = vDauPz[0]; histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0]); histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1]); histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode()); @@ -1202,10 +1201,6 @@ struct LambdaTableProducer { histos.fill(HIST("McGen/Lambda/Pion/hPhi"), vDauPhi[1]); fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); } else { - // Assign anti-proton p-vec - prPx = vDauPx[1]; - prPy = vDauPy[1]; - prPz = vDauPz[1]; histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0]); histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1]); histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode()); @@ -1222,7 +1217,7 @@ struct LambdaTableProducer { // Fill Lambda McGen Table lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), - mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), prPx, prPy, prPz, + mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), daughterIDs[0], daughterIDs[1], (int8_t)v0Type, -999., -999., v0PrmScdType, 1.); } } @@ -1251,23 +1246,28 @@ struct LambdaTableProducer { fillLambdaMcGenTables(mcCollision, mcParticles); } - SliceCache cache; - Preslice> perCollision = aod::v0data::collisionId; - - using CollisionsRun3 = soa::Join; - using CollisionsRun2 = soa::Join; - using Tracks = soa::Join; - using TracksRun2 = soa::Join; + // Collision, tracks and V0s + using CollisionsRun3 = soa::Join; + using CollisionsRun2 = soa::Join; + using Tracks = soa::Join; + using TracksRun2 = soa::Join; using TracksMC = soa::Join; using TracksMCRun2 = soa::Join; using McV0Tracks = soa::Join; + SliceCache cache; + Preslice> perCollision = aod::v0data::collisionId; + + void processDummy(CollisionsRun3::iterator const&) {} + + PROCESS_SWITCH(LambdaTableProducer, processDummy, "Dummy Process", true); + void processDataRun3(CollisionsRun3::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) { fillLambdaRecoTables(collision, V0s, tracks); } - PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", true); + PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", false); void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, TracksRun2 const& tracks) { @@ -1276,6 +1276,18 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processDataRun2, "Process for Run2 DATA", false); + void processMatchEffData(CollisionsRun3::iterator const& collision, Tracks const& tracks) + { + // check collision + if (!selCollision(collision)) { + return; + } + // Get Matching Efficiency + getMatchEffHist(tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMatchEffData, "Process for Matching Efficieny Calculation", false); + void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&) { @@ -1300,6 +1312,18 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun2, "Process for Run2 McReco DATA", false); + void processMatchEffMCReco(soa::Join::iterator const& collision, aod::McCollisions const&, TracksMC const& tracks, aod::McParticles const&) + { + // check collision + if (!selCollision(collision)) { + return; + } + // Get Matching Efficiency + getMatchEffHist(tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMatchEffMCReco, "Process for Matching Efficieny Calculation at MC Reconstructed Level", false); + void processMCRun3(aod::McCollisions::iterator const& mcCollision, soa::SmallGroups> const& collisions, McV0Tracks const& V0s, TracksMC const& tracks, @@ -1383,9 +1407,12 @@ struct LambdaTracksExtProducer { } } - void process(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) - { + void processDummy(aod::LambdaCollisions::iterator const&) {} + PROCESS_SWITCH(LambdaTracksExtProducer, processDummy, "Dummy Process", true); + + void processLambdaTrackExt(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) + { int nTotLambda = 0, nTotAntiLambda = 0, nSelLambda = 0, nSelAntiLambda = 0; for (auto const& lambda : tracks) { @@ -1482,162 +1509,8 @@ struct LambdaTracksExtProducer { histos.fill(HIST("h1i_antilambda_mult"), nSelAntiLambda); } } -}; - -struct LambdaSpinCorrelation { - // Global Configurables - Configurable cNPtBins{"cNPtBins", 30, "N pT Bins"}; - Configurable cMinPt{"cMinPt", 0.5, "pT Min"}; - Configurable cMaxPt{"cMaxPt", 3.5, "pT Max"}; - Configurable cNRapBins{"cNRapBins", 10, "N Rapidity Bins"}; - Configurable cMinRap{"cMinRap", -0.5, "Minimum Rapidity"}; - Configurable cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"}; - Configurable cNPhiBins{"cNPhiBins", 36, "N Phi Bins"}; - Configurable cNBinsCosTS{"cNBinsCosTS", 10, "N CosTS Bins"}; - Configurable cInvBoostFlag{"cInvBoostFlag", true, "Inverse Boost Flag"}; - // Centrality Axis - ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; - - // Histogram Registry. - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // Global variables - float cent = 0.; - - void init(InitContext const&) - { - const AxisSpec axisCheck(1, 0, 1, ""); - const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); - const AxisSpec axisCent(cMultBins, "FT0M (%)"); - const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); - const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); - const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); - const AxisSpec axisPt(cNPtBins, cMinPt, cMaxPt, "p_{T} (GeV/#it{c})"); - const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta"); - const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); - const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#varphi (rad)"); - const AxisSpec axisDRap(2 * cNRapBins, cMinRap - cMaxRap, cMaxRap - cMinRap, "#Deltay"); - const AxisSpec axisDPhi(cNPhiBins, -PI, PI, "#Delta#varphi"); - const AxisSpec axisCosTS(cNBinsCosTS, -1, 1, "cos(#theta*)"); - const AxisSpec axisDR(10, 0, 2, "#DeltaR"); - - // Single and Two Particle Densities - // 1D Histograms - histos.add("Reco/h2f_n2_mass_LaPLaM", "m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - histos.add("Reco/h2f_n2_mass_LaPLaP", "m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - histos.add("Reco/h2f_n2_mass_LaMLaM", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - - // rho2 for C2 - histos.add("RecoCorr/h2f_n2_dlta_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR}); - histos.add("RecoCorr/h2f_n2_dlta_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDR}); - histos.add("RecoCorr/h2f_n2_dlta_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_cphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_cphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_cphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); - histos.add("RecoCorr/h2f_n2_dphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); - histos.add("RecoCorr/h2f_n2_dphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); - histos.add("RecoCorr/h2f_n2_dphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi}); - } - - void getBoostVector(std::array const& p, std::array& v, bool inverseBoostFlag = true) - { - int n = p.size(); - for (int i = 0; i < n - 1; ++i) { - if (inverseBoostFlag) { - v[i] = -p[i] / RecoDecay::e(p[0], p[1], p[2], p[3]); - } else { - v[i] = p[i] / RecoDecay::e(p[0], p[1], p[2], p[3]); - } - } - } - - void boost(std::array& p, std::array const& b) - { - float e = RecoDecay::e(p[0], p[1], p[2], p[3]); - float b2 = b[0] * b[0] + b[1] * b[1] + b[2] * b[2]; - float gamma = 1. / std::sqrt(1 - b2); - float bp = b[0] * p[0] + b[1] * p[1] + b[2] * p[2]; - float gamma2 = b2 > 0 ? (gamma - 1.) / b2 : 0.; - - p[0] = p[0] + gamma2 * bp * b[0] + gamma * b[0] * e; - p[1] = p[1] + gamma2 * bp * b[1] + gamma * b[1] * e; - p[2] = p[2] + gamma2 * bp * b[2] + gamma * b[2] * e; - } - - template - void fillPairHistos(U& p1, U& p2) - { - static constexpr std::string_view SubDirHist[] = {"LaPLaM", "LaPLaP", "LaMLaM"}; - - // Fill lambda pair mass - histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt()); - float drap = p1.rap() - p2.rap(); - float dphi = RecoDecay::constrainAngle(p1.phi() - p2.phi(), -PI); - - // Get Lambda-Proton four-momentum - std::array l1 = {p1.px(), p1.py(), p1.pz(), MassLambda0}; - std::array l2 = {p2.px(), p2.py(), p2.pz(), MassLambda0}; - std::array pr1 = {p1.prPx(), p1.prPy(), p1.prPz(), MassProton}; - std::array pr2 = {p2.prPx(), p2.prPy(), p2.prPz(), MassProton}; - std::array v1, v2; - getBoostVector(l1, v1, cInvBoostFlag); - getBoostVector(l2, v2, cInvBoostFlag); - boost(pr1, v1); - boost(pr2, v2); - - std::array pr1tv = {pr1[0], pr1[1], pr1[2]}; - std::array pr2tv = {pr2[0], pr2[1], pr2[2]}; - float cphi = RecoDecay::dotProd(pr1tv, pr2tv) / (RecoDecay::sqrtSumOfSquares(pr1tv[0], pr1tv[1], pr1tv[2]) * RecoDecay::sqrtSumOfSquares(pr2tv[0], pr2tv[1], pr2tv[2])); - float prdphi = RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI); - float prdrap = RecoDecay::eta(pr1tv) - RecoDecay::eta(pr2tv); - float dr = std::sqrt(prdrap * prdrap + prdphi * prdphi); - - // Fill pair density - histos.fill(HIST("RecoCorr/h2f_n2_dphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI)); - histos.fill(HIST("RecoCorr/h2f_n2_cphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, cphi); - histos.fill(HIST("RecoCorr/h2f_n2_dlta_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, dr); - } - - template - void analyzePairs(T const& trks_1, T const& trks_2) - { - for (auto const& trk_1 : trks_1) { - for (auto const& trk_2 : trks_2) { - // check for same index for Lambda-Lambda / AntiLambda-AntiLambda - if (samelambda && ((trk_1.index() == trk_2.index()))) { - continue; - } - fillPairHistos(trk_1, trk_2); - } - } - } - - // Initialize tables - using LambdaCollisions = aod::LambdaCollisions; - using LambdaTracks = soa::Join; - - SliceCache cache; - Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); - Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); - - void processDummy(LambdaCollisions::iterator const&) {} - - PROCESS_SWITCH(LambdaSpinCorrelation, processDummy, "Dummy process", true); - - void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) - { - // assign centrality - cent = collision.cent(); - - auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - analyzePairs(lambdaTracks, antiLambdaTracks); - analyzePairs(lambdaTracks, lambdaTracks); - analyzePairs(antiLambdaTracks, antiLambdaTracks); - } - - PROCESS_SWITCH(LambdaSpinCorrelation, processDataReco, "Process for Data and MCReco", false); + PROCESS_SWITCH(LambdaTracksExtProducer, processLambdaTrackExt, "Process for lambda track extension", false); }; struct LambdaR2Correlation { @@ -1657,7 +1530,7 @@ struct LambdaR2Correlation { Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Eta/Rap Analysis Flag"}; // Centrality Axis - ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; + ConfigurableAxis cCentBins{"cCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -1691,7 +1564,7 @@ struct LambdaR2Correlation { const AxisSpec axisCheck(1, 0, 1, ""); const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); - const AxisSpec axisCent(cMultBins, "FT0M (%)"); + const AxisSpec axisCent(cCentBins, "FT0C (%)"); const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); @@ -1706,16 +1579,14 @@ struct LambdaR2Correlation { // Event 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/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTH2F, {axisCent, axisChMult}); - histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTH2F, {axisCent, axisMult}); - histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTH2F, {axisCent, axisMult}); + histos.add("Event/Reco/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTProfile, {axisCent}); + histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTProfile, {axisCent}); + histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTProfile, {axisCent}); // Efficiency Histograms // Single Particle Efficiencies histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); - histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); - histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRap}); histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRap}); @@ -1723,22 +1594,16 @@ struct LambdaR2Correlation { // 1D Histograms histos.add("Reco/Primary/h3f_n1_centmasspt_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisMass, axisPt}); histos.add("Reco/Primary/h3f_n1_centmasspt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisMass, axisPt}); - histos.add("Reco/Primary/h2f_n1_pt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); - histos.add("Reco/Primary/h2f_n1_pt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); - histos.add("Reco/Primary/h2f_n1_eta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisEta}); - histos.add("Reco/Primary/h2f_n1_eta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisEta}); - histos.add("Reco/Primary/h2f_n1_rap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisRap}); - histos.add("Reco/Primary/h2f_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisRap}); - histos.add("Reco/Primary/h2f_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPhi}); - histos.add("Reco/Primary/h2f_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPhi}); + histos.add("Reco/Primary/h4f_n1_ptrapphi_LaP", "#rho_{1}^{#Lambda}", kTHnSparseF, {axisCent, axisPt, axisRap, axisPhi}); + histos.add("Reco/Primary/h4f_n1_ptrapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRap, axisPhi}); // rho1 for R2 RapPhi histos.add("Reco/Primary/h3f_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisRap, axisPhi}); histos.add("Reco/Primary/h3f_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisPhi}); // rho1 for Q_{inv} - histos.add("Reco/Primary/h3f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); - histos.add("Reco/Primary/h3f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/h3f_n1_ptrapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRapPhi}); + histos.add("Reco/Primary/h3f_n1_ptrapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRapPhi}); // Clone Singles Primary/Secondary Histogram if (cAnaSecondaries) { @@ -1760,9 +1625,9 @@ struct LambdaR2Correlation { histos.add("Reco/PP/h3f_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); // rho2 for R2 Qinv - histos.add("Reco/PP/h2f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); - histos.add("Reco/PP/h2f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2F, {axisCent, axisQinv}); - histos.add("Reco/PP/h2f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h3f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); + histos.add("Reco/PP/h3f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); + histos.add("Reco/PP/h3f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisPt, axisRapPhi, axisQinv}); // Clone Pairs Histograms if (cAnaSecondaryPairs) { @@ -1779,6 +1644,21 @@ struct LambdaR2Correlation { } } + // Rap-Phi Bin Index + int getRapPhiBin(float const& rap, float const& phi) + { + int rapbin = static_cast((rap - kminrap) / rapbinwidth); + int phibin = static_cast(phi / phibinwidth); + + int rapphibin = -99; + if (rapbin >= 0 && phibin >= 0 && rapbin < nrapbins && phibin < nphibins) { + rapphibin = rapbin * nphibins + phibin; + return rapphibin; + } + + return rapphibin; + } + template void fillPairHistos(U& p1, U& p2) { @@ -1813,7 +1693,7 @@ struct LambdaR2Correlation { 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(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h2f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, qinv, corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, p1.pt(), getRapPhiBin(p1.rap(), p1.phi()), qinv, corfac); } template @@ -1831,21 +1711,17 @@ struct LambdaR2Correlation { // Efficiency Plots histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h2f_n1_centpt_") + HIST(SubDirHist[part]), cent, track.pt()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centpteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta()); histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centptrap_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap()); // QA Plots histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_centmasspt_") + HIST(SubDirHist[part]), cent, track.mass(), track.pt()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_pt_") + HIST(SubDirHist[part]), cent, track.pt(), track.corrFact()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_eta_") + HIST(SubDirHist[part]), cent, track.eta(), track.corrFact()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_phi_") + HIST(SubDirHist[part]), cent, track.phi(), track.corrFact()); - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_rap_") + HIST(SubDirHist[part]), cent, track.rap(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h4f_n1_ptrapphi_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap(), track.phi(), track.corrFact()); // Rho1 for N1RapPhi histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_rapphi_") + HIST(SubDirHist[part]), cent, track.rap(), track.phi(), track.corrFact()); - // Rho1 for Q_{inv} Bkg Estimation - histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_pteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta(), track.corrFact()); + // Rho1 for Q_{inv} + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_ptrapphi_") + HIST(SubDirHist[part]), cent, track.pt(), getRapPhiBin(track.rap(), track.phi()), track.corrFact()); } // fill multiplicity histograms @@ -1881,6 +1757,10 @@ struct LambdaR2Correlation { Partition partSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); Partition partSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + void processDummy(aod::LambdaCollisions::iterator const&) {} + + PROCESS_SWITCH(LambdaR2Correlation, processDummy, "Dummy Process", true); + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) { histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); @@ -1923,7 +1803,7 @@ struct LambdaR2Correlation { } } - PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", false); using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; using LambdaMcGenTracks = aod::LambdaMcGenTracks; @@ -1984,6 +1864,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } From 4fe9af34bc3e4e83d1845f4efdc653dea962af28 Mon Sep 17 00:00:00 2001 From: Zhenjun Xiong <108917659+zjxiongOvO@users.noreply.github.com> Date: Fri, 10 Apr 2026 17:14:21 +0200 Subject: [PATCH 230/282] [PWGDQ] add variables for global polarization (#15713) Co-authored-by: ypwangg --- PWGDQ/Core/HistogramsLibrary.cxx | 3 +++ PWGDQ/Core/VarManager.cxx | 15 +++++++++++++++ PWGDQ/Core/VarManager.h | 13 +++++++++++++ 3 files changed, 31 insertions(+) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index e198ea2d7af..c37196eeca6 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1347,6 +1347,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "CosThetaStarTPC", "", false, 100, -1.0, 1.0, VarManager::kCosThetaStarTPC); hm->AddHistogram(histClass, "CosThetaStarFT0A", "", false, 100, -1.0, 1.0, VarManager::kCosThetaStarFT0A); hm->AddHistogram(histClass, "CosThetaStarFT0C", "", false, 100, -1.0, 1.0, VarManager::kCosThetaStarFT0C); + hm->AddHistogram(histClass, "CosThetaStarRandom", "", false, 100, -1.0, 1.0, VarManager::kCosThetaStarRandom); + hm->AddHistogram(histClass, "Cos2ThetaStarFT0C_Mass", "", true, 50, 2.0, 4.0, VarManager::kMass, 100, -1.0, 1.0, VarManager::kCos2ThetaStarFT0C); + hm->AddHistogram(histClass, "Cos2ThetaStarRandom_Mass", "", true, 50, 2.0, 4.0, VarManager::kMass, 100, -1.0, 1.0, VarManager::kCos2ThetaStarRandom); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index d39cdc34a0f..05375a7b971 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -1425,6 +1425,8 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kPsi2B] = ""; fgVariableNames[kPsi2C] = "#Psi_{2}^{C} "; fgVariableUnits[kPsi2C] = ""; + fgVariableNames[kRandomPsi2] = "Random #Psi_{2} "; + fgVariableUnits[kRandomPsi2] = ""; fgVariableNames[kR2SP_AB] = "R_{2}^{SP} (AB) "; fgVariableUnits[kR2SP_AB] = ""; fgVariableNames[kR2SP_AC] = "R_{2}^{SP} (AC) "; @@ -1521,6 +1523,14 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kCosThetaStarFT0A] = ""; fgVariableNames[kCosThetaStarFT0C] = "cos#it{#theta}^{*}_{FT0C}"; fgVariableUnits[kCosThetaStarFT0C] = ""; + fgVariableNames[kAbsCosThetaStarFT0C] = "|cos#it{#theta}^{*}_{FT0C}|"; + fgVariableUnits[kAbsCosThetaStarFT0C] = ""; + fgVariableNames[kCos2ThetaStarFT0C] = "cos^{2}#it{#theta}^{*}_{FT0C}"; + fgVariableUnits[kCos2ThetaStarFT0C] = ""; + fgVariableNames[kCosThetaStarRandom] = "cos#it{#theta}^{*}_{Random}"; + fgVariableUnits[kCosThetaStarRandom] = ""; + fgVariableNames[kCos2ThetaStarRandom] = "cos^{2}#it{#theta}^{*}_{Random}"; + fgVariableUnits[kCos2ThetaStarRandom] = ""; fgVariableNames[kCosPhiVP] = "cos#it{#varphi}_{VP}"; fgVariableUnits[kCosPhiVP] = ""; fgVariableNames[kPhiVP] = "#varphi_{VP} - #Psi_{2}"; @@ -2337,6 +2347,10 @@ void VarManager::SetDefaultVarNames() fgVarNamesMap["kCosThetaStarTPC"] = kCosThetaStarTPC; fgVarNamesMap["kCosThetaStarFT0A"] = kCosThetaStarFT0A; fgVarNamesMap["kCosThetaStarFT0C"] = kCosThetaStarFT0C; + fgVarNamesMap["kAbsCosThetaStarFT0C"] = kAbsCosThetaStarFT0C; + fgVarNamesMap["kCos2ThetaStarFT0C"] = kCos2ThetaStarFT0C; + fgVarNamesMap["kCosThetaStarRandom"] = kCosThetaStarRandom; + fgVarNamesMap["kCos2ThetaStarRandom"] = kCos2ThetaStarRandom; fgVarNamesMap["kCosPhiVP"] = kCosPhiVP; fgVarNamesMap["kPhiVP"] = kPhiVP; fgVarNamesMap["kDeltaPhiPair2"] = kDeltaPhiPair2; @@ -2435,6 +2449,7 @@ void VarManager::SetDefaultVarNames() fgVarNamesMap["kPsi2ANEG"] = kPsi2ANEG; fgVarNamesMap["kPsi2B"] = kPsi2B; fgVarNamesMap["kPsi2C"] = kPsi2C; + fgVarNamesMap["kRandomPsi2"] = kRandomPsi2; fgVarNamesMap["kCos2DeltaPhi"] = kCos2DeltaPhi; fgVarNamesMap["kCos2DeltaPhiMu1"] = kCos2DeltaPhiMu1; fgVarNamesMap["kCos2DeltaPhiMu2"] = kCos2DeltaPhiMu2; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 32cb1ea8227..3b50b989cdd 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -775,6 +775,10 @@ class VarManager : public TObject kCosThetaStarTPC, kCosThetaStarFT0A, kCosThetaStarFT0C, + kAbsCosThetaStarFT0C, + kCos2ThetaStarFT0C, + kCosThetaStarRandom, + kCos2ThetaStarRandom, kCosPhiVP, kPhiVP, kDeltaPhiPair2, @@ -880,6 +884,7 @@ class VarManager : public TObject kPsi2ANEG, kPsi2B, kPsi2C, + kRandomPsi2, kCos2DeltaPhi, kCos2DeltaPhiMu1, // cos(phi - phi1) for muon1 kCos2DeltaPhiMu2, ////cos(phi - phi2) for muon2 @@ -2195,6 +2200,7 @@ void VarManager::FillEvent(T const& event, float* values) values[VarManager::kPsi2A] = Psi2A; values[VarManager::kPsi2B] = Psi2B; values[VarManager::kPsi2C] = Psi2C; + values[VarManager::kRandomPsi2] = gRandom->Uniform(-o2::constants::math::PIHalf, o2::constants::math::PIHalf); if constexpr ((fillMap & ReducedEventQvectorExtra) > 0) { values[kQ42XA] = event.q42xa(); @@ -5697,6 +5703,13 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) ROOT::Math::XYZVector zaxisFT0C = ROOT::Math::XYZVector(TMath::Cos(Psi2C), TMath::Sin(Psi2C), 0).Unit(); values[kCosThetaStarFT0C] = v_CM.Dot(zaxisFT0C); + values[kAbsCosThetaStarFT0C] = std::abs(values[kCosThetaStarFT0C]); + values[kCos2ThetaStarFT0C] = values[kCosThetaStarFT0C] * values[kCosThetaStarFT0C]; + + // Randomize the event plane angle to check the unpolarized contribution + ROOT::Math::XYZVector zaxisRandom = ROOT::Math::XYZVector(TMath::Cos(values[kRandomPsi2]), TMath::Sin(values[kRandomPsi2]), 0).Unit(); + values[kCosThetaStarRandom] = v_CM.Dot(zaxisRandom); + values[kCos2ThetaStarRandom] = values[kCosThetaStarRandom] * values[kCosThetaStarRandom]; } // kV4, kC4POI, kC4REF etc. From fcff36949ea9c711dcfb51e19bfb23e767ade7a4 Mon Sep 17 00:00:00 2001 From: yongzhen <58928668+yhou-git@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:41:21 +0200 Subject: [PATCH 231/282] [PWGJE] chargedJetHadron.cxx: Reduce THnSparse axes (#15708) --- PWGJE/Tasks/chargedJetHadron.cxx | 395 +++++++++++++++++-------------- 1 file changed, 221 insertions(+), 174 deletions(-) diff --git a/PWGJE/Tasks/chargedJetHadron.cxx b/PWGJE/Tasks/chargedJetHadron.cxx index fd4b5831977..c7224f12110 100644 --- a/PWGJE/Tasks/chargedJetHadron.cxx +++ b/PWGJE/Tasks/chargedJetHadron.cxx @@ -46,26 +46,26 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::constants::math; -const double assoHadronPtCut = 2.0; -static const float kNaN = std::numeric_limits::quiet_NaN(); +const double assoHadronPtMin = 1.0, assoHadronPtMax = 2.0; struct ChargedJetHadron { Configurable selectedJetsRadius{"selectedJetsRadius", 0.2, "resolution parameter for histograms without radius"}; Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"}; Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; Configurable centralityMin{"centralityMin", 0.0, "minimum centrality"}; Configurable centralityMax{"centralityMax", 100.0, "maximum centrality"}; Configurable leadingjetptMin{"leadingjetptMin", 20.0, "minimum leadingjetpt"}; Configurable subleadingjetptMin{"subleadingjetptMin", 10.0, "minimum subleadingjetpt"}; Configurable dijetDphiCut{"dijetDphiCut", 0.5, "minimum dijetDphiCut"}; - Configurable assoHadronPtMaxCut{"assoHadronPtMaxCut", 10.0, "maximum associate hadron pt cut"}; + Configurable assoHadronPtMaxCut{"assoHadronPtMaxCut", 8.0, "maximum associate hadron pt cut"}; Configurable etaGapdw{"etaGapdw", 0.5, "dijet eta gap low threshold"}; Configurable etaGapup{"etaGapup", 1.0, "dijet eta gap high threshold"}; Configurable trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"}; Configurable trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"}; Configurable trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"}; - Configurable trackPtMax{"trackPtMax", 100.0, "maximum pT acceptance for tracks"}; + Configurable trackPtMax{"trackPtMax", 140.0, "maximum pT acceptance for tracks"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; 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"}; @@ -81,7 +81,7 @@ struct ChargedJetHadron { Configurable acceptSplitCollisions{"acceptSplitCollisions", 0, "0: only look at mcCollisions that are not split; 1: accept split mcCollisions, 2: accept split mcCollisions but only look at the first reco collision associated with it"}; Configurable skipMBGapEvents{"skipMBGapEvents", false, "flag to choose to reject min. bias gap events; jet-level rejection can also be applied at the jet finder level for jets only, here rejection is applied for collision and track process functions for the first time, and on jets in case it was set to false at the jet finder level"}; Configurable checkLeadConstituentPtForMcpJets{"checkLeadConstituentPtForMcpJets", false, "flag to choose whether particle level jets should have their lead track pt above leadingConstituentPtMin to be accepted; off by default, as leadingConstituentPtMin cut is only applied on MCD jets for the Pb-Pb analysis using pp MC anchored to Pb-Pb for the response matrix"}; - Configurable doDijetRaa{"doDijetRaa", false, "0: all axis fill of thnsparse, 1: partial filling of thnsparse"}; + Configurable doDijetEta{"doDijetEta", true, "0: dijet-hadron Eta axis, 1: dijet-hadron DEta axis"}; Configurable doEventWeighted{"doEventWeighted", false, "0: weight is 1 for MB Sample, 1: weight from Jet-Jet Sample"}; Configurable cfgCentEstimator{"cfgCentEstimator", 0, "0:FT0C; 1:FT0A; 2:FT0M"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "number of events mixed in ME process"}; @@ -91,10 +91,10 @@ struct ChargedJetHadron { ConfigurableAxis binsCentrality{"binsCentrality", {VARIABLE_WIDTH, 0.0, 10., 30., 50, 70., 100.}, "Mixing bins - centrality"}; // Filter .................. - Filter collisionFilter = (nabs(aod::jcollision::posZ) < vertexZCut && + Filter collisionFilter = (nabs(aod::jcollision::posZ) <= vertexZCut && aod::jcollision::trackOccupancyInTimeRange >= trackOccupancyInTimeRangeMin && aod::jcollision::trackOccupancyInTimeRange <= trackOccupancyInTimeRangeMax && ((skipMBGapEvents.node() == false) || (aod::jcollision::getSubGeneratorId != static_cast(jetderiveddatautilities::JCollisionSubGeneratorId::mbGap)))); - Filter mcCollisionFilter = (nabs(aod::jmccollision::posZ) < vertexZCut && + Filter mcCollisionFilter = (nabs(aod::jmccollision::posZ) <= vertexZCut && ((skipMBGapEvents.node() == false) || (aod::jmccollision::getSubGeneratorId != static_cast(jetderiveddatautilities::JCollisionSubGeneratorId::mbGap)))); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta >= trackEtaMin && aod::jtrack::eta <= trackEtaMax); Filter partCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta >= trackEtaMin && aod::jmcparticle::eta <= trackEtaMax); @@ -144,42 +144,42 @@ struct ChargedJetHadron { trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); if (cfgCentEstimator == 0) { - eventCuts = (aod::jcollision::centFT0C >= centralityMin && aod::jcollision::centFT0C < centralityMax); + eventCuts = (aod::jcollision::centFT0C >= centralityMin && aod::jcollision::centFT0C <= centralityMax); } else if (cfgCentEstimator == 1) { - eventCuts = (aod::jcollision::centFT0A >= centralityMin && aod::jcollision::centFT0A < centralityMax); + eventCuts = (aod::jcollision::centFT0A >= centralityMin && aod::jcollision::centFT0A <= centralityMax); } else { - eventCuts = (aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax); + eventCuts = (aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M <= centralityMax); } AxisSpec centralityAxis = {110, -5., 105., "Centrality"}; AxisSpec trackPtAxis = {200, 0.0, 200.0, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec etaAxis = {40, -1.0, 1.0, "#eta"}; + AxisSpec etaAxis = {20, -1.0, 1.0, "#eta"}; AxisSpec phiAxis = {65, -0.2, 6.3, "#varphi"}; AxisSpec jetPtAxis = {200, 0., 200., "#it{p}_{T} (GeV/#it{c})"}; AxisSpec jetPtAxisRhoAreaSub = {280, -80., 200., "#it{p}_{T} (GeV/#it{c})"}; AxisSpec jetmultetaAxis = {4, -0.5, 0.5, "#Delta#eta"}; - AxisSpec detaAxis = {64, -1.6, 1.6, "#Delta#eta"}; + AxisSpec detaAxis = {32, -1.6, 1.6, "#Delta#eta"}; AxisSpec dphiAxis = {70, -1.7, 5.3, "#Delta#varphi"}; - AxisSpec drAxis = {60, 0.0, 1.5, "#Delta#it{R}"}; + AxisSpec drAxis = {30, 0.0, 1.5, "#Delta#it{R}"}; AxisSpec axisBdtScore = {100, 0., 1., "Bdt score"}; if (doprocessCollisionsQCData || doprocessCollisionsQCMCD) { + if (doprocessCollisionsQCMCD && doEventWeighted) { + registry.add("h_jet_phat", "jet #hat{p};#hat{p} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0, 1000}}}); + registry.add("h_jet_phat_weighted", "jet #hat{p};#hat{p} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0, 1000}}}); + } registry.add("h_collisions", "event status;event status; entries", {HistType::kTH1F, {{7, 0.0, 7.0}}}); registry.add("h_collisions_weighted", "event status;event status;entries", {HistType::kTH1F, {{7, 0.0, 7.0}}}); registry.add("h_fakecollisions", "event status;event status; entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h2_centrality_occupancy", "centrality vs occupancy; centrality; occupancy", {HistType::kTH2F, {centralityAxis, {60, 0, 30000}}}); - registry.add("h_collisions_Zvertex", "position of collision; #it{Z} (cm)", {HistType::kTH1F, {{300, -15.0, 15.0}}}); - registry.add("h_collisions_multFT0", " multiplicity using multFT0; entries", {HistType::kTH1F, {{300, 0, 60000}}}); + registry.add("h_collisions_zvertex", "position of collision; #it{Z} (cm)", {HistType::kTH1F, {{300, -15.0, 15.0}}}); + registry.add("h_collisions_multFT0", " multiplicity using multFT0; entries", {HistType::kTH1F, {{500, 0, 100000}}}); registry.add("h2_track_eta_track_phi", "track #eta vs. track #phi; #eta; #phi; counts", {HistType::kTH2F, {etaAxis, phiAxis}}); registry.add("h2_track_eta_pt", "track #eta vs. track #it{p}_{T}; #eta; #it{p}_{T,track} (GeV/#it{c}; counts", {HistType::kTH2F, {etaAxis, trackPtAxis}}); registry.add("h2_track_phi_pt", "track #phi vs. track #it{p}_{T}; #phi; #it{p}_{T,track} (GeV/#it{c}; counts", {HistType::kTH2F, {phiAxis, trackPtAxis}}); } if (doprocessSpectraAreaSubData || doprocessSpectraAreaSubMCD) { - if (doprocessSpectraAreaSubMCD && doEventWeighted) { - registry.add("h_jet_phat", "jet #hat{p};#hat{p} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0, 1000}}}); - registry.add("h_jet_phat_weighted", "jet #hat{p};#hat{p} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0, 1000}}}); - } registry.add("h_jet_pt", "jet pT; #it{p}_{T,jet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxis}}); registry.add("h_jet_eta", "jet eta; #eta_{jet}; counts", {HistType::kTH1F, {etaAxis}}); registry.add("h_jet_phi", "jet phi; #phi_{jet}; counts", {HistType::kTH1F, {phiAxis}}); @@ -228,7 +228,7 @@ struct ChargedJetHadron { registry.add("h2_d0jet_detadphi", "D^{0}-jets deta vs dphi; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); } //========leading jet-hadron correlations====================== - if (doprocessLeadingJetHadron || doprocessLeadinJetHadronMCD) { + if (doprocessLeadingJetHadron || doprocessLeadingJetHadronMCD) { registry.add("h_centrality", "centrality distributions; centrality; counts", {HistType::kTH1F, {centralityAxis}}); registry.add("h_inclusivejet_corrpt", "inclusive jet pT;#it{p}_{T,jet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_leadjet_pt", "leading jet pT;#it{p}_{T,leadingjet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxis}}); @@ -242,20 +242,23 @@ struct ChargedJetHadron { registry.add("h2_dijet_detanoflip_dphi", "dijet #Delta#eta no flip vs #Delta#varphi; #Delta#eta_{noflip}; #Delta#varphi; counts", {HistType::kTH2F, {detaAxis, {63, 0, 6.3}}}); registry.add("h2_dijet_Asymmetry", "dijet Asymmetry; #it{p}_{T,subleadingjet} (GeV/#it{c}); #it{X}_{J}; counts", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {40, 0, 1.0}}}); registry.add("h3_dijet_deta_pt", "dijet #Delta#eta flip vs #it{p}_{T,jet1-jet2}; #Delta#eta_{flip}; #it{p}_{T,jet1} (GeV/#it{c}); #it{p}_{T,jet2} (GeV/#it{c})", {HistType::kTH3F, {{16, 0, 1.6}, jetPtAxis, jetPtAxis}}); - registry.add("h2_dijet_TimeEtaThan0_pt", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - registry.add("h2_dijet_TimeEtaLess0_pt", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - - registry.add("h_jeth_detatot", "jet-hadron tot #Delta#eta;#Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); - registry.add("h_jeth_deta", "jet-hadron #Delta#eta;#Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); - registry.add("h_jeth_dphi", "jet-hadron #Delta#varphi;#Delta#varphi; counts", {HistType::kTH1F, {dphiAxis}}); - registry.add("h2_jeth_deta_dphi", "jeth deta vs dphi; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_jeth_physicalcutsup_deta_dphi", "jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_jeth_physicalcutsmd_deta_dphi", "jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_jeth_physicalcutsdw_deta_dphi", "jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("thn_ljeth_correlations", "leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; #Delta#eta_{jet1,2}; track #eta; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {10, 0., 10.}, jetmultetaAxis, {16, 0, 1.6}, etaAxis, detaAxis, dphiAxis}); + registry.add("h_jeth_detatot", "jeth tot #Delta#eta; #Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); + registry.add("h_jeth_deta", "jeth #Delta#eta; #Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); + registry.add("h_jeth_dphi", "jeth #Delta#varphi; #Delta#varphi; counts", {HistType::kTH1F, {dphiAxis}}); + if (doDijetEta) { + registry.add("h2_dijet_TimeEtaThan0_pt", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_dijet_TimeEtaLess0_pt", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_jeth_heta_dphi", "jeth heta vs dphi; hadron #eta; #Delta#phi", {HistType::kTH2F, {etaAxis, dphiAxis}}); + registry.add("thn_ljeth_correlations", "leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; track #eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, jetmultetaAxis, etaAxis, dphiAxis}); + } else { + registry.add("h2_jeth_physicalcutsup_deta_dphi", "jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_jeth_physicalcutsmd_deta_dphi", "jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_jeth_physicalcutsdw_deta_dphi", "jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("thn_ljeth_correlations", "leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; #Delta#eta_{jet1,2}; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, {16, 0, 1.6}, detaAxis, dphiAxis}); + } } - if (doprocessMixLeadingJetHadron || doprocessMixLeadinJetHadronMCD) { + if (doprocessMixLeadingJetHadron || doprocessMixLeadingJetHadronMCD) { registry.add("h_mixdijet_pair_counts_cut", "ME: number of pairs with leadingjet & subleadingjet cut pair; jet pairs; counts", {HistType::kTH1F, {{10, 0, 10}}}); registry.add("h_mixleadjet_corrpt", "ME: leading jet corrpT;#it{p}_{T,leadingjet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_mixsubleadjet_corrpt", "ME: subleading jet corrpT;#it{p}_{T,leadingjet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); @@ -264,16 +267,20 @@ struct ChargedJetHadron { registry.add("h2_mixdijet_detanoflip_dphi", "ME: dijet #Delta#eta no flip vs #Delta#varphi; #Delta#eta_{noflip}; #Delta#varphi; counts", {HistType::kTH2F, {detaAxis, {63, 0, 6.3}}}); registry.add("h2_mixdijet_Asymmetry", "ME: dijet Asymmetry; #it{p}_{T,subleadingjet} (GeV/#it{c}); #it{X}_{J}; counts", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {40, 0, 1.0}}}); registry.add("h3_mixdijet_deta_pt", "ME: dijet #Delta#eta flip vs #it{p}_{T,jet1-jet2}; #Delta#eta_{flip}; #Delta#varphi; counts", {HistType::kTH3F, {{16, 0, 1.6}, jetPtAxis, jetPtAxis}}); - registry.add("h2_mixdijet_TimeEtaThan0_pt", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - registry.add("h2_mixdijet_TimeEtaLess0_pt", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - registry.add("h_mixjeth_detatot", "ME: jet-hadron correlations; no flip #Delta#eta", {HistType::kTH1F, {detaAxis}}); - registry.add("h_mixjeth_deta", "ME: jet-hadron correlations; #Delta#eta", {HistType::kTH1F, {detaAxis}}); - registry.add("h_mixjeth_dphi", "ME: jet-hadron correlations; #Delta#phi", {HistType::kTH1F, {dphiAxis}}); - registry.add("h2_mixjeth_deta_dphi", "ME: jet-hadron correlations; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_mixjeth_physicalcutsup_deta_dphi", "ME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_mixjeth_physicalcutsmd_deta_dphi", "ME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_mixjeth_physicalcutsdw_deta_dphi", "ME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("thn_mixljeth_correlations", "ME: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; #Delta#eta_{jet1,2}; track #eta; jeth#Delta#eta; jeth#Delta#varphi; poolBin", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {10, 0., 10.}, jetmultetaAxis, {16, 0, 1.6}, etaAxis, detaAxis, dphiAxis, {15, 0, 15}}); + registry.add("h_mixjeth_detatot", "ME: jeth correlations; no flip #Delta#eta", {HistType::kTH1F, {detaAxis}}); + registry.add("h_mixjeth_deta", "ME: jeth correlations; #Delta#eta", {HistType::kTH1F, {detaAxis}}); + registry.add("h_mixjeth_dphi", "ME: jeth correlations; #Delta#phi", {HistType::kTH1F, {dphiAxis}}); + if (doDijetEta) { + registry.add("h2_mixdijet_TimeEtaThan0_pt", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_mixdijet_TimeEtaLess0_pt", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_mixjeth_heta_dphi", "ME: jeth heta vs dphi; hadron #eta; #Delta#phi", {HistType::kTH2F, {etaAxis, dphiAxis}}); + registry.add("thn_mixljeth_correlations", "ME: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; track #eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, jetmultetaAxis, etaAxis, dphiAxis}); + } else { + registry.add("h2_mixjeth_physicalcutsup_deta_dphi", "ME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_mixjeth_physicalcutsmd_deta_dphi", "ME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_mixjeth_physicalcutsdw_deta_dphi", "ME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("thn_mixljeth_correlations", "ME: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; #Delta#eta_{jet1,2}; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, {16, 0, 1.6}, detaAxis, dphiAxis}); + } registry.add("h_mix_event_stats", "Mixed event statistics; Event pair type; counts", {HistType::kTH1F, {{7, 0., 7.}}}); registry.get(HIST("h_mix_event_stats"))->GetXaxis()->SetBinLabel(1, "Total mixed events"); @@ -284,18 +291,18 @@ struct ChargedJetHadron { } if (doprocessCollisionsQCMCP) { - registry.add("h_mcColl_counts", " number of mc events; event status; entries", {HistType::kTH1F, {{7, 0., 7.}}}); + registry.add("h_mcColl_counts", " number of mc events; event status; entries", {HistType::kTH1F, {{9, 0., 9.}}}); registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(1, "allMcColl"); registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(2, "vertexZ"); registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(3, "noRecoColl"); - registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(4, "recoEvtSel"); - registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(5, "centralitycut"); - registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(6, "occupancycut"); - registry.add("h_mcdColl_mult", " mcd multiplicity global tracks; entries", {HistType::kTH1F, {{300, 0, 60000}}}); + registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(4, "nonSplitOnly"); + registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(5, "recoEvtSel"); + registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(6, "occupancyCut"); + registry.get(HIST("h_mcColl_counts"))->GetXaxis()->SetBinLabel(7, "centralityCut"); - registry.add("h_mcpColl_Zvertex", "position of collision ;#it{Z} (cm)", {HistType::kTH1F, {{300, -15.0, 15.0}}}); + registry.add("h_mcpColl_zvertex", "position of collision ;#it{Z} (cm)", {HistType::kTH1F, {{300, -15.0, 15.0}}}); registry.add("h_mcpColl_centrality", "mcp collision centrality; centrality; counts", {HistType::kTH1F, {centralityAxis}}); - registry.add("h_mcpColl_mult", " mcp multiplicity global tracks; entries", {HistType::kTH1F, {{300, 0, 60000}}}); + registry.add("h_mcpColl_multFT0", " mcp multiplicity global tracks; entries", {HistType::kTH1F, {{500, 0, 100000}}}); registry.add("h2_particle_eta_phi", "particle #eta vs. particle #phi; #eta; #phi; counts", {HistType::kTH2F, {etaAxis, phiAxis}}); registry.add("h2_particle_eta_pt", "particle #eta vs. particle #it{p}_{T}; #eta; #it{p}_{T,particle} (GeV/#it{c}; counts", {HistType::kTH2F, {etaAxis, trackPtAxis}}); registry.add("h2_particle_phi_pt", "particle #phi vs. particle #it{p}_{T}; #phi; #it{p}_{T,particle} (GeV/#it{c}; counts", {HistType::kTH2F, {phiAxis, trackPtAxis}}); @@ -355,17 +362,20 @@ struct ChargedJetHadron { registry.add("h2_dijet_detanoflip_dphi_part", "MCP: dijet #Delta#eta no flip vs #Delta#varphi; #Delta#eta_{noflip}; #Delta#varphi; counts", {HistType::kTH2F, {detaAxis, {63, 0, 6.3}}}); registry.add("h2_dijet_Asymmetry_part", "MCP: dijet Asymmetry; #it{p}_{T,subleadingjet} (GeV/#it{c}); #it{X}_{J}; counts", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {40, 0, 1.0}}}); registry.add("h3_dijet_deta_pt_part", "MCP: dijet #Delta#eta flip vs #it{p}_{T,jet1-jet2}; #Delta#eta_{flip}; #Delta#varphi; counts", {HistType::kTH3F, {{16, 0, 1.6}, jetPtAxis, jetPtAxis}}); - registry.add("h2_dijet_TimeEtaThan0_pt_part", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - registry.add("h2_dijet_TimeEtaLess0_pt_part", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - - registry.add("h_jeth_detatot_part", "MCP: jet-hadron tot #Delta#eta;#Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); - registry.add("h_jeth_deta_part", "MCP: jet-hadron #Delta#eta;#Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); - registry.add("h_jeth_dphi_part", "MCP: jet-hadron #Delta#varphi;#Delta#varphi; counts", {HistType::kTH1F, {dphiAxis}}); - registry.add("h2_jeth_deta_dphi_part", "MCP: jeth deta vs dphi; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_jeth_physicalcutsup_deta_dphi_part", "MCP: jeth deta vs dphi with physical cuts |#Delta#eta_{jet}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_jeth_physicalcutsmd_deta_dphi_part", "MCP: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_jeth_physicalcutsdw_deta_dphi_part", "MCP: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("thn_ljeth_correlations_part", "MCP: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; #Delta#eta_{jet1,2}; track #eta; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {10, 0., 10.}, jetmultetaAxis, {16, 0, 1.6}, etaAxis, detaAxis, dphiAxis}); + registry.add("h_jeth_detatot_part", "MCP: jeth tot #Delta#eta; #Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); + registry.add("h_jeth_deta_part", "MCP: jeth #Delta#eta; #Delta#eta; counts", {HistType::kTH1F, {detaAxis}}); + registry.add("h_jeth_dphi_part", "MCP: jeth #Delta#varphi; #Delta#varphi; counts", {HistType::kTH1F, {dphiAxis}}); + if (doDijetEta) { + registry.add("h2_dijet_TimeEtaThan0_pt_part", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_dijet_TimeEtaLess0_pt_part", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_jeth_heta_dphi_part", "MCP: jeth heta vs dphi; hadron #eta; #Delta#phi", {HistType::kTH2F, {etaAxis, dphiAxis}}); + registry.add("thn_ljeth_correlations_part", "MCP: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; track #eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, jetmultetaAxis, etaAxis, dphiAxis}); + } else { + registry.add("h2_jeth_physicalcutsup_deta_dphi_part", "MCP: jeth deta vs dphi with physical cuts |#Delta#eta_{jet}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_jeth_physicalcutsmd_deta_dphi_part", "MCP: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_jeth_physicalcutsdw_deta_dphi_part", "MCP: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("thn_ljeth_correlations_part", "MCP: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; #Delta#eta_{jet1,2}; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, {16, 0, 1.6}, detaAxis, dphiAxis}); + } } if (doprocessMixLeadingJetHadronMCP) { @@ -378,17 +388,20 @@ struct ChargedJetHadron { registry.add("h2_mixdijet_detanoflip_dphi_part", "mcpME: dijet #Delta#eta no flip vs #Delta#varphi; #Delta#eta_{noflip}; #Delta#varphi; counts", {HistType::kTH2F, {detaAxis, {63, 0, 6.3}}}); registry.add("h2_mixdijet_Asymmetry_part", "mcpME: dijet Asymmetry; #it{p}_{T,subleadingjet} (GeV/#it{c}); #it{X}_{J}; counts", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {40, 0, 1.0}}}); registry.add("h3_mixdijet_deta_pt_part", "mcpME: dijet #Delta#eta flip vs #it{p}_{T,jet1-jet2}; #Delta#eta_{flip}; #Delta#varphi; counts", {HistType::kTH3F, {{16, 0, 1.6}, jetPtAxis, jetPtAxis}}); - registry.add("h2_mixdijet_TimeEtaThan0_pt_part", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - registry.add("h2_mixdijet_TimeEtaLess0_pt_part", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); - - registry.add("h_mixjeth_detatot_part", "mcpME: jet-hadron correlations; no flip #Delta#eta", {HistType::kTH1F, {detaAxis}}); - registry.add("h_mixjeth_deta_part", "mcpME: jet-hadron correlations; #Delta#eta", {HistType::kTH1F, {detaAxis}}); - registry.add("h_mixjeth_dphi_part", "mcpME: jet-hadron correlations; #Delta#phi", {HistType::kTH1F, {dphiAxis}}); - registry.add("h2_mixjeth_deta_dphi_part", "mcpME: jet-hadron correlations; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_mixjeth_physicalcutsup_deta_dphi_part", "mcpME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_mixjeth_physicalcutsmd_deta_dphi_part", "mcpME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("h2_mixjeth_physicalcutsdw_deta_dphi_part", "mcpME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); - registry.add("thn_mixljeth_correlations_part", "mcpME: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; #Delta#eta_{jet1,2}; track #eta; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {10, 0., 10.}, jetmultetaAxis, {16, 0, 1.6}, etaAxis, detaAxis, dphiAxis}); + registry.add("h_mixjeth_detatot_part", "mcpME: jeth correlations; no flip #Delta#eta", {HistType::kTH1F, {detaAxis}}); + registry.add("h_mixjeth_deta_part", "mcpME: jeth correlations; #Delta#eta", {HistType::kTH1F, {detaAxis}}); + registry.add("h_mixjeth_dphi_part", "mcpME: jeth correlations; #Delta#phi", {HistType::kTH1F, {dphiAxis}}); + if (doDijetEta) { + registry.add("h2_mixdijet_TimeEtaThan0_pt_part", "dijet #eta_{jet1}#eta_{jet1} > 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_mixdijet_TimeEtaLess0_pt_part", "dijet #eta_{jet1}#eta_{jet1} < 0", {HistType::kTH2F, {jetPtAxis, jetPtAxis}}); + registry.add("h2_mixjeth_heta_dphi_part", "mcpME: jeth heta vs dphi; hadron #eta; #Delta#phi", {HistType::kTH2F, {etaAxis, dphiAxis}}); + registry.add("thn_mixljeth_correlations_part", "mcpME: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; timedijeteta; track #eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, jetmultetaAxis, etaAxis, dphiAxis}); + } else { + registry.add("h2_mixjeth_physicalcutsup_deta_dphi_part", "mcpME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet}| > 1.0; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_mixjeth_physicalcutsmd_deta_dphi_part", "mcpME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| #in (0.5, 1.0); #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("h2_mixjeth_physicalcutsdw_deta_dphi_part", "mcpME: jeth deta vs dphi with physical cuts |#Delta#eta_{jet1,2}| < 0.5; #Delta#eta; #Delta#phi", {HistType::kTH2F, {detaAxis, dphiAxis}}); + registry.add("thn_mixljeth_correlations_part", "mcpME: leading jet-h correlations; leadingjetpT; subleadingjetpT; trackpT; #Delta#eta_{jet1,2}; jeth#Delta#eta; jeth#Delta#varphi", HistType::kTHnSparseF, {jetPtAxis, jetPtAxis, {8, 0., 8.}, {16, 0, 1.6}, detaAxis, dphiAxis}); + } registry.add("h_mixevent_stats_part", "MCP: mixed event statistics; Event pair type; counts", {HistType::kTH1F, {{7, 0., 7.}}}); registry.get(HIST("h_mixevent_stats_part"))->GetXaxis()->SetBinLabel(1, "Total mixed events"); @@ -429,7 +442,7 @@ struct ChargedJetHadron { template bool isGoodCollision(const TCollision& coll) const { - if (!jetderiveddatautilities::selectCollision(coll, eventSelectionBits, skipMBGapEvents.value)) + if (!jetderiveddatautilities::selectCollision(coll, eventSelectionBits, skipMBGapEvents.value, applyRCTSelections.value)) return false; const auto occ = coll.trackOccupancyInTimeRange(); if (occ < trackOccupancyInTimeRangeMin.value || occ > trackOccupancyInTimeRangeMax.value) @@ -444,7 +457,7 @@ struct ChargedJetHadron { } template - bool applyMCCollisionCuts(const TMcCollision& mccollision, const TCollisions& collisions) const + bool applyMCCollisionCuts(const TMcCollision& mccollision, const TCollisions& collisions, bool checkMCPFill = false) { // MC z-vertex cut, must have associated collisions, split-collision rule if (std::abs(mccollision.posZ()) > vertexZCut.value) @@ -455,16 +468,46 @@ struct ChargedJetHadron { if (acceptSplitCollisions.value == NonSplitOnly && collisions.size() > 1) return false; - // At least one associated collision must pass all cuts - if (acceptSplitCollisions.value == SplitOkCheckFirstAssocCollOnly) - return isGoodCollision(*collisions.begin()); + bool hasSel8Coll = false; + bool occupancyIsGood = false; + bool centralityIsGood = false; - for (auto const& collision : collisions) { - if (isGoodCollision(collision)) { - return true; + // At least one associated collision must pass all cuts + if (acceptSplitCollisions.value == SplitOkCheckFirstAssocCollOnly) { + if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents.value, applyRCTSelections.value)) + hasSel8Coll = true; + if ((trackOccupancyInTimeRangeMin.value <= collisions.begin().trackOccupancyInTimeRange()) && (collisions.begin().trackOccupancyInTimeRange() <= trackOccupancyInTimeRangeMax.value)) + occupancyIsGood = true; + float cent = mccollision.centFT0M(); + if (centralityMin.value <= cent && cent <= centralityMax.value) + centralityIsGood = true; + } else { + for (auto const& collision : collisions) { + if (jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents.value, applyRCTSelections.value)) + hasSel8Coll = true; + if ((trackOccupancyInTimeRangeMin.value <= collision.trackOccupancyInTimeRange()) && (collision.trackOccupancyInTimeRange() <= trackOccupancyInTimeRangeMax.value)) + occupancyIsGood = true; + float cent = getCentrality(collision); + if (centralityMin.value <= cent && cent <= centralityMax.value) + centralityIsGood = true; } } - return false; + if (!hasSel8Coll) + return false; + if (checkMCPFill) + registry.fill(HIST("h_mcColl_counts"), 4.5); + + if (!occupancyIsGood) + return false; + if (checkMCPFill) + registry.fill(HIST("h_mcColl_counts"), 5.5); + + if (!centralityIsGood) + return false; + if (checkMCPFill) + registry.fill(HIST("h_mcColl_counts"), 6.5); + + return true; } template @@ -480,12 +523,14 @@ struct ChargedJetHadron { if ((ptMin <= ptMinDefault && ptMax >= ptMaxDefault) || (mcLevelIsParticleLevel && !checkLeadConstituentPtForMcpJets)) return true; // Loop jet constituents + double leadingTrackPt = -1.0; for (const auto& constituent : jet.template tracks_as()) { const double pt = constituent.pt(); - if (pt >= ptMin && pt <= ptMax) - return true; + if (pt > leadingTrackPt) { + leadingTrackPt = pt; + } } - return false; + return (leadingTrackPt >= ptMin && leadingTrackPt <= ptMax); } // ========================================================== template @@ -503,17 +548,6 @@ struct ChargedJetHadron { registry.fill(HIST("h2_track_phi_pt"), track.phi(), track.pt(), weight); } - template - void fillParticleHistograms(const TParticles& particle, float weight = 1.0) - { - float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); - if (particle.pt() > pTHatMaxMCD * pTHat || pTHat < pTHatAbsoluteMin) - return; - registry.fill(HIST("h2_particle_eta_phi"), particle.eta(), particle.phi(), weight); - registry.fill(HIST("h2_particle_eta_pt"), particle.eta(), particle.pt(), weight); - registry.fill(HIST("h2_particle_phi_pt"), particle.phi(), particle.pt(), weight); - } - template void fillJetHistograms(TJets const& jet, float weight = 1.0) { @@ -547,6 +581,17 @@ struct ChargedJetHadron { } } + template + void fillParticleHistograms(const TParticles& particle, float weight = 1.0) + { + float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); + if (particle.pt() > pTHatMaxMCP * pTHat || pTHat < pTHatAbsoluteMin) + return; + registry.fill(HIST("h2_particle_eta_phi"), particle.eta(), particle.phi(), weight); + registry.fill(HIST("h2_particle_eta_pt"), particle.eta(), particle.pt(), weight); + registry.fill(HIST("h2_particle_phi_pt"), particle.phi(), particle.pt(), weight); + } + template void fillMCPHistograms(TJets const& jet, float weight = 1.0) { @@ -807,9 +852,9 @@ struct ChargedJetHadron { registry.fill(HIST("h2_dijet_detanoflip_dphi"), deltaEtaJetsNoflip, deltaPhiJets, weight); registry.fill(HIST("h2_dijet_Asymmetry"), ptSubleadingCorr, ptSubleadingCorr / ptLeadingCorr, weight); registry.fill(HIST("h3_dijet_deta_pt"), deltaEtaJets, ptLeadingCorr, ptSubleadingCorr, weight); - if (multEta1Eta2 > 0) + if (doDijetEta && multEta1Eta2 > 0) registry.fill(HIST("h2_dijet_TimeEtaThan0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (multEta1Eta2 < 0) + else if (doDijetEta && multEta1Eta2 < 0) registry.fill(HIST("h2_dijet_TimeEtaLess0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& track : tracks) { @@ -826,18 +871,21 @@ struct ChargedJetHadron { registry.fill(HIST("h_jeth_detatot"), detatot, weight); registry.fill(HIST("h_jeth_deta"), deta, weight); registry.fill(HIST("h_jeth_dphi"), dphi, weight); - if (doDijetRaa) - registry.fill(HIST("thn_ljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, kNaN, multEta1Eta2, deltaEtaJetsNoflip, kNaN, kNaN, kNaN, weight); - else - registry.fill(HIST("thn_ljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, deltaEtaJets, heta, deta, dphi, weight); - if (hpt < assoHadronPtCut) { - registry.fill(HIST("h2_jeth_deta_dphi"), deta, dphi, weight); - if (std::abs(deltaEtaJets) >= etaGapup) - registry.fill(HIST("h2_jeth_physicalcutsup_deta_dphi"), deta, dphi, weight); - if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) - registry.fill(HIST("h2_jeth_physicalcutsmd_deta_dphi"), deta, dphi, weight); - if (std::abs(deltaEtaJets) < etaGapdw) - registry.fill(HIST("h2_jeth_physicalcutsdw_deta_dphi"), deta, dphi, weight); + // registry.fill(HIST("thn_ljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, multEta1Eta2, deltaEtaJetsNoflip, weight); + if (doDijetEta) { + registry.fill(HIST("thn_ljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, heta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax && multEta1Eta2 > 0) + registry.fill(HIST("h2_jeth_heta_dphi"), heta, dphi, weight); + } else { + registry.fill(HIST("thn_ljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, hpt, deltaEtaJets, deta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax) { + if (std::abs(deltaEtaJets) >= etaGapup) + registry.fill(HIST("h2_jeth_physicalcutsup_deta_dphi"), deta, dphi, weight); + if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) + registry.fill(HIST("h2_jeth_physicalcutsmd_deta_dphi"), deta, dphi, weight); + if (std::abs(deltaEtaJets) < etaGapdw) + registry.fill(HIST("h2_jeth_physicalcutsdw_deta_dphi"), deta, dphi, weight); + } } } } @@ -853,7 +901,7 @@ struct ChargedJetHadron { weight = doEventWeighted ? c1.weight() : 1.f; const float pTHat = 10.f / std::pow(weight, 1.f / pTHatExponent); registry.fill(HIST("h_mix_event_stats"), 1); - int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), getCentrality(c2))); + // int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), getCentrality(c2))); if (!isGoodCollision(c1) || !isGoodCollision(c2)) continue; @@ -921,9 +969,9 @@ struct ChargedJetHadron { registry.fill(HIST("h2_mixdijet_detanoflip_dphi"), deltaEtaJetsNoflip, deltaPhiJets, weight); registry.fill(HIST("h2_mixdijet_Asymmetry"), ptSubleadingCorr, ptSubleadingCorr / ptLeadingCorr, weight); registry.fill(HIST("h3_mixdijet_deta_pt"), deltaEtaJets, ptLeadingCorr, ptSubleadingCorr, weight); - if (multEta1Eta2 > 0) + if (doDijetEta && multEta1Eta2 > 0) registry.fill(HIST("h2_mixdijet_TimeEtaThan0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (multEta1Eta2 < 0) + else if (doDijetEta && multEta1Eta2 < 0) registry.fill(HIST("h2_mixdijet_TimeEtaLess0_pt"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& track : tracks2) { @@ -943,18 +991,20 @@ struct ChargedJetHadron { registry.fill(HIST("h_mixjeth_detatot"), detatot, weight); registry.fill(HIST("h_mixjeth_deta"), deta, weight); registry.fill(HIST("h_mixjeth_dphi"), dphi, weight); - if (doDijetRaa) - registry.fill(HIST("thn_mixljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, kNaN, multEta1Eta2, deltaEtaJetsNoflip, kNaN, kNaN, kNaN, weight); - else - registry.fill(HIST("thn_mixljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, deltaEtaJets, heta, deta, dphi, poolBin, weight); - if (hpt < assoHadronPtCut) { - registry.fill(HIST("h2_mixjeth_deta_dphi"), deta, dphi, weight); - if (std::abs(deltaEtaJets) >= etaGapup) - registry.fill(HIST("h2_mixjeth_physicalcutsup_deta_dphi"), deta, dphi, weight); - if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) - registry.fill(HIST("h2_mixjeth_physicalcutsmd_deta_dphi"), deta, dphi, weight); - if (std::abs(deltaEtaJets) < etaGapdw) - registry.fill(HIST("h2_mixjeth_physicalcutsdw_deta_dphi"), deta, dphi, weight); + if (doDijetEta) { + registry.fill(HIST("thn_mixljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, heta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax && multEta1Eta2 > 0) + registry.fill(HIST("h2_mixjeth_heta_dphi"), heta, dphi, weight); + } else { + registry.fill(HIST("thn_mixljeth_correlations"), ptLeadingCorr, ptSubleadingCorr, hpt, deltaEtaJets, deta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax) { + if (std::abs(deltaEtaJets) >= etaGapup) + registry.fill(HIST("h2_mixjeth_physicalcutsup_deta_dphi"), deta, dphi, weight); + if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) + registry.fill(HIST("h2_mixjeth_physicalcutsmd_deta_dphi"), deta, dphi, weight); + if (std::abs(deltaEtaJets) < etaGapdw) + registry.fill(HIST("h2_mixjeth_physicalcutsdw_deta_dphi"), deta, dphi, weight); + } } } } @@ -1027,9 +1077,9 @@ struct ChargedJetHadron { registry.fill(HIST("h2_dijet_detanoflip_dphi_part"), deltaEtaJetsNoflip, deltaPhiJets, weight); registry.fill(HIST("h2_dijet_Asymmetry_part"), ptSubleadingCorr, ptSubleadingCorr / ptLeadingCorr, weight); registry.fill(HIST("h3_dijet_deta_pt_part"), deltaEtaJets, ptLeadingCorr, ptSubleadingCorr, weight); - if (multEta1Eta2 > 0) + if (doDijetEta && multEta1Eta2 > 0) registry.fill(HIST("h2_dijet_TimeEtaThan0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (multEta1Eta2 < 0) + else if (doDijetEta && multEta1Eta2 < 0) registry.fill(HIST("h2_dijet_TimeEtaLess0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& particle : particles) { @@ -1044,18 +1094,20 @@ struct ChargedJetHadron { registry.fill(HIST("h_jeth_detatot_part"), detatot, weight); registry.fill(HIST("h_jeth_deta_part"), deta, weight); registry.fill(HIST("h_jeth_dphi_part"), dphi, weight); - if (doDijetRaa) - registry.fill(HIST("thn_ljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, kNaN, multEta1Eta2, deltaEtaJetsNoflip, kNaN, kNaN, kNaN, weight); - else - registry.fill(HIST("thn_ljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, deltaEtaJets, heta, deta, dphi, weight); - if (hpt < assoHadronPtCut) { - registry.fill(HIST("h2_jeth_deta_dphi_part"), deta, dphi); - if (std::abs(deltaEtaJets) >= etaGapup) - registry.fill(HIST("h2_jeth_physicalcutsup_deta_dphi_part"), deta, dphi, weight); - if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) - registry.fill(HIST("h2_jeth_physicalcutsmd_deta_dphi_part"), deta, dphi, weight); - if (std::abs(deltaEtaJets) < etaGapdw) - registry.fill(HIST("h2_jeth_physicalcutsdw_deta_dphi_part"), deta, dphi, weight); + if (doDijetEta) { + registry.fill(HIST("thn_ljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, heta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax && multEta1Eta2 > 0) + registry.fill(HIST("h2_jeth_heta_dphi_part"), heta, dphi, weight); + } else { + registry.fill(HIST("thn_ljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, hpt, deltaEtaJets, deta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax) { + if (std::abs(deltaEtaJets) >= etaGapup) + registry.fill(HIST("h2_jeth_physicalcutsup_deta_dphi_part"), deta, dphi, weight); + if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) + registry.fill(HIST("h2_jeth_physicalcutsmd_deta_dphi_part"), deta, dphi, weight); + if (std::abs(deltaEtaJets) < etaGapdw) + registry.fill(HIST("h2_jeth_physicalcutsdw_deta_dphi_part"), deta, dphi, weight); + } } } } @@ -1138,9 +1190,9 @@ struct ChargedJetHadron { registry.fill(HIST("h2_mixdijet_detanoflip_dphi_part"), deltaEtaJetsNoflip, deltaPhiJets, weight); registry.fill(HIST("h2_mixdijet_Asymmetry_part"), ptSubleadingCorr, ptSubleadingCorr / ptLeadingCorr, weight); registry.fill(HIST("h3_mixdijet_deta_pt_part"), deltaEtaJets, ptLeadingCorr, ptSubleadingCorr, weight); - if (multEta1Eta2 > 0) + if (doDijetEta && multEta1Eta2 > 0) registry.fill(HIST("h2_mixdijet_TimeEtaThan0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); - else if (multEta1Eta2 < 0) + else if (doDijetEta && multEta1Eta2 < 0) registry.fill(HIST("h2_mixdijet_TimeEtaLess0_pt_part"), ptLeadingCorr, ptSubleadingCorr, weight); for (auto const& particle : particles2) { @@ -1158,18 +1210,20 @@ struct ChargedJetHadron { registry.fill(HIST("h_mixjeth_detatot_part"), detatot, weight); registry.fill(HIST("h_mixjeth_deta_part"), deta, weight); registry.fill(HIST("h_mixjeth_dphi_part"), dphi, weight); - if (doDijetRaa) - registry.fill(HIST("thn_mixljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, kNaN, multEta1Eta2, deltaEtaJetsNoflip, kNaN, kNaN, kNaN, weight); - else - registry.fill(HIST("thn_mixljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, deltaEtaJets, heta, deta, dphi, weight); - if (hpt < assoHadronPtCut) { - registry.fill(HIST("h2_mixjeth_deta_dphi_part"), deta, dphi); - if (std::abs(deltaEtaJets) >= etaGapup) - registry.fill(HIST("h2_mixjeth_physicalcutsup_deta_dphi_part"), deta, dphi, weight); - if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) - registry.fill(HIST("h2_mixjeth_physicalcutsmd_deta_dphi_part"), deta, dphi, weight); - if (std::abs(deltaEtaJets) < etaGapdw) - registry.fill(HIST("h2_mixjeth_physicalcutsdw_deta_dphi_part"), deta, dphi, weight); + if (doDijetEta) { + registry.fill(HIST("thn_mixljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, hpt, multEta1Eta2, heta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax && multEta1Eta2 > 0) + registry.fill(HIST("h2_mixjeth_heta_dphi_part"), heta, dphi, weight); + } else { + registry.fill(HIST("thn_mixljeth_correlations_part"), ptLeadingCorr, ptSubleadingCorr, hpt, deltaEtaJets, deta, dphi, weight); + if (hpt >= assoHadronPtMin && hpt < assoHadronPtMax) { + if (std::abs(deltaEtaJets) >= etaGapup) + registry.fill(HIST("h2_mixjeth_physicalcutsup_deta_dphi_part"), deta, dphi, weight); + if (std::abs(deltaEtaJets) >= etaGapdw && std::abs(deltaEtaJets) < etaGapup) + registry.fill(HIST("h2_mixjeth_physicalcutsmd_deta_dphi_part"), deta, dphi, weight); + if (std::abs(deltaEtaJets) < etaGapdw) + registry.fill(HIST("h2_mixjeth_physicalcutsdw_deta_dphi_part"), deta, dphi, weight); + } } } } @@ -1182,7 +1236,7 @@ struct ChargedJetHadron { FilterJetTracks const& tracks) { registry.fill(HIST("h_collisions"), 0.5); - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections.value)) return; registry.fill(HIST("h_collisions"), 1.5); if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) { @@ -1193,7 +1247,7 @@ struct ChargedJetHadron { return; registry.fill(HIST("h_collisions"), 3.5); registry.fill(HIST("h2_centrality_occupancy"), getCentrality(collision), collision.trackOccupancyInTimeRange()); - registry.fill(HIST("h_collisions_Zvertex"), collision.posZ()); + registry.fill(HIST("h_collisions_zvertex"), collision.posZ()); registry.fill(HIST("h_collisions_multFT0"), getMultiplicity(collision)); // collision.MultFT0M() for (auto const& track : tracks) { @@ -1304,7 +1358,7 @@ struct ChargedJetHadron { } registry.fill(HIST("h_collisions"), 0.5); registry.fill(HIST("h_collisions_weighted"), 0.5, eventWeight); - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections.value)) return; registry.fill(HIST("h_collisions"), 1.5); registry.fill(HIST("h_collisions_weighted"), 1.5, eventWeight); @@ -1318,7 +1372,7 @@ struct ChargedJetHadron { registry.fill(HIST("h_collisions"), 3.5); registry.fill(HIST("h_collisions_weighted"), 3.5, eventWeight); registry.fill(HIST("h2_centrality_occupancy"), getCentrality(collision), collision.trackOccupancyInTimeRange(), eventWeight); - registry.fill(HIST("h_collisions_Zvertex"), collision.posZ(), eventWeight); + registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); for (auto const& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) @@ -1348,9 +1402,9 @@ struct ChargedJetHadron { } PROCESS_SWITCH(ChargedJetHadron, processSpectraAreaSubMCD, "jet spectra with rho-area subtraction for MCD", false); - void processLeadinJetHadronMCD(FilterCollision const& collision, - CorrChargedMCDJets const& jets, - FilterJetTracks const& tracks) + void processLeadingJetHadronMCD(FilterCollision const& collision, + CorrChargedMCDJets const& jets, + FilterJetTracks const& tracks) { const float eventWeight = doEventWeighted ? collision.weight() : 1.f; if (!isGoodCollision(collision)) { @@ -1358,17 +1412,17 @@ struct ChargedJetHadron { } fillLeadingJetHadronHistograms(collision, jets, tracks, eventWeight); } - PROCESS_SWITCH(ChargedJetHadron, processLeadinJetHadronMCD, "same event leading jet-hadron correlations for MCD", false); + PROCESS_SWITCH(ChargedJetHadron, processLeadingJetHadronMCD, "same event leading jet-hadron correlations for MCD", false); - void processMixLeadinJetHadronMCD(FilterCollisions const& collisions, - CorrChargedMCDJets const& jets, - FilterJetTracks const& tracks) + void processMixLeadingJetHadronMCD(FilterCollisions const& collisions, + CorrChargedMCDJets const& jets, + FilterJetTracks const& tracks) { if (collisions.size() == 0) return; fillMixLeadingJetHadronHistograms(collisions, jets, tracks); } - PROCESS_SWITCH(ChargedJetHadron, processMixLeadinJetHadronMCD, "mixed event leading jet-hadron correlations for MCD", false); + PROCESS_SWITCH(ChargedJetHadron, processMixLeadingJetHadronMCD, "mixed event leading jet-hadron correlations for MCD", false); void processJetHadronMCD(FilterCollision const& collision, CorrChargedMCDJets const& jets, @@ -1411,19 +1465,12 @@ struct ChargedJetHadron { return; registry.fill(HIST("h_mcColl_counts"), 3.5); - int nGood = 0; - for (auto const& collision : collisions) { - if (isGoodCollision(collision)) { - registry.fill(HIST("h_mcdColl_mult"), getMultiplicity(collision), eventWeight); - nGood++; - } - } - if (nGood == 0) + if (!applyMCCollisionCuts(mccollision, collisions, true)) return; - registry.fill(HIST("h_mcColl_counts"), 4.5); - registry.fill(HIST("h_mcpColl_Zvertex"), mccollision.posZ(), eventWeight); + registry.fill(HIST("h_mcColl_counts"), 7.5); + registry.fill(HIST("h_mcpColl_zvertex"), mccollision.posZ(), eventWeight); registry.fill(HIST("h_mcpColl_centrality"), mccollision.centFT0M(), eventWeight); - registry.fill(HIST("h_mcpColl_mult"), getMultiplicity(mccollision), eventWeight); + registry.fill(HIST("h_mcpColl_multFT0"), getMultiplicity(mccollision), eventWeight); for (auto const& particle : particles) { fillParticleHistograms(particle, eventWeight); } From e3edb15f316977c080a956f36b3a72f76222cef6 Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:45:06 +0200 Subject: [PATCH 232/282] [PWGLF] Add FT0C centrality vs FT0C mult correlation (#15716) --- .../GlobalEventProperties/heavyionMultiplicity.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index ac1e8841006..6eadc606998 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -197,6 +197,7 @@ struct HeavyionMultiplicity { Configurable isApplyNoCollInRofStandard{"isApplyNoCollInRofStandard", false, "Enable NoCollInRofStandard cut"}; Configurable isApplyNoHighMultCollInPrevRof{"isApplyNoHighMultCollInPrevRof", false, "Enable NoHighMultCollInPrevRof cut"}; Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; + Configurable isApplyVtxCut{"isApplyVtxCut", false, "Enable vertex cut condition"}; Configurable isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "Enable FT0CbasedOccupancy cut"}; Configurable isApplyCentFT0C{"isApplyCentFT0C", true, "Centrality based on FT0C"}; Configurable isApplyCentFV0A{"isApplyCentFV0A", false, "Centrality based on FV0A"}; @@ -207,6 +208,7 @@ struct HeavyionMultiplicity { Configurable isApplyCentMFT{"isApplyCentMFT", false, "Centrality based on MFT tracks"}; Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; + Configurable isApplyBestCollIndex{"isApplyBestCollIndex", true, ""}; Configurable selectCollidingBCs{"selectCollidingBCs", true, "BC analysis: select colliding BCs"}; Configurable selectTVX{"selectTVX", true, "BC analysis: select TVX"}; @@ -357,6 +359,7 @@ struct HeavyionMultiplicity { histos.add("hRecMCvertexZ", "hRecMCvertexZ", kTH1D, {axisVtxZ}, false); histos.add("hRecMCvtxzcent", "hRecMCvtxzcent", kTH3D, {axisVtxZ, centAxis, axisOccupancy}, false); histos.add("hRecMCcentrality", "hRecMCcentrality", kTH1D, {axisCent}, false); + histos.add("MCCentrality_vs_FT0C", "MCCentrality_vs_FT0C", kTH2F, {axisCent, axisFt0cMult}, true); histos.add("hRecMCphivseta", "hRecMCphivseta", kTH2D, {axisPhi2, axisEta}, false); histos.add("hRecMCdndeta", "hRecMCdndeta", kTHnSparseD, {axisVtxZ, centAxis, axisOccupancy, axisEta, axisPhi, axisRecTrkType}, false); histos.add("etaResolution", "etaResolution", kTH2D, {axisEta, axisDeltaEta}); @@ -415,6 +418,10 @@ struct HeavyionMultiplicity { return false; } histos.fill(HIST("EventHist"), 10); + if (isApplyVtxCut && std::abs(col.posZ()) >= vtxRange) { + return false; + } + histos.fill(HIST("EventHist"), 11); return true; } @@ -875,7 +882,7 @@ struct HeavyionMultiplicity { if (!isEventSelected(RecCol)) { continue; } - if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + if (isApplyBestCollIndex && RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; } atLeastOne = true; @@ -928,11 +935,12 @@ struct HeavyionMultiplicity { if (!isEventSelected(RecCol)) { continue; } - if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + if (isApplyBestCollIndex && RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; } histos.fill(HIST("hRecMCvertexZ"), RecCol.posZ()); histos.fill(HIST("hRecMCcentrality"), selColCent(RecCol)); + histos.fill(HIST("MCCentrality_vs_FT0C"), RecCol.centFT0C(), RecCol.multFT0C()); histos.fill(HIST("hRecMCvtxzcent"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol)); auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); From 759a5650cede20f3b6b8eadddca66fd67520c602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:47:10 +0200 Subject: [PATCH 233/282] [PWGHF] Fix includes and using statements (#15721) --- .../dataCreatorHiddenCharmReduced.cxx | 15 ++++++++------- PWGHF/D2H/Tasks/taskD0.cxx | 1 + PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 2 +- PWGHF/D2H/Tasks/taskHiddenCharm.cxx | 3 +++ PWGHF/D2H/Tasks/taskLc.cxx | 1 + PWGHF/HFL/Tasks/taskSingleMuonSource.cxx | 4 +++- PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx | 1 + 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx index c205258b3c6..ef0171a7fd9 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorHiddenCharmReduced.cxx @@ -19,16 +19,12 @@ #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/D2H/DataModel/ReducedDataModel.h" #include "PWGHF/D2H/Utils/utilsRedDataFormat.h" -#include "PWGHF/DataModel/AliasTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "PWGHF/Utils/utilsAnalysis.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/TPCVDriftManager.h" #include "Common/Core/ZorroSummary.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" @@ -37,21 +33,26 @@ #include #include +#include #include #include #include +#include #include +#include #include #include #include #include #include -#include +#include #include #include +#include #include -#include +#include +#include #include #include diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 68dba6a3d91..22225c4a951 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -32,6 +32,7 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" #include #include diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index f0af577b233..64dae9f433c 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include diff --git a/PWGHF/D2H/Tasks/taskHiddenCharm.cxx b/PWGHF/D2H/Tasks/taskHiddenCharm.cxx index 0830048c0a7..70fa6f717f2 100644 --- a/PWGHF/D2H/Tasks/taskHiddenCharm.cxx +++ b/PWGHF/D2H/Tasks/taskHiddenCharm.cxx @@ -21,7 +21,9 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" +#include #include +#include #include #include #include @@ -31,6 +33,7 @@ #include #include +#include #include using namespace o2; diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index bd29b00c868..e7144cf505d 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -36,6 +36,7 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" #include #include diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index e2d209966dc..5076aca2541 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -16,6 +16,7 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" +#include #include #include #include @@ -28,7 +29,8 @@ #include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include #include #include diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index a21218a5eed..11fbbf3508b 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -34,6 +34,7 @@ #include #include +#include using namespace o2; using namespace o2::framework; From f762349549a87751832ca6b494daf11a97fe3094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:26:13 +0200 Subject: [PATCH 234/282] [ALICE3] Fix includes and using statements (#15717) --- ALICE3/DataModel/OTFMCParticle.h | 2 ++ ALICE3/Macros/drawFastTracker.C | 11 ++++++++++- ALICE3/Macros/testFastTracker.C | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ALICE3/DataModel/OTFMCParticle.h b/ALICE3/DataModel/OTFMCParticle.h index cf24e2e7691..56a1400a2e9 100644 --- a/ALICE3/DataModel/OTFMCParticle.h +++ b/ALICE3/DataModel/OTFMCParticle.h @@ -21,6 +21,8 @@ #include +#include + namespace o2::aod { diff --git a/ALICE3/Macros/drawFastTracker.C b/ALICE3/Macros/drawFastTracker.C index 71f44970d37..79978eac997 100644 --- a/ALICE3/Macros/drawFastTracker.C +++ b/ALICE3/Macros/drawFastTracker.C @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include @@ -21,9 +23,16 @@ #include #include #include -#include +#include #include #include +#include +#include + +#include + +#include +#include void drawFastTracker(float magneticField = 5.f, // in units of kGauss const int nch = 100, // number of charged particles per unit rapidity diff --git a/ALICE3/Macros/testFastTracker.C b/ALICE3/Macros/testFastTracker.C index 68d416295a8..857ff416919 100644 --- a/ALICE3/Macros/testFastTracker.C +++ b/ALICE3/Macros/testFastTracker.C @@ -15,10 +15,10 @@ #include "ALICE3/Core/FastTracker.h" -#include -#include #include +#include + void testFastTracker(std::string geometryFile = "a3geo.ini") { From 7de0b016015b8c5f6a1efbfc704f8ff4516eb047 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 10 Apr 2026 21:54:02 +0200 Subject: [PATCH 235/282] [PWGCF] DptDpt - More ancestor identification flexibility (#15724) Co-authored-by: Victor Gonzalez --- .../Tasks/particleOriginAnalysis.cxx | 119 ++---------------- 1 file changed, 13 insertions(+), 106 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx index 354a6865699..11df7945ea1 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx @@ -54,97 +54,13 @@ namespace particleorigintask { using namespace o2::analysis::dptdptfilter; -// ============================================================================ -// Compact encoding of the mother resonance identity -// ============================================================================ -enum MotherSpecies { - kMothPrompt = 0, ///< not from decay (prompt from hadronization) - kMothRho0, ///< rho0(770) - PDG 113 - kMothRhoCharged, ///< rho+/-(770) - PDG 213 - kMothOmega782, ///< omega(782) - PDG 223 - kMothEta, ///< eta - PDG 221 - kMothEtaPrime, ///< eta'(958) - PDG 331 - kMothKStar892Ch, ///< K*(892)+/- - PDG 323 - kMothKStar892_0, ///< K*(892)0 - PDG 313 - kMothPhi1020, ///< phi(1020) - PDG 333 - kMothDelta, ///< Delta(1232) all - PDG 1114,2114,2214,2224 - kMothSigmaStar, ///< Sigma*(1385) - PDG 3114,3214,3224 - kMothLambda1520, ///< Lambda(1520) - PDG 3124 - kMothF0_980, ///< f0(980) - PDG 9010221 - kMothOtherMeson, ///< other meson mothers - kMothOtherBaryon, ///< other baryon mothers - kNMotherSpecies -}; - -static const char* motherLabel[kNMotherSpecies] = { - "prompt", "#rho^{0}", "#rho^{#pm}", "#omega", "#eta", "#eta'", - "K*^{#pm}", "K*^{0}", "#phi", - "#Delta", "#Sigma*", "#Lambda(1520)", - "f_{0}(980)", "other meson", "other baryon"}; - -// PDG codes used from TPDGCode.h (ROOT): -// kRho770_0 (113), kRho770Plus (213), kLambda1520 (3124), -// kPiPlus (211), kKPlus (321), kProton (2212) -// PDG codes used from CommonConstants/PhysicsConstants.h (O2): -// o2::constants::physics::Pdg::kEta (221), kOmega (223), kEtaPrime (331), -// kK0Star892 (313), kKPlusStar892 (323), kPhi (333) -// PDG codes NOT in either header - defined here: -static constexpr int KPdgDeltaMinusMinus = 1114; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgDelta0 = 2114; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgDeltaPlus = 2214; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgDeltaPlusPlus = 2224; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgSigmaStarMinus = 3114; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgSigmaStar0 = 3214; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgSigmaStarPlus = 3224; // o2-linter: disable=pdg/explicit-code(not existing) -static constexpr int KPdgF0_980 = 9010221; // o2-linter: disable=pdg/explicit-code(not existing),name/function-variable(clashes with f0),name/constexpr-constant(clashes with f0) - -/// PDG codes below this threshold are mesons; at or above are baryons -static constexpr int KPdgBaryonThreshold = 1000; // o2-linter: disable=pdg/explicit-code(not a PDG code) - -/// \brief Encode absolute PDG code of a mother into compact bin index -inline int encodeMotherPDG(int absPdg) -{ - using namespace o2::constants::physics; - switch (absPdg) { - case kRho770_0: - return kMothRho0; - case kRho770Plus: /* kRho770Minus is just -213, we use abs */ - return kMothRhoCharged; - case Pdg::kOmega: - return kMothOmega782; - case Pdg::kEta: - return kMothEta; - case Pdg::kEtaPrime: - return kMothEtaPrime; - case Pdg::kKPlusStar892: - return kMothKStar892Ch; - case Pdg::kK0Star892: - return kMothKStar892_0; - case Pdg::kPhi: - return kMothPhi1020; - case KPdgDeltaMinusMinus: - case KPdgDelta0: - case KPdgDeltaPlus: - case KPdgDeltaPlusPlus: - return kMothDelta; - case KPdgSigmaStarMinus: - case KPdgSigmaStar0: - case KPdgSigmaStarPlus: - return kMothSigmaStar; - case kLambda1520: - return kMothLambda1520; - case KPdgF0_980: - return kMothF0_980; - default: - return (absPdg < KPdgBaryonThreshold) ? kMothOtherMeson : kMothOtherBaryon; - } -} - /// PDG codes above this threshold correspond to hadrons (mesons and baryons). /// Below are quarks (1-6), leptons (11-16), gauge bosons (21-25), and /// special/internal generator codes. -static constexpr int KPdgHadronThreshold = 100; // o2-linter: disable=pdg/explicit-code(not a PDG code) +static constexpr int KPdgHadronThreshold = 100; // o2-linter: disable=pdg/explicit-code (not a PDG code) +/// the prompt origin label +static constexpr std::string PromptStr = "prompt"; // ============================================================================ // Classification utilities // ============================================================================ @@ -226,8 +142,6 @@ struct ParticleOriginAnalysis { /* histogram pointers for direct access */ /* per track id histograms: indexed by trackacceptedid */ - static constexpr int KNMo = particleorigintask::kNMotherSpecies; - std::vector> fhPromptVsPt; ///< prompt counts vs pT, per track id std::vector> fhDecayVsPt; ///< from-decay counts vs pT, per track id std::vector> fhPromptVsCentVsPt; ///< prompt counts vs (cent, pT), per track id @@ -316,7 +230,6 @@ struct ParticleOriginAnalysis { /* build the centrality axis with variable bin edges */ const AxisSpec centAxis{centBinEdges, "centrality (%)"}; const AxisSpec ptAxis{ptbins, ptlow, ptup, "#it{p}_{T} (GeV/#it{c})"}; - const AxisSpec motherAxis{KNMo, -0.5f, KNMo - 0.5f, "mother species"}; const AxisSpec pdgAxis{100, 0.5f, 100.5f, "species"}; const AxisSpec zvtxAxis{zvtxbins, zvtxlow, zvtxup, "#it{z}_{vtx}"}; @@ -357,18 +270,12 @@ struct ParticleOriginAnalysis { fhMotherVsPtVsCent[i] = registry.add( FORMATSTRING("MotherVsPtVsCent_%s", tname), FORMATSTRING("Immediate mother of %s;mother;#it{p}_{T} (GeV/#it{c});centrality (%%)", tname), - kTH3D, {motherAxis, ptAxis, centAxis}); + kTH3D, {pdgAxis, ptAxis, centAxis}); fhAncestorVsPtVsCent[i] = registry.add( FORMATSTRING("AncestorVsPtVsCent_%s", tname), FORMATSTRING("Earliest ancestor of %s;ancestor;#it{p}_{T} (GeV/#it{c});centrality (%%)", tname), - kTH3D, {motherAxis, ptAxis, centAxis}); - - /* label the encoded mother/ancestor axis */ - for (int im = 0; im < KNMo; ++im) { - fhMotherVsPtVsCent[i]->GetXaxis()->SetBinLabel(im + 1, motherLabel[im]); - fhAncestorVsPtVsCent[i]->GetXaxis()->SetBinLabel(im + 1, motherLabel[im]); - } + kTH3D, {pdgAxis, ptAxis, centAxis}); fhMotherPDG[i] = registry.add( FORMATSTRING("MotherPDG_%s", tname), @@ -399,20 +306,20 @@ struct ParticleOriginAnalysis { if (isFromDecay) { fhDecayVsPt[tid]->Fill(pt); fhDecayVsCentVsPt[tid]->Fill(centmult, pt); - int encodedMother = encodeMotherPDG(std::abs(immediatePdg)); - fhMotherVsPtVsCent[tid]->Fill(static_cast(encodedMother), pt, centmult); - fhMotherPDG[tid]->Fill(TString::Format("%d", immediatePdg).Data(), 1.0); + TString strMother = TString::Format("%d", immediatePdg); + fhMotherVsPtVsCent[tid]->Fill(strMother.Data(), pt, centmult, 1.0); + fhMotherPDG[tid]->Fill(strMother.Data(), 1.0); } else { fhPromptVsPt[tid]->Fill(pt); fhPromptVsCentVsPt[tid]->Fill(centmult, pt); - fhMotherVsPtVsCent[tid]->Fill(static_cast(kMothPrompt), pt, centmult); + fhMotherVsPtVsCent[tid]->Fill(PromptStr.c_str(), pt, centmult, 1.0); } if (isFromDecayFull) { - int encodedAncestor = encodeMotherPDG(std::abs(ancestorPdg)); - fhAncestorVsPtVsCent[tid]->Fill(static_cast(encodedAncestor), pt, centmult); - fhAncestorPDG[tid]->Fill(TString::Format("%d", ancestorPdg).Data(), 1.0); + TString strAncestor = TString::Format("%d", ancestorPdg); + fhAncestorVsPtVsCent[tid]->Fill(strAncestor.Data(), pt, centmult, 1.0); + fhAncestorPDG[tid]->Fill(strAncestor.Data(), 1.0); } else { - fhAncestorVsPtVsCent[tid]->Fill(static_cast(kMothPrompt), pt, centmult); + fhAncestorVsPtVsCent[tid]->Fill(PromptStr.c_str(), pt, centmult, 1.0); } } From f4a974c76c4e7316bcd1fdd7048fa7bef49df466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Sat, 11 Apr 2026 05:39:06 +0200 Subject: [PATCH 236/282] [DPG] Fix includes and using statements (#15718) --- .../AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx index 07992cc7753..67695354168 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFDynamic.cxx @@ -16,15 +16,30 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" +#include +#include +#include +#include #include +#include +#include #include +#include +#include +#include #include #include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; From 405ba3f2458fb2a50532b3d51e8bdbacdad399b8 Mon Sep 17 00:00:00 2001 From: navneetkumar231295 <71565461+navneetkumar231295@users.noreply.github.com> Date: Sat, 11 Apr 2026 23:46:00 +0530 Subject: [PATCH 237/282] [PWGLF] Add cos(theta*) axis for MC histograms (#15732) Co-authored-by: Navneet --- .../Tasks/Resonances/chargedkstaranalysis.cxx | 228 ++++++++++++------ 1 file changed, 155 insertions(+), 73 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index 6081e136eec..ba09b4f72d5 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -89,7 +89,7 @@ struct Chargedkstaranalysis { }; SliceCache cache; Preslice perCollision = aod::track::collisionId; - + bool currentIsGen = false; struct : ConfigurableGroup { 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 cfgmultbins{"cfgmultbins", {VARIABLE_WIDTH, 0., 1., 5., 10., 30., 50., 70., 100., 110.}, "Mixing bins - multiplicity"}; @@ -141,6 +141,7 @@ struct Chargedkstaranalysis { using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; + HistogramRegistry histosMc{"histosMc", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry hChaKstar{"hChaKstar", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -183,6 +184,7 @@ struct Chargedkstaranalysis { /// Event cuts o2::analysis::CollisonCuts colCuts; struct : ConfigurableGroup { + Configurable confIsMix{"confIsMix", false, "Evt Mixing Bkg otherwise Rot Bkg"}; Configurable confEvtZvtx{"confEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; Configurable confEvtOccupancyInTimeRangeMax{"confEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; Configurable confEvtOccupancyInTimeRangeMin{"confEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; @@ -214,6 +216,11 @@ struct Chargedkstaranalysis { Configurable cfgCentEst{"cfgCentEst", static_cast(CentralityEstimator::FT0C), "Centrality estimator: 1=FT0C, 2=FT0M"}; } eventCutCfgs; + // MC configurables + struct : ConfigurableGroup { + Configurable doBkgMc{"doBkgMc", false, "Apply rotation in MC"}; + } mcCfgs; + /// Track selections // struct : ConfigurableGroup { @@ -355,9 +362,9 @@ struct Chargedkstaranalysis { hCutFlow->GetXaxis()->SetBinLabel(4, "Multiplicity"); hCutFlow->GetXaxis()->SetBinLabel(5, "IsINELgt0"); if (isQaRequired) { - constexpr int kNTrackCuts = 22; + constexpr int KNTrackCuts = 22; - histos.add("QA/hTrackCutFlow", "Track cut flow", kTH1I, {{kNTrackCuts, 0.5, kNTrackCuts + 0.5}}); + histos.add("QA/hTrackCutFlow", "Track cut flow", kTH1D, {{KNTrackCuts, 0.5, KNTrackCuts + 0.5}}); auto hTrackCutFlow = histos.get(HIST("QA/hTrackCutFlow")); @@ -384,9 +391,9 @@ struct Chargedkstaranalysis { hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAxy"); hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAz"); - constexpr int kNK0sCuts = 14; + constexpr int KnK0sCuts = 14; int iK0sbin = 1; - histos.add("QA/K0sCutCheck", "K0s cut flow", kTH1I, {{kNK0sCuts, 0.5, kNK0sCuts + 0.5}}); + histos.add("QA/K0sCutCheck", "K0s cut flow", kTH1D, {{KnK0sCuts, 0.5, KnK0sCuts + 0.5}}); auto hK0sCut = histos.get(HIST("QA/K0sCutCheck")); hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "All PASS"); hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DauDCA>max"); @@ -404,8 +411,6 @@ struct Chargedkstaranalysis { histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); histos.add("QA/before/CentDist1", "Centrality distribution", o2::framework::kTH1F, {{110, 0, 110}}); - histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); - histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); histos.add("QA/trkbpionTPCPIDME", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); @@ -464,9 +469,8 @@ struct Chargedkstaranalysis { histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - + histos.add("QA/before/hArmSecondary", "Armenteros distribution of secondary resonance", HistType::kTH2D, {AxisSpec{100, -1, 1, "alpha"}, {200, 0, 0.5, "qtArm"}}); histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); @@ -476,8 +480,8 @@ struct Chargedkstaranalysis { histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + histos.add("QA/after/hArmSecondary", "Armenteros distribution of secondary resonance", HistType::kTH2D, {AxisSpec{100, -1, 1, "alpha"}, {200, 0, 0.5, "qtArm"}}); // Kstar // Invariant mass nSparse @@ -494,9 +498,6 @@ struct Chargedkstaranalysis { if (!helicityCfgs.qAOptimisation) { hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); - - // hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - // hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); } } // MC @@ -544,7 +545,6 @@ struct Chargedkstaranalysis { histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); // K892 @@ -554,6 +554,15 @@ struct Chargedkstaranalysis { histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); } + if (!helicityCfgs.qAOptimisation) { + histosMc.add("h3ChaKstarInvMassDSMcGen", "h3ChaKstarInvMassDSMcGen", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); + histosMc.add("h3ChaKstarInvMassDSMcRec", "h3ChaKstarInvMassDSMcRec", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); + if (mcCfgs.doBkgMc) { + histosMc.add("h3ChaKstarInvMassRotMcGen", "h3ChaKstarInvMassRotMcGen", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); + histosMc.add("h3ChaKstarInvMassRotMcRec", "h3ChaKstarInvMassRotMcRec", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); + } + } + histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis}); histos.add("EffKstar/genKstar_pri", "Gen primary Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis}); @@ -719,7 +728,7 @@ struct Chargedkstaranalysis { auto v0Radius = candidate.v0radius(); auto dcaToPV = std::fabs(candidate.dcav0topv()); auto cosPA = candidate.v0cosPA(); - auto propTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0s; + auto propTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto mK0s = candidate.mK0Short(); auto mLambda = candidate.mLambda(); auto mALambda = candidate.mAntiLambda(); @@ -778,9 +787,6 @@ struct Chargedkstaranalysis { } int count = 0; - double massPi = o2::constants::physics::MassPionCharged; - double massK0s = o2::constants::physics::MassK0Short; - template bool matchRecoToTruthKstar(V0T const& v0, TrkT const& trk) { @@ -828,6 +834,33 @@ struct Chargedkstaranalysis { return true; } // matchRecoToTruthKstar + template + void fillKstarHist(bool isRot, float multiplicity, const T& mother, double cosTheta) + { + if (!doprocessMC) { + + if (isRot) { + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, mother.Pt(), mother.M(), cosTheta); + } else { + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosTheta); + } + } else { + if (currentIsGen) { + if (isRot) { + histosMc.fill(HIST("h3ChaKstarInvMassRotMcGen"), multiplicity, mother.Pt(), mother.M(), cosTheta); + } else { + histosMc.fill(HIST("h3ChaKstarInvMassDSMcGen"), multiplicity, mother.Pt(), mother.M(), cosTheta); + } + } else { + if (isRot) { + histosMc.fill(HIST("h3ChaKstarInvMassRotMcRec"), multiplicity, mother.Pt(), mother.M(), cosTheta); + } else { + histosMc.fill(HIST("h3ChaKstarInvMassDSMcRec"), multiplicity, mother.Pt(), mother.M(), cosTheta); + } + } + } + } + template void fillInvMass(const T& mother, float multiplicity, const T& daughter1, const T& daughter2, bool isMix) { @@ -874,6 +907,7 @@ struct Chargedkstaranalysis { auto phiCS = std::atan2(yAxisCS.Dot(v1CM), xAxisCS.Dot(v1CM)); phiCS = RecoDecay::constrainAngle(phiCS, 0.0); + bool doRotation = (!doprocessMC) || (doprocessMC && mcCfgs.doBkgMc); // if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { if (helicityCfgs.activateHelicityFrame) { // helicityVec = mother.Vect(); // 3 vector of mother in COM frame @@ -881,48 +915,52 @@ struct Chargedkstaranalysis { auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2())); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); //, anglePhi); + fillKstarHist(false, multiplicity, mother, cosThetaStarHelicity); } + if (doRotation) { + for (int i = 0; i < helicityCfgs.cRotations; i++) { + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); - for (int i = 0; i < helicityCfgs.cRotations; i++) { - theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); - daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + motherRot = daughterRot + daughter2; - motherRot = daughterRot + daughter2; + ROOT::Math::Boost boost2{motherRot.BoostToCM()}; + daughterRotCM = boost2(daughterRot); - ROOT::Math::Boost boost2{motherRot.BoostToCM()}; - daughterRotCM = boost2(daughterRot); - - auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2())); - auto phiHelicityRot = std::atan2(yaxisHE.Dot(daughterRotCM.Vect().Unit()), xaxisHE.Dot(daughterRotCM.Vect().Unit())); - phiHelicityRot = RecoDecay::constrainAngle(phiHelicityRot, 0.0); - if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot); //, phiHelicityRot); + auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2())); + auto phiHelicityRot = std::atan2(yaxisHE.Dot(daughterRotCM.Vect().Unit()), xaxisHE.Dot(daughterRotCM.Vect().Unit())); + phiHelicityRot = RecoDecay::constrainAngle(phiHelicityRot, 0.0); + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { + fillKstarHist(true, multiplicity, motherRot, cosThetaStarHelicityRot); + } + } } } } else if (helicityCfgs.activateCollinsSoperFrame) { if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS); //, phiCS); + fillKstarHist(false, multiplicity, mother, cosThetaStarCS); } + if (doRotation) { + for (int i = 0; i < helicityCfgs.cRotations; i++) { + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); - for (int i = 0; i < helicityCfgs.cRotations; i++) { - theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); - - daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); - motherRot = daughterRot + daughter2; + motherRot = daughterRot + daughter2; - ROOT::Math::Boost boost2{motherRot.BoostToCM()}; - daughterRotCM = boost2(daughterRot); + ROOT::Math::Boost boost2{motherRot.BoostToCM()}; + daughterRotCM = boost2(daughterRot); - auto cosThetaStarCSrot = zAxisCS.Dot(daughterRotCM.Vect()) / std::sqrt(daughterRotCM.Vect().Mag2()); - auto phiCSrot = std::atan2(yAxisCS.Dot(daughterRotCM.Vect().Unit()), xAxisCS.Dot(daughterRotCM.Vect().Unit())); - phiCSrot = RecoDecay::constrainAngle(phiCSrot, 0.0); + auto cosThetaStarCSrot = zAxisCS.Dot(daughterRotCM.Vect()) / std::sqrt(daughterRotCM.Vect().Mag2()); + auto phiCSrot = std::atan2(yAxisCS.Dot(daughterRotCM.Vect().Unit()), xAxisCS.Dot(daughterRotCM.Vect().Unit())); + phiCSrot = RecoDecay::constrainAngle(phiCSrot, 0.0); - if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarCSrot); //, phiCSrot); + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { + fillKstarHist(true, multiplicity, mother, cosThetaStarCSrot); + } + } } } } else if (helicityCfgs.activateProductionFrame) { @@ -930,13 +968,17 @@ struct Chargedkstaranalysis { auto cosThetaProduction = normalVec.Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(normalVec.Mag2())); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction); //, anglePhi); + fillKstarHist(false, multiplicity, mother, cosThetaProduction); } - for (int i = 0; i < helicityCfgs.cRotations; i++) { - theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); - motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); - if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaProduction); //, anglePhi); + if (doRotation) { + for (int i = 0; i < helicityCfgs.cRotations; i++) { + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { + fillKstarHist(true, multiplicity, motherRot, cosThetaProduction); + } } } } @@ -945,13 +987,17 @@ struct Chargedkstaranalysis { auto cosThetaStarBeam = beamVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); //, anglePhi); + fillKstarHist(false, multiplicity, mother, cosThetaStarBeam); } - for (int i = 0; i < helicityCfgs.cRotations; i++) { - theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); - motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); - if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam); //, anglePhi); + if (doRotation) { + for (int i = 0; i < helicityCfgs.cRotations; i++) { + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { + fillKstarHist(true, multiplicity, motherRot, cosThetaStarBeam); + } } } } @@ -963,18 +1009,21 @@ struct Chargedkstaranalysis { auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); //, phiRandom); + fillKstarHist(false, multiplicity, mother, cosThetaStarRandom); } - for (int i = 0; i < helicityCfgs.cRotations; i++) { - theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); - motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); - if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom); //, phiRandom); + if (doRotation) { + for (int i = 0; i < helicityCfgs.cRotations; i++) { + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { + fillKstarHist(true, multiplicity, motherRot, cosThetaStarRandom); + } } } } } - // } } template @@ -1065,6 +1114,7 @@ struct Chargedkstaranalysis { auto trkkDCAtoPV = K0scand.dcav0topv(); auto trkkCPA = K0scand.v0cosPA(); auto trkkMass = K0scand.mK0Short(); + auto trkkPropTau = K0scand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; if constexpr (!IsMix) { if (!doprocessMC && isQaRequired) { @@ -1092,6 +1142,8 @@ struct Chargedkstaranalysis { histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); + histos.fill(HIST("QA/before/hArmSecondary"), K0scand.alpha(), K0scand.qtarm()); + histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); } } @@ -1102,6 +1154,20 @@ struct Chargedkstaranalysis { if constexpr (!IsMix) { if (!doprocessMC && isQaRequired) { + // positive pion + histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + + // negative pion + histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); @@ -1111,6 +1177,8 @@ struct Chargedkstaranalysis { histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); + histos.fill(HIST("QA/after/hArmSecondary"), K0scand.alpha(), K0scand.qtarm()); + histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); } } @@ -1120,14 +1188,14 @@ struct Chargedkstaranalysis { // ========================= // Pairing // ========================= - for (auto tIdx : trackIndicies) { - for (auto kIdx : k0sIndicies) { + for (auto const& tIdx : trackIndicies) { + for (auto const& kIdx : k0sIndicies) { auto bTrack = dTracks1.rawIteratorAt(tIdx); auto k0s = dTracks2.rawIteratorAt(kIdx); - lDecayDaughter_bach = {bTrack.px(), bTrack.py(), bTrack.pz(), massPi}; - lResoSecondary = {k0s.px(), k0s.py(), k0s.pz(), massK0s}; + lDecayDaughter_bach = {bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged}; + lResoSecondary = {k0s.px(), k0s.py(), k0s.pz(), MassK0Short}; lResoKstar = lResoSecondary + lDecayDaughter_bach; if constexpr (!IsMix) { @@ -1221,8 +1289,8 @@ struct Chargedkstaranalysis { continue; ROOT::Math::PxPyPzMVector lResoSecondary, lDecayDaughter_bach, lResoKstar; - lDecayDaughter_bach = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massPi); - lResoSecondary = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massK0s); + lDecayDaughter_bach = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), MassPionCharged); + lResoSecondary = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), MassK0Short); lResoKstar = lResoSecondary + lDecayDaughter_bach; if (lResoKstar.Rapidity() > kstarCutCfgs.cKstarMaxRap || lResoKstar.Rapidity() < kstarCutCfgs.cKstarMinRap) @@ -1233,7 +1301,7 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataME, "Process Event for data without Partitioning", true); - void processMC(soa::Join const&, aod::McParticles& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) + void processMC(soa::Join const&, aod::McParticles const& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) { allowedMcIds.clear(); centTruthByAllowed.clear(); @@ -1260,6 +1328,7 @@ struct Chargedkstaranalysis { continue; if (!coll.isInelGt0()) continue; + colCuts.fillQA(coll); if (doprocessMC && isQaRequired) { histos.fill(HIST("QA/MC/QACent_woCentCut"), lCentrality); @@ -1275,23 +1344,25 @@ struct Chargedkstaranalysis { allowedMcIds.insert(mcid); centTruthByAllowed.emplace(mcid, lCentrality); } - // Calculating the generated Kstar for (const auto& part : mcParticles) { + currentIsGen = true; if (!part.has_mcCollision()) continue; if (std::abs(part.pdgCode()) != kKstarPlus) continue; if (std::abs(part.y()) > kstarCutCfgs.cKstarMaxRap) continue; + LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot; + lResoKstar = LorentzVectorSetXYZM(part.px(), part.py(), part.pz(), MassKPlusStar892); const int pionWanted = (part.pdgCode() > 0) ? +kPiPlus : -kPiPlus; bool hasRightPion = false; bool hasK0sToPipi = false; - for (const auto& d1 : part.template daughters_as()) { const int pdg1 = d1.pdgCode(); if (pdg1 == pionWanted) { + lDecayDaughter_bach = LorentzVectorSetXYZM(d1.px(), d1.py(), d1.pz(), MassPionCharged); hasRightPion = true; } else if (std::abs(pdg1) == kPDGK0) { for (const auto& d2 : d1.template daughters_as()) { @@ -1304,6 +1375,7 @@ struct Chargedkstaranalysis { seenPim = true; } if (seenPip && seenPim) { + lResoSecondary = LorentzVectorSetXYZM(d2.px(), d2.py(), d2.pz(), MassK0Short); hasK0sToPipi = true; break; } @@ -1328,13 +1400,18 @@ struct Chargedkstaranalysis { const float lCentrality = iter->second; histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality); - + if (helicityCfgs.cBoostKShot) { + fillInvMass(lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix); + } else { + fillInvMass(lResoKstar, lCentrality, lDecayDaughter_bach, lResoSecondary, eventCutCfgs.confIsMix); + } if (part.vt() == 0) { histos.fill(HIST("EffKstar/genKstar_pri"), part.pt(), lCentrality); // To check the primary particle } } // To store the recoKstar for (const auto& v0 : v0s) { + currentIsGen = false; auto coll = v0.template collision_as(); if (!coll.has_mcCollision()) @@ -1402,6 +1479,11 @@ struct Chargedkstaranalysis { continue; } histos.fill(HIST("EffKstar/recoKstar"), ptreco, lCentrality); + if (helicityCfgs.cBoostKShot) { + fillInvMass(lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix); + } else { + fillInvMass(lResoKstar, lCentrality, lDecayDaughter_bach, lResoSecondary, eventCutCfgs.confIsMix); + } histos.fill(HIST("MCReco/hInvmass_Kstar_true"), lCentrality, ptreco, lResoKstar.M()); } } From ed0e19a5906721268d2ccea1c8882d04e4c2a3e6 Mon Sep 17 00:00:00 2001 From: Subhadeep Roy Date: Sun, 12 Apr 2026 11:12:43 +0530 Subject: [PATCH 238/282] [PWGCF] Updated for detailed analysis (#15704) --- .../Tasks/lambdaSpinPolarization.cxx | 610 ++++++++++++++---- 1 file changed, 480 insertions(+), 130 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx index e0eefb67fad..d079b483981 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx @@ -30,6 +30,8 @@ #include "Framework/runDataProcessing.h" #include +#include +#include #include #include @@ -119,11 +121,13 @@ namespace lambdatrackext DECLARE_SOA_COLUMN(LambdaSharingDaughter, lambdaSharingDaughter, bool); DECLARE_SOA_COLUMN(LambdaSharingDauIds, lambdaSharingDauIds, std::vector); DECLARE_SOA_COLUMN(TrueLambdaFlag, trueLambdaFlag, bool); +DECLARE_SOA_COLUMN(FakeFlag, fakeFlag, bool); } // namespace lambdatrackext DECLARE_SOA_TABLE(LambdaTracksExt, "AOD", "LAMBDATRACKSEXT", lambdatrackext::LambdaSharingDaughter, lambdatrackext::LambdaSharingDauIds, - lambdatrackext::TrueLambdaFlag); + lambdatrackext::TrueLambdaFlag, + lambdatrackext::FakeFlag); using LambdaTrackExt = LambdaTracksExt::iterator; @@ -239,13 +243,22 @@ enum RunType { enum ParticleType { kLambda = 0, - kAntiLambda + kAntiLambda, + kFakeLambda, + kFakeAntiLambda }; enum ParticlePairType { + // ----------------------------------------------------------------------- kLambdaAntiLambda = 0, - kLambdaLambda, - kAntiLambdaAntiLambda + kAntiLambdaLambda = 1, + kLambdaLambda = 2, + kAntiLambdaAntiLambda = 3, + // ----------------------------------------------------------------------- + kLambdaFakeAntiLambda = 4, + kAntiLambdaFakeLambda = 5, + kLambdaFakeLambda = 6, + kAntiLambdaFakeAntiLambda = 7 }; enum ShareDauLambda { @@ -315,6 +328,13 @@ struct LambdaTableProducer { Configurable cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"}; Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"}; Configurable cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"}; + // LS (fake) background control variables + Configurable cApplyFakeDcaCuts{"cApplyFakeDcaCuts", true, "Apply DCA-to-PV cuts on LS daughter tracks"}; + Configurable cFakeDaughterMaxDEta{"cFakeDaughterMaxDEta", -1.f, "Max delta eta between LS daughters as topology proxy (-1=off)"}; + Configurable cFakeDaughterMaxOpenAngle{"cFakeDaughterMaxOpenAngle", -1.f, "Max opening angle between LS daughters [rad] (-1=off)"}; + Configurable cAllowDualAssignment{"cAllowDualAssignment", true, "Allow both PID assignments per LS pair"}; + Configurable cMaxFakeLambdaPerEvent{"cMaxFakeLambdaPerEvent", -1, "Max fake Lambda/AntiLambda candidates per event (-1 = no limit)"}; + Configurable cRandomizeFakeSubsample{"cRandomizeFakeSubsample", false, "Randomly subsample fake candidates if over limit"}; // V0s Configurable cMinDcaProtonToPV{"cMinDcaProtonToPV", 0.02, "Minimum Proton DCAr to PV"}; @@ -430,6 +450,9 @@ struct LambdaTableProducer { 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}); + // histogram for LS subsampling fraction (nKept/nTotal per event) + histos.add("Tracks/h1f_fake_subsample_fraction", "LS subsample fraction (nKept/nTotal)", kTH1F, {{110, 0., 1.1, "f_{subsample}"}}); + // QA Lambda 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}); @@ -1016,6 +1039,45 @@ struct LambdaTableProducer { histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPhi"), phi); } + // Basic track quality selection reused for fake-lambda (LS) daughter candidates + template + bool selTrackBasic(T const& track) + { + if (track.pt() <= cTrackMinPt || track.pt() >= cTrackMaxPt) + return false; + if (std::abs(track.eta()) >= cTrackEtaCut) + return false; + if (track.tpcNClsCrossedRows() <= cMinTpcCrossedRows) + return false; + if (track.tpcCrossedRowsOverFindableCls() < cMinTpcCROverCls) + return false; + if (track.tpcNClsShared() > cMaxTpcSharedClusters) + return false; + if (track.tpcChi2NCl() > cMaxChi2Tpc) + return false; + return true; + } + + template + bool selTrackBasicWithDCA(T const& track, bool isProton) + { + if (!selTrackBasic(track)) + return false; + if (cApplyFakeDcaCuts) { + float minDca = isProton ? static_cast(cMinDcaProtonToPV) : static_cast(cMinDcaPionToPV); + if (std::abs(track.dcaXY()) < minDca) + return false; + } + return true; + } + + struct FakeCandidate { + float px, py, pz, pt, eta, phi, rap, mass; + float prPx, prPy, prPz; + int64_t id1, id2; + ParticleType type; + }; + // Reconstructed Level Tables template void fillLambdaRecoTables(C const& collision, B const& bc, V const& v0tracks, T const& tracks) @@ -1147,7 +1209,117 @@ struct LambdaTableProducer { v0.template posTrack_as().index(), v0.template negTrack_as().index(), v0.v0cosPA(), v0.dcaV0daughters(), (int8_t)v0Type, v0PrmScdType, corr_fact); } - } + + // ------------------------------------------------------------------------- + // Fake Lambda reconstruction for combinatorial background (LS pairs) + // ------------------------------------------------------------------------- + // subsample before writing to the output table. + std::vector fakeCandBuffer; + fakeCandBuffer.reserve(512); + + for (auto const& tr1 : tracks) { + if (!selTrackBasic(tr1)) { + continue; + } + + for (auto const& tr2 : tracks) { + if (tr2.index() <= tr1.index()) { + continue; + } + + if (!selTrackBasic(tr2)) { + continue; + } + + if (tr1.sign() != tr2.sign()) { + continue; + } + + if (cFakeDaughterMaxDEta > 0.f && + std::abs(tr1.eta() - tr2.eta()) > cFakeDaughterMaxDEta) { + continue; + } + if (cFakeDaughterMaxOpenAngle > 0.f) { + float cosOA = (tr1.px() * tr2.px() + tr1.py() * tr2.py() + tr1.pz() * tr2.pz()) / + (std::sqrt(tr1.px() * tr1.px() + tr1.py() * tr1.py() + tr1.pz() * tr1.pz() + 1e-10f) * + std::sqrt(tr2.px() * tr2.px() + tr2.py() * tr2.py() + tr2.pz() * tr2.pz() + 1e-10f)); + if (std::acos(std::clamp(cosOA, -1.f, 1.f)) > cFakeDaughterMaxOpenAngle) { + continue; + } + } + + float fkPx = tr1.px() + tr2.px(); + float fkPy = tr1.py() + tr2.py(); + float fkPz = tr1.pz() + tr2.pz(); + float fkPt = std::sqrt(fkPx * fkPx + fkPy * fkPy); + float fkEta = RecoDecay::eta(std::array{fkPx, fkPy, fkPz}); + float fkPhi = RecoDecay::phi(fkPx, fkPy); + + ParticleType fakeType = (tr1.sign() > 0) ? kFakeLambda : kFakeAntiLambda; + + auto bufferFakeCandidate = [&](float prPxL, float prPyL, float prPzL, float fkMass, int64_t prId, int64_t piId) { + float fkRap = RecoDecay::y(std::array{fkPx, fkPy, fkPz}, fkMass); + float fkRapEta = cDoEtaAnalysis ? std::abs(fkEta) : std::abs(fkRap); + if (!kinCutSelection(fkPt, fkRapEta, cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) + return; + fakeCandBuffer.push_back({fkPx, fkPy, fkPz, fkPt, fkEta, fkPhi, fkRap, fkMass, prPxL, prPyL, prPzL, prId, piId, fakeType}); + }; + + // Assignment A: tr1 = proton candidate, tr2 = pion candidate + if (std::abs(tr1.tpcNSigmaPr()) < cTpcNsigmaCut && + std::abs(tr2.tpcNSigmaPi()) < cTpcNsigmaCut && + selTrackBasicWithDCA(tr1, true /*isProton*/) && + selTrackBasicWithDCA(tr2, false /*isPion*/)) { + std::array pPr = {tr1.px(), tr1.py(), tr1.pz()}; + std::array pPi = {tr2.px(), tr2.py(), tr2.pz()}; + float fkMassA = RecoDecay::m(std::array{pPr, pPi}, std::array{MassProton, MassPionCharged}); + if (fkMassA >= cMinV0Mass && fkMassA <= cMaxV0Mass) { + bufferFakeCandidate(tr1.px(), tr1.py(), tr1.pz(), fkMassA, tr1.index(), tr2.index()); + } + } + + // Assignment B: tr2 = proton candidate, tr1 = pion candidate + if (cAllowDualAssignment && + std::abs(tr2.tpcNSigmaPr()) < cTpcNsigmaCut && + std::abs(tr1.tpcNSigmaPi()) < cTpcNsigmaCut && + selTrackBasicWithDCA(tr2, true /*isProton*/) && + selTrackBasicWithDCA(tr1, false /*isPion*/)) { + std::array pPr = {tr2.px(), tr2.py(), tr2.pz()}; + std::array pPi = {tr1.px(), tr1.py(), tr1.pz()}; + float fkMassB = RecoDecay::m(std::array{pPr, pPi}, std::array{MassProton, MassPionCharged}); + if (fkMassB >= cMinV0Mass && fkMassB <= cMaxV0Mass) { + bufferFakeCandidate(tr2.px(), tr2.py(), tr2.pz(), fkMassB, tr2.index(), tr1.index()); + } + } + } // end tr2 loop + } // end tr1 loop + + int nFakeTotal = static_cast(fakeCandBuffer.size()); + if (cMaxFakeLambdaPerEvent > 0 && nFakeTotal > cMaxFakeLambdaPerEvent) { + if (cRandomizeFakeSubsample) { + static thread_local std::mt19937 rng{std::random_device{}()}; + std::shuffle(fakeCandBuffer.begin(), fakeCandBuffer.end(), rng); + } + fakeCandBuffer.resize(static_cast(cMaxFakeLambdaPerEvent)); + } + int nFakeKept = static_cast(fakeCandBuffer.size()); + if (nFakeTotal > 0) { + histos.fill(HIST("Tracks/h1f_fake_subsample_fraction"), static_cast(nFakeKept) / static_cast(nFakeTotal)); + } + + for (auto const& fc : fakeCandBuffer) { + if (fc.type == kFakeLambda) { + histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), fc.mass, fc.pt); + } else { + histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), fc.mass, fc.pt); + } + lambdaTrackTable(lambdaCollisionTable.lastIndex(), + fc.px, fc.py, fc.pz, fc.pt, fc.eta, fc.phi, fc.rap, fc.mass, + fc.prPx, fc.prPy, fc.prPz, + fc.id1, fc.id2, + -999.f, -999.f, (int8_t)fc.type, kPrimary, 1.f); + } + } // end fillLambdaRecoTables // MC Generater Level Tables template @@ -1313,37 +1485,6 @@ struct LambdaTableProducer { PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", true); - /* void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, TracksRun2 const& tracks) - { - fillLambdaRecoTables(collision, V0s, tracks); - } - - PROCESS_SWITCH(LambdaTableProducer, processDataRun2, "Process for Run2 DATA", false); - - void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, - McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&) - { - // check collision - if (!selCollision(collision)) { - return; - } - fillLambdaRecoTables(collision, V0s, tracks); - } - - PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun3, "Process for Run3 McReco DATA", false); - - void processMCRecoRun2(soa::Join::iterator const& collision, aod::McCollisions const&, - McV0Tracks const& V0s, TracksMCRun2 const& tracks, aod::McParticles const&) - { - // check collision - if (!selCollision(collision)) { - return; - } - fillLambdaRecoTables(collision, V0s, tracks); - } */ - - // PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun2, "Process for Run2 McReco DATA", false); - void processMCRun3(aod::McCollisions::iterator const& mcCollision, soa::SmallGroups> const& collisions, McV0Tracks const& V0s, TracksMC const& tracks, @@ -1396,9 +1537,10 @@ struct LambdaTracksExtProducer { histos.add("h1i_totantilambda_mult", "Multiplicity", kTH1I, {axisMult}); histos.add("h1i_lambda_mult", "Multiplicity", kTH1I, {axisMult}); histos.add("h1i_antilambda_mult", "Multiplicity", kTH1I, {axisMult}); - histos.add("h2d_n2_etaphi_LaP_LaM", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); - histos.add("h2d_n2_etaphi_LaP_LaP", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); - histos.add("h2d_n2_etaphi_LaM_LaM", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaP_LaM", "#rho_{2}^{SharePair} #Lambda#bar{#Lambda}", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaM_LaP", "#rho_{2}^{SharePair} #bar{#Lambda}#Lambda", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaP_LaP", "#rho_{2}^{SharePair} #Lambda#Lambda", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaM_LaM", "#rho_{2}^{SharePair} #bar{#Lambda}#bar{#Lambda}", kTH2D, {axisDEta, axisDPhi}); // InvMass, DcaDau and CosPA histos.add("Reco/h1f_lambda_invmass", "M_{p#pi}", kTH1F, {axisMass}); @@ -1444,7 +1586,10 @@ struct LambdaTracksExtProducer { ++nTotAntiLambda; } - tLambda = (cA * std::abs(lambda.mass() - MassLambda0)) + (cB * lambda.dcaDau()) + (cC * std::abs(lambda.cosPA() - 1.)); + bool const isFake = (lambda.v0Type() == kFakeLambda || lambda.v0Type() == kFakeAntiLambda); + if (!isFake) { + tLambda = (cA * std::abs(lambda.mass() - MassLambda0)) + (cB * lambda.dcaDau()) + (cC * std::abs(lambda.cosPA() - 1.)); + } for (auto const& track : tracks) { // check lambda index (don't analyze same lambda track !!!) @@ -1457,13 +1602,16 @@ struct LambdaTracksExtProducer { vSharedDauLambdaIndex.push_back(track.index()); lambdaSharingDauFlag = true; - // Fill DEta-DPhi Histogram - if ((lambda.v0Type() == kLambda && track.v0Type() == kAntiLambda) || (lambda.v0Type() == kAntiLambda && track.v0Type() == kLambda)) { - histos.fill(HIST("h2d_n2_etaphi_LaP_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); - } else if (lambda.v0Type() == kLambda && track.v0Type() == kLambda) { - histos.fill(HIST("h2d_n2_etaphi_LaP_LaP"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); - } else if (lambda.v0Type() == kAntiLambda && track.v0Type() == kAntiLambda) { - histos.fill(HIST("h2d_n2_etaphi_LaM_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + if (!isFake) { + if (lambda.v0Type() == kLambda && track.v0Type() == kAntiLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaP_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kAntiLambda && track.v0Type() == kLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaM_LaP"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kLambda && track.v0Type() == kLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaP_LaP"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kAntiLambda && track.v0Type() == kAntiLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaM_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } } // decision based on mass closest to PdgMass of Lambda @@ -1472,14 +1620,35 @@ struct LambdaTracksExtProducer { } // decisions based on t-score - tTrack = (cA * std::abs(track.mass() - MassLambda0)) + (cB * track.dcaDau()) + (cC * std::abs(track.cosPA() - 1.)); - if (tLambda > tTrack) { - lambdaMinTScoreFlag = false; + // Guard: only compute tTrack for real V0 candidates (fakes have sentinel cosPA/dcaDau) + bool const isFakeTrack = (track.v0Type() == kFakeLambda || track.v0Type() == kFakeAntiLambda); + if (!isFake && !isFakeTrack) { + tTrack = (cA * std::abs(track.mass() - MassLambda0)) + (cB * track.dcaDau()) + (cC * std::abs(track.cosPA() - 1.)); + if (tLambda > tTrack) { + lambdaMinTScoreFlag = false; + } } } } - // fill QA histograms + if (isFake) { + bool fakeAccepted = false; + if (cAcceptAllLambda) { + fakeAccepted = true; + } else if (cRejAllLambdaShaDau && !lambdaSharingDauFlag) { + fakeAccepted = true; + } + if (fakeAccepted) { + if (lambda.v0Type() == kFakeLambda) + ++nSelLambda; + else + ++nSelAntiLambda; + } + lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, false /*trueLambdaFlag*/, fakeAccepted /*fakeFlag*/); + continue; + } + + // fill QA histograms (real V0s only) if (lambdaSharingDauFlag) { fillHistos(lambda); } else { @@ -1505,8 +1674,8 @@ struct LambdaTracksExtProducer { } } - // fill LambdaTrackExt table - lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, trueLambdaFlag); + // fill LambdaTrackExt table (fakeFlag = false for all real V0 candidates) + lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, trueLambdaFlag, false); } // fill multiplicity histograms @@ -1536,15 +1705,21 @@ struct LambdaSpinPolarization { // Global Configurables Configurable cNPtBins{"cNPtBins", 30, "N pT Bins"}; Configurable cMinPt{"cMinPt", 0.5, "pT Min"}; - Configurable cMaxPt{"cMaxPt", 3.5, "pT Max"}; + Configurable cMaxPt{"cMaxPt", 4.5, "pT Max"}; Configurable cNRapBins{"cNRapBins", 10, "N Rapidity Bins"}; Configurable cMinRap{"cMinRap", -0.5, "Minimum Rapidity"}; Configurable cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"}; Configurable cNPhiBins{"cNPhiBins", 36, "N Phi Bins"}; - Configurable cNBinsCosTS{"cNBinsCosTS", 10, "N CosTS Bins"}; + Configurable cNBinsCosTS{"cNBinsCosTS", 20, "N CosTS Bins"}; + Configurable cNBinsDeltaR{"cNBinsDeltaR", 20, "DeltaR Bins"}; Configurable cInvBoostFlag{"cInvBoostFlag", true, "Inverse Boost Flag"}; Configurable mixingParameter{"mixingParameter", 5, "How many events are mixed"}; + Configurable cDoAtlasMethod{"cDoAtlasMethod", false, "Fill pair-boost histograms"}; + Configurable cDoStarMethod{"cDoStarMethod", true, "Fill lab-boost histograms"}; + + Configurable cMEMode{"cMEMode", 0, "ME mode: 0=standard, 1=sequential"}; + // Centrality Axis ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; ConfigurableAxis axisCentME{"axisCentME", {VARIABLE_WIDTH, 0, 10, 30, 50, 100}, "Mixing bins - centrality (%)"}; @@ -1563,11 +1738,11 @@ struct LambdaSpinPolarization { void init(InitContext const&) { const AxisSpec axisCheck(1, 0, 1, ""); - const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); + const AxisSpec axisPosZ(220, -7, 7, "V_{z} (cm)"); const AxisSpec axisCent(cMultBins, "FT0M (%)"); const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); - const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); + const AxisSpec axisMass(100, 1.08, 1.2, "M_{#Lambda} (GeV/#it{c}^{2})"); const AxisSpec axisPt(cNPtBins, cMinPt, cMaxPt, "p_{T} (GeV/#it{c})"); const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta"); const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); @@ -1575,7 +1750,7 @@ struct LambdaSpinPolarization { const AxisSpec axisDRap(2 * cNRapBins, cMinRap - cMaxRap, cMaxRap - cMinRap, "#Deltay"); const AxisSpec axisDPhi(cNPhiBins, -PI, PI, "#Delta#varphi"); const AxisSpec axisCosTS(cNBinsCosTS, -1, 1, "cos(#theta*)"); - const AxisSpec axisDR(10, 0, 2, "#DeltaR"); + const AxisSpec axisDR(cNBinsDeltaR, 0, 4, "#DeltaR"); // Pool occupancy histos.add("QA/ME/hPoolCentVz", "ME pool occupancy;centrality (%);V_{z} (cm)", kTH2F, {axisCentME, axisVtxZME}); @@ -1584,18 +1759,36 @@ struct LambdaSpinPolarization { histos.add("QA/ME/hLambdaMultVsCent", "ME #Lambda multiplicity;centrality (%);N_{#Lambda}", kTH2F, {axisCentME, {50, 0, 50}}); histos.add("QA/ME/hAntiLambdaMultVsCent", "ME #bar{#Lambda} multiplicity;centrality (%);N_{#bar{#Lambda}}", kTH2F, {axisCentME, {50, 0, 50}}); - // inv mass vs pt for Lambda and AntiLambda + // inv mass vs pt: four separate signal pair types histos.add("Reco/h2f_n2_mass_LaPLaM", "m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("Reco/h2f_n2_mass_LaMLaP", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); histos.add("Reco/h2f_n2_mass_LaPLaP", "m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); histos.add("Reco/h2f_n2_mass_LaMLaM", "m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); - // rho2 for C2 + histos.add("RecoBkg/h2f_n2_mass_LaPFkLaM", "US-LS: m_{inv}^{#Lambda} vs m_{inv}^{fake#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("RecoBkg/h2f_n2_mass_LaMLFkLaP", "US-LS: m_{inv}^{#bar{#Lambda}} vs m_{inv}^{fake#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("RecoBkg/h2f_n2_mass_LaPFkLaP", "US-LS: m_{inv}^{#Lambda} vs m_{inv}^{fake#Lambda}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("RecoBkg/h2f_n2_mass_LaMLFkLaM", "US-LS: m_{inv}^{#bar{#Lambda}} vs m_{inv}^{fake#bar{#Lambda}}", kTHnSparseF, {axisMass, axisMass, axisPt, axisPt}); + histos.add("RecoCorr/h2f_n2_dltaR_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDR, axisCosTS}); + histos.add("RecoCorr/h2f_n2_dltaR_LaMLaP", "#rho_{2}^{#bar{#Lambda}#Lambda}", kTHnSparseF, {axisCent, axisDR, axisCosTS}); histos.add("RecoCorr/h2f_n2_dltaR_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDR, axisCosTS}); histos.add("RecoCorr/h2f_n2_dltaR_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDR, axisCosTS}); + histos.add("RecoCorr/h2f_n2_ctheta_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorr/h2f_n2_ctheta_LaMLaP", "#rho_{2}^{#bar{#Lambda}#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); histos.add("RecoCorr/h2f_n2_ctheta_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); histos.add("RecoCorr/h2f_n2_ctheta_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + + histos.add("RecoCorrBkg/h2f_n2_dltaR_LaPFkLaM", "#rho_{2}^{#Lambda,fake#bar{#Lambda}} (US-LS)", kTHnSparseF, {axisCent, axisDR, axisCosTS}); + histos.add("RecoCorrBkg/h2f_n2_dltaR_LaMLFkLaP", "#rho_{2}^{#bar{#Lambda},fake#Lambda} (US-LS)", kTHnSparseF, {axisCent, axisDR, axisCosTS}); + histos.add("RecoCorrBkg/h2f_n2_dltaR_LaPFkLaP", "#rho_{2}^{#Lambda,fake#Lambda} (US-LS)", kTHnSparseF, {axisCent, axisDR, axisCosTS}); + histos.add("RecoCorrBkg/h2f_n2_dltaR_LaMLFkLaM", "#rho_{2}^{#bar{#Lambda},fake#bar{#Lambda}} (US-LS)", kTHnSparseF, {axisCent, axisDR, axisCosTS}); + + histos.add("RecoCorrBkg/h2f_n2_ctheta_LaPFkLaM", "#rho_{2}^{#Lambda,fake#bar{#Lambda}} (US-LS)", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorrBkg/h2f_n2_ctheta_LaMLFkLaP", "#rho_{2}^{#bar{#Lambda},fake#Lambda} (US-LS)", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorrBkg/h2f_n2_ctheta_LaPFkLaP", "#rho_{2}^{#Lambda,fake#Lambda} (US-LS)", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); + histos.add("RecoCorrBkg/h2f_n2_ctheta_LaMLFkLaM", "#rho_{2}^{#bar{#Lambda},fake#bar{#Lambda}} (US-LS)", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisCosTS}); } void getBoostVector(std::array const& p, std::array& v, bool inverseBoostFlag = true) @@ -1626,82 +1819,179 @@ struct LambdaSpinPolarization { template void fillPairHistos(U& p1, U& p2) { - static constexpr std::string_view SubDirHist[] = {"LaPLaM", "LaPLaP", "LaMLaM"}; + static constexpr std::string_view SubDirHistUS[] = {"LaPLaM", "LaMLaP", "LaPLaP", "LaMLaM"}; + static constexpr std::string_view SubDirHistBkg[] = {"LaPFkLaM", "LaMLFkLaP", "LaPFkLaP", "LaMLFkLaM"}; + + constexpr bool IsBkg = (part_pair == kLambdaFakeAntiLambda || part_pair == kAntiLambdaFakeLambda || part_pair == kLambdaFakeLambda || part_pair == kAntiLambdaFakeAntiLambda); + + // Fill pair invariant mass histogram + if constexpr (!IsBkg) { + histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHistUS[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt()); + } else { + constexpr int BkgIdx = static_cast(part_pair) - 4; + histos.fill(HIST("RecoBkg/h2f_n2_mass_") + HIST(SubDirHistBkg[BkgIdx]), p1.mass(), p2.mass(), p1.pt(), p2.pt()); + } - // Fill lambda pair mass - // histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt()); float drap = p1.rap() - p2.rap(); float dphi = RecoDecay::constrainAngle(p1.phi() - p2.phi(), -PI); float dR = std::sqrt(drap * drap + dphi * dphi); std::array l1 = {p1.px(), p1.py(), p1.pz(), MassLambda0}; std::array l2 = {p2.px(), p2.py(), p2.pz(), MassLambda0}; - - std::array llpair = { - l1[0] + l2[0], - l1[1] + l2[1], - l1[2] + l2[2], - l1[3] + l2[3]}; - std::array pr1 = {p1.prPx(), p1.prPy(), p1.prPz(), MassProton}; std::array pr2 = {p2.prPx(), p2.prPy(), p2.prPz(), MassProton}; - std::array vPair; - getBoostVector(llpair, vPair, cInvBoostFlag); - - boost(l1, vPair); - boost(l2, vPair); - - boost(pr1, vPair); - boost(pr2, vPair); + if (cDoAtlasMethod) { + std::array l1Atlas = l1; + std::array l2Atlas = l2; + std::array pr1Atlas = pr1; + std::array pr2Atlas = pr2; + + std::array llpair = { + l1Atlas[0] + l2Atlas[0], + l1Atlas[1] + l2Atlas[1], + l1Atlas[2] + l2Atlas[2], + l1Atlas[3] + l2Atlas[3]}; + + std::array vPair; + getBoostVector(llpair, vPair, cInvBoostFlag); + boost(l1Atlas, vPair); + boost(l2Atlas, vPair); + boost(pr1Atlas, vPair); + boost(pr2Atlas, vPair); + + std::array v1Pair, v2Pair; + getBoostVector(l1Atlas, v1Pair, cInvBoostFlag); + getBoostVector(l2Atlas, v2Pair, cInvBoostFlag); + boost(pr1Atlas, v1Pair); + boost(pr2Atlas, v2Pair); + + std::array pr1tvAtlas = {pr1Atlas[0], pr1Atlas[1], pr1Atlas[2]}; + std::array pr2tvAtlas = {pr2Atlas[0], pr2Atlas[1], pr2Atlas[2]}; + float ctheta = + RecoDecay::dotProd(pr1tvAtlas, pr2tvAtlas) / + (RecoDecay::sqrtSumOfSquares(pr1tvAtlas[0], pr1tvAtlas[1], pr1tvAtlas[2]) * + RecoDecay::sqrtSumOfSquares(pr2tvAtlas[0], pr2tvAtlas[1], pr2tvAtlas[2])); + + if constexpr (!IsBkg) { + histos.fill(HIST("RecoCorr/h2f_n2_ctheta_") + HIST(SubDirHistUS[part_pair]), cent, drap, dphi, ctheta); + histos.fill(HIST("RecoCorr/h2f_n2_dltaR_") + HIST(SubDirHistUS[part_pair]), cent, dR, ctheta); + } else { + constexpr int BkgIdx = static_cast(part_pair) - 4; + histos.fill(HIST("RecoCorrBkg/h2f_n2_ctheta_") + HIST(SubDirHistBkg[BkgIdx]), cent, drap, dphi, ctheta); + histos.fill(HIST("RecoCorrBkg/h2f_n2_dltaR_") + HIST(SubDirHistBkg[BkgIdx]), cent, dR, ctheta); + } + } - std::array v1_pair, v2_pair; - getBoostVector(l1, v1_pair, cInvBoostFlag); - getBoostVector(l2, v2_pair, cInvBoostFlag); + if (cDoStarMethod) { + std::array pr1Star = pr1; + std::array pr2Star = pr2; - boost(pr1, v1_pair); - boost(pr2, v2_pair); + std::array v1Lab, v2Lab; + getBoostVector(l1, v1Lab, cInvBoostFlag); + getBoostVector(l2, v2Lab, cInvBoostFlag); + boost(pr1Star, v1Lab); + boost(pr2Star, v2Lab); - std::array pr1tv = {pr1[0], pr1[1], pr1[2]}; - std::array pr2tv = {pr2[0], pr2[1], pr2[2]}; - float ctheta = RecoDecay::dotProd(pr1tv, pr2tv) / (RecoDecay::sqrtSumOfSquares(pr1tv[0], pr1tv[1], pr1tv[2]) * RecoDecay::sqrtSumOfSquares(pr2tv[0], pr2tv[1], pr2tv[2])); + std::array pr1tvStar = {pr1Star[0], pr1Star[1], pr1Star[2]}; + std::array pr2tvStar = {pr2Star[0], pr2Star[1], pr2Star[2]}; + float ctheta = + RecoDecay::dotProd(pr1tvStar, pr2tvStar) / + (RecoDecay::sqrtSumOfSquares(pr1tvStar[0], pr1tvStar[1], pr1tvStar[2]) * + RecoDecay::sqrtSumOfSquares(pr2tvStar[0], pr2tvStar[1], pr2tvStar[2])); - histos.fill(HIST("RecoCorr/h2f_n2_ctheta_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, ctheta); - histos.fill(HIST("RecoCorr/h2f_n2_dltaR_") + HIST(SubDirHist[part_pair]), cent, dR, ctheta); + if constexpr (!IsBkg) { + histos.fill(HIST("RecoCorr/h2f_n2_ctheta_") + HIST(SubDirHistUS[part_pair]), cent, drap, dphi, ctheta); + histos.fill(HIST("RecoCorr/h2f_n2_dltaR_") + HIST(SubDirHistUS[part_pair]), cent, dR, ctheta); + } else { + constexpr int BkgIdx = static_cast(part_pair) - 4; + histos.fill(HIST("RecoCorrBkg/h2f_n2_ctheta_") + HIST(SubDirHistBkg[BkgIdx]), cent, drap, dphi, ctheta); + histos.fill(HIST("RecoCorrBkg/h2f_n2_dltaR_") + HIST(SubDirHistBkg[BkgIdx]), cent, dR, ctheta); + } + } } - template - void analyzePairs(T const& trks_1, T const& trks_2) + template + void analyzePairsStandard(T const& trks_1, T const& trks_2) { for (auto const& trk_1 : trks_1) { for (auto const& trk_2 : trks_2) { - // check for same index for Lambda-Lambda / AntiLambda-AntiLambda - if (samelambda && ((trk_1.index() == trk_2.index()))) { - continue; + + if constexpr (samelambda) { + if (trk_1.index() == trk_2.index()) + continue; } - fillPairHistos(trk_1, trk_2); + + fillPairHistos(trk_1, trk_2); } } } template - void analyzePairsWithKinematicMatching(T const& trks_1, T const& trks_2) + void analyzePairsSequential(T const& trks_1, T const& trks_2) { + std::vector candidates; + candidates.reserve(trks_2.size()); + + for (auto const& trk : trks_2) { + candidates.push_back(&trk); + } + + if (candidates.empty()) { + return; + } + + // Randomize candidates + static thread_local std::mt19937 rng(std::random_device{}()); + std::shuffle(candidates.begin(), candidates.end(), rng); + for (auto const& trk_1 : trks_1) { - for (auto const& trk_2 : trks_2) { - if (samelambda && ((trk_1.index() == trk_2.index()))) { + + decltype(&*trks_2.begin()) currentPartner = nullptr; + + for (auto const& trk_2 : candidates) { + + if constexpr (samelambda) { + if (trk_1.index() == trk_2->index()) + continue; + } + + // Initialize + if (!currentPartner) { + currentPartner = trk_2; continue; } - // Kinematic matching - float deltaPt = std::abs(trk_1.pt() - trk_2.pt()); - float deltaPhi = std::abs(RecoDecay::constrainAngle(trk_1.phi() - trk_2.phi(), -PI)); - float deltaRap = std::abs(trk_1.rap() - trk_2.rap()); + float dPt = std::abs(trk_2->pt() - currentPartner->pt()); + float dPhi = std::abs(RecoDecay::constrainAngle(trk_2->phi() - currentPartner->phi(), -PI)); + float dRap = std::abs(trk_2->rap() - currentPartner->rap()); - if (deltaPt < cMaxDeltaPt && deltaPhi < cMaxDeltaPhi && deltaRap < cMaxDeltaRap) { - fillPairHistos(trk_1, trk_2); + if (dPt < cMaxDeltaPt && dPhi < cMaxDeltaPhi && dRap < cMaxDeltaRap) { + currentPartner = trk_2; } } + + if (currentPartner) { + fillPairHistos(trk_1, *currentPartner); + } + } + } + + template + void analyzePairsME(T const& trks_1, T const& trks_2) + { + switch (cMEMode) { + + case 0: // standard + analyzePairsStandard(trks_1, trks_2); + break; + + case 1: // sequential + analyzePairsSequential(trks_1, trks_2); + break; + + default: + LOGF(fatal, "Invalid cMEMode value!"); } } @@ -1712,27 +2002,44 @@ struct LambdaSpinPolarization { Preslice perCollisionLambda = aod::lambdatrack::lambdaCollisionId; SliceCache cache; - Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); - Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + // Real V0 partitions: trueLambdaFlag=true (passed sharing-daughter resolution) AND fakeFlag=false + Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrackext::fakeFlag == false) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrackext::fakeFlag == false) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + + // LS combinatorial background partitions: + // fakeFlag=true now means: passed the sharing-daughter acceptance logic (Issue 3 fix). + Partition partFakeLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kFakeLambda) && (aod::lambdatrackext::fakeFlag == true); + Partition partFakeAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kFakeAntiLambda) && (aod::lambdatrackext::fakeFlag == true); void processDummy(LambdaCollisions::iterator const&) {} - PROCESS_SWITCH(LambdaSpinPolarization, processDummy, "Dummy process", true); + PROCESS_SWITCH(LambdaSpinPolarization, processDummy, "Dummy process", false); void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) { - // assign centrality cent = collision.cent(); auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - // Add QA for single Lambds + auto fakeLambdaTracks = partFakeLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto fakeAntiLambdaTracks = partFakeAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + + analyzePairsStandard(lambdaTracks, antiLambdaTracks); + analyzePairsStandard(antiLambdaTracks, lambdaTracks); + analyzePairsStandard(lambdaTracks, lambdaTracks); + analyzePairsStandard(antiLambdaTracks, antiLambdaTracks); + + analyzePairsStandard(lambdaTracks, fakeAntiLambdaTracks); + analyzePairsStandard(fakeLambdaTracks, antiLambdaTracks); + + analyzePairsStandard(antiLambdaTracks, fakeLambdaTracks); + analyzePairsStandard(fakeAntiLambdaTracks, lambdaTracks); - // Analyze pairs - analyzePairs(lambdaTracks, antiLambdaTracks); - analyzePairs(lambdaTracks, lambdaTracks); - analyzePairs(antiLambdaTracks, antiLambdaTracks); + analyzePairsStandard(lambdaTracks, fakeLambdaTracks); + analyzePairsStandard(fakeLambdaTracks, lambdaTracks); + analyzePairsStandard(antiLambdaTracks, fakeAntiLambdaTracks); + analyzePairsStandard(fakeAntiLambdaTracks, antiLambdaTracks); } PROCESS_SWITCH(LambdaSpinPolarization, processDataReco, "Process for Data and MCReco", true); @@ -1764,40 +2071,83 @@ struct LambdaSpinPolarization { histos.fill(HIST("QA/ME/hPoolCentVz"), col1.cent(), col1.posZ()); // Lambda slices - auto lambdaTracks_col1 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); - auto lambdaTracks_col2 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); + auto lambdaTracksCol1 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); + auto lambdaTracksCol2 = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); // Anti-lambda slices - auto antiLambdaTracks_col1 = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); - auto antiLambdaTracks_col2 = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); + auto antiLambdaTracksCol1 = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col1.globalIndex(), cache); + auto antiLambdaTracksCol2 = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); + + // Fake lambda slices (LS background) + auto fakeLambdaTracksCol2 = partFakeLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); + auto fakeAntiLambdaTracksCol2 = partFakeAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, col2.globalIndex(), cache); // QA: multiplicities - histos.fill(HIST("QA/ME/hLambdaMultVsCent"), col1.cent(), lambdaTracks_col1.size()); - histos.fill(HIST("QA/ME/hAntiLambdaMultVsCent"), col1.cent(), antiLambdaTracks_col1.size()); + histos.fill(HIST("QA/ME/hLambdaMultVsCent"), col1.cent(), lambdaTracksCol1.size()); + histos.fill(HIST("QA/ME/hAntiLambdaMultVsCent"), col1.cent(), antiLambdaTracksCol1.size()); + + analyzePairsME(lambdaTracksCol1, antiLambdaTracksCol2); + analyzePairsME(antiLambdaTracksCol1, lambdaTracksCol2); + analyzePairsME(lambdaTracksCol1, lambdaTracksCol2); + analyzePairsME(antiLambdaTracksCol1, antiLambdaTracksCol2); + + analyzePairsME(lambdaTracksCol1, fakeAntiLambdaTracksCol2); + analyzePairsME(fakeLambdaTracksCol2, antiLambdaTracksCol1); + + analyzePairsME(antiLambdaTracksCol1, fakeLambdaTracksCol2); + analyzePairsME(fakeAntiLambdaTracksCol2, lambdaTracksCol1); - // Mixed-event pairs - analyzePairsWithKinematicMatching(lambdaTracks_col1, antiLambdaTracks_col2); - analyzePairsWithKinematicMatching(antiLambdaTracks_col1, lambdaTracks_col2); - analyzePairsWithKinematicMatching(lambdaTracks_col1, lambdaTracks_col2); - analyzePairsWithKinematicMatching(antiLambdaTracks_col1, antiLambdaTracks_col2); + analyzePairsME(lambdaTracksCol1, fakeLambdaTracksCol2); + analyzePairsME(fakeLambdaTracksCol2, lambdaTracksCol1); + analyzePairsME(antiLambdaTracksCol1, fakeAntiLambdaTracksCol2); + analyzePairsME(fakeAntiLambdaTracksCol2, antiLambdaTracksCol1); } } PROCESS_SWITCH(LambdaSpinPolarization, processDataRecoMixed, "Process for Data and MCReco for Mixed events", false); - void processDataRecoMixEvent(LambdaCollisions::iterator const& collision, LambdaTracks const& tracks) + void processDataRecoMixEvent(LambdaCollisions::iterator const& collision, LambdaTracks const&) { - // return for no lambdas in a collision - if (tracks.size() == 0) { + // Slice each particle type for this collision + auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto fakeLambdaTracks = partFakeLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto fakeAntiLambdaTracks = partFakeAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + + // Skip collision if there are no true lambdas of any kind + if (lambdaTracks.size() == 0 && antiLambdaTracks.size() == 0 && fakeLambdaTracks.size() == 0 && fakeAntiLambdaTracks.size() == 0) { return; } - // fill collision table + // Fill collision table once per collision lambdaMixEvtCol(collision.index(), collision.cent(), collision.posZ(), collision.timeStamp()); - for (auto const& track : tracks) { - lambdaMixEvtTrk(collision.index(), track.globalIndex(), track.px(), track.py(), track.pz(), track.mass(), - track.prPx(), track.prPy(), track.prPz(), track.v0Type(), collision.timeStamp()); + for (auto const& track : lambdaTracks) { + lambdaMixEvtTrk(collision.index(), track.globalIndex(), + track.px(), track.py(), track.pz(), track.mass(), + track.prPx(), track.prPy(), track.prPz(), + track.v0Type(), collision.timeStamp()); + } + + for (auto const& track : antiLambdaTracks) { + lambdaMixEvtTrk(collision.index(), track.globalIndex(), + track.px(), track.py(), track.pz(), track.mass(), + track.prPx(), track.prPy(), track.prPz(), + track.v0Type(), collision.timeStamp()); + } + + for (auto const& track : fakeLambdaTracks) { + lambdaMixEvtTrk(collision.index(), track.globalIndex(), + track.px(), track.py(), track.pz(), track.mass(), + track.prPx(), track.prPy(), track.prPz(), + track.v0Type(), collision.timeStamp()); + } + + for (auto const& track : fakeAntiLambdaTracks) { + lambdaMixEvtTrk(collision.index(), track.globalIndex(), + track.px(), track.py(), track.pz(), track.mass(), + track.prPx(), track.prPy(), track.prPz(), + track.v0Type(), collision.timeStamp()); } } From c0227abbaca50a1ce35919a9c308a0cc52c72732 Mon Sep 17 00:00:00 2001 From: dyx-11 <1260971129@qq.com> Date: Mon, 13 Apr 2026 01:34:58 +0800 Subject: [PATCH 239/282] [PWGUD] use get track size and add flowMC (#15679) --- PWGUD/Tasks/CMakeLists.txt | 7 +- PWGUD/Tasks/flowCorrelationsUpc.cxx | 13 +- PWGUD/Tasks/flowCumulantsUpc.cxx | 53 ++++---- PWGUD/Tasks/flowMcUpc.cxx | 196 ++++++++++++++++++++++++++++ 4 files changed, 240 insertions(+), 29 deletions(-) create mode 100644 PWGUD/Tasks/flowMcUpc.cxx diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index d8aa575b906..ab54549251c 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -254,6 +254,11 @@ o2physics_add_dpl_workflow(flow-correlations-upc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::PWGCFCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(flow-mc-upc + SOURCES flowMcUpc.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::GFWCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(analysis-mc-dpm-jet-sg-v3 SOURCES analysisMCDPMJetSGv3.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore @@ -272,4 +277,4 @@ o2physics_add_dpl_workflow(sg-exclusive-jpsi-midrapidity o2physics_add_dpl_workflow(fitbit-mapping SOURCES upcTestFITBitMapping.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) \ No newline at end of file + COMPONENT_NAME Analysis) diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index 061eda25566..6bd5736ee48 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -377,12 +377,21 @@ struct FlowCorrelationsUpc { // event mixing SliceCache cache; - using MixedBinning = ColumnBinningPolicy; + // using MixedBinning = ColumnBinningPolicy; // the process for filling the mixed events void processMixed(UDCollisionsFull const& collisions, UdTracksFull const& tracks) { - MixedBinning binningOnVtxAndMult{{vtxMix, multMix}, true}; // true is for 'ignore overflows' (true by default) + auto getTracksSize = [&tracks, this](UDCollisionsFull::iterator const& collision) { + auto associatedTracks = tracks.sliceByCached(o2::aod::udtrack::udCollisionId, collision.udCollisionId(), this->cache); + + auto mult = associatedTracks.size(); + return mult; + }; + + using MixedBinning = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getTracksSize)>; + MixedBinning binningOnVtxAndMult{{getTracksSize}, {vtxMix, multMix}, true}; + // MixedBinning binningOnVtxAndMult{{vtxMix, multMix}, true}; // true is for 'ignore overflows' (true by default) auto tracksTuple = std::make_tuple(tracks); SameKindPair pairs{binningOnVtxAndMult, cfgMinMixEventNum, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index 9624c1a5c86..7d831eb2bf8 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -404,33 +404,34 @@ struct FlowCumulantsUpc { delete oba; // eta region - fGFW->AddRegion("full", -0.8, 0.8, 1, 1); - fGFW->AddRegion("refN00", -0.8, 0., 1, 1); // gap0 negative region - fGFW->AddRegion("refP00", 0., 0.8, 1, 1); // gap0 positve region - fGFW->AddRegion("refN02", -0.8, -0.1, 1, 1); // gap2 negative region - fGFW->AddRegion("refP02", 0.1, 0.8, 1, 1); // gap2 positve region - fGFW->AddRegion("refN04", -0.8, -0.2, 1, 1); // gap4 negative region - fGFW->AddRegion("refP04", 0.2, 0.8, 1, 1); // gap4 positve region - fGFW->AddRegion("refN06", -0.8, -0.3, 1, 1); // gap6 negative region - fGFW->AddRegion("refP06", 0.3, 0.8, 1, 1); // gap6 positve region - fGFW->AddRegion("refN08", -0.8, -0.4, 1, 1); - fGFW->AddRegion("refP08", 0.4, 0.8, 1, 1); - fGFW->AddRegion("refN10", -0.8, -0.5, 1, 1); - fGFW->AddRegion("refP10", 0.5, 0.8, 1, 1); - fGFW->AddRegion("refN12", -0.8, -0.6, 1, 1); - fGFW->AddRegion("refP12", 0.6, 0.8, 1, 1); - fGFW->AddRegion("refN14", -0.8, -0.7, 1, 1); - fGFW->AddRegion("refP14", 0.7, 0.8, 1, 1); - fGFW->AddRegion("refN", -0.8, -0.4, 1, 1); - fGFW->AddRegion("refP", 0.4, 0.8, 1, 1); + fGFW->AddRegion("full", -0.9, 0.9, 1, 1); + fGFW->AddRegion("refN00", -0.9, 0., 1, 1); // gap0 negative region + fGFW->AddRegion("refP00", 0., 0.9, 1, 1); // gap0 positve region + fGFW->AddRegion("refN02", -0.9, -0.1, 1, 1); // gap2 negative region + fGFW->AddRegion("refP02", 0.1, 0.9, 1, 1); // gap2 positve region + fGFW->AddRegion("refN04", -0.9, -0.2, 1, 1); // gap4 negative region + fGFW->AddRegion("refP04", 0.2, 0.9, 1, 1); // gap4 positve region + fGFW->AddRegion("refN06", -0.9, -0.3, 1, 1); // gap6 negative region + fGFW->AddRegion("refP06", 0.3, 0.9, 1, 1); // gap6 positve region + fGFW->AddRegion("refN08", -0.9, -0.4, 1, 1); + fGFW->AddRegion("refP08", 0.4, 0.9, 1, 1); + fGFW->AddRegion("refN10", -0.9, -0.5, 1, 1); + fGFW->AddRegion("refP10", 0.5, 0.9, 1, 1); + fGFW->AddRegion("refN12", -0.9, -0.6, 1, 1); + fGFW->AddRegion("refP12", 0.6, 0.9, 1, 1); + fGFW->AddRegion("refN14", -0.9, -0.7, 1, 1); + fGFW->AddRegion("refP14", 0.7, 0.9, 1, 1); + fGFW->AddRegion("refN", -0.9, -0.4, 1, 1); + fGFW->AddRegion("refP", 0.4, 0.9, 1, 1); fGFW->AddRegion("refM", -0.4, 0.4, 1, 1); - fGFW->AddRegion("poiN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); - fGFW->AddRegion("poiN10", -0.8, -0.5, 1 + fPtAxis->GetNbins(), 2); - fGFW->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2); - fGFW->AddRegion("olN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 4); - fGFW->AddRegion("olN10", -0.8, -0.5, 1 + fPtAxis->GetNbins(), 4); - fGFW->AddRegion("olfull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 4); - + fGFW->AddRegion("poiN", -0.9, -0.4, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("poiN10", -0.9, -0.5, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("poifull", -0.9, 0.9, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("olN", -0.9, -0.4, 1 + fPtAxis->GetNbins(), 4); + fGFW->AddRegion("olN10", -0.9, -0.5, 1 + fPtAxis->GetNbins(), 4); + fGFW->AddRegion("olfull", -0.9, 0.9, 1 + fPtAxis->GetNbins(), 4); + + // eta region for MC, can be different from data to study the effect of acceptance fGFWMC->AddRegion("full", -0.8, 0.8, 1, 1); fGFWMC->AddRegion("refN00", -0.8, 0., 1, 1); // gap0 negative region fGFWMC->AddRegion("refP00", 0., 0.8, 1, 1); // gap0 positve region diff --git a/PWGUD/Tasks/flowMcUpc.cxx b/PWGUD/Tasks/flowMcUpc.cxx new file mode 100644 index 00000000000..a927c075658 --- /dev/null +++ b/PWGUD/Tasks/flowMcUpc.cxx @@ -0,0 +1,196 @@ +// 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. + +/// \file flowMcUpc.cxx +/// \author Zhiyong Lu (zhiyong.lu@cern.ch), Yongxi Du (yongxi.du@cern.ch) +/// \since Apr/2/2026 +/// \brief flow efficiency analysis on UPC MC + +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/DataModel/UDTables.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + +struct FlowMcUpc { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable minB{"minB", 0.0f, "min impact parameter"}; + Configurable maxB{"maxB", 20.0f, "max impact parameter"}; + O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") + O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") + O2_DEFINE_CONFIGURABLE(cfgPtCutMin, float, 0.1f, "Minimal pT for tracks") + O2_DEFINE_CONFIGURABLE(cfgPtCutMax, float, 1000.0f, "Maximal pT for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutDCAxy, float, 0.2f, "DCAxy cut for tracks") + O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy") + + ConfigurableAxis axisB{"axisB", {100, 0.0f, 20.0f}, ""}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}, "pt axis"}; + // Connect to ccdb + Service ccdb; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + + double epsilon = 1e-6; + + using McParts = soa::Join; + + void init(InitContext&) + { + ccdb->setURL(ccdbUrl.value); + ccdb->setCaching(true); + auto now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); + + const AxisSpec axisVertex{20, -10, 10, "Vtxz (cm)"}; + const AxisSpec axisEta{20, -1., 1., "#eta"}; + const AxisSpec axisCounter{1, 0, +1, ""}; + // QA histograms + histos.add("mcEventCounter", "Monte Carlo Truth EventCounter", HistType::kTH1F, {{5, 0, 5}}); + histos.add("RecoProcessEventCounter", "Reconstruction EventCounter", HistType::kTH1F, {{5, 0, 5}}); + histos.add("hImpactParameter", "hImpactParameter", HistType::kTH1D, {axisB}); + + histos.add("hPtMCGen", "Monte Carlo Truth; pT (GeV/c);", {HistType::kTH1D, {axisPt}}); + histos.add("hEtaPtVtxzMCGen", "Monte Carlo Truth; #eta; p_{T} (GeV/c); V_{z} (cm);", {HistType::kTH3D, {axisEta, axisPt, axisVertex}}); + histos.add("hPtReco", "Monte Carlo Reco Global; pT (GeV/c);", {HistType::kTH1D, {axisPt}}); + histos.add("hEtaPtVtxzMCReco", "Monte Carlo Global; #eta; p_{T} (GeV/c); V_{z} (cm);", {HistType::kTH3D, {axisEta, axisPt, axisVertex}}); + } + + // template + // bool eventSelected(TCollision collision) + // { + // return true; + // } + + template + bool trackSelected(TTrack const& track) + { + // auto momentum = std::array{track.px(), track.py(), track.pz()}; + auto pt = track.pt(); + if (pt < cfgPtCutMin || pt > cfgPtCutMax) { + return false; + } + double dcaLimit = 0.0105 + 0.035 / std::pow(pt, 1.1); + if (cfgDcaxy && !(std::fabs(track.dcaXY()) < dcaLimit)) { + return false; + } + return true; + } + + void processMCTrue(aod::UDMcCollisions::iterator const& mcCollision, McParts const& mcParts, aod::BCs const& bcs) + { + if (bcs.size() == 0) { + return; + } + histos.fill(HIST("mcEventCounter"), 0.5); + float imp = mcCollision.impactParameter(); + float vtxz = mcCollision.posZ(); + + if (imp >= minB && imp <= maxB) { + // event within range + histos.fill(HIST("hImpactParameter"), imp); + + for (auto const& mcParticle : mcParts) { + auto momentum = std::array{mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + int pdgCode = std::abs(mcParticle.pdgCode()); + + double pt = RecoDecay::pt(momentum); + double eta = RecoDecay::eta(momentum); + + if (pdgCode != PDG_t::kElectron && pdgCode != PDG_t::kMuonMinus && pdgCode != PDG_t::kPiPlus && pdgCode != PDG_t::kKPlus && pdgCode != PDG_t::kProton) + continue; + + if (!mcParticle.isPhysicalPrimary()) + continue; + if (std::fabs(eta) > cfgCutEta) // main acceptance + continue; + + histos.fill(HIST("hPtMCGen"), pt); + histos.fill(HIST("hEtaPtVtxzMCGen"), eta, pt, vtxz); + } + } + } + PROCESS_SWITCH(FlowMcUpc, processMCTrue, "process pure simulation information", true); + + using MCRecoTracks = soa::Join; + using MCRecoCollisions = soa::Join; + + void processReco(MCRecoCollisions::iterator const& collision, MCRecoTracks const& tracks) + { + histos.fill(HIST("RecoProcessEventCounter"), 0.5); + // if (!eventSelected(collision)) + // return; + histos.fill(HIST("RecoProcessEventCounter"), 1.5); + if (!collision.has_udMcCollision()) + return; + histos.fill(HIST("RecoProcessEventCounter"), 2.5); + if (tracks.size() < 1) + return; + histos.fill(HIST("RecoProcessEventCounter"), 3.5); + + float vtxz = collision.posZ(); + + for (const auto& track : tracks) { + // focus on bulk: e, mu, pi, k, p + auto momentum = std::array{track.px(), track.py(), track.pz()}; + double pt = RecoDecay::pt(momentum); + double eta = RecoDecay::eta(momentum); + // double phi = RecoDecay::phi(momentum); + if (!trackSelected(track) || (!track.has_udMcParticle())) + continue; + auto mcParticle = track.udMcParticle(); + int pdgCode = std::abs(mcParticle.pdgCode()); + + // double pt = recoMC.Pt(); + // double eta = recoMC.Eta(); + if (pdgCode != PDG_t::kElectron && pdgCode != PDG_t::kMuonMinus && pdgCode != PDG_t::kPiPlus && pdgCode != PDG_t::kKPlus && pdgCode != PDG_t::kProton) + continue; + if (std::fabs(eta) > cfgCutEta) // main acceptance + continue; + if (!mcParticle.isPhysicalPrimary()) + continue; + + histos.fill(HIST("hPtReco"), pt); + histos.fill(HIST("hEtaPtVtxzMCReco"), eta, pt, vtxz); + } + } + PROCESS_SWITCH(FlowMcUpc, processReco, "process reconstructed information", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 98104e274b3748457473ffdc9c0b6aa8ade116f5 Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Sun, 12 Apr 2026 21:37:49 +0200 Subject: [PATCH 240/282] [PWGLF] Add missing normalization histogram in MCGen for closure (#15737) --- PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index 6f3dbf51da5..05074ea22df 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -967,6 +967,7 @@ struct PhiStrangenessCorrelation { return std::abs(mcParticle.y()) <= yConfigs.cfgYAcceptance; }; + // Preliminary loop to fill vectors of particles of interest for the current event, applying pt and y cuts for (const auto& mcParticle : mcParticles) { if (!inYAcceptance(mcParticle)) continue; @@ -996,9 +997,12 @@ struct PhiStrangenessCorrelation { if (multBin < 0) return; + // Same Event Correlations std::vector* currentAssocParticles[] = {&k0sParticles, &pionParticles}; for (const auto& phiParticle : phiParticles) { + histos.fill(HIST("phi/h3PhiMCGen"), multiplicity, phiParticle.pt, phiParticle.y); + static_for<0, assocParticleLabels.size() - 1>([&](auto i_idx) { constexpr unsigned int i = i_idx.value; @@ -1011,6 +1015,7 @@ struct PhiStrangenessCorrelation { }); } + // Mixed Event Correlations for (const auto& pastEvent : eventBuffer[multBin]) { const std::vector* pastAssocParticles[] = {&pastEvent.k0sParticles, &pastEvent.pionParticles}; From 7c0fd4c2510ea954cd83cb18f31811bca8bb4f40 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:30:40 +0200 Subject: [PATCH 241/282] [PWGLF] Add option to look at secondary V0s efficiency (#15738) --- .../derivedlambdakzeroanalysis.cxx | 106 +++++++++++++++++- 1 file changed, 102 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 28a6759f51e..1f3ea1b9cb5 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -125,6 +125,7 @@ struct derivedlambdakzeroanalysis { Configurable doMCAssociation{"doMCAssociation", true, "if MC, do MC association"}; Configurable doTreatPiToMuon{"doTreatPiToMuon", false, "Take pi decay into muon into account in MC"}; Configurable doCollisionAssociationQA{"doCollisionAssociationQA", true, "check collision association"}; + Configurable doSecondaryV0s{"doSecondaryV0s", false, "Look at secondary V0s?"}; struct : ConfigurableGroup { std::string prefix = "eventSelections"; // JSON group name @@ -1002,10 +1003,18 @@ struct derivedlambdakzeroanalysis { if (analyseLambda && calculateFeeddownMatrix && (doprocessMonteCarloRun3 || doprocessMonteCarloRun2)) { histos.add("h3dLambdaFeeddown", "h3dLambdaFeeddown", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPtXi}); histos.add("h3dLambdaFeeddownFromXi0", "h3dLambdaFeeddownFromXi0", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPtXi}); + if (doSecondaryV0s) { + histos.add("h3dMassSecLambdaFromXi", "h3dMassSecLambdaFromXi", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisLambdaMass}); + histos.add("h3dMassSecLambdaFromXiAndXi0", "h3dMassSecLambdaFromXiAndXi0", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisLambdaMass}); + } } if (analyseAntiLambda && calculateFeeddownMatrix && (doprocessMonteCarloRun3 || doprocessMonteCarloRun2)) { histos.add("h3dAntiLambdaFeeddown", "h3dAntiLambdaFeeddown", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPtXi}); histos.add("h3dAntiLambdaFeeddownFromXi0", "h3dAntiLambdaFeeddownFromXi0", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPtXi}); + if (doSecondaryV0s) { + histos.add("h3dMassSecAntiLambdaFromXi", "h3dMassSecAntiLambdaFromXi", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisLambdaMass}); + histos.add("h3dMassSecAntiLambdaFromXiAndXi0", "h3dMassSecAntiLambdaFromXiAndXi0", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisLambdaMass}); + } } if (analyseK0Short) @@ -1126,6 +1135,29 @@ struct derivedlambdakzeroanalysis { histos.add("h2dGenXiPlusVsMultMC", "h2dGenXiPlusVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); histos.add("h2dGenOmegaMinusVsMultMC", "h2dGenOmegaMinusVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); histos.add("h2dGenOmegaPlusVsMultMC", "h2dGenOmegaPlusVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + + if (doSecondaryV0s) { + histos.add("h2dGenSecLambda", "h2dGenSecLambda", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambda", "h2dGenSecAntiLambda", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); + histos.add("h2dGenSecLambdaFromXi", "h2dGenSecLambdaFromXi", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaFromXi", "h2dGenSecAntiLambdaFromXi", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); + histos.add("h2dGenSecLambdaFromOmega", "h2dGenSecLambdaFromOmega", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaFromOmega", "h2dGenSecAntiLambdaFromOmega", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); + + histos.add("h2dGenSecLambda_VsRecoedEvt", "h2dGenSecLambda_VsRecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambda_VsRecoedEvt", "h2dGenSecAntiLambda_VsRecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecLambdaFromXiVsMultMC_VsRecoedEvt", "h2dGenSecLambdaFromXiVsMultMC_VsRecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaFromXiVsMultMC_VsRecoedEvt", "h2dGenSecAntiLambdaFromXiVsMultMC_VsRecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecLambdaFromOmegaVsMultMC_VsRecoedEvt", "h2dGenSecLambdaFromOmegaVsMultMC_VsRecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaFromOmegaVsMultMC_VsRecoedEvt", "h2dGenSecAntiLambdaFromOmegaVsMultMC_VsRecoedEvt", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + + histos.add("h2dGenSecLambdaVsMultMC", "h2dGenSecLambdaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaVsMultMC", "h2dGenSecAntiLambdaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecLambdaFromXiVsMultMC", "h2dGenSecLambdaFromXiVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaFromXiVsMultMC", "h2dGenSecAntiLambdaFromXiVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecLambdaFromOmegaVsMultMC", "h2dGenSecLambdaFromOmegaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + histos.add("h2dGenSecAntiLambdaFromOmegaVsMultMC", "h2dGenSecAntiLambdaFromOmegaVsMultMC", kTH2D, {axisConfigurations.axisNch, axisConfigurations.axisPt}); + } } if (doprocessBinnedGenerated) { histos.add("h2dGeneratedK0Short", "h2dGeneratedK0Short", kTH2D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt}); @@ -2074,18 +2106,34 @@ struct derivedlambdakzeroanalysis { // __________________________________________ if (verifyMask(selMap, secondaryMaskSelectionLambda) && analyseLambda) { if (v0mother.isPhysicalPrimary()) { - if (v0mother.pdgCode() == PDG_t::kXiMinus) + if (v0mother.pdgCode() == PDG_t::kXiMinus) { histos.fill(HIST("h3dLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py())); - if (v0mother.pdgCode() == PDG_t::kXiMinus || v0mother.pdgCode() == o2::constants::physics::Pdg::kXi0) + if (doSecondaryV0s) { + histos.fill(HIST("h3dMassSecLambdaFromXi"), centrality, pt, v0.mLambda()); + } + } + if (v0mother.pdgCode() == PDG_t::kXiMinus || v0mother.pdgCode() == o2::constants::physics::Pdg::kXi0) { histos.fill(HIST("h3dLambdaFeeddownFromXi0"), centrality, pt, std::hypot(v0mother.px(), v0mother.py())); + if (doSecondaryV0s) { + histos.fill(HIST("h3dMassSecLambdaFromXiAndXi0"), centrality, pt, v0.mLambda()); + } + } } } if (verifyMask(selMap, secondaryMaskSelectionAntiLambda) && analyseAntiLambda) { if (v0mother.isPhysicalPrimary()) { - if (v0mother.pdgCode() == PDG_t::kXiPlusBar) + if (v0mother.pdgCode() == PDG_t::kXiPlusBar) { histos.fill(HIST("h3dAntiLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py())); - if (v0mother.pdgCode() == PDG_t::kXiPlusBar || v0mother.pdgCode() == -o2::constants::physics::Pdg::kXi0) + if (doSecondaryV0s) { + histos.fill(HIST("h3dMassSecAntiLambdaFromXi"), centrality, pt, v0.mAntiLambda()); + } + } + if (v0mother.pdgCode() == PDG_t::kXiPlusBar || v0mother.pdgCode() == -o2::constants::physics::Pdg::kXi0) { histos.fill(HIST("h3dAntiLambdaFeeddownFromXi0"), centrality, pt, std::hypot(v0mother.px(), v0mother.py())); + if (doSecondaryV0s) { + histos.fill(HIST("h3dMassSecAntiLambdaFromXiAndXi0"), centrality, pt, v0.mAntiLambda()); + } + } } } } @@ -2902,6 +2950,28 @@ struct derivedlambdakzeroanalysis { if (cascMC.pdgCode() == PDG_t::kOmegaPlusBar) { histos.fill(HIST("h2dGenOmegaPlusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); } + + if (doSecondaryV0s && std::abs(cascMC.pdgCodeV0()) == kLambda0) { + float v0PtMc = std::hypot(cascMC.pxPosMC() + cascMC.pxNegMC(), cascMC.pyPosMC() + cascMC.pyNegMC()); + if (cascMC.pdgCodeV0() == kLambda0) { + histos.fill(HIST("h2dGenSecLambda_VsRecoedEvt"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCodeV0() == kLambda0Bar) { + histos.fill(HIST("h2dGenSecAntiLambda_VsRecoedEvt"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kXiMinus && cascMC.pdgCodeV0() == kLambda0) { + histos.fill(HIST("h2dGenSecLambdaFromXiVsMultMC_VsRecoedEvt"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kXiPlusBar && cascMC.pdgCodeV0() == kLambda0Bar) { + histos.fill(HIST("h2dGenSecAntiLambdaFromXiVsMultMC_VsRecoedEvt"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kOmegaMinus && cascMC.pdgCodeV0() == kLambda0) { + histos.fill(HIST("h2dGenSecLambdaFromOmegaVsMultMC_VsRecoedEvt"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kOmegaPlusBar && cascMC.pdgCodeV0() == kLambda0Bar) { + histos.fill(HIST("h2dGenSecAntiLambdaFromOmegaVsMultMC_VsRecoedEvt"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + } } if (cascMC.pdgCode() == PDG_t::kXiMinus) { @@ -2920,6 +2990,34 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("h2dGenOmegaPlus"), centrality, ptmc); histos.fill(HIST("h2dGenOmegaPlusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); } + + if (doSecondaryV0s && std::abs(cascMC.pdgCodeV0()) == kLambda0) { + float v0PtMc = std::hypot(cascMC.pxPosMC() + cascMC.pxNegMC(), cascMC.pyPosMC() + cascMC.pyNegMC()); + if (cascMC.pdgCodeV0() == kLambda0) { + histos.fill(HIST("h2dGenSecLambda"), centrality, v0PtMc); + histos.fill(HIST("h2dGenSecLambdaVsMultMC"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCodeV0() == kLambda0Bar) { + histos.fill(HIST("h2dGenSecAntiLambda"), centrality, v0PtMc); + histos.fill(HIST("h2dGenSecAntiLambdaVsMultMC"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kXiMinus && cascMC.pdgCodeV0() == kLambda0) { + histos.fill(HIST("h2dGenSecLambdaFromXi"), centrality, v0PtMc); + histos.fill(HIST("h2dGenSecLambdaFromXiVsMultMC"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kXiPlusBar && cascMC.pdgCodeV0() == kLambda0Bar) { + histos.fill(HIST("h2dGenSecAntiLambdaFromXi"), centrality, v0PtMc); + histos.fill(HIST("h2dGenSecAntiLambdaFromXiVsMultMC"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kOmegaMinus && cascMC.pdgCodeV0() == kLambda0) { + histos.fill(HIST("h2dGenSecLambdaFromOmega"), centrality, v0PtMc); + histos.fill(HIST("h2dGenSecLambdaFromOmegaVsMultMC"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + if (cascMC.pdgCode() == PDG_t::kOmegaPlusBar && cascMC.pdgCodeV0() == kLambda0Bar) { + histos.fill(HIST("h2dGenSecAntiLambdaFromOmega"), centrality, v0PtMc); + histos.fill(HIST("h2dGenSecAntiLambdaFromOmegaVsMultMC"), mcCollision.multMCNParticlesEta05(), v0PtMc); + } + } } } From e93ccf10637da26a967d25790b82132d3915571a Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Mon, 13 Apr 2026 09:40:29 +0200 Subject: [PATCH 242/282] [PWGEM] Revert "[PWGEM] LMee: Adding more DCA correlation histograms to various signals." (#15734) --- PWGEM/Dilepton/Core/DileptonMC.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index f86454e1893..83a56821628 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -525,14 +525,6 @@ struct DileptonMC { fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/Eta/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - // fRegistry.add(std::format("Pair/sm/EtaPrime/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - // fRegistry.add(std::format("Pair/sm/Rho/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/Omega/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/Omega2ll/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/Phi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/Phi2ll/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); @@ -544,12 +536,6 @@ struct DileptonMC { fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lsmm/"); - if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - for (const auto& strSign : pair_sign_types) { - fRegistry.add(std::format("Pair/ccbar/c2l_c2l/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - } - } - fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2l_b2l/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2c2l_b2c2l/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2c2l_b2l_sameb/"); @@ -579,15 +565,6 @@ struct DileptonMC { } } - if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - for (const auto& strSign : pair_sign_types) { - fRegistry.add(std::format("Pair/bbbar/b2l_b2l/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/bbbar/b2c2l_b2c2l/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/bbbar/b2c2l_b2l_sameb/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/bbbar/b2c2l_b2l_diffb/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - } - } - // for correlated bkg due to mis-identified hadrons, and true combinatorial bkg fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lspp/"); From 9e216ff96f0fd7f64211ea812021fa82aa6c8721 Mon Sep 17 00:00:00 2001 From: Florian Jonas Date: Mon, 13 Apr 2026 10:11:36 +0200 Subject: [PATCH 243/282] [PWGEM] changes to emcpi0qc task to allow running over (weighted) MC productions (#15715) Co-authored-by: ALICE Action Bot --- PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx | 324 ++++++++++++++++++++----- 1 file changed, 269 insertions(+), 55 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx index ae6192a9dbb..04f1f09b6e7 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx @@ -63,6 +63,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using MyCollisions = o2::soa::Join; +using MyMCCollisions = o2::soa::Join; using MyBCs = o2::soa::Join; struct Photon { @@ -96,6 +97,11 @@ struct Photon { bool onDCal; // Checks whether photon is in phi region of the DCal, otherwise: EMCal }; +enum SubGeneratorId { + none = -1, + mbGap = 0 +}; + struct Meson { Meson(Photon p1, Photon p2) : pgamma1(p1), pgamma2(p2) @@ -156,6 +162,7 @@ struct EmcalPi0Qc { Configurable mMinOpenAngleCut{"mMinOpenAngleCut", 0.0202, "apply min opening angle cut"}; Configurable mClusterDefinition{"mClusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default"}; Configurable mSplitEMCalDCal{"mSplitEMCalDCal", 0, "Create and fill inv mass histograms for photons on EMCal and DCal individually"}; + Configurable mDoSumw2{"mDoSumw2", 1, "enable Sumw2 for all histograms"}; std::vector mVetoBCIDs; std::vector mSelectBCIDs; @@ -173,6 +180,7 @@ struct EmcalPi0Qc { // event mixing class EventMixVec evtMix; + float mWeight = 1.0f; // current event weight, by default 1.0 o2::ccdb::CcdbApi ccdbApi; int lastRunNumber = -1; // get the runnumber to obtain the SOR of the run to get t - SOR in (s) later @@ -197,8 +205,27 @@ struct EmcalPi0Qc { const AxisSpec invmassAxis{invmassBinning, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; const AxisSpec ptAxis{pTBinning, "#it{p}_{T} (GeV/#it{c})"}; - if (doprocessCollision) { - mHistManager.add("events", "events;;#it{count}", HistType::kTH1F, {{7, 0.5, 7.5}}); + if (doprocessCollisionMC) { + mHistManager.add("eventsWithoutWeight", "events without weight;;#it{count}", HistType::kTH1F, {{8, 0.5, 8.5}}, mDoSumw2.value); + auto heventWithoutWeight = mHistManager.get(HIST("eventsWithoutWeight")); + heventWithoutWeight->GetXaxis()->SetBinLabel(1, "All events"); + heventWithoutWeight->GetXaxis()->SetBinLabel(2, "Has MC collision"); + heventWithoutWeight->GetXaxis()->SetBinLabel(3, "sel8"); + heventWithoutWeight->GetXaxis()->SetBinLabel(4, "EMCal readout"); + heventWithoutWeight->GetXaxis()->SetBinLabel(5, "1+ Contributor"); + heventWithoutWeight->GetXaxis()->SetBinLabel(6, "z<10cm"); + heventWithoutWeight->GetXaxis()->SetBinLabel(7, "unique col"); + heventWithoutWeight->GetXaxis()->SetBinLabel(8, "EMCal cell>0"); + + // histogram the number of gap events and signal events (2 bins, bin 1 gap bin 2 signal) + mHistManager.add("signalGapEvents", "number of signal and gap events;;#it{count}", HistType::kTH1F, {{2, 0.5, 2.5}}, mDoSumw2.value); + auto hsignalGapEvents = mHistManager.get(HIST("signalGapEvents")); + hsignalGapEvents->GetXaxis()->SetBinLabel(1, "Gap events"); + hsignalGapEvents->GetXaxis()->SetBinLabel(2, "Signal events"); + } + + if (doprocessCollision || doprocessCollisionMC) { + mHistManager.add("events", "events;;#it{count}", HistType::kTH1F, {{7, 0.5, 7.5}}, mDoSumw2.value); auto heventType = mHistManager.get(HIST("events")); heventType->GetXaxis()->SetBinLabel(1, "All events"); heventType->GetXaxis()->SetBinLabel(2, "sel8"); @@ -207,49 +234,65 @@ struct EmcalPi0Qc { heventType->GetXaxis()->SetBinLabel(5, "z<10cm"); heventType->GetXaxis()->SetBinLabel(6, "unique col"); heventType->GetXaxis()->SetBinLabel(7, "EMCal cell>0"); - mHistManager.add("eventVertexZAll", "z-vertex of event (all events)", HistType::kTH1F, {{200, -20, 20}}); - mHistManager.add("eventVertexZSelected", "z-vertex of event (selected events)", HistType::kTH1F, {{200, -20, 20}}); - mHistManager.add("hEventPerTime", "number of events per time", HistType::kTH1F, {collisionTimeAxis}); + mHistManager.add("eventVertexZAll", "z-vertex of event (all events)", HistType::kTH1F, {{200, -20, 20}}, mDoSumw2.value); + mHistManager.add("eventVertexZSelected", "z-vertex of event (selected events)", HistType::kTH1F, {{200, -20, 20}}, mDoSumw2.value); + mHistManager.add("hEventPerTime", "number of events per time", HistType::kTH1F, {collisionTimeAxis}, mDoSumw2.value); + + // emcal hardware triggers + mHistManager.add("eventsEMCALHardwareTriggers", "events with EMCal hardware triggers;;#it{count}", HistType::kTH1F, {{12, 0.5, 12.5}}, mDoSumw2.value); + auto heventsEMCALHardwareTriggers = mHistManager.get(HIST("eventsEMCALHardwareTriggers")); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(1, "kTVXinEMC"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(2, "kEMC7"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(3, "kDMC7"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(4, "kEG1"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(5, "kEG2"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(6, "kDG1"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(7, "kDG2"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(8, "kEJ1"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(9, "kEJ2"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(10, "kDJ1"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(11, "kDJ2"); + heventsEMCALHardwareTriggers->GetXaxis()->SetBinLabel(12, "All"); } if (doprocessAmbiguous) { - mHistManager.add("eventBCAll", "Bunch crossing ID of event (all events)", HistType::kTH1F, {bcAxis}); - mHistManager.add("eventBCSelected", "Bunch crossing ID of event (selected events)", HistType::kTH1F, {bcAxis}); + mHistManager.add("eventBCAll", "Bunch crossing ID of event (all events)", HistType::kTH1F, {bcAxis}, mDoSumw2.value); + mHistManager.add("eventBCSelected", "Bunch crossing ID of event (selected events)", HistType::kTH1F, {bcAxis}, mDoSumw2.value); } // cluster properties for (const bool& iBeforeCuts : {false, true}) { const char* clusterDirectory = iBeforeCuts ? "ClustersBeforeCuts" : "ClustersAfterCuts"; - mHistManager.add(Form("%s/clusterE", clusterDirectory), "Energy of cluster", HistType::kTH1F, {energyAxis}); - mHistManager.add(Form("%s/clusterE_SimpleBinning", clusterDirectory), "Energy of cluster", HistType::kTH1F, {{400, 0, 100, "#it{E} (GeV)"}}); - mHistManager.add(Form("%s/clusterTime", clusterDirectory), "Time of cluster", HistType::kTH1F, {{500, -250, 250, "#it{t}_{cls} (ns)"}}); - mHistManager.add(Form("%s/clusterEtaPhi", clusterDirectory), "Eta and phi of cluster", HistType::kTH2F, {{100, -1, 1, "#eta"}, {100, 0, o2::constants::math::TwoPI, "#phi"}}); - mHistManager.add(Form("%s/clusterM02", clusterDirectory), "M02 of cluster", HistType::kTH1F, {{400, 0, 5, "#it{M}_{02}"}}); - mHistManager.add(Form("%s/clusterM20", clusterDirectory), "M20 of cluster", HistType::kTH1F, {{400, 0, 2.5, "#it{M}_{20}"}}); - mHistManager.add(Form("%s/clusterNLM", clusterDirectory), "Number of local maxima of cluster", HistType::kTH1I, {{10, 0, 10, "#it{N}_{local maxima}"}}); - mHistManager.add(Form("%s/clusterNCells", clusterDirectory), "Number of cells in cluster", HistType::kTH1I, {{50, 0, 50, "#it{N}_{cells}"}}); - mHistManager.add(Form("%s/clusterDistanceToBadChannel", clusterDirectory), "Distance to bad channel", HistType::kTH1F, {{100, 0, 100, "#it{d}"}}); + mHistManager.add(Form("%s/clusterE", clusterDirectory), "Energy of cluster", HistType::kTH1F, {energyAxis}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterE_SimpleBinning", clusterDirectory), "Energy of cluster", HistType::kTH1F, {{400, 0, 100, "#it{E} (GeV)"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterTime", clusterDirectory), "Time of cluster", HistType::kTH1F, {{500, -250, 250, "#it{t}_{cls} (ns)"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterEtaPhi", clusterDirectory), "Eta and phi of cluster", HistType::kTH2F, {{100, -1, 1, "#eta"}, {100, 0, o2::constants::math::TwoPI, "#phi"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterM02", clusterDirectory), "M02 of cluster", HistType::kTH1F, {{400, 0, 5, "#it{M}_{02}"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterM20", clusterDirectory), "M20 of cluster", HistType::kTH1F, {{400, 0, 2.5, "#it{M}_{20}"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterNLM", clusterDirectory), "Number of local maxima of cluster", HistType::kTH1I, {{10, 0, 10, "#it{N}_{local maxima}"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterNCells", clusterDirectory), "Number of cells in cluster", HistType::kTH1I, {{50, 0, 50, "#it{N}_{cells}"}}, mDoSumw2.value); + mHistManager.add(Form("%s/clusterDistanceToBadChannel", clusterDirectory), "Distance to bad channel", HistType::kTH1F, {{100, 0, 100, "#it{d}"}}, mDoSumw2.value); } // meson related histograms - mHistManager.add("invMassVsPt", "invariant mass and pT of meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPtBackground", "invariant mass and pT of background meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPtMixedBackground", "invariant mass and pT of mixed background meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPt", "invariant mass and pT of meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPtBackground", "invariant mass and pT of background meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPtMixedBackground", "invariant mass and pT of mixed background meson candidates", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); if (mSplitEMCalDCal) { - mHistManager.add("invMassVsPt_EMCal", "invariant mass and pT of meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPtBackground_EMCal", "invariant mass and pT of background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPtMixedBackground_EMCal", "invariant mass and pT of mixed background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPt_DCal", "invariant mass and pT of meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPtBackground_DCal", "invariant mass and pT of background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}); - mHistManager.add("invMassVsPtMixedBackground_DCal", "invariant mass and pT of mixed background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}); + mHistManager.add("invMassVsPt_EMCal", "invariant mass and pT of meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPtBackground_EMCal", "invariant mass and pT of background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPtMixedBackground_EMCal", "invariant mass and pT of mixed background meson candidates with both clusters on EMCal", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPt_DCal", "invariant mass and pT of meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPtBackground_DCal", "invariant mass and pT of background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); + mHistManager.add("invMassVsPtMixedBackground_DCal", "invariant mass and pT of mixed background meson candidates with both clusters on DCal", HistType::kTH2F, {invmassAxis, ptAxis}, mDoSumw2.value); } // add histograms per supermodule for (int ism = 0; ism < 20; ++ism) { - mHistManager.add(Form("clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM%d", ism), Form("Cluster time vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {clusterTimeAxis, collisionTimeAxis}); - mHistManager.add(Form("clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM%d", ism), Form("Cluster number of cells vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {{50, 0, 50}, collisionTimeAxis}); - mHistManager.add(Form("clusterM02VsTimeStamp/clusterM02VsTimeStampSM%d", ism), Form("Cluster M02 vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {{400, 0, 5}, collisionTimeAxis}); - mHistManager.add(Form("mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM%d", ism), Form("invariant mass vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {invmassAxis, collisionTimeAxis}); + mHistManager.add(Form("clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM%d", ism), Form("Cluster time vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {clusterTimeAxis, collisionTimeAxis}, mDoSumw2.value); + mHistManager.add(Form("clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM%d", ism), Form("Cluster number of cells vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {{50, 0, 50}, collisionTimeAxis}, mDoSumw2.value); + mHistManager.add(Form("clusterM02VsTimeStamp/clusterM02VsTimeStampSM%d", ism), Form("Cluster M02 vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {{400, 0, 5}, collisionTimeAxis}, mDoSumw2.value); + mHistManager.add(Form("mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM%d", ism), Form("invariant mass vs collision timestamp in Supermodule %d", ism), HistType::kTH2F, {invmassAxis, collisionTimeAxis}, mDoSumw2.value); } if (mVetoBCID->length()) { @@ -277,6 +320,7 @@ struct EmcalPi0Qc { LOG(info) << "mRequireCaloReadout = " << mRequireCaloReadout.value; LOG(info) << "mRequireEMCalCells = " << mRequireEMCalCells.value; LOG(info) << "mSplitEMCalDCal = " << mSplitEMCalDCal.value; + LOG(info) << "mDoSumw2 = " << mDoSumw2.value; } template @@ -285,16 +329,16 @@ struct EmcalPi0Qc { static constexpr std::string_view ClusterTimeHistSM[20] = {"clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM0", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM1", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM2", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM3", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM4", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM5", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM6", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM7", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM8", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM9", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM10", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM11", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM12", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM13", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM14", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM15", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM16", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM17", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM18", "clusterTimeVsTimeStamp/clusterTimeVsTimeStampSM19"}; static constexpr std::string_view ClusterNcellHistSM[20] = {"clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM0", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM1", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM2", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM3", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM4", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM5", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM6", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM7", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM8", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM9", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM10", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM11", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM12", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM13", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM14", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM15", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM16", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM17", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM18", "clusterNcellVsTimeStamp/clusterNCellVsTimeStampSM19"}; static constexpr std::string_view ClusterM02HistSM[20] = {"clusterM02VsTimeStamp/clusterM02VsTimeStampSM0", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM1", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM2", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM3", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM4", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM5", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM6", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM7", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM8", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM9", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM10", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM11", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM12", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM13", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM14", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM15", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM16", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM17", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM18", "clusterM02VsTimeStamp/clusterM02VsTimeStampSM19"}; - mHistManager.fill(HIST(ClusterTimeHistSM[supermoduleID]), time, timeSinceSOR); - mHistManager.fill(HIST(ClusterNcellHistSM[supermoduleID]), NCell, timeSinceSOR); - mHistManager.fill(HIST(ClusterM02HistSM[supermoduleID]), m02, timeSinceSOR); + mHistManager.fill(HIST(ClusterTimeHistSM[supermoduleID]), time, timeSinceSOR, mWeight); + mHistManager.fill(HIST(ClusterNcellHistSM[supermoduleID]), NCell, timeSinceSOR, mWeight); + mHistManager.fill(HIST(ClusterM02HistSM[supermoduleID]), m02, timeSinceSOR, mWeight); } template void supermoduleHistHelperMeson(float minv, float timeSinceSOR) { static constexpr std::string_view MesonInvMassHistSM[20] = {"mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM0", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM1", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM2", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM3", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM4", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM5", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM6", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM7", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM8", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM9", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM10", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM11", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM12", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM13", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM14", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM15", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM16", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM17", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM18", "mesonInvMassVsTimeStamp/mesonInvMassVsTimeStampSM19"}; - mHistManager.fill(HIST(MesonInvMassHistSM[supermoduleID]), minv, timeSinceSOR); + mHistManager.fill(HIST(MesonInvMassHistSM[supermoduleID]), minv, timeSinceSOR, mWeight); } void fillSupermoduleHistogramsPhoton(int supermoduleID, float time, float m02, int NCell, float timeSinceSOR) @@ -455,13 +499,50 @@ struct EmcalPi0Qc { } for (const auto& collision : collisions) { + mHistManager.fill(HIST("events"), 1); // Fill "All events" bin of event histogram + // emcal hardware triggers + if (collision.alias_bit(kTVXinEMC)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 1); + } + if (collision.alias_bit(kEMC7)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 2); + } + if (collision.alias_bit(kDMC7)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 3); + } + if (collision.alias_bit(kEG1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 4); + } + if (collision.alias_bit(kEG2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 5); + } + if (collision.alias_bit(kDG1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 6); + } + if (collision.alias_bit(kDG2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 7); + } + if (collision.alias_bit(kEJ1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 8); + } + if (collision.alias_bit(kEJ2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 9); + } + if (collision.alias_bit(kDJ1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 10); + } + if (collision.alias_bit(kDJ2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 11); + } + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 12); + if (mDoEventSel.value && (!collision.sel8())) { // Check sel8 continue; } - mHistManager.fill(HIST("events"), 2); // Fill sel8 - if (mRequireCaloReadout.value && !collision.alias_bit(kTVXinEMC)) { // Check whether EMC was read out + mHistManager.fill(HIST("events"), 2); + if (mRequireCaloReadout.value && !(collision.alias_bit(kTVXinEMC) || collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7) || collision.alias_bit(kEG1) || collision.alias_bit(kEG2) || collision.alias_bit(kDG1) || collision.alias_bit(kDG2) || collision.alias_bit(kEJ1) || collision.alias_bit(kEJ2) || collision.alias_bit(kDJ1) || collision.alias_bit(kDJ2))) { // Check whether EMC was read out continue; } mHistManager.fill(HIST("events"), 3); // Fill readout @@ -521,6 +602,138 @@ struct EmcalPi0Qc { } PROCESS_SWITCH(EmcalPi0Qc, processCollision, "Process clusters from collision", false); + /// \brief Process EMCAL clusters from MC-tagged collisions and set event weight + void processCollisionMC(MyBCs const& bcs, MyMCCollisions const& collisions, o2::aod::McCollisions const&, o2::aod::EMCALClusters const& clusters, o2::soa::Filtered const& cells, o2::aod::EMCALClusterCells const& clusterCells) + { + auto cellIter = cells.begin(); + auto bcIter = bcs.begin(); + int runNumber = bcIter.runNumber(); + std::unordered_map cellGlobalBCs; + // Build map of number of cells for corrected BCs using global BCs + // used later in the determination whether a BC has EMC cell content (for speed reason) + for (const auto& cell : cells) { + cellGlobalBCs[cell.bc_as().globalBC()]++; + } + + for (const auto& collision : collisions) { + mWeight = 1.0f; + // emcal hardware triggers + if (collision.alias_bit(kTVXinEMC)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 1); + } + if (collision.alias_bit(kEMC7)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 2); + } + if (collision.alias_bit(kDMC7)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 3); + } + if (collision.alias_bit(kEG1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 4); + } + if (collision.alias_bit(kEG2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 5); + } + if (collision.alias_bit(kDG1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 6); + } + if (collision.alias_bit(kDG2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 7); + } + if (collision.alias_bit(kEJ1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 8); + } + if (collision.alias_bit(kEJ2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 9); + } + if (collision.alias_bit(kDJ1)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 10); + } + if (collision.alias_bit(kDJ2)) { + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 11); + } + mHistManager.fill(HIST("eventsEMCALHardwareTriggers"), 12); + + if (collision.has_mcCollision()) { + mWeight = collision.mcCollision().weight(); + if (collision.mcCollision().getSubGeneratorId() == SubGeneratorId::mbGap) { + mHistManager.fill(HIST("signalGapEvents"), 1); // Fill gap events bin of signalGapEvents histogram + } else { + mHistManager.fill(HIST("signalGapEvents"), 2); // Fill signal events bin of signalGapEvents histogram + } + } + + mHistManager.fill(HIST("events"), 1, mWeight); // Fill "All events" bin of event histogram + mHistManager.fill(HIST("eventsWithoutWeight"), 1); // Fill "All events" bin of event histogram without weight + if (collision.has_mcCollision()) { + mHistManager.fill(HIST("eventsWithoutWeight"), 2); // Fill "Has MC collision" bin of event histogram without weight + } + if (mDoEventSel.value && (!collision.sel8())) { // Check sel8 + continue; + } + + mHistManager.fill(HIST("events"), 2, mWeight); // Fill sel8 + mHistManager.fill(HIST("eventsWithoutWeight"), 3); // Fill sel8 bin of event histogram without weight + if (mRequireCaloReadout.value && !(collision.alias_bit(kTVXinEMC) || collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7) || collision.alias_bit(kEG1) || collision.alias_bit(kEG2) || collision.alias_bit(kDG1) || collision.alias_bit(kDG2) || collision.alias_bit(kEJ1) || collision.alias_bit(kEJ2) || collision.alias_bit(kDJ1) || collision.alias_bit(kDJ2))) { // Check whether EMC was read out + continue; + } + mHistManager.fill(HIST("events"), 3, mWeight); // Fill readout + mHistManager.fill(HIST("eventsWithoutWeight"), 4); // Fill readout bin of event histogram without weight + if (mDoEventSel.value && collision.numContrib() < 0.5) { // Skip collisions without contributors + continue; + } + mHistManager.fill(HIST("events"), 4, mWeight); // Fill >1 vtx contr. bin of event histogram + mHistManager.fill(HIST("eventsWithoutWeight"), 5); // Fill >1 vtx contr. bin of event histogram without weight + mHistManager.fill(HIST("eventVertexZAll"), collision.posZ(), mWeight); + if (mVertexCut > 0 && std::abs(collision.posZ()) > mVertexCut) { + continue; + } + mHistManager.fill(HIST("events"), 5, mWeight); // Fill z-Vertex selected bin of event histogram + mHistManager.fill(HIST("eventsWithoutWeight"), 6); // Fill z-Vertex selected bin of event histogram without weight + mHistManager.fill(HIST("eventVertexZSelected"), collision.posZ(), mWeight); + + if (mDoEventSel.value && collision.ambiguous()) { // Skip ambiguous collisions (those that are in BCs including multiple collisions) + continue; + } + mHistManager.fill(HIST("events"), 6, mWeight); // Fill "One collision in BC" bin of event histogram + mHistManager.fill(HIST("eventsWithoutWeight"), 7); // Fill "One collision in BC" bin of event histogram without weight + if (mDoEventSel.value) { + auto found = cellGlobalBCs.find(collision.foundBC_as().globalBC()); + if (mRequireEMCalCells.value && (found == cellGlobalBCs.end() || found->second == 0)) { // Skip collisions without any readout EMCal cells + continue; + } + } + mHistManager.fill(HIST("events"), 7, mWeight); // Fill at least one non0 cell in EMCal of event histogram (Selected) + mHistManager.fill(HIST("eventsWithoutWeight"), 8); // Fill at least one non0 cell in EMCal of event histogram (Selected) without weight + // Get BC and run number + int64_t foundBCId = collision.foundBCId(); + if (foundBCId >= 0) { + bcIter.setCursor(foundBCId); + } + runNumber = bcIter.runNumber(); + + // Fetch SOR only when run changes + if (runNumber != lastRunNumber) { + std::map headers, metadata; + headers = ccdbApi.retrieveHeaders(Form("RCT/Info/RunInformation/%i", runNumber), metadata, -1); + tsSOR = atol(headers["SOR"].c_str()); + // LOGP(info, "Run {} | SOR = {} ms", runNumber, tsSOR); + lastRunNumber = runNumber; + } + + // Time since SOR in minutes (bc.timestamp() is in ms) + float timeSinceSORMin = (bcIter.timestamp() - tsSOR) / 1000.0f / 60.f; + mHistManager.fill(HIST("hEventPerTime"), timeSinceSORMin, mWeight); + + auto clustersPerColl = clusters.sliceBy(perCollision, collision.globalIndex()); + if (clustersPerColl.size() == 0) { + continue; + } + processClusters(clustersPerColl, clusterCells, cellIter, timeSinceSORMin); + processMesons(timeSinceSORMin); + } + } + PROCESS_SWITCH(EmcalPi0Qc, processCollisionMC, "Process clusters from MC-tagged collisions", false); + /// \brief Process EMCAL clusters that are not matched to a collision /// This is not needed for most users void processAmbiguous(o2::aod::BCs::iterator const& bc, o2::aod::EMCALAmbiguousClusters const& clusters) @@ -614,15 +827,15 @@ struct EmcalPi0Qc { static constexpr std::string_view ClusterQAHistNLM[2] = {"ClustersBeforeCuts/clusterNLM", "ClustersAfterCuts/clusterNLM"}; static constexpr std::string_view ClusterQAHistNCells[2] = {"ClustersBeforeCuts/clusterNCells", "ClustersAfterCuts/clusterNCells"}; static constexpr std::string_view ClusterQAHistDistanceToBadChannel[2] = {"ClustersBeforeCuts/clusterDistanceToBadChannel", "ClustersAfterCuts/clusterDistanceToBadChannel"}; - mHistManager.fill(HIST(ClusterQAHistEnergy[BeforeCuts]), cluster.energy()); - mHistManager.fill(HIST(ClusterQAHistEnergySimpleBinning[BeforeCuts]), cluster.energy()); - mHistManager.fill(HIST(ClusterQAHistTime[BeforeCuts]), cluster.time()); - mHistManager.fill(HIST(ClusterQAHistEtaPhi[BeforeCuts]), cluster.eta(), cluster.phi()); - mHistManager.fill(HIST(ClusterQAHistM02[BeforeCuts]), cluster.m02()); - mHistManager.fill(HIST(ClusterQAHistM20[BeforeCuts]), cluster.m20()); - mHistManager.fill(HIST(ClusterQAHistNLM[BeforeCuts]), cluster.nlm()); - mHistManager.fill(HIST(ClusterQAHistNCells[BeforeCuts]), cluster.nCells()); - mHistManager.fill(HIST(ClusterQAHistDistanceToBadChannel[BeforeCuts]), cluster.distanceToBadChannel()); + mHistManager.fill(HIST(ClusterQAHistEnergy[BeforeCuts]), cluster.energy(), mWeight); + mHistManager.fill(HIST(ClusterQAHistEnergySimpleBinning[BeforeCuts]), cluster.energy(), mWeight); + mHistManager.fill(HIST(ClusterQAHistTime[BeforeCuts]), cluster.time(), mWeight); + mHistManager.fill(HIST(ClusterQAHistEtaPhi[BeforeCuts]), cluster.eta(), cluster.phi(), mWeight); + mHistManager.fill(HIST(ClusterQAHistM02[BeforeCuts]), cluster.m02(), mWeight); + mHistManager.fill(HIST(ClusterQAHistM20[BeforeCuts]), cluster.m20(), mWeight); + mHistManager.fill(HIST(ClusterQAHistNLM[BeforeCuts]), cluster.nlm(), mWeight); + mHistManager.fill(HIST(ClusterQAHistNCells[BeforeCuts]), cluster.nCells(), mWeight); + mHistManager.fill(HIST(ClusterQAHistDistanceToBadChannel[BeforeCuts]), cluster.distanceToBadChannel(), mWeight); } /// \brief Return a boolean that states, whether a cluster should be rejected by the applied cluster cuts @@ -668,7 +881,7 @@ struct EmcalPi0Qc { // build meson from photons Meson meson(mPhotons[ig1], mPhotons[ig2]); if (meson.getOpeningAngle() > mMinOpenAngleCut) { - mHistManager.fill(HIST("invMassVsPt"), meson.getMass(), meson.getPt()); + mHistManager.fill(HIST("invMassVsPt"), meson.getMass(), meson.getPt(), mWeight); uint8_t sm1 = mPhotons[ig1].sm; uint8_t sm2 = mPhotons[ig2].sm; @@ -678,9 +891,9 @@ struct EmcalPi0Qc { if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal) { - mHistManager.fill(HIST("invMassVsPt_EMCal"), meson.getMass(), meson.getPt()); + mHistManager.fill(HIST("invMassVsPt_EMCal"), meson.getMass(), meson.getPt(), mWeight); } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal) { - mHistManager.fill(HIST("invMassVsPt_DCal"), meson.getMass(), meson.getPt()); + mHistManager.fill(HIST("invMassVsPt_DCal"), meson.getMass(), meson.getPt(), mWeight); } } } @@ -688,6 +901,7 @@ struct EmcalPi0Qc { // calculate background candidates (rotation background) calculateBackground(meson, ig1, ig2); } + // TODO: for now this part makes no sense when running JJ MC due to weights calculateMixedBack(mPhotons[ig1]); } @@ -736,22 +950,22 @@ struct EmcalPi0Qc { // Fill histograms if (mesonRotated1.getOpeningAngle() > mMinOpenAngleCut) { - mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated1.getMass(), mesonRotated1.getPt()); + mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated1.getMass(), mesonRotated1.getPt(), mWeight); if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal && !mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated1.getMass(), mesonRotated1.getPt()); + mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated1.getMass(), mesonRotated1.getPt(), mWeight); } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal && mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated1.getMass(), mesonRotated1.getPt()); + mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated1.getMass(), mesonRotated1.getPt(), mWeight); } } } if (mesonRotated2.getOpeningAngle() > mMinOpenAngleCut) { - mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated2.getMass(), mesonRotated2.getPt()); + mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated2.getMass(), mesonRotated2.getPt(), mWeight); if (mSplitEMCalDCal) { if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal && !mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated2.getMass(), mesonRotated2.getPt()); + mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated2.getMass(), mesonRotated2.getPt(), mWeight); } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal && mPhotons[ig3].onDCal) { - mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated2.getMass(), mesonRotated2.getPt()); + mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated2.getMass(), mesonRotated2.getPt(), mWeight); } } } @@ -803,7 +1017,7 @@ struct EmcalPi0Qc { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc, TaskName{"EmcalPi0QcAssociate"}, SetDefaultProcesses{{{"processCollision", true}, {"processAmbiguous", false}}}), // o2-linter: disable=name/o2-task (adapted multiple times) - adaptAnalysisTask(cfgc, TaskName{"EmcalPi0QcAmbiguous"}, SetDefaultProcesses{{{"processCollision", false}, {"processAmbiguous", true}}})}; // o2-linter: disable=name/o2-task (adapted multiple times) + adaptAnalysisTask(cfgc, TaskName{"EmcalPi0QcAssociate"}, SetDefaultProcesses{{{"processCollision", true}, {"processCollisionMC", false}, {"processAmbiguous", false}}}), // o2-linter: disable=name/o2-task (adapted multiple times) + adaptAnalysisTask(cfgc, TaskName{"EmcalPi0QcAmbiguous"}, SetDefaultProcesses{{{"processCollision", false}, {"processCollisionMC", false}, {"processAmbiguous", true}}})}; // o2-linter: disable=name/o2-task (adapted multiple times) return workflow; } From ddc0cba8c6d7d48a6b0017f5c5f2bb12735775d5 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:49:10 +0200 Subject: [PATCH 244/282] [PWGEM,PWGEM-36] PM/PhotonResoTask: Add Rec-True/True vs True histograms (#15740) --- PWGEM/PhotonMeson/Tasks/photonResoTask.cxx | 95 +++++++++++++++------- 1 file changed, 64 insertions(+), 31 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index a1ddbb8f3d7..1396ec31f63 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -88,6 +88,8 @@ struct PhotonResoTask { ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {400, 0.0, 0.8}, "invariant mass axis for the neutral meson"}; ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {100, 0., 20.}, "pT axis for the neutral meson"}; ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {20, 0., 100.}, "centrality axis for the current event"}; + ConfigurableAxis thnConfigAxisMult{"thnConfigAxisMult", {60, 0., 60000.}, "multiplicity axis for the current event"}; + Configurable useCent{"useCent", 0, "flag to enable usage of centrality instead of multiplicity as axis."}; EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { @@ -314,7 +316,12 @@ struct PhotonResoTask { const AxisSpec thnAxisPtGen{thnConfigAxisPt, "#it{p}_{T,Gen} (GeV/#it{c})"}; const AxisSpec thnAxisPtRec{thnConfigAxisPt, "#it{p}_{T,Rec} (GeV/#it{c})"}; - const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality (%)"}; + const AxisSpec thnAxisPGen{thnConfigAxisPt, "#it{p}_{Gen} (GeV/#it{c})"}; + const AxisSpec thnAxisPRec{thnConfigAxisPt, "#it{p}_{Rec} (GeV/#it{c})"}; + const AxisSpec thnAxisPRelative{thnConfigAxisPt, "#it{p}_{Rec} - #it{p}_{Gen} / #it{p}_{Gen}"}; + const AxisSpec thnAxisEGen{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; + const AxisSpec thnAxisERec{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; + const AxisSpec thnAxisERelative{thnConfigAxisPt, "#it{E}_{Rec} - #it{E}_{Gen} / #it{E}_{Gen}"}; const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; const AxisSpec thnAxisEtaGen{280, -0.7, 0.7, "#it{#eta}_{Gen}"}; @@ -323,25 +330,39 @@ struct PhotonResoTask { const AxisSpec thnAxisPhiGen{360, 0., o2::constants::math::TwoPI, "#it{#varphi}_{Gen} (rad)"}; const AxisSpec thnAxisPhiRec{360, 0., o2::constants::math::TwoPI, "#it{#varphi}_{Rec} (rad)"}; - registry.add("EMCal/hPhotonReso", "EMCal photon rec pT vs true pT vs cent", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCent}); - registry.add("EMCal/hConvPhotonReso", "EMCal conversion photon rec pT vs true pT vs cent ", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCent}); + AxisSpec thnAxisCentOrMult{1, 0., 1., "Centrality/Multiplicity"}; // placeholder, overwritten in init + if (useCent.value) { + // PbPb: use centrality + thnAxisCentOrMult = {thnConfigAxisCent, "Centrality (%)"}; + } else { + // pp: use multiplicity + thnAxisCentOrMult = {thnConfigAxisMult, "FT0C Multiplicity"}; + } + + registry.add("EMCal/hPhotonReso", "EMCal photon rec pT vs true pT vs cent", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCentOrMult}); + registry.add("EMCal/hConvPhotonReso", "EMCal conversion photon rec pT vs true pT vs cent ", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCentOrMult}); - registry.add("EMCal/hPi0Reso", "EMCal pi0 rec pT vs true pT vs min vs cent ", HistType::kTHnSparseF, {thnAxisPtRec, thnAxisPtGen, thnConfigAxisInvMass, thnAxisCent}); - registry.add("EMCal/hEtaReso", "EMCal eta rec pT vs true pT vs min vs cent ", HistType::kTHnSparseF, {thnAxisPtRec, thnAxisPtGen, thnConfigAxisInvMass, thnAxisCent}); + registry.add("EMCal/hErecEmcPhotons", "EMCal photon rec E - true E vs true E vs cent", HistType::kTH3D, {thnAxisERelative, thnAxisEGen, thnAxisCentOrMult}); + registry.add("EMCal/hErecEmcConvPhotons", "EMCal conversion photon rec E - true E vs true E vs cent ", HistType::kTH3D, {thnAxisERelative, thnAxisEGen, thnAxisCentOrMult}); - registry.add("EMCal/hPhotonResoEta", "EMCal photon rec eta vs true eta vs cent", HistType::kTH3D, {thnAxisEtaRec, thnAxisEtaGen, thnAxisCent}); - registry.add("EMCal/hConvPhotonResoEta", "EMCal conversion photon rec eta vs true eta vs cent ", HistType::kTH3D, {thnAxisEtaRec, thnAxisEtaGen, thnAxisCent}); + registry.add("EMCal/hPi0Reso", "EMCal pi0 rec pT vs true pT vs min vs cent ", HistType::kTHnSparseF, {thnAxisPtRec, thnAxisPtGen, thnConfigAxisInvMass, thnAxisCentOrMult}); + registry.add("EMCal/hEtaReso", "EMCal eta rec pT vs true pT vs min vs cent ", HistType::kTHnSparseF, {thnAxisPtRec, thnAxisPtGen, thnConfigAxisInvMass, thnAxisCentOrMult}); - registry.add("EMCal/hPi0ResoEta", "EMCal pi0 rec eta vs true eta vs min vs cent ", HistType::kTHnSparseF, {thnAxisEtaRec, thnAxisEtaGen, thnConfigAxisInvMass, thnAxisCent}); - registry.add("EMCal/hEtaResoEta", "EMCal eta rec eta vs true eta vs min vs cent ", HistType::kTHnSparseF, {thnAxisEtaRec, thnAxisEtaGen, thnConfigAxisInvMass, thnAxisCent}); + registry.add("EMCal/hPhotonResoEta", "EMCal photon rec eta vs true eta vs cent", HistType::kTH3D, {thnAxisEtaRec, thnAxisEtaGen, thnAxisCentOrMult}); + registry.add("EMCal/hConvPhotonResoEta", "EMCal conversion photon rec eta vs true eta vs cent ", HistType::kTH3D, {thnAxisEtaRec, thnAxisEtaGen, thnAxisCentOrMult}); - registry.add("EMCal/hPhotonResoPhi", "EMCal photon rec phi vs true phi vs cent", HistType::kTH3D, {thnAxisPhiRec, thnAxisPhiGen, thnAxisCent}); - registry.add("EMCal/hConvPhotonResoPhi", "EMCal conversion photon rec phi vs true phi vs cent ", HistType::kTH3D, {thnAxisPhiRec, thnAxisPhiGen, thnAxisCent}); + registry.add("EMCal/hPi0ResoEta", "EMCal pi0 rec eta vs true eta vs min vs cent ", HistType::kTHnSparseF, {thnAxisEtaRec, thnAxisEtaGen, thnConfigAxisInvMass, thnAxisCentOrMult}); + registry.add("EMCal/hEtaResoEta", "EMCal eta rec eta vs true eta vs min vs cent ", HistType::kTHnSparseF, {thnAxisEtaRec, thnAxisEtaGen, thnConfigAxisInvMass, thnAxisCentOrMult}); - registry.add("EMCal/hPi0ResoPhi", "EMCal pi0 rec phi vs true phi vs min vs cent ", HistType::kTHnSparseF, {thnAxisPhiRec, thnAxisPhiGen, thnConfigAxisInvMass, thnAxisCent}); - registry.add("EMCal/hEtaResoPhi", "EMCal eta rec phi vs true phi vs min vs cent ", HistType::kTHnSparseF, {thnAxisPhiRec, thnAxisPhiGen, thnConfigAxisInvMass, thnAxisCent}); + registry.add("EMCal/hPhotonResoPhi", "EMCal photon rec phi vs true phi vs cent", HistType::kTH3D, {thnAxisPhiRec, thnAxisPhiGen, thnAxisCentOrMult}); + registry.add("EMCal/hConvPhotonResoPhi", "EMCal conversion photon rec phi vs true phi vs cent ", HistType::kTH3D, {thnAxisPhiRec, thnAxisPhiGen, thnAxisCentOrMult}); - registry.add("PCM/hPhotonReso", "PCM photon rec pT vs true pT vs ", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCent}); + registry.add("EMCal/hPi0ResoPhi", "EMCal pi0 rec phi vs true phi vs min vs cent ", HistType::kTHnSparseF, {thnAxisPhiRec, thnAxisPhiGen, thnConfigAxisInvMass, thnAxisCentOrMult}); + registry.add("EMCal/hEtaResoPhi", "EMCal eta rec phi vs true phi vs min vs cent ", HistType::kTHnSparseF, {thnAxisPhiRec, thnAxisPhiGen, thnConfigAxisInvMass, thnAxisCentOrMult}); + + registry.add("PCM/hPhotonReso", "PCM photon rec pT vs true pT vs cent", HistType::kTH3D, {thnAxisPtRec, thnAxisPtGen, thnAxisCentOrMult}); + + registry.add("PCM/hPrecPmcPhotons", "PCM photon rec p - true p vs true p vs cent", HistType::kTH3D, {thnAxisPRelative, thnAxisPGen, thnAxisCentOrMult}); auto hMesonCuts = registry.add("hMesonCuts", "hMesonCuts;;Counts", kTH1D, {{6, 0.5, 6.5}}, false); hMesonCuts->GetXaxis()->SetBinLabel(1, "in"); @@ -387,6 +408,16 @@ struct PhotonResoTask { mRunNumber = collision.runNumber(); } + template + float getCentralityOrMultiplicity(TCollision const& collision) + { + if (useCent.value) { + return getCentrality(collision); + } + // pp: use raw FT0C multiplicity + return collision.multFT0C(); + } + /// Get the centrality /// \param collision is the collision with the centrality information template @@ -428,8 +459,8 @@ struct PhotonResoTask { // occupancy selection return false; } - float cent = getCentrality(collision); - if (cent < eventcuts.cfgMinCent || cent > eventcuts.cfgMaxCent) { + float centOrMult = getCentralityOrMultiplicity(collision); + if (useCent && (centOrMult < eventcuts.cfgMinCent || centOrMult > eventcuts.cfgMaxCent)) { // event selection return false; } @@ -473,7 +504,7 @@ struct PhotonResoTask { initCCDB(collision); isFullEventSelected(collision, true); - float cent = getCentrality(collision); + float centOrMult = getCentralityOrMultiplicity(collision); auto photonsEMCPerCollision = clusters.sliceBy(perCollisionEMC, collision.globalIndex()); auto photonsPCMPerCollision = photons.sliceBy(perCollisionPCM, collision.globalIndex()); @@ -490,16 +521,18 @@ struct PhotonResoTask { mcPhoton1.setCursor(photonEMC.emmcparticleIds()[0]); if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kGamma) { - registry.fill(HIST("EMCal/hPhotonReso"), photonEMC.pt(), mcPhoton1.pt(), cent); - registry.fill(HIST("EMCal/hPhotonResoEta"), photonEMC.eta(), mcPhoton1.eta(), cent); - registry.fill(HIST("EMCal/hPhotonResoPhi"), photonEMC.phi(), mcPhoton1.phi(), cent); + registry.fill(HIST("EMCal/hPhotonReso"), photonEMC.pt(), mcPhoton1.pt(), centOrMult); + registry.fill(HIST("EMCal/hPhotonResoEta"), photonEMC.eta(), mcPhoton1.eta(), centOrMult); + registry.fill(HIST("EMCal/hPhotonResoPhi"), photonEMC.phi(), mcPhoton1.phi(), centOrMult); + registry.fill(HIST("EMCal/hErecEmcPhotons"), (photonEMC.e() - mcPhoton1.e()) / mcPhoton1.e(), mcPhoton1.e(), centOrMult); } else if (std::abs(mcPhoton1.pdgCode()) == PDG_t::kElectron) { if (!o2::aod::pwgem::photonmeson::utils::mcutil::isMotherPDG(mcPhoton1, PDG_t::kGamma)) { continue; } - registry.fill(HIST("EMCal/hConvPhotonReso"), photonEMC.pt(), mcPhoton1.pt(), cent); - registry.fill(HIST("EMCal/hConvPhotonResoEta"), photonEMC.eta(), mcPhoton1.eta(), cent); - registry.fill(HIST("EMCal/hConvPhotonResoPhi"), photonEMC.phi(), mcPhoton1.phi(), cent); + registry.fill(HIST("EMCal/hConvPhotonReso"), photonEMC.pt(), mcPhoton1.pt(), centOrMult); + registry.fill(HIST("EMCal/hConvPhotonResoEta"), photonEMC.eta(), mcPhoton1.eta(), centOrMult); + registry.fill(HIST("EMCal/hConvPhotonResoPhi"), photonEMC.phi(), mcPhoton1.phi(), centOrMult); + registry.fill(HIST("EMCal/hErecEmcConvPhotons"), (photonEMC.e() - mcPhoton1.e()) / mcPhoton1.e(), mcPhoton1.e(), centOrMult); } } @@ -527,8 +560,8 @@ struct PhotonResoTask { if (!fV0PhotonCut.IsConversionPointInAcceptance(mcPhoton1, trueConvRadius)) { continue; } - - registry.fill(HIST("PCM/hPhotonReso"), photonPCM.pt(), mcPhoton1.pt(), cent); + registry.fill(HIST("PCM/hPhotonReso"), photonPCM.pt(), mcPhoton1.pt(), centOrMult); + registry.fill(HIST("PCM/hPrecPmcPhotons"), (photonPCM.p() - mcPhoton1.p()) / mcPhoton1.p(), mcPhoton1.p(), centOrMult); } // end of loop over pcm photons @@ -590,15 +623,15 @@ struct PhotonResoTask { if (pi0id >= 0) { const auto pi0mc = mcParticles.iteratorAt(pi0id); - registry.fill(HIST("EMCal/hPi0Reso"), vMeson.Pt(), pi0mc.pt(), vMeson.M(), cent); - registry.fill(HIST("EMCal/hPi0ResoEta"), vMeson.Eta(), pi0mc.eta(), vMeson.M(), cent); - registry.fill(HIST("EMCal/hPi0ResoPhi"), RecoDecay::constrainAngle(vMeson.Phi()), pi0mc.phi(), vMeson.M(), cent); + registry.fill(HIST("EMCal/hPi0Reso"), vMeson.Pt(), pi0mc.pt(), vMeson.M(), centOrMult); + registry.fill(HIST("EMCal/hPi0ResoEta"), vMeson.Eta(), pi0mc.eta(), vMeson.M(), centOrMult); + registry.fill(HIST("EMCal/hPi0ResoPhi"), RecoDecay::constrainAngle(vMeson.Phi()), pi0mc.phi(), vMeson.M(), centOrMult); } if (etaid >= 0) { const auto etamc = mcParticles.iteratorAt(etaid); - registry.fill(HIST("EMCal/hEtaReso"), vMeson.Pt(), etamc.pt(), vMeson.M(), cent); - registry.fill(HIST("EMCal/hEtaResoEta"), vMeson.Eta(), etamc.eta(), vMeson.M(), cent); - registry.fill(HIST("EMCal/hEtaResoPhi"), RecoDecay::constrainAngle(vMeson.Phi()), etamc.phi(), vMeson.M(), cent); + registry.fill(HIST("EMCal/hEtaReso"), vMeson.Pt(), etamc.pt(), vMeson.M(), centOrMult); + registry.fill(HIST("EMCal/hEtaResoEta"), vMeson.Eta(), etamc.eta(), vMeson.M(), centOrMult); + registry.fill(HIST("EMCal/hEtaResoPhi"), RecoDecay::constrainAngle(vMeson.Phi()), etamc.phi(), vMeson.M(), centOrMult); } } } From a5f65eb57cd18d11887c338ed19eafee7d53ca62 Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Mon, 13 Apr 2026 13:30:00 +0200 Subject: [PATCH 245/282] [PWGLF] dN/deat fixes (#15730) --- PWGLF/DataModel/LFNonPromptCascadeTables.h | 22 +++++------ PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 41 +++++++++++++------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index da4a1495602..4d3d16f07f6 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -195,7 +195,7 @@ DECLARE_SOA_TABLE(NPCascTable, "AOD", "NPCASCTABLE", NPCascadeTable::CentFT0M, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::ToiMask, - NPCascadeTable::NoSameBunchPileup) + NPCascadeTable::NoSameBunchPileup); DECLARE_SOA_TABLE(NPCascTableNT, "AOD", "NPCASCTABLENT", NPCascadeTable::RunNumber, @@ -263,7 +263,7 @@ DECLARE_SOA_TABLE(NPCascTableNT, "AOD", "NPCASCTABLENT", NPCascadeTable::CentFT0M, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::ToiMask, - NPCascadeTable::NoSameBunchPileup) + NPCascadeTable::NoSameBunchPileup); DECLARE_SOA_TABLE(NPCascTableMC, "AOD", "NPCASCTABLEMC", NPCascadeTable::RunNumber, @@ -350,7 +350,7 @@ DECLARE_SOA_TABLE(NPCascTableMC, "AOD", "NPCASCTABLEMC", NPCascadeTable::MotherDecayDaughters, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::ToiMask, - NPCascadeTable::NoSameBunchPileup) + NPCascadeTable::NoSameBunchPileup); DECLARE_SOA_TABLE(NPCascTableMCNT, "AOD", "NPCASCTABLEMCNT", NPCascadeTable::RunNumber, @@ -437,7 +437,7 @@ DECLARE_SOA_TABLE(NPCascTableMCNT, "AOD", "NPCASCTABLEMCNT", NPCascadeTable::MotherDecayDaughters, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::ToiMask, - NPCascadeTable::NoSameBunchPileup) + NPCascadeTable::NoSameBunchPileup); DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::gPt, NPCascadeTable::gEta, @@ -449,7 +449,12 @@ DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::DCAzMC, NPCascadeTable::IsFromBeauty, NPCascadeTable::IsFromCharm, - NPCascadeTable::MotherDecayDaughters) + NPCascadeTable::MotherDecayDaughters); +DECLARE_SOA_TABLE(NPMCChargedTable, "AOD", "NPMCChargedTABLE", + NPCascadeTable::PtGen, + NPCascadeTable::PtRec, + NPCascadeTable::MultNTracksGlobal, + NPCascadeTable::MultGen); DECLARE_SOA_TABLE(NPCollisionTable, "AOD", "NPCollisionTABLE", NPCascadeTable::RunNumber, NPCascadeTable::GlobalBC, @@ -457,13 +462,8 @@ DECLARE_SOA_TABLE(NPCollisionTable, "AOD", "NPCollisionTABLE", NPCascadeTable::MultNTracksGlobal, NPCascadeTable::CentFT0M, NPCascadeTable::MultFT0M); -DECLARE_SOA_TABLE(NPMCChargedTable, "AOD", "NPMCChargedTABLE", - NPCascadeTable::PtGen, - NPCascadeTable::PtRec, - NPCascadeTable::MultNTracksGlobal, - NPCascadeTable::MultGen); DECLARE_SOA_INDEX_COLUMN_FULL(NPCollision, npCollision, int32_t, NPCollisionTable, ""); -DECLARE_SOA_TABLE(NPRecoChargedCandidate, "AOD", "NPRecoChargedCandidate", +DECLARE_SOA_TABLE(NPRecoChargedCand, "AOD", "NPRecoChargedCand", NPCollisionId, NPCascadeTable::PtRec); } // namespace o2::aod diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 2085067c176..4b828a18bd3 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -185,7 +185,7 @@ struct NonPromptCascadeTask { // Produces NPCollsTable; Produces NPMCNTable; - Produces NPRecoCandTable; + Produces NPRecoCandTable; using TracksExtData = soa::Join; using TracksExtMC = soa::Join; @@ -196,6 +196,7 @@ struct NonPromptCascadeTask { Preslice perCollision = aod::track::collisionId; Preslice perCollisionMC = aod::track::collisionId; + Preslice perCollisionSel = aod::track::collisionId; HistogramRegistry mRegistry; @@ -222,6 +223,7 @@ struct NonPromptCascadeTask { Configurable cfgMaxMultFV0{"cfgMaxMultFV0", 10000.f, "Upper range of multiplicty FV0 histo"}; Configurable cfgPtEdgesdNdeta{"ptEdges", "0,0.2,0.4,0.6,0.8,1,1.2,1.6,2.0,2.4,2.8,3.2,3.6,4,4.5,5,5.5,6,7,8,10", "Pt bin edges (comma-separated)"}; Configurable cfgDownscaleMB{"cfgDownscaleMB", 1, "Downscaling for pile up study sample"}; + Configurable cfgEtaCutdNdeta{"cfgEtaCutdNdeta", 0.8, "Eta cut for charged tracks"}; Zorro mZorro; OutputObj mZorroSummary{"ZorroSummary"}; @@ -331,8 +333,9 @@ struct NonPromptCascadeTask { // dN/deta // bool runMCdNdeta = context.options().get("processdNdetaMC"); + bool rundNdeta = context.options().get("processdNdeta"); // std::cout << "runMCdNdeta: " << runMCdNdeta << std::endl; - if (runMCdNdeta) { + if (runMCdNdeta || rundNdeta) { std::vector ptBins; std::vector tokens = o2::utils::Str::tokenize(cfgPtEdgesdNdeta, ','); for (auto const& pts : tokens) { @@ -344,13 +347,14 @@ struct NonPromptCascadeTask { } ptBins.push_back(pt); } - AxisSpec ptAxisMC{ptBins, "pT MC"}; AxisSpec ptAxisReco{ptBins, "pT Reco"}; + AxisSpec ptAxisMC{ptBins, "pT MC"}; // multMeasured, multMC, ptMeasured, ptMC mRegistrydNdeta.add("hdNdetaRM/hdNdetaRM", "hdNdetaRM", HistType::kTHnSparseF, {nTracksAxisMC, nTracksAxis, ptAxisMC, ptAxisReco}); mRegistrydNdeta.add("hdNdetaRM/hdNdetaRMNotInRecoCol", "hdNdetaRMNotInRecoCol", HistType::kTHnSparseF, {nTracksAxisMC, ptAxisMC}); mRegistrydNdeta.add("hdNdetaRM/hdNdetaRMNotInRecoTrk", "hdNdetaRMNotInRecoTrk", HistType::kTHnSparseF, {nTracksAxisMC, ptAxisMC}); + mRegistrydNdeta.add("hdNdetaData", "hdNdetaData", HistType::kTH1F, {nTracksAxis}); } } @@ -810,6 +814,10 @@ struct NonPromptCascadeTask { aod::McParticles const& mcParticles, TracksWithLabel const& tracks) { + //------------------------------------------------------------ + // Downscaling output table by BC as there is no pileup in MC + //------------------------------------------------------------ + int ds = 1; //------------------------------------------------------------- // MC mult for all MC coll //-------------------------------------------------------------- @@ -822,7 +830,7 @@ struct NonPromptCascadeTask { // apply your primary/eta/charge definition here if (!mcp.isPhysicalPrimary()) continue; - if (std::abs(mcp.eta()) > 0.5f) + if (std::abs(mcp.eta()) > cfgEtaCutdNdeta) continue; int q = 0; if (auto pdg = pdgDB->GetParticle(mcp.pdgCode())) { @@ -859,7 +867,7 @@ struct NonPromptCascadeTask { // ------------------------------------------------------------ std::vector recoMultDense(colls.size(), 0); for (auto const& trk : tracks) { - if (std::abs(trk.eta()) > 0.5f) { + if (std::abs(trk.eta()) > cfgEtaCutdNdeta) { continue; } const int collRowId = trk.collisionId(); @@ -887,7 +895,7 @@ struct NonPromptCascadeTask { // ------------------------------------------------------------ for (auto const& trk : tracks) { // Accept reco track - if (std::abs(trk.eta()) > 0.5f) { + if (std::abs(trk.eta()) > cfgEtaCutdNdeta) { continue; } @@ -931,7 +939,7 @@ struct NonPromptCascadeTask { if (!mcPar.isPhysicalPrimary()) { continue; } - if (std::abs(mcPar.eta()) > 0.5f) { + if (std::abs(mcPar.eta()) > cfgEtaCutdNdeta) { continue; } @@ -952,7 +960,10 @@ struct NonPromptCascadeTask { const float ptMC = mcPar.pt(); mRegistrydNdeta.fill(HIST("hdNdetaRM/hdNdetaRM"), mult, multReco, ptMC, ptReco); - NPMCNTable(ptMC, ptReco, mult, multReco); + if (ds % cfgDownscaleMB == 0) { + NPMCNTable(ptMC, ptReco, mult, multReco); + } + ds++; } // ------------------------------------------------------------ @@ -983,7 +994,7 @@ struct NonPromptCascadeTask { PROCESS_SWITCH(NonPromptCascadeTask, processdNdetaMC, "process mc dN/deta", false); // - void processdNdeta(CollisionCandidatesRun3 const& collisions, TracksWithSel const& tracks) + void processdNdeta(CollisionCandidatesRun3 const& collisions, TracksWithSel const& tracks, aod::BCsWithTimestamps const&) { int ds = 1; uint32_t orbitO = 0; @@ -1006,22 +1017,26 @@ struct NonPromptCascadeTask { mRunNumber = bc.runNumber(); } NPCollsTable(mRunNumber, - coll.bc().globalBC(), + globalBC, coll.numContrib(), coll.multNTracksGlobal(), coll.centFT0M(), coll.multFT0M()); auto collIdx = NPCollsTable.lastIndex(); - auto tracksThisColl = tracks.sliceBy(perCollision, coll.globalIndex()); + auto tracksThisColl = tracks.sliceBy(perCollisionSel, coll.globalIndex()); + float multreco = 0.; + // std::cout << "tracks:" << tracksThisColl.size() << std::endl; for (auto const& track : tracksThisColl) { - if (std::fabs(track.eta()) < 0.8 && track.tpcNClsFound() >= 80 && track.tpcNClsCrossedRows() >= 100) { + // std::cout << track.pt() << " tracks " << track.isGlobalTrack() << std::endl; + if (std::fabs(track.eta()) < cfgEtaCutdNdeta && track.tpcNClsFound() >= 80 && track.tpcNClsCrossedRows() >= 100) { if (track.isGlobalTrack()) { - // mults.multGlobalTracks++; + multreco++; NPRecoCandTable(collIdx, track.pt()); } } } + mRegistrydNdeta.fill(HIST("hdNdetaData"), multreco); } } } From b59bb79ad78577d3dce612fe40003abb5b29bf21 Mon Sep 17 00:00:00 2001 From: Maxim Virta <84773378+MaximVirta@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:05:25 +0200 Subject: [PATCH 246/282] [PWGCF] Removed potential memory leaks (#15743) Co-authored-by: Maxim Virta --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 45 +++++++++++---------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index b921074a4f8..35931370294 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -244,22 +244,22 @@ struct FlowGfwV02 { std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; - TH1D* hPtMid[4] = {nullptr, nullptr, nullptr, nullptr}; + std::array, 4> hPtMid{}; }; PIDState pidStates; // Event selection cuts - Alex - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultPVGlobalCutHigh = nullptr; - TF1* fMultGlobalV0ACutLow = nullptr; - TF1* fMultGlobalV0ACutHigh = nullptr; - TF1* fMultGlobalT0ACutLow = nullptr; - TF1* fMultGlobalT0ACutHigh = nullptr; - - TF1* fPtDepDCAxy = nullptr; + std::unique_ptr fMultPVCutLow; + std::unique_ptr fMultPVCutHigh; + std::unique_ptr fMultCutLow; + std::unique_ptr fMultCutHigh; + std::unique_ptr fMultPVGlobalCutHigh; + std::unique_ptr fMultGlobalV0ACutLow; + std::unique_ptr fMultGlobalV0ACutHigh; + std::unique_ptr fMultGlobalT0ACutLow; + std::unique_ptr fMultGlobalT0ACutHigh; + + std::unique_ptr fPtDepDCAxy; using GFWTracks = soa::Filtered>; @@ -361,10 +361,10 @@ struct FlowGfwV02 { o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars; // Initialise pt spectra histograms for different particles - pidStates.hPtMid[PidCharged] = new TH1D("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidPions] = new TH1D("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidKaons] = new TH1D("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidProtons] = new TH1D("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidCharged] = std::make_unique("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidPions] = std::make_unique("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidKaons] = std::make_unique("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidProtons] = std::make_unique("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); pidStates.hPtMid[PidCharged]->SetDirectory(nullptr); pidStates.hPtMid[PidPions]->SetDirectory(nullptr); pidStates.hPtMid[PidKaons]->SetDirectory(nullptr); @@ -466,6 +466,7 @@ struct FlowGfwV02 { LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable"); fGFW->CreateRegions(); TObjArray* oba = new TObjArray(); + oba->SetOwner(kTRUE); addConfigObjectsToObjArray(oba, corrconfigs); LOGF(info, "Number of correlators: %d", oba->GetEntries()); fFC->SetName("FlowContainer"); @@ -501,19 +502,19 @@ struct FlowGfwV02 { } if (cfgUseAdditionalEventCut) { - fMultPVCutLow = new TF1("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultPVCutLow = std::make_unique("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); fMultPVCutLow->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); - fMultPVCutHigh = new TF1("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultPVCutHigh = std::make_unique("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); fMultPVCutHigh->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); - fMultCutLow = new TF1("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultCutLow = std::make_unique("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); fMultCutLow->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); - fMultCutHigh = new TF1("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultCutHigh = std::make_unique("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); fMultCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); - fMultPVGlobalCutHigh = new TF1("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); + fMultPVGlobalCutHigh = std::make_unique("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); fMultPVGlobalCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalPVCorrCutPars[0])); } // Set DCAxy cut - fPtDepDCAxy = new TF1("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); + fPtDepDCAxy = std::make_unique("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); fPtDepDCAxy->SetParameter(0, cfgTrackCuts.cfgDCAxyNSigma); } From e2474d7e00ce729e97e0b8258fea8b90f050dcae Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:05:47 +0200 Subject: [PATCH 247/282] [PWGCF] add subevent pt-pt, eta-cut on daughter particles (#15742) --- .../Tasks/flowGenericFramework.cxx | 57 ++++++++++++++++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index e43730e8212..0e2e5f9e069 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -91,6 +91,7 @@ GFWRegions regions; GFWCorrConfigs configs; GFWCorrConfigs configsV02; GFWCorrConfigs configsV0; +std::vector> etagapsPtPt; std::vector multGlobalCorrCutPars; std::vector multPVCorrCutPars; std::vector multGlobalPVCorrCutPars; @@ -122,6 +123,7 @@ auto readMatrix(Array2D const& mat, P& array) static constexpr float LongArrayFloat[3][20] = {{1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {2.1, 2.2, 2.3, -2.1, -2.2, -2.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {3.1, 3.2, 3.3, -3.1, -3.2, -3.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}}; static constexpr int LongArrayInt[3][20] = {{1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}, {2, 2, 2, -2, -2, -2, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}, {3, 3, 3, -3, -3, -3, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}}; +static constexpr double LongArrayDouble[4][2] = {{-0.8, -0.5}, {0.5, 0.8}, {-2, -2}, {-2, -2}}; struct FlowGenericFramework { @@ -145,6 +147,8 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgEta, float, 0.8, "eta cut"); O2_DEFINE_CONFIGURABLE(cfgEtaPtPt, float, 0.4, "eta cut for pt-pt correlations"); O2_DEFINE_CONFIGURABLE(cfgEtaNch, float, 0.4, "eta cut for nch selection"); + O2_DEFINE_CONFIGURABLE(cfgEtaV0Daughters, float, 0.5, "eta cut on V0 daughter particles"); + Configurable> cfgPtPtGaps{"cfgPtPtGaps", {LongArrayDouble[0], 4, 2, {"subevent 1", "subevent 2", "subevent 3", "subevent 4"}, {"etamin", "etamax"}}, "{etamin,etamax} for all ptpt-subevents"}; O2_DEFINE_CONFIGURABLE(cfgUsePIDTotal, bool, false, "use fraction of PID total"); O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10, "vertex cut (cm)"); struct : ConfigurableGroup { @@ -360,7 +364,7 @@ struct FlowGenericFramework { kUseV0Radius }; enum V0Selection { - kFillCandidate = 0, + kFillCandidate = 1, kFillDaughterPt, kFillMassCut, kFillRapidityCut, @@ -469,6 +473,16 @@ struct FlowGenericFramework { readMatrix(cfgPIDCuts.resonanceSwitches->getData(), resoSwitchVals); printResoCuts(); + for (int i = 0; i < 4; ++i) { // o2-linter: disable=magic-number (maximum of 4 subevents) + if (cfgPtPtGaps->getData()[i][0] < -1. || cfgPtPtGaps->getData()[i][1] < -1.) + continue; + o2::analysis::gfw::etagapsPtPt.push_back(std::make_pair(cfgPtPtGaps->getData()[i][0], cfgPtPtGaps->getData()[i][1])); + } + + for (const auto& [etamin, etamax] : o2::analysis::gfw::etagapsPtPt) { + LOGF(info, "pt-pt subevent: {%.1f,%.1f}", etamin, etamax); + } + AxisSpec phiAxis = {o2::analysis::gfw::phibins, o2::analysis::gfw::philow, o2::analysis::gfw::phiup, "#phi"}; AxisSpec phiModAxis = {100, 0, constants::math::PI / 9, "fmod(#varphi,#pi/9)"}; AxisSpec etaAxis = {o2::analysis::gfw::etabins, -cfgEta, cfgEta, "#eta"}; @@ -681,6 +695,7 @@ struct FlowGenericFramework { fFCpt->setUseCentralMoments(cfgUseCentralMoments); fFCpt->setUseGapMethod(cfgUseGapMethod); fFCpt->initialise(multAxis, cfgMpar, o2::analysis::gfw::configs, cfgNbootstrap); + fFCpt->initialiseSubevent(multAxis, cfgMpar, o2::analysis::gfw::etagapsPtPt.size(), cfgNbootstrap); // Multiplicity correlation cuts if (cfgMultCut) { @@ -1229,8 +1244,11 @@ struct FlowGenericFramework { void fillOutputContainers(const float& centmult, const double& rndm, AcceptedTracks acceptedtracks) { fFCpt->calculateCorrelations(); + fFCpt->calculateSubeventCorrelations(); fFCpt->fillPtProfiles(centmult, rndm); + fFCpt->fillSubeventPtProfiles(centmult, rndm); fFCpt->fillCMProfiles(centmult, rndm); + fFCpt->fillCMSubeventProfiles(centmult, rndm); if (!cfgUseGapMethod) fFCpt->fillVnPtStdProfiles(centmult, rndm); @@ -1307,10 +1325,14 @@ struct FlowGenericFramework { if (corrconfigsV0.size() < SPECIESCOUNT) return; - if (fFCpt->corrDen[0] == 0.) + if (fFCpt->corrDenSub[0][1] == 0. || fFCpt->corrDenSub[1][1] == 0.) + return; + double mpt_sub1 = fFCpt->corrNumSub[0][1] / fFCpt->corrDenSub[0][1]; + double mpt_sub2 = fFCpt->corrNumSub[1][1] / fFCpt->corrDenSub[1][1]; + double mpt = 0.5 * (mpt_sub1 + mpt_sub2); + if (std::isnan(mpt)) return; for (uint l_ind = 0; l_ind < SPECIESCOUNT; ++l_ind) { - double mpt = fFCpt->corrNum[1] / fFCpt->corrDen[1]; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm); } @@ -1473,11 +1495,17 @@ struct FlowGenericFramework { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); } } + + if (fFCpt->corrDenSub[0][1] == 0. || fFCpt->corrDenSub[1][1] == 0.) + return; + + double mpt_sub1 = fFCpt->corrNumSub[0][1] / fFCpt->corrDenSub[0][1]; + double mpt_sub2 = fFCpt->corrNumSub[1][1] / fFCpt->corrDenSub[1][1]; + double mpt = 0.5 * (mpt_sub1 + mpt_sub2); + if (std::isnan(mpt)) + return; + for (uint l_ind = 4; l_ind < corrconfigsV0.size(); ++l_ind) { - double dn = fFCpt->corrDen[1]; - if (dn == 0.) - continue; - double mpt = fFCpt->corrNum[1] / dn; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom); } @@ -1685,6 +1713,10 @@ struct FlowGenericFramework { return false; } + // Eta cuts on daughter particles to remove self-correlations with correlated observables + if (std::abs(track.eta()) > cfgEtaV0Daughters) + return false; + return true; } @@ -1864,8 +1896,19 @@ struct FlowGenericFramework { double weff = (dt == kGen) ? 1. : getEfficiency(track); if (weff < 0) return; + + // Fill the nominal sums if (std::abs(track.eta()) < cfgEtaPtPt) fFCpt->fill(weff, track.pt()); + + // Fill the subevent sums + std::size_t index = 0; + for (const auto& [etamin, etamax] : o2::analysis::gfw::etagapsPtPt) { + if (etamin < track.eta() && track.eta() < etamax) { + fFCpt->fillSub(weff, track.pt(), index); + } + ++index; + } if (!cfgUseGapMethod) { std::complex q2p = {weff * wacc * std::cos(2 * track.phi()), weff * wacc * std::sin(2 * track.phi())}; std::complex q2n = {weff * wacc * std::cos(-2 * track.phi()), weff * wacc * std::sin(-2 * track.phi())}; From c6348353d8598bf5aba27a84e7351df488c49fba Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:06:17 +0200 Subject: [PATCH 248/282] [PWGCF] Update flowEventPlane.cxx task (#15731) --- PWGCF/Flow/Tasks/flowEventPlane.cxx | 131 +++++++++++++++++----------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowEventPlane.cxx b/PWGCF/Flow/Tasks/flowEventPlane.cxx index 510ba5c5b89..73d8d84904e 100644 --- a/PWGCF/Flow/Tasks/flowEventPlane.cxx +++ b/PWGCF/Flow/Tasks/flowEventPlane.cxx @@ -355,17 +355,70 @@ struct SpectatorPlaneTableProducer { return true; } - void gainCalib(bool const& loadGainCalib, float const& vz, std::array& eA, std::array& eC) + // Load Gain Calibrations and ZDC Q-Vector Recentering Corrections + void loadCorrections() { - // Store gain calibration histograms per run number - if (loadGainCalib) { + // Load ZDC gain calibration + if (cDoGainCalib) { std::string ccdbPath = static_cast(cCcdbPath) + "/GainCalib" + "/Run" + std::to_string(cRunNum); auto ccdbObj = ccdbService->getForTimeStamp(ccdbPath, -1); CorrectionHistContainer.hGainCalib[0] = reinterpret_cast(ccdbObj->FindObject("hZNASignal")); CorrectionHistContainer.hGainCalib[1] = reinterpret_cast(ccdbObj->FindObject("hZNCSignal")); } - // Apply gain calibration + // Load shift corrections for ZDC Q-Vectors + if (cApplyRecentCorr) { + std::vector vCorrFlags = static_cast>(cCorrFlagVector); + int nitr = vCorrFlags.size(); + CorrectionType corrType = kFineCorr; + + for (int i = 0; i < nitr; ++i) { + // Skip correction if corrFlag != 1 + if (vCorrFlags[i] != 1) { + continue; + } + + // Set correction type + if (i % kNCorr == 0) { + corrType = kCoarseCorr; + } else { + corrType = kFineCorr; + } + + // Set ccdb path + std::string ccdbPath = static_cast(cCcdbPath) + "/CorrItr_" + std::to_string(i + 1) + "/Run" + std::to_string(cRunNum); + + // Get object from CCDB + auto ccdbObject = ccdbService->getForTimeStamp(ccdbPath, -1); + + // Check CCDB Object + if (!ccdbObject) { + LOGF(warning, "CCDB OBJECT NOT FOUND"); + return; + } + + // Store histograms in Hist Container + std::vector> vHistNames = corrTypeHistNameMap.at(corrType); + int cntrx = 0; + for (auto const& x : vHistNames) { + int cntry = 0; + for (auto const& y : x) { + if (corrType == kFineCorr) { + CorrectionHistContainer.vFineCorrHist[i][cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); + } else { + CorrectionHistContainer.vCoarseCorrHist[i][cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); + } + ++cntry; + } + ++cntrx; + } + } + } + } + + // Apply gain calibrations + void gainCalib(float const& vz, std::array& eA, std::array& eC) + { float vA = 0., vC = 0.; for (int i = 0; i < static_cast(eA.size()); ++i) { vA = CorrectionHistContainer.hGainCalib[0]->GetBinContent(CorrectionHistContainer.hGainCalib[0]->FindBin(i + 0.5, vz + 0.00001)); @@ -406,12 +459,11 @@ struct SpectatorPlaneTableProducer { return vAvgOutput; } - void applyCorrection(bool const& loadShiftCorr, std::array const& inputParam, std::array& outputParam) + void applyCorrection(std::array const& inputParam, std::array& outputParam) { std::vector vCorrFlags = static_cast>(cCorrFlagVector); int nitr = vCorrFlags.size(); CorrectionType corrType = kFineCorr; - std::string ccdbPath; // Correction iterations for (int i = 0; i < nitr; ++i) { @@ -427,37 +479,6 @@ struct SpectatorPlaneTableProducer { corrType = kFineCorr; } - // Check current and last run number, fetch ccdb object and store corrections in container - if (loadShiftCorr) { - // Set ccdb path - ccdbPath = static_cast(cCcdbPath) + "/CorrItr_" + std::to_string(i + 1) + "/Run" + std::to_string(cRunNum); - - // Get object from CCDB - auto ccdbObject = ccdbService->getForTimeStamp(ccdbPath, -1); - - // Check CCDB Object - if (!ccdbObject) { - LOGF(warning, "CCDB OBJECT NOT FOUND"); - return; - } - - // Store histograms in Hist Container - std::vector> vHistNames = corrTypeHistNameMap.at(corrType); - int cntrx = 0; - for (auto const& x : vHistNames) { - int cntry = 0; - for (auto const& y : x) { - if (corrType == kFineCorr) { - CorrectionHistContainer.vFineCorrHist[i][cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); - } else { - CorrectionHistContainer.vCoarseCorrHist[i][cntrx][cntry] = reinterpret_cast(ccdbObject->FindObject(y.c_str())); - } - ++cntry; - } - ++cntrx; - } - } - // Get averages std::vector vAvg = getAvgCorrFactors(i, corrType, inputParam); @@ -497,8 +518,8 @@ struct SpectatorPlaneTableProducer { histos.fill(HIST("CorrHist/hYZNCVsVz"), vCollParam[kVz], vSP[kYc]); } - template - bool analyzeCollision(C const& collision, std::array& vSP) + template + bool analyzeCollision(B const& bc, C const& collision, std::array& vSP) { // Event selection if (!selCollision(collision)) { @@ -515,17 +536,6 @@ struct SpectatorPlaneTableProducer { histos.fill(HIST("Event/hVy"), posY); histos.fill(HIST("Event/hVz"), posZ); - // Get bunch crossing - auto bc = collision.template foundBC_as(); - cRunNum = collision.template foundBC_as().runNumber(); - - // Load calibration flags - bool loadGainCalib = false, loadShiftCorr = false; - if (cRunNum != lRunNum) { - loadGainCalib = true; - loadShiftCorr = true; - } - // check zdc if (!bc.has_zdc()) { return false; @@ -552,7 +562,7 @@ struct SpectatorPlaneTableProducer { // Do gain calibration if (cDoGainCalib) { - gainCalib(loadGainCalib, vCollParam[kVz], znaEnergy, zncEnergy); + gainCalib(vCollParam[kVz], znaEnergy, zncEnergy); } // Fill zdc signal @@ -599,7 +609,7 @@ struct SpectatorPlaneTableProducer { // Do corrections if (cApplyRecentCorr) { - applyCorrection(loadShiftCorr, vCollParam, vSP); + applyCorrection(vCollParam, vSP); } // Fill X and Y histograms for corrections after each iteration @@ -675,9 +685,17 @@ struct SpectatorPlaneTableProducer { void processSpectatorPlane(CollisionsRun3::iterator const& collision, BCsRun3 const&, aod::Zdcs const&) { + // Get bunch crossing + auto bc = collision.template foundBC_as(); + cRunNum = collision.template foundBC_as().runNumber(); + + if (lRunNum != cRunNum) { + loadCorrections(); + } + // Analyze collision and get Spectator Plane Vector std::array vSP = {0., 0., 0., 0.}; - bool colSPExtFlag = analyzeCollision(collision, vSP); + bool colSPExtFlag = analyzeCollision(bc, collision, vSP); // Update run number lRunNum = cRunNum; @@ -870,6 +888,7 @@ struct FlowEventPlane { histos.add("V0/Lambda/Flow/hQuA", "hQuA", kTProfile3D, {axisCent, axisTrackRap, axisLambdaInvMass}); histos.add("V0/Lambda/Flow/hQuC", "hQuC", kTProfile3D, {axisCent, axisTrackRap, axisLambdaInvMass}); histos.addClone("V0/Lambda/", "V0/AntiLambda/"); + histos.addClone("V0/Lambda/", "V0/LambdaAntiLambda/"); histos.add("V0/K0Short/hMassVsRap", "hMassVsRap", kTH3F, {axisCent, axisK0ShortInvMass, axisTrackEta}); histos.add("V0/K0Short/Flow/hQuA", "hQuA", kTProfile3D, {axisCent, axisTrackRap, axisK0ShortInvMass}); histos.add("V0/K0Short/Flow/hQuC", "hQuC", kTProfile3D, {axisCent, axisTrackRap, axisK0ShortInvMass}); @@ -1208,6 +1227,9 @@ struct FlowEventPlane { histos.fill(HIST("V0/Lambda/hMassVsRap"), cent, v0.mLambda(), v0.eta()); histos.fill(HIST("V0/Lambda/Flow/hQuA"), cent, v0.eta(), v0.mLambda(), v1a); histos.fill(HIST("V0/Lambda/Flow/hQuC"), cent, v0.eta(), v0.mLambda(), v1c); + histos.fill(HIST("V0/LambdaAntiLambda/hMassVsRap"), cent, v0.mLambda(), v0.eta()); + histos.fill(HIST("V0/LambdaAntiLambda/Flow/hQuA"), cent, v0.eta(), v0.mLambda(), v1a); + histos.fill(HIST("V0/LambdaAntiLambda/Flow/hQuC"), cent, v0.eta(), v0.mLambda(), v1c); } // AntiLambda @@ -1216,6 +1238,9 @@ struct FlowEventPlane { histos.fill(HIST("V0/AntiLambda/hMassVsRap"), cent, v0.mAntiLambda(), v0.eta()); histos.fill(HIST("V0/AntiLambda/Flow/hQuA"), cent, v0.eta(), v0.mAntiLambda(), v1a); histos.fill(HIST("V0/AntiLambda/Flow/hQuC"), cent, v0.eta(), v0.mAntiLambda(), v1c); + histos.fill(HIST("V0/LambdaAntiLambda/hMassVsRap"), cent, v0.mAntiLambda(), v0.eta()); + histos.fill(HIST("V0/LambdaAntiLambda/Flow/hQuA"), cent, v0.eta(), v0.mAntiLambda(), v1a); + histos.fill(HIST("V0/LambdaAntiLambda/Flow/hQuC"), cent, v0.eta(), v0.mAntiLambda(), v1c); } } } From 43c495cba6b8e1ac4bf42428cfa69a21ab324895 Mon Sep 17 00:00:00 2001 From: MattOckleton <149105337+MattOckleton@users.noreply.github.com> Date: Mon, 13 Apr 2026 14:34:22 +0100 Subject: [PATCH 249/282] [PWGJE] column name fixes jetCorrelationD0 (#15744) --- PWGJE/Tasks/jetCorrelationD0.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index bba4f0273aa..31b3bfcb944 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -81,7 +81,7 @@ DECLARE_SOA_COLUMN(D0PhiD, d0PhiD, float); DECLARE_SOA_COLUMN(D0Reflection, d0Reflection, int); } // namespace d0Info -DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0TABLE", +DECLARE_SOA_TABLE(D0Tables, "AOD", "D0TABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, d0Info::D0PromptBDT, @@ -105,7 +105,7 @@ DECLARE_SOA_TABLE(D0McPTables, "AOD", "D0MCPTABLE", namespace jetInfo { // D0 tables -DECLARE_SOA_INDEX_COLUMN(D0DataTable, d0DataTable); +DECLARE_SOA_INDEX_COLUMN(D0Table, d0Table); DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0McPTable); // Jet DECLARE_SOA_COLUMN(JetPt, jetPt, float); @@ -119,10 +119,10 @@ DECLARE_SOA_COLUMN(D0JetDeltaPhi, d0JetDeltaPhi, float); DECLARE_SOA_COLUMN(D0JetDeltaPhiP, d0JetDeltaPhiP, float); } // namespace jetInfo -DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETTABLE", +DECLARE_SOA_TABLE_STAGED(JetTables, "JETTABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, - jetInfo::D0DataTableId, + jetInfo::D0TableId, jetInfo::JetPt, jetInfo::JetEta, jetInfo::JetPhi, @@ -156,9 +156,9 @@ struct JetCorrelationD0 { Produces tableCollision; Produces tableMatchedCollision; Produces tableMcCollision; - Produces tableD0; + Produces tableD0; Produces tableD0McParticle; - Produces tableJet; + Produces tableJet; Produces tableJetMcParticle; Produces tableJetMatched; From e8e9d78dde1ce7b1faa66e2e18976dcaeb5c5cc7 Mon Sep 17 00:00:00 2001 From: Rrantu <156880782+Rrantu@users.noreply.github.com> Date: Mon, 13 Apr 2026 17:25:54 +0200 Subject: [PATCH 250/282] [PWGHF] Add filter to only fill Xic0 MC candidates in the tree (#15745) --- PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index e1e8a27e38e..d4ab4225cdb 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -38,6 +38,7 @@ using namespace o2; using namespace o2::framework; +using namespace o2::framework::expressions; namespace o2::aod { @@ -145,7 +146,9 @@ struct HfTreeCreatorXic0ToXiPiKf { using MyEventTableWithFT0C = soa::Join; using MyEventTableWithFT0M = soa::Join; using MyEventTableWithNTracksPV = soa::Join; + using MyMcCandidates = soa::Filtered>; + Filter mcFilter = (aod::hf_cand_mc_flag::originMcRec == static_cast(RecoDecay::OriginType::NonPrompt)) || (aod::hf_cand_mc_flag::originMcRec == static_cast(RecoDecay::OriginType::Prompt)); HistogramRegistry registry{"registry"}; // for QA of selections void init(InitContext const&) @@ -276,7 +279,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); void processKfMcXic0(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -286,7 +289,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); void processKfMCWithFT0C(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -296,7 +299,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); void processKfMCWithFT0M(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -306,7 +309,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); void processMCLiteWithNTracksPV(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { From 502692c5702939c59eea98eef119119db27a6797 Mon Sep 17 00:00:00 2001 From: aferrero2707 Date: Mon, 13 Apr 2026 18:21:17 +0200 Subject: [PATCH 251/282] [PWGDQ] added comparison of MFT and MCH tracks at reference planes (#15700) --- PWGDQ/Tasks/muonGlobalAlignment.cxx | 251 +++++++++++++++++++--------- 1 file changed, 170 insertions(+), 81 deletions(-) diff --git a/PWGDQ/Tasks/muonGlobalAlignment.cxx b/PWGDQ/Tasks/muonGlobalAlignment.cxx index 968bb3842a3..7ba8a128625 100644 --- a/PWGDQ/Tasks/muonGlobalAlignment.cxx +++ b/PWGDQ/Tasks/muonGlobalAlignment.cxx @@ -58,11 +58,11 @@ #include #include +#include "rapidjson/document.h" + #include #include -#include "rapidjson/document.h" - #include #include #include @@ -177,6 +177,10 @@ struct muonGlobalAlignment { Configurable fEnableGlobalFwdDcaAnalysis{"cfgEnableGlobalFwdDcaAnalysis", true, "Enable the analysis of DCA-based MFT alignment using global forward tracks"}; Configurable fEnableMftMchResidualsAnalysis{"cfgEnableMftMchResidualsAnalysis", true, "Enable the analysis of residuals between MFT tracks and MCH clusters"}; Configurable fEnableMftMchResidualsExtraPlots{"cfgEnableMftMchResidualsExtraPlots", false, "Enable additional plots for the analysis of residuals between MFT tracks and MCH clusters"}; + Configurable fEnableMftMchMatchingAnalysis{"cfgEnableMftMchMatchingAnalysis", false, "Enable the analysis of residuals between MFT and MCH tracks at reference planes"}; + + Configurable fRefPlaneZMFT{"cfgRefPlaneZMFT", o2::mft::constants::mft::LayerZCoordinate()[0], "Reference plane on MFT side"}; + Configurable fRefPlaneZMCH{"cfgRefPlaneZMCH", -526.0, "Reference plane on MCH side"}; int mRunNumber{0}; // needed to detect if the run changed and trigger update of magnetic field @@ -536,6 +540,19 @@ struct muonGlobalAlignment { registry.add("residuals/dy_vs_de_corr", "Cluster y residual vs. DE, quadrant, chargeSign, momentum (with corrections)", {HistType::kTHnSparseF, {dyAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("residuals/de_alignment_corrections_x", "DE alignment corrections - X coordinate", + {HistType::kTH1F, {{getNumDE(), 0, static_cast(getNumDE()), "DE"}}}); + registry.add("residuals/de_alignment_corrections_y", "DE alignment corrections - Y coordinate", + {HistType::kTH1F, {{getNumDE(), 0, static_cast(getNumDE()), "DE"}}}); + + for (const auto& [deId, corr] : mMchAlignmentCorrections) { + auto deIndex = getDEindex(deId); + registry.get(HIST("residuals/de_alignment_corrections_x"))->SetBinContent(deIndex + 1, corr.x); + registry.get(HIST("residuals/de_alignment_corrections_x"))->SetBinError(deIndex + 1, 0.1); + registry.get(HIST("residuals/de_alignment_corrections_y"))->SetBinContent(deIndex + 1, corr.y); + registry.get(HIST("residuals/de_alignment_corrections_y"))->SetBinError(deIndex + 1, 0.1); + } + if (fEnableMftMchResidualsExtraPlots) { registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_vz", std::format("DCA(x) vs. vz, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {dcazAxis, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_vz", std::format("DCA(y) vs. vz, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {dcazAxis, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); @@ -544,6 +561,38 @@ struct muonGlobalAlignment { {HistType::kTHnSparseF, {{200, -0.2f, 0.2f, "#Delta#phi"}, {80, -10.f, 10.f, "track_x (cm)"}, {80, -10.f, 10.f, "track_y (cm)"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); } } + + if (fEnableMftMchMatchingAnalysis) { + AxisSpec dxAxis = {200, -10.0, 10.0, "#Deltax (cm)"}; + AxisSpec dyAxis = {200, -10.0, 10.0, "#Deltay (cm)"}; + AxisSpec dsxAxis = {200, -0.1, 0.1, "#Deltaslope(x) (rad)"}; + AxisSpec dsyAxis = {200, -0.1, 0.1, "#Deltaslope(y) (rad)"}; + AxisSpec dphiAxis = {200, -1.0, 1.0, "#Delta#phi (rad)"}; + + // MFT plane + registry.add("matching/dxAtMFT", "Tracks #Deltax at MFT reference plane", + {HistType::kTHnSparseF, {dxAxis, {20, -15.0, 15.0, "track x (cm)"}, {20, -15.0, 15.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dyAtMFT", "Tracks #Deltay at MFT reference plane", + {HistType::kTHnSparseF, {dyAxis, {20, -15.0, 15.0, "track x (cm)"}, {20, -15.0, 15.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dsxAtMFT", "Tracks #Deltaslope(x) at MFT reference plane", + {HistType::kTHnSparseF, {dsxAxis, {20, -15.0, 15.0, "track x (cm)"}, {20, -15.0, 15.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dsyAtMFT", "Tracks #Deltaslope(y) at MFT reference plane", + {HistType::kTHnSparseF, {dsyAxis, {20, -15.0, 15.0, "track x (cm)"}, {20, -15.0, 15.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dphiAtMFT", "Tracks #Delta#phi at MFT reference plane", + {HistType::kTHnSparseF, {dphiAxis, {20, -15.0, 15.0, "track x (cm)"}, {20, -15.0, 15.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + + // MCH plane + registry.add("matching/dxAtMCH", "Tracks #Deltax at MCH reference plane", + {HistType::kTHnSparseF, {dxAxis, {20, -100.0, 100.0, "track x (cm)"}, {20, -100.0, 100.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dyAtMCH", "Tracks #Deltay at MCH reference plane", + {HistType::kTHnSparseF, {dyAxis, {20, -100.0, 100.0, "track x (cm)"}, {20, -100.0, 100.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dsxAtMCH", "Tracks #Deltaslope(x) at MCH reference plane", + {HistType::kTHnSparseF, {dsxAxis, {20, -100.0, 100.0, "track x (cm)"}, {20, -100.0, 100.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dsyAtMCH", "Tracks #Deltaslope(y) at MCH reference plane", + {HistType::kTHnSparseF, {dsyAxis, {20, -100.0, 100.0, "track x (cm)"}, {20, -100.0, 100.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("matching/dphiAtMCH", "Tracks #Delta#phi at MCH reference plane", + {HistType::kTHnSparseF, {dphiAxis, {20, -100.0, 100.0, "track x (cm)"}, {20, -100.0, 100.0, "track y (cm)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + } } int GetDetElemId(int iDetElemNumber) @@ -611,8 +660,8 @@ struct muonGlobalAlignment { int getNumDE() { - static int nDE = -1; - if (nDE < 0) { + static int nDE = 0; + if (nDE <= 0) { for (int c = 0; c < 10; c++) { nDE += getNumDEinChamber(c); } @@ -1562,7 +1611,7 @@ struct muonGlobalAlignment { aod::FwdTrkCls const& clusters, const std::map& collisionInfos) { - if (!fEnableMftMchResidualsAnalysis) { + if (!fEnableMftMchResidualsAnalysis && !fEnableMftMchMatchingAnalysis) { return; } @@ -1606,100 +1655,140 @@ struct muonGlobalAlignment { convertedTrackWithCorrOk = MchRealignTrack(mchTrack, clusters, convertedTrackWithCorr, true); } - // loop over attached clusters - auto clustersSliced = clusters.sliceBy(perMuon, mchTrack.globalIndex()); // Slice clusters by muon id - for (auto const& cluster : clustersSliced) { - int deId = cluster.deId(); - int chamber = deId / 100 - 1; - if (chamber < 0 || chamber > 9) - continue; - int deIndex = getDEindex(deId); + if (fEnableMftMchResidualsAnalysis) { + // loop over attached clusters + auto clustersSliced = clusters.sliceBy(perMuon, mchTrack.globalIndex()); // Slice clusters by muon id + for (auto const& cluster : clustersSliced) { + int deId = cluster.deId(); + int chamber = deId / 100 - 1; + if (chamber < 0 || chamber > 9) + continue; + int deIndex = getDEindex(deId); - math_utils::Point3D local; - math_utils::Point3D master; - math_utils::Point3D masterWithCorr; + math_utils::Point3D local; + math_utils::Point3D master; + math_utils::Point3D masterWithCorr; - master.SetXYZ(cluster.x(), cluster.y(), cluster.z()); - masterWithCorr.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + master.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + masterWithCorr.SetXYZ(cluster.x(), cluster.y(), cluster.z()); - // apply realignment to MCH cluster - if (configRealign.fEnableMCHRealign) { - // Transformation from reference geometry frame to new geometry frame - transformRef[cluster.deId()].MasterToLocal(master, local); - transformNew[cluster.deId()].LocalToMaster(local, master); - transformNew[cluster.deId()].LocalToMaster(local, masterWithCorr); - } + // apply realignment to MCH cluster + if (configRealign.fEnableMCHRealign) { + // Transformation from reference geometry frame to new geometry frame + transformRef[cluster.deId()].MasterToLocal(master, local); + transformNew[cluster.deId()].LocalToMaster(local, master); + transformNew[cluster.deId()].LocalToMaster(local, masterWithCorr); + } - // apply alignment corrections to MCH cluster (if available) - if (!mMchAlignmentCorrections.empty()) { - auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId()); - if (correctionsIt != mMchAlignmentCorrections.end()) { - const auto& corrections = correctionsIt->second; - masterWithCorr.SetX(masterWithCorr.x() + corrections.x); - masterWithCorr.SetY(masterWithCorr.y() + corrections.y); - masterWithCorr.SetZ(masterWithCorr.z() + corrections.z); + // apply alignment corrections to MCH cluster (if available) + if (!mMchAlignmentCorrections.empty()) { + auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId()); + if (correctionsIt != mMchAlignmentCorrections.end()) { + const auto& corrections = correctionsIt->second; + masterWithCorr.SetX(masterWithCorr.x() + corrections.x); + masterWithCorr.SetY(masterWithCorr.y() + corrections.y); + masterWithCorr.SetZ(masterWithCorr.z() + corrections.z); + } } - } - // MFT-MCH residuals (MCH cluster is realigned if enabled) - // if the realignment is enabled and successful, the MFT track is extrpolated - // by taking the momentum from the MCH track refitted with the new alignment - if (!configRealign.fEnableMCHRealign || convertedTrackOk) { - auto mftTrackAtCluster = configRealign.fEnableMCHRealign ? PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrack.first()), master.z()) : PropagateMFTtoMCH(mftTrack, FwdtoMCH(FwdToTrackPar(mchTrack)), master.z()); + // MFT-MCH residuals (MCH cluster is realigned if enabled) + // if the realignment is enabled and successful, the MFT track is extrpolated + // by taking the momentum from the MCH track refitted with the new alignment + if (!configRealign.fEnableMCHRealign || convertedTrackOk) { + auto mftTrackAtCluster = configRealign.fEnableMCHRealign ? PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrack.first()), master.z()) : PropagateMFTtoMCH(mftTrack, FwdtoMCH(FwdToTrackPar(mchTrack)), master.z()); - std::array xPos{master.x(), mftTrackAtCluster.getX()}; - std::array yPos{master.y(), mftTrackAtCluster.getY()}; + std::array xPos{master.x(), mftTrackAtCluster.getX()}; + std::array yPos{master.y(), mftTrackAtCluster.getY()}; - registry.get(HIST("residuals/dx_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); - registry.get(HIST("residuals/dy_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); + registry.get(HIST("residuals/dx_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); + registry.get(HIST("residuals/dy_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); - registry.get(HIST("residuals/dx_vs_de"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - registry.get(HIST("residuals/dy_vs_de"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - } + registry.get(HIST("residuals/dx_vs_de"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dy_vs_de"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + } - // MFT-MCH residuals with realigned and/or corrected MCH clusters - // if the alignment corrections are available and the refitting is successful, the MFT track is extrpolated - // by taking the momentum from the MCH track refitted with the alignment corrections and the new - // alignment (if realignment is enabled) - if (convertedTrackWithCorrOk) { - auto mftTrackAtClusterWithCorr = PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrackWithCorr.first()), masterWithCorr.z()); + // MFT-MCH residuals with realigned and/or corrected MCH clusters + // if the alignment corrections are available and the refitting is successful, the MFT track is extrpolated + // by taking the momentum from the MCH track refitted with the alignment corrections and the new + // alignment (if realignment is enabled) + if (convertedTrackWithCorrOk) { + auto mftTrackAtClusterWithCorr = PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrackWithCorr.first()), masterWithCorr.z()); - std::array xPos{masterWithCorr.x(), mftTrackAtClusterWithCorr.getX()}; - std::array yPos{masterWithCorr.y(), mftTrackAtClusterWithCorr.getY()}; + std::array xPos{masterWithCorr.x(), mftTrackAtClusterWithCorr.getX()}; + std::array yPos{masterWithCorr.y(), mftTrackAtClusterWithCorr.getY()}; - registry.get(HIST("residuals/dx_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); - registry.get(HIST("residuals/dy_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); + registry.get(HIST("residuals/dx_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); + registry.get(HIST("residuals/dy_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); - registry.get(HIST("residuals/dx_vs_de_corr"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - registry.get(HIST("residuals/dy_vs_de_corr"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dx_vs_de_corr"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dy_vs_de_corr"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + } } - } - if (!configRealign.fEnableMCHRealign || convertedTrackOk) { - auto mchTrackAtDCA = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrack, collision.posZ()) : PropagateMCH(mchTrack, collision.posZ()); - auto dcax = mchTrackAtDCA.getX() - collision.posX(); - auto dcay = mchTrackAtDCA.getY() - collision.posY(); - - registry.get(HIST("DCA/MCH/DCA_y_vs_x"))->Fill(dcax, dcay); - registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcax); - registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcay); - - if (fEnableMftMchResidualsExtraPlots) { - registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_vz"))->Fill(collision.posZ(), quadrantMch, posNeg, dcax); - registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_vz"))->Fill(collision.posZ(), quadrantMch, posNeg, dcay); - auto mchTrackAtMFT = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrack, mftTrack.z()) : PropagateMCH(mchTrack, mftTrack.z()); - double deltaPhi = mchTrackAtMFT.getPhi() - mftTrack.phi(); - registry.get(HIST("residuals/dphi_at_mft"))->Fill(deltaPhi, mftTrack.x(), mftTrack.y(), posNeg, mchTrackAtMFT.getP()); + if (!configRealign.fEnableMCHRealign || convertedTrackOk) { + auto mchTrackAtDCA = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrack, collision.posZ()) : PropagateMCH(mchTrack, collision.posZ()); + auto dcax = mchTrackAtDCA.getX() - collision.posX(); + auto dcay = mchTrackAtDCA.getY() - collision.posY(); + + registry.get(HIST("DCA/MCH/DCA_y_vs_x"))->Fill(dcax, dcay); + registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcax); + registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcay); + + if (fEnableMftMchResidualsExtraPlots) { + registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_vz"))->Fill(collision.posZ(), quadrantMch, posNeg, dcax); + registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_vz"))->Fill(collision.posZ(), quadrantMch, posNeg, dcay); + auto mchTrackAtMFT = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrack, mftTrack.z()) : PropagateMCH(mchTrack, mftTrack.z()); + double deltaPhi = mchTrackAtMFT.getPhi() - mftTrack.phi(); + registry.get(HIST("residuals/dphi_at_mft"))->Fill(deltaPhi, mftTrack.x(), mftTrack.y(), posNeg, mchTrackAtMFT.getP()); + } } - } - if (convertedTrackWithCorrOk) { - auto mchTrackAtDCA = PropagateMCHRealigned(convertedTrackWithCorr, collision.posZ()); - auto dcax = mchTrackAtDCA.getX() - collision.posX(); - auto dcay = mchTrackAtDCA.getY() - collision.posY(); + if (convertedTrackWithCorrOk) { + auto mchTrackAtDCA = PropagateMCHRealigned(convertedTrackWithCorr, collision.posZ()); + auto dcax = mchTrackAtDCA.getX() - collision.posX(); + auto dcay = mchTrackAtDCA.getY() - collision.posY(); - registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcax); - registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcay); + registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcax); + registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcay); + } + } + + // MFT-MCH track residuals analysis + if (fEnableMftMchMatchingAnalysis && convertedTrackWithCorrOk) { + double refPlaneZ[2] = {fRefPlaneZMFT, fRefPlaneZMCH}; + + std::shared_ptr dxPlots[2]{registry.get(HIST("matching/dxAtMFT")), registry.get(HIST("matching/dxAtMCH"))}; + std::shared_ptr dyPlots[2]{registry.get(HIST("matching/dyAtMFT")), registry.get(HIST("matching/dyAtMCH"))}; + std::shared_ptr dsxPlots[2]{registry.get(HIST("matching/dsxAtMFT")), registry.get(HIST("matching/dsxAtMCH"))}; + std::shared_ptr dsyPlots[2]{registry.get(HIST("matching/dsyAtMFT")), registry.get(HIST("matching/dsyAtMCH"))}; + std::shared_ptr dphiPlots[2]{registry.get(HIST("matching/dphiAtMFT")), registry.get(HIST("matching/dphiAtMCH"))}; + + for (int iRefPlane = 0; iRefPlane < 2; iRefPlane++) { + const auto mftTrackAtRefPlane = configRealign.fEnableMCHRealign ? PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrackWithCorr.first()), refPlaneZ[iRefPlane]) : PropagateMFTtoMCH(mftTrack, FwdtoMCH(FwdToTrackPar(mchTrack)), refPlaneZ[iRefPlane]); + const auto mchTrackAtRefPlane = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrackWithCorr, refPlaneZ[iRefPlane]) : PropagateMCH(mchTrack, refPlaneZ[iRefPlane]); + const auto& refTrackAtRefPlane = (iRefPlane == 0) ? mftTrackAtRefPlane : mchTrackAtRefPlane; + + auto dx = mchTrackAtRefPlane.getX() - mftTrackAtRefPlane.getX(); + dxPlots[iRefPlane]->Fill(dx, refTrackAtRefPlane.getX(), refTrackAtRefPlane.getY(), quadrantMch, posNeg, mchTrack.p()); + auto dy = mchTrackAtRefPlane.getY() - mftTrackAtRefPlane.getY(); + dyPlots[iRefPlane]->Fill(dy, refTrackAtRefPlane.getX(), refTrackAtRefPlane.getY(), quadrantMch, posNeg, mchTrack.p()); + + auto mftParamAtRefPlane = FwdtoMCH(mftTrackAtRefPlane); + auto mchParamAtRefPlane = FwdtoMCH(mchTrackAtRefPlane); + + auto dsx = mchParamAtRefPlane.getNonBendingSlope() - mftParamAtRefPlane.getNonBendingSlope(); + dsxPlots[iRefPlane]->Fill(dsx, refTrackAtRefPlane.getX(), refTrackAtRefPlane.getY(), quadrantMch, posNeg, mchTrack.p()); + auto dsy = mchParamAtRefPlane.getBendingSlope() - mftParamAtRefPlane.getBendingSlope(); + dsyPlots[iRefPlane]->Fill(dsy, refTrackAtRefPlane.getX(), refTrackAtRefPlane.getY(), quadrantMch, posNeg, mchTrack.p()); + + auto dphi = mchTrackAtRefPlane.getPhi() - mftTrackAtRefPlane.getPhi(); + if (dphi < -TMath::Pi()) { + dphi += TMath::Pi() * 2.0; + } else if (dphi > TMath::Pi()) { + dphi -= TMath::Pi() * 2.0; + } + dphiPlots[iRefPlane]->Fill(dphi, refTrackAtRefPlane.getX(), refTrackAtRefPlane.getY(), quadrantMch, posNeg, mchTrack.p()); + } } } } From b0c0863ecad7d6d3368dc1222224044951b9ab22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Mon, 13 Apr 2026 19:53:41 +0200 Subject: [PATCH 252/282] [PWGLF,PWGMM] Fix includes and using statements (#15723) --- PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx | 1 - PWGMM/Lumi/Tasks/lumiZdcQa.cxx | 7 ------- PWGMM/Mult/Tasks/mftReassociationValidation.cxx | 3 ++- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx index 068801a64c5..9aba4bd6837 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/PWGMM/Lumi/Tasks/lumiZdcQa.cxx b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx index 80f2012a164..5ebd6d64b59 100644 --- a/PWGMM/Lumi/Tasks/lumiZdcQa.cxx +++ b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx @@ -16,14 +16,9 @@ /// \author Stefanie Mrozinski (stefanie.mrozinski@cern.ch) - Goethe University Frankfurt /// \author Lorenzo Mattei (lorenzo.mattei@cern.ch) - Turin University -#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/MetadataHelper.h" #include "Common/DataModel/EventSelection.h" -#include -#include -#include -#include #include #include #include @@ -35,10 +30,8 @@ #include #include -#include #include -#include #include #include #include diff --git a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx index 31e8e78df72..5d5e2f2b1bb 100644 --- a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx +++ b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx @@ -28,11 +28,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -41,6 +41,7 @@ #include #include +#include #include #include From eca42168b8b06d5c949b774f6b5117f9d5391e2f Mon Sep 17 00:00:00 2001 From: YashParakh007 Date: Tue, 14 Apr 2026 00:51:14 +0530 Subject: [PATCH 253/282] [PWGCF] Fix issues for ZvtxFT0vsPV selection (#15729) --- .../EbyEFluctuations/Tasks/netprotcumulants.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx index 66eadcf5369..c8d37967512 100644 --- a/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx @@ -101,6 +101,7 @@ struct NetProtCumulants { Configurable cfgIfRejectElectron{"cfgIfRejectElectron", true, "Remove electrons"}; Configurable cfgIfMandatoryTOF{"cfgIfMandatoryTOF", true, "Mandatory TOF requirement to remove pileup"}; Configurable cfgEvSelkIsVertexTOFmatched{"cfgEvSelkIsVertexTOFmatched", true, "If matched with TOF, for pileup"}; + Configurable cfgEvSelkIsGoodZvtxFT0vsPV{"cfgEvSelkIsGoodZvtxFT0vsPV", false, "Apply kIsGoodZvtxFT0vsPV event selection"}; ConfigurableAxis cfgCentralityBins{"cfgCentralityBins", {90, 0., 90.}, "Centrality/Multiplicity percentile bining"}; // Connect to ccdb @@ -1078,7 +1079,7 @@ struct NetProtCumulants { } //------------------------------------------------------------------------------------------- } - PROCESS_SWITCH(NetProtCumulants, processMCGen, "Process Generated", false); + PROCESS_SWITCH(NetProtCumulants, processMCGen, "Process Generated", true); void processMCRec(MyMCRecCollision const& collision, MyMCTracks const& tracks, aod::McCollisions const&, aod::McParticles const&) { @@ -1097,7 +1098,9 @@ struct NetProtCumulants { } if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { return; - ; + } + if (cfgEvSelkIsGoodZvtxFT0vsPV && !(collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) { + return; } auto cent = collision.centFT0C(); @@ -2026,7 +2029,7 @@ struct NetProtCumulants { histos.get(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111); } } - PROCESS_SWITCH(NetProtCumulants, processMCRec, "Process Generated", false); + PROCESS_SWITCH(NetProtCumulants, processMCRec, "Process Generated", true); void processDataRec(AodCollisions::iterator const& coll, aod::BCsWithTimestamps const&, AodTracks const& inputTracks) { @@ -2044,7 +2047,10 @@ struct NetProtCumulants { if (cfgEvSelkIsVertexTOFmatched && !(coll.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { return; - ; + } + + if (cfgEvSelkIsGoodZvtxFT0vsPV && !(coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))) { + return; } histos.fill(HIST("hZvtx_after"), coll.posZ()); @@ -2978,7 +2984,7 @@ struct NetProtCumulants { histos.get(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111); } } - PROCESS_SWITCH(NetProtCumulants, processDataRec, "Process real data", true); + PROCESS_SWITCH(NetProtCumulants, processDataRec, "Process real data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From c4c46dde8695a5bf8e9e9f9787bb66160e109396 Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Mon, 13 Apr 2026 22:59:00 +0200 Subject: [PATCH 254/282] [PWGLF,PWGMM] Added extra checks for reassociation (#15750) --- PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx | 2930 ++++++++++++++++++++-------- 1 file changed, 2117 insertions(+), 813 deletions(-) diff --git a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx index 97425d586c6..dfe53b32df8 100644 --- a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx +++ b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx @@ -19,57 +19,43 @@ #include "Index.h" #include "bestCollisionTable.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/GeomConstants.h" +#include "CommonConstants/MathConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DetectorsBase/Propagator.h" +#include "Field/MagneticField.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Configurable.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/RuntimeError.h" +#include "Framework/runDataProcessing.h" +#include "MathUtils/Utils.h" +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "ReconstructionDataFormats/TrackFwd.h" + +#include "Math/MatrixFunctions.h" +#include "Math/SMatrix.h" +#include "TGeoGlobalMagField.h" +#include "TMCProcess.h" +#include "TPDGCode.h" #include -#include #include #include -#include -#include -#include -#include #include #include -#include #include #include @@ -96,8 +82,37 @@ auto static constexpr CmaxAccFT0A = 4.9f; auto static constexpr CminAccFT0C = -3.3f; auto static constexpr CmaxAccFT0C = -2.1f; -enum TrkSel { - trkSelAll, +constexpr int CevtSel = 15; +constexpr int CtrkSel = 7; +constexpr int CtrkTrkBestSel = 6; +constexpr int CambTrkType = 7; +constexpr int CselAmbTrkTypeAssocFlag = 16; +constexpr int CtrackToCollEvtType = 5; +constexpr int CreassocVtxType = 18; +constexpr int CevtReAsReAssocMCEventStatus = 5; +constexpr int CreAssocMCTrackStatus = 29; + +enum class EvtSel { + evtAll = 0, + evtSel, + evtIsGoodZvtx, + evtNoSameBunchPileup, + evtZvtxCut, + evtNoCollInTimeRangeStd, + evtNoCollInTimeRangeNarrow, + evtNoCollInTimeRangeStrict, + evtNoCollInRofStrict, + evtNoCollInRofStandard, + evtNoHighMultCollInPrevRof, + evtBelowMinOccup, + evtAboveMaxOccup, + evtRCTFlagChecker, + evtRCTFlagCheckerExtra, + nEvtSel +}; + +enum class TrkSel { + trkSelAll = 0, trkSelNCls, trkSelChi2Ncl, trkSelEta, @@ -107,35 +122,169 @@ enum TrkSel { nTrkSel }; -enum TrkBestSel { - trkBestSelAll, - trkBestSelCollID, - trkBestSelDCAxyCut, - trkBestSelDCAzCut, - trkBestSelNumReassoc, - nTrkBestSel +enum class TrkTrkBestSel { + trkTrkBestSelAll = 0, + trkTrkBestSelCollID, + trkTrkBestSelOrphan, + trkTrkBestSelDCAxyCut, + trkTrkBestSelDCAzCut, + trkTrkBestSelNumReassoc, + nTrkTrkBestSel }; -enum AmbTrkType { - kNonAmb = 0, - kOrphan = 1, - kNonAmbSame = 2, - kAmb = 3, - kAmbGt1 = 4, +enum class AmbTrkType { + kAll = 0, + kNonAmb, + kOrphan, + kOrphanNull, + kNonAmbSame, + kAmb, + kAmbGt1, nAmbTrkType }; -std::unordered_map mapVtxXrec; -std::unordered_map mapVtxYrec; -std::unordered_map mapVtxZrec; -std::unordered_map mapMcCollIdPerRecColl; +enum AmbTrkTypeAssocFlag { + kSel = 0, + kSelGoodVtxTrue, + kSelGoodVtxBad, + kSelNonAmbAll, + kSelNonAmbGoodVtxTrue, + kSelNonAmbGoodVtxBad, + kSelNonAmbSameAll, + kSelNonAmbSameGoodVtxTrue, + kSelNonAmbSameGoodVtxBad, + kSelAmbAll, + kSelAmbGoodVtxTrue, + kSelAmbGoodVtxBad, + kSelAmbGt1All, + kSelAmbGt1GoodVtxTrue, + kSelAmbGt1GoodVtxBad, + kSelOrphanNull, + nSelAmbTrkTypeAssocFlag +}; + +enum class TrackToCollEvtType { + kAllRecColl = 0, + kIsInelGt0wMft, + kEvtSel, + kBestCollIdx, + kIsMcColl, + nTrackToCollEvtType +}; + +enum class VertexStatusMC { + kNull = 0, + kGood, + kBad +}; + +enum class ReassocCheckVtxType { + kIsTrueVtxAllTrue = 0, + kIsTrueVtxAllFalse, + kIsTrueVtxVsGoodVtxTrue, + kIsTrueVtxVsGoodVtxFalse, + kIsTrueVtxVsBadVtxTrue, + kIsTrueVtxVsBadVtxFalse, + kIsRecGoodAllTrue, + kIsRecGoodAllFalse, + kIsRecGoodMatchAllTrue, + kIsRecGoodMatchAllFalse, + kIsRecGoodVsGoodVtxTrue, + kIsRecGoodVsGoodVtxFalse, + kIsRecGoodMatchVsGoodVtxTrue, + kIsRecGoodMatchVsGoodVtxFalse, + kIsRecGoodVsBadVtxTrue, + kIsRecGoodVsBadVtxFalse, + kIsRecGoodMatchVsBadVtxTrue, + kIsRecGoodMatchVsBadVtxFalse, + nReassocVtxType +}; + +enum class ReAssocMCEventStatus { + kEvtReAsAll = 0, + kEvtReAsSelected, + kEvtReAsHasMcColl, + kEvtReAsSplitVtxRemoved, + kEvtReAsZVtxCutMC, + nEvtReAsReAssocMCEventStatus +}; + +enum class ReAssocMCTrackStatus { + kTrkReAssocAll = 0, + kTrkBestSel, + kTrkSel, + kTrkHasColl, + kTrkReassignedRemoved, + kTrkHasMcPart, + kTrkNonAmbAll, + kTrkNonAmbGood, + kTrkNonAmbBad, + kTrkAmbAll, + kTrkAmbGood, + kTrkAmbBad, + kTrkNonAmbAllE, + kTrkNonAmbGoodE, + kTrkNonAmbBadE, + kAssoc, + kAssocGood, + kAssocGoodIsCompTrue, + kAssocGoodIsCompFalse, + kAssocBad, + kAssocBadIsCompTrue, + kAssocBadIsCompFalse, + kReAssoc, + kReAssocGood, + kReAssocGoodIsCompTrue, + kReAssocGoodIsCompFalse, + kReAssocBad, + kReAssocBadIsCompTrue, + kReAssocBadIsCompFalse, + nReAssocMCTrackStatus +}; + +enum class HistStatusReAssocVtx { + kTrkNonAmbAll = 0, + kTrkNonAmbGood, + kTrkNonAmbBad, + kTrkAmbAll, + kTrkAmbGood, + kTrkAmbBad, + kTrkNonAmbAllE, + kTrkNonAmbGoodE, + kTrkNonAmbBadE, + kAssoc, + kAssocGood, + kAssocGoodIsCompTrue, + kAssocGoodIsCompFalse, + kAssocBad, + kAssocBadIsCompTrue, + kAssocBadIsCompFalse, + kReAssoc, + kReAssocGood, + kReAssocGoodIsCompTrue, + kReAssocGoodIsCompFalse, + kReAssocBad, + kReAssocBadIsCompTrue, + kReAssocBadIsCompFalse, + nHistStatusReAssocVtx +}; + +std::unordered_map mapVtxXrec; +std::unordered_map mapVtxYrec; +std::unordered_map mapVtxZrec; +std::unordered_map mapVtxXgen; +std::unordered_map mapVtxYgen; +std::unordered_map mapVtxZgen; +std::unordered_map mapMcCollIdPerRecColl; struct DndetaMFTPbPb { SliceCache cache; std::array, 4> hCollAssoc; - std::array, 4> hReAssoc; - std::array, 8> hDCAMc; + std::array, 23> hReAssocVtxRes; + std::array, 23> hReAssocDCA; + // std::array, 23> hReAssocDCAPrim; + std::array, 21> hTimeAssocWithReassocMC; enum OccupancyEst { TrkITS = 1, Ft0C }; @@ -162,8 +311,12 @@ struct DndetaMFTPbPb { Configurable cfgIRSource{"cfgIRSource", "ZNC hadronic", "Estimator of the interaction rate (Pb-Pb: ZNC hadronic)"}; Configurable cfgUseTrackSel{"cfgUseTrackSel", false, "Flag to apply track selection"}; Configurable cfgUseParticleSel{"cfgUseParticleSel", false, "Flag to apply particle selection"}; + Configurable cfgUsePrimaries{"cfgUsePrimaries", false, "Select primary particles"}; Configurable cfgRemoveTrivialAssoc{"cfgRemoveTrivialAssoc", false, "Skip trivial associations"}; + Configurable cfgRemoveAmbiguousTracks{"cfgRemoveAmbiguousTracks", false, "Remove ambiguous tracks"}; + Configurable cfgRemoveOrphanTracks{"cfgRemoveOrphanTracks", true, "Remove orphan tracks"}; Configurable cfgRemoveReassigned{"cfgRemoveReassigned", false, "Remove reassgined tracks"}; + Configurable cfgRemoveSplitVertex{"cfgRemoveSplitVertex", true, "Remove split vertices"}; Configurable cfgUseTrackParExtra{"cfgUseTrackParExtra", false, "Use table with refitted track parameters"}; Configurable cfgUseInelgt0{"cfgUseInelgt0", false, "Use INEL > 0 condition"}; Configurable cfgUseInelgt0wMFT{"cfgUseInelgt0wMFT", false, "Use INEL > 0 condition with MFT acceptance"}; @@ -196,6 +349,7 @@ struct DndetaMFTPbPb { struct : ConfigurableGroup { Configurable requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"}; + Configurable requireRCTFlagCheckerExtra{"requireRCTFlagCheckerExtra", true, "Check RCT flag extra"}; Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_fw", "Evt sel: RCT flag checker label"}; Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; @@ -254,6 +408,7 @@ struct DndetaMFTPbPb { ctpRateFetcher rateFetcher; TH2* gCurrentHadronicRate; RCTFlagsChecker rctChecker; + RCTFlagsChecker rctCheckerExtra{kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad}; float bZ = 0; // Magnetic field for MFT static constexpr double CcenterMFT[3] = {0, 0, -61.4}; // Field at center of MFT @@ -352,38 +507,60 @@ struct DndetaMFTPbPb { "be enabled!"); } - auto hev = registry.add("Events/hEvtSel", "hEvtSel", HistType::kTH1F, - {{15, -0.5f, +14.5f}}); - hev->GetXaxis()->SetBinLabel(1, "All collisions"); - hev->GetXaxis()->SetBinLabel(2, "Ev. sel."); - hev->GetXaxis()->SetBinLabel(3, "kIsGoodZvtxFT0vsPV"); - hev->GetXaxis()->SetBinLabel(4, "NoSameBunchPileup"); - hev->GetXaxis()->SetBinLabel(5, "Z-vtx cut"); - hev->GetXaxis()->SetBinLabel(6, "kNoCollInTimeRangeStd"); - hev->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeNarrow"); - hev->GetXaxis()->SetBinLabel(8, "kNoCollInTimeRangeStrict"); - hev->GetXaxis()->SetBinLabel(9, "kNoCollInRofStrict"); - hev->GetXaxis()->SetBinLabel(10, "kNoCollInRofStandard"); - hev->GetXaxis()->SetBinLabel(11, "kNoHighMultCollInPrevRof"); - hev->GetXaxis()->SetBinLabel(12, "Below min occup."); - hev->GetXaxis()->SetBinLabel(13, "Above max occup."); - hev->GetXaxis()->SetBinLabel(14, "RCT Flag Checker"); - - registry.add("Tracks/hBestTrkSel", "Number of best tracks; Cut; #Tracks Passed Cut", {HistType::kTH1F, {{nTrkBestSel, -0.5, +nTrkBestSel - 0.5}}}); - registry.get(HIST("Tracks/hBestTrkSel"))->GetXaxis()->SetBinLabel(trkBestSelAll + 1, "All"); - registry.get(HIST("Tracks/hBestTrkSel"))->GetXaxis()->SetBinLabel(trkBestSelCollID + 1, "Assigned (ID>=0)"); - registry.get(HIST("Tracks/hBestTrkSel"))->GetXaxis()->SetBinLabel(trkBestSelDCAxyCut + 1, "DCA xy cut"); - registry.get(HIST("Tracks/hBestTrkSel"))->GetXaxis()->SetBinLabel(trkBestSelDCAzCut + 1, "DCA z cut"); - registry.get(HIST("Tracks/hBestTrkSel"))->GetXaxis()->SetBinLabel(trkBestSelNumReassoc + 1, "Reassociated"); - - registry.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {HistType::kTH1F, {{nTrkSel, -0.5, +nTrkSel - 0.5}}}); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelAll + 1, "All"); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNCls + 1, "Ncl cut"); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelChi2Ncl + 1, "#chi^{2}/Ncl cut"); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "#eta cut"); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPhiCut + 1, "#varphi cut"); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "#it{p}_{T} cut"); - registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelCA + 1, "Tracking algorithm (CA)"); + // registry.add("Events/hRCTSel", "Event accepted if RCT not selected;RCT Status;", {HistType::kTH1F, {{2, 0.5, 2.5}}}); + // auto hrctSel = registry.get(HIST("Events/hRCTSel")); + // auto* x = hrctSel->GetXaxis(); + // x->SetBinLabel(1, "All"); + // x->SetBinLabel(2, "kFT0Bad"); + + registry.add("Events/hEvtSel", "Number of events; Cut; #Evt Passed Cut", {HistType::kTH1F, {{static_cast(EvtSel::nEvtSel), -0.5, +static_cast(EvtSel::nEvtSel) - 0.5}}}); + std::string labelEvtSel[CevtSel]; + labelEvtSel[static_cast(EvtSel::evtAll)] = "All coll."; + labelEvtSel[static_cast(EvtSel::evtSel)] = "Sel 8"; + labelEvtSel[static_cast(EvtSel::evtIsGoodZvtx)] = "kIsGoodZvtxFT0vsPV"; + labelEvtSel[static_cast(EvtSel::evtNoSameBunchPileup)] = "NoSameBunchPileup"; + labelEvtSel[static_cast(EvtSel::evtZvtxCut)] = "Z-vtx cut"; + labelEvtSel[static_cast(EvtSel::evtNoCollInTimeRangeStd)] = "kNoCollInTimeRangeStd"; + labelEvtSel[static_cast(EvtSel::evtNoCollInTimeRangeNarrow)] = "kNoCollInTimeRangeNarrow"; + labelEvtSel[static_cast(EvtSel::evtNoCollInTimeRangeStrict)] = "kNoCollInTimeRangeStrict"; + labelEvtSel[static_cast(EvtSel::evtNoCollInRofStrict)] = "kNoCollInRofStrict"; + labelEvtSel[static_cast(EvtSel::evtNoCollInRofStandard)] = "kNoCollInRofStandard"; + labelEvtSel[static_cast(EvtSel::evtNoHighMultCollInPrevRof)] = "kNoHighMultCollInPrevRof"; + labelEvtSel[static_cast(EvtSel::evtBelowMinOccup)] = "Below min occup."; + labelEvtSel[static_cast(EvtSel::evtAboveMaxOccup)] = "Above max occup."; + labelEvtSel[static_cast(EvtSel::evtRCTFlagChecker)] = "RCT Flag Checker"; + labelEvtSel[static_cast(EvtSel::evtRCTFlagCheckerExtra)] = "RCT Flag Checker Extra"; + registry.get(HIST("Events/hEvtSel"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(EvtSel::nEvtSel); iBin++) { + registry.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(iBin + 1, labelEvtSel[iBin].data()); + } + + registry.add("Tracks/hBestTrkSel", "Number of best tracks; Cut; #Tracks Passed Cut", {HistType::kTH1F, {{static_cast(TrkTrkBestSel::nTrkTrkBestSel), -0.5, +static_cast(TrkTrkBestSel::nTrkTrkBestSel) - 0.5}}}); + std::string labelTrkTrkBestSel[CtrkTrkBestSel]; + labelTrkTrkBestSel[static_cast(TrkTrkBestSel::trkTrkBestSelAll)] = "All"; + labelTrkTrkBestSel[static_cast(TrkTrkBestSel::trkTrkBestSelCollID)] = "Assigned (ID>=0)"; + labelTrkTrkBestSel[static_cast(TrkTrkBestSel::trkTrkBestSelOrphan)] = "No orphans"; + labelTrkTrkBestSel[static_cast(TrkTrkBestSel::trkTrkBestSelDCAxyCut)] = "DCA xy cut"; + labelTrkTrkBestSel[static_cast(TrkTrkBestSel::trkTrkBestSelDCAzCut)] = "DCA z cut"; + labelTrkTrkBestSel[static_cast(TrkTrkBestSel::trkTrkBestSelNumReassoc)] = "#Reassoc"; + registry.get(HIST("Tracks/hBestTrkSel"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(TrkTrkBestSel::nTrkTrkBestSel); iBin++) { + registry.get(HIST("Tracks/hBestTrkSel"))->GetXaxis()->SetBinLabel(iBin + 1, labelTrkTrkBestSel[iBin].data()); + } + + registry.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {HistType::kTH1F, {{static_cast(TrkSel::nTrkSel), -0.5, +static_cast(TrkSel::nTrkSel) - 0.5}}}); + std::string labelTrkSel[CtrkSel]; + labelTrkSel[static_cast(TrkSel::trkSelAll)] = "All"; + labelTrkSel[static_cast(TrkSel::trkSelNCls)] = "Ncls"; + labelTrkSel[static_cast(TrkSel::trkSelChi2Ncl)] = "Chi2"; + labelTrkSel[static_cast(TrkSel::trkSelEta)] = "Eta"; + labelTrkSel[static_cast(TrkSel::trkSelPhiCut)] = "Phi cut"; + labelTrkSel[static_cast(TrkSel::trkSelPt)] = "Pt"; + labelTrkSel[static_cast(TrkSel::trkSelCA)] = "CA"; + registry.get(HIST("Tracks/hTrkSel"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(TrkSel::nTrkSel); iBin++) { + registry.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(iBin + 1, labelTrkSel[iBin].data()); + } auto hBcSel = registry.add("hBcSel", "hBcSel", HistType::kTH1F, {{3, -0.5f, +2.5f}}); @@ -918,77 +1095,155 @@ struct DndetaMFTPbPb { qaregistry.add({"Tracks/hMftTracksAmbDegreeWithTrivial", " ; N_{coll}^{comp}", {HistType::kTH1F, {{41, -0.5, 40.5}}}}); - // qaregistry.add({"Tracks/hAmbTrackType", - // " ; Ambiguous track type", - // {HistType::kTH1F, {{5, -0.5, 4.5}}}}); - - qaregistry.add("Tracks/hAmbTrackType", "hAmbTrackType", {HistType::kTH1F, {{AmbTrkType::nAmbTrkType, -0.5, +AmbTrkType::nAmbTrkType - 0.5}}}); - std::string labelAmbiguity[AmbTrkType::nAmbTrkType]; - labelAmbiguity[AmbTrkType::kOrphan] = "orphan"; - labelAmbiguity[AmbTrkType::kNonAmb] = "nonAmbiguous"; - labelAmbiguity[AmbTrkType::kNonAmbSame] = "trkInCollTabHasSameAssoc"; - labelAmbiguity[AmbTrkType::kAmb] = "trkInCollTabHasDiffAssoc"; - labelAmbiguity[AmbTrkType::kAmbGt1] = "trkInCollTabHasGt1Assoc"; - qaregistry.get(HIST("Tracks/hAmbTrackType"))->SetMinimum(0.1); - for (int iBin = 0; iBin < AmbTrkType::nAmbTrkType; iBin++) { + qaregistry.add("Tracks/hAmbTrackType", "hAmbTrackType", {HistType::kTH1F, {{static_cast(AmbTrkType::nAmbTrkType), -0.5, +static_cast(AmbTrkType::nAmbTrkType) - 0.5}}}); + std::string labelAmbiguity[CambTrkType]; + labelAmbiguity[static_cast(AmbTrkType::kAll)] = "all"; + labelAmbiguity[static_cast(AmbTrkType::kOrphan)] = "orphan"; + labelAmbiguity[static_cast(AmbTrkType::kOrphanNull)] = "orphanNull"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmb)] = "nonAmb"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmbSame)] = "nonAmbSame"; + labelAmbiguity[static_cast(AmbTrkType::kAmb)] = "Amb"; + labelAmbiguity[static_cast(AmbTrkType::kAmbGt1)] = "AmbGt1"; + qaregistry.get(HIST("Tracks/hAmbTrackType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(AmbTrkType::nAmbTrkType); iBin++) { qaregistry.get(HIST("Tracks/hAmbTrackType"))->GetXaxis()->SetBinLabel(iBin + 1, labelAmbiguity[iBin].data()); } } - if (doprocessCollAssocMC) { - - registry.add("Events/hNAssocColls", "Number of times generated collisions are reconstructed; N; Counts", HistType::kTH1F, {{10, -0.5, 9.5}}); + if (doprocessAssocMC) { + registry.add("TrackToColl/hAmbTrackType", "hAmbTrackType", {HistType::kTH1F, {{static_cast(AmbTrkType::nAmbTrkType), -0.5, +static_cast(AmbTrkType::nAmbTrkType) - 0.5}}}); + std::string labelAmbiguity[CambTrkType]; + labelAmbiguity[static_cast(AmbTrkType::kAll)] = "all"; + labelAmbiguity[static_cast(AmbTrkType::kOrphan)] = "orphan"; + labelAmbiguity[static_cast(AmbTrkType::kOrphanNull)] = "orphanNull"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmb)] = "nonAmb"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmbSame)] = "nonAmbSame"; + labelAmbiguity[static_cast(AmbTrkType::kAmb)] = "Amb"; + labelAmbiguity[static_cast(AmbTrkType::kAmbGt1)] = "AmbGt1"; + registry.get(HIST("TrackToColl/hAmbTrackType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(AmbTrkType::nAmbTrkType); iBin++) { + registry.get(HIST("TrackToColl/hAmbTrackType"))->GetXaxis()->SetBinLabel(iBin + 1, labelAmbiguity[iBin].data()); + } // tracks not associated to any collision - hCollAssoc[0] = qaregistry.add("TrackToColl/hNonAssocTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hCollAssoc[0] = registry.add("TrackToColl/hNonAssocTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); // tracks associasted to a collision - hCollAssoc[1] = qaregistry.add("TrackToColl/hAssocTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hCollAssoc[1] = registry.add("TrackToColl/hAssocTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); // tracks associated to the correct collision considering only first reco collision (based on the MC collision index) - hCollAssoc[2] = qaregistry.add("TrackToColl/hGoodAssocTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hCollAssoc[2] = registry.add("TrackToColl/hGoodAssocTracks", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); // tracks associated to the correct collision considering all ambiguous reco collisions (based on the MC collision index) - hCollAssoc[3] = qaregistry.add("TrackToColl/hGoodAssocTracksAmb", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); - - qaregistry.add("TrackToColl/histFracTracksFakeMcColl", "Fraction of tracks originating from fake collision; fraction; entries", {HistType::kTH1F, {{101, 0., 1.01}}}); - qaregistry.add("TrackToColl/histFracGoodTracks", "Fraction of tracks originating from the correct collision; fraction; entries", {HistType::kTH1F, {{101, 0., 1.01}}}); - qaregistry.add("TrackToColl/histAmbTrackNumColls", "Number of collisions associated to an ambiguous track; no. collisions; entries", {HistType::kTH1F, {{30, -0.5, 29.5}}}); - qaregistry.add("TrackToColl/histTrackNumColls", "Number of collisions associated to track; no. collisions; entries", {HistType::kTH1F, {{30, -0.5, 29.5}}}); - qaregistry.add("TrackToColl/histNonAmbTrackNumColls", "Number of collisions associated to non-ambiguous track; no. collisions; entries", {HistType::kTH1F, {{30, -0.5, 29.5}}}); - qaregistry.add("TrackToColl/histAmbTrackZvtxRMS", "RMS of #it{Z}^{reco} of collisions associated to a track; RMS(#it{Z}^{reco}) (cm); entries", {HistType::kTH1F, {{100, 0., 0.5}}}); - } - - if (doprocessReAssocMC) { - - registry.add("Events/hNReAssocColls", "Number of times generated collisions are reconstructed; N; Counts", HistType::kTH1F, {{10, -0.5, 9.5}}); - - registry.add("Events/ReAssocMCStatus", ";status", {HistType::kTH1F, {{12, 0.5, 12.5}}}); - auto hstat = registry.get(HIST("Events/ReAssocMCStatus")); - hstat->GetXaxis()->SetBinLabel(1, "All compatible"); - hstat->GetXaxis()->SetBinLabel(2, "Selected"); - hstat->GetXaxis()->SetBinLabel(3, "Has collision"); - hstat->GetXaxis()->SetBinLabel(4, "Reassigned"); - hstat->GetXaxis()->SetBinLabel(5, "Has particle"); - hstat->GetXaxis()->SetBinLabel(6, "Pos z MC cut"); - hstat->GetXaxis()->SetBinLabel(7, "Associated"); - hstat->GetXaxis()->SetBinLabel(8, "Associated true"); - hstat->GetXaxis()->SetBinLabel(9, "Associated wrong"); - hstat->GetXaxis()->SetBinLabel(10, "Reassociated"); - hstat->GetXaxis()->SetBinLabel(11, "Reassociated true"); - hstat->GetXaxis()->SetBinLabel(12, "Reassociated wrong"); - - hReAssoc[0] = qaregistry.add("ReAssoc/hAssocBestTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); - hReAssoc[1] = qaregistry.add("ReAssoc/hAssocBestWrong", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); - hReAssoc[2] = qaregistry.add("ReAssoc/hReAssocBestTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); - hReAssoc[3] = qaregistry.add("ReAssoc/hReAssocBestWrong", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); - - hDCAMc[0] = qaregistry.add("ReAssoc/hAssocBestTrueDCAPrim", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[1] = qaregistry.add("ReAssoc/hAssocBestTrueDCASec", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[2] = qaregistry.add("ReAssoc/hAssocBestWrongDCAPrim", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[3] = qaregistry.add("ReAssoc/hAssocBestWrongDCASec", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[4] = qaregistry.add("ReAssoc/hReAssocBestTrueDCAPrim", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[5] = qaregistry.add("ReAssoc/hReAssocBestTrueDCASec", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[6] = qaregistry.add("ReAssoc/hReAssocBestWrongDCAPrim", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); - hDCAMc[7] = qaregistry.add("ReAssoc/hReAssocBestWrongDCASec", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hCollAssoc[3] = registry.add("TrackToColl/hGoodAssocTracksAmb", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + + registry.add("TrackToColl/histFracTracksFakeMcColl", "Fraction of tracks originating from fake collision; fraction; entries", {HistType::kTH1F, {{101, 0., 1.01}}}); + registry.add("TrackToColl/histFracGoodTracks", "Fraction of tracks originating from the correct collision; fraction; entries", {HistType::kTH1F, {{101, 0., 1.01}}}); + registry.add("TrackToColl/histAmbTrackNumColls", "Number of collisions associated to an ambiguous track; no. collisions; entries", {HistType::kTH1F, {{30, -0.5, 29.5}}}); + registry.add("TrackToColl/histTrackNumColls", "Number of collisions associated to track; no. collisions; entries", {HistType::kTH1F, {{30, -0.5, 29.5}}}); + registry.add("TrackToColl/histNonAmbTrackNumColls", "Number of collisions associated to non-ambiguous track; no. collisions; entries", {HistType::kTH1F, {{30, -0.5, 29.5}}}); + registry.add("TrackToColl/histAmbTrackZvtxRMS", "RMS of #it{Z}^{reco} of collisions associated to a track; RMS(#it{Z}^{reco}) (cm); entries", {HistType::kTH1F, {{100, 0., 10.}}}); + } + + if (doprocessReAssoc3dMC) { + + registry.add("ReAssocMC/hNReAssocRecoColls", "Number of times generated collisions are reconstructed; N; Counts", HistType::kTH1F, {{10, -0.5, 9.5}}); + + registry.add("ReAssocMC/hReAssocMCEventStatus", ";status", {HistType::kTH1F, {{static_cast(ReAssocMCEventStatus::nEvtReAsReAssocMCEventStatus), -0.5, +static_cast(ReAssocMCEventStatus::nEvtReAsReAssocMCEventStatus) - 0.5}}}); + std::string labelReAssocMCEventStatus[CevtReAsReAssocMCEventStatus]; + labelReAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsAll)] = "All"; + labelReAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsSelected)] = "Selected"; + labelReAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsHasMcColl)] = "Has Mc Coll"; + labelReAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsSplitVtxRemoved)] = "Split Vtx Removed"; + labelReAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsZVtxCutMC)] = "Vtx-z cut MC"; + registry.get(HIST("ReAssocMC/hReAssocMCEventStatus"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(ReAssocMCEventStatus::nEvtReAsReAssocMCEventStatus); iBin++) { + registry.get(HIST("ReAssocMC/hReAssocMCEventStatus"))->GetXaxis()->SetBinLabel(iBin + 1, labelReAssocMCEventStatus[iBin].data()); + } + + registry.add("ReAssocMC/hReAssocMCTrackStatus", ";status", {HistType::kTH1F, {{static_cast(ReAssocMCTrackStatus::nReAssocMCTrackStatus), -0.5, +static_cast(ReAssocMCTrackStatus::nReAssocMCTrackStatus) - 0.5}}}); + std::string labelReAssocMCTrackStatus[CreAssocMCTrackStatus]; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkReAssocAll)] = "All"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkBestSel)] = "Best sel"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkSel)] = "Trk sel"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkHasColl)] = "Has coll"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkReassignedRemoved)] = "Reas rm"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkHasMcPart)] = "Has part"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkNonAmbAll)] = "Non-amb"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkNonAmbGood)] = "Non-amb good coll."; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkNonAmbBad)] = "Non-amb bad coll."; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkAmbAll)] = "Amb"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkAmbGood)] = "Amb good coll."; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkAmbBad)] = "Amb bad coll."; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkNonAmbAllE)] = "Non-amb (ex)"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkNonAmbGoodE)] = "Non-amb good coll. (ex)"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kTrkNonAmbBadE)] = "Non-amb bad coll. (ex)"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssoc)] = "Assoc (gt1 amb)"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssocGood)] = "Assoc good"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssocGoodIsCompTrue)] = "Assoc good Comp True"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssocGoodIsCompFalse)] = "Assoc good Comp False"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssocBad)] = "Assoc bad"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssocBadIsCompTrue)] = "Assoc bad Comp True"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kAssocBadIsCompFalse)] = "Assoc bad Comp False"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssoc)] = "ReAssoc"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssocGood)] = "ReAssoc good"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssocGoodIsCompTrue)] = "ReAssoc good Comp True"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssocGoodIsCompFalse)] = "ReAssoc good Comp False"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssocBad)] = "ReAssoc bad"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssocBadIsCompTrue)] = "ReAssoc bad Comp True"; + labelReAssocMCTrackStatus[static_cast(ReAssocMCTrackStatus::kReAssocBadIsCompFalse)] = "ReAssoc bad Comp False"; + registry.get(HIST("ReAssocMC/hReAssocMCTrackStatus"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(ReAssocMCTrackStatus::nReAssocMCTrackStatus); iBin++) { + registry.get(HIST("ReAssocMC/hReAssocMCTrackStatus"))->GetXaxis()->SetBinLabel(iBin + 1, labelReAssocMCTrackStatus[iBin].data()); + } + + // Vertex resolution + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbAll)] = registry.add("ReAssocMC/hVtxResNonAmbAll", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbGood)] = registry.add("ReAssocMC/hVtxResNonAmbGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbBad)] = registry.add("ReAssocMC/hVtxResNonAmbBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkAmbAll)] = registry.add("ReAssocMC/hVtxResAmbAll", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkAmbGood)] = registry.add("ReAssocMC/hVtxResAmbGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkAmbBad)] = registry.add("ReAssocMC/hVtxResAmbBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbAllE)] = registry.add("ReAssocMC/hVtxResNonAmbAllE", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbGoodE)] = registry.add("ReAssocMC/hVtxResNonAmbGoodE", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbBadE)] = registry.add("ReAssocMC/hVtxResNonAmbBadE", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssoc)] = registry.add("ReAssocMC/hVtxResAssoc", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocGood)] = registry.add("ReAssocMC/hVtxResAssocGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompTrue)] = registry.add("ReAssocMC/hVtxResAssocGoodIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompFalse)] = registry.add("ReAssocMC/hVtxResAssocGoodIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocBad)] = registry.add("ReAssocMC/hVtxResAssocBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocBadIsCompTrue)] = registry.add("ReAssocMC/hVtxResAssocBadIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocBadIsCompFalse)] = registry.add("ReAssocMC/hVtxResAssocBadIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssoc)] = registry.add("ReAssocMC/hVtxResReAssoc", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocGood)] = registry.add("ReAssocMC/hVtxResReAssocGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompTrue)] = registry.add("ReAssocMC/hVtxResReAssocGoodIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompFalse)] = registry.add("ReAssocMC/hVtxResReAssocGoodIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocBad)] = registry.add("ReAssocMC/hVtxResReAssocBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompTrue)] = registry.add("ReAssocMC/hVtxResReAssocBadIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompFalse)] = registry.add("ReAssocMC/hVtxResReAssocBadIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, deltaZAxis, deltaZAxis, deltaZAxis}); + + // DCA + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbAll)] = registry.add("ReAssocMC/hDCANonAmbAll", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbGood)] = registry.add("ReAssocMC/hDCANonAmbGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbBad)] = registry.add("ReAssocMC/hDCANonAmbBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkAmbAll)] = registry.add("ReAssocMC/hDCAAmbAll", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkAmbGood)] = registry.add("ReAssocMC/hDCAAmbGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkAmbBad)] = registry.add("ReAssocMC/hDCAAmbBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbAllE)] = registry.add("ReAssocMC/hDCANonAmbAllE", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbGoodE)] = registry.add("ReAssocMC/hDCANonAmbGoodE", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbBadE)] = registry.add("ReAssocMC/hDCANonAmbBadE", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssoc)] = registry.add("ReAssocMC/hDCAAssoc", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocGood)] = registry.add("ReAssocMC/hDCAAssocGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompTrue)] = registry.add("ReAssocMC/hDCAAssocGoodIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompFalse)] = registry.add("ReAssocMC/hDCAAssocGoodIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocBad)] = registry.add("ReAssocMC/hDCAAssocBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocBadIsCompTrue)] = registry.add("ReAssocMC/hDCAAssocBadIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocBadIsCompFalse)] = registry.add("ReAssocMC/hDCAAssocBadIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssoc)] = registry.add("ReAssocMC/hDCAReAssoc", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocGood)] = registry.add("ReAssocMC/hDCAReAssocGood", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompTrue)] = registry.add("ReAssocMC/hDCAReAssocGoodIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompFalse)] = registry.add("ReAssocMC/hDCAReAssocGoodIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocBad)] = registry.add("ReAssocMC/hDCAReAssocBad", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompTrue)] = registry.add("ReAssocMC/hDCAReAssocBadIsCompTrue", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompFalse)] = registry.add("ReAssocMC/hDCAReAssocBadIsCompFalse", ";#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};DCA_{XY} (cm)^{reco}; DCA_{Z} (cm)^{reco}; DCA_{XY} (cm); DCA_{Z} (cm)", HistType::kTHnSparseF, {ptAxis, etaAxis, dcaxyAxis, dcazAxis, dcaxyAxis, dcazAxis}); } if (doprocessEfficiencyInclusive) { @@ -1025,13 +1280,40 @@ struct DndetaMFTPbPb { auto hNevt = registry.add("Events/hNGenRecColls", "Number of generated and reconstructed MC collisions", HistType::kTH1F, {{3, 0.5, 3.5}}); hNevt->GetXaxis()->SetBinLabel(1, "Reconstructed collisions"); hNevt->GetXaxis()->SetBinLabel(2, "Generated collisions"); + if (doprocessSecondariesMCInlcusive) { - registry.add({"Events/EvtGenRec", ";status", {HistType::kTH1F, {{3, 0.5, 3.5}}}}); - auto heff = registry.get(HIST("Events/EvtGenRec")); - auto* h = heff->GetXaxis(); - h->SetBinLabel(1, "All generated"); - h->SetBinLabel(2, "All reconstructed"); - h->SetBinLabel(3, "Selected reconstructed"); + qaregistry.add("Events/hTrackToCollEvtType", ";status", {HistType::kTH1F, {{static_cast(TrackToCollEvtType::nTrackToCollEvtType), -0.5, +static_cast(TrackToCollEvtType::nTrackToCollEvtType) - 0.5}}}); + std::string labelTrkToCollEvt[CtrackToCollEvtType]; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kAllRecColl)] = "all rec"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kIsInelGt0wMft)] = "inel>0 mft"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kEvtSel)] = "evt sel"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kBestCollIdx)] = "bestColl Idx (numContrib)"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kIsMcColl)] = "is mc"; + qaregistry.get(HIST("Events/hTrackToCollEvtType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(TrackToCollEvtType::nTrackToCollEvtType); iBin++) { + qaregistry.get(HIST("Events/hTrackToCollEvtType"))->GetXaxis()->SetBinLabel(iBin + 1, labelTrkToCollEvt[iBin].data()); + } + // registry.add({"Events/EvtGenRec", ";status", {HistType::kTH1F, {{3, 0.5, 3.5}}}}); + // auto heff = registry.get(HIST("Events/EvtGenRec")); + // auto* h = heff->GetXaxis(); + // h->SetBinLabel(1, "All generated"); + // h->SetBinLabel(2, "All reconstructed"); + // h->SetBinLabel(3, "Selected reconstructed"); + + qaregistry.add("TrkCompColls/hAmbTrackType", ";status", {HistType::kTH1F, {{static_cast(AmbTrkType::nAmbTrkType), -0.5, +static_cast(AmbTrkType::nAmbTrkType) - 0.5}}}); + std::string labelAmbiguity[CambTrkType]; + labelAmbiguity[static_cast(AmbTrkType::kAll)] = "all"; + labelAmbiguity[static_cast(AmbTrkType::kOrphan)] = "orphan"; + labelAmbiguity[static_cast(AmbTrkType::kOrphanNull)] = "orphanNull"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmb)] = "nonAmb"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmbSame)] = "nonAmbSame"; + labelAmbiguity[static_cast(AmbTrkType::kAmb)] = "Amb"; + labelAmbiguity[static_cast(AmbTrkType::kAmbGt1)] = "AmbGt1"; + qaregistry.get(HIST("TrkCompColls/hAmbTrackType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(AmbTrkType::nAmbTrkType); iBin++) { + qaregistry.get(HIST("TrkCompColls/hAmbTrackType"))->GetXaxis()->SetBinLabel(iBin + 1, labelAmbiguity[iBin].data()); + } + registry.add({"Tracks/THnRecAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}}); registry.add({"Tracks/THnRec", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}}); registry.add({"Tracks/THnRecNonAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}}); @@ -1046,12 +1328,38 @@ struct DndetaMFTPbPb { registry.add({"Tracks/THnGenSecMatAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm)", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis}}}); } if (doprocessSecondariesMCCentFT0C) { - registry.add({"Events/Centrality/EvtGenRec", ";status;centrality", {HistType::kTH2F, {{3, 0.5, 3.5}, centralityAxis}}}); - auto heff = registry.get(HIST("Events/Centrality/EvtGenRec")); - auto* h = heff->GetXaxis(); - h->SetBinLabel(1, "All generated"); - h->SetBinLabel(2, "All reconstructed"); - h->SetBinLabel(3, "Selected reconstructed"); + qaregistry.add("Events/Centrality/hTrackToCollEvtType", ";status;centrality", {HistType::kTH2F, {{static_cast(TrackToCollEvtType::nTrackToCollEvtType), -0.5, +static_cast(TrackToCollEvtType::nTrackToCollEvtType) - 0.5}, centralityAxis}}); + std::string labelTrkToCollEvt[CtrackToCollEvtType]; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kAllRecColl)] = "all rec"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kIsInelGt0wMft)] = "inel>0 mft"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kEvtSel)] = "evt sel"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kBestCollIdx)] = "bestColl Idx (numContrib)"; + labelTrkToCollEvt[static_cast(TrackToCollEvtType::kIsMcColl)] = "is mc"; + qaregistry.get(HIST("Events/Centrality/hTrackToCollEvtType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(TrackToCollEvtType::nTrackToCollEvtType); iBin++) { + qaregistry.get(HIST("Events/Centrality/hTrackToCollEvtType"))->GetXaxis()->SetBinLabel(iBin + 1, labelTrkToCollEvt[iBin].data()); + } + // registry.add({"Events/Centrality/EvtGenRec", ";status;centrality", {HistType::kTH2F, {{3, 0.5, 3.5}, centralityAxis}}}); + // auto heff = registry.get(HIST("Events/Centrality/EvtGenRec")); + // auto* h = heff->GetXaxis(); + // h->SetBinLabel(1, "All generated"); + // h->SetBinLabel(2, "All reconstructed"); + // h->SetBinLabel(3, "Selected reconstructed"); + + qaregistry.add("TrkCompColls/Centrality/hAmbTrackType", ";status;centrality", {HistType::kTH2F, {{static_cast(AmbTrkType::nAmbTrkType), -0.5, +static_cast(AmbTrkType::nAmbTrkType) - 0.5}, centralityAxis}}); + std::string labelAmbiguity[CambTrkType]; + labelAmbiguity[static_cast(AmbTrkType::kAll)] = "all"; + labelAmbiguity[static_cast(AmbTrkType::kOrphan)] = "orphan"; + labelAmbiguity[static_cast(AmbTrkType::kOrphanNull)] = "orphanNull"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmb)] = "nonAmb"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmbSame)] = "nonAmbSame"; + labelAmbiguity[static_cast(AmbTrkType::kAmb)] = "Amb"; + labelAmbiguity[static_cast(AmbTrkType::kAmbGt1)] = "AmbGt1"; + qaregistry.get(HIST("TrkCompColls/Centrality/hAmbTrackType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(AmbTrkType::nAmbTrkType); iBin++) { + qaregistry.get(HIST("TrkCompColls/Centrality/hAmbTrackType"))->GetXaxis()->SetBinLabel(iBin + 1, labelAmbiguity[iBin].data()); + } + registry.add({"Tracks/Centrality/THnRecAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis, centralityAxis}}}); registry.add({"Tracks/Centrality/THnRec", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis, centralityAxis}}}); registry.add({"Tracks/Centrality/THnRecNonAmb", "; p_{T} (GeV/c); #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {ptAxis, etaAxis, zAxis, centralityAxis}}}); @@ -1146,6 +1454,156 @@ struct DndetaMFTPbPb { registry.add({"Tracks/Centrality/EtaGen_t", "; #eta; centrality; occupancy", {HistType::kTH2F, {etaAxis, centralityAxis}}}); registry.add({"Tracks/Centrality/EtaGen", "; #eta; centrality; occupancy", {HistType::kTH2F, {etaAxis, centralityAxis}}}); } + + if (doprocessTimeAssocMC) { + + registry.add("TimeAssocMC/hTimeAssocMCEventStatus", ";status", {HistType::kTH1F, {{static_cast(ReAssocMCEventStatus::nEvtReAsReAssocMCEventStatus), -0.5, +static_cast(ReAssocMCEventStatus::nEvtReAsReAssocMCEventStatus) - 0.5}}}); + std::string labelTimeAssocMCEventStatus[CevtReAsReAssocMCEventStatus]; + labelTimeAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsAll)] = "All"; + labelTimeAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsSelected)] = "Selected"; + labelTimeAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsHasMcColl)] = "Has Mc Coll"; + labelTimeAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsSplitVtxRemoved)] = "Split Vtx Removed"; + labelTimeAssocMCEventStatus[static_cast(ReAssocMCEventStatus::kEvtReAsZVtxCutMC)] = "Vtx-z cut MC"; + registry.get(HIST("TimeAssocMC/hTimeAssocMCEventStatus"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(ReAssocMCEventStatus::nEvtReAsReAssocMCEventStatus); iBin++) { + registry.get(HIST("TimeAssocMC/hTimeAssocMCEventStatus"))->GetXaxis()->SetBinLabel(iBin + 1, labelTimeAssocMCEventStatus[iBin].data()); + } + + registry.add("TimeAssocMC/VtxStatus", ";status", {HistType::kTH1F, {{2, 0.5, 2.5}}}); + auto hstat = registry.get(HIST("TimeAssocMC/VtxStatus")); + hstat->GetXaxis()->SetBinLabel(1, "Good vtx"); + hstat->GetXaxis()->SetBinLabel(2, "Wrong vtx"); + + registry.add({"TimeAssocMC/hVertexResV1", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVertexResV2", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + + registry.add({"TimeAssocMC/hVTXkSelGoodVtxTrue", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelGoodVtxBad", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelNonAmbAll", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelNonAmbGoodVtxTrue", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelNonAmbGoodVtxBad", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelNonAmbSameAll", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelNonAmbSameGoodVtxTrue", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelNonAmbSameGoodVtxBad", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelAmbAll", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelAmbGoodVtxTrue", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelAmbGoodVtxBad", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelAmbGt1All", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelAmbGt1GoodVtxTrue", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + registry.add({"TimeAssocMC/hVTXkSelAmbGt1GoodVtxBad", "; #Delta X (cm); #Delta Y (cm); #Delta Z (cm)", {HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}}}); + + registry.add("TimeAssocMC/hTimeAssocCheckVtxType", ";status", {HistType::kTH1F, {{static_cast(ReassocCheckVtxType::nReassocVtxType), -0.5, +static_cast(ReassocCheckVtxType::nReassocVtxType) - 0.5}}}); + std::string labelReAssocVtxType[CreassocVtxType]; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxAllTrue)] = "kIsTrueVtxAll=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxAllFalse)] = "kIsTrueVtxAll=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxTrue)] = "kIsTrueVtxVsGoodVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxFalse)] = "kIsTrueVtxVsGoodVtx=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxTrue)] = "kIsTrueVtxVsBadVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxFalse)] = "kIsTrueVtxVsBadVtx=False"; + registry.get(HIST("TimeAssocMC/hTimeAssocCheckVtxType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(ReassocCheckVtxType::nReassocVtxType); iBin++) { + registry.get(HIST("TimeAssocMC/hTimeAssocCheckVtxType"))->GetXaxis()->SetBinLabel(iBin + 1, labelReAssocVtxType[iBin].data()); + } + + registry.add("TimeAssocMC/hAmbTrackType", ";status", {HistType::kTH1F, {{static_cast(AmbTrkType::nAmbTrkType), -0.5, +static_cast(AmbTrkType::nAmbTrkType) - 0.5}}}); + std::string labelAmbiguity[CambTrkType]; + labelAmbiguity[static_cast(AmbTrkType::kAll)] = "all"; + labelAmbiguity[static_cast(AmbTrkType::kOrphan)] = "orphan"; + labelAmbiguity[static_cast(AmbTrkType::kOrphanNull)] = "orphanNull"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmb)] = "nonAmb"; + labelAmbiguity[static_cast(AmbTrkType::kNonAmbSame)] = "nonAmbSame"; + labelAmbiguity[static_cast(AmbTrkType::kAmb)] = "Amb"; + labelAmbiguity[static_cast(AmbTrkType::kAmbGt1)] = "AmbGt1"; + registry.get(HIST("TimeAssocMC/hAmbTrackType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(AmbTrkType::nAmbTrkType); iBin++) { + registry.get(HIST("TimeAssocMC/hAmbTrackType"))->GetXaxis()->SetBinLabel(iBin + 1, labelAmbiguity[iBin].data()); + } + + registry.add("TimeAssocMC/hAmbTrkTypeAssocFlag", ";status", {HistType::kTH1F, {{static_cast(AmbTrkTypeAssocFlag::nSelAmbTrkTypeAssocFlag), -0.5, +static_cast(AmbTrkTypeAssocFlag::nSelAmbTrkTypeAssocFlag) - 0.5}}}); + std::string lAmbTrackType[CselAmbTrkTypeAssocFlag]; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSel)] = "all sel"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelGoodVtxTrue)] = "all good vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelGoodVtxBad)] = "all bad vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelNonAmbAll)] = "non-amb"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelNonAmbGoodVtxTrue)] = "non-amb good vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelNonAmbGoodVtxBad)] = "non-amb bad vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameAll)] = "non-amb (same)"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameGoodVtxTrue)] = "non-amb (same) good vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameGoodVtxBad)] = "non-amb (same) bad vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelAmbAll)] = "amb"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelAmbGoodVtxTrue)] = "amb good vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelAmbGoodVtxBad)] = "amb bad vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1All)] = "ambGt1"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1GoodVtxTrue)] = "ambGt1 good vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1GoodVtxBad)] = "ambGt1 bad vtx"; + lAmbTrackType[static_cast(AmbTrkTypeAssocFlag::kSelOrphanNull)] = "orhpan null"; + registry.get(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(AmbTrkTypeAssocFlag::nSelAmbTrkTypeAssocFlag); iBin++) { + registry.get(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"))->GetXaxis()->SetBinLabel(iBin + 1, lAmbTrackType[iBin].data()); + } + } + + if (doprocessTimeAssocWithReassocMC) { + registry.add("TimeAssocWithReassocMC/VtxStatus", ";status", {HistType::kTH1F, {{2, 0.5, 2.5}}}); + auto hstat = registry.get(HIST("TimeAssocWithReassocMC/VtxStatus")); + hstat->GetXaxis()->SetBinLabel(1, "Good vtx"); + hstat->GetXaxis()->SetBinLabel(2, "Wrong vtx"); + + registry.add("TimeAssocWithReassocMC/hReassocCheckVtxType", ";status", {HistType::kTH1F, {{static_cast(ReassocCheckVtxType::nReassocVtxType), -0.5, +static_cast(ReassocCheckVtxType::nReassocVtxType) - 0.5}}}); + std::string labelReAssocVtxType[CreassocVtxType]; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxAllTrue)] = "kIsTrueVtxAll=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxAllFalse)] = "kIsTrueVtxAll=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodAllTrue)] = "IsRecGoodAll=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodAllFalse)] = "kIsRecGoodAll=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodMatchAllTrue)] = "kIsRecGoodMatchAll=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodMatchAllFalse)] = "kIsRecGoodMatchAll=False"; + // + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxTrue)] = "kIsTrueVtxVsGoodVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxFalse)] = "kIsTrueVtxVsGoodVtx=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodVsGoodVtxTrue)] = "kIsRecGoodVsGoodVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodVsGoodVtxFalse)] = "kIsRecGoodVsGoodVtx=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsGoodVtxTrue)] = "kIsRecGoodMatchVsGoodVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsGoodVtxFalse)] = "kIsRecGoodMatchVsGoodVtx=False"; + // + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxTrue)] = "kIsTrueVtxVsBadVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxFalse)] = "kIsTrueVtxVsBadVtx=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodVsBadVtxTrue)] = "kIsRecGoodVsBadVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodVsBadVtxFalse)] = "kIsRecGoodVsBadVtx=False"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsBadVtxTrue)] = "kIsRecGoodMatchVsBadVtx=True"; + labelReAssocVtxType[static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsBadVtxFalse)] = "kIsRecGoodMatchVsBadVtx=False"; + registry.get(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"))->SetMinimum(0.1); + for (int iBin = 0; iBin < static_cast(ReassocCheckVtxType::nReassocVtxType); iBin++) { + registry.get(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"))->GetXaxis()->SetBinLabel(iBin + 1, labelReAssocVtxType[iBin].data()); + } + + hTimeAssocWithReassocMC[0] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrig", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[1] = registry.add("TimeAssocWithReassocMC/hDCAReassocBest", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[2] = registry.add("TimeAssocWithReassocMC/hDCAReassocTruth", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + + hTimeAssocWithReassocMC[3] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigTrueVtx", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[4] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigRecGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[5] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigRecGoodMatch", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + + hTimeAssocWithReassocMC[6] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigTrueVtxVtxFlagGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[7] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigRecGoodVtxFlagGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[8] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigRecGoodMatchVtxFlagGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + + hTimeAssocWithReassocMC[9] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigTrueVtxVtxFlagBad", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[10] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigRecGoodVtxFlagBad", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[11] = registry.add("TimeAssocWithReassocMC/hDCAReassocOrigRecGoodMatchVtxFlagBad", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + + hTimeAssocWithReassocMC[12] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestTrueVtx", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[13] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestRecGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[14] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestRecGoodMatch", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + + hTimeAssocWithReassocMC[15] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestTrueVtxVtxFlagGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[16] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestRecGoodVtxFlagGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[17] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestRecGoodMatchVtxFlagGood", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + + hTimeAssocWithReassocMC[18] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestTrueVtxVtxFlagBad", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[19] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestRecGoodVtxFlagBad", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + hTimeAssocWithReassocMC[20] = registry.add("TimeAssocWithReassocMC/hDCAReassocBestRecGoodMatchVtxFlagBad", ";#it{X}_{vtx}^{reco}#minus#it{X}_{vtx}^{gen} (cm);#it{Y}_{vtx}^{reco}#minus#it{Y}_{vtx}^{gen} (cm);#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm)", HistType::kTHnSparseF, {deltaZAxis, deltaZAxis, deltaZAxis}); + } } /// Filters - tracks @@ -1160,10 +1618,10 @@ struct DndetaMFTPbPb { /// Joined tables using FullBCs = soa::Join; - using CollBCs = soa::Join; + using CollBCs = soa::Join; using ExtBCs = soa::Join; - // Collisions + /// Collisions using Colls = soa::Join; using Coll = Colls::iterator; using CollsCentFT0C = soa::Join; @@ -1179,13 +1637,16 @@ struct DndetaMFTPbPb { using CollisionsWithMCLabels = soa::Join; using CollGenCent = CollsGenCentFT0C::iterator; using CollsCorr = soa::Join; - using CollsMCExtra = soa::Join; + using CollsMCExtra = soa::Join; + using CollsMCExtraMult = soa::Join; - // Tracks + /// Tracks using MFTTracksLabeled = soa::Join; using MftTracksWColls = soa::Join; using MftTracksWCollsMC = soa::Join; using BestTracksMC = soa::Join; + using BestTracks3dWCollsMC = soa::Join; + using BestTracks2dWCollsMC = soa::Join; /// Filtered tables using FiltMftTracks = soa::Filtered; @@ -1247,25 +1708,31 @@ struct DndetaMFTPbPb { bool isBestTrackSelected(const B& besttrack) { if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelAll); + registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelAll)); } if (besttrack.bestCollisionId() < CintZero) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelCollID); + registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelCollID)); + } + if (besttrack.ambDegree() == CintZero) { + return false; + } + if constexpr (fillHis) { + registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelOrphan)); } if (std::abs(besttrack.bestDCAXY()) >= trackCuts.maxDCAxy) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelDCAxyCut); + registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelDCAxyCut)); } - if (std::abs(besttrack.bestDCAZ()) >= trackCuts.maxDCAxy) { + if (std::abs(besttrack.bestDCAZ()) >= trackCuts.maxDCAz) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelDCAzCut); + registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelDCAzCut)); } return true; } @@ -1274,13 +1741,13 @@ struct DndetaMFTPbPb { bool isTrackSelected(const T& track) { if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelAll); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelAll)); } if (track.nClusters() < trackCuts.minNclusterMft) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelNCls); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelNCls)); } if (trackCuts.useChi2Cut) { float nclMft = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); @@ -1289,13 +1756,13 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelChi2Ncl); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelChi2Ncl)); } if (track.eta() < trackCuts.minEta || track.eta() > trackCuts.maxEta) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelEta); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelEta)); } if (trackCuts.usephiCut) { float phi = track.phi(); @@ -1311,19 +1778,19 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelPhiCut); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelPhiCut)); } if (trackCuts.usePtCut && track.pt() < trackCuts.minPt) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelPt); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelPt)); } if (trackCuts.requireCA && !track.isCA()) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Tracks/hTrkSel"), trkSelCA); + registry.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelCA)); } return true; } @@ -1451,7 +1918,7 @@ struct DndetaMFTPbPb { if (itrack.has_collision() && itrack.collisionId() != atrack.bestCollisionId()) { reassignedTrkIds.emplace_back(atrack.mfttrackId()); if (fillHis) { - registry.fill(HIST("Tracks/hBestTrkSel"), trkBestSelNumReassoc); + registry.fill(HIST("Tracks/hBestTrkSel"), static_cast(TrkTrkBestSel::trkTrkBestSelNumReassoc)); float phi = itrack.phi(); o2::math_utils::bringTo02Pi(phi); if (phi < Czero || TwoPI < phi) { @@ -1585,6 +2052,9 @@ struct DndetaMFTPbPb { template bool isParticleSelected(P const& particle) { + if (gConf.cfgUsePrimaries && !particle.isPhysicalPrimary()) { + return false; + } if (particle.eta() < trackCuts.minEta || particle.eta() > trackCuts.maxEta) { return false; } @@ -1641,69 +2111,69 @@ struct DndetaMFTPbPb { bool isGoodEvent(C const& collision) { if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 0); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtAll)); } if (!collision.sel8()) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 1); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtSel)); } if (eventCuts.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 2); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtIsGoodZvtx)); } if (eventCuts.requireRejectSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 3); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoSameBunchPileup)); } if (collision.posZ() <= eventCuts.minZvtx || collision.posZ() >= eventCuts.maxZvtx) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 4); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtZvtxCut)); } if (eventCuts.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 5); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInTimeRangeStd)); } if (eventCuts.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 6); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInTimeRangeNarrow)); } if (eventCuts.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 7); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInTimeRangeStrict)); } if (eventCuts.requireNoCollInRofStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 8); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInRofStrict)); } if (eventCuts.requireNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 9); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoCollInRofStandard)); } if (eventCuts.requireNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 10); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtNoHighMultCollInPrevRof)); } if (eventCuts.minOccupancy >= 0 && getOccupancy(collision, eventCuts.occupancyEstimator) < @@ -1711,7 +2181,7 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 11); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtBelowMinOccup)); } if (eventCuts.maxOccupancy >= 0 && getOccupancy(collision, eventCuts.occupancyEstimator) > @@ -1719,14 +2189,19 @@ struct DndetaMFTPbPb { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 12); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtAboveMaxOccup)); } - if (rctCuts.requireRCTFlagChecker && !rctChecker(collision)) { return false; } if constexpr (fillHis) { - registry.fill(HIST("Events/hEvtSel"), 13); + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtRCTFlagChecker)); + } + if (rctCuts.requireRCTFlagCheckerExtra && !rctCheckerExtra(collision)) { + return false; + } + if constexpr (fillHis) { + registry.fill(HIST("Events/hEvtSel"), static_cast(EvtSel::evtRCTFlagCheckerExtra)); } return true; } @@ -1835,6 +2310,12 @@ struct DndetaMFTPbPb { registry.fill(HIST("Events/Selection"), 1., occ); } + // const bool isFT0Bad = bc.rct_bit(kFT0Bad); + // registry.fill(HIST("Events/hRCTSel"), 1.0); + // if (!isFT0Bad) { + // registry.fill(HIST("Events/hRCTSel"), 2.0); + // } + if (!isGoodEvent(collision)) { return; } @@ -2944,352 +3425,196 @@ struct DndetaMFTPbPb { PROCESS_SWITCH(DndetaMFTPbPb, processEfficiencyCentFT0C, "Process efficiencies in FT0C centrality bins", false); - /// @brief process function to check ambiguous tracks - void processCheckAmbiguousMftTracks(aod::Collisions const&, MftTracksWColls const& tracks) + template + void processCorrelationwBestTracks(typename C::iterator const& collision, FiltMftTracks const& /*tracks*/, soa::SmallGroups const& besttracks) { - for (auto const& track : tracks) { - auto trkCollId = track.has_collision() ? track.collisionId() : -1; - auto ids = track.compatibleCollIds(); - if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { - qaregistry.fill(HIST("Tracks/hMftTracksAmbDegreeWithTrivial"), track.compatibleCollIds().size()); - if (ids.empty()) { - qaregistry.fill(HIST("Tracks/hAmbTrackType"), AmbTrkType::kOrphan); - } - if (ids.size() == 1 && trkCollId == ids[0]) { - qaregistry.fill(HIST("Tracks/hAmbTrackType"), AmbTrkType::kNonAmb); - } + if (!isGoodEvent(collision)) { + return; + } + + auto nBestTrks = 0; + for (auto const& atrack : besttracks) { + if (gConf.cfgUseTrackSel && !isBestTrackSelected(atrack)) { continue; } - qaregistry.fill(HIST("Tracks/hMftTracksAmbDegree"), track.compatibleCollIds().size()); - - if (track.compatibleCollIds().size() > 0) { - if (track.compatibleCollIds().size() == 1) { - if (track.collisionId() != track.compatibleCollIds()[0]) { - qaregistry.fill(HIST("Tracks/hAmbTrackType"), AmbTrkType::kAmb); - } else { - qaregistry.fill(HIST("Tracks/hAmbTrackType"), AmbTrkType::kNonAmbSame); - } - } else { - qaregistry.fill(HIST("Tracks/hAmbTrackType"), AmbTrkType::kAmbGt1); - } + auto itrack = atrack.template mfttrack_as(); + if (itrack.eta() < trackCuts.minEta || itrack.eta() > trackCuts.maxEta) { + continue; + } + if (gConf.cfgUseTrackSel && !isTrackSelected(itrack)) { + continue; } + nBestTrks++; } + qaregistry.fill(HIST("Events/hMultMFTvsFT0A"), nBestTrks, collision.multFT0A()); + qaregistry.fill(HIST("Events/hMultMFTvsFT0C"), nBestTrks, collision.multFT0C()); + qaregistry.fill(HIST("Events/hNPVtracksVsFT0C"), collision.multNTracksPV(), collision.multFT0C()); + qaregistry.fill(HIST("Events/hMultMFTvsFV0A"), nBestTrks, collision.multFV0A()); + qaregistry.fill(HIST("Events/hNPVtracksVsMultMFT"), collision.multNTracksPV(), nBestTrks); } - PROCESS_SWITCH(DndetaMFTPbPb, processCheckAmbiguousMftTracks, "Process checks for Ambiguous MFT tracks (inclusive)", false); + void processCorrelationwBestTracksInclusive(CollsCorr::iterator const& collision, FiltMftTracks const& tracks, soa::SmallGroups const& besttracks) + { + processCorrelationwBestTracks(collision, tracks, besttracks); + } - Partition tracksInAcc = (aod::fwdtrack::eta < trackCuts.maxEta) && (aod::fwdtrack::eta > trackCuts.minEta); + PROCESS_SWITCH(DndetaMFTPbPb, processCorrelationwBestTracksInclusive, "Do correlation study based on BestCollisionsFwd3d table", false); + + int getQuadrantPhi(float phi) + { + if (phi >= Czero && phi < Cninety) { + return 0; + } + if (phi >= Cninety && phi <= ConeHeighty) { + return 1; + } + if (phi >= -ConeHeighty && phi < -Cninety) { + return 2; + } + if (phi >= -Cninety && phi < Czero) { + return 3; + } + return -1; + } + + template + int getQuadrantTrack(T const& track) + { + float phi = static_cast(track.phi()) * ConeHeighty / PI; + return getQuadrantPhi(phi); + } + /// @brief process function to check MFT alignment (based on BestCollisionsFwd3d table) template - void processCheckAssocMC(C const& collisions, - MftTracksWCollsMC const& tracks, - aod::McParticles const& /*particles*/, - aod::McCollisions const& /*mccollisions*/ + void processAlignment(typename C::iterator const& collision, + FiltMftTracks const& /*tracks*/, + soa::SmallGroups const& besttracks, + CollBCs const& /*bcs*/ ) { - const auto& nRecoColls = collisions.size(); - registry.fill(HIST("Events/hNAssocColls"), 1.f, nRecoColls); - // Generated evets with >= 1 reco collisions - if (nRecoColls > CintZero) { - auto maxNcontributors = -1; - auto bestCollIndex = -1; - for (const auto& collision : collisions) { - if (!isGoodEvent(collision)) { - continue; - } - if (!collision.has_mcCollision()) { - continue; - } - if (maxNcontributors < collision.numContrib()) { - maxNcontributors = collision.numContrib(); - bestCollIndex = collision.globalIndex(); - } - } - - for (const auto& collision : collisions) { - if (!isGoodEvent(collision)) { - continue; - } - if (!collision.has_mcCollision()) { - continue; - } - // Select collisions with the largest number of contributors - if (bestCollIndex != collision.globalIndex()) { - continue; - } - // auto mcCollision = collision.template mcCollision_as(); - auto tracksInColl = tracksInAcc->sliceByCached(aod::fwdtrack::collisionId, collision.globalIndex(), cache); - int nTrk = 0, nFakeTrk = 0, nGoodTrk = 0; - for (const auto& track : tracksInColl) { - if (!track.has_mcParticle()) { - continue; - } - nTrk++; - auto particle = track.mcParticle(); + auto bc = collision.template foundBC_as(); + if (!isGoodEvent(collision)) { + return; + } - if ((particle.mcCollisionId() != collision.mcCollision().globalIndex())) { - nFakeTrk++; - continue; - } - if (collision.mcCollisionId() == particle.mcCollisionId()) { - nGoodTrk++; - } - } - float frac = (nTrk > 0) ? static_cast(nGoodTrk) / nTrk : -1.; - qaregistry.fill(HIST("TrackToColl/histFracGoodTracks"), frac); - float fracFake = (nTrk > 0) ? static_cast(nFakeTrk) / nTrk : -1.; - qaregistry.fill(HIST("TrackToColl/histFracTracksFakeMcColl"), fracFake); + if (gConf.cfgDoIR) { + initHadronicRate(bc); + float ir = !gConf.cfgIRSource.value.empty() ? rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), gConf.cfgIRSource, gConf.cfgIRCrashOnNull) * 1.e-3 : -1; + float seconds = bc.timestamp() * 1.e-3 - mMinSeconds; + if (gConf.cfgUseIRCut && (ir < eventCuts.minIR || ir > eventCuts.maxIR)) { // cut on hadronic rate + return; } + gCurrentHadronicRate->Fill(seconds, ir); } - for (const auto& track : tracks) { - uint index = uint(track.collisionId() >= 0); - if (track.has_mcParticle()) { - // auto particle = track.mcParticle_as(); - const auto& particle = track.mcParticle(); - - qaregistry.fill(HIST("TrackToColl/histTrackNumColls"), track.compatibleCollIds().size()); - - if (gConf.cfgRemoveTrivialAssoc) { - if (track.compatibleCollIds().empty() || (track.compatibleCollIds().size() == 1 && track.collisionId() == track.compatibleCollIds()[0])) { - qaregistry.fill(HIST("TrackToColl/histNonAmbTrackNumColls"), track.compatibleCollIds().size()); - continue; - } - } - - bool isAmbiguous = (track.compatibleCollIds().size() > 1); - if (isAmbiguous) { - qaregistry.fill(HIST("TrackToColl/histAmbTrackNumColls"), track.compatibleCollIds().size()); - std::vector ambVtxZ{}; - for (const auto& collIdx : track.compatibleCollIds()) { - const auto& ambColl = collisions.rawIteratorAt(collIdx); - ambVtxZ.push_back(ambColl.posZ()); - } - if (!ambVtxZ.empty()) { - qaregistry.fill(HIST("TrackToColl/histAmbTrackZvtxRMS"), computeRMS(ambVtxZ)); - } - } + auto z = collision.posZ(); + for (auto const& atrack : besttracks) { + if (!isBestTrackSelected(atrack)) { + continue; + } + auto itrack = atrack.template mfttrack_as(); + if (!isTrackSelected(itrack)) { + continue; + } - float deltaX = -999.f; - float deltaY = -999.f; - float deltaZ = -999.f; - if (index) { - const auto& collision = track.collision_as(); - const auto& mcCollision = particle.mcCollision_as(); - deltaX = collision.posX() - mcCollision.posX(); - deltaY = collision.posY() - mcCollision.posY(); - deltaZ = collision.posZ() - mcCollision.posZ(); - if (collision.has_mcCollision() && collision.mcCollisionId() == particle.mcCollisionId()) { - hCollAssoc[index + 1]->Fill(track.pt(), track.eta(), deltaX, deltaY, deltaZ); - } else { - if (isAmbiguous) { - for (const auto& collIdx : track.compatibleCollIds()) { - auto ambColl = collisions.rawIteratorAt(collIdx); - if (ambColl.has_mcCollision() && ambColl.mcCollisionId() == particle.mcCollisionId()) { - hCollAssoc[index + 2]->Fill(track.pt(), track.eta(), deltaX, deltaY, deltaZ); - // hCollAssoc[index + 2]->Fill(track.pt(), track.eta(), ambColl.posX() - mcCollision.posX(), ambColl.posY() - mcCollision.posY(), ambColl.posZ() - mcCollision.posZ()); - break; - } - } - } - } - hCollAssoc[index]->Fill(track.pt(), track.eta(), deltaX, deltaY, deltaZ); - } - } else { - hCollAssoc[index]->Fill(track.pt(), track.eta(), -999.f, -999.f, -999.f); + int quadrant = getQuadrantTrack(itrack); + if (quadrant < 0) { + continue; } + std::get>(hAlignment[0][quadrant][0]["DCA_x_vs_z"])->Fill(z, atrack.bestDCAXY()); } } - void processCollAssocMC(CollisionsWithMCLabels const& collisions, - MftTracksWCollsMC const& tracks, - aod::McParticles const& particles, - aod::McCollisions const& mccollisions) + void processAlignmentInclusive(Colls::iterator const& collision, + FiltMftTracks const& tracks, + soa::SmallGroups const& besttracks, + CollBCs const& bcs) { - processCheckAssocMC(collisions, tracks, particles, mccollisions); + processAlignment(collision, tracks, besttracks, bcs); } - PROCESS_SWITCH(DndetaMFTPbPb, processCollAssocMC, "Process collision-association information, requires extra table from TrackToCollisionAssociation task (fillTableOfCollIdsPerTrack=true)", false); - template - void processCheckReAssocMC(C const& collisions, - soa::SmallGroups const& besttracks, - FiltMcMftTracks const& /*tracks*/, - FiltParticles const& /*particles*/, - aod::McCollisions const& /*mccollisions*/ - ) - { - const auto& nRecoColls = collisions.size(); - registry.fill(HIST("Events/hNReAssocColls"), 1.f, nRecoColls); - // Generated evets with >= 1 reco collisions - if (nRecoColls > CintZero) { + PROCESS_SWITCH(DndetaMFTPbPb, processAlignmentInclusive, "Check MFT alignment using tracks based on BestCollisionsFwd3d table (inclusive)", false); - mapVtxXrec.clear(); - mapVtxYrec.clear(); - mapVtxZrec.clear(); - mapMcCollIdPerRecColl.clear(); - mapVtxXrec.reserve(collisions.size()); - mapVtxYrec.reserve(collisions.size()); - mapVtxZrec.reserve(collisions.size()); - mapMcCollIdPerRecColl.reserve(collisions.size()); + /// @brief process function to calculate signal loss based on MC + void processEventAndSignalLossCentFT0C(CollsMCExtraMult::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + FiltParticles const& particles) + { + registry.fill(HIST("Events/Centrality/hNRecCollsSigEvtLoss"), 1.f, collisions.size()); - auto maxNcontributors = -1; - auto bestCollIndex = -1; - for (auto const& collision : collisions) { - if (!isGoodEvent(collision)) { - continue; - } - if (!collision.has_mcCollision()) { - continue; - } - if (maxNcontributors < collision.numContrib()) { - maxNcontributors = collision.numContrib(); - bestCollIndex = collision.globalIndex(); - mapVtxXrec.emplace(collision.globalIndex(), collision.posX()); - mapVtxYrec.emplace(collision.globalIndex(), collision.posY()); - mapVtxZrec.emplace(collision.globalIndex(), collision.posZ()); - mapMcCollIdPerRecColl.emplace(collision.globalIndex(), collision.mcCollisionId()); - } + if (gConf.cfgUseInelgt0 && !mcCollision.isInelGt0()) { + return; + } + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + return; + } + + bool gtZeroColl = false; + auto maxNcontributors = -1; + auto centrality = -1; + for (auto const& collision : collisions) { + if (!isGoodEvent(collision)) { + continue; + } + if (std::abs(collision.posZ()) >= eventCuts.maxZvtx) { + continue; + } + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + centrality = getRecoCent(collision); } + gtZeroColl = true; + } - for (const auto& collision : collisions) { - if (!isGoodEvent(collision)) { - continue; - } - if (!collision.has_mcCollision()) { - continue; - } - // Select collisions with the largest number of contributors - if (bestCollIndex != collision.globalIndex()) { - continue; - } + auto perCollMCsample = mcSample->sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto multMCNParticlesEtaMFT = countPart(perCollMCsample); - auto perCollisionASample = besttracks.sliceBy(perColU, collision.globalIndex()); - for (auto const& atrack : perCollisionASample) { - registry.fill(HIST("Events/ReAssocMCStatus"), 1); - if (!isBestTrackSelected(atrack)) { - continue; - } - registry.fill(HIST("Events/ReAssocMCStatus"), 2); - auto itrack = atrack.template mfttrack_as(); - if (!isTrackSelected(itrack)) { - continue; - } - float phi = itrack.phi(); - o2::math_utils::bringTo02Pi(phi); - if (phi < Czero || TwoPI < phi) { - continue; - } - if (!itrack.has_collision()) { - continue; - } - registry.fill(HIST("Events/ReAssocMCStatus"), 3); - if (gConf.cfgRemoveReassigned) { - if (itrack.collisionId() != atrack.bestCollisionId()) { - continue; - } - registry.fill(HIST("Events/ReAssocMCStatus"), 4); - } - if (itrack.has_mcParticle()) { - registry.fill(HIST("Events/ReAssocMCStatus"), 5); - auto particle = itrack.template mcParticle_as(); - auto collision = itrack.template collision_as(); - auto mcCollision = particle.template mcCollision_as(); + registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 1., centrality); + registry.fill(HIST("Events/Centrality/hMultGenVsCent"), centrality, mcCollision.multMCFT0C()); + registry.fill(HIST("Events/Centrality/hMultGenVsCentNParticlesEta05"), centrality, mcCollision.multMCNParticlesEta05()); + registry.fill(HIST("Events/Centrality/hMultGenVsCentNParticlesEtaMFT"), centrality, multMCNParticlesEtaMFT); - if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { - continue; - } + if (collisions.size() == 0) { + registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 3., centrality); + } - registry.fill(HIST("Events/ReAssocMCStatus"), 6); + if (gtZeroColl) { + registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 2., centrality); + registry.fill(HIST("Events/Centrality/hMultGenVsCentRec"), centrality, mcCollision.multMCFT0C()); + registry.fill(HIST("Events/Centrality/hMultGenVsCentRecNParticlesEta05"), centrality, mcCollision.multMCNParticlesEta05()); + registry.fill(HIST("Events/Centrality/hMultGenVsCentRecNParticlesEtaMFT"), centrality, multMCNParticlesEtaMFT); + } - float deltaX = -999.f; - float deltaY = -999.f; - float deltaZ = -999.f; + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { + continue; + } - if (mapVtxXrec.find(atrack.bestCollisionId()) == mapVtxXrec.end()) { - continue; - } - if (mapVtxYrec.find(atrack.bestCollisionId()) == mapVtxYrec.end()) { - continue; - } - if (mapVtxZrec.find(atrack.bestCollisionId()) == mapVtxZrec.end()) { - continue; - } - if (mapMcCollIdPerRecColl.find(atrack.bestCollisionId()) == mapMcCollIdPerRecColl.end()) { - continue; - } - const float vtxXbest = mapVtxXrec.find(atrack.bestCollisionId())->second; - const float vtxYbest = mapVtxYrec.find(atrack.bestCollisionId())->second; - const float vtxZbest = mapVtxZrec.find(atrack.bestCollisionId())->second; - // LOGP(info, "\t ---> \t .... \t vtxZrec: {} - collision.posZ(): {}", vtxZrec, collision.posZ()); - const float mcCollIdRec = mapMcCollIdPerRecColl.find(atrack.bestCollisionId())->second; - // LOGP(info, "\t ---> \t .... \t mcCollIdRec: {} - bestMCCol: {}", mcCollIdRec, bestMCCol); - deltaX = vtxXbest - mcCollision.posX(); - deltaY = vtxYbest - mcCollision.posY(); - deltaZ = vtxZbest - mcCollision.posZ(); + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + if (phi < Czero || TwoPI < phi) { + continue; + } - const auto dcaXtruth(particle.vx() - particle.mcCollision().posX()); - const auto dcaYtruth(particle.vy() - particle.mcCollision().posY()); - const auto dcaZtruth(particle.vz() - particle.mcCollision().posZ()); - auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + dcaYtruth * dcaYtruth); + registry.fill(HIST("Tracks/Centrality/EtaCentVsMultGen_t"), particle.eta(), centrality, mcCollision.multMCFT0C()); + registry.fill(HIST("Tracks/Centrality/EtaGen_t"), particle.eta(), centrality); - if (itrack.collisionId() == atrack.bestCollisionId()) { // associated - registry.fill(HIST("Events/ReAssocMCStatus"), 7); - if (collision.has_mcCollision() && mcCollIdRec == particle.mcCollisionId()) { - registry.fill(HIST("Events/ReAssocMCStatus"), 8); - hReAssoc[0]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); - if (!particle.isPhysicalPrimary()) { - hDCAMc[1]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } else { // Primaries - hDCAMc[0]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } - } else { - registry.fill(HIST("Events/ReAssocMCStatus"), 9); - hReAssoc[1]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); - if (!particle.isPhysicalPrimary()) { - hDCAMc[3]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } else { // Primaries - hDCAMc[2]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } - } - } else { - registry.fill(HIST("Events/ReAssocMCStatus"), 10); - if (collision.has_mcCollision() && mcCollIdRec == particle.mcCollisionId()) { - registry.fill(HIST("Events/ReAssocMCStatus"), 11); - hReAssoc[2]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); - if (!particle.isPhysicalPrimary()) { - hDCAMc[5]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } else { // Primaries - hDCAMc[4]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } - } else { - registry.fill(HIST("Events/ReAssocMCStatus"), 12); - hReAssoc[3]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); - if (!particle.isPhysicalPrimary()) { - hDCAMc[7]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } else { // Primaries - hDCAMc[6]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); - } - } - } - } + if (gtZeroColl) { + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + if (phi < Czero || TwoPI < phi) { + continue; } + registry.fill(HIST("Tracks/Centrality/EtaCentVsMultGen"), particle.eta(), centrality, mcCollision.multMCFT0C()); + registry.fill(HIST("Tracks/Centrality/EtaGen"), particle.eta(), centrality); } - mapVtxXrec.clear(); - mapVtxYrec.clear(); - mapVtxZrec.clear(); - mapMcCollIdPerRecColl.clear(); } } - void processReAssocMC(CollisionsWithMCLabels const& collisions, - soa::SmallGroups const& besttracks, - FiltMcMftTracks const& tracks, - FiltParticles const& particles, - aod::McCollisions const& mccollisions) - { - processCheckReAssocMC(collisions, besttracks, tracks, particles, mccollisions); - } - PROCESS_SWITCH(DndetaMFTPbPb, processReAssocMC, "Process re-association information based on BestCollisionsFwd3d table", false); + PROCESS_SWITCH(DndetaMFTPbPb, processEventAndSignalLossCentFT0C, "Signal/event loss based on MC (in FT0C centrality bins)", false); Preslice filtTrkperCol = o2::aod::fwdtrack::collisionId; @@ -3368,331 +3693,1094 @@ struct DndetaMFTPbPb { PROCESS_SWITCH(DndetaMFTPbPb, processMcQACentFT0C, "Process MC QA checks (in FT0 centrality bins)", false); - Preslice mftTrkCompCollperCol = o2::aod::fwdtrack::collisionId; - - /// @brief process template function for DCA MC checks - template - void processSecondariesMC(typename soa::Join const& collisions, - MftTracksWCollsMC const& tracks, - MC const& mcCollisions, - aod::McParticles const& /*particles*/ - ) + /// @brief process function to check ambiguous tracks + void processCheckAmbiguousMftTracks(aod::Collisions const&, MftTracksWColls const& tracks) { - registry.fill(HIST("Events/hNGenRecColls"), 1.f, collisions.size()); - registry.fill(HIST("Events/hNGenRecColls"), 2.f, mcCollisions.size()); + for (auto const& track : tracks) { + auto trkCollId = track.has_collision() ? track.collisionId() : -1; + auto ids = track.compatibleCollIds(); + qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kAll)); + if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { + qaregistry.fill(HIST("Tracks/hMftTracksAmbDegreeWithTrivial"), track.compatibleCollIds().size()); + if (ids.empty()) { + qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kOrphan)); + } + if (ids.size() == 1 && trkCollId == ids[0]) { + qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kNonAmb)); + } + continue; + } + qaregistry.fill(HIST("Tracks/hMftTracksAmbDegree"), track.compatibleCollIds().size()); - float cGen = -1; - if constexpr (has_reco_cent) { - float crecMin = 105.f; - for (const auto& collision : collisions) { - if (isGoodEvent(collision)) { - float c = getRecoCent(collision); - if (c < crecMin) { - crecMin = c; + if (track.compatibleCollIds().size() > 0) { + if (track.compatibleCollIds().size() == 1) { + if (track.collisionId() != track.compatibleCollIds()[0]) { + qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kAmb)); + } else { + qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kNonAmbSame)); } + } else { + qaregistry.fill(HIST("Tracks/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1)); } } - if (cGen < 0) - cGen = crecMin; } + } - if constexpr (has_reco_cent) { - registry.fill(HIST("Events/Centrality/EvtGenRec"), 1., cGen); - } else { - registry.fill(HIST("Events/EvtGenRec"), 1.); - } + PROCESS_SWITCH(DndetaMFTPbPb, processCheckAmbiguousMftTracks, "Process checks for Ambiguous MFT tracks (inclusive)", false); - for (const auto& collision : collisions) { - float crec = getRecoCent(collision); + // Preslice perColMc = aod::mcparticle::mcCollisionId; + void processTimeAssocMC(CollsMCExtra const& mcCollisions, + CollisionsWithMCLabels const& collisions, + MftTracksWCollsMC const& tracks, + aod::McParticles const& /*particles*/, + aod::McCollisionLabels const& labels) + { + const auto& nRecoColls = collisions.size(); + LOG(info) << "reconstructed collisions: " << nRecoColls; + const auto& nMcColls = mcCollisions.size(); + LOG(info) << "MC collisions: " << nMcColls; + const auto& nLabels = labels.size(); + LOG(info) << "collision labels: " << nLabels; + + std::unordered_map mapRecToMc; + mapRecToMc.clear(); + mapRecToMc.reserve(nRecoColls); + + // std::unordered_map mapVtxXrec; + mapVtxXrec.clear(); + mapVtxXrec.reserve(nRecoColls); + // std::unordered_map mapVtxYrec; + mapVtxYrec.clear(); + mapVtxYrec.reserve(nRecoColls); + // std::unordered_map mapVtxZrec; + mapVtxZrec.clear(); + mapVtxZrec.reserve(nRecoColls); + + if (nRecoColls <= CintZero) { + return; + } - if constexpr (has_reco_cent) { - registry.fill(HIST("Events/Centrality/EvtGenRec"), 2., crec); - } else { - registry.fill(HIST("Events/EvtGenRec"), 2.); + auto maxNcontributors = -1; + auto bestCollIndex = -1; + for (auto const& collision : collisions) { + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + mapVtxXrec.emplace(collision.globalIndex(), collision.posX()); + mapVtxYrec.emplace(collision.globalIndex(), collision.posY()); + mapVtxZrec.emplace(collision.globalIndex(), collision.posZ()); + mapRecToMc.emplace(collision.globalIndex(), collision.mcCollisionId()); } + } + LOG(info) << "mapRecToMc size: " << mapRecToMc.size(); + LOG(info) << "mapVtxXrec size: " << mapVtxXrec.size(); - if (!isGoodEvent(collision)) { + std::unordered_map mapVtxXgen; + mapVtxXgen.clear(); + mapVtxXgen.reserve(nMcColls); + std::unordered_map mapVtxYgen; + mapVtxYgen.reserve(nMcColls); + mapVtxYgen.clear(); + std::unordered_map mapVtxZgen; + mapVtxZgen.clear(); + mapVtxZgen.reserve(nMcColls); + + for (const auto& mcCollision : mcCollisions) { + mapVtxXgen.emplace(mcCollision.globalIndex(), mcCollision.posX()); + mapVtxYgen.emplace(mcCollision.globalIndex(), mcCollision.posY()); + mapVtxZgen.emplace(mcCollision.globalIndex(), mcCollision.posZ()); + } + LOG(info) << "mapVtxXgen size: " << mapVtxXgen.size(); + + int nNoMC{0}; + for (const auto& collision : collisions) { + registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsAll)); + if (!isGoodEvent(collision)) { continue; } - - if constexpr (has_reco_cent) { - registry.fill(HIST("Events/Centrality/EvtGenRec"), 3., crec); - } else { - registry.fill(HIST("Events/EvtGenRec"), 3.); + registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsSelected)); + if (!collision.has_mcCollision()) { + continue; } + registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsHasMcColl)); - if (!collision.has_mcCollision()) { + int64_t recCollId = collision.globalIndex(); + auto itMC = mapRecToMc.find(recCollId); + if (itMC == mapRecToMc.end()) { + nNoMC++; + LOGP(debug, "collison {} has no MC coll", recCollId); + continue; + } + auto mcCollision = collision.mcCollision_as(); + if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { + continue; + } + registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsSplitVtxRemoved)); + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { continue; } + registry.fill(HIST("TimeAssocMC/hTimeAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsZVtxCutMC)); - auto trkPerColl = tracks.sliceBy(mftTrkCompCollperCol, collision.globalIndex()); - for (auto const& track : trkPerColl) { - if (!isTrackSelected(track)) { - continue; - } + // Loop on collision compatible MFT tracks + // Check: (1) good/bad vertices (2) if bad true vertex is available among rec vertices + for (const auto& track : tracks) { if (!track.has_collision()) { continue; } auto trkCollId = track.has_collision() ? track.collisionId() : -1; auto ids = track.compatibleCollIds(); - bool isAmbiguous = (ids.size() != 1); - - if (isAmbiguous) { - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnRecAmb"), track.pt(), track.eta(), collision.posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnRecAmb"), track.pt(), track.eta(), collision.posZ()); - } - } else { - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnRec"), track.pt(), track.eta(), collision.posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnRec"), track.pt(), track.eta(), collision.posZ()); - } - if (trkCollId == ids[0]) { - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnRecNonAmb"), track.pt(), track.eta(), collision.posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnRecNonAmb"), track.pt(), track.eta(), collision.posZ()); - } + if (trkCollId != recCollId) { // check if track is associated to rec coll + continue; + } + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kAll)); + if (ids.empty()) { + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kOrphan)); + } + if (gConf.cfgRemoveOrphanTracks && ids.empty()) { + continue; + } + if (gConf.cfgRemoveTrivialAssoc) { + if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { + continue; } - if (trkCollId != ids[0]) { - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnRecAmbRest"), track.pt(), track.eta(), collision.posZ(), crec); + } + if (gConf.cfgRemoveAmbiguousTracks && (track.compatibleCollIds().size() != 1)) { + continue; + } + if (ids.size() > 0) { + if (ids.size() == 1) { + if (trkCollId == ids[0]) { + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kNonAmb)); + } else if (trkCollId != ids[0]) { + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kAmb)); } else { - registry.fill(HIST("Tracks/THnRecAmbRest"), track.pt(), track.eta(), collision.posZ()); + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kNonAmbSame)); } + } else { + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1)); } + } else { + registry.fill(HIST("TimeAssocMC/hAmbTrackType"), static_cast(AmbTrkType::kOrphanNull)); } - - uint index = uint(track.collisionId() >= 0); - - if (!track.has_mcParticle()) { - LOGP(debug, "No MC particle for track, skip..."); + if (gConf.cfgUseTrackSel && !isTrackSelected(track)) { continue; } - auto particle = track.template mcParticle_as(); - if (!isChrgParticle(particle.pdgCode())) { - continue; + bool isTrueVtx = false; + int vtxFlag = static_cast(VertexStatusMC::kNull); + + float vtxX = -1.; + float vtxY = -1.; + float vtxZ = -1.; + float deltaXv1 = -1.; + float deltaYv1 = -1.; + float deltaZv1 = -1.; + float deltaXv2 = -1.; + float deltaYv2 = -1.; + float deltaZv2 = -1.; + + if (track.collisionId() >= 0 && track.has_mcParticle() && track.mcMask() == 0) { + auto itMCTrk = mapRecToMc.find(trkCollId); + const auto& mcPart = track.mcParticle(); + if (!isChrgParticle(mcPart.pdgCode())) { + continue; + } + if (gConf.cfgUseParticleSel && !isParticleSelected(mcPart)) { + continue; + } + int64_t mcPartId = mcPart.mcCollisionId(); + + // check if rec vertex is available in MC collisions + for (const auto& mcTrkId : mapRecToMc) { + if (mcTrkId.second == mcPartId) { + isTrueVtx = true; + break; + } + } + + // check if there is good or bad collision + if (itMCTrk != mapRecToMc.end()) { + int mcTrkCollId = itMCTrk->second; + if (mcPartId == mcTrkCollId) { // particle.mcCollisionId == collision.mcCollisionId -> good vtx + vtxFlag = static_cast(VertexStatusMC::kGood); + } else { // wrong vtx + vtxFlag = static_cast(VertexStatusMC::kBad); + } + } + + if (mapVtxXrec.find(trkCollId) == mapVtxXrec.end()) { + continue; + } + if (mapVtxYrec.find(trkCollId) == mapVtxYrec.end()) { + continue; + } + if (mapVtxZrec.find(trkCollId) == mapVtxZrec.end()) { + continue; + } + if (mapRecToMc.find(trkCollId) == mapRecToMc.end()) { + continue; + } + vtxX = mapVtxXrec.find(trkCollId)->second; + vtxY = mapVtxYrec.find(trkCollId)->second; + vtxZ = mapVtxZrec.find(trkCollId)->second; + // LOGP(info, "\t ---> \t .... \t vtxZrec: {} - collision.posZ(): {}", vtxZrec, collision.posZ()); + int64_t mcCollIdRec = mapRecToMc.find(trkCollId)->second; + // int64_t mcCollId = itMC->second; + // LOGP(info, "\t ---> \t .... \t mcCollIdRec: {} - mcCollId: {} - bestMCCol: {}", mcCollIdRec, mcCollId, bestMCCol); + if (mapVtxXgen.find(mcCollIdRec) == mapVtxXgen.end()) { + continue; + } + if (mapVtxYgen.find(mcCollIdRec) == mapVtxYgen.end()) { + continue; + } + if (mapVtxZgen.find(mcCollIdRec) == mapVtxZgen.end()) { + continue; + } + // vertex resolution - ver 1 + // rec coll vtx - mc associated to orig rec coll (first in time) + deltaXv1 = vtxX - mcCollision.posX(); + deltaYv1 = vtxY - mcCollision.posY(); + deltaZv1 = vtxZ - mcCollision.posZ(); + // vertex resolution - ver 2 + // rec coll vtx - mc associated to orig rec coll (first in time) + deltaXv2 = vtxX - mapVtxXgen.find(mcCollIdRec)->second; + deltaYv2 = vtxY - mapVtxYgen.find(mcCollIdRec)->second; + deltaZv2 = vtxZ - mapVtxZgen.find(mcCollIdRec)->second; } - if (particle.eta() <= trackCuts.minEta || particle.eta() >= trackCuts.maxEta) { - continue; + + registry.fill(HIST("TimeAssocMC/VtxStatus"), vtxFlag); + registry.fill(HIST("TimeAssocMC/hVertexResV1"), deltaXv1, deltaYv1, deltaZv1); + registry.fill(HIST("TimeAssocMC/hVertexResV2"), deltaXv2, deltaYv2, deltaZv2); + + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSel)); + + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hTimeAssocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxAllTrue)); + } else { + registry.fill(HIST("TimeAssocMC/hTimeAssocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxAllFalse)); } - if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { - continue; + if (vtxFlag == static_cast(VertexStatusMC::kGood)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelGoodVtxTrue"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelGoodVtxTrue)); + registry.fill(HIST("TimeAssocMC/hTimeAssocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxTrue)); + } else { + registry.fill(HIST("TimeAssocMC/hTimeAssocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxFalse)); + } } - - if (index) { - auto mcCollision = particle.template mcCollision_as(); - if (eventCuts.useZDiffCut) { - if (std::abs(collision.posZ() - mcCollision.posZ()) > eventCuts.maxZvtxDiff) { - continue; - } + if (vtxFlag == static_cast(VertexStatusMC::kBad)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelGoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelGoodVtxBad)); + registry.fill(HIST("TimeAssocMC/hTimeAssocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxTrue)); + } else { + registry.fill(HIST("TimeAssocMC/hTimeAssocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxFalse)); } + } - if (collision.has_mcCollision() && collision.mcCollisionId() == particle.mcCollisionId()) { - if (!particle.isPhysicalPrimary()) { // Secondaries (weak decays and material) - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenSec"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenSec"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + if (ids.size() > 0) { + if (ids.size() == 1) { + if (trkCollId == ids[0]) { // non ambiguous + registry.fill(HIST("TimeAssocMC/hVTXkSelNonAmbAll"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbAll)); + if (vtxFlag == static_cast(VertexStatusMC::kGood)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelNonAmbGoodVtxTrue"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbGoodVtxTrue)); + } } - if (particle.getProcess() == TMCProcess::kPDecay) { // Particles from decay - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenSecWeak"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenSecWeak"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + if (vtxFlag == static_cast(VertexStatusMC::kBad)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelNonAmbGoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbGoodVtxBad)); } - } else { // Particles from the material - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenSecMat"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenSecMat"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } else if (trkCollId != ids[0]) { + registry.fill(HIST("TimeAssocMC/hVTXkSelAmbAll"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbAll)); + if (vtxFlag == static_cast(VertexStatusMC::kGood)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelAmbGoodVtxTrue"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbGoodVtxTrue)); } } - } else { // Primaries - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenPrim"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenPrim"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + if (vtxFlag == static_cast(VertexStatusMC::kBad)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelAmbGoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbGoodVtxBad)); + } } - } - } else { - if (isAmbiguous) { - for (const auto& collIdx : track.compatibleCollIds()) { - auto ambColl = collisions.rawIteratorAt(collIdx); - if (ambColl.has_mcCollision() && ambColl.mcCollisionId() == particle.mcCollisionId()) { - if (!particle.isPhysicalPrimary()) { // Secondaries (weak decays and material) - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenSecAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenSecAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); - } - if (particle.getProcess() == TMCProcess::kPDecay) { // Particles from decay - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenSecWeakAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenSecWeakAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); - } - } else { // Particles from the material - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenSecMatAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenSecMatAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); - } - } - } else { // Primaries - if constexpr (has_reco_cent) { - registry.fill(HIST("Tracks/Centrality/THnGenPrimAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); - } else { - registry.fill(HIST("Tracks/THnGenPrimAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); - } - } - break; + } else { // non ambiguous (extra) + registry.fill(HIST("TimeAssocMC/hVTXkSelNonAmbSameAll"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameAll)); + if (vtxFlag == static_cast(VertexStatusMC::kGood)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelNonAmbSameGoodVtxTrue"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameGoodVtxTrue)); } } + if (vtxFlag == static_cast(VertexStatusMC::kBad)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelNonAmbSameGoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelNonAmbSameGoodVtxBad)); + } + } + } + } else { // ambiguous + registry.fill(HIST("TimeAssocMC/hVTXkSelAmbGt1All"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1All)); + if (vtxFlag == static_cast(VertexStatusMC::kGood)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelAmbGt1GoodVtxTrue"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1GoodVtxTrue)); + } + } + if (vtxFlag == static_cast(VertexStatusMC::kBad)) { + if (isTrueVtx) { + registry.fill(HIST("TimeAssocMC/hVTXkSelAmbGt1GoodVtxBad"), deltaXv2, deltaYv2, deltaZv2); + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelAmbGt1GoodVtxBad)); + } } } + } else { + registry.fill(HIST("TimeAssocMC/hAmbTrkTypeAssocFlag"), static_cast(AmbTrkTypeAssocFlag::kSelOrphanNull)); } } } + LOG(info) << "No MC: " << nNoMC; } - - void processSecondariesMCInlcusive(soa::Join const& collisions, - MftTracksWCollsMC const& tracks, - aod::McCollisions const& mccollisions, - aod::McParticles const& particles) + PROCESS_SWITCH(DndetaMFTPbPb, processTimeAssocMC, "process MC: check MFT tracks in compatible collisions (time-associasted)", false); + + void processTimeAssocWithReassocMC(CollsMCExtra const& mcCollisions, + CollisionsWithMCLabels const& collisions, + FiltMftTracks const& /*tracks*/, + BestTracks3dWCollsMC const& besttracks, + aod::McParticles const& /*particles*/, + aod::McCollisionLabels const& labels, + ExtBCs const& bcs) { - processSecondariesMC(collisions, tracks, mccollisions, particles); - } + if (bcs.size() == 0) { + return; + } + auto bc = bcs.begin(); + initCCDB(bc); - PROCESS_SWITCH(DndetaMFTPbPb, processSecondariesMCInlcusive, "Process secondaries checks (Inclusive)", false); + const auto& nRecoColls = collisions.size(); + LOG(info) << "reconstructed collisions: " << nRecoColls; + const auto& nMcColls = mcCollisions.size(); + LOG(info) << "MC collisions: " << nMcColls; + // LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), collisions.size()); + const auto& nLabels = labels.size(); + LOG(info) << "collision labels: " << nLabels; + + std::unordered_map mapRecToMc; + mapRecToMc.reserve(nRecoColls); + std::unordered_map mapMcToRec; + mapMcToRec.reserve(nRecoColls); + // std::unordered_map mapVtxXrec; + mapVtxXrec.reserve(nRecoColls); + // std::unordered_map mapVtxYrec; + mapVtxYrec.reserve(nRecoColls); + // std::unordered_map mapVtxZrec; + mapVtxZrec.reserve(nRecoColls); + + if (nRecoColls <= CintZero) { + return; + } - void processSecondariesMCCentFT0C(soa::Join const& collisions, - MftTracksWCollsMC const& tracks, - aod::McCollisions const& mccollisions, - aod::McParticles const& particles) - { - processSecondariesMC(collisions, tracks, mccollisions, particles); - } + auto maxNcontributors = -1; + auto bestCollIndex = -1; + for (auto const& collision : collisions) { + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + mapVtxXrec.emplace(collision.globalIndex(), collision.posX()); + mapVtxYrec.emplace(collision.globalIndex(), collision.posY()); + mapVtxZrec.emplace(collision.globalIndex(), collision.posZ()); + mapRecToMc.emplace(collision.globalIndex(), collision.mcCollisionId()); + mapMcToRec.emplace(collision.mcCollisionId(), collision.globalIndex()); + } + } + LOG(info) << "mapRecToMc size: " << mapRecToMc.size(); + LOG(info) << "mapVtxXrec size: " << mapVtxXrec.size(); - PROCESS_SWITCH(DndetaMFTPbPb, processSecondariesMCCentFT0C, "Process secondaries checks (in FT0C centrality bins)", false); + std::unordered_map mapVtxXgen; + mapVtxXgen.reserve(nMcColls); + std::unordered_map mapVtxYgen; + mapVtxYgen.reserve(nMcColls); + std::unordered_map mapVtxZgen; + mapVtxZgen.reserve(nMcColls); - template - void processCorrelationwBestTracks(typename C::iterator const& collision, FiltMftTracks const& /*tracks*/, soa::SmallGroups const& besttracks) - { - if (!isGoodEvent(collision)) { - return; + for (const auto& mcCollision : mcCollisions) { + mapVtxXgen.emplace(mcCollision.globalIndex(), mcCollision.posX()); + mapVtxYgen.emplace(mcCollision.globalIndex(), mcCollision.posY()); + mapVtxZgen.emplace(mcCollision.globalIndex(), mcCollision.posZ()); } + LOG(info) << "mapVtxXgen size: " << mapVtxXgen.size(); - auto nBestTrks = 0; - for (auto const& atrack : besttracks) { - if (gConf.cfgUseTrackSel && !isBestTrackSelected(atrack)) { + int nNoMC{0}; + for (const auto& collision : collisions) { + int64_t recCollId = collision.globalIndex(); + auto itMC = mapRecToMc.find(recCollId); + if (itMC == mapRecToMc.end()) { + nNoMC++; + LOGP(debug, "collison {} has no MC coll", recCollId); continue; } - auto itrack = atrack.template mfttrack_as(); - if (itrack.eta() < trackCuts.minEta || itrack.eta() > trackCuts.maxEta) { + if (!collision.has_mcCollision()) { continue; } - if (gConf.cfgUseTrackSel && !isTrackSelected(itrack)) { + auto mcCollision = collision.mcCollision_as(); + // if (collision.globalIndex() != mcCollision.bestCollisionIndex()) { + // continue; + // } + if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { continue; } - nBestTrks++; + + if (!isGoodEvent(collision)) { + continue; + } + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + continue; + } + + for (auto const& atrack : besttracks) { + if (!isBestTrackSelected(atrack)) { + continue; + } + // auto itrack = atrack.mfttrack_as(); + // if (!isTrackSelected(itrack)) { + // continue; + // } + if (gConf.cfgUseTrackSel && !isTrackSelected(atrack)) { + continue; + } + float phi = atrack.phi(); + o2::math_utils::bringTo02Pi(phi); + if (phi < Czero || TwoPI < phi) { + continue; + } + auto trkBestCollId = atrack.has_collision() ? atrack.bestCollisionId() : -1; + // if (trkBestCollId != recCollId) { // check if best track is associated to original rec coll + // continue; + // } + + bool isTrueVtx = false; + bool isRecGoodMatch = false; + bool isRecGood = false; + int vtxFlag = static_cast(VertexStatusMC::kNull); + + float vtxXbest = -1.; + float vtxYbest = -1.; + float vtxZbest = -1.; + float deltaXOrigMc = -1.; + float deltaYOrigMc = -1.; + float deltaZOrigMc = -1.; + // dca best rec - dca mc associated to best rec coll + float deltaX = -1.; + float deltaY = -1.; + float deltaZ = -1.; + + if (trkBestCollId >= 0 && atrack.has_mcParticle() && atrack.mcMask() == 0) { + auto itRecToMc = mapRecToMc.find(trkBestCollId); // try mfttrackId ??? + int64_t mcPartId = atrack.mcParticle().mcCollisionId(); + auto const& idCompColl = atrack.compatibleCollIds(); + + // check if rec vertex is available in MC collisions + for (const auto& mcTrkId : mapRecToMc) { + if (mcTrkId.second == mcPartId) { + isTrueVtx = true; + break; + } + } + + // check good rec vertex of corresponding mc coll is available in compatible rec coll + if (!idCompColl.empty()) { + for (auto const& id : idCompColl) { + auto itMcCollId = mapRecToMc.find(id); + if (itMcCollId != mapRecToMc.end()) { + if (itMcCollId->second == mcPartId) { + isRecGoodMatch = true; + break; + } + } + } + } + + // check if there is good or bad collision + if (itRecToMc != mapRecToMc.end()) { + int mcTrkCollId = itRecToMc->second; + if (mcPartId == mcTrkCollId) { // particle.mcCollisionId == collision.mcCollisionId -> good vtx + vtxFlag = static_cast(VertexStatusMC::kGood); + } else { // wrong vtx + vtxFlag = static_cast(VertexStatusMC::kBad); + } + } + + // + // check: vertex resolution of time-to-coll reassoc: pos(rec coll best) - gen (mc coll) + // + // const auto& particle = atrack.mcParticle_as(); + // // // auto collision = atrack.collision_as(); // not in use + // const auto& mcColl = particle.mcCollision_as(); + if (mapVtxXrec.find(trkBestCollId) == mapVtxXrec.end()) { + continue; + } + if (mapVtxYrec.find(trkBestCollId) == mapVtxYrec.end()) { + continue; + } + if (mapVtxZrec.find(trkBestCollId) == mapVtxZrec.end()) { + continue; + } + if (mapRecToMc.find(trkBestCollId) == mapRecToMc.end()) { + continue; + } + vtxXbest = mapVtxXrec.find(trkBestCollId)->second; + vtxYbest = mapVtxYrec.find(trkBestCollId)->second; + vtxZbest = mapVtxZrec.find(trkBestCollId)->second; + // LOGP(info, "\t ---> \t .... \t vtxZrec: {} - collision.posZ(): {}", vtxZrec, collision.posZ()); + int64_t mcCollIdRec = mapRecToMc.find(trkBestCollId)->second; + // int64_t mcCollId = itMC->second; + // LOGP(info, "\t ---> \t .... \t mcCollIdRec: {} - mcCollId: {} - bestMCCol: {}", mcCollIdRec, mcCollId, bestMCCol); + if (mapVtxXgen.find(mcCollIdRec) == mapVtxXgen.end()) { + continue; + } + if (mapVtxYgen.find(mcCollIdRec) == mapVtxYgen.end()) { + continue; + } + if (mapVtxZgen.find(mcCollIdRec) == mapVtxZgen.end()) { + continue; + } + // vertex resolution: best rec - mc associated to orig rec coll (first in time) + deltaXOrigMc = vtxXbest - mcCollision.posX(); + deltaYOrigMc = vtxYbest - mcCollision.posY(); + deltaZOrigMc = vtxZbest - mcCollision.posZ(); + // vertex resolution: best rec - mc associated to best rec coll + deltaX = vtxXbest - mapVtxXgen.find(mcCollIdRec)->second; + deltaY = vtxYbest - mapVtxYgen.find(mcCollIdRec)->second; + deltaZ = vtxZbest - mapVtxZgen.find(mcCollIdRec)->second; + } // has_mcParticle + + registry.fill(HIST("TimeAssocWithReassocMC/VtxStatus"), vtxFlag); + + hTimeAssocWithReassocMC[0]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[1]->Fill(deltaX, deltaY, deltaZ); + + if (isTrueVtx) { + hTimeAssocWithReassocMC[3]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[12]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxAllTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxAllFalse)); + } + if (isRecGood) { + hTimeAssocWithReassocMC[4]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[13]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodAllTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodAllFalse)); + } + if (isRecGoodMatch) { + hTimeAssocWithReassocMC[5]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[14]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodMatchAllTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodMatchAllFalse)); + } + + if (vtxFlag == static_cast(VertexStatusMC::kGood)) { + if (isTrueVtx) { + hTimeAssocWithReassocMC[6]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[15]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsGoodVtxFalse)); + } + if (isRecGood) { + hTimeAssocWithReassocMC[7]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[16]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodVsGoodVtxTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodVsGoodVtxFalse)); + } + if (isRecGoodMatch) { + hTimeAssocWithReassocMC[8]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[17]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsGoodVtxTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsGoodVtxFalse)); + } + } + + if (vtxFlag == static_cast(VertexStatusMC::kBad)) { + if (isTrueVtx) { + hTimeAssocWithReassocMC[9]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[18]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsTrueVtxVsBadVtxFalse)); + } + if (isRecGood) { + hTimeAssocWithReassocMC[10]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[19]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodVsBadVtxTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodVsBadVtxFalse)); + } + if (isRecGoodMatch) { + hTimeAssocWithReassocMC[11]->Fill(deltaXOrigMc, deltaYOrigMc, deltaZOrigMc); + hTimeAssocWithReassocMC[20]->Fill(deltaX, deltaY, deltaZ); + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsBadVtxTrue)); + } else { + registry.fill(HIST("TimeAssocWithReassocMC/hReassocCheckVtxType"), static_cast(ReassocCheckVtxType::kIsRecGoodMatchVsBadVtxFalse)); + } + } + } } - qaregistry.fill(HIST("Events/hMultMFTvsFT0A"), nBestTrks, collision.multFT0A()); - qaregistry.fill(HIST("Events/hMultMFTvsFT0C"), nBestTrks, collision.multFT0C()); - qaregistry.fill(HIST("Events/hNPVtracksVsFT0C"), collision.multNTracksPV(), collision.multFT0C()); - qaregistry.fill(HIST("Events/hMultMFTvsFV0A"), nBestTrks, collision.multFV0A()); - qaregistry.fill(HIST("Events/hNPVtracksVsMultMFT"), collision.multNTracksPV(), nBestTrks); + LOG(info) << "No MC: " << nNoMC; } + PROCESS_SWITCH(DndetaMFTPbPb, processTimeAssocWithReassocMC, "process MC: check MFT tracks in reassociation with compatible collisions", false); - void processCorrelationwBestTracksInclusive(CollsCorr::iterator const& collision, FiltMftTracks const& tracks, soa::SmallGroups const& besttracks) + Partition tracksInAcc = (aod::fwdtrack::eta < trackCuts.maxEta) && (aod::fwdtrack::eta > trackCuts.minEta); + + void processAssocMC(CollisionsWithMCLabels const& collisions, + MftTracksWCollsMC const& tracks, + aod::McParticles const& /*particles*/, + aod::McCollisions const& /*mccollisions*/ + ) { - processCorrelationwBestTracks(collision, tracks, besttracks); - } + const auto& nRecoColls = collisions.size(); + // Generated evets with >= 1 reco collisions + if (nRecoColls > CintZero) { + auto maxNcontributors = -1; + auto bestCollIndex = -1; + for (const auto& collision : collisions) { + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + } + } + for (const auto& collision : collisions) { + if (!isGoodEvent(collision)) { + continue; + } + // Select collisions with the largest number of contributors + if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { + continue; + } + if (!collision.has_mcCollision()) { + continue; + } + auto mcCollision = collision.template mcCollision_as(); - PROCESS_SWITCH(DndetaMFTPbPb, processCorrelationwBestTracksInclusive, "Do correlation study based on BestCollisionsFwd3d table", false); + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + continue; + } - int getQuadrantPhi(float phi) - { - if (phi >= Czero && phi < Cninety) { - return 0; - } - if (phi >= Cninety && phi <= ConeHeighty) { - return 1; - } - if (phi >= -ConeHeighty && phi < -Cninety) { - return 2; - } - if (phi >= -Cninety && phi < Czero) { - return 3; + int nTrk = 0, nFakeTrk = 0, nGoodTrk = 0; + for (const auto& track : tracks) { + uint index = uint(track.collisionId() >= 0); + if (track.has_mcParticle() && track.mcMask() == 0) { + // auto particle = track.mcParticle_as(); + const auto& particle = track.mcParticle(); + auto trkCollId = track.has_collision() ? track.collisionId() : -1; + auto ids = track.compatibleCollIds(); + qaregistry.fill(HIST("TrackToColl/histTrackNumColls"), ids.size()); + qaregistry.fill(HIST("TrackToColl/hAmbTrackType"), static_cast(AmbTrkType::kAll)); + + if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { + if (ids.empty()) { + qaregistry.fill(HIST("TrackToColl/hAmbTrackType"), static_cast(AmbTrkType::kOrphan)); + } + if (ids.size() == 1 && trkCollId == ids[0]) { + qaregistry.fill(HIST("TrackToColl/hAmbTrackType"), static_cast(AmbTrkType::kNonAmb)); + } + } + if (gConf.cfgRemoveOrphanTracks && ids.empty()) { + continue; + } + if (gConf.cfgRemoveTrivialAssoc) { + if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { + qaregistry.fill(HIST("TrackToColl/histNonAmbTrackNumColls"), ids.size()); + continue; + } + } + if (gConf.cfgRemoveAmbiguousTracks && (track.compatibleCollIds().size() != 1)) { + continue; + } + nTrk++; + if ((particle.mcCollisionId() != collision.mcCollision().globalIndex())) { + nFakeTrk++; + continue; + } + if (collision.mcCollisionId() == particle.mcCollisionId()) { + nGoodTrk++; + } + if (ids.size() > 0) { + if (ids.size() == 1) { + if (trkCollId != ids[0]) { + qaregistry.fill(HIST("TrackToColl/hAmbTrackType"), static_cast(AmbTrkType::kAmb)); + } else { + qaregistry.fill(HIST("TrackToColl/hAmbTrackType"), static_cast(AmbTrkType::kNonAmbSame)); + } + } else { + qaregistry.fill(HIST("TrackToColl/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1)); + } + } + + bool isAmbiguous = (ids.size() > 1); + if (isAmbiguous) { + qaregistry.fill(HIST("TrackToColl/histAmbTrackNumColls"), ids.size()); + std::vector ambVtxZ{}; + for (const auto& collIdx : ids) { + const auto& ambColl = collisions.rawIteratorAt(collIdx); + ambVtxZ.push_back(ambColl.posZ()); + } + if (!ambVtxZ.empty()) { + qaregistry.fill(HIST("TrackToColl/histAmbTrackZvtxRMS"), computeRMS(ambVtxZ)); + } + } + + float deltaX = -999.f; + float deltaY = -999.f; + float deltaZ = -999.f; + if (index) { + const auto& collision = track.template collision_as(); + const auto& mcCollision = particle.template mcCollision_as(); + deltaX = collision.posX() - mcCollision.posX(); + deltaY = collision.posY() - mcCollision.posY(); + deltaZ = collision.posZ() - mcCollision.posZ(); + if (collision.has_mcCollision() && collision.mcCollisionId() == particle.mcCollisionId()) { + hCollAssoc[index + 1]->Fill(track.pt(), track.eta(), deltaX, deltaY, deltaZ); + } else { + if (isAmbiguous) { + for (const auto& collIdx : ids) { + auto ambColl = collisions.rawIteratorAt(collIdx); + if (ambColl.has_mcCollision() && ambColl.mcCollisionId() == particle.mcCollisionId()) { + hCollAssoc[index + 2]->Fill(track.pt(), track.eta(), deltaX, deltaY, deltaZ); + // hCollAssoc[index + 2]->Fill(track.pt(), track.eta(), ambColl.posX() - mcCollision.posX(), ambColl.posY() - mcCollision.posY(), ambColl.posZ() - mcCollision.posZ()); + break; + } + } + } + } + hCollAssoc[index]->Fill(track.pt(), track.eta(), deltaX, deltaY, deltaZ); + } + } else { + hCollAssoc[index]->Fill(track.pt(), track.eta(), -999.f, -999.f, -999.f); + } + } + float frac = (nTrk > 0) ? static_cast(nGoodTrk) / nTrk : -1.; + qaregistry.fill(HIST("TrackToColl/histFracGoodTracks"), frac); + float fracFake = (nTrk > 0) ? static_cast(nFakeTrk) / nTrk : -1.; + qaregistry.fill(HIST("TrackToColl/histFracTracksFakeMcColl"), fracFake); + } } - return -1; } - template - int getQuadrantTrack(T const& track) - { - float phi = static_cast(track.phi()) * ConeHeighty / PI; - return getQuadrantPhi(phi); - } + PROCESS_SWITCH(DndetaMFTPbPb, processAssocMC, "Process collision-association information, requires extra table from TrackToCollisionAssociation task (fillTableOfCollIdsPerTrack=true)", false); - /// @brief process function to check MFT alignment (based on BestCollisionsFwd3d table) - template - void processAlignment(typename C::iterator const& collision, - FiltMftTracks const& /*tracks*/, - soa::SmallGroups const& besttracks, - CollBCs const& /*bcs*/ + template + void processReAssocMC(CollisionsWithMCLabels const& collisions, + B const& besttracks, + FiltMcMftTracks const& /*tracks*/, + aod::McCollisions const& /*mcCollisions*/, + aod::McParticles const& /*particles*/ ) { - auto bc = collision.template foundBC_as(); - if (!isGoodEvent(collision)) { - return; - } + const auto& nRecoColls = collisions.size(); + registry.fill(HIST("ReAssocMC/hNReAssocRecoColls"), 1.f, nRecoColls); - if (gConf.cfgDoIR) { - initHadronicRate(bc); - float ir = !gConf.cfgIRSource.value.empty() ? rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), gConf.cfgIRSource, gConf.cfgIRCrashOnNull) * 1.e-3 : -1; - float seconds = bc.timestamp() * 1.e-3 - mMinSeconds; - if (gConf.cfgUseIRCut && (ir < eventCuts.minIR || ir > eventCuts.maxIR)) { // cut on hadronic rate - return; - } - gCurrentHadronicRate->Fill(seconds, ir); - } + if (nRecoColls > CintZero) { - auto z = collision.posZ(); - for (auto const& atrack : besttracks) { - if (!isBestTrackSelected(atrack)) { - continue; - } - auto itrack = atrack.template mfttrack_as(); - if (!isTrackSelected(itrack)) { - continue; + mapVtxXrec.clear(); + mapVtxYrec.clear(); + mapVtxZrec.clear(); + mapMcCollIdPerRecColl.clear(); + mapVtxXrec.reserve(collisions.size()); + mapVtxYrec.reserve(collisions.size()); + mapVtxZrec.reserve(collisions.size()); + mapMcCollIdPerRecColl.reserve(collisions.size()); + + auto maxNcontributors = -1; + auto bestCollIndex = -1; + for (auto const& collision : collisions) { + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + mapVtxXrec.emplace(collision.globalIndex(), collision.posX()); + mapVtxYrec.emplace(collision.globalIndex(), collision.posY()); + mapVtxZrec.emplace(collision.globalIndex(), collision.posZ()); + mapMcCollIdPerRecColl.emplace(collision.globalIndex(), collision.mcCollisionId()); + } } - int quadrant = getQuadrantTrack(itrack); - if (quadrant < 0) { - continue; + int nNoMC{0}; + for (const auto& collision : collisions) { + registry.fill(HIST("ReAssocMC/hReAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsAll)); + if (!isGoodEvent(collision)) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsSelected)); + if (!collision.has_mcCollision()) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsHasMcColl)); + + int64_t recCollId = collision.globalIndex(); + auto itMC = mapMcCollIdPerRecColl.find(recCollId); + if (itMC == mapMcCollIdPerRecColl.end()) { + nNoMC++; + continue; + } + + auto mcColl = collision.template mcCollision_as(); + // Select collisions with the largest number of contributors + if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsSplitVtxRemoved)); + if (eventCuts.useZVtxCutMC && (std::abs(mcColl.posZ()) >= eventCuts.maxZvtx)) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCEventStatus"), static_cast(ReAssocMCEventStatus::kEvtReAsZVtxCutMC)); + + for (auto const& atrack : besttracks) { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkReAssocAll)); + if (!isBestTrackSelected(atrack)) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkBestSel)); + + auto itrack = atrack.template mfttrack_as(); + + if (!isTrackSelected(itrack)) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkSel)); + float phi = itrack.phi(); + o2::math_utils::bringTo02Pi(phi); + if (phi < Czero || TwoPI < phi) { + continue; + } + if (!itrack.has_collision()) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkHasColl)); + if (gConf.cfgRemoveReassigned) { + if (itrack.collisionId() != atrack.bestCollisionId()) { + continue; + } + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkReassignedRemoved)); + } + + if (itrack.collisionId() >= 0 && itrack.has_mcParticle() && itrack.mcMask() == 0) { + + auto particle = itrack.template mcParticle_as(); + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { + continue; + } + auto collision = itrack.template collision_as(); + + float deltaX = -999.f; + float deltaY = -999.f; + float deltaZ = -999.f; + + if (mapVtxXrec.find(atrack.bestCollisionId()) == mapVtxXrec.end()) { + continue; + } + if (mapVtxYrec.find(atrack.bestCollisionId()) == mapVtxYrec.end()) { + continue; + } + if (mapVtxZrec.find(atrack.bestCollisionId()) == mapVtxZrec.end()) { + continue; + } + if (mapMcCollIdPerRecColl.find(atrack.bestCollisionId()) == mapMcCollIdPerRecColl.end()) { + continue; + } + const float vtxXbest = mapVtxXrec.find(atrack.bestCollisionId())->second; + const float vtxYbest = mapVtxYrec.find(atrack.bestCollisionId())->second; + const float vtxZbest = mapVtxZrec.find(atrack.bestCollisionId())->second; + // LOGP(info, "\t ---> \t .... \t vtxZrec: {} - collision.posZ(): {}", vtxZrec, collision.posZ()); + const float mcCollIdRec = mapMcCollIdPerRecColl.find(atrack.bestCollisionId())->second; + // LOGP(info, "\t ---> \t .... \t mcCollIdRec: {} - bestMCCol: {}", mcCollIdRec, bestMCCol); + + auto vtxXtruth = atrack.mcParticle().mcCollision().posX(); + auto vtxYtruth = atrack.mcParticle().mcCollision().posY(); + auto vtxZtruth = atrack.mcParticle().mcCollision().posZ(); + + deltaX = vtxXbest - vtxXtruth; + deltaY = vtxYbest - vtxYtruth; + deltaZ = vtxZbest - vtxZtruth; + + const auto dcaXtruth(particle.vx() - particle.mcCollision().posX()); + const auto dcaYtruth(particle.vy() - particle.mcCollision().posY()); + const auto dcaZtruth(particle.vz() - particle.mcCollision().posZ()); + auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + dcaYtruth * dcaYtruth); + + // check good rec vertex of corresponding mc coll is available in compatible rec coll + auto const& ids = atrack.compatibleCollIds(); + bool isInCoColl = false; + if (atrack.ambDegree() != 0) { + const int mcCollId = atrack.mcParticle().mcCollisionId(); + if (!ids.empty()) { + for (auto const& id : ids) { + auto itMcCollId = mapMcCollIdPerRecColl.find(id); + if (itMcCollId != mapMcCollIdPerRecColl.end()) { + if (itMcCollId->second == mcCollId) { + isInCoColl = true; + break; + } + } + } + } + } + + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkHasMcPart)); + + if (ids.size() > 0) { + if (ids.size() == 1) { + if (itrack.collisionId() == ids[0]) { // non ambiguous + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkNonAmbAll)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbAll)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbAll)]->Fill(particle.pt(), particle.eta(), 0., 0., dcaXYtruth, dcaZtruth); + if (collision.mcCollisionId() == particle.mcCollisionId()) { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkNonAmbGood)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbGood)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbGood)]->Fill(particle.pt(), particle.eta(), 0., 0., dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkNonAmbBad)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbBad)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbBad)]->Fill(particle.pt(), particle.eta(), 0., 0., dcaXYtruth, dcaZtruth); + } + } else if (itrack.collisionId() != ids[0]) { // ambiguous extra + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkAmbAll)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkAmbAll)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkAmbAll)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + + if (collision.mcCollisionId() == particle.mcCollisionId()) { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkAmbGood)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkAmbGood)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkAmbGood)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkAmbBad)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkAmbBad)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkAmbBad)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } + } else { // non ambiguous (extra) + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkNonAmbAllE)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbAllE)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbAllE)]->Fill(particle.pt(), particle.eta(), 0., 0., dcaXYtruth, dcaZtruth); + + if (collision.mcCollisionId() == particle.mcCollisionId()) { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkNonAmbGoodE)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbGoodE)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbGoodE)]->Fill(particle.pt(), particle.eta(), 0., 0., dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kTrkNonAmbBadE)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kTrkNonAmbBadE)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kTrkNonAmbBadE)]->Fill(particle.pt(), particle.eta(), 0., 0., dcaXYtruth, dcaZtruth); + } + } + } else { // ambiguous + + if (itrack.collisionId() == atrack.bestCollisionId()) { // associated + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssoc)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssoc)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssoc)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + + if (collision.has_mcCollision() && mcCollIdRec == particle.mcCollisionId()) { // good coll + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssocGood)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocGood)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocGood)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + + if (isInCoColl) { // coll vertex is among compatible colls + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssocGoodIsCompTrue)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompTrue)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompTrue)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssocGoodIsCompFalse)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompFalse)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocGoodIsCompFalse)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssocBad)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocBad)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocBad)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + + if (isInCoColl) { // coll vertex is among compatible colls + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssocBadIsCompTrue)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocBadIsCompTrue)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocBadIsCompTrue)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kAssocBadIsCompFalse)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kAssocBadIsCompFalse)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kAssocBadIsCompFalse)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } + } + } else { // reassociated + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssoc)); + if (collision.has_mcCollision() && mcCollIdRec == particle.mcCollisionId()) { // good coll + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssocGood)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocGood)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocGood)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + + if (isInCoColl) { // coll vertex is among compatible colls + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssocGoodIsCompTrue)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompTrue)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompTrue)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssocGoodIsCompFalse)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompFalse)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocGoodIsCompFalse)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssocBad)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocBad)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocBad)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + + if (isInCoColl) { // coll vertex is among compatible colls + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssocBadIsCompTrue)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompTrue)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompTrue)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } else { + registry.fill(HIST("ReAssocMC/hReAssocMCTrackStatus"), static_cast(ReAssocMCTrackStatus::kReAssocBadIsCompFalse)); + hReAssocVtxRes[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompFalse)]->Fill(particle.pt(), particle.eta(), deltaX, deltaY, deltaZ); + hReAssocDCA[static_cast(HistStatusReAssocVtx::kReAssocBadIsCompFalse)]->Fill(particle.pt(), particle.eta(), atrack.bestDCAXY(), atrack.bestDCAZ(), dcaXYtruth, dcaZtruth); + } + } + } + } + } + } + } } - std::get>(hAlignment[0][quadrant][0]["DCA_x_vs_z"])->Fill(z, atrack.bestDCAXY()); + mapVtxXrec.clear(); + mapVtxYrec.clear(); + mapVtxZrec.clear(); + mapMcCollIdPerRecColl.clear(); + LOG(info) << "No MC: " << nNoMC; } } - void processAlignmentInclusive(Colls::iterator const& collision, - FiltMftTracks const& tracks, - soa::SmallGroups const& besttracks, - CollBCs const& bcs) + void processReAssoc3dMC(CollisionsWithMCLabels const& collisions, + BestTracks3dWCollsMC const& besttracks, + FiltMcMftTracks const& tracks, + aod::McCollisions const& mcCollisions, + aod::McParticles const& particles) { - processAlignment(collision, tracks, besttracks, bcs); + processReAssocMC(collisions, besttracks, tracks, mcCollisions, particles); } - - PROCESS_SWITCH(DndetaMFTPbPb, processAlignmentInclusive, "Check MFT alignment using tracks based on BestCollisionsFwd3d table (inclusive)", false); + PROCESS_SWITCH(DndetaMFTPbPb, processReAssoc3dMC, "Process re-association information based on BestCollisionsFwd3d table", false); Preslice compCollPerCol = o2::aod::fwdtrack::collisionId; /// @brief process function to check reassociation efficiency - void processReassocEfficiency(CollsMCExtra::iterator const& mcCollision, + void processReassocEfficiency(CollsMCExtraMult::iterator const& mcCollision, soa::SmallGroups const& collisions, MftTracksWCollsMC const& tracks, aod::McParticles const& particles, @@ -3739,12 +4827,10 @@ struct DndetaMFTPbPb { continue; } // Select collisions with the largest number of contributors - if (bestCollIndex != collision.globalIndex()) { + if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { continue; } - registry.fill(HIST("Events/Centrality/ReEffStatus"), 1, crec); - if (!collision.has_mcCollision()) { continue; } @@ -3769,8 +4855,17 @@ struct DndetaMFTPbPb { auto bestCol = track.has_collision() ? track.collisionId() : -1; uint index = uint(track.collisionId() >= 0); - bool isAmbiguous = (track.compatibleCollIds().size() > 1); + auto ids = track.compatibleCollIds(); + bool isAmbiguous = (ids.size() > 1); + if (gConf.cfgRemoveReassigned) { + if (ids.empty() || (ids.size() == 1 && bestCol == ids[0])) { + continue; + } + } + if (gConf.cfgRemoveOrphanTracks && ids.empty()) { + continue; + } if (!track.has_mcParticle()) { continue; } @@ -3784,18 +4879,11 @@ struct DndetaMFTPbPb { if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { continue; } - - if (gConf.cfgRemoveReassigned) { - if (track.compatibleCollIds().empty() || (track.compatibleCollIds().size() == 1 && bestCol == track.compatibleCollIds()[0])) { - continue; - } - } - int bestMCCol = -1; o2::track::TrackParCovFwd trackPar = o2::aod::fwdtrackutils::getTrackParCovFwdShift(track, mZShift); if (index) { - auto mcCollision = particle.mcCollision_as(); + auto mcCollision = particle.mcCollision_as(); if (eventCuts.useZDiffCut) { if (std::abs(collision.posZ() - mcCollision.posZ()) > eventCuts.maxZvtxDiff) { continue; @@ -3909,86 +4997,302 @@ struct DndetaMFTPbPb { PROCESS_SWITCH(DndetaMFTPbPb, processReassocEfficiency, "Process collision-reassociation efficiency based on track propagation DCA 3D (in FT0C centrality bins)", false); - /// @brief process function to calculate signal loss based on MC - void processEventAndSignalLossCentFT0C(CollsMCExtra::iterator const& mcCollision, - soa::SmallGroups> const& collisions, - FiltParticles const& particles) + Preslice mftTrkCompCollperCol = o2::aod::fwdtrack::collisionId; + + /// @brief process template function for DCA MC checks + template + void processSecondariesMC(typename soa::Join const& collisions, + MftTracksWCollsMC const& tracks, + MC const& mcCollisions, + aod::McParticles const& particles, + ExtBCs const& bcs) { - registry.fill(HIST("Events/Centrality/hNRecCollsSigEvtLoss"), 1.f, collisions.size()); + registry.fill(HIST("Events/hNGenRecColls"), 1.f, collisions.size()); + registry.fill(HIST("Events/hNGenRecColls"), 2.f, mcCollisions.size()); - if (gConf.cfgUseInelgt0 && !mcCollision.isInelGt0()) { - return; - } - if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + if (bcs.size() == 0) { return; } + auto bc = bcs.begin(); + initCCDB(bc); - bool gtZeroColl = false; - auto maxNcontributors = -1; - auto centrality = -1; - for (auto const& collision : collisions) { - if (!isGoodEvent(collision)) { - continue; - } - if (std::abs(collision.posZ()) >= eventCuts.maxZvtx) { - continue; - } - if (maxNcontributors < collision.numContrib()) { - maxNcontributors = collision.numContrib(); - centrality = getRecoCent(collision); + // Generated evets with >= 1 reco collisions + const auto& nRecoColls = collisions.size(); + if (nRecoColls > CintZero) { + auto maxNcontributors = -1; + auto bestCollIndex = -1; + auto crec = -1; + for (auto const& collision : collisions) { + if (!isGoodEvent(collision)) { + continue; + } + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + if constexpr (has_reco_cent) { + crec = getRecoCent(collision); + } + } } - gtZeroColl = true; - } - auto perCollMCsample = mcSample->sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto multMCNParticlesEtaMFT = countPart(perCollMCsample); + for (const auto& collision : collisions) { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("Events/Centrality/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kAllRecColl), crec); + } else { + qaregistry.fill(HIST("Events/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kAllRecColl)); + } + // At least one generated primary in MFT acceptance + TVX triggered collisions + if (gConf.cfgUseInelgt0wMFT && !isInelGt0wMft(particles)) { + return; + } + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("Events/Centrality/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kIsInelGt0wMft), crec); + } else { + qaregistry.fill(HIST("Events/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kIsInelGt0wMft)); + } + if (!isGoodEvent(collision)) { + continue; + } + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("Events/Centrality/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kEvtSel), crec); + } else { + qaregistry.fill(HIST("Events/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kEvtSel)); + } + // Select collisions with the largest number of contributors + if (gConf.cfgRemoveSplitVertex && (bestCollIndex != collision.globalIndex())) { + continue; + } + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("Events/Centrality/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kBestCollIdx), crec); + } else { + qaregistry.fill(HIST("Events/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kBestCollIdx)); + } + if (!collision.has_mcCollision()) { + continue; + } + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("Events/Centrality/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kIsMcColl), crec); + } else { + qaregistry.fill(HIST("Events/hTrackToCollEvtType"), static_cast(TrackToCollEvtType::kIsMcColl)); + } - registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 1., centrality); - registry.fill(HIST("Events/Centrality/hMultGenVsCent"), centrality, mcCollision.multMCFT0C()); - registry.fill(HIST("Events/Centrality/hMultGenVsCentNParticlesEta05"), centrality, mcCollision.multMCNParticlesEta05()); - registry.fill(HIST("Events/Centrality/hMultGenVsCentNParticlesEtaMFT"), centrality, multMCNParticlesEtaMFT); + auto trkPerColl = tracks.sliceBy(mftTrkCompCollperCol, collision.globalIndex()); + for (auto const& track : trkPerColl) { + if (!isTrackSelected(track)) { + continue; + } + if (!track.has_collision()) { + continue; + } + auto trkCollId = track.has_collision() ? track.collisionId() : -1; + auto ids = track.compatibleCollIds(); + bool isAmbiguous = (ids.size() > 1); - if (collisions.size() == 0) { - registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 3., centrality); - } + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kAll), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kAll)); + } + if (ids.empty()) { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kOrphan), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kOrphan)); + } + } + if (ids.size() > 0) { + if (ids.size() == 1) { + if (trkCollId == ids[0]) { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kNonAmb), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kNonAmb)); + } + } else if (trkCollId != ids[0]) { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kAmb), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kAmb)); + } + } else { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kNonAmbSame), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kNonAmbSame)); + } + } + } else { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kAmbGt1)); + } + } + } else { + if constexpr (has_reco_cent) { + qaregistry.fill(HIST("TrkCompColls/Centrality/hAmbTrackType"), static_cast(AmbTrkType::kOrphanNull), crec); + } else { + qaregistry.fill(HIST("TrkCompColls/hAmbTrackType"), static_cast(AmbTrkType::kOrphanNull)); + } + } - if (gtZeroColl) { - registry.fill(HIST("Events/Centrality/EvtSigLossStatus"), 2., centrality); - registry.fill(HIST("Events/Centrality/hMultGenVsCentRec"), centrality, mcCollision.multMCFT0C()); - registry.fill(HIST("Events/Centrality/hMultGenVsCentRecNParticlesEta05"), centrality, mcCollision.multMCNParticlesEta05()); - registry.fill(HIST("Events/Centrality/hMultGenVsCentRecNParticlesEtaMFT"), centrality, multMCNParticlesEtaMFT); - } + if (gConf.cfgRemoveTrivialAssoc) { + if (ids.empty() || (ids.size() == 1 && trkCollId == ids[0])) { + qaregistry.fill(HIST("TrkCompColls/Centrality/histNonAmbTrackNumColls"), ids.size()); + continue; + } + } - for (auto const& particle : particles) { - if (!isChrgParticle(particle.pdgCode())) { - continue; - } - if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { - continue; - } + if (isAmbiguous) { + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnRecAmb"), track.pt(), track.eta(), collision.posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnRecAmb"), track.pt(), track.eta(), collision.posZ()); + } + } else { + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnRec"), track.pt(), track.eta(), collision.posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnRec"), track.pt(), track.eta(), collision.posZ()); + } + if (trkCollId == ids[0]) { + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnRecNonAmb"), track.pt(), track.eta(), collision.posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnRecNonAmb"), track.pt(), track.eta(), collision.posZ()); + } + } + if (trkCollId != ids[0]) { + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnRecAmbRest"), track.pt(), track.eta(), collision.posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnRecAmbRest"), track.pt(), track.eta(), collision.posZ()); + } + } + } - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - if (phi < Czero || TwoPI < phi) { - continue; - } + // remove orphan tracks + if (ids.empty()) { + continue; + } + // remove fake tracks + if (!track.has_mcParticle() || track.mcMask() != 0) { + continue; + } + // assigned collision index + uint index = uint(track.collisionId() >= 0); + auto particle = track.template mcParticle_as(); + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (particle.eta() <= trackCuts.minEta || particle.eta() >= trackCuts.maxEta) { + continue; + } + if (gConf.cfgUseParticleSel && !isParticleSelected(particle)) { + continue; + } - registry.fill(HIST("Tracks/Centrality/EtaCentVsMultGen_t"), particle.eta(), centrality, mcCollision.multMCFT0C()); - registry.fill(HIST("Tracks/Centrality/EtaGen_t"), particle.eta(), centrality); + if (index) { + auto mcCollision = particle.template mcCollision_as(); + if (eventCuts.useZVtxCutMC && (std::abs(mcCollision.posZ()) >= eventCuts.maxZvtx)) { + continue; + } + if (eventCuts.useZDiffCut) { + if (std::abs(collision.posZ() - mcCollision.posZ()) > eventCuts.maxZvtxDiff) { + continue; + } + } - if (gtZeroColl) { - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - if (phi < Czero || TwoPI < phi) { - continue; + if (collision.has_mcCollision() && collision.mcCollisionId() == particle.mcCollisionId()) { + if (!particle.isPhysicalPrimary()) { // Secondaries (weak decays and material) + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenSec"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenSec"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + if (particle.getProcess() == TMCProcess::kPDecay) { // Particles from decay + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenSecWeak"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenSecWeak"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } else { // Particles from the material + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenSecMat"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenSecMat"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } + } else { // Primaries + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenPrim"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenPrim"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } + } else { + if (isAmbiguous) { + for (const auto& collIdx : track.compatibleCollIds()) { + auto ambColl = collisions.rawIteratorAt(collIdx); + if (ambColl.has_mcCollision() && ambColl.mcCollisionId() == particle.mcCollisionId()) { + if (!particle.isPhysicalPrimary()) { // Secondaries (weak decays and material) + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenSecAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenSecAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + if (particle.getProcess() == TMCProcess::kPDecay) { // Particles from decay + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenSecWeakAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenSecWeakAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } else { // Particles from the material + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenSecMatAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenSecMatAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } + } else { // Primaries + if constexpr (has_reco_cent) { + registry.fill(HIST("Tracks/Centrality/THnGenPrimAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ(), crec); + } else { + registry.fill(HIST("Tracks/THnGenPrimAmb"), particle.pt(), particle.eta(), particle.mcCollision().posZ()); + } + } + break; + } + } + } + } + } } - registry.fill(HIST("Tracks/Centrality/EtaCentVsMultGen"), particle.eta(), centrality, mcCollision.multMCFT0C()); - registry.fill(HIST("Tracks/Centrality/EtaGen"), particle.eta(), centrality); } } } - PROCESS_SWITCH(DndetaMFTPbPb, processEventAndSignalLossCentFT0C, "Signal/event loss based on MC (in FT0C centrality bins)", false); + void processSecondariesMCInlcusive(soa::Join const& collisions, + MftTracksWCollsMC const& tracks, + aod::McCollisions const& mccollisions, + aod::McParticles const& particles, + ExtBCs const& bcs) + { + processSecondariesMC(collisions, tracks, mccollisions, particles, bcs); + } + + PROCESS_SWITCH(DndetaMFTPbPb, processSecondariesMCInlcusive, "Process secondaries checks (Inclusive)", false); + + void processSecondariesMCCentFT0C(soa::Join const& collisions, + MftTracksWCollsMC const& tracks, + aod::McCollisions const& mccollisions, + aod::McParticles const& particles, + ExtBCs const& bcs) + { + processSecondariesMC(collisions, tracks, mccollisions, particles, bcs); + } + + PROCESS_SWITCH(DndetaMFTPbPb, processSecondariesMCCentFT0C, "Process secondaries checks (in FT0C centrality bins)", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From dd542c4ef2296067b471bc9659ffbf3f90761eca Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 13 Apr 2026 23:32:46 +0200 Subject: [PATCH 255/282] [PWGEM/Dilepton] remove unnecessary config value (#15751) --- PWGEM/Dilepton/Core/Dilepton.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index d9c4c3cf9b0..c31d605078a 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -117,7 +117,6 @@ struct Dilepton { o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2SP:2, kFlowV3SP:3, kPolarization:4, kHFll:5, kBootstrapv2:6, kFlowV2EP:7, kFlowV3EP:8"}; o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - o2::framework::Configurable cfgEPEstimator{"cfgEPEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; @@ -1156,7 +1155,7 @@ struct Dilepton { {collision.ep3ft0m(), collision.ep3ft0a(), collision.ep3ft0c(), collision.ep3btot(), collision.ep3bpos(), collision.ep3bneg(), collision.ep3fv0a()}, // 3rd harmonics }; - float ep = RecoDecay::constrainAngle(eventplanes[nmod][cfgEPEstimator], -o2::constants::math::PI / nmod, static_cast(nmod)); + float ep = RecoDecay::constrainAngle(eventplanes[nmod][cfgQvecEstimator], -o2::constants::math::PI / nmod, static_cast(nmod)); float phi_ll = RecoDecay::constrainAngle(v12.Phi(), -o2::constants::math::PI / nmod, 1U); float dphi_ll_ep = std::fabs(RecoDecay::constrainAngle(phi_ll - ep, 0.f, static_cast(nmod))); From f28e8e8fb3b29eb39925386474eea3a4d3edfb97 Mon Sep 17 00:00:00 2001 From: yakparo Date: Tue, 14 Apr 2026 07:24:46 +0200 Subject: [PATCH 256/282] [PWGLF] Add custom grouping option for tracked cascades (#15753) --- PWGLF/Tasks/Strangeness/strangeCascTrack.cxx | 678 ++++++++++--------- 1 file changed, 375 insertions(+), 303 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx index de8e38ecbfb..4f2c3dea4d0 100644 --- a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx +++ b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx @@ -65,6 +65,7 @@ struct StrangeCascTrack { PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; PresliceUnsorted cascsPerMcCollision = aod::cascdata::straMCCollisionId; + Preslice cascsPerCollision = aod::cascdata::straCollisionId; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -122,10 +123,9 @@ struct StrangeCascTrack { Configurable cutMaxV0CosPA{"cutMaxV0CosPA", 1.1f, "max V0 cosPA"}; Configurable cutMinBachCosPA{"cutMinBachCosPA", -1.1f, "min Bachelor cosPA"}; Configurable cutMaxBachCosPA{"cutMaxBachCosPA", 1.1f, "max Bachelor cosPA"}; - Configurable> cutMinCascCosPaVsPt{ - "cutMinCascCosPaVsPt", - {0.993, 0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 0.999}, - "Min Casc CosPA per pT bin (same binning as axisPt)"}; + Configurable> cutMinCascCosPaVsPt{"cutMinCascCosPaVsPt", + {0.993, 0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 0.999}, + "Min Casc CosPA per pT bin (same binning as axisPt)"}; Configurable cutRapidity{"cutRapidity", 0.5f, "max rapidity"}; Configurable cutDauEta{"cutDauEta", 1.0f, "max eta of dau tracks"}; Configurable cutCompMassRej{"cutCompMassRej", 0.008f, "Competing mass rejection"}; @@ -407,333 +407,367 @@ struct StrangeCascTrack { } // applies selections for and fills histograms - template - void analyseCascs(TEvent collision, TCascs cascades) + template + void analyseCascade(TEvent collision, TCasc cascade) { - int64_t casccollid = 0; - for (auto const& cascade : cascades) { + if constexpr (requires { cascade.topologyChi2(); }) { + if (!cascade.has_standardCascade()) + return; // safety check: dismisses tracked cascades without proper reference + } + // for tracked cascades, make a reference to standard table + auto stdCasc = [&]() { if constexpr (requires { cascade.topologyChi2(); }) { - if (!cascade.has_standardCascade()) - continue; // safety check: dismisses tracked cascades without proper reference - } - - // for tracked cascades, make a reference to standard table - auto stdCasc = [&]() { - if constexpr (requires { cascade.topologyChi2(); }) { - if constexpr (requires { collision.straMCCollisionId(); }) { - return cascade.template standardCascade_as(); - } else { - return cascade.template standardCascade_as(); - } - } else { - return cascade; - } - }(); - - // Type 1 for tracked cascades, Type 0 for standard - static constexpr int Type = [&]() { - if constexpr (requires { cascade.topologyChi2(); }) { - return 1; + if constexpr (requires { collision.straMCCollisionId(); }) { + return cascade.template standardCascade_as(); } else { - return 0; + return cascade.template standardCascade_as(); } - }(); - - double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); // ion collisions use FT0C for multiplicity, pp uses both + } else { + return cascade; + } + }(); - // fill multiplicity for events with >=1 cascade - if (collision.index() != casccollid) { - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/EvMult"), mult); - if constexpr (requires { collision.straMCCollisionId(); }) { - if (isMCTruth(stdCasc, "Xi") || isMCTruth(stdCasc, "Omega")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/EvMult"), mult); - } - } - casccollid = collision.index(); + // Type 1 for tracked cascades, Type 0 for standard + static constexpr int Type = [&]() { + if constexpr (requires { cascade.topologyChi2(); }) { + return 1; + } else { + return 0; } + }(); - double massXi = cascade.mXi(); - double massOmega = cascade.mOmega(); - double pt = cascade.pt(); - double v0cosPA = cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - double casccosPA = cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()); - double bachEta = cascade.bacheloreta(); - double negEta = cascade.negativeeta(); - double posEta = cascade.positiveeta(); + double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); // ion collisions use FT0C for multiplicity, pp uses both - // fill filters for no cascade selections - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PropDCAz"), cascade.dcaZCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/V0CosPA"), v0cosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/CascCosPA"), casccosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/RapidityXi"), cascade.yXi()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PtVsRapidityXi"), pt, cascade.yXi()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/RapidityOmega"), cascade.yOmega()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PtVsRapidityOmega"), pt, cascade.yOmega()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/EtaDau"), bachEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/EtaDau"), negEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/EtaDau"), posEta); - // fill inv mass for no cascade selections - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/MassXi"), massXi); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/MassOmega"), massOmega); - // fill filters and inv mass for no cascade selections (MC truth) - if constexpr (requires { collision.straMCCollisionId(); }) { - if (isMCTruth(stdCasc, "Xi") || isMCTruth(stdCasc, "Omega")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/PropDCAz"), cascade.dcaZCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/V0CosPA"), v0cosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/CascCosPA"), casccosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/EtaDau"), bachEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/EtaDau"), negEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/EtaDau"), posEta); - if (isMCTruth(stdCasc, "Xi")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/RapidityXi"), cascade.yXi()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/MassXi"), massXi); - } - if (isMCTruth(stdCasc, "Omega")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/RapidityOmega"), cascade.yOmega()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/MassOmega"), massOmega); - } - } - } - // start checking selections - bool passedAllSelsXi = true; - bool passedAllSelsOmega = true; - bool fillTruthXi = false; - bool fillTruthOmega = false; - if constexpr (requires { collision.straMCCollisionId(); }) { + double massXi = cascade.mXi(); + double massOmega = cascade.mOmega(); + double pt = cascade.pt(); + double v0cosPA = cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); + double casccosPA = cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()); + double bachEta = cascade.bacheloreta(); + double negEta = cascade.negativeeta(); + double posEta = cascade.positiveeta(); + + // fill filters for no cascade selections + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PropDCAz"), cascade.dcaZCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/V0CosPA"), v0cosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/CascCosPA"), casccosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/RapidityXi"), cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PtVsRapidityXi"), pt, cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/RapidityOmega"), cascade.yOmega()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/PtVsRapidityOmega"), pt, cascade.yOmega()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/EtaDau"), bachEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/EtaDau"), negEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/Filters/EtaDau"), posEta); + // fill inv mass for no cascade selections + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/MassXi"), massXi); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/MassOmega"), massOmega); + // fill filters and inv mass for no cascade selections (MC truth) + if constexpr (requires { collision.straMCCollisionId(); }) { + if (isMCTruth(stdCasc, "Xi") || isMCTruth(stdCasc, "Omega")) { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/PropDCAz"), cascade.dcaZCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/V0CosPA"), v0cosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/CascCosPA"), casccosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/EtaDau"), bachEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/EtaDau"), negEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/EtaDau"), posEta); if (isMCTruth(stdCasc, "Xi")) { - fillTruthXi = true; + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/RapidityXi"), cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/MassXi"), massXi); } - } - if constexpr (requires { collision.straMCCollisionId(); }) { if (isMCTruth(stdCasc, "Omega")) { - fillTruthOmega = true; + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/Filters/RapidityOmega"), cascade.yOmega()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/MassOmega"), massOmega); } } - // apply pt cuts - if (doApplyPtCutsXi) { - if (isValidPt(cascade, "Xi", Type)) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 0.5); - if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 0.5); - } else { - passedAllSelsXi = false; - } + } + // start checking selections + bool passedAllSelsXi = true; + bool passedAllSelsOmega = true; + bool fillTruthXi = false; + bool fillTruthOmega = false; + if constexpr (requires { collision.straMCCollisionId(); }) { + if (isMCTruth(stdCasc, "Xi")) { + fillTruthXi = true; } - if (doApplyPtCutsOmega) { - if (isValidPt(cascade, "Omega", Type)) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 0.5); - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 0.5); - } else { - passedAllSelsOmega = false; - } + } + if constexpr (requires { collision.straMCCollisionId(); }) { + if (isMCTruth(stdCasc, "Omega")) { + fillTruthOmega = true; } - // apply general cascade cuts - if (doApplyGenCutsXi) { - auto genSels = isValidCasc(collision, cascade, stdCasc, "Xi"); - for (size_t i = 0; i < std::size(genSels); ++i) { - if (genSels[i]) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenFiltersXi"), (i + 0.5)); - if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenFiltersXi"), (i + 0.5)); - } - } - if (genSels[std::size(genSels) - 1]) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 1.5); - if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 1.5); - } else { - passedAllSelsXi = false; - } + } + // apply pt cuts + if (doApplyPtCutsXi) { + if (isValidPt(cascade, "Xi", Type)) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 0.5); + if (fillTruthXi) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 0.5); + } else { + passedAllSelsXi = false; } - if (doApplyGenCutsOmega) { - auto genSels = isValidCasc(collision, cascade, stdCasc, "Omega"); - for (size_t i = 0; i < std::size(genSels); ++i) { - if (genSels[i]) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenFiltersOmega"), (i + 0.5)); - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenFiltersOmega"), (i + 0.5)); - } - } - if (genSels[std::size(genSels) - 1]) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 1.5); - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 1.5); - } else { - passedAllSelsOmega = false; - } + } + if (doApplyPtCutsOmega) { + if (isValidPt(cascade, "Omega", Type)) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 0.5); + if (fillTruthOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 0.5); + } else { + passedAllSelsOmega = false; } - // apply tpc pid - if (doApplyTPCPIDXi) { - if (passesTPC(stdCasc, "Xi")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 2.5); + } + // apply general cascade cuts + if (doApplyGenCutsXi) { + auto genSels = isValidCasc(collision, cascade, stdCasc, "Xi"); + for (size_t i = 0; i < std::size(genSels); ++i) { + if (genSels[i]) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenFiltersXi"), (i + 0.5)); if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 2.5); - } else { - passedAllSelsXi = false; + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenFiltersXi"), (i + 0.5)); } } - if (doApplyTPCPIDOmega) { - if (passesTPC(stdCasc, "Omega")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 2.5); + if (genSels[std::size(genSels) - 1]) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 1.5); + if (fillTruthXi) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 1.5); + } else { + passedAllSelsXi = false; + } + } + if (doApplyGenCutsOmega) { + auto genSels = isValidCasc(collision, cascade, stdCasc, "Omega"); + for (size_t i = 0; i < std::size(genSels); ++i) { + if (genSels[i]) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenFiltersOmega"), (i + 0.5)); if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 2.5); - } else { - passedAllSelsOmega = false; + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenFiltersOmega"), (i + 0.5)); } } - // apply tof pid - if (doApplyTOFPIDXi) { - if (passesTOF(stdCasc, "Xi")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 3.5); - if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 3.5); - } else { - passedAllSelsXi = false; - } + if (genSels[std::size(genSels) - 1]) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 1.5); + if (fillTruthOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 1.5); + } else { + passedAllSelsOmega = false; } - if (doApplyTOFPIDOmega) { - if (passesTOF(stdCasc, "Omega")) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 3.5); - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 3.5); - } else { - passedAllSelsOmega = false; - } + } + // apply tpc pid + if (doApplyTPCPIDXi) { + if (passesTPC(stdCasc, "Xi")) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 2.5); + if (fillTruthXi) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 2.5); + } else { + passedAllSelsXi = false; } - // apply competing mass rej - if (doCompetingMassRej) { - if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > cascCuts.cutCompMassRej)) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 4.5); - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 4.5); - } else { - passedAllSelsOmega = false; - } + } + if (doApplyTPCPIDOmega) { + if (passesTPC(stdCasc, "Omega")) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 2.5); + if (fillTruthOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 2.5); + } else { + passedAllSelsOmega = false; } - - // fil rec histograms - if (passedAllSelsXi || passedAllSelsOmega) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/EvMult"), mult); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PropDCAz"), cascade.dcaZCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/V0CosPA"), v0cosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/CascCosPA"), casccosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/EtaDau"), bachEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/EtaDau"), negEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/EtaDau"), posEta); - if (passedAllSelsXi) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/RapidityXi"), cascade.yXi()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PtVsRapidityXi"), pt, cascade.yXi()); - } - if (passedAllSelsOmega) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/RapidityOmega"), cascade.yOmega()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PtVsRapidityOmega"), pt, cascade.yOmega()); - } - if (fillTruthXi || fillTruthOmega) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/EvMult"), mult); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/PropDCAz"), cascade.dcaZCascToPV()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/V0CosPA"), v0cosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/CascCosPA"), casccosPA); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/EtaDau"), bachEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/EtaDau"), negEta); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/EtaDau"), posEta); - if (passedAllSelsXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/RapidityXi"), cascade.yXi()); - if (passedAllSelsOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/RapidityOmega"), cascade.yOmega()); - } + } + // apply tof pid + if (doApplyTOFPIDXi) { + if (passesTOF(stdCasc, "Xi")) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 3.5); + if (fillTruthXi) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 3.5); + } else { + passedAllSelsXi = false; + } + } + if (doApplyTOFPIDOmega) { + if (passesTOF(stdCasc, "Omega")) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 3.5); + if (fillTruthOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 3.5); + } else { + passedAllSelsOmega = false; + } + } + // apply competing mass rej + if (doCompetingMassRej) { + if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > cascCuts.cutCompMassRej)) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 4.5); + if (fillTruthOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 4.5); + } else { + passedAllSelsOmega = false; } + } + + // fil rec histograms + if (passedAllSelsXi || passedAllSelsOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PropDCAz"), cascade.dcaZCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/V0CosPA"), v0cosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/CascCosPA"), casccosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/EtaDau"), bachEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/EtaDau"), negEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/EtaDau"), posEta); if (passedAllSelsXi) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 4.5); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXi"), massXi); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); - // fill for particle-antiparticle type - if (cascade.sign() < 0) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiMinus"), massXi); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiMinus"), massXi, pt, mult); - } - if (cascade.sign() > 0) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiPlus"), massXi); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiPlus"), massXi, pt, mult); - } - // fill truth - if (fillTruthXi) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 4.5); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassXi"), massXi); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Xi"), massXi, pt, mult); - // - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Xi"), pt, mult, cascade.yXi()); - } + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/RapidityXi"), cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PtVsRapidityXi"), pt, cascade.yXi()); } if (passedAllSelsOmega) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 5.5); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmega"), massOmega); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Omega"), massOmega, pt, mult); - // fill for particle-antiparticle type - if (cascade.sign() < 0) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaMinus"), massOmega); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaMinus"), massOmega, pt, mult); - } - if (cascade.sign() > 0) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaPlus"), massOmega); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaPlus"), massOmega, pt, mult); - } - // fill truth - if (fillTruthOmega) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 5.5); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassOmega"), massOmega); - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Omega"), massOmega, pt, mult); - // - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Omega"), pt, mult, cascade.yOmega()); - } + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/RapidityOmega"), cascade.yOmega()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Filters/PtVsRapidityOmega"), pt, cascade.yOmega()); + } + if (fillTruthXi || fillTruthOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/PropDCAxy"), cascade.dcaXYCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/PropDCAz"), cascade.dcaZCascToPV()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/BachCosPA"), stdCasc.bachBaryonCosPA()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/V0CosPA"), v0cosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/CascCosPA"), casccosPA); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/EtaDau"), bachEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/EtaDau"), negEta); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/EtaDau"), posEta); + if (passedAllSelsXi) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/RapidityXi"), cascade.yXi()); + if (passedAllSelsOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/RapidityOmega"), cascade.yOmega()); + } + } + if (passedAllSelsXi) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 4.5); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXi"), massXi); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); + // fill for particle-antiparticle type + if (cascade.sign() < 0) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiMinus"), massXi); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiMinus"), massXi, pt, mult); + } + if (cascade.sign() > 0) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiPlus"), massXi); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiPlus"), massXi, pt, mult); + } + // fill truth + if (fillTruthXi) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 4.5); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassXi"), massXi); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Xi"), massXi, pt, mult); + // + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Xi"), pt, mult, cascade.yXi()); + } + } + if (passedAllSelsOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 5.5); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmega"), massOmega); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Omega"), massOmega, pt, mult); + // fill for particle-antiparticle type + if (cascade.sign() < 0) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaMinus"), massOmega); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaMinus"), massOmega, pt, mult); } + if (cascade.sign() > 0) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaPlus"), massOmega); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaPlus"), massOmega, pt, mult); + } + // fill truth + if (fillTruthOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 5.5); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassOmega"), massOmega); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Omega"), massOmega, pt, mult); + // + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Omega"), pt, mult, cascade.yOmega()); + } + } - // statistics - compare gen and reco pt and rapidity - if constexpr (requires { collision.straMCCollisionId(); }) { - if constexpr (requires { stdCasc.has_cascMCCore(); }) { - auto cascmccore = stdCasc.template cascMCCore_as(); - double genPt = cascmccore.ptMC(); - double genYXi = cascmccore.rapidityMC(0); - double genYOmega = cascmccore.rapidityMC(2); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/GenRecPt"), genPt, pt); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/GenRecRapidityXi"), genYXi, cascade.yXi()); - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); + // statistics - compare gen and reco pt and rapidity + int charmBeautyCodes = 4000; + if constexpr (requires { collision.straMCCollisionId(); }) { + if constexpr (requires { stdCasc.has_cascMCCore(); }) { + auto cascmccore = stdCasc.template cascMCCore_as(); + double genPt = cascmccore.ptMC(); + double genYXi = cascmccore.rapidityMC(0); + double genYOmega = cascmccore.rapidityMC(2); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/GenRecPt"), genPt, pt); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/GenRecRapidityXi"), genYXi, cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); + if (fillTruthXi || fillTruthOmega) + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/GenRecPt"), genPt, pt); + if (passedAllSelsOmega || passedAllSelsXi) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenRecPt"), genPt, pt); if (fillTruthXi || fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/GenRecPt"), genPt, pt); - if (passedAllSelsOmega || passedAllSelsXi) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenRecPt"), genPt, pt); - if (fillTruthXi || fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenRecPt"), genPt, pt); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenRecPt"), genPt, pt); + } + if (fillTruthXi) { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/GenRecRapidityXi"), genYXi, cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAxyPrimaryXi"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAzPrimaryXi"), cascade.dcaZCascToPV(), pt, mult); + if (std::abs(cascmccore.pdgCodeMother()) > charmBeautyCodes) { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAxyDecayXi"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAzDecayXi"), cascade.dcaZCascToPV(), pt, mult); + } else { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAxyDirectXi"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAzDirectXi"), cascade.dcaZCascToPV(), pt, mult); } - if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/GenRecRapidityXi"), genYXi, cascade.yXi()); - if (passedAllSelsXi) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenRecRapidityXi"), genYXi, cascade.yXi()); - if (fillTruthXi) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenRecRapidityXi"), genYXi, cascade.yXi()); + } + if (passedAllSelsXi) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenRecRapidityXi"), genYXi, cascade.yXi()); + if (fillTruthXi) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenRecRapidityXi"), genYXi, cascade.yXi()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAxyPrimaryXi"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAzPrimaryXi"), cascade.dcaZCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Radius/PrimaryXi"), cascade.cascradius(), pt); + if (std::abs(cascmccore.pdgCodeMother()) > charmBeautyCodes) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAxyDecayXi"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAzDecayXi"), cascade.dcaZCascToPV(), pt, mult); + } else { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAxyDirectXi"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAzDirectXi"), cascade.dcaZCascToPV(), pt, mult); + } } - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); - if (passedAllSelsOmega) { - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); - if (fillTruthOmega) - histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); + } + if (fillTruthOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAxyPrimaryOmega"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAzPrimaryOmega"), cascade.dcaZCascToPV(), pt, mult); + if (std::abs(cascmccore.pdgCodeMother()) > charmBeautyCodes) { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAxyDecayOmega"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAzDecayOmega"), cascade.dcaZCascToPV(), pt, mult); + } else { + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAxyDirectOmega"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/NoSel-Truth/DCA/DCAzDirectOmega"), cascade.dcaZCascToPV(), pt, mult); + } + } + if (passedAllSelsOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); + if (fillTruthOmega) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenRecRapidityOmega"), genYOmega, cascade.yOmega()); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAxyPrimaryOmega"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAzPrimaryOmega"), cascade.dcaZCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Radius/PrimaryOmega"), cascade.cascradius(), pt); + if (std::abs(cascmccore.pdgCodeMother()) > charmBeautyCodes) { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAxyDecayOmega"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAzDecayOmega"), cascade.dcaZCascToPV(), pt, mult); + } else { + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAxyDirectOmega"), cascade.dcaXYCascToPV(), pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/DCA/DCAzDirectOmega"), cascade.dcaZCascToPV(), pt, mult); + } } } } } } + template + void analyseCascs(TEvent const& collision, TCascs const& cascades) + { + for (auto const& cascade : cascades) { + analyseCascade(collision, cascade); + } + } + void init(InitContext const&) { // check if cut configuration is valid @@ -773,7 +807,6 @@ struct StrangeCascTrack { histos.add(Form("%s/NoSel/Filters/RapidityOmega", TypeNames[Type].data()), "y under Omega hypothesis", kTH1D, {{200, -1.0, 1.0}}); histos.add(Form("%s/NoSel/Filters/PtVsRapidityOmega", TypeNames[Type].data()), "pt vs y under Xi hypothesis", kTH2D, {axesConfig.axisPt, {200, -1.0, 1.0}}); histos.add(Form("%s/NoSel/Filters/EtaDau", TypeNames[Type].data()), "|#eta| of dau tracks", kTH1D, {axesConfig.axisEta}); - histos.add(Form("%s/NoSel/EvMult", TypeNames[Type].data()), "Multiplicity of events with >=1 cascade", kTH1D, {axesConfig.axisMult}); histos.add(Form("%s/NoSel/GenRecPt", TypeNames[Type].data()), "Generated vs reconstructed pt", kTH2D, {axesConfig.axisPt, axesConfig.axisPt}); histos.add(Form("%s/NoSel/GenRecRapidityXi", TypeNames[Type].data()), "Generated vs reconstructed y (Xi)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); histos.add(Form("%s/NoSel/GenRecRapidityOmega", TypeNames[Type].data()), "Generated vs reconstructed y (Omega)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); @@ -788,12 +821,24 @@ struct StrangeCascTrack { histos.add(Form("%s/NoSel-Truth/Filters/RapidityXi", TypeNames[Type].data()), "y under Xi hypothesis", kTH1D, {{200, -1.0, 1.0}}); histos.add(Form("%s/NoSel-Truth/Filters/RapidityOmega", TypeNames[Type].data()), "y under Omega hypothesis", kTH1D, {{200, -1.0, 1.0}}); histos.add(Form("%s/NoSel-Truth/Filters/EtaDau", TypeNames[Type].data()), "|#eta| of dau tracks", kTH1D, {axesConfig.axisEta}); - histos.add(Form("%s/NoSel-Truth/EvMult", TypeNames[Type].data()), "Multiplicity of events with >=1 cascade", kTH1D, {axesConfig.axisMult}); histos.add(Form("%s/NoSel-Truth/GenRecPt", TypeNames[Type].data()), "Generated vs reconstructed pt", kTH2D, {axesConfig.axisPt, axesConfig.axisPt}); histos.add(Form("%s/NoSel-Truth/GenRecRapidityXi", TypeNames[Type].data()), "Generated vs reconstructed y (Xi)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); histos.add(Form("%s/NoSel-Truth/GenRecRapidityOmega", TypeNames[Type].data()), "Generated vs reconstructed y (Omega)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); histos.add(Form("%s/NoSel-Truth/MassXi", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); histos.add(Form("%s/NoSel-Truth/MassOmega", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); + /// + histos.add(Form("%s/NoSel-Truth/DCA/DCAxyPrimaryXi", TypeNames[Type].data()), "DCA xy for primary Xi", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAzPrimaryXi", TypeNames[Type].data()), "DCA z for primary Xi", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAxyDirectXi", TypeNames[Type].data()), "DCA xy for direct Xi (has no mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAzDirectXi", TypeNames[Type].data()), "DCA z for direct Xi (has no mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAxyDecayXi", TypeNames[Type].data()), "DCA xy for decay Xi (has mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAzDecayXi", TypeNames[Type].data()), "DCA z for decay Xi (has mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAxyPrimaryOmega", TypeNames[Type].data()), "DCA xy for primary Omega", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAzPrimaryOmega", TypeNames[Type].data()), "DCA z for primary Omega", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAxyDirectOmega", TypeNames[Type].data()), "DCA xy for direct Omega (has no mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAzDirectOmega", TypeNames[Type].data()), "DCA z for direct Omega (has no mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAxyDecayOmega", TypeNames[Type].data()), "DCA xy for decay Omega (has mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/NoSel-Truth/DCA/DCAzDecayOmega", TypeNames[Type].data()), "DCA z for decay Omega (has mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); // xi and omega selection statistics histos.add(Form("%s/Rec/Filters/PropDCAxy", TypeNames[Type].data()), "DCA to xy (propagated)", kTH1D, {axesConfig.axisDCAxy}); histos.add(Form("%s/Rec/Filters/PropDCAz", TypeNames[Type].data()), "DCA to z (propagated)", kTH1D, {axesConfig.axisDCAz}); @@ -805,7 +850,6 @@ struct StrangeCascTrack { histos.add(Form("%s/Rec/Filters/RapidityOmega", TypeNames[Type].data()), "y under Omega hypothesis", kTH1D, {{200, -1.0, 1.0}}); histos.add(Form("%s/Rec/Filters/PtVsRapidityOmega", TypeNames[Type].data()), "pt vs y under Omega hypothesis", kTH2D, {axesConfig.axisPt, {200, -1.0, 1.0}}); histos.add(Form("%s/Rec/Filters/EtaDau", TypeNames[Type].data()), "|#eta| of dau tracks", kTH1D, {axesConfig.axisEta}); - histos.add(Form("%s/Rec/EvMult", TypeNames[Type].data()), "Multiplicity of events with >=1 selected cascade", kTH1D, {axesConfig.axisMult}); histos.add(Form("%s/Rec/GenRecPt", TypeNames[Type].data()), "Generated vs reconstructed pt", kTH2D, {axesConfig.axisPt, axesConfig.axisPt}); histos.add(Form("%s/Rec/GenRecRapidityXi", TypeNames[Type].data()), "Generated vs reconstructed y (Xi)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); histos.add(Form("%s/Rec/GenRecRapidityOmega", TypeNames[Type].data()), "Generated vs reconstructed y (Omega)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); @@ -837,7 +881,6 @@ struct StrangeCascTrack { histos.add(Form("%s/Rec-Truth/Filters/RapidityXi", TypeNames[Type].data()), "y under Xi hypothesis", kTH1D, {{200, -1.0, 1.0}}); histos.add(Form("%s/Rec-Truth/Filters/RapidityOmega", TypeNames[Type].data()), "y under Omega hypothesis", kTH1D, {{200, -1.0, 1.0}}); histos.add(Form("%s/Rec-Truth/Filters/EtaDau", TypeNames[Type].data()), "|#eta| of dau tracks", kTH1D, {axesConfig.axisEta}); - histos.add(Form("%s/Rec-Truth/EvMult", TypeNames[Type].data()), "Multiplicity of events with >=1 cascade", kTH1D, {axesConfig.axisMult}); histos.add(Form("%s/Rec-Truth/GenRecPt", TypeNames[Type].data()), "Generated vs reconstructed pt", kTH2D, {axesConfig.axisPt, axesConfig.axisPt}); histos.add(Form("%s/Rec-Truth/GenRecRapidityXi", TypeNames[Type].data()), "Generated vs reconstructed y (Xi)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); histos.add(Form("%s/Rec-Truth/GenRecRapidityOmega", TypeNames[Type].data()), "Generated vs reconstructed y (Omega)", kTH2D, {{200, -1.0, 1.0}, {200, -1.0, 1.0}}); @@ -852,6 +895,22 @@ struct StrangeCascTrack { /// histos.add(Form("%s/Rec-Truth/RapCheck_TH3_Truth_Xi", TypeNames[Type].data()), "Rapidity check (pt, mult, y)", kTHnD, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); histos.add(Form("%s/Rec-Truth/RapCheck_TH3_Truth_Omega", TypeNames[Type].data()), "Rapidity check (pt, mult, y)", kTHnD, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); + /// + histos.add(Form("%s/Rec-Truth/DCA/DCAxyPrimaryXi", TypeNames[Type].data()), "DCA xy for primary Xi", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAzPrimaryXi", TypeNames[Type].data()), "DCA z for primary Xi", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAxyDirectXi", TypeNames[Type].data()), "DCA xy for direct Xi (has no mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAzDirectXi", TypeNames[Type].data()), "DCA z for direct Xi (has no mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAxyDecayXi", TypeNames[Type].data()), "DCA xy for decay Xi (has mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAzDecayXi", TypeNames[Type].data()), "DCA z for decay Xi (has mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAxyPrimaryOmega", TypeNames[Type].data()), "DCA xy for primary Omega", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAzPrimaryOmega", TypeNames[Type].data()), "DCA z for primary Omega", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAxyDirectOmega", TypeNames[Type].data()), "DCA xy for direct Omega (has no mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAzDirectOmega", TypeNames[Type].data()), "DCA z for direct Omega (has no mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAxyDecayOmega", TypeNames[Type].data()), "DCA xy for decay Omega (has mothers)", kTHnD, {axesConfig.axisDCAxy, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec-Truth/DCA/DCAzDecayOmega", TypeNames[Type].data()), "DCA z for decay Omega (has mothers)", kTHnD, {axesConfig.axisDCAz, axesConfig.axisPt, axesConfig.axisMult}); + /// + histos.add(Form("%s/Rec-Truth/Radius/PrimaryXi", TypeNames[Type].data()), "Cascade radius (primary Xi)", kTH2D, {{500, 0.0, 50.0}, axesConfig.axisPt}); + histos.add(Form("%s/Rec-Truth/Radius/PrimaryOmega", TypeNames[Type].data()), "Cascade radius (primary Omega)", kTH2D, {{500, 0.0, 50.0}, axesConfig.axisPt}); }); // for MC-specific processing // all generated events: @@ -1131,17 +1190,30 @@ struct StrangeCascTrack { } } - void processDerivedMCRec(DerMCRecCollisions::iterator const& collision, DerMCRecCascDatas const& allCascs, DerMCRecTraCascDatas const& traCascs, DauTracks const&, DerMCGenCascades const&) + std::vector> traCascsGrouped; + void processDerivedMCRec(DerMCRecCollisions const& collisions, DerMCRecCascDatas const& allCascs, DerMCRecTraCascDatas const& traCascs, DauTracks const&, DerMCGenCascades const&) { - fillEvents(collision); // save info about all processed events - if (isValidEvent(collision, true)) { - histos.fill(HIST("Rec-Events/EvCounter"), 0.5); - histos.fill(HIST("Rec-Events/PVxy"), collision.posX(), collision.posY()); - histos.fill(HIST("Rec-Events/PVz"), collision.posZ()); - double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); - histos.fill(HIST("Rec-Events/Mult"), mult); - analyseCascs(collision, allCascs); // process all cascades - analyseCascs(collision, traCascs); // process tracked cascades + // custom group tracked cascades - a temporary fix for wrong ordering in OO MC + traCascsGrouped.clear(); + traCascsGrouped.resize(collisions.size()); + for (const auto& casc : traCascs) { + traCascsGrouped[casc.straCollisionId()].push_back(casc.globalIndex()); + } + for (const auto& collision : collisions) { + fillEvents(collision); // save info about all processed events + auto slicedAllCascs = allCascs.sliceBy(cascsPerCollision, collision.globalIndex()); + if (isValidEvent(collision, true)) { + histos.fill(HIST("Rec-Events/EvCounter"), 0.5); + histos.fill(HIST("Rec-Events/PVxy"), collision.posX(), collision.posY()); + histos.fill(HIST("Rec-Events/PVz"), collision.posZ()); + double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); + histos.fill(HIST("Rec-Events/Mult"), mult); + analyseCascs(collision, slicedAllCascs); // process all cascades + for (int const& idx : traCascsGrouped[collision.globalIndex()]) { + auto casc = traCascs.rawIteratorAt(idx); + analyseCascade(collision, casc); + } + } } } From 7c5afe4b5880bd50d70a17e333672ef987b9709c Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Tue, 14 Apr 2026 08:43:55 +0200 Subject: [PATCH 257/282] [PWGDQ] Integration of dqFlow workflow into the tableMaker (#15746) Co-authored-by: Lucamicheletti93 --- PWGDQ/Core/CutsLibrary.cxx | 8 ++++++++ PWGDQ/Core/HistogramsLibrary.cxx | 24 ++++++++++++++---------- PWGDQ/Tasks/dqFlow.cxx | 22 ++++++++++++---------- PWGDQ/Tasks/tableReader_withAssoc.cxx | 7 +++++++ 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 09bb472266b..d636d4ab7b7 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -6329,6 +6329,14 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("muonMinimalCuts10SigmaPDCA")) { + cut->AddCut(VarManager::kEta, -4.0, -2.5); + cut->AddCut(VarManager::kMuonRAtAbsorberEnd, 17.6, 89.5); + cut->AddCut(VarManager::kMuonPDca, 0.0, 990.0, false, VarManager::kMuonRAtAbsorberEnd, 17.6, 26.5); + cut->AddCut(VarManager::kMuonPDca, 0.0, 540.0, false, VarManager::kMuonRAtAbsorberEnd, 26.5, 89.5); + return cut; + } + if (!nameStr.compare("muonQualityCuts")) { cut->AddCut(VarManager::kEta, -4.0, -2.5); cut->AddCut(VarManager::kMuonRAtAbsorberEnd, 17.6, 89.5); diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index c37196eeca6..8cd67e4b22c 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -263,7 +263,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("subgen")) { hm->AddHistogram(histClass, "SubGenID", "SubGenerator ID", false, 11, -0.5, 10.5, VarManager::kMCEventSubGeneratorId); } - if (subGroupStr.Contains("qvector")) { + if (subGroupStr.Contains("central-qvector")) { + hm->AddHistogram(histClass, "Q2X0A_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2X0A); + hm->AddHistogram(histClass, "Q2Y0A_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2Y0A); + hm->AddHistogram(histClass, "Q2X0B_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2X0B); + hm->AddHistogram(histClass, "Q2Y0B_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2Y0B); + hm->AddHistogram(histClass, "Q2X0C_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2X0C); + hm->AddHistogram(histClass, "Q2Y0C_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2Y0C); + + hm->AddHistogram(histClass, "Psi2A_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2A); + hm->AddHistogram(histClass, "Psi2B_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2B); + hm->AddHistogram(histClass, "Psi2C_CentFT0C", "", false, 100, 0.0, 100.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2C); + } + if (subGroupStr.Contains("all-qvector")) { int varZNA[3] = {VarManager::kQ1ZNAX, VarManager::kQ1ZNAY, VarManager::kCentFT0C}; int varZNC[3] = {VarManager::kQ1ZNCX, VarManager::kQ1ZNCY, VarManager::kCentFT0C}; @@ -399,14 +411,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h } } if (subGroupStr.Contains("res")) { - hm->AddHistogram(histClass, "R2SP_TPCFT0A_CentV0M", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2SP_AB); - hm->AddHistogram(histClass, "R2SP_TPCFT0C_CentV0M", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2SP_AC); - hm->AddHistogram(histClass, "R2SP_FT0AFT0C_CentV0M", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2SP_BC); - hm->AddHistogram(histClass, "R3SP_CentV0M", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR3SP); - hm->AddHistogram(histClass, "R3EP_CentV0M", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR3EP); - hm->AddHistogram(histClass, "R2EP_TPCFT0A_CentV0M", "", false, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2EP_AB); - hm->AddHistogram(histClass, "R2EP_TPCFT0C_CentV0M", "", false, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2EP_AC); - hm->AddHistogram(histClass, "R2EP_FT0CFT0A_CentV0M", "", false, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2EP_BC); hm->AddHistogram(histClass, "R2SP_TPCFT0A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_AB); hm->AddHistogram(histClass, "R2SP_TPCFT0C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_AC); hm->AddHistogram(histClass, "R2SP_FT0AFT0C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_BC); @@ -1185,7 +1189,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "YMC", "MC y", false, 50, -5.0, 5.0, VarManager::kMCY); hm->AddHistogram(histClass, "CentFT0CMC", "MC Cent. FT0C", false, 18, 0., 90., VarManager::kMCEventCentrFT0C); hm->AddHistogram(histClass, "PtMC_YMC", "MC pT vs MC y", false, 120, 0.0, 30.0, VarManager::kMCPt, 1000, -5.0, 5.0, VarManager::kMCY); - hm->AddHistogram(histClass, "PtMC_YMC_CentFT0CMC", "MC pT vs MC y vs MC Cent. FT0C", false, 120, 0.0, 30.0, VarManager::kMCPt, 1000, -5.0, 5.0, VarManager::kMCY, 20, 0., 100., VarManager::kMCEventCentrFT0C); + hm->AddHistogram(histClass, "PtMC_YMC_CentFT0CMC", "MC pT vs MC y vs MC Cent. FT0C", false, 300, 0.0, 30.0, VarManager::kMCPt, 1000, -5.0, 5.0, VarManager::kMCY, 20, 0., 100., VarManager::kMCEventCentrFT0C); hm->AddHistogram(histClass, "EtaMC_PtMC", "", false, 40, -2.0, 2.0, VarManager::kMCEta, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "VzMC", "MC vz", false, 100, -15.0, 15.0, VarManager::kMCVz); hm->AddHistogram(histClass, "VzMC_VtxZMC", "MC vz vs MC vtxZ", false, 50, -15.0, 15.0, VarManager::kMCVz, 50, -15.0, 15.0, VarManager::kMCVtxZ); diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index 547068bab36..7b2232dcaff 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -112,8 +112,8 @@ struct DQEventQvector { Produces eventQvector; Produces eventQvectorExtra; - Produces eventQvectorCentr; - Produces eventQvectorCentrExtra; + // Produces eventQvectorCentr; // temporarily removed --> this table is filled in the table-maker directly + // Produces eventQvectorCentrExtra; // temporarily removed --> this table is filled in the table-maker directly Produces eventRefFlow; Produces eventQvectorZN; @@ -345,11 +345,12 @@ struct DQEventQvector { } // Fill the tree for the reduced event table with Q vector quantities - if (fEventCut->IsSelected(VarManager::fgValues)) { - eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(), - collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg()); - eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall()); - } + // temporarily removed --> this table is filled in the table-maker directly + // if (fEventCut->IsSelected(VarManager::fgValues)) { + // eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(), + // collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg()); + // eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall()); + // } } // Templated function instantianed for all of the process functions @@ -538,9 +539,10 @@ struct DQEventQvector { } } if (fEventCut->IsSelected(VarManager::fgValues)) { - eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(), - collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg()); - eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall()); + // temporarily removed --> this table is filled in the table-maker directly + // eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(), + // collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg()); + // eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall()); if (bc.has_zdc()) { eventQvectorZN(VarManager::fgValues[VarManager::kQ1ZNAX], VarManager::fgValues[VarManager::kQ1ZNAY], VarManager::fgValues[VarManager::kQ1ZNCX], VarManager::fgValues[VarManager::kQ1ZNCY]); } else { diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 27f6c17d839..8fa36edcc28 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -2540,6 +2540,12 @@ struct AnalysisSameEventPairing { runSameSideMixing(events, muonAssocs, muons, muonAssocsPerCollision); } + void processMixingMuonSkimmedFlow(soa::Filtered& events, + soa::Join const& muonAssocs, MyMuonTracksWithCovWithAmbiguities const& muons) + { + runSameSideMixing(events, muonAssocs, muons, muonAssocsPerCollision); + } + void processDummy(MyEventsBasic&) { // do nothing @@ -2561,6 +2567,7 @@ struct AnalysisSameEventPairing { PROCESS_SWITCH(AnalysisSameEventPairing, processMixingBarrelSkimmedFlow, "Run barrel type mixing pairing, with flow, with skimmed tracks", false); PROCESS_SWITCH(AnalysisSameEventPairing, processMixingBarrelWithQvectorCentrSkimmedNoCov, "Run barrel type mixing pairing, with skimmed tracks and with Qvector from central framework", false); PROCESS_SWITCH(AnalysisSameEventPairing, processMixingMuonSkimmed, "Run muon type mixing pairing, with skimmed muons", false); + PROCESS_SWITCH(AnalysisSameEventPairing, processMixingMuonSkimmedFlow, "Run muon type mixing pairing, with skimmed muons and flow", false); PROCESS_SWITCH(AnalysisSameEventPairing, processDummy, "Dummy function, enabled only if none of the others are enabled", true); }; From 58d53aeac1e336f4aa85385539e1d9b775e16d77 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Tue, 14 Apr 2026 09:21:15 +0200 Subject: [PATCH 258/282] [PWGCF] added a process function for mixed event combinatorial bkg for phi (#15710) --- PWGCF/DataModel/CorrelationsDerived.h | 11 ++- PWGCF/TableProducer/filter2Prong.cxx | 104 +++++++++++++++++++++ PWGCF/TableProducer/filterCorrelations.cxx | 15 +-- 3 files changed, 116 insertions(+), 14 deletions(-) diff --git a/PWGCF/DataModel/CorrelationsDerived.h b/PWGCF/DataModel/CorrelationsDerived.h index 8af9d7fef71..dbe807c165d 100644 --- a/PWGCF/DataModel/CorrelationsDerived.h +++ b/PWGCF/DataModel/CorrelationsDerived.h @@ -46,6 +46,14 @@ DECLARE_SOA_TABLE(CFMcParticles, "AOD", "CFMCPARTICLE", //! Reduced MC particle mcparticle::IsPhysicalPrimary); using CFMcParticle = CFMcParticles::iterator; +namespace cfmultiplicity +{ +DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float); +} +DECLARE_SOA_TABLE(CFMultiplicities, "AOD", "CFMULTIPLICITY", cfmultiplicity::Multiplicity); + +using CFMultiplicity = CFMultiplicities::iterator; + namespace cfcollision { DECLARE_SOA_INDEX_COLUMN(CFMcCollision, cfMcCollision); //! Index to reduced MC collision @@ -157,7 +165,8 @@ enum ParticleDecay { LambdaToPPiTight, AntiLambdaToPiPLoose, AntiLambdaToPiPTight, - D0barToKPiExclusive + D0barToKPiExclusive, + PhiToKKPID3Mixed }; } // namespace cf2prongtrack DECLARE_SOA_TABLE(CF2ProngTracks, "AOD", "CF2PRONGTRACK", //! Reduced track table diff --git a/PWGCF/TableProducer/filter2Prong.cxx b/PWGCF/TableProducer/filter2Prong.cxx index c57427a92c5..739eb424b40 100644 --- a/PWGCF/TableProducer/filter2Prong.cxx +++ b/PWGCF/TableProducer/filter2Prong.cxx @@ -45,6 +45,8 @@ enum LambdaPid { kLambda = 0, #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; struct Filter2Prong { + SliceCache cache; + O2_DEFINE_CONFIGURABLE(cfgVerbosity, int, 0, "Verbosity level (0 = major, 1 = per collision)") O2_DEFINE_CONFIGURABLE(cfgYMax, float, -1.0f, "Maximum candidate rapidity") O2_DEFINE_CONFIGURABLE(cfgImPart1Mass, float, o2::constants::physics::MassKPlus, "Daughter particle 1 mass in GeV") @@ -146,6 +148,10 @@ struct Filter2Prong { O2_DEFINE_CONFIGURABLE(applyTOF, bool, false, "Flag for applying TOF"); } grpPhi; + O2_DEFINE_CONFIGURABLE(cfgNoMixedEvents, int, 5, "Number of mixed events per event for mixed phi building") + ConfigurableAxis axisVertexMix{"axisVertexMix", {7, -7, 7}, "vertex axis for phi event mixing"}; + ConfigurableAxis axisMultiplicityMix{"axisMultiplicityMix", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100.1}, "multiplicity axis for phi event mixing"}; + HfHelper hfHelper; Produces output2ProngTracks; Produces output2ProngTrackmls; @@ -772,6 +778,104 @@ struct Filter2Prong { } PROCESS_SWITCH(Filter2Prong, processDataPhiV0, "Process data Phi and V0 candidates with invariant mass method", false); + using DerivedCollisions = soa::Join; + void processDataPhiMixed(DerivedCollisions const& collisions, aod::CFTrackRefs const& cftracks) + { + auto getMultiplicity = [](auto const& col) { + return col.multiplicity(); + }; + using BinningTypeDerived = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getMultiplicity)>; + BinningTypeDerived configurableBinningDerived{{getMultiplicity}, {axisVertexMix, axisMultiplicityMix}, true}; + auto tracksTuple = std::make_tuple(cftracks, cftracks); + using TA = std::tuple_element<0, decltype(tracksTuple)>::type; + using TB = std::tuple_element - 1, decltype(tracksTuple)>::type; + Pair pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + + o2::aod::ITSResponse itsResponse; + + for (auto it = pairs.begin(); it != pairs.end(); it++) { + auto& [collision1, tracks1, collision2, tracks2] = *it; + + if (!(collision1.sel8() && + collision1.selection_bit(aod::evsel::kNoSameBunchPileup) && + collision1.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && + collision1.selection_bit(aod::evsel::kIsGoodITSLayersAll))) { + continue; + } + + if (!(collision2.sel8() && + collision2.selection_bit(aod::evsel::kNoSameBunchPileup) && + collision2.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && + collision2.selection_bit(aod::evsel::kIsGoodITSLayersAll))) { + continue; + } + + for (const auto& cftrack1 : tracks1) { + const auto& p1 = cftrack1.track_as(); + + if (p1.sign() != 1) { + continue; + } + if (!selectionTrack(p1)) { + continue; + } + if (grpPhi.ITSPIDSelection && + p1.p() < grpPhi.ITSPIDPthreshold.value && + !(itsResponse.nSigmaITS(p1) > grpPhi.lowITSPIDNsigma.value && + itsResponse.nSigmaITS(p1) < grpPhi.highITSPIDNsigma.value)) { + continue; + } + if (grpPhi.removefaketrack && isFakeTrack(p1)) { + continue; + } + + for (const auto& cftrack2 : tracks2) { + const auto& p2 = cftrack2.track_as(); + + if (p2.sign() != -1) { + continue; + } + if (!selectionTrack(p2)) { + continue; + } + if (grpPhi.ITSPIDSelection && + p2.p() < grpPhi.ITSPIDPthreshold.value && + !(itsResponse.nSigmaITS(p2) > grpPhi.lowITSPIDNsigma.value && + itsResponse.nSigmaITS(p2) < grpPhi.highITSPIDNsigma.value)) { + continue; + } + if (grpPhi.removefaketrack && isFakeTrack(p2)) { + continue; + } + if (!selectionPair(p1, p2)) { + continue; + } + + if (selectionPID3(p1) && selectionPID3(p2)) { + if (selectionSys(p1, false, false) && selectionSys(p2, false, false)) { + ROOT::Math::PtEtaPhiMVector vec1(p1.pt(), p1.eta(), p1.phi(), cfgImPart1Mass); + ROOT::Math::PtEtaPhiMVector vec2(p2.pt(), p2.eta(), p2.phi(), cfgImPart2Mass); + ROOT::Math::PtEtaPhiMVector s = vec1 + vec2; + + if (s.M() < grpPhi.ImMinInvMassPhiMeson || s.M() > grpPhi.ImMaxInvMassPhiMeson) { + continue; + } + + float phi = RecoDecay::constrainAngle(s.Phi(), 0.0f); + + output2ProngTracks(collision1.globalIndex(), + cftrack1.globalIndex(), cftrack2.globalIndex(), + s.pt(), s.eta(), phi, s.M(), + aod::cf2prongtrack::PhiToKKPID3Mixed); + } + } + } + } + } + } + + PROCESS_SWITCH(Filter2Prong, processDataPhiMixed, "Process mixed-event phi candidates using O2 framework", false); + // Phi and V0s invariant mass method candidate finder. Only works for non-identical daughters of opposite charge for now. void processDataV0(aod::Collisions::iterator const& collision, aod::BCsWithTimestamps const&, aod::CFCollRefs const& cfcollisions, aod::CFTrackRefs const& cftracks, Filter2Prong::PIDTrack const&, aod::V0Datas const& V0s) { diff --git a/PWGCF/TableProducer/filterCorrelations.cxx b/PWGCF/TableProducer/filterCorrelations.cxx index 6ceaaa6c815..79dd72d4e67 100644 --- a/PWGCF/TableProducer/filterCorrelations.cxx +++ b/PWGCF/TableProducer/filterCorrelations.cxx @@ -42,17 +42,6 @@ using namespace o2::math_utils::detail; #define FLOAT_PRECISION 0xFFFFFFF0 #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; -namespace o2::aod -{ -namespace cfmultiplicity -{ -DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float); //! Centrality/multiplicity value -} // namespace cfmultiplicity -DECLARE_SOA_TABLE(CFMultiplicities, "AOD", "CFMULTIPLICITY", cfmultiplicity::Multiplicity); //! Transient multiplicity table - -using CFMultiplicity = CFMultiplicities::iterator; -} // namespace o2::aod - struct FilterCF { Service pdg; @@ -106,7 +95,7 @@ struct FilterCF { // TODO how to have this in the second task? For now they are copied Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPt); - Filter trackSelection = (requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true); + Filter trackSelection = (requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true); Filter mcCollisionFilter = nabs(aod::mccollision::posZ) < cfgCutVertex; @@ -570,7 +559,7 @@ struct MultiplicitySelector { O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPt); - Filter trackSelection = (requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true); + Filter trackSelection = (requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true); void init(InitContext&) { From 0752b3dd20c602baccc6bb6a06949a8a55b90c19 Mon Sep 17 00:00:00 2001 From: aferrero2707 Date: Tue, 14 Apr 2026 13:29:11 +0200 Subject: [PATCH 259/282] [PWGDQ] updates to the ML training data producer task (#15758) --- PWGDQ/Tasks/mftMchMatcher.cxx | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/mftMchMatcher.cxx b/PWGDQ/Tasks/mftMchMatcher.cxx index 321cacb238d..12381a9cde3 100644 --- a/PWGDQ/Tasks/mftMchMatcher.cxx +++ b/PWGDQ/Tasks/mftMchMatcher.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -120,6 +121,7 @@ DECLARE_SOA_COLUMN(TimeResMFT, timeResMFT, float); DECLARE_SOA_COLUMN(Chi2MFT, chi2MFT, float); DECLARE_SOA_COLUMN(McMaskMFT, mcMaskMFT, int); DECLARE_SOA_COLUMN(MftClusterSizesAndTrackFlags, mftClusterSizesAndTrackFlags, uint64_t); +DECLARE_SOA_COLUMN(TrackTypeMFT, trackTypeMFT, int); DECLARE_SOA_COLUMN(CXXMFT, cXXMFT, float); DECLARE_SOA_COLUMN(CYYMFT, cYYMFT, float); @@ -183,6 +185,7 @@ DECLARE_SOA_TABLE(FwdMatchMLCandidates, "AOD", "FWDMLCAND", fwdmatchcandidates::TimeResMFT, fwdmatchcandidates::Chi2MFT, fwdmatchcandidates::MftClusterSizesAndTrackFlags, + fwdmatchcandidates::TrackTypeMFT, fwdmatchcandidates::CXXMFT, fwdmatchcandidates::CYYMFT, fwdmatchcandidates::CPhiPhiMFT, @@ -236,6 +239,8 @@ struct mftMchMatcher { Configurable fKeepBestMatch{"cfgKeepBestMatch", false, "Keep only the best match global muons in the skimming"}; Configurable fzMatching{"cfgzMatching", -77.5f, "Plane for MFT-MCH matching"}; + Configurable fSamplingFraction{"cfgSamplingFraction", 1.f, "Fraction of randomly selected events to be processed"}; + //// Variables for ccdb 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"}; @@ -263,6 +268,9 @@ struct mftMchMatcher { o2::parameters::GRPMagField* fGrpMag = nullptr; + std::uniform_real_distribution mDistribution{0.0, 1.0}; + std::mt19937 mGenerator; + o2::globaltracking::MatchGlobalFwd mMatching; std::unordered_map mftCovIndexes; @@ -403,8 +411,15 @@ struct mftMchMatcher { ccdbManager->get(geoPath); } - // int matchTypeMax = static_cast(kMatchTypeUndefined); - AxisSpec matchTypeAxis = {static_cast(kMatchTypeUndefined), 0, static_cast(kMatchTypeUndefined), ""}; + if (fSamplingFraction < 1.0) { + std::random_device rd; + mGenerator = std::mt19937(rd()); + } + auto hAcceptedEvents = std::get>(registry.add("acceptedEvents", "Accepted events", {HistType::kTH1F, {{2, 0, 2.f, ""}}})); + hAcceptedEvents->GetXaxis()->SetBinLabel(1, "total"); + hAcceptedEvents->GetXaxis()->SetBinLabel(2, "accepted"); + + AxisSpec matchTypeAxis = {static_cast(kMatchTypeUndefined) + 1, 0, static_cast(kMatchTypeUndefined) + 1, ""}; auto hMatchType = std::get>(registry.add("matchType", "Match type", {HistType::kTH1F, {matchTypeAxis}})); hMatchType->GetXaxis()->SetBinLabel(1, "true (leading)"); hMatchType->GetXaxis()->SetBinLabel(2, "wrong (leading)"); @@ -414,6 +429,7 @@ struct mftMchMatcher { hMatchType->GetXaxis()->SetBinLabel(6, "wrong (non leading)"); hMatchType->GetXaxis()->SetBinLabel(7, "decay (non leading)"); hMatchType->GetXaxis()->SetBinLabel(8, "fake (non leading)"); + hMatchType->GetXaxis()->SetBinLabel(9, "undefined"); } template @@ -584,6 +600,16 @@ struct mftMchMatcher { VarManager::SetMatchingPlane(fzMatching.value); } + registry.get(HIST("acceptedEvents"))->Fill(0); + // reject a randomly selected fraction of events + if (fSamplingFraction < 1.0) { + double rnd = mDistribution(mGenerator); + if (rnd > fSamplingFraction) { + return; + } + } + registry.get(HIST("acceptedEvents"))->Fill(1); + fillBestMuonMatches(muonTracks); std::vector> matchablePairs; @@ -684,6 +710,7 @@ struct mftMchMatcher { mfttrack.trackTimeRes(), mfttrack.chi2(), mfttrack.mftClusterSizesAndTrackFlags(), + (mfttrack.isCA() ? 1 : 0), mftpropCov(0, 0), mftpropCov(1, 1), mftpropCov(2, 2), From d30a97f27f35346dd316943016082914bdf0cd6e Mon Sep 17 00:00:00 2001 From: Shunsuke-Kurita <135583712+Shunsuke-Kurita@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:52:30 +0900 Subject: [PATCH 260/282] [PWGDQ] Adding new mixing process function for electron-muon analysis (#15754) --- PWGDQ/Tasks/tableReader_withAssoc.cxx | 132 +++++++++++++++++++++++--- 1 file changed, 121 insertions(+), 11 deletions(-) diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 8fa36edcc28..8a55b51e97e 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -1340,7 +1340,7 @@ struct AnalysisSameEventPairing { bool fEnableMuonHistos; bool fEnableMuonMixingHistos; bool fEnableBarrelMuonHistos; - // bool fEnableBarrelMuonMixingHistos; + bool fEnableBarrelMuonMixingHistos; NoBinningPolicy hashBin; @@ -1355,9 +1355,10 @@ struct AnalysisSameEventPairing { fEnableMuonHistos = context.mOptions.get("processAllSkimmed") || context.mOptions.get("processMuonOnlySkimmed") || context.mOptions.get("processMuonOnlySkimmedMultExtra") || context.mOptions.get("processMuonOnlySkimmedFlow") || context.mOptions.get("processMixingMuonSkimmed"); fEnableMuonMixingHistos = context.mOptions.get("processMixingAllSkimmed") || context.mOptions.get("processMixingMuonSkimmed"); fEnableBarrelMuonHistos = context.mOptions.get("processElectronMuonSkimmed"); + fEnableBarrelMuonMixingHistos = context.mOptions.get("processMixingElectronMuonSkimmed"); if (context.mOptions.get("processDummy")) { - if (fEnableBarrelHistos || fEnableBarrelMixingHistos || fEnableMuonHistos || fEnableMuonMixingHistos || fEnableBarrelMuonHistos) { + if (fEnableBarrelHistos || fEnableBarrelMixingHistos || fEnableMuonHistos || fEnableMuonMixingHistos || fEnableBarrelMuonHistos || fEnableBarrelMuonMixingHistos) { LOG(fatal) << "No other processing tasks should be enabled if the processDummy is enabled!!"; } return; @@ -1599,7 +1600,7 @@ struct AnalysisSameEventPairing { VarManager::SetupMatLUTFwdDCAFitter(fLUT); } - if (fEnableBarrelMuonHistos) { + if (fEnableBarrelMuonHistos || fEnableBarrelMuonMixingHistos) { for (int iTrack = 0; iTrack < fNCutsBarrel; ++iTrack) { TString trackCutName = fTrackCuts[iTrack]; if (objArrayTrackCuts->FindObject(trackCutName.Data()) == nullptr) @@ -1618,12 +1619,12 @@ struct AnalysisSameEventPairing { int index = iTrack * fNCutsMuon + iMuon; fTrackMuonHistNames[index] = names; - // if (fEnableBarrelMuonMixingHistos) { - // names.push_back(Form("PairsBarrelMuonMEPM_%s_%s", trackCutName.Data(), muonCutName.Data())); - // names.push_back(Form("PairsBarrelMuonMEPP_%s_%s", trackCutName.Data(), muonCutName.Data())); - // names.push_back(Form("PairsBarrelMuonMEMM_%s_%s", trackCutName.Data(), muonCutName.Data())); - // histNames += Form("%s;%s;%s;", names[3].Data(), names[4].Data(), names[5].Data()); - // } + if (fEnableBarrelMuonMixingHistos) { + names.push_back(Form("PairsEleMuMEPM_%s_%s", trackCutName.Data(), muonCutName.Data())); + names.push_back(Form("PairsEleMuMEPP_%s_%s", trackCutName.Data(), muonCutName.Data())); + names.push_back(Form("PairsEleMuMEMM_%s_%s", trackCutName.Data(), muonCutName.Data())); + histNames += Form("%s;%s;%s;", names[3].Data(), names[4].Data(), names[5].Data()); + } TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { @@ -1635,6 +1636,12 @@ struct AnalysisSameEventPairing { Form("PairsEleMuSEPP_%s_%s_%s", trackCutName.Data(), muonCutName.Data(), objArrayPair->At(iPairCut)->GetName()), Form("PairsEleMuSEMM_%s_%s_%s", trackCutName.Data(), muonCutName.Data(), objArrayPair->At(iPairCut)->GetName())}; histNames += Form("%s;%s;%s;", names[0].Data(), names[1].Data(), names[2].Data()); + if (fEnableBarrelMuonMixingHistos) { + names.push_back(Form("PairsEleMuMEPM_%s_%s_%s", trackCutName.Data(), muonCutName.Data(), objArrayPair->At(iPairCut)->GetName())); + names.push_back(Form("PairsEleMuMEPP_%s_%s_%s", trackCutName.Data(), muonCutName.Data(), objArrayPair->At(iPairCut)->GetName())); + names.push_back(Form("PairsEleMuMEMM_%s_%s_%s", trackCutName.Data(), muonCutName.Data(), objArrayPair->At(iPairCut)->GetName())); + histNames += Form("%s;%s;%s;", names[3].Data(), names[4].Data(), names[5].Data()); + } index = iTrack * (fNCutsMuon * nPairCuts) + iMuon * nPairCuts + iPairCut; fTrackMuonHistNames[index] = names; } @@ -1651,10 +1658,10 @@ struct AnalysisSameEventPairing { DefineHistograms(fHistMan, histNames.Data(), fConfigAddSEPHistogram.value.data()); // define all histograms if (fEnableBarrelHistos) { DefineHistograms(fHistMan, "PairingSEQA", "sameevent-pairing"); // histograms for QA of the pairing - }; + } if (fEnableBarrelMixingHistos) { DefineHistograms(fHistMan, "PairingMEQA", "mixedevent-pairing"); // histograms for QA of the pairing - }; + } dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); @@ -2432,6 +2439,101 @@ struct AnalysisSameEventPairing { } // end event loop } + template + void runEmuMixedPairing(TAssoc1 const& assocs1, TAssoc2 const& assocs2, TTracks1 const& /*tracks1*/, TTracks2 const& /*tracks2*/) + { + const auto& histNames = fTrackMuonHistNames; + int sign1 = 0; + int sign2 = 0; + int nPairCuts = (fPairCuts.size() > 0) ? fPairCuts.size() : 1; + constexpr bool eventHasQvector = ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0); + constexpr bool eventHasQvectorCentr = ((TEventFillMap & VarManager::ObjTypes::CollisionQvect) > 0); + + for (auto& a1 : assocs1) { + if (!(a1.isBarrelSelected_raw() & fTrackFilterMask)) { + continue; + } + for (auto& a2 : assocs2) { + if (!(a2.isMuonSelected_raw() & fMuonFilterMask)) { + continue; + } + + auto t1 = a1.template reducedtrack_as(); + auto t2 = a2.template reducedmuon_as(); + sign1 = t1.sign(); + sign2 = t2.sign(); + + VarManager::FillPairME(t1, t2); + if constexpr (eventHasQvector) { + VarManager::FillPairVn(t1, t2); + } + if constexpr (eventHasQvectorCentr) { + VarManager::FillPairVn(t1, t2); + } + + for (int iTrack = 0; iTrack < fNCutsBarrel; ++iTrack) { + if (!(a1.isBarrelSelected_raw() & (1u << iTrack))) { + continue; + } + for (int iMuon = 0; iMuon < fNCutsMuon; ++iMuon) { + if (!(a2.isMuonSelected_raw() & (1u << iMuon))) { + continue; + } + for (int iPairCut = 0; iPairCut < nPairCuts; ++iPairCut) { + if (!fPairCuts.empty()) { + AnalysisCompositeCut cut = fPairCuts.at(iPairCut); + if (!cut.IsSelected(VarManager::fgValues)) { + continue; + } + } + int index = iTrack * (fNCutsMuon * nPairCuts) + iMuon * nPairCuts + iPairCut; + auto itHist = histNames.find(index); + if (itHist == histNames.end() || itHist->second.size() < 6) { + continue; + } + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(itHist->second[3].Data(), VarManager::fgValues); + } else { + if (sign1 > 0) { + fHistMan->FillHistClass(itHist->second[4].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(itHist->second[5].Data(), VarManager::fgValues); + } + } + } // end pair cut loop + } // end muon cut loop + } // end barrel cut loop + } + } + } + + template + void runEmuSameSideMixing(TEvents& events, Preslice& preslice1, TTrackAssocs const& assocs1, TTracks const& tracks1, + Preslice& preslice2, TMuonAssocs const& assocs2, TMuons const& tracks2) + { + events.bindExternalIndices(&assocs1); + events.bindExternalIndices(&assocs2); + int mixingDepth = fConfigMixingDepth.value; + for (auto& [event1, event2] : selfCombinations(hashBin, mixingDepth, -1, events, events)) { + VarManager::ResetValues(0, VarManager::kNVars); + VarManager::FillEvent(event1, VarManager::fgValues); + + auto groupedAssocs1 = assocs1.sliceBy(preslice1, event1.globalIndex()); + groupedAssocs1.bindExternalIndices(&events); + if (groupedAssocs1.size() == 0) { + continue; + } + + auto groupedAssocs2 = assocs2.sliceBy(preslice2, event2.globalIndex()); + groupedAssocs2.bindExternalIndices(&events); + if (groupedAssocs2.size() == 0) { + continue; + } + + runEmuMixedPairing(groupedAssocs1, groupedAssocs2, tracks1, tracks2); + } // end event loop + } + void processAllSkimmed(MyEventsVtxCovSelected const& events, soa::Join const& barrelAssocs, MyBarrelTracksWithCovWithAmbiguities const& barrelTracks, soa::Join const& muonAssocs, MyMuonTracksWithCovWithAmbiguities const& muons) @@ -2546,6 +2648,13 @@ struct AnalysisSameEventPairing { runSameSideMixing(events, muonAssocs, muons, muonAssocsPerCollision); } + void processMixingElectronMuonSkimmed(soa::Filtered& events, + soa::Join const& barrelAssocs, aod::ReducedTracks const& barrelTracks, + soa::Join const& muonAssocs, MyMuonTracksWithCovWithAmbiguities const& muons) + { + runEmuSameSideMixing(events, trackEmuAssocsPerCollision, barrelAssocs, barrelTracks, muonAssocsPerCollision, muonAssocs, muons); + } + void processDummy(MyEventsBasic&) { // do nothing @@ -2568,6 +2677,7 @@ struct AnalysisSameEventPairing { PROCESS_SWITCH(AnalysisSameEventPairing, processMixingBarrelWithQvectorCentrSkimmedNoCov, "Run barrel type mixing pairing, with skimmed tracks and with Qvector from central framework", false); PROCESS_SWITCH(AnalysisSameEventPairing, processMixingMuonSkimmed, "Run muon type mixing pairing, with skimmed muons", false); PROCESS_SWITCH(AnalysisSameEventPairing, processMixingMuonSkimmedFlow, "Run muon type mixing pairing, with skimmed muons and flow", false); + PROCESS_SWITCH(AnalysisSameEventPairing, processMixingElectronMuonSkimmed, "Run electron-muon mixing pairing, with skimmed tracks/muons", false); PROCESS_SWITCH(AnalysisSameEventPairing, processDummy, "Dummy function, enabled only if none of the others are enabled", true); }; From 07ccbec83d2ddd8ceb51dd09d1dbf011f87976fa Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Tue, 14 Apr 2026 13:58:41 +0200 Subject: [PATCH 261/282] [DPG] Add flag to reject particles from background events (#15339) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 850f8e38e4a..20abc845190 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -201,6 +201,7 @@ struct QaEfficiency { Configurable numSameCollision{"numSameCollision", false, "Flag to ask that the numerator is in the same collision as the denominator"}; Configurable noFakesHits{"noFakesHits", false, "Flag to reject tracks that have fake hits"}; Configurable skipEventsWithoutTPCTracks{"skipEventsWithoutTPCTracks", false, "Flag to reject events that have no tracks reconstructed in the TPC"}; + Configurable skipParticlesFromBackgroundEvents{"skipParticlesFromBackgroundEvents", false, "Flag to reject particles from background events (for embedded MC)"}; Configurable maxProdRadius{"maxProdRadius", 9999.f, "Maximum production radius of the particle under study"}; Configurable nsigmaTPCDe{"nsigmaTPCDe", 3.f, "Value of the Nsigma TPC cut for deuterons PID"}; // Charge selection @@ -1548,6 +1549,9 @@ struct QaEfficiency { histos.fill(countingHisto, trkCutIdxHasMcPart); // Tracks with particles (i.e. no fakes) } const auto mcParticle = track.mcParticle(); + if (skipParticlesFromBackgroundEvents && mcParticle.fromBackgroundEvent()) { + return false; + } if (!isInAcceptance(mcParticle, countingHisto, trkCutIdxHasMcPart)) { // 3: pt cut 4: eta cut 5: phi cut 6: y cut return false; @@ -1913,6 +1917,9 @@ struct QaEfficiency { /// only to fill denominator of ITS-TPC matched primary tracks only in MC events with at least 1 reco. vtx for (const auto& particle : groupedMcParticles) { // Particle loop + if (skipParticlesFromBackgroundEvents && particle.fromBackgroundEvent()) { + continue; + } /// require generated particle in acceptance if (!isInAcceptance(particle, nullptr)) { @@ -1968,6 +1975,9 @@ struct QaEfficiency { // Loop on particles to fill the denominator float dNdEta = 0; // Multiplicity for (const auto& mcParticle : groupedMcParticles) { + if (skipParticlesFromBackgroundEvents && mcParticle.fromBackgroundEvent()) { + continue; + } if (TMath::Abs(mcParticle.eta()) <= 2.f && !mcParticle.has_daughters()) { dNdEta += 1.f; } From f4cf4771ccc4d7a7318eadcf87db6d84448afe98 Mon Sep 17 00:00:00 2001 From: amatyja Date: Tue, 14 Apr 2026 14:23:53 +0200 Subject: [PATCH 262/282] [PWGUD] Added timing information of ZDC to output tree (#15760) --- PWGUD/DataModel/TauThreeProngEventTables.h | 4 ++++ .../TableProducer/tauThreeProngEventTableProducer.cxx | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/PWGUD/DataModel/TauThreeProngEventTables.h b/PWGUD/DataModel/TauThreeProngEventTables.h index bd7da95f14c..e01daca155a 100644 --- a/PWGUD/DataModel/TauThreeProngEventTables.h +++ b/PWGUD/DataModel/TauThreeProngEventTables.h @@ -50,6 +50,8 @@ DECLARE_SOA_COLUMN(ZvtxFT0vsPv, zvtxFT0vsPv, int8_t); DECLARE_SOA_COLUMN(VtxITSTPC, vtxITSTPC, int8_t); DECLARE_SOA_COLUMN(ZdcAenergy, zdcAenergy, float); DECLARE_SOA_COLUMN(ZdcCenergy, zdcCenergy, float); +DECLARE_SOA_COLUMN(ZdcAtime, zdcAtime, float); +DECLARE_SOA_COLUMN(ZdcCtime, zdcCtime, float); // DECLARE_SOA_COLUMN(Qtot, qtot, int8_t); // FIT info DECLARE_SOA_COLUMN(TotalFT0AmplitudeA, totalFT0AmplitudeA, float); @@ -113,6 +115,7 @@ DECLARE_SOA_TABLE(DataTauFourTracks, "AOD", "TAUFOURTRACK", tautree::Trs, tautree::Trofs, tautree::Hmpr, tautree::Tfb, tautree::ItsRofb, tautree::Sbp, tautree::ZvtxFT0vsPv, tautree::VtxITSTPC, tautree::ZdcAenergy, tautree::ZdcCenergy, + tautree::ZdcAtime, tautree::ZdcCtime, // tautree::Qtot, tautree::TotalFT0AmplitudeA, tautree::TotalFT0AmplitudeC, tautree::TotalFV0AmplitudeA, // tautree::TimeFT0A, tautree::TimeFT0C, tautree::TimeFV0A, @@ -135,6 +138,7 @@ DECLARE_SOA_TABLE(TrueTauFourTracks, "AOD", "TRUETAU", tautree::Trs, tautree::Trofs, tautree::Hmpr, tautree::Tfb, tautree::ItsRofb, tautree::Sbp, tautree::ZvtxFT0vsPv, tautree::VtxITSTPC, tautree::ZdcAenergy, tautree::ZdcCenergy, + tautree::ZdcAtime, tautree::ZdcCtime, // tautree::Qtot, tautree::TotalFT0AmplitudeA, tautree::TotalFT0AmplitudeC, tautree::TotalFV0AmplitudeA, // tautree::TimeFT0A, tautree::TimeFT0C, tautree::TimeFV0A, diff --git a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx index 87878b7b364..c90139faac4 100644 --- a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx @@ -63,10 +63,11 @@ using namespace o2::constants::physics; enum MyRecoProblem { NO_PROBLEM = 0, // no problem - MANY_RECO = 1, // more than 1 reconstructed collision + MANY_RECO = 1, // more than 1 reconstructed collision, event not rejected TOO_MANY_DAUGHTERS = 2, // more than 6 daughters from 2 taus TWO_TRACKS = 3, // more than 1 associated track to MC particle (tau daughter) - NO_TRACK = 4 // No associated track to MC particle (tau daughter) + NO_TRACK = 4, // No associated track to MC particle (tau daughter) + MIXED_TRACKS = 5 // 4 (or 6) tracks reconstructed but from 2 collisions }; enum MyParticle { @@ -718,6 +719,8 @@ struct TauThreeProngEventTableProducer { energyZNA = -1.; if (energyZNC < 0) energyZNC = -1.; + float timeZNA = dgcand.timeZNA(); + float timeZNC = dgcand.timeZNC(); int nTofTrk = 0; int nEtaIn15 = 0; @@ -872,6 +875,7 @@ struct TauThreeProngEventTableProducer { dgcand.trs(), dgcand.trofs(), dgcand.hmpr(), // to test it dgcand.tfb(), dgcand.itsROFb(), dgcand.sbp(), dgcand.zVtxFT0vPV(), dgcand.vtxITSTPC(), energyZNA, energyZNC, + timeZNA, timeZNC, // qtot, <<-------- comment out dgcand.totalFT0AmplitudeA(), dgcand.totalFT0AmplitudeC(), dgcand.totalFV0AmplitudeA(), // dgcand.timeFT0A(), dgcand.timeFT0C(), dgcand.timeFV0A(), @@ -1202,6 +1206,8 @@ struct TauThreeProngEventTableProducer { // zdc information - there i sno information in MC float energyZNA = -999.; float energyZNC = -999.; + float timeZNA = -999.; + float timeZNC = -999.; float amplitudesFIT[3] = {-999., -999., -999.}; // FT0A, FT0C, FV0 // float timesFIT[3] = {-999., -999., -999.}; // FT0A, FT0C, FV0 @@ -1577,6 +1583,7 @@ struct TauThreeProngEventTableProducer { bcSels[0], bcSels[1], bcSels[2], // to test it bcSels[3], bcSels[4], bcSels[5], bcSels[6], bcSels[7], energyZNA, energyZNC, + timeZNA, timeZNC, // qtot, <<-------- comment out amplitudesFIT[0], amplitudesFIT[1], amplitudesFIT[2], // timesFIT[0], timesFIT[1], timesFIT[2], From ee8ec8f36bc411e65189fca9cca2cc13cf4ebb69 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 14 Apr 2026 14:29:24 +0200 Subject: [PATCH 263/282] [PWGEM/Dilepton] add protection in DileptonHadronMPC.h (#15761) --- PWGEM/Dilepton/Core/DileptonHadronMPC.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index d93d829ecdb..c7676facbc6 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -1139,7 +1139,10 @@ struct DileptonHadronMPC { std::pair key_df_collision = std::make_pair(ndf, collision.globalIndex()); if (nuls > 0 || nlspp > 0 || nlsmm > 0) { // at least 1 pair exists. - emh_ref->ReserveNTracksPerCollision(key_df_collision, refTracks_per_coll.size()); + if (cfgDoMix) { + emh_ref->ReserveNTracksPerCollision(key_df_collision, refTracks_per_coll.size()); + } + for (const auto& track : refTracks_per_coll) { if (fEMTrackCut.IsSelected(track)) { fRegistry.fill(HIST("Hadron/hs"), track.pt(), track.eta(), track.phi()); From 7456567276c256ee34d82848140d02635c032818 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma Date: Tue, 14 Apr 2026 14:32:46 +0200 Subject: [PATCH 264/282] [PWGHF] Add axis to store eta of D0 prongs in UPC process (#15762) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskD0.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 22225c4a951..088c3847b90 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -97,6 +97,7 @@ struct HfTaskD0 { Configurable storeTrackQuality{"storeTrackQuality", false, "Flag to store track quality information"}; Configurable storeZdcEnergy{"storeZdcEnergy", false, "Flag to store ZDC energy info"}; Configurable storeZdcTime{"storeZdcTime", false, "Flag to store ZDC time info"}; + Configurable storeEtaProngs{"storeEtaProngs", false, "Flag to store eta of the prongs"}; // ML inference Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -167,6 +168,7 @@ struct HfTaskD0 { ConfigurableAxis thnConfigAxisFDD{"thnConfigAxisFDD", {200, 0., 4000.}, "axis for FDD amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisZN{"thnConfigAxisZN", {510, -1.5, 49.5}, "axis for ZN energy (a.u.)"}; ConfigurableAxis thnConfigAxisTimeZN{"thnConfigAxisTimeZN", {700, -35., 35.}, "axis for ZN energy (a.u.)"}; + ConfigurableAxis thnConfigAxisEtaProng{"thnConfigAxisEtaProng", {200, -1., 1.}, "axis for eta of D0 prongs"}; HistogramRegistry registry{ "registry", @@ -322,6 +324,7 @@ struct HfTaskD0 { const AxisSpec thnAxisEnergyZNC{thnConfigAxisZN, "ZNC energy"}; const AxisSpec thnAxisTimeZNA{thnConfigAxisTimeZN, "ZNA Time"}; const AxisSpec thnAxisTimeZNC{thnConfigAxisTimeZN, "ZNC Time"}; + const AxisSpec thnAxisEtaProngs{thnConfigAxisEtaProng, "Eta of prongs"}; if (doprocessMcWithDCAFitterN || doprocessMcWithDCAFitterNCent || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithDCAFitterNMlCent || doprocessMcWithKFParticleMl) { std::vector axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; @@ -387,6 +390,10 @@ struct HfTaskD0 { axes.push_back(thnAxisTimeZNA); axes.push_back(thnAxisTimeZNC); } + if (storeEtaProngs) { + axes.push_back(thnAxisEtaProngs); + axes.push_back(thnAxisEtaProngs); + } } if (applyMl) { @@ -853,7 +860,8 @@ struct HfTaskD0 { int const nAxesOccIR = storeOccupancyAndIR ? 2 : 0; // occupancy and IR if storeOccupancyAndIR int const nAxesZdcEnergy = storeZdcEnergy ? 2 : 0; // ZDC energy if storeZdcEnergy int const nAxesZdcTime = storeZdcTime ? 2 : 0; // ZDC time if storeZdctime - int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR + nAxesZdcEnergy + nAxesZdcTime; + int const nAxesEtaProngs = storeEtaProngs ? 2 : 0; // Eta distributions of prong + int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR + nAxesZdcEnergy + nAxesZdcTime + nAxesEtaProngs; std::vector valuesToFill; valuesToFill.reserve(nAxesTotal); @@ -893,6 +901,10 @@ struct HfTaskD0 { valuesToFill.push_back(static_cast(zdcTimeZNA)); valuesToFill.push_back(static_cast(zdcTimeZNC)); } + if (storeEtaProngs) { + valuesToFill.push_back(static_cast(track0.eta())); + valuesToFill.push_back(static_cast(track1.eta())); + } if constexpr (FillMl) { registry.get(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"))->Fill(valuesToFill.data()); } else { From c07b42262e3093957604d8115a36f29fd0c0448a Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Tue, 14 Apr 2026 14:40:59 +0200 Subject: [PATCH 265/282] [PWGEM,PWGEM-36] Add new axis configurbale for relative axis (#15763) --- PWGEM/PhotonMeson/Tasks/photonResoTask.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index 1396ec31f63..a7589d90316 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -87,6 +87,7 @@ struct PhotonResoTask { // configurable axis ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {400, 0.0, 0.8}, "invariant mass axis for the neutral meson"}; ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {100, 0., 20.}, "pT axis for the neutral meson"}; + ConfigurableAxis thnConfigAxisXRelative{"thnConfigAxisXRelative", {800, -1., 19.}, "(X rec - X true) / X true axis"}; ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {20, 0., 100.}, "centrality axis for the current event"}; ConfigurableAxis thnConfigAxisMult{"thnConfigAxisMult", {60, 0., 60000.}, "multiplicity axis for the current event"}; Configurable useCent{"useCent", 0, "flag to enable usage of centrality instead of multiplicity as axis."}; @@ -318,10 +319,10 @@ struct PhotonResoTask { const AxisSpec thnAxisPtRec{thnConfigAxisPt, "#it{p}_{T,Rec} (GeV/#it{c})"}; const AxisSpec thnAxisPGen{thnConfigAxisPt, "#it{p}_{Gen} (GeV/#it{c})"}; const AxisSpec thnAxisPRec{thnConfigAxisPt, "#it{p}_{Rec} (GeV/#it{c})"}; - const AxisSpec thnAxisPRelative{thnConfigAxisPt, "#it{p}_{Rec} - #it{p}_{Gen} / #it{p}_{Gen}"}; + const AxisSpec thnAxisPRelative{thnConfigAxisXRelative, "#it{p}_{Rec} - #it{p}_{Gen} / #it{p}_{Gen}"}; const AxisSpec thnAxisEGen{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; const AxisSpec thnAxisERec{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; - const AxisSpec thnAxisERelative{thnConfigAxisPt, "#it{E}_{Rec} - #it{E}_{Gen} / #it{E}_{Gen}"}; + const AxisSpec thnAxisERelative{thnConfigAxisXRelative, "#it{E}_{Rec} - #it{E}_{Gen} / #it{E}_{Gen}"}; const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; const AxisSpec thnAxisEtaGen{280, -0.7, 0.7, "#it{#eta}_{Gen}"}; From 0f2c43e251c347c277cbd5929d582f0d8df5e809 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 14 Apr 2026 19:52:36 +0530 Subject: [PATCH 266/282] [PWGLF] Update true event and MC filling logic (#15757) --- .../Resonances/lambda1520analysisinpp.cxx | 476 +++++++++--------- 1 file changed, 227 insertions(+), 249 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 2418f442bf4..e9682bdde1a 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -13,6 +13,7 @@ /// \brief This standalone task reconstructs track-track decay of lambda(1520) resonance candidate /// \author Hirak Kumar Koley +#include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/Utils/inelGt.h" #include "Common/DataModel/Centrality.h" @@ -48,18 +49,6 @@ enum { Inel10, Inelg0, Inelg010, - Trig, - Trig10, - TrigINELg0, - TrigINELg010, - Sel8, - Sel810, - Sel8INELg0, - Sel8INELg010, - AllCuts, - AllCuts10, - AllCutsINELg0, - AllCutsINELg010, }; enum TrackSelectionType { @@ -77,10 +66,11 @@ enum PIDCutType { }; struct Lambda1520analysisinpp { - // Define slice per Resocollision - SliceCache cache; + // Define slice per collision Preslice perCollision = o2::aod::track::collisionId; + SliceCache cache; Preslice perMcCollision = o2::aod::mcparticle::mcCollisionId; + SliceCache cacheMC; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -216,9 +206,15 @@ struct Lambda1520analysisinpp { using EventCandidates = soa::Join; using TrackCandidates = soa::Filtered>; + + // for MC reco using MCEventCandidates = soa::Join; using MCTrackCandidates = soa::Filtered>; + // for MC truth + // using MCTrueEventCandidates = soa::Join; + // using MCTrueTrackCandidates = aod::McParticles; + /// Figures ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.12f, 0.14f, 0.16f, 0.18f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.5f, 0.55f, 0.6f, 0.65f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 0.95f, 1.0f, 1.1f, 1.2f, 1.25f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.75f, 1.8f, 1.9f, 2.0f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.0f, 3.1f, 3.2f, 3.3f, 3.4f, 3.6f, 3.7f, 3.8f, 3.9f, 4.0f, 4.1f, 4.2f, 4.5f, 4.6f, 4.8f, 4.9f, 5.0f, 5.5f, 5.6f, 6.0f, 6.4f, 6.5f, 7.0f, 7.2f, 8.0f, 9.0f, 9.5f, 9.6f, 10.0f, 11.0f, 11.5f, 12.0f, 13.0f, 14.0f, 14.4f, 15.0f, 16.0f, 18.0f, 19.2f, 20.0f}, "Binning of the pT axis"}; ConfigurableAxis binsPtQA{"binsPtQA", {VARIABLE_WIDTH, 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 1.2f, 1.4f, 1.6f, 1.8f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.2f, 4.4f, 4.6f, 4.8f, 5.0f, 5.2f, 5.4f, 5.6f, 5.8f, 6.0f, 6.2f, 6.4f, 6.6f, 6.8f, 7.0f, 7.2f, 7.4f, 7.6f, 7.8f, 8.0f, 8.2f, 8.4f, 8.6f, 8.8f, 9.0f, 9.2f, 9.4f, 9.6f, 9.8f, 10.0f, 10.2f, 10.4f, 10.6f, 10.8f, 11.0f, 11.2f, 11.4f, 11.6f, 11.8f, 12.0f, 12.2f, 12.4f, 12.6f, 12.8f, 13.0f, 13.2f, 13.4f, 13.6f, 13.8f, 14.0f, 14.2f, 14.4f, 14.6f, 14.8f, 15.0f, 15.2f, 15.4f, 15.6f, 15.8f, 16.0f, 16.2f, 16.4f, 16.6f, 16.8f, 17.0f, 17.2f, 17.4f, 17.6f, 17.8f, 18.0f, 18.2f, 18.4f, 18.6f, 18.8f, 19.0f, 19.2f, 19.4f, 19.6f, 19.8f, 20.0f}, "Binning of the pT axis"}; @@ -396,6 +392,7 @@ struct Lambda1520analysisinpp { // MC QA histos.add("Event/hMCEventIndices", "hMCEventIndices", kTH2D, {axisMult, idxMCAxis}); + if (doprocessMCGen) { histos.add("QA/Gen", "Gen histogram", kTH1D, {{10, 0, 10, "index"}}); histos.add("QA/MC/h2GenEtaPt_beforeanycut", " #eta-#it{p}_{T} distribution of Generated #Lambda(1520); #eta; #it{p}_{T}; Counts;", HistType::kTHnSparseF, {axisEta, axisPtQA}); @@ -407,6 +404,15 @@ struct Lambda1520analysisinpp { histos.add("Result/MC/Genlambda1520pt", "pT distribution of True MC #Lambda(1520)0", kTH3F, {axisMClabel, axisPt, axisMult}); histos.add("Result/MC/Genantilambda1520pt", "pT distribution of True MC Anti-#Lambda(1520)0", kTH3F, {axisMClabel, axisPt, axisMult}); + + histos.add("Result/SignalLoss/GenTrueprotonpt_num", "True proton (num)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/Genprotonpt_num", "Proton (num)", kTH2F, {axisPt, axisMult}); + + histos.add("Result/SignalLoss/GenTruelambdapt_num", "True lambda (num)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/Genlambdapt_num", "Lambda (num)", kTH2F, {axisPt, axisMult}); + + histos.add("Result/SignalLoss/GenTruexipt_num", "True xi (num)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/Genxipt_num", "Xi (num)", kTH2F, {axisPt, axisMult}); } if (doprocessMCRec) { histos.add("QA/MC/h2RecoEtaPt_after", " #eta-#it{p}_{T} distribution of Reconstructed #Lambda(1520); #eta; #it{p}_{T}; Counts;", HistType::kTHnSparseF, {axisEta, axisPt}); @@ -425,13 +431,17 @@ struct Lambda1520analysisinpp { histos.add("Result/MC/h3antilambda1520Recoinvmass", "Invariant mass of Reconstructed MC Anti-#Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); } if (doprocessSignalLoss) { - histos.add("Result/SignalLoss/Genprotonpt", "pT distribution of #Lambda(1520) from Proton", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/SignalLoss/Genlambdapt", "pT distribution of #Lambda(1520) from #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/SignalLoss/Genxipt", "pT distribution of #Lambda(1520) from #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/SignalLoss/GenTruelambda1520pt_den", "True lambda1520 (den)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/GenTrueantilambda1520pt_den", "True anti-lambda1520 (den)", kTH2F, {axisPt, axisMult}); + + histos.add("Result/SignalLoss/GenTrueprotonpt_den", "True proton (den)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/Genprotonpt_den", "Proton (den)", kTH2F, {axisPt, axisMult}); - histos.add("Result/SignalLoss/GenTrueprotonpt", "pT distribution of True MC Proton", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/SignalLoss/GenTruelambdapt", "pT distribution of True MC #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); - histos.add("Result/SignalLoss/GenTruexipt", "pT distribution of True MC #Xi", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/SignalLoss/GenTruelambdapt_den", "True lambda (den)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/Genlambdapt_den", "Lambda (den)", kTH2F, {axisPt, axisMult}); + + histos.add("Result/SignalLoss/GenTruexipt_den", "True xi (den)", kTH2F, {axisPt, axisMult}); + histos.add("Result/SignalLoss/Genxipt_den", "Xi (den)", kTH2F, {axisPt, axisMult}); } // Print output histograms statistics @@ -1097,10 +1107,62 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processRotational, "Process Rotational Background", false); + // Processing Event Mixing + using BinningTypeVtxZT0M = ColumnBinningPolicy; + + void processME(EventCandidates const& collision, + TrackCandidates const& tracks) + { + auto tracksTuple = std::make_tuple(tracks); + + BinningTypeVtxZT0M colBinning{{configBkg.cfgVtxBins, configBkg.cfgMultPercentileBins}, true}; + SameKindPair pairs{colBinning, configBkg.nEvtMixing, -1, collision, tracksTuple, &cache}; // -1 is the number of the bin to skip + + for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { + // LOGF(info, "Mixed event collisions: (%d, %d)", collision1.globalIndex(), collision2.globalIndex()); + + // for (auto& [t1, t2] : combinations(CombinationsFullIndexPolicy(tracks1, tracks2))) { + // LOGF(info, "Mixed event tracks pair: (%d, %d) from events (%d, %d)", t1.index(), t2.index(), collision1.index(), collision2.index()); + // } + + if (!isSelected(collision1, false)) // Default event selection + continue; + + if (!isSelected(collision2, false)) // Default event selection + continue; + + if (!collision1.isInelGt0()) // <-- + continue; + + if (!collision2.isInelGt0()) // <-- + continue; + + if (cFilladditionalQAeventPlots) { + // Fill histograms for the characteristics of the *mixed* events (collision1 and collision2) + // This will show the distribution of events that are actually being mixed. + if (cFill1DQAs) { + histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision1.posZ()); + histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision1.centFT0M()); + } + histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision1.posZ(), collision1.centFT0M()); + + // You might also want to fill for collision2 if you want to see both partners' distributions + // histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision2.posZ()); + // histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision2.centFT0M()); + // histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision2.posZ(), collision2.centFT0M()); + } + fillHistograms(collision1, tracks1, tracks2); + } + } + PROCESS_SWITCH(Lambda1520analysisinpp, processME, "Process EventMixing light without partition", false); + void processMCRec(MCEventCandidates::iterator const& collision, aod::McCollisions const&, MCTrackCandidates const& tracks, aod::McParticles const&) { + if (!collision.has_mcCollision()) + return; + if (!isSelected(collision)) return; @@ -1117,22 +1179,24 @@ struct Lambda1520analysisinpp { void processMCGen(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { + if (!collision.has_mcCollision()) + return; + bool isInAfterAllCuts = isSelected(collision, false); bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = collision.sel8(); auto mcPartsAll = mcParticles.sliceBy(perMcCollision, collision.mcCollision().globalIndex()); - - bool isTrueINELgt0 = pwglf::isINELgt0mc(mcPartsAll, pdg); - // bool isTrueINELgt0 = collision.isInelGt0(); + // bool isTrueINELgt0 = pwglf::isINELgt0mc(mcPartsAll, pdg); + bool isTrueINELgt0 = collision.isInelGt0(); // <-- auto centrality = centEst(collision); auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); // Not related to the real collisions - for (const auto& part : mcParts) { // loop over all MC particles + for (const auto& part : mcParts) { // loop over all Lambda(1520) particles std::vector daughterPDGs; if (part.has_daughters()) { @@ -1230,284 +1294,198 @@ struct Lambda1520analysisinpp { } } - // QA for Trigger efficiency - histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel); - if (inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel10); - if (isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg0); - if (inVtx10 && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg010); - - // TVX MB trigger - if (isTriggerTVX) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Trig); - if (isTriggerTVX && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Trig10); - if (isTriggerTVX && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, TrigINELg0); - if (isTriggerTVX && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, TrigINELg010); - - // Sel8 event selection - if (isSel8) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8); - if (isSel8 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel810); - if (isSel8 && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8INELg0); - if (isSel8 && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8INELg010); - - // CollisionCuts selection - if (isInAfterAllCuts) - histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCuts); - if (isInAfterAllCuts && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCuts10); - if (isInAfterAllCuts && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCutsINELg0); - if (isInAfterAllCuts && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCutsINELg010); - } - PROCESS_SWITCH(Lambda1520analysisinpp, processMCGen, "Process Event for MC only", false); - - // Processing Event Mixing - using BinningTypeVtxZT0M = ColumnBinningPolicy; - - void processME(EventCandidates const& collision, - TrackCandidates const& tracks) - { - auto tracksTuple = std::make_tuple(tracks); - - BinningTypeVtxZT0M colBinning{{configBkg.cfgVtxBins, configBkg.cfgMultPercentileBins}, true}; - SameKindPair pairs{colBinning, configBkg.nEvtMixing, -1, collision, tracksTuple, &cache}; // -1 is the number of the bin to skip - - for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { - // LOGF(info, "Mixed event collisions: (%d, %d)", collision1.globalIndex(), collision2.globalIndex()); - - // for (auto& [t1, t2] : combinations(CombinationsFullIndexPolicy(tracks1, tracks2))) { - // LOGF(info, "Mixed event tracks pair: (%d, %d) from events (%d, %d)", t1.index(), t2.index(), collision1.index(), collision2.index()); - // } - - if (!isSelected(collision1, false)) // Default event selection - continue; - - if (!isSelected(collision2, false)) // Default event selection - continue; - - if (!collision1.isInelGt0()) // <-- - continue; - - if (!collision2.isInelGt0()) // <-- - continue; - - if (cFilladditionalQAeventPlots) { - // Fill histograms for the characteristics of the *mixed* events (collision1 and collision2) - // This will show the distribution of events that are actually being mixed. - if (cFill1DQAs) { - histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision1.posZ()); - histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision1.centFT0M()); - } - histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision1.posZ(), collision1.centFT0M()); - - // You might also want to fill for collision2 if you want to see both partners' distributions - // histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision2.posZ()); - // histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision2.centFT0M()); - // histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision2.posZ(), collision2.centFT0M()); - } - fillHistograms(collision1, tracks1, tracks2); - } - } - PROCESS_SWITCH(Lambda1520analysisinpp, processME, "Process EventMixing light without partition", false); - - void processSignalLoss(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) - { - bool isInAfterAllCuts = isSelected(collision, false); - bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; - bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); - bool isSel8 = collision.sel8(); - - auto mcPartsAll = mcParticles.sliceBy(perMcCollision, collision.mcCollision().globalIndex()); - - bool isTrueINELgt0 = pwglf::isINELgt0mc(mcPartsAll, pdg); - // bool isTrueINELgt0 = collision.isInelGt0(); - - auto centrality = centEst(collision); - auto computePtL = [&](float pt, float m_ref) { float ptL2 = pt * pt + m_ref * m_ref - MassLambda1520 * MassLambda1520; return (ptL2 > 0) ? std::sqrt(ptL2) : -1.f; }; + // ===== NUM ===== + if (!(inVtx10 && isTrueINELgt0)) + return; + + if (!isInAfterAllCuts) + return; + for (const auto& part : mcPartsAll) { if (!part.isPhysicalPrimary()) continue; - float pt = part.pt(); - - float weight; - - if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) // rapidity cut + if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) continue; - if (std::abs(part.pdgCode()) == kProton) { - - // true proton - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 0, pt, centrality); - - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 1, pt, centrality); - - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 2, pt, centrality); - - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 3, pt, centrality); - - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 4, pt, centrality); + if (cUseEtacutMC && std::abs(part.eta()) > cEtacutMC) + continue; - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 5, pt, centrality); + float pt = part.pt(); - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt"), 6, pt, centrality); + // proton + if (std::abs(part.pdgCode()) == kProton) { + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt_num"), pt, centrality); float ptL = computePtL(pt, massPr); - if (ptL < 0) - continue; - - if (useWeight) - weight = ptL / pt; - else - weight = 1.f; - - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 0, ptL, centrality, weight); - - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 1, ptL, centrality, weight); - - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 2, ptL, centrality, weight); + if (ptL > 0) { + float w = useWeight ? ptL / pt : 1.f; + histos.fill(HIST("Result/SignalLoss/Genprotonpt_num"), ptL, centrality, w); + } + } - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 3, ptL, centrality, weight); + // lambda + if (std::abs(part.pdgCode()) == kLambda0) { + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt_num"), pt, centrality); - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 4, ptL, centrality, weight); + float ptL = computePtL(pt, MassLambda0); + if (ptL > 0) { + float w = useWeight ? ptL / pt : 1.f; + histos.fill(HIST("Result/SignalLoss/Genlambdapt_num"), ptL, centrality, w); + } + } - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 5, ptL, centrality, weight); + // xi + if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { + histos.fill(HIST("Result/SignalLoss/GenTruexipt_num"), pt, centrality); - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/Genprotonpt"), 6, ptL, centrality, weight); + float ptL = computePtL(pt, MassXiMinus); + if (ptL > 0) { + float w = useWeight ? ptL / pt : 1.f; + histos.fill(HIST("Result/SignalLoss/Genxipt_num"), ptL, centrality, w); + } } + } + } + PROCESS_SWITCH(Lambda1520analysisinpp, processMCGen, "Process Event for MC only", false); - if (std::abs(part.pdgCode()) == kLambda0) { - - // true lambda - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 0, pt, centrality); + void processEventFactor(soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + { + // Loop on generated collisions to fill the event factor for the INEL>0 correction + for (const auto& mccolls : mcCollisions) { + float centrality = mccolls.centFT0M(); + bool inVtx10 = std::abs(mccolls.posZ()) <= configEvents.cfgEvtZvtx; + + const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolls.globalIndex(), cacheMC); + bool isTrueINELgt0 = pwglf::isINELgt0mc(particlesInCollision, pdg); // QA for Trigger efficiency + + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel); + if (inVtx10) + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel10); + if (isTrueINELgt0) + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg0); + if (inVtx10 && isTrueINELgt0) + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg010); + } + } + PROCESS_SWITCH(Lambda1520analysisinpp, processEventFactor, "Process Event factor", false); - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 1, pt, centrality); + void processSignalLoss(soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + { + for (const auto& mccolls : mcCollisions) { + float centrality = mccolls.centFT0M(); - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 2, pt, centrality); + bool inVtx10 = std::abs(mccolls.posZ()) <= configEvents.cfgEvtZvtx; - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 3, pt, centrality); + const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolls.globalIndex(), cacheMC); + bool isTrueINELgt0 = pwglf::isINELgt0mc(particlesInCollision, pdg); - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 4, pt, centrality); + if (!(inVtx10 && isTrueINELgt0)) + continue; - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 5, pt, centrality); + auto computePtL = [&](float pt, float m_ref) { + float ptL2 = pt * pt + m_ref * m_ref - MassLambda1520 * MassLambda1520; + return (ptL2 > 0) ? std::sqrt(ptL2) : -1.f; + }; - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruelambdapt"), 6, pt, centrality); + for (const auto& part : particlesInCollision) { - float ptL = computePtL(pt, MassLambda0); - if (ptL < 0) + if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) continue; - if (useWeight) - weight = ptL / pt; - else - weight = 1.f; - - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 0, ptL, centrality, weight); - - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 1, ptL, centrality, weight); + if (cUseEtacutMC && std::abs(part.eta()) > cEtacutMC) + continue; - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 2, ptL, centrality, weight); + // ========================= + // ===== LAMBDA(1520) ====== + // ========================= + if (std::abs(part.pdgCode()) == Pdg::kLambda1520_Py) { - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 3, ptL, centrality, weight); + std::vector daughterPDGs; + if (part.has_daughters()) { + auto daughter01 = mcParticles.rawIteratorAt(part.daughtersIds()[0] - mcParticles.offset()); + auto daughter02 = mcParticles.rawIteratorAt(part.daughtersIds()[1] - mcParticles.offset()); + daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()}; + } else { + daughterPDGs = {-1, -1}; + } - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 4, ptL, centrality, weight); + bool pass1 = std::abs(daughterPDGs[0]) == kKPlus || std::abs(daughterPDGs[1]) == kKPlus; // At least one decay to Kaon + bool pass2 = std::abs(daughterPDGs[0]) == kProton || std::abs(daughterPDGs[1]) == kProton; // At least one decay to Proton - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 5, ptL, centrality, weight); + // Checking if we have both decay products + if (!pass1 || !pass2) + continue; - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/Genlambdapt"), 6, ptL, centrality, weight); - } + if (part.pdgCode() > 0) + histos.fill(HIST("Result/SignalLoss/GenTruelambda1520pt_den"), part.pt(), centrality); + else + histos.fill(HIST("Result/SignalLoss/GenTrueantilambda1520pt_den"), part.pt(), centrality); + } - if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { + if (!part.isPhysicalPrimary()) + continue; - // true Xi - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 0, pt, centrality); + float pt = part.pt(); + float weight = 1.f; - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 1, pt, centrality); + // ========================= + // ===== PROTON ============ + // ========================= + if (std::abs(part.pdgCode()) == kProton) { - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 2, pt, centrality); + // --- DENOMINATOR ONLY + histos.fill(HIST("Result/SignalLoss/GenTrueprotonpt_den"), pt, centrality); - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 3, pt, centrality); + float ptL = computePtL(pt, massPr); + if (ptL < 0) + continue; - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 4, pt, centrality); + if (useWeight) + weight = ptL / pt; - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 5, pt, centrality); + histos.fill(HIST("Result/SignalLoss/Genprotonpt_den"), ptL, centrality, weight); + } - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/GenTruexipt"), 6, pt, centrality); + // ========================= + // ===== LAMBDA ============ + // ========================= + if (std::abs(part.pdgCode()) == kLambda0) { - float ptL = computePtL(pt, MassXiMinus); - if (ptL < 0) - continue; + histos.fill(HIST("Result/SignalLoss/GenTruelambdapt_den"), pt, centrality); - if (useWeight) - weight = ptL / pt; - else - weight = 1.f; + float ptL = computePtL(pt, MassLambda0); + if (ptL < 0) + continue; - histos.fill(HIST("Result/SignalLoss/Genxipt"), 0, ptL, centrality, weight); + if (useWeight) + weight = ptL / pt; - if (inVtx10) // vtx10 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 1, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genlambdapt_den"), ptL, centrality, weight); + } - if (inVtx10 && isSel8) // vtx10, sel8 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 2, ptL, centrality, weight); + // ========================= + // ===== XI ================= + // ========================= + if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { - if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX - histos.fill(HIST("Result/SignalLoss/Genxipt"), 3, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/GenTruexipt_den"), pt, centrality); - if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 4, ptL, centrality, weight); + float ptL = computePtL(pt, MassXiMinus); + if (ptL < 0) + continue; - if (isInAfterAllCuts) // after all event selection - histos.fill(HIST("Result/SignalLoss/Genxipt"), 5, ptL, centrality, weight); + if (useWeight) + weight = ptL / pt; - if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 - histos.fill(HIST("Result/SignalLoss/Genxipt"), 6, ptL, centrality, weight); + histos.fill(HIST("Result/SignalLoss/Genxipt_den"), ptL, centrality, weight); + } } } } From 6bcff8b701d534ce96deff7401de241b28b59b79 Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:25:58 +0200 Subject: [PATCH 267/282] [PWGHF] enabling MC checks on Lc-h correl (#15767) --- PWGHF/HFC/DataModel/CorrelationTables.h | 3 ++- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 16 ++++++++-------- .../HFC/TableProducer/correlatorLcScHadrons.cxx | 4 ++-- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 9 +++++---- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index c39a16ea784..c7595b8fc68 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -218,7 +218,8 @@ DECLARE_SOA_TABLE(LcRecoInfo, "AOD", "LCRECOINFO", //! Lc candidates Reconstruct aod::hf_correlation_lc_hadron::MLc, aod::hf_correlation_lc_hadron::PtLc, aod::hf_correlation_lc_hadron::MlScoreBkg, - aod::hf_correlation_lc_hadron::MlScorePrompt); + aod::hf_correlation_lc_hadron::MlScorePrompt, + aod::hf_correlation_lc_hadron::PoolBin); DECLARE_SOA_TABLE(LcGenInfo, "AOD", "LCGENOINFO", //! Lc candidates Generated Information aod::hf_correlation_lc_hadron::IsPrompt); diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 960c00485b3..15bc9ed7c79 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -356,8 +356,8 @@ struct HfCorrelatorLcHadrons { registry.add("hcountLctriggersMcGen", "Lc trigger particles - MC gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {axisPtLc}}}); registry.add("hPtCandMcGen", "Lc,Hadron particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {axisPtLc}}); registry.add("hYMcGen", "Lc,Hadron candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1D, {axisRapidity}}); - registry.add("hPtCandMcGenPrompt", "Lc,Hadron particles - MC Gen Prompt", {HistType::kTH1D, {axisPtLc}}); - registry.add("hPtCandMcGenNonPrompt", "Lc,Hadron particles - MC Gen Non Prompt", {HistType::kTH1D, {axisPtLc}}); + registry.add("hPtCandMcGenPrompt", "Lc,Hadron particles - MC Gen Prompt", {HistType::kTH2D, {{axisPtLc}, {axisPoolBin}}}); + registry.add("hPtCandMcGenNonPrompt", "Lc,Hadron particles - MC Gen Non Prompt", {HistType::kTH2D, {{axisPtLc}, {axisPoolBin}}}); registry.add("hPtParticleAssocMcGen", "Associated Particle - MC Gen", {HistType::kTH1D, {axisPtHadron}}); registry.add("hEtaMcGen", "Lc,Hadron particles - MC Gen", {HistType::kTH1D, {axisEta}}); registry.add("hPhiMcGen", "Lc,Hadron particles - MC Gen", {HistType::kTH1D, {axisPhi}}); @@ -439,7 +439,7 @@ struct HfCorrelatorLcHadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; } - entryLcCandRecoInfo(HfHelper::invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(HfHelper::invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1], poolBin); // 0: BkgBDTScore, 1:PromptBDTScore if (!skipMixedEventTableFilling) { entryLc(candidate.phi(), candidate.eta(), candidate.pt() * chargeLc, HfHelper::invMassLcToPKPi(candidate), poolBin, gCollisionId, timeStamp); } @@ -451,7 +451,7 @@ struct HfCorrelatorLcHadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; } - entryLcCandRecoInfo(HfHelper::invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(HfHelper::invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1], poolBin); // 0: BkgBDTScore, 1:PromptBDTScore if (!skipMixedEventTableFilling) { entryLc(candidate.phi(), candidate.eta(), candidate.pt() * chargeLc, HfHelper::invMassLcToPiKP(candidate), poolBin, gCollisionId, timeStamp); } @@ -611,7 +611,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRecSig"), HfHelper::invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), HfHelper::invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusLcToPKPiMcRec"), candidate.isSelLcToPKPi()); - entryLcCandRecoInfo(HfHelper::invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(HfHelper::invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1], poolBin); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -629,7 +629,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRecSig"), HfHelper::invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), HfHelper::invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusLcToPiKPMcRec"), candidate.isSelLcToPiKP()); - entryLcCandRecoInfo(HfHelper::invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(HfHelper::invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1], poolBin); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } } else { @@ -855,9 +855,9 @@ struct HfCorrelatorLcHadrons { isLcPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; isLcNonPrompt = particle.originMcGen() == RecoDecay::OriginType::NonPrompt; if (isLcPrompt) { - registry.fill(HIST("hPtCandMcGenPrompt"), particle.pt()); + registry.fill(HIST("hPtCandMcGenPrompt"), particle.pt(), poolBin); } else if (isLcNonPrompt) { - registry.fill(HIST("hPtCandMcGenNonPrompt"), particle.pt()); + registry.fill(HIST("hPtCandMcGenNonPrompt"), particle.pt(), poolBin); } // prompt and non-prompt division diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 0952c89de39..144c344abbc 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -931,7 +931,7 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hPtVsMultiplicityMcRecNonPrompt"), ptCand, multiplicityFT0M); } - entryCandCandRecoInfo(massCandPKPi, ptCand, outputMlPKPi[0], outputMlPKPi[1]); + entryCandCandRecoInfo(massCandPKPi, ptCand, outputMlPKPi[0], outputMlPKPi[1], poolBin); entryCandCandGenInfo(isPrompt); if (!skipMixedEventTableFilling) { entryCand(candidate.phi(), etaCand, ptCand, massCandPKPi, poolBin, gCollisionId, timeStamp); @@ -952,7 +952,7 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hPtCandSigNonPrompt"), ptCand); registry.fill(HIST("hPtVsMultiplicityMcRecNonPrompt"), ptCand, multiplicityFT0M); } - entryCandCandRecoInfo(massCandPiKP, ptCand, outputMlPiKP[0], outputMlPiKP[1]); + entryCandCandRecoInfo(massCandPiKP, ptCand, outputMlPiKP[0], outputMlPiKP[1], poolBin); entryCandCandGenInfo(isPrompt); if (!skipMixedEventTableFilling) { entryCand(candidate.phi(), etaCand, ptCand, massCandPiKP, poolBin, gCollisionId, timeStamp); diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 9ca930af538..ad6156782d2 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -259,8 +259,8 @@ struct HfTaskCorrelationLcHadrons { } // Histograms for MC Reco analysis if (fillHistoMcRec) { - registry.add("hMassPromptLcVsPt", "Lc prompt candidates mass Vs Pt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); - registry.add("hMassNonPromptLcVsPt", "Lc non prompt candidates mass Vs Pt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassPromptLcVsPt", "Lc prompt candidates mass Vs Pt", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisPoolBin}}}); + registry.add("hMassNonPromptLcVsPt", "Lc non prompt candidates mass Vs Pt", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisPoolBin}}}); registry.add("hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1D, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1D, {axisDeltaPhi}}); registry.add("hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1D, {axisDeltaEta}}); @@ -577,6 +577,7 @@ struct HfTaskCorrelationLcHadrons { float const ptLc = std::abs(candidate.ptLc()); float const bdtScorePrompt = candidate.mlScorePrompt(); float const bdtScoreBkg = candidate.mlScoreBkg(); + int const poolBin = candidate.poolBin(); int const effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); bool const isLcPrompt = candidate.isPrompt(); @@ -597,7 +598,7 @@ struct HfTaskCorrelationLcHadrons { } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); - registry.fill(HIST("hMassPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassPromptLcVsPt"), massLc, ptLc, poolBin, efficiencyWeightLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); } else { @@ -607,7 +608,7 @@ struct HfTaskCorrelationLcHadrons { } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); - registry.fill(HIST("hMassNonPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassNonPromptLcVsPt"), massLc, ptLc, poolBin, efficiencyWeightLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); } From ac3ace7e6be2364df5c0fb847d3d5e98466c5354 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:43:31 +0200 Subject: [PATCH 268/282] [PWGCF] fix certain histogram axes being misaligned and filled incorrectly (#15765) --- .../Tasks/flowGenericFramework.cxx | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 0e2e5f9e069..a9383a9b5b6 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -311,17 +311,7 @@ struct FlowGenericFramework { int histBin; int flag; // just store the enum }; - std::vector eventcutflags = { - {cfgEventCutFlags.cfgNoSameBunchPileupCut, kNoSameBunchPileup, o2::aod::evsel::kNoSameBunchPileup}, - {cfgEventCutFlags.cfgIsGoodZvtxFT0vsPV, kIsGoodZvtxFT0vsPV, o2::aod::evsel::kIsGoodZvtxFT0vsPV}, - {cfgEventCutFlags.cfgNoCollInTimeRangeStandard, kNoCollInTimeRangeStandard, o2::aod::evsel::kNoCollInTimeRangeStandard}, - {cfgEventCutFlags.cfgNoCollInRofStandard, kNoCollInRofStandard, o2::aod::evsel::kNoCollInRofStandard}, - {cfgEventCutFlags.cfgNoHighMultCollInPrevRof, kNoHighMultCollInPrevRof, o2::aod::evsel::kNoHighMultCollInPrevRof}, - {cfgEventCutFlags.cfgNoTimeFrameBorder, kNoTimeFrameBorder, o2::aod::evsel::kIsVertexITSTPC}, - {cfgEventCutFlags.cfgNoITSROFrameBorder, kNoITSROFrameBorder, o2::aod::evsel::kIsGoodITSLayersAll}, - {cfgEventCutFlags.cfgIsVertexITSTPC, kIsVertexITSTPC, o2::aod::evsel::kNoTimeFrameBorder}, - {cfgEventCutFlags.cfgIsGoodITSLayersAll, kIsGoodITSLayersAll, o2::aod::evsel::kNoITSROFrameBorder}, - }; + std::vector eventcutflags; enum Particles { PIONS, KAONS, @@ -483,6 +473,20 @@ struct FlowGenericFramework { LOGF(info, "pt-pt subevent: {%.1f,%.1f}", etamin, etamax); } + // Setup event cuts + eventcutflags.push_back({cfgEventCutFlags.cfgNoSameBunchPileupCut, kNoSameBunchPileup, o2::aod::evsel::kNoSameBunchPileup}); + eventcutflags.push_back({cfgEventCutFlags.cfgIsGoodZvtxFT0vsPV, kIsGoodZvtxFT0vsPV, o2::aod::evsel::kIsGoodZvtxFT0vsPV}); + eventcutflags.push_back({cfgEventCutFlags.cfgNoCollInTimeRangeStandard, kNoCollInTimeRangeStandard, o2::aod::evsel::kNoCollInTimeRangeStandard}); + eventcutflags.push_back({cfgEventCutFlags.cfgNoCollInRofStandard, kNoCollInRofStandard, o2::aod::evsel::kNoCollInRofStandard}); + eventcutflags.push_back({cfgEventCutFlags.cfgNoHighMultCollInPrevRof, kNoHighMultCollInPrevRof, o2::aod::evsel::kNoHighMultCollInPrevRof}); + eventcutflags.push_back({cfgEventCutFlags.cfgNoTimeFrameBorder, kNoTimeFrameBorder, o2::aod::evsel::kIsVertexITSTPC}); + eventcutflags.push_back({cfgEventCutFlags.cfgNoITSROFrameBorder, kNoITSROFrameBorder, o2::aod::evsel::kIsGoodITSLayersAll}); + eventcutflags.push_back({cfgEventCutFlags.cfgIsVertexITSTPC, kIsVertexITSTPC, o2::aod::evsel::kNoTimeFrameBorder}); + eventcutflags.push_back({cfgEventCutFlags.cfgIsGoodITSLayersAll, kIsGoodITSLayersAll, o2::aod::evsel::kNoITSROFrameBorder}); + for (const auto& cut : eventcutflags) { + LOGF(info, "Flag %d is %senabled", cut.histBin, (cut.enabled) ? "" : "not "); + } + AxisSpec phiAxis = {o2::analysis::gfw::phibins, o2::analysis::gfw::philow, o2::analysis::gfw::phiup, "#phi"}; AxisSpec phiModAxis = {100, 0, constants::math::PI / 9, "fmod(#varphi,#pi/9)"}; AxisSpec etaAxis = {o2::analysis::gfw::etabins, -cfgEta, cfgEta, "#eta"}; @@ -1771,13 +1775,13 @@ struct FlowGenericFramework { registry.fill(HIST("K0/PiMinusTPC_K0"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("K0/PiMinusTOF_K0"), negtrack.pt(), negtrack.tofNSigmaKa()); - registry.fill(HIST("K0/hK0s"), 1); + registry.fill(HIST("K0/hK0s"), 0.5, 1); if (cfgUsePIDEfficiencies) { double weffDaughter1 = getEfficiency(postrack, 1); double weffDaughter2 = getEfficiency(negtrack, 1); weff = weffDaughter1 * weffDaughter2; if (weff > 0) - registry.fill(HIST("K0/hK0s_corrected"), weff); + registry.fill(HIST("K0/hK0s_corrected"), 0.5, weff); } return true; @@ -1859,13 +1863,13 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/PiMinusTPC_L"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("Lambda/PiMinusTOF_L"), negtrack.pt(), negtrack.tofNSigmaKa()); - registry.fill(HIST("Lambda/hLambdas"), 1); + registry.fill(HIST("Lambda/hLambdas"), 0.5, 1); if (cfgUsePIDEfficiencies) { double weffDaughter1 = getEfficiency(postrack, 3); double weffDaughter2 = getEfficiency(negtrack, 1); weff = weffDaughter1 * weffDaughter2; if (weff > 0) - registry.fill(HIST("Lambda/hLambdas_corrected"), weff); + registry.fill(HIST("Lambda/hLambdas_corrected"), 0.5, weff); } } if (isAL) { @@ -1877,13 +1881,13 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/PrMinusTPC_AL"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("Lambda/PrMinusTOF_AL"), negtrack.pt(), negtrack.tofNSigmaKa()); - registry.fill(HIST("Lambda/hLambdas"), 1); + registry.fill(HIST("Lambda/hLambdas"), 0.5, 1); if (cfgUsePIDEfficiencies) { double weffDaughter1 = getEfficiency(postrack, 1); double weffDaughter2 = getEfficiency(negtrack, 3); weff = weffDaughter1 * weffDaughter2; if (weff > 0) - registry.fill(HIST("Lambda/hLambdas_corrected"), weff); + registry.fill(HIST("Lambda/hLambdas_corrected"), 0.5, weff); } } return true; From 04cf5be9208d136130ff8c1fb359c15bca289e13 Mon Sep 17 00:00:00 2001 From: Florian Eisenhut <53603353+feisenhu@users.noreply.github.com> Date: Tue, 14 Apr 2026 19:47:35 +0200 Subject: [PATCH 269/282] [PWGEM] Fix TTCA weights when using cfgRequireTrueAssociation in PWGEM/Dilepton tasks (#15764) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- PWGEM/Dilepton/Core/DileptonMC.h | 9 +++++++++ PWGEM/Dilepton/Core/SingleTrackQCMC.h | 6 ++++++ PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 83a56821628..6194716c508 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -2222,6 +2222,9 @@ struct DileptonMC { if (cfgEventGeneratorType >= 0 && mccollision_from_neg.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos.emmceventId() != collision.emmceventId() || mcneg.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); @@ -2238,6 +2241,9 @@ struct DileptonMC { if (cfgEventGeneratorType >= 0 && mccollision_from_pos2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos1.emmceventId() != collision.emmceventId() || mcpos2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); @@ -2254,6 +2260,9 @@ struct DileptonMC { if (cfgEventGeneratorType >= 0 && mccollision_from_neg2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcneg1.emmceventId() != collision.emmceventId() || mcneg2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index bde658f6c28..97191e4fe98 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -1055,6 +1055,9 @@ struct SingleTrackQCMC { if (cfgEventGeneratorType >= 0 && mccollision_from_track.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mctrack.emmceventId() != collision.emmceventId())) { + continue; + } if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { if (!cut.template IsSelectedTrack(track)) { @@ -1074,6 +1077,9 @@ struct SingleTrackQCMC { if (cfgEventGeneratorType >= 0 && mccollision_from_track.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mctrack.emmceventId() != collision.emmceventId())) { + continue; + } if (!cut.template IsSelectedTrack(track)) { continue; } diff --git a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx index 91ec19cdacd..b6e0118bd15 100644 --- a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx @@ -2804,6 +2804,9 @@ struct checkMCPairTemplate { if (cfgEventGeneratorType >= 0 && mccollision_from_neg.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos.emmceventId() != collision.emmceventId() || mcneg.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); @@ -2820,6 +2823,9 @@ struct checkMCPairTemplate { if (cfgEventGeneratorType >= 0 && mccollision_from_pos2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos1.emmceventId() != collision.emmceventId() || mcpos2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); @@ -2836,6 +2842,9 @@ struct checkMCPairTemplate { if (cfgEventGeneratorType >= 0 && mccollision_from_neg2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcneg1.emmceventId() != collision.emmceventId() || mcneg2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } From 6287d8735c1989f85d490d62f3e2ba6231f4931d Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 14 Apr 2026 20:17:08 +0200 Subject: [PATCH 270/282] [Common] Fetch FIT ccdb also if only BC cent requested (#15664) --- Common/Tools/Multiplicity/MultModule.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/Tools/Multiplicity/MultModule.h b/Common/Tools/Multiplicity/MultModule.h index 94c9deec697..5b13392e06c 100644 --- a/Common/Tools/Multiplicity/MultModule.h +++ b/Common/Tools/Multiplicity/MultModule.h @@ -1233,11 +1233,11 @@ class MultModule // invoke loading only for requested centralities if (internalOpts.mEnabledTables[kCentFV0As]) getccdb(fv0aInfo, internalOpts.generatorName); - if (internalOpts.mEnabledTables[kCentFT0Ms]) + if (internalOpts.mEnabledTables[kCentFT0Ms] || internalOpts.mEnabledTables[kBCCentFT0Ms]) getccdb(ft0mInfo, internalOpts.generatorName); - if (internalOpts.mEnabledTables[kCentFT0As]) + if (internalOpts.mEnabledTables[kCentFT0As] || internalOpts.mEnabledTables[kBCCentFT0As]) getccdb(ft0aInfo, internalOpts.generatorName); - if (internalOpts.mEnabledTables[kCentFT0Cs]) + if (internalOpts.mEnabledTables[kCentFT0Cs] || internalOpts.mEnabledTables[kBCCentFT0Cs]) getccdb(ft0cInfo, internalOpts.generatorName); if (internalOpts.mEnabledTables[kCentFT0CVariant1s]) getccdb(ft0cVariant1Info, internalOpts.generatorName); From 9ad38d0204320f6af10efc9dcb99f2cbe71a1bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:19:16 +0200 Subject: [PATCH 271/282] [Tutorial,PWGCF,PWGEM,PWGHF,PWGLF,PWGMM,PWGUD] Fix includes and using statements (#15392) --- Tutorials/ML/applyMlSelection.cxx | 20 +++++++-- Tutorials/ML/applyOnnxModel.cxx | 14 ++++-- Tutorials/OpenData/flowAnalysis.cxx | 29 +++++++++---- .../PWGCF/EventPlane/src/qVectorstutorial.cxx | 43 ++++++++----------- .../EventPlane/src/spectatorPlaneTutorial.cxx | 39 ++++++++--------- .../FemtoFramework/src/CFTutorialTask1.cxx | 16 +++---- .../FemtoFramework/src/CFTutorialTask2.cxx | 19 ++++---- .../FemtoFramework/src/CFTutorialTask3.cxx | 23 ++++++---- .../FemtoFramework/src/CFTutorialTask4.cxx | 23 ++++++---- .../FemtoFramework/src/CFTutorialTask5.cxx | 24 ++++++++--- .../src/flowGFWTutorial.cxx | 42 +++++++++++------- .../src/firstcfcorrelations.cxx | 16 ++----- .../src/firstcfo2physics.cxx | 7 ++- Tutorials/PWGEM/Cocktail/plotLFCocktail.C | 8 +++- Tutorials/PWGEM/emcclustertutorial.cxx | 26 +++++------ Tutorials/PWGEM/pcm/pcmtutorial.cxx | 23 ++++++---- Tutorials/PWGHF/taskMini.cxx | 1 - .../PWGLF/Resonance/resonancesCombine.cxx | 22 ++++++---- .../PWGLF/Resonance/resonancesMicrotrack.cxx | 17 ++++---- .../PWGLF/Resonance/resonances_step0.cxx | 13 +++--- .../PWGLF/Resonance/resonances_step1.cxx | 18 +++++--- .../PWGLF/Resonance/resonances_step2.cxx | 21 ++++++--- .../PWGLF/Resonance/resonances_step3.cxx | 12 ++++-- .../PWGLF/Resonance/resonances_step4.cxx | 12 ++++-- .../PWGLF/Resonance/resonances_step5.cxx | 15 +++++-- .../PWGLF/Resonance/resonances_step6.cxx | 20 ++++++--- .../Analysis/strangeness_derived_skeleton.cxx | 12 +++++- .../Analysis/strangeness_derived_step0.cxx | 12 +++++- .../Analysis/strangeness_derived_step1.cxx | 15 ++++++- .../Analysis/strangeness_derived_step2.cxx | 15 ++++++- .../Analysis/strangeness_derived_step3.cxx | 15 ++++++- .../Analysis/strangeness_derived_step4.cxx | 17 +++++++- .../Original/strangeness_skeleton.cxx | 14 ++++-- .../Original/strangeness_step0.cxx | 12 +++++- .../Original/strangeness_step1.cxx | 12 +++++- .../Original/strangeness_step2.cxx | 17 ++++++-- .../Original/strangeness_step3.cxx | 19 ++++++-- .../Original/strangeness_step4.cxx | 20 +++++++-- .../PWGLF/Utils/collisionCutsTutorial.cxx | 10 ++++- Tutorials/PWGMM/myExampleTask.cxx | 9 +++- Tutorials/PWGUD/UDTutorial_01.cxx | 22 +++++++--- Tutorials/PWGUD/UDTutorial_02a.cxx | 22 +++++++--- Tutorials/PWGUD/UDTutorial_02b.cxx | 19 +++++++- Tutorials/PWGUD/UDTutorial_03a.cxx | 24 ++++++++--- Tutorials/PWGUD/UDTutorial_03b.cxx | 24 ++++++++--- Tutorials/PWGUD/UDTutorial_04.cxx | 27 +++++++++--- Tutorials/PWGUD/UDTutorial_05.cxx | 28 ++++++++---- Tutorials/PWGUD/UDTutorial_06.cxx | 37 ++++++++-------- Tutorials/PWGUD/UDTutorial_07.cxx | 27 ++++++++---- Tutorials/PWGUD/UDTutorial_08.cxx | 8 ++++ .../Skimming/DataModel/DerivedExampleTable.h | 10 ++--- Tutorials/Skimming/DataModel/JEDerived.h | 16 ++++--- Tutorials/Skimming/DataModel/LFDerived.h | 13 +++--- Tutorials/Skimming/DataModel/UDDerived.h | 10 ++--- Tutorials/Skimming/derivedBasicConsumer.cxx | 19 ++++---- Tutorials/Skimming/derivedBasicProvider.cxx | 22 ++++++---- Tutorials/Skimming/jetProvider.cxx | 16 +++---- Tutorials/Skimming/jetSpectraAnalyser.cxx | 22 ++++------ Tutorials/Skimming/jetSpectraReference.cxx | 17 +++----- Tutorials/Skimming/spectraNucleiAnalyser.cxx | 18 ++++---- Tutorials/Skimming/spectraNucleiProvider.cxx | 18 ++++---- Tutorials/Skimming/spectraNucleiReference.cxx | 20 ++++++--- Tutorials/Skimming/spectraTPCAnalyser.cxx | 23 +++++++--- Tutorials/Skimming/spectraTPCProvider.cxx | 17 ++++---- Tutorials/Skimming/spectraTPCReference.cxx | 23 +++++++--- Tutorials/Skimming/spectraUPCAnalyser.cxx | 19 ++++---- Tutorials/Skimming/spectraUPCProvider.cxx | 14 +++--- Tutorials/Skimming/spectraUPCReference.cxx | 22 ++++++---- Tutorials/include/configurableCut.h | 15 ++++--- Tutorials/src/IntermediateTables.h | 3 +- Tutorials/src/TrainingTree.h | 3 +- Tutorials/src/ZDCVZeroIteration.cxx | 5 ++- Tutorials/src/associatedExample.cxx | 16 +++++-- Tutorials/src/ccdbaccess.cxx | 12 ++++-- Tutorials/src/ccdbtableaccess.cxx | 15 +++---- Tutorials/src/collisionTracksIteration.cxx | 5 ++- Tutorials/src/compatibleBCs.cxx | 11 +++-- Tutorials/src/conditionalExpressions.cxx | 14 +++++- Tutorials/src/configurableCut.cxx | 6 +++ Tutorials/src/configurableObjects.cxx | 17 ++++++-- Tutorials/src/consume.cxx | 8 +++- Tutorials/src/dynamicColumns.cxx | 7 ++- Tutorials/src/efficiencyGlobal.cxx | 14 ++++-- Tutorials/src/efficiencyPerRun.cxx | 14 ++++-- Tutorials/src/eventMixing.cxx | 19 +++++--- Tutorials/src/eventMixingValidation.cxx | 21 ++++----- Tutorials/src/extendedColumns.cxx | 7 ++- Tutorials/src/extendedTables.cxx | 9 +++- Tutorials/src/filters.cxx | 11 ++++- Tutorials/src/fullTrackIteration.cxx | 6 ++- Tutorials/src/hepMC.cxx | 9 +++- Tutorials/src/histogramRegistry.cxx | 31 ++++++++++--- Tutorials/src/histogramTrackSelection.cxx | 14 ++++-- Tutorials/src/histograms.cxx | 15 ++++++- Tutorials/src/histogramsFullTracks.cxx | 11 +++-- Tutorials/src/jetAnalysis.cxx | 11 ++++- Tutorials/src/mcHistograms.cxx | 15 ++++--- Tutorials/src/mcOnly.cxx | 13 +++--- Tutorials/src/multiProcess.cxx | 13 +++++- .../src/multiplicityEventTrackSelection.cxx | 13 ++++-- Tutorials/src/muonIteration.cxx | 7 +-- Tutorials/src/newCollections.cxx | 11 ++++- Tutorials/src/partitions.cxx | 11 ++++- Tutorials/src/pidTpcTof.cxx | 13 +++--- Tutorials/src/preprocess.cxx | 16 +++++-- Tutorials/src/propagatedTracks.cxx | 20 ++++----- Tutorials/src/reweighting.cxx | 26 +++++++++-- Tutorials/src/schemaEvolution.cxx | 13 +++++- Tutorials/src/tableIOin.cxx | 5 ++- Tutorials/src/tableIOout.cxx | 7 ++- Tutorials/src/trackIteration.cxx | 7 ++- Tutorials/src/tracksCombinations.cxx | 15 +++++-- Tutorials/src/treeCreator.cxx | 13 ++++-- Tutorials/src/usingPDGService.cxx | 10 +++-- Tutorials/src/weakDecayIteration.cxx | 5 ++- 115 files changed, 1238 insertions(+), 603 deletions(-) diff --git a/Tutorials/ML/applyMlSelection.cxx b/Tutorials/ML/applyMlSelection.cxx index aad14571c2d..869abd7a62c 100644 --- a/Tutorials/ML/applyMlSelection.cxx +++ b/Tutorials/ML/applyMlSelection.cxx @@ -17,12 +17,26 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "Tools/ML/MlResponse.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include using namespace o2; using namespace o2::analysis; diff --git a/Tutorials/ML/applyOnnxModel.cxx b/Tutorials/ML/applyOnnxModel.cxx index 6bf5d6ecb59..16151511df0 100644 --- a/Tutorials/ML/applyOnnxModel.cxx +++ b/Tutorials/ML/applyOnnxModel.cxx @@ -14,11 +14,19 @@ /// /// \author Christian Sonnabend , GSI -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" #include "Tools/ML/model.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/OpenData/flowAnalysis.cxx b/Tutorials/OpenData/flowAnalysis.cxx index 29190eee67e..6ab74ebfced 100644 --- a/Tutorials/OpenData/flowAnalysis.cxx +++ b/Tutorials/OpenData/flowAnalysis.cxx @@ -15,23 +15,36 @@ /// \author /// \since -#include -#include -#include -#include -#include -#include -#include +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" #include #include #include +#include #include +#include +#include #include +#include +#include +#include #include #include -#include +#include +#include + +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx b/Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx index b5b01185a49..c572356754c 100644 --- a/Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx +++ b/Tutorials/PWGCF/EventPlane/src/qVectorstutorial.cxx @@ -9,35 +9,28 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// C++/ROOT includes. -#include -#include -#include -#include -#include -#include -#include -#include - -// o2Physics includes. -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/StaticFor.h" - -#include "Common/DataModel/Qvectors.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/EventPlaneHelper.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" -#include "Common/Core/EventPlaneHelper.h" -#include "Common/Core/TrackSelection.h" -#include "CommonConstants/PhysicsConstants.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -// o2 includes. +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGCF/EventPlane/src/spectatorPlaneTutorial.cxx b/Tutorials/PWGCF/EventPlane/src/spectatorPlaneTutorial.cxx index 6790dd30ae5..d99a16fb996 100644 --- a/Tutorials/PWGCF/EventPlane/src/spectatorPlaneTutorial.cxx +++ b/Tutorials/PWGCF/EventPlane/src/spectatorPlaneTutorial.cxx @@ -16,33 +16,32 @@ #include "PWGCF/DataModel/SPTableZDC.h" -#include "Common/Core/EventPlaneHelper.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" - -#include "TF1.h" -#include "TPDGCode.h" - -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include #include -#include -#include #include using namespace o2; diff --git a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask1.cxx b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask1.cxx index 369e63cbdf6..8cbaf5da2b4 100644 --- a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask1.cxx +++ b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask1.cxx @@ -11,19 +11,19 @@ /// \author Anton Riedel -/// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -/// FemtoDream includes -#include "PWGCF/FemtoDream/Core/femtoDreamMath.h" -#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" #include "PWGCF/DataModel/FemtoDerived.h" +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::analysis::femtoDream; struct CFTutorialTask1 { diff --git a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask2.cxx b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask2.cxx index ff5fa93aa5b..65464a9fafd 100644 --- a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask2.cxx +++ b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask2.cxx @@ -11,19 +11,22 @@ /// \author Anton Riedel -/// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -/// FemtoDream includes -#include "PWGCF/FemtoDream/Core/femtoDreamMath.h" -#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" #include "PWGCF/DataModel/FemtoDerived.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::analysis::femtoDream; struct CFTutorialTask2 { diff --git a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask3.cxx b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask3.cxx index ca200fd3937..112b4d053b5 100644 --- a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask3.cxx +++ b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask3.cxx @@ -11,19 +11,26 @@ /// \author Anton Riedel -/// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -/// FemtoDream includes -#include "PWGCF/FemtoDream/Core/femtoDreamMath.h" -#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" #include "PWGCF/DataModel/FemtoDerived.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::analysis::femtoDream; struct CFTutorialTask3 { diff --git a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask4.cxx b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask4.cxx index 90ae5168a78..fdfcf410147 100644 --- a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask4.cxx +++ b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask4.cxx @@ -11,19 +11,26 @@ /// \author Anton Riedel -/// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -/// FemtoDream includes -#include "PWGCF/FemtoDream/Core/femtoDreamMath.h" -#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" #include "PWGCF/DataModel/FemtoDerived.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::analysis::femtoDream; struct CFTutorialTask4 { diff --git a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask5.cxx b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask5.cxx index d9159c2e3cc..be71808ecf5 100644 --- a/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask5.cxx +++ b/Tutorials/PWGCF/FemtoFramework/src/CFTutorialTask5.cxx @@ -11,15 +11,25 @@ /// \author Anton Riedel -/// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "TDatabasePDG.h" - -/// FemtoDream includes +#include "PWGCF/DataModel/FemtoDerived.h" #include "PWGCF/FemtoDream/Core/femtoDreamMath.h" #include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" -#include "PWGCF/DataModel/FemtoDerived.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx b/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx index cfd0eca696b..02d8c89d063 100644 --- a/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx +++ b/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx @@ -9,25 +9,35 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/HistogramRegistry.h" +#include "PWGCF/GenericFramework/Core/GFW.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" -#include "GFWPowerArray.h" -#include "GFW.h" -#include "GFWCumulant.h" -#include "TList.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -54,7 +64,7 @@ struct GfwTutorial { ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); // Connect to ccdb Service ccdb; diff --git a/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfcorrelations.cxx b/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfcorrelations.cxx index cdec4f3ca95..556108c95fb 100644 --- a/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfcorrelations.cxx +++ b/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfcorrelations.cxx @@ -13,18 +13,10 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.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 +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfo2physics.cxx b/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfo2physics.cxx index d5d1a6777d3..e0dca13afe6 100644 --- a/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfo2physics.cxx +++ b/Tutorials/PWGCF/TwoParticleCorrelations/src/firstcfo2physics.cxx @@ -13,10 +13,9 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "Common/DataModel/Centrality.h" +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGEM/Cocktail/plotLFCocktail.C b/Tutorials/PWGEM/Cocktail/plotLFCocktail.C index 8740544d66f..4387b986d30 100644 --- a/Tutorials/PWGEM/Cocktail/plotLFCocktail.C +++ b/Tutorials/PWGEM/Cocktail/plotLFCocktail.C @@ -9,6 +9,12 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include +#include +#include +#include +#include + const int nHists = 7; TH1F* mee[nHists]; TH1F* mee_orig[nHists]; @@ -72,4 +78,4 @@ void plotLFCocktail(TString filename = "AnalysisResults.root", int rebin = 1) } gPad->BuildLegend(0.62, 0.9, 0.9, 0.6); mee[0]->SetTitle("after resolution and acceptance"); -} \ No newline at end of file +} diff --git a/Tutorials/PWGEM/emcclustertutorial.cxx b/Tutorials/PWGEM/emcclustertutorial.cxx index 2e2df5912c1..203bfd8f002 100644 --- a/Tutorials/PWGEM/emcclustertutorial.cxx +++ b/Tutorials/PWGEM/emcclustertutorial.cxx @@ -11,26 +11,22 @@ #include "PWGJE/DataModel/EMCALClusters.h" -#include "Common/DataModel/Centrality.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/AnalysisCluster.h" -#include "DataFormatsEMCAL/Cell.h" -#include "DataFormatsEMCAL/Constants.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include -#include -#include -#include #include #include diff --git a/Tutorials/PWGEM/pcm/pcmtutorial.cxx b/Tutorials/PWGEM/pcm/pcmtutorial.cxx index c10b4251991..2704acd795f 100644 --- a/Tutorials/PWGEM/pcm/pcmtutorial.cxx +++ b/Tutorials/PWGEM/pcm/pcmtutorial.cxx @@ -12,16 +12,21 @@ /// \brief tutorial for pcm analysis. /// \author daiki.sekihata@cern.ch -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::soa; diff --git a/Tutorials/PWGHF/taskMini.cxx b/Tutorials/PWGHF/taskMini.cxx index e92553d8e50..9656eef3c62 100644 --- a/Tutorials/PWGHF/taskMini.cxx +++ b/Tutorials/PWGHF/taskMini.cxx @@ -36,7 +36,6 @@ #include #include -#include #include #include diff --git a/Tutorials/PWGLF/Resonance/resonancesCombine.cxx b/Tutorials/PWGLF/Resonance/resonancesCombine.cxx index 26a28661c6c..9243c7cdbde 100644 --- a/Tutorials/PWGLF/Resonance/resonancesCombine.cxx +++ b/Tutorials/PWGLF/Resonance/resonancesCombine.cxx @@ -14,16 +14,22 @@ /// \author Bong-Hwi Lim /// \since 13/12/2024 -#include -#include +#include "PWGLF/DataModel/LFResonanceTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/DataModel/Qvectors.h" #include "Common/Core/EventPlaneHelper.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" -#include "PWGLF/DataModel/LFResonanceTables.h" +#include "Common/DataModel/Qvectors.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Resonance/resonancesMicrotrack.cxx b/Tutorials/PWGLF/Resonance/resonancesMicrotrack.cxx index 5022d4b602d..bcb945f8647 100644 --- a/Tutorials/PWGLF/Resonance/resonancesMicrotrack.cxx +++ b/Tutorials/PWGLF/Resonance/resonancesMicrotrack.cxx @@ -14,16 +14,17 @@ /// \author Bong-Hwi Lim /// \since 07/03/2025 -#include -#include - -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step0.cxx b/Tutorials/PWGLF/Resonance/resonances_step0.cxx index 706abc72cd2..31c96c4a2ff 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step0.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step0.cxx @@ -13,13 +13,16 @@ /// \author /// \since 08/11/2023 -#include - -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step1.cxx b/Tutorials/PWGLF/Resonance/resonances_step1.cxx index 2f566ace97c..8c8f731ea68 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step1.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step1.cxx @@ -13,15 +13,19 @@ /// \author /// \since 08/11/2023 -#include -#include - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step2.cxx b/Tutorials/PWGLF/Resonance/resonances_step2.cxx index 000bbf1e501..9956e8d7ef2 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step2.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step2.cxx @@ -13,14 +13,23 @@ /// \author /// \since 08/11/2023 -#include - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step3.cxx b/Tutorials/PWGLF/Resonance/resonances_step3.cxx index f2ef8dbbe67..692e4e1cd77 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step3.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step3.cxx @@ -13,12 +13,16 @@ /// \author Hirak Kumar Koley /// \since 11/10/2024 -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step4.cxx b/Tutorials/PWGLF/Resonance/resonances_step4.cxx index 05f7b35f7cf..97b588c9df6 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step4.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step4.cxx @@ -13,12 +13,16 @@ /// \author Hirak Kumar Koley /// \since 11/10/2024 -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step5.cxx b/Tutorials/PWGLF/Resonance/resonances_step5.cxx index 7d8463b9236..aaf10cca389 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step5.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step5.cxx @@ -13,12 +13,19 @@ /// \author Hirak Kumar Koley /// \since 11/10/2024 -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Resonance/resonances_step6.cxx b/Tutorials/PWGLF/Resonance/resonances_step6.cxx index 23ccac6dfd2..616a2648d27 100644 --- a/Tutorials/PWGLF/Resonance/resonances_step6.cxx +++ b/Tutorials/PWGLF/Resonance/resonances_step6.cxx @@ -13,14 +13,22 @@ /// \author Hirak Kumar Koley /// \since 11/10/2024 -#include - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_skeleton.cxx b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_skeleton.cxx index 13b030a6b02..cfd28f9f825 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_skeleton.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_skeleton.cxx @@ -19,8 +19,16 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step0.cxx b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step0.cxx index fa3b71c7b35..2a63800e255 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step0.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step0.cxx @@ -19,8 +19,16 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step1.cxx b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step1.cxx index f9211528626..49a0d38d4fe 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step1.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step1.cxx @@ -19,8 +19,19 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step2.cxx b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step2.cxx index a52df4fc576..5dd95dddbc8 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step2.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step2.cxx @@ -20,8 +20,19 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step3.cxx b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step3.cxx index 8885e9ba425..204c6471506 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step3.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step3.cxx @@ -20,8 +20,19 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step4.cxx b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step4.cxx index 94169733f30..49bf2265e4d 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/Analysis/strangeness_derived_step4.cxx @@ -20,8 +20,21 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Original/strangeness_skeleton.cxx b/Tutorials/PWGLF/Strangeness/Original/strangeness_skeleton.cxx index 761da227e3c..da58bd3c52f 100644 --- a/Tutorials/PWGLF/Strangeness/Original/strangeness_skeleton.cxx +++ b/Tutorials/PWGLF/Strangeness/Original/strangeness_skeleton.cxx @@ -13,12 +13,18 @@ /// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) /// \author Chiara De Martin (chiara.de.martin@cern.ch) -#include "PWGLF/DataModel/LFStrangenessTables.h" - #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Original/strangeness_step0.cxx b/Tutorials/PWGLF/Strangeness/Original/strangeness_step0.cxx index 4c2b6569e09..fa98b01b381 100644 --- a/Tutorials/PWGLF/Strangeness/Original/strangeness_step0.cxx +++ b/Tutorials/PWGLF/Strangeness/Original/strangeness_step0.cxx @@ -17,8 +17,16 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Original/strangeness_step1.cxx b/Tutorials/PWGLF/Strangeness/Original/strangeness_step1.cxx index ca57646dc97..a494be8dc7a 100644 --- a/Tutorials/PWGLF/Strangeness/Original/strangeness_step1.cxx +++ b/Tutorials/PWGLF/Strangeness/Original/strangeness_step1.cxx @@ -17,8 +17,16 @@ #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Original/strangeness_step2.cxx b/Tutorials/PWGLF/Strangeness/Original/strangeness_step2.cxx index f41aac138f5..e22127d1466 100644 --- a/Tutorials/PWGLF/Strangeness/Original/strangeness_step2.cxx +++ b/Tutorials/PWGLF/Strangeness/Original/strangeness_step2.cxx @@ -16,9 +16,20 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/EventSelection.h" - -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/PIDResponseTPC.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Original/strangeness_step3.cxx b/Tutorials/PWGLF/Strangeness/Original/strangeness_step3.cxx index 16a71ee81e5..3f38287deef 100644 --- a/Tutorials/PWGLF/Strangeness/Original/strangeness_step3.cxx +++ b/Tutorials/PWGLF/Strangeness/Original/strangeness_step3.cxx @@ -16,9 +16,22 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/EventSelection.h" - -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/PIDResponseTPC.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Strangeness/Original/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/Original/strangeness_step4.cxx index eb8893e2cd2..89f6d69a2a3 100644 --- a/Tutorials/PWGLF/Strangeness/Original/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/Original/strangeness_step4.cxx @@ -16,9 +16,23 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/EventSelection.h" - -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/PIDResponseTPC.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGLF/Utils/collisionCutsTutorial.cxx b/Tutorials/PWGLF/Utils/collisionCutsTutorial.cxx index 47747c6e4b2..4ca4eacc2f4 100644 --- a/Tutorials/PWGLF/Utils/collisionCutsTutorial.cxx +++ b/Tutorials/PWGLF/Utils/collisionCutsTutorial.cxx @@ -20,8 +20,14 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGMM/myExampleTask.cxx b/Tutorials/PWGMM/myExampleTask.cxx index f7035781b6e..e6839bdfe5c 100644 --- a/Tutorials/PWGMM/myExampleTask.cxx +++ b/Tutorials/PWGMM/myExampleTask.cxx @@ -13,8 +13,13 @@ /// it is meant to be a blank page for further developments. /// \author everyone -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_01.cxx b/Tutorials/PWGUD/UDTutorial_01.cxx index d19accd1ee8..ca17b26ba7a 100644 --- a/Tutorials/PWGUD/UDTutorial_01.cxx +++ b/Tutorials/PWGUD/UDTutorial_01.cxx @@ -13,15 +13,23 @@ // \author Paul Buehler, paul.buehler@oeaw.ac.at // \since April 2023 -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/PIDResponseTOF.h" - -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TVector3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_02a.cxx b/Tutorials/PWGUD/UDTutorial_02a.cxx index 847191d3626..dc608ee3965 100644 --- a/Tutorials/PWGUD/UDTutorial_02a.cxx +++ b/Tutorials/PWGUD/UDTutorial_02a.cxx @@ -16,11 +16,23 @@ #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_02b.cxx b/Tutorials/PWGUD/UDTutorial_02b.cxx index ece20563991..1d060b44f27 100644 --- a/Tutorials/PWGUD/UDTutorial_02b.cxx +++ b/Tutorials/PWGUD/UDTutorial_02b.cxx @@ -17,8 +17,23 @@ #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_03a.cxx b/Tutorials/PWGUD/UDTutorial_03a.cxx index 4a7c91d0690..a133a359053 100644 --- a/Tutorials/PWGUD/UDTutorial_03a.cxx +++ b/Tutorials/PWGUD/UDTutorial_03a.cxx @@ -19,11 +19,25 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_03b.cxx b/Tutorials/PWGUD/UDTutorial_03b.cxx index af5c1e1166e..beee8578225 100644 --- a/Tutorials/PWGUD/UDTutorial_03b.cxx +++ b/Tutorials/PWGUD/UDTutorial_03b.cxx @@ -19,11 +19,25 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_04.cxx b/Tutorials/PWGUD/UDTutorial_04.cxx index 94a93cb0ef4..f2220ad17e1 100644 --- a/Tutorials/PWGUD/UDTutorial_04.cxx +++ b/Tutorials/PWGUD/UDTutorial_04.cxx @@ -13,13 +13,28 @@ // \author Paul Buehler, paul.buehler@oeaw.ac.at // \since October 2023 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_05.cxx b/Tutorials/PWGUD/UDTutorial_05.cxx index 40375c48614..36ccc7590b0 100644 --- a/Tutorials/PWGUD/UDTutorial_05.cxx +++ b/Tutorials/PWGUD/UDTutorial_05.cxx @@ -10,18 +10,28 @@ // or submit itself to any jurisdiction. // -#include -#include "TLorentzVector.h" -#include "TDatabasePDG.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include -// using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_06.cxx b/Tutorials/PWGUD/UDTutorial_06.cxx index 9b1d1f55895..0ad7f4766e0 100644 --- a/Tutorials/PWGUD/UDTutorial_06.cxx +++ b/Tutorials/PWGUD/UDTutorial_06.cxx @@ -13,24 +13,27 @@ /// \author Anisa Khatun /// \date 10.10.2024 -// O2 headers -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -// O2Physics headers #include "PWGUD/DataModel/UDTables.h" -#include "PWGUD/Core/UDHelpers.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" - -// ROOT headers -#include "TSystem.h" -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "TLorentzVector.h" -#include "TMath.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/PWGUD/UDTutorial_07.cxx b/Tutorials/PWGUD/UDTutorial_07.cxx index 0060b68293e..f9a7ffee4a4 100644 --- a/Tutorials/PWGUD/UDTutorial_07.cxx +++ b/Tutorials/PWGUD/UDTutorial_07.cxx @@ -9,16 +9,27 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -#include -#include -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "PWGUD/DataModel/UDTables.h" -#include "TLorentzVector.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include using namespace std; using namespace o2; diff --git a/Tutorials/PWGUD/UDTutorial_08.cxx b/Tutorials/PWGUD/UDTutorial_08.cxx index b9795210c87..87a27cd2e51 100644 --- a/Tutorials/PWGUD/UDTutorial_08.cxx +++ b/Tutorials/PWGUD/UDTutorial_08.cxx @@ -13,12 +13,20 @@ // \author Sigurd Nese // \since November 2025 +#include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" + +#include "Common/DataModel/EventSelection.h" #include +#include #include +#include #include +#include + using namespace o2::framework; // EvSels table contains connection between collision and BC diff --git a/Tutorials/Skimming/DataModel/DerivedExampleTable.h b/Tutorials/Skimming/DataModel/DerivedExampleTable.h index 46a97b07e7b..a5e4b7f4906 100644 --- a/Tutorials/Skimming/DataModel/DerivedExampleTable.h +++ b/Tutorials/Skimming/DataModel/DerivedExampleTable.h @@ -9,11 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef O2_ANALYSIS_DERIVEDEXAMPLETABLES_H -#define O2_ANALYSIS_DERIVEDEXAMPLETABLES_H +#ifndef TUTORIALS_SKIMMING_DATAMODEL_DERIVEDEXAMPLETABLE_H_ +#define TUTORIALS_SKIMMING_DATAMODEL_DERIVEDEXAMPLETABLE_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include namespace o2::aod { @@ -33,4 +33,4 @@ DECLARE_SOA_TABLE(DrTracks, "AOD", "DRTRACK", o2::soa::Index<>, exampleTrackSpac using DrTrack = DrTracks::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_DERIVEDEXAMPLETABLES_H +#endif // TUTORIALS_SKIMMING_DATAMODEL_DERIVEDEXAMPLETABLE_H_ diff --git a/Tutorials/Skimming/DataModel/JEDerived.h b/Tutorials/Skimming/DataModel/JEDerived.h index 20a8b3d076e..000d01411d9 100644 --- a/Tutorials/Skimming/DataModel/JEDerived.h +++ b/Tutorials/Skimming/DataModel/JEDerived.h @@ -10,11 +10,13 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -#ifndef O2_ANALYSIS_JEDERIVED_H -#define O2_ANALYSIS_JEDERIVED_H +#ifndef TUTORIALS_SKIMMING_DATAMODEL_JEDERIVED_H_ +#define TUTORIALS_SKIMMING_DATAMODEL_JEDERIVED_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { @@ -29,7 +31,7 @@ DECLARE_SOA_COLUMN(Area, area, float); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return pt * TMath::Cos(phi); }); DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return pt * TMath::Sin(phi); }); DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return pt * TMath::SinH(eta); }); -DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); //absolute p +DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); // absolute p } // namespace jejet DECLARE_SOA_TABLE(JEJets, "AOD", "JEJET", @@ -56,7 +58,7 @@ DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return pt * TMath::Cos(phi); }); DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return pt * TMath::Sin(phi); }); DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return pt * TMath::SinH(eta); }); -DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); //absolute p +DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); // absolute p } // namespace jeconstituent DECLARE_SOA_TABLE(JEConstituents, "AOD", "JECONSTITUENT", o2::soa::Index<>, @@ -69,4 +71,4 @@ DECLARE_SOA_TABLE(JEConstituents, "AOD", "JECONSTITUENT", o2::soa::Index<>, using JEConstituent = JEConstituents::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_JEDERIVED_H +#endif // TUTORIALS_SKIMMING_DATAMODEL_JEDERIVED_H_ diff --git a/Tutorials/Skimming/DataModel/LFDerived.h b/Tutorials/Skimming/DataModel/LFDerived.h index 12d7405a98d..4e47d06cd68 100644 --- a/Tutorials/Skimming/DataModel/LFDerived.h +++ b/Tutorials/Skimming/DataModel/LFDerived.h @@ -10,14 +10,13 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -#ifndef O2_ANALYSIS_LFDERIVED_H -#define O2_ANALYSIS_LFDERIVED_H +#ifndef TUTORIALS_SKIMMING_DATAMODEL_LFDERIVED_H_ +#define TUTORIALS_SKIMMING_DATAMODEL_LFDERIVED_H_ -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { @@ -95,4 +94,4 @@ using LFNucleiTrack = LFNucleiTracks::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_LFDERIVED_H +#endif // TUTORIALS_SKIMMING_DATAMODEL_LFDERIVED_H_ diff --git a/Tutorials/Skimming/DataModel/UDDerived.h b/Tutorials/Skimming/DataModel/UDDerived.h index 8a8a2b6984e..738dec61a1b 100644 --- a/Tutorials/Skimming/DataModel/UDDerived.h +++ b/Tutorials/Skimming/DataModel/UDDerived.h @@ -10,11 +10,11 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -#ifndef O2_ANALYSIS_UDDERIVED_H -#define O2_ANALYSIS_UDDERIVED_H +#ifndef TUTORIALS_SKIMMING_DATAMODEL_UDDERIVED_H_ +#define TUTORIALS_SKIMMING_DATAMODEL_UDDERIVED_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include namespace o2::aod { @@ -40,4 +40,4 @@ using UDTrack = UDTracks::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_UDDERIVED_H +#endif // TUTORIALS_SKIMMING_DATAMODEL_UDDERIVED_H_ diff --git a/Tutorials/Skimming/derivedBasicConsumer.cxx b/Tutorials/Skimming/derivedBasicConsumer.cxx index c96eeb156e7..712e766772c 100644 --- a/Tutorials/Skimming/derivedBasicConsumer.cxx +++ b/Tutorials/Skimming/derivedBasicConsumer.cxx @@ -10,20 +10,23 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -// O2 includes -#include "ReconstructionDataFormats/Track.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "DataModel/DerivedExampleTable.h" +#include +#include +#include +#include +#include +#include + +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct DerivedBasicConsumer { /// Function to aid in calculating delta-phi /// \param phi1 first phi value diff --git a/Tutorials/Skimming/derivedBasicProvider.cxx b/Tutorials/Skimming/derivedBasicProvider.cxx index 93e567ecc9b..dc590ac6d8d 100644 --- a/Tutorials/Skimming/derivedBasicProvider.cxx +++ b/Tutorials/Skimming/derivedBasicProvider.cxx @@ -9,20 +9,26 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// O2 includes -#include "ReconstructionDataFormats/Track.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "DataModel/DerivedExampleTable.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct DerivedBasicProvider { // Histogram registry: an object to hold your histograms HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; diff --git a/Tutorials/Skimming/jetProvider.cxx b/Tutorials/Skimming/jetProvider.cxx index 36b985bc18d..ea9d23b1a14 100644 --- a/Tutorials/Skimming/jetProvider.cxx +++ b/Tutorials/Skimming/jetProvider.cxx @@ -10,22 +10,20 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -// O2 includes -#include "ReconstructionDataFormats/Track.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "DataModel/JEDerived.h" + #include "PWGJE/DataModel/Jet.h" -#include "PWGJE/Core/JetFinder.h" + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct JetProviderTask { Produces outputJets; diff --git a/Tutorials/Skimming/jetSpectraAnalyser.cxx b/Tutorials/Skimming/jetSpectraAnalyser.cxx index 6e635cd659e..d315fc2c022 100644 --- a/Tutorials/Skimming/jetSpectraAnalyser.cxx +++ b/Tutorials/Skimming/jetSpectraAnalyser.cxx @@ -14,19 +14,15 @@ // Author: Nima Zardoshti // -#include "TH1F.h" -#include "TTree.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" - -#include "PWGJE/DataModel/Jet.h" -#include "PWGJE/Core/JetFinder.h" #include "DataModel/JEDerived.h" +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -39,7 +35,7 @@ struct JetSpectraAnalyser { {"hNJetConstituents", "Number of constituents;N;entries", {HistType::kTH1F, {{100, -0.5, 99.5}}}}, {"hConstituentPt", "Constituent pT; Constituent #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 100.}}}}}}; - //Filter jetCuts = aod::jet::pt > f_jetPtMin; + // Filter jetCuts = aod::jet::pt > f_jetPtMin; void process(aod::JEJet const& jet, aod::JEConstituents const& constituents) @@ -55,4 +51,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc, TaskName{"jetspectra-task-skim-analyser"})}; -} \ No newline at end of file +} diff --git a/Tutorials/Skimming/jetSpectraReference.cxx b/Tutorials/Skimming/jetSpectraReference.cxx index 74fb82dfc83..072357216cb 100644 --- a/Tutorials/Skimming/jetSpectraReference.cxx +++ b/Tutorials/Skimming/jetSpectraReference.cxx @@ -14,17 +14,14 @@ // Author: Nima Zardoshti // -#include "TH1F.h" -#include "TTree.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" - #include "PWGJE/DataModel/Jet.h" -#include "PWGJE/Core/JetFinder.h" + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/Skimming/spectraNucleiAnalyser.cxx b/Tutorials/Skimming/spectraNucleiAnalyser.cxx index 699905c2f9b..9ef8fbe3e82 100644 --- a/Tutorials/Skimming/spectraNucleiAnalyser.cxx +++ b/Tutorials/Skimming/spectraNucleiAnalyser.cxx @@ -8,18 +8,18 @@ // 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. -// O2 includes #include "DataModel/LFDerived.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/Tutorials/Skimming/spectraNucleiProvider.cxx b/Tutorials/Skimming/spectraNucleiProvider.cxx index 76a0bb9dc42..404169f202d 100644 --- a/Tutorials/Skimming/spectraNucleiProvider.cxx +++ b/Tutorials/Skimming/spectraNucleiProvider.cxx @@ -10,29 +10,31 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -// O2 includes #include "DataModel/LFDerived.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::math_utils::detail; -#include "Framework/runDataProcessing.h" - struct NucleiSpectraProviderTask { Produces outputCollisions; diff --git a/Tutorials/Skimming/spectraNucleiReference.cxx b/Tutorials/Skimming/spectraNucleiReference.cxx index 7d3bf950210..cbca33c2611 100644 --- a/Tutorials/Skimming/spectraNucleiReference.cxx +++ b/Tutorials/Skimming/spectraNucleiReference.cxx @@ -8,23 +8,29 @@ // 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. -// O2 includes +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + #include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/Skimming/spectraTPCAnalyser.cxx b/Tutorials/Skimming/spectraTPCAnalyser.cxx index 348e9d1de7c..4b53b56ea73 100644 --- a/Tutorials/Skimming/spectraTPCAnalyser.cxx +++ b/Tutorials/Skimming/spectraTPCAnalyser.cxx @@ -9,15 +9,24 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// O2 includes #include "DataModel/LFDerived.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/Track.h" +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -30,7 +39,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include constexpr int Np = 9; struct TPCSpectraAnalyserTask { diff --git a/Tutorials/Skimming/spectraTPCProvider.cxx b/Tutorials/Skimming/spectraTPCProvider.cxx index c79115dd78f..f4828029a44 100644 --- a/Tutorials/Skimming/spectraTPCProvider.cxx +++ b/Tutorials/Skimming/spectraTPCProvider.cxx @@ -10,26 +10,27 @@ // or submit itself to any jurisdiction. /// \author Nima Zardoshti , CERN -// O2 includes #include "DataModel/LFDerived.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::math_utils::detail; -#include "Framework/runDataProcessing.h" - struct TPCSpectraProviderTask { // Produces outputCollisions; //currently it seems in the spectraTPC task no loop over the collision is made. Leave this here in case it will be added diff --git a/Tutorials/Skimming/spectraTPCReference.cxx b/Tutorials/Skimming/spectraTPCReference.cxx index 6111c5dba92..db02e2c6109 100644 --- a/Tutorials/Skimming/spectraTPCReference.cxx +++ b/Tutorials/Skimming/spectraTPCReference.cxx @@ -9,14 +9,25 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// O2 includes #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -29,7 +40,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include constexpr int Np = 9; struct TPCSpectraReferenceTask { diff --git a/Tutorials/Skimming/spectraUPCAnalyser.cxx b/Tutorials/Skimming/spectraUPCAnalyser.cxx index 740a62dc822..d1cf89ecd69 100644 --- a/Tutorials/Skimming/spectraUPCAnalyser.cxx +++ b/Tutorials/Skimming/spectraUPCAnalyser.cxx @@ -9,25 +9,22 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// O2 includes #include "DataModel/UDDerived.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "ReconstructionDataFormats/Track.h" - -#include "TLorentzVector.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct UPCSpectraAnalyserTask { float mPion = 0.13957; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; diff --git a/Tutorials/Skimming/spectraUPCProvider.cxx b/Tutorials/Skimming/spectraUPCProvider.cxx index 8884c09d99b..6a72eb1385b 100644 --- a/Tutorials/Skimming/spectraUPCProvider.cxx +++ b/Tutorials/Skimming/spectraUPCProvider.cxx @@ -12,16 +12,18 @@ #include "DataModel/UDDerived.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include -#include +#include +#include using namespace o2; using namespace o2::aod::evsel; diff --git a/Tutorials/Skimming/spectraUPCReference.cxx b/Tutorials/Skimming/spectraUPCReference.cxx index f0a26f248f8..0cbadce7d6b 100644 --- a/Tutorials/Skimming/spectraUPCReference.cxx +++ b/Tutorials/Skimming/spectraUPCReference.cxx @@ -9,17 +9,23 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include -#include "Framework/HistogramRegistry.h" +#include -#include -#include "TLorentzVector.h" +#include +#include using namespace o2; using namespace o2::aod::evsel; diff --git a/Tutorials/include/configurableCut.h b/Tutorials/include/configurableCut.h index b690058abf1..d384e8ba5e9 100644 --- a/Tutorials/include/configurableCut.h +++ b/Tutorials/include/configurableCut.h @@ -9,13 +9,16 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef CONFIGURABLECUT_H -#define CONFIGURABLECUT_H +#ifndef TUTORIALS_INCLUDE_CONFIGURABLECUT_H_ +#define TUTORIALS_INCLUDE_CONFIGURABLECUT_H_ + +#include -#include "Framework/Array2D.h" -#include #include -#include + +#include +#include +#include static constexpr double default_matrix[3][3] = {{1.1, 1.2, 1.3}, {2.1, 2.2, 2.3}, {3.1, 3.2, 3.3}}; @@ -63,4 +66,4 @@ class configurableCut std::ostream& operator<<(std::ostream& os, configurableCut const& c); -#endif // CONFIGURABLECUT_H +#endif // TUTORIALS_INCLUDE_CONFIGURABLECUT_H_ diff --git a/Tutorials/src/IntermediateTables.h b/Tutorials/src/IntermediateTables.h index 601deb12d00..476f4f53257 100644 --- a/Tutorials/src/IntermediateTables.h +++ b/Tutorials/src/IntermediateTables.h @@ -10,7 +10,8 @@ // or submit itself to any jurisdiction. #ifndef TUTORIALS_SRC_INTERMEDIATETABLES_H_ #define TUTORIALS_SRC_INTERMEDIATETABLES_H_ -#include "Framework/AnalysisDataModel.h" + +#include /// Definition of output table to store the flat tree for re-weighting model /// training diff --git a/Tutorials/src/TrainingTree.h b/Tutorials/src/TrainingTree.h index 229b8393193..4cc2f95ebf2 100644 --- a/Tutorials/src/TrainingTree.h +++ b/Tutorials/src/TrainingTree.h @@ -10,7 +10,8 @@ // or submit itself to any jurisdiction. #ifndef TUTORIALS_SRC_TRAININGTREE_H_ #define TUTORIALS_SRC_TRAININGTREE_H_ -#include "Framework/AnalysisDataModel.h" + +#include /// Definition of output table to store the flat tree for re-weighting model /// training diff --git a/Tutorials/src/ZDCVZeroIteration.cxx b/Tutorials/src/ZDCVZeroIteration.cxx index 10b45687213..27647e1fbe0 100644 --- a/Tutorials/src/ZDCVZeroIteration.cxx +++ b/Tutorials/src/ZDCVZeroIteration.cxx @@ -17,8 +17,9 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/associatedExample.cxx b/Tutorials/src/associatedExample.cxx index 6538104d3f5..c8c87debff1 100644 --- a/Tutorials/src/associatedExample.cxx +++ b/Tutorials/src/associatedExample.cxx @@ -13,8 +13,18 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include namespace o2::aod { @@ -140,7 +150,7 @@ struct PartitionColExtra { struct BuildHmpidIndex { // build the index table HMPIDTracksIndex Builds idx; - void init(InitContext const&){}; + void init(InitContext const&) {}; }; struct ConsumeHmpidIndex { diff --git a/Tutorials/src/ccdbaccess.cxx b/Tutorials/src/ccdbaccess.cxx index afa5c9d4d52..e1ea568f46f 100644 --- a/Tutorials/src/ccdbaccess.cxx +++ b/Tutorials/src/ccdbaccess.cxx @@ -18,12 +18,18 @@ /// \author Nicolo' Jacazio /// \since 2020-06-22 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" #include -#include "CommonDataFormat/InteractionRecord.h" +#include +#include +#include +#include +#include +#include + +#include #include +#include using namespace o2::framework; using namespace o2::header; diff --git a/Tutorials/src/ccdbtableaccess.cxx b/Tutorials/src/ccdbtableaccess.cxx index 52688bcebfc..5c703e4d1dd 100644 --- a/Tutorials/src/ccdbtableaccess.cxx +++ b/Tutorials/src/ccdbtableaccess.cxx @@ -13,14 +13,13 @@ /// \author Daiki Sekihata /// \since 2026-03-01 -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include using namespace o2::framework; using namespace o2::header; diff --git a/Tutorials/src/collisionTracksIteration.cxx b/Tutorials/src/collisionTracksIteration.cxx index a2261504d3b..72694dea20e 100644 --- a/Tutorials/src/collisionTracksIteration.cxx +++ b/Tutorials/src/collisionTracksIteration.cxx @@ -15,8 +15,9 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/compatibleBCs.cxx b/Tutorials/src/compatibleBCs.cxx index 20d38d032db..bf5acbdb147 100644 --- a/Tutorials/src/compatibleBCs.cxx +++ b/Tutorials/src/compatibleBCs.cxx @@ -15,9 +15,14 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "CommonConstants/LHCConstants.h" +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/conditionalExpressions.cxx b/Tutorials/src/conditionalExpressions.cxx index 07b9dbac403..7fb68f37b99 100644 --- a/Tutorials/src/conditionalExpressions.cxx +++ b/Tutorials/src/conditionalExpressions.cxx @@ -11,8 +11,18 @@ /// /// \brief Demonstration of conditions in filter expressions -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/configurableCut.cxx b/Tutorials/src/configurableCut.cxx index 62b1d1adc66..00806f20d28 100644 --- a/Tutorials/src/configurableCut.cxx +++ b/Tutorials/src/configurableCut.cxx @@ -10,7 +10,13 @@ // or submit itself to any jurisdiction. #include "configurableCut.h" + +#include + #include +#include +#include +#include std::ostream& operator<<(std::ostream& os, configurableCut const& c) { diff --git a/Tutorials/src/configurableObjects.cxx b/Tutorials/src/configurableObjects.cxx index 210d93c0dac..e1a758b1851 100644 --- a/Tutorials/src/configurableObjects.cxx +++ b/Tutorials/src/configurableObjects.cxx @@ -14,11 +14,20 @@ /// \author /// \since -#include - #include "configurableCut.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/consume.cxx b/Tutorials/src/consume.cxx index f97e65bda87..c87127bc10e 100644 --- a/Tutorials/src/consume.cxx +++ b/Tutorials/src/consume.cxx @@ -14,8 +14,12 @@ /// \since #include "IntermediateTables.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/dynamicColumns.cxx b/Tutorials/src/dynamicColumns.cxx index 48de150b042..dba185ae495 100644 --- a/Tutorials/src/dynamicColumns.cxx +++ b/Tutorials/src/dynamicColumns.cxx @@ -13,8 +13,11 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include namespace o2::aod { diff --git a/Tutorials/src/efficiencyGlobal.cxx b/Tutorials/src/efficiencyGlobal.cxx index ef509cb0bac..13e1fdb9df3 100644 --- a/Tutorials/src/efficiencyGlobal.cxx +++ b/Tutorials/src/efficiencyGlobal.cxx @@ -17,10 +17,18 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include +#include +#include +#include + +#include + #include +#include using namespace o2::framework; using namespace o2; @@ -56,7 +64,7 @@ struct EfficiencyGlobal { { for (auto& track : tracks) { pt->Fill(track.pt(), efficiency->GetBinContent(efficiency->FindBin(track.pt()))); - //LOGF(info, "Efficiency %f for pt %f", efficiency->GetBinContent(efficiency->FindBin(track.pt())), track.pt()); + // LOGF(info, "Efficiency %f for pt %f", efficiency->GetBinContent(efficiency->FindBin(track.pt())), track.pt()); } } }; diff --git a/Tutorials/src/efficiencyPerRun.cxx b/Tutorials/src/efficiencyPerRun.cxx index c2fa7a887ca..7cbebd815ab 100644 --- a/Tutorials/src/efficiencyPerRun.cxx +++ b/Tutorials/src/efficiencyPerRun.cxx @@ -20,10 +20,18 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include +#include +#include +#include + +#include + #include +#include using namespace o2::framework; using namespace o2; @@ -58,7 +66,7 @@ struct EfficiencyPerRun { for (auto& track : tracks) { pt->Fill(track.pt(), efficiency->GetBinContent(efficiency->FindBin(track.pt()))); - //LOGF(info, "Efficiency %f for pt %f", efficiency->GetBinContent(efficiency->FindBin(track.pt())), track.pt()); + // LOGF(info, "Efficiency %f for pt %f", efficiency->GetBinContent(efficiency->FindBin(track.pt())), track.pt()); } } }; diff --git a/Tutorials/src/eventMixing.cxx b/Tutorials/src/eventMixing.cxx index a1526740886..925cc9f03a7 100644 --- a/Tutorials/src/eventMixing.cxx +++ b/Tutorials/src/eventMixing.cxx @@ -14,15 +14,22 @@ /// \author Karwowska Maja /// \since -#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/src/eventMixingValidation.cxx b/Tutorials/src/eventMixingValidation.cxx index cc1933b0a25..f7cf702f5d0 100644 --- a/Tutorials/src/eventMixingValidation.cxx +++ b/Tutorials/src/eventMixingValidation.cxx @@ -14,15 +14,16 @@ /// \author Karwowska Maja /// \since +#include +#include +#include +#include +#include +#include +#include +#include + #include -#include "Framework/AnalysisDataModel.h" -#include "Framework/SliceCache.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/Multiplicity.h" using namespace o2; using namespace o2::framework; @@ -39,7 +40,7 @@ struct MixedEventsEmptyTables { std::vector xBins{VARIABLE_WIDTH, -0.064, -0.062, -0.060, 0.066, 0.068, 0.070, 0.072}; std::vector yBins{VARIABLE_WIDTH, -0.320, -0.301, -0.300, 0.330, 0.340, 0.350, 0.360}; using BinningType = ColumnBinningPolicy; - BinningType binningOnPositions{{xBins, yBins}, true}; // true is for 'ignore overflows' (true by default) + BinningType binningOnPositions{{xBins, yBins}, true}; // true is for 'ignore overflows' (true by default) SameKindPair pair{binningOnPositions, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored void process(aod::Collisions const& collisions, MyTracks const& tracks) @@ -71,7 +72,7 @@ struct MixedEventsJoinedTracks { std::vector xBins{VARIABLE_WIDTH, -0.064, -0.062, -0.060, 0.066, 0.068, 0.070, 0.072}; std::vector yBins{VARIABLE_WIDTH, -0.320, -0.301, -0.300, 0.330, 0.340, 0.350, 0.360}; using BinningType = ColumnBinningPolicy; - BinningType binningOnPositions{{xBins, yBins}, true}; // true is for 'ignore overflows' (true by default) + BinningType binningOnPositions{{xBins, yBins}, true}; // true is for 'ignore overflows' (true by default) SameKindPair pair{binningOnPositions, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored void process(aod::Collisions const& collisions, aod::FullTracks const& tracks) diff --git a/Tutorials/src/extendedColumns.cxx b/Tutorials/src/extendedColumns.cxx index 72bb2bb55b4..3fd0af3b758 100644 --- a/Tutorials/src/extendedColumns.cxx +++ b/Tutorials/src/extendedColumns.cxx @@ -13,8 +13,11 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include namespace o2::aod { diff --git a/Tutorials/src/extendedTables.cxx b/Tutorials/src/extendedTables.cxx index 643a81e1504..96bf680ff28 100644 --- a/Tutorials/src/extendedTables.cxx +++ b/Tutorials/src/extendedTables.cxx @@ -13,8 +13,13 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include namespace o2::aod { diff --git a/Tutorials/src/filters.cxx b/Tutorials/src/filters.cxx index 7411db8b7ab..684c0e02464 100644 --- a/Tutorials/src/filters.cxx +++ b/Tutorials/src/filters.cxx @@ -13,9 +13,16 @@ /// \author Anton Alkin (anton.alkin@cern.ch) /// \file filters.cxx -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include using namespace o2; diff --git a/Tutorials/src/fullTrackIteration.cxx b/Tutorials/src/fullTrackIteration.cxx index c88ba5b1a78..e0444a798eb 100644 --- a/Tutorials/src/fullTrackIteration.cxx +++ b/Tutorials/src/fullTrackIteration.cxx @@ -13,8 +13,10 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/hepMC.cxx b/Tutorials/src/hepMC.cxx index d05941eff06..775ca6a8c66 100644 --- a/Tutorials/src/hepMC.cxx +++ b/Tutorials/src/hepMC.cxx @@ -13,8 +13,13 @@ /// \author jgrosseo /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/histogramRegistry.cxx b/Tutorials/src/histogramRegistry.cxx index ddbcdd18c56..9e61566af5b 100644 --- a/Tutorials/src/histogramRegistry.cxx +++ b/Tutorials/src/histogramRegistry.cxx @@ -13,12 +13,29 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include "Framework/StaticFor.h" +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; @@ -30,7 +47,7 @@ struct EtaPhiHistograms { { {"eta", "#eta", {HistType::kTH1F, {{102, -2.01, 2.01}}}}, // {"phi", "#varphi", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}} // - } // + } // }; void process(aod::Tracks const& tracks) @@ -49,7 +66,7 @@ struct FilteredHistograms { { {"eta", "#eta", {HistType::kTH1F, {{102, -2.01, 2.01}}}}, // {"ptToPt", "#ptToPt", {HistType::kTH2F, {{100, -0.01, 10.01}, {100, -0.01, 10.01}}}} // - } // + } // }; void process(aod::Tracks const& tracks) @@ -259,7 +276,7 @@ struct TListTest { { {"eta", "#eta", {HistType::kTH1F, {{102, -2.01, 2.01}}}}, // {"phi", "#varphi", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}} // - } // + } // }; void init(InitContext const&) diff --git a/Tutorials/src/histogramTrackSelection.cxx b/Tutorials/src/histogramTrackSelection.cxx index df164396b66..b7e20550749 100644 --- a/Tutorials/src/histogramTrackSelection.cxx +++ b/Tutorials/src/histogramTrackSelection.cxx @@ -17,12 +17,18 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/src/histograms.cxx b/Tutorials/src/histograms.cxx index 613b27d05d6..1d52c7dedf5 100644 --- a/Tutorials/src/histograms.cxx +++ b/Tutorials/src/histograms.cxx @@ -19,8 +19,19 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/histogramsFullTracks.cxx b/Tutorials/src/histogramsFullTracks.cxx index 8c45e5a3927..59fb15f80b0 100644 --- a/Tutorials/src/histogramsFullTracks.cxx +++ b/Tutorials/src/histogramsFullTracks.cxx @@ -13,9 +13,14 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include +#include +#include +#include +#include +#include + +#include + #include using namespace o2; diff --git a/Tutorials/src/jetAnalysis.cxx b/Tutorials/src/jetAnalysis.cxx index 8313e69f2bb..5b42e80bf84 100644 --- a/Tutorials/src/jetAnalysis.cxx +++ b/Tutorials/src/jetAnalysis.cxx @@ -14,10 +14,17 @@ /// \author Jochen Klein /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" #include "PWGJE/DataModel/Jet.h" +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/mcHistograms.cxx b/Tutorials/src/mcHistograms.cxx index 75c28c6c3c4..b1240f5a7e0 100644 --- a/Tutorials/src/mcHistograms.cxx +++ b/Tutorials/src/mcHistograms.cxx @@ -13,11 +13,16 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/mcOnly.cxx b/Tutorials/src/mcOnly.cxx index e72295ecb3a..b9c3b5a670f 100644 --- a/Tutorials/src/mcOnly.cxx +++ b/Tutorials/src/mcOnly.cxx @@ -13,11 +13,14 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/multiProcess.cxx b/Tutorials/src/multiProcess.cxx index 823e6e3f16c..048f5bb2d26 100644 --- a/Tutorials/src/multiProcess.cxx +++ b/Tutorials/src/multiProcess.cxx @@ -15,14 +15,23 @@ /// \author /// \since -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" namespace { diff --git a/Tutorials/src/multiplicityEventTrackSelection.cxx b/Tutorials/src/multiplicityEventTrackSelection.cxx index c1e3714f2f3..5689d037c62 100644 --- a/Tutorials/src/multiplicityEventTrackSelection.cxx +++ b/Tutorials/src/multiplicityEventTrackSelection.cxx @@ -17,12 +17,19 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/src/muonIteration.cxx b/Tutorials/src/muonIteration.cxx index 4b94fe77ae3..a62ed4b8bfc 100644 --- a/Tutorials/src/muonIteration.cxx +++ b/Tutorials/src/muonIteration.cxx @@ -16,8 +16,9 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -65,7 +66,7 @@ struct IterateMuonsSparse { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - //adaptAnalysisTask(cfgc), // currently does not work + // adaptAnalysisTask(cfgc), // currently does not work adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), }; diff --git a/Tutorials/src/newCollections.cxx b/Tutorials/src/newCollections.cxx index 490782347f3..64b73bb431b 100644 --- a/Tutorials/src/newCollections.cxx +++ b/Tutorials/src/newCollections.cxx @@ -13,8 +13,15 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include + +#include + +#include // define columns in a sub-namespace of o2::aod // and tables in namespace o2::aod diff --git a/Tutorials/src/partitions.cxx b/Tutorials/src/partitions.cxx index f5b58529a80..9887ea9671c 100644 --- a/Tutorials/src/partitions.cxx +++ b/Tutorials/src/partitions.cxx @@ -13,8 +13,15 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/pidTpcTof.cxx b/Tutorials/src/pidTpcTof.cxx index dab7d9e425c..86a9f376a1b 100644 --- a/Tutorials/src/pidTpcTof.cxx +++ b/Tutorials/src/pidTpcTof.cxx @@ -15,15 +15,16 @@ /// \brief Task to test the PID features and utilities /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -// O2Physics includes #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::aod::pidutils; using namespace o2::framework; diff --git a/Tutorials/src/preprocess.cxx b/Tutorials/src/preprocess.cxx index 417bafbf744..8a3bc43be05 100644 --- a/Tutorials/src/preprocess.cxx +++ b/Tutorials/src/preprocess.cxx @@ -16,10 +16,18 @@ /// \since #include "IntermediateTables.h" -#include "Framework/runDataProcessing.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/propagatedTracks.cxx b/Tutorials/src/propagatedTracks.cxx index 651738de71e..311504716f0 100644 --- a/Tutorials/src/propagatedTracks.cxx +++ b/Tutorials/src/propagatedTracks.cxx @@ -14,18 +14,14 @@ // Needs o2-analysis-track-propagation // -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/trackUtilities.h" -#include "ReconstructionDataFormats/DCA.h" -#include "DetectorsBase/Propagator.h" -#include "CommonUtils/NameConf.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::constants::math; @@ -105,4 +101,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), }; -} \ No newline at end of file +} diff --git a/Tutorials/src/reweighting.cxx b/Tutorials/src/reweighting.cxx index 17a4ad4bf33..48e90a9560d 100644 --- a/Tutorials/src/reweighting.cxx +++ b/Tutorials/src/reweighting.cxx @@ -28,12 +28,30 @@ // This workflow is used to create a flat tree for model training // Use o2-aod-merger to combine dataframes in output AnalysisResults_trees.root -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/Multiplicity.h" #include "TrainingTree.h" + +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/schemaEvolution.cxx b/Tutorials/src/schemaEvolution.cxx index a15fcba6dda..709c35ade42 100644 --- a/Tutorials/src/schemaEvolution.cxx +++ b/Tutorials/src/schemaEvolution.cxx @@ -16,8 +16,17 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include + +#include +#include +#include + +#include namespace o2::aod { diff --git a/Tutorials/src/tableIOin.cxx b/Tutorials/src/tableIOin.cxx index 12a93e749d0..a4b7b56619b 100644 --- a/Tutorials/src/tableIOin.cxx +++ b/Tutorials/src/tableIOin.cxx @@ -13,8 +13,9 @@ /// \author /// \since -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include namespace o2::aod { diff --git a/Tutorials/src/tableIOout.cxx b/Tutorials/src/tableIOout.cxx index 403740755d9..6f9f907e0fd 100644 --- a/Tutorials/src/tableIOout.cxx +++ b/Tutorials/src/tableIOout.cxx @@ -14,8 +14,11 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include namespace o2::aod { diff --git a/Tutorials/src/trackIteration.cxx b/Tutorials/src/trackIteration.cxx index ff3271d90c0..f256c2222c2 100644 --- a/Tutorials/src/trackIteration.cxx +++ b/Tutorials/src/trackIteration.cxx @@ -13,8 +13,11 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/tracksCombinations.cxx b/Tutorials/src/tracksCombinations.cxx index 413e8399e9b..a4ecbf1047e 100644 --- a/Tutorials/src/tracksCombinations.cxx +++ b/Tutorials/src/tracksCombinations.cxx @@ -15,11 +15,20 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" #include "Common/DataModel/Multiplicity.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::soa; diff --git a/Tutorials/src/treeCreator.cxx b/Tutorials/src/treeCreator.cxx index 27d1f1eda21..85848ab67e5 100644 --- a/Tutorials/src/treeCreator.cxx +++ b/Tutorials/src/treeCreator.cxx @@ -30,11 +30,18 @@ // This workflow is used to create a flat tree for model training // Use o2-aod-merger to combine dataframes in output AnalysisResults_trees.root -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/Multiplicity.h" #include "TrainingTree.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/src/usingPDGService.cxx b/Tutorials/src/usingPDGService.cxx index 72b0188142e..86b3f9445da 100644 --- a/Tutorials/src/usingPDGService.cxx +++ b/Tutorials/src/usingPDGService.cxx @@ -9,9 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/Tutorials/src/weakDecayIteration.cxx b/Tutorials/src/weakDecayIteration.cxx index 0c4bc01f877..b773094e890 100644 --- a/Tutorials/src/weakDecayIteration.cxx +++ b/Tutorials/src/weakDecayIteration.cxx @@ -17,8 +17,9 @@ /// \author /// \since -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include using namespace o2; using namespace o2::framework; From f418000017d754196f1a85ea95ae9344f6a89add Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:36:33 +0200 Subject: [PATCH 272/282] [PWGLF] Changes to accomodate online mult-integrated efficiency correction + electron rejection (#15770) --- .../DataModel/LFPhiStrangeCorrelationTables.h | 14 +- .../Strangeness/phiStrangeCorrelator.cxx | 18 +- .../Strangeness/phiStrangeCorrelation.cxx | 223 ++++++++++++++---- 3 files changed, 203 insertions(+), 52 deletions(-) diff --git a/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h b/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h index aca738fe6f2..caaab7720b6 100644 --- a/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h @@ -151,11 +151,11 @@ DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); DECLARE_SOA_DYNAMIC_COLUMN(InNSigmaRegion, inNSigmaRegion, - [](float nSigmaTPC, float pt, bool hasTOF, float nSigmaTOF, float pidTPCMax, float tofPIDThreshold, float pidTOFMax) -> bool { + [](float nSigmaTPC, bool hasTOF, float nSigmaTOF, float pidTPCMax, float pidTOFMax) -> bool { if (std::abs(nSigmaTPC) >= pidTPCMax) { return false; // TPC check failed } - if (pt >= tofPIDThreshold && hasTOF && std::abs(nSigmaTOF) >= pidTOFMax) { + if (hasTOF && std::abs(nSigmaTOF) >= pidTOFMax) { return false; // TOF check failed } return true; @@ -171,8 +171,9 @@ DECLARE_SOA_TABLE(PionTracksData, "AOD", "PITRACKSDATA", lf_selection_pion_track::Y, lf_selection_pion_track::Phi, lf_selection_pion_track::HasTOF, - lf_selection_pion_track::InNSigmaRegion); + lf_selection_pion_track::InNSigmaRegion); DECLARE_SOA_TABLE(PionTracksMcReco, "AOD", "PITRACKSMCRECO", soa::Index<>, @@ -183,8 +184,9 @@ DECLARE_SOA_TABLE(PionTracksMcReco, "AOD", "PITRACKSMCRECO", lf_selection_pion_track::Y, lf_selection_pion_track::Phi, lf_selection_pion_track::HasTOF, - lf_selection_pion_track::InNSigmaRegion); + lf_selection_pion_track::InNSigmaRegion); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFPHISTRANGECORRELATIONTABLES_H_ diff --git a/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx b/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx index b4f266b96b1..a05e958377f 100644 --- a/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx +++ b/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx @@ -573,7 +573,7 @@ struct PionTrackProducer { using FilteredSimCollisions = soa::Filtered; // Defining the type of the tracks for data and MC - using FullTracks = soa::Join; + using FullTracks = soa::Join; using FullMCTracks = soa::Join; void init(InitContext&) @@ -633,6 +633,22 @@ struct PionTrackProducer { template bool pidHypothesesRejection(const T& track) { + // Electron rejection + auto nSigmaTPCEl = aod::pidutils::tpcNSigma(o2::track::PID::Electron, track); + + if (nSigmaTPCEl > -3.0f && nSigmaTPCEl < 5.0f) { + auto nSigmaTPCPi = aod::pidutils::tpcNSigma(o2::track::PID::Pion, track); + auto nSigmaTPCKa = aod::pidutils::tpcNSigma(o2::track::PID::Kaon, track); + auto nSigmaTPCPr = aod::pidutils::tpcNSigma(o2::track::PID::Proton, track); + + if (std::abs(nSigmaTPCPi) > 3.0f && + std::abs(nSigmaTPCKa) > 3.0f && + std::abs(nSigmaTPCPr) > 3.0f) { + return false; + } + } + + // Other hadron species rejection for (size_t speciesIndex = 0; speciesIndex < trackConfigs.trkPIDspecies->size(); ++speciesIndex) { auto const& pid = trackConfigs.trkPIDspecies->at(speciesIndex); auto nSigmaTPC = aod::pidutils::tpcNSigma(pid, track); diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index 05074ea22df..94c45348c36 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -72,6 +72,7 @@ #include #include #include +#include #include using namespace o2; @@ -84,14 +85,19 @@ enum AnalysisMode { kDeltaYvsDeltaPhi }; -enum ParticleOfInterest { +enum AssociatedParticleType { + kK0S = 0, + kXi, + kPion, + kAssocPartSize +}; + +/*enum ParticleOfInterest { Phi = 0, K0S, Pion, - /*PionTPC, - PionTPCTOF*/ ParticleOfInterestSize -}; +};*/ /* #define LIST_OF_PARTICLES_OF_INTEREST \ @@ -121,7 +127,9 @@ static constexpr auto particleOfInterestLabels = std::to_array }); */ -struct BoundEfficiencyMap { +using EffMapPtr = std::variant, std::shared_ptr>; + +/*struct BoundEfficiencyMap { using CoordsTuple = std::tuple; const TH3* effMap; @@ -149,6 +157,58 @@ struct BoundEfficiencyMap { const auto& [x, y, z] = coords; return effMap->Interpolate(x, y, z); } +};*/ + +struct BoundEfficiencyMap { + using CoordsTuple = std::tuple; + + const EffMapPtr& effMap; + CoordsTuple coords; + + BoundEfficiencyMap(const EffMapPtr& effMap, float x, float y, float z) : effMap(effMap), coords(x, y, z) {} + BoundEfficiencyMap(const EffMapPtr& effMap, const CoordsTuple& coords) : effMap(effMap), coords(coords) {} + + float getBinEfficiency() const + { + return std::visit( + [this](auto&& mapPtr) -> float { + if (!mapPtr) + return 1.0f; + + const auto& [x, y, z] = coords; + + // Extract the actual histogram type (TH2 or TH3) held by the smart pointer + using HistoType = typename std::decay_t::element_type; + + // Compile-time branching: generates the exact correct function call + if constexpr (std::is_same_v) { + return mapPtr->GetBinContent(mapPtr->FindFixBin(y, z)); // 2D case only + } else { + return mapPtr->GetBinContent(mapPtr->FindFixBin(x, y, z)); // Full 3D case + } + }, + effMap); + } + + float interpolateEfficiency() const + { + return std::visit( + [this](auto&& mapPtr) -> float { + if (!mapPtr) + return 1.0f; + + const auto& [x, y, z] = coords; + + using HistoType = typename std::decay_t::element_type; + + if constexpr (std::is_same_v) { + return mapPtr->Interpolate(y, z); // Native 2D interpolation + } else { + return mapPtr->Interpolate(x, y, z); // Native 3D interpolation + } + }, + effMap); + } }; struct PhiStrangenessCorrelation { @@ -183,7 +243,7 @@ struct PhiStrangenessCorrelation { Configurable selectPionInSigRegion{"selectPionInSigRegion", true, "Select Pion candidates in signal region"}; Configurable pidTPCMax{"pidTPCMax", 2.0f, "Maximum nSigma TPC"}; Configurable pidTOFMax{"pidTOFMax", 2.0f, "Maximum nSigma TOF"}; - Configurable tofPIDThreshold{"tofPIDThreshold", 0.5f, "Minimum pT after which TOF PID is applicable"}; + // Configurable tofPIDThreshold{"tofPIDThreshold", 0.5f, "Minimum pT after which TOF PID is applicable"}; } pionConfigs; // Configurables on phi pT bins @@ -195,6 +255,12 @@ struct PhiStrangenessCorrelation { // Configurable on pion pT bins Configurable> binspTPi{"binspTPi", {0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.2, 1.5, 2.0, 3.0}, "pT bin limits for pions"}; + struct : ConfigurableGroup { + Configurable doK0SCorrelation{"doK0SCorrelation", true, "Enable Phi-K0S correlation"}; + Configurable doXiCorrelation{"doXiCorrelation", false, "Enable Phi-Xi correlation"}; + Configurable doPionCorrelation{"doPionCorrelation", true, "Enable Phi-Pion correlation"}; + } activeCorrelationConfigs; + // Configurables for delta y selection struct : ConfigurableGroup { Configurable nBinsY{"nBinsY", 20, "Number of bins in y axis"}; @@ -250,18 +316,22 @@ struct PhiStrangenessCorrelation { // Necessary service to retrieve efficiency maps from CCDB Service ccdb; - std::array, ParticleOfInterestSize> effMaps{}; + // std::shared_ptr effMapPhi{}; + // std::array, kAssocPartSize> effMapsAssoc{}; + + EffMapPtr effMapPhi{}; + std::array effMapsAssoc{}; // Binning policy and axes for mixed event - ConfigurableAxis axisVertexMixing{"axisVertexMixing", {20, -10, 10}, "Z vertex axis binning for mixing"}; - ConfigurableAxis axisCentralityMixing{"axisCentralityMixing", {20, 0, 100}, "Multiplicity percentil binning for mixing"}; + ConfigurableAxis axisVertexMixing{"axisVertexMixing", {10, -10.0f, 10.0f}, "Z vertex axis binning for mixing"}; + ConfigurableAxis axisCentralityMixing{"axisCentralityMixing", {VARIABLE_WIDTH, 0.0f, 1.0f, 5.0f, 10.0f, 15.0f, 20.0f, 30.0f, 40.0f, 50.0f, 70.0f, 100.0f}, "Multiplicity percentage binning for mixing"}; using BinningTypeVertexCent = ColumnBinningPolicy; BinningTypeVertexCent binningOnVertexAndCent{{axisVertexMixing, axisCentralityMixing}, true}; static constexpr std::array phiMassRegionLabels{"Signal", "Sideband"}; - static constexpr std::array particleOfInterestLabels{"Phi", "K0S", "Pion" /*"PionTPC", "PionTPCTOF"*/}; - static constexpr std::array assocParticleLabels{"K0S", "Pi"}; + // static constexpr std::array particleOfInterestLabels{"Phi", "K0S", "Pion" /*"PionTPC", "PionTPCTOF"*/}; + static constexpr std::array assocParticleLabels{"K0S", "Xi", "Pi"}; // Light structures to store only the necessary information for the correlation analysis at MCGen level struct MiniParticle { @@ -274,6 +344,7 @@ struct PhiStrangenessCorrelation { float multiplicity; std::vector phiParticles; std::vector k0sParticles; + std::vector xiParticles; std::vector pionParticles; }; @@ -335,6 +406,8 @@ struct PhiStrangenessCorrelation { histos.add("pi/h3PiMCGen", "Pion in MC Gen", kTH3F, {binnedmultAxis, binnedpTPiAxis, yAxis}); histos.add("pi/h4PiMCGenAssocReco", "Pion in MC Gen Assoc Reco", kTHnSparseF, {vertexZAxis, binnedmultAxis, binnedpTPiAxis, yAxis}); + histos.add("phi/h3PhiMCClosureGen", "Phi in MC Gen for MC Closure Test", kTH3F, {binnedmultAxis, binnedpTPhiAxis, yAxis}); + histos.add("phiK0S/h5PhiK0SClosureMCGen", "Deltay vs deltaphi for Phi and K0Short in MCGen", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTK0SAxis, deltayAxis, deltaphiAxis}); histos.add("phiPi/h5PhiPiClosureMCGen", "Deltay vs deltaphi for Phi and Pion in MCGen", kTHnSparseF, {binnedmultAxis, binnedpTPhiAxis, binnedpTPiAxis, deltayAxis, deltaphiAxis}); @@ -348,21 +421,56 @@ struct PhiStrangenessCorrelation { ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); - for (int i = 0; i < ParticleOfInterestSize; ++i) { + /*for (int i = 0; i < ParticleOfInterestSize; ++i) { loadEfficiencyMapFromCCDB(static_cast(i)); - } + }*/ + loadEfficiencyMaps(); } eventBuffer.resize(binsMult->size() - 1); } - void loadEfficiencyMapFromCCDB(ParticleOfInterest poi) + void fetchSingleEfficiencyMapFromCCDB(EffMapPtr& effMap, std::string_view particleName) + { + std::string path = fmt::format("{}{}", ccdbEfficiencyPath.value, particleName); + + if (auto map3D = std::shared_ptr(ccdb->get(path))) { + effMap = map3D; + LOG(info) << "Efficiency map (TH3) for " << particleName << " loaded from CCDB"; + return; + } + + if (auto map2D = std::shared_ptr(ccdb->get(path))) { + effMap = map2D; + LOG(info) << "Efficiency map (TH2) for " << particleName << " loaded from CCDB"; + return; + } + + LOG(fatal) << "Could not load efficiency map (neither TH3 nor TH2) for " << particleName << " from CCDB!"; + } + + void loadEfficiencyMaps() + { + // Always load the Trigger (Phi) map + fetchSingleEfficiencyMapFromCCDB(effMapPhi, "Phi"); + + // Map the user configurations for the associated particles + bool doAssocCorrelations[kAssocPartSize] = {activeCorrelationConfigs.doK0SCorrelation, activeCorrelationConfigs.doXiCorrelation, activeCorrelationConfigs.doPionCorrelation}; + + // Only load the associated maps that are explicitly enabled + for (size_t i = 0; i < kAssocPartSize; ++i) { + if (doAssocCorrelations[i]) + fetchSingleEfficiencyMapFromCCDB(effMapsAssoc[i], assocParticleLabels[i]); + } + } + + /*void loadEfficiencyMapFromCCDB(ParticleOfInterest poi) { effMaps[poi] = std::shared_ptr(ccdb->get(fmt::format("{}{}", ccdbEfficiencyPath.value, particleOfInterestLabels[poi]))); if (!effMaps[poi]) LOG(fatal) << "Could not load efficiency map for " << particleOfInterestLabels[poi] << "!"; LOG(info) << "Efficiency map for " << particleOfInterestLabels[poi] << " loaded from CCDB"; - } + }*/ // Compute weight based on efficiencies template @@ -397,45 +505,56 @@ struct PhiStrangenessCorrelation { const std::array, 2> phiMassRegions = {phiConfigs.rangeMPhiSignal, phiConfigs.rangeMPhiSideband}; + bool doAssocCorrelations[kAssocPartSize] = {activeCorrelationConfigs.doK0SCorrelation, + activeCorrelationConfigs.doXiCorrelation, + activeCorrelationConfigs.doPionCorrelation}; + const bool applyK0sMassCut = (analysisMode == kDeltaYvsDeltaPhi) && k0sConfigs.selectK0sInSigRegion; const auto& [minMassK0s, maxMassK0s] = k0sConfigs.rangeMK0sSignal.value; auto isK0sValid = [&](const auto& k0s) { - return !applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s); + return (!applyEfficiency || k0s.pt() < binspTK0S->back()) && (!applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s)); }; const bool applyPionNSigmaCut = (analysisMode == kDeltaYvsDeltaPhi) && pionConfigs.selectPionInSigRegion; const float& pidTPCMax = pionConfigs.pidTPCMax; const float& pidTOFMax = pionConfigs.pidTOFMax; - const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; + // const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; auto isPionValid = [&](const auto& pion) { - return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, tofPIDThreshold, pidTOFMax); + return (!applyEfficiency || pion.pt() < binspTPi->back()) && (!applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, pidTOFMax)); }; for (const auto& phiCand : phiCandidates) { - float weightPhi = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y())); + if (applyEfficiency && phiCand.pt() >= binspTPhi->back()) + continue; + + float weightPhi = computeWeight(BoundEfficiencyMap(effMapPhi, multiplicity, phiCand.pt(), phiCand.y())); histos.fill(HIST("phi/h3PhiData"), multiplicity, phiCand.pt(), phiCand.m(), weightPhi); auto processCorrelations = [&](auto fillK0S, auto fillPion) { - // Loop over all reduced K0S candidates - for (const auto& k0s : k0sReduced) { - if (!isK0sValid(k0s)) - continue; + if (doAssocCorrelations[kK0S]) { + // Loop over all reduced K0S candidates + for (const auto& k0s : k0sReduced) { + if (!isK0sValid(k0s)) + continue; - float weightPhiK0S = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), - BoundEfficiencyMap(effMaps[K0S], multiplicity, k0s.pt(), k0s.y())); - fillK0S(k0s, weightPhiK0S); + float weightPhiK0S = computeWeight(BoundEfficiencyMap(effMapPhi, multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMapsAssoc[kK0S], multiplicity, k0s.pt(), k0s.y())); + fillK0S(k0s, weightPhiK0S); + } } - // Loop over all primary pion candidates - for (const auto& pionTrack : pionTracks) { - if (!isPionValid(pionTrack)) - continue; + if (doAssocCorrelations[kPion]) { + // Loop over all primary pion candidates + for (const auto& pionTrack : pionTracks) { + if (!isPionValid(pionTrack)) + continue; - float weightPhiPion = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), - BoundEfficiencyMap(effMaps[Pion], multiplicity, pionTrack.pt(), pionTrack.y())); - fillPion(pionTrack, weightPhiPion); + float weightPhiPion = computeWeight(BoundEfficiencyMap(effMapPhi, multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMapsAssoc[kPion], multiplicity, pionTrack.pt(), pionTrack.y())); + fillPion(pionTrack, weightPhiPion); + } } }; @@ -533,7 +652,7 @@ struct PhiStrangenessCorrelation { const auto& [minMassK0s, maxMassK0s] = k0sConfigs.rangeMK0sSignal.value; auto isK0sValid = [&](const auto& k0s) { - return !applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s); + return (!applyEfficiency || k0s.pt() < binspTK0S->back()) && (!applyK0sMassCut || k0s.inMassRegion(minMassK0s, maxMassK0s)); }; auto tuplePhiK0S = std::make_tuple(phiCandidates, k0sReduced); @@ -544,12 +663,14 @@ struct PhiStrangenessCorrelation { float multiplicity = c1.centFT0M(); for (const auto& [phiCand, k0s] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(phiCands, k0sRed))) { + if (applyEfficiency && phiCand.pt() >= binspTPhi->back()) + continue; if (!isK0sValid(k0s)) continue; auto processCorrelations = [&](auto fillK0S) { - float weightPhiK0S = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), - BoundEfficiencyMap(effMaps[K0S], multiplicity, k0s.pt(), k0s.y())); + float weightPhiK0S = computeWeight(BoundEfficiencyMap(effMapPhi, multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMapsAssoc[kK0S], multiplicity, k0s.pt(), k0s.y())); fillK0S(k0s, weightPhiK0S); }; @@ -623,10 +744,10 @@ struct PhiStrangenessCorrelation { const bool applyPionNSigmaCut = (analysisMode == kDeltaYvsDeltaPhi) && pionConfigs.selectPionInSigRegion; const float& pidTPCMax = pionConfigs.pidTPCMax; const float& pidTOFMax = pionConfigs.pidTOFMax; - const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; + // const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; auto isPionValid = [&](const auto& pion) { - return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, tofPIDThreshold, pidTOFMax); + return (!applyEfficiency || pion.pt() < binspTPi->back()) && (!applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, pidTOFMax)); }; auto tuplePhiPion = std::make_tuple(phiCandidates, pionTracks); @@ -637,12 +758,14 @@ struct PhiStrangenessCorrelation { float multiplicity = c1.centFT0M(); for (const auto& [phiCand, piTrack] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(phiCands, piTracks))) { + if (applyEfficiency && phiCand.pt() >= binspTPhi->back()) + continue; if (!isPionValid(piTrack)) continue; auto processCorrelations = [&](auto fillPion) { - float weightPhiPion = computeWeight(BoundEfficiencyMap(effMaps[Phi], multiplicity, phiCand.pt(), phiCand.y()), - BoundEfficiencyMap(effMaps[Pion], multiplicity, piTrack.pt(), piTrack.y())); + float weightPhiPion = computeWeight(BoundEfficiencyMap(effMapPhi, multiplicity, phiCand.pt(), phiCand.y()), + BoundEfficiencyMap(effMapsAssoc[kPion], multiplicity, piTrack.pt(), piTrack.y())); fillPion(piTrack, weightPhiPion); }; @@ -715,10 +838,10 @@ struct PhiStrangenessCorrelation { const bool applyPionNSigmaCut = (analysisMode == kDeltaYvsDeltaPhi) && pionConfigs.selectPionInSigRegion; const float& pidTPCMax = pionConfigs.pidTPCMax; const float& pidTOFMax = pionConfigs.pidTOFMax; - const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; + // const float& tofPIDThreshold = pionConfigs.tofPIDThreshold; auto isPionValid = [&](const auto& pion) { - return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, tofPIDThreshold, pidTOFMax); + return !applyPionNSigmaCut || pion.inNSigmaRegion(pidTPCMax, pidTOFMax); }; std::unordered_map> collsGrouped; @@ -961,6 +1084,7 @@ struct PhiStrangenessCorrelation { std::vector phiParticles; std::vector k0sParticles; + std::vector xiParticles; std::vector pionParticles; auto inYAcceptance = [&](const auto& mcParticle) { @@ -997,14 +1121,20 @@ struct PhiStrangenessCorrelation { if (multBin < 0) return; + bool doAssocCorrelations[kAssocPartSize] = {activeCorrelationConfigs.doK0SCorrelation, + activeCorrelationConfigs.doXiCorrelation, + activeCorrelationConfigs.doPionCorrelation}; + // Same Event Correlations - std::vector* currentAssocParticles[] = {&k0sParticles, &pionParticles}; + std::vector* currentAssocParticles[] = {&k0sParticles, &xiParticles, &pionParticles}; for (const auto& phiParticle : phiParticles) { - histos.fill(HIST("phi/h3PhiMCGen"), multiplicity, phiParticle.pt, phiParticle.y); + histos.fill(HIST("phi/h3PhiMCClosureGen"), multiplicity, phiParticle.pt, phiParticle.y); static_for<0, assocParticleLabels.size() - 1>([&](auto i_idx) { constexpr unsigned int i = i_idx.value; + if (!doAssocCorrelations[i]) + return; for (const auto& assocParticle : *(currentAssocParticles[i])) { histos.fill(HIST("phi") + HIST(assocParticleLabels[i]) + HIST("/h5Phi") + HIST(assocParticleLabels[i]) + HIST("ClosureMCGen"), @@ -1017,12 +1147,14 @@ struct PhiStrangenessCorrelation { // Mixed Event Correlations for (const auto& pastEvent : eventBuffer[multBin]) { - const std::vector* pastAssocParticles[] = {&pastEvent.k0sParticles, &pastEvent.pionParticles}; + const std::vector* pastAssocParticles[] = {&pastEvent.k0sParticles, &pastEvent.xiParticles, &pastEvent.pionParticles}; // Loop over past events in the same multiplicity bin and fill histograms with all combinations of current phi particles and past associated particles for (const auto& phiParticle : phiParticles) { static_for<0, assocParticleLabels.size() - 1>([&](auto i_idx) { constexpr unsigned int i = i_idx.value; + if (!doAssocCorrelations[i]) + return; for (const auto& assocParticle : *(pastAssocParticles[i])) { histos.fill(HIST("phi") + HIST(assocParticleLabels[i]) + HIST("/h5Phi") + HIST(assocParticleLabels[i]) + HIST("ClosureMCGenME"), @@ -1038,6 +1170,7 @@ struct PhiStrangenessCorrelation { currentEvent.multiplicity = multiplicity; currentEvent.phiParticles = std::move(phiParticles); currentEvent.k0sParticles = std::move(k0sParticles); + currentEvent.xiParticles = std::move(xiParticles); currentEvent.pionParticles = std::move(pionParticles); eventBuffer[multBin].push_front(std::move(currentEvent)); From d0f0ff3a17a90f3249e662705b7c692cef752e8c Mon Sep 17 00:00:00 2001 From: ivorobye Date: Tue, 14 Apr 2026 20:51:52 +0200 Subject: [PATCH 273/282] [PWGEM] update single muon QC histograms (#15769) --- PWGEM/Dilepton/Core/SingleTrackQC.h | 4 ++-- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 06cd401f60c..bb37b9ba1e2 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -331,9 +331,9 @@ struct SingleTrackQC { fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 100}}, false); fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); + fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0.0f, 100}, {200, 0, 0.5}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } } diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 97191e4fe98..6882c2e32d0 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -358,7 +358,7 @@ struct SingleTrackQCMC { } if (cfgFillQA) { fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/PromptLF/positive/hdEtadPhi", "#Delta#eta vs. #Delta#varphi between MFT-MCH-MID and MCH-MID;#varphi_{sa} - #varphi_{gl} (rad.);#eta_{sa} - #eta_{gl}", o2::framework::kTH2F, {{90, -M_PI / 4, M_PI / 4}, {100, -0.5, +0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", o2::framework::kTH1F, {{100, 0.f, 1.0f}}, false); @@ -377,12 +377,12 @@ struct SingleTrackQCMC { fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 100}}, false); fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0.0f, 100}, {200, 0, 0.5}}, false); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -741,6 +741,7 @@ struct SingleTrackQCMC { float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); float deta = track.etaMatchedMCHMID() - track.eta(); float dphi = track.phiMatchedMCHMID() - track.phi(); + float reldpt = (track.ptMatchedMCHMID() - track.pt()) / track.pt(); o2::math_utils::bringToPMPi(dphi); float weight = 1.f; @@ -756,7 +757,7 @@ struct SingleTrackQCMC { } if (cfgFillQA) { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hEtaPhi_MatchMCHMID"), track.phiMatchedMCHMID(), track.etaMatchedMCHMID(), weight); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hdEtadPhi"), dphi, deta, weight); + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hsDelta"), track.pt(), reldpt, deta, dphi, weight); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hTrackType"), track.trackType()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxy"), std::sqrt(std::pow(track.fwdDcaX(), 2) + std::pow(track.fwdDcaY(), 2))); @@ -789,7 +790,7 @@ struct SingleTrackQCMC { } if (cfgFillQA) { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hEtaPhi_MatchMCHMID"), track.phiMatchedMCHMID(), track.etaMatchedMCHMID(), weight); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hdEtadPhi"), dphi, deta, weight); + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hsDelta"), track.pt(), reldpt, deta, dphi, weight); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hTrackType"), track.trackType()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxy"), std::sqrt(std::pow(track.fwdDcaX(), 2) + std::pow(track.fwdDcaY(), 2))); From 6dd77a50509c760e358f986c5f0c20d412c7bbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:53:01 +0200 Subject: [PATCH 274/282] [Scripts] Dependency finder: Support other origins and regex exclude patterns (#15766) --- Scripts/find_dependencies.py | 39 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/Scripts/find_dependencies.py b/Scripts/find_dependencies.py index 87e07897aff..363899c3f7b 100755 --- a/Scripts/find_dependencies.py +++ b/Scripts/find_dependencies.py @@ -34,6 +34,7 @@ import hashlib import json import os +import re import subprocess as sp # nosec B404 import sys @@ -81,11 +82,11 @@ def load_workflows_from_json(): return db_wf -def format_table_name(description: str, subspec: int): - """Format table description name, including potential versions.""" - if not subspec: - return description - return f"{description}_{subspec:03d}" +def format_table_name(description: str, subspec: int, origin: str): + """Format table description name, including origin and potential versions.""" + if subspec > 0: + description += f"_{subspec:03d}" + return f"{origin}/{description}" def get_devices(specs_wf: dict): @@ -101,7 +102,9 @@ def get_inputs(specs_wf: dict, device=""): if device and dev["name"] != device: continue list_inputs += [ - format_table_name(i["description"], i["subspec"]) for i in dev["inputs"] if i["origin"] == "AOD" + format_table_name(i["description"], i["subspec"], i["origin"]) + for i in dev["inputs"] + if i["origin"].startswith(("AOD", "EMB")) ] return list(dict.fromkeys(list_inputs)) # Remove duplicities @@ -115,7 +118,9 @@ def get_outputs(specs_wf: dict, device=""): if device and dev["name"] != device: continue list_outputs += [ - format_table_name(i["description"], i["subspec"]) for i in dev["outputs"] if i["origin"] == "AOD" + format_table_name(i["description"], i["subspec"], i["origin"]) + for i in dev["outputs"] + if i["origin"].startswith(("AOD", "EMB")) ] return list(dict.fromkeys(list_outputs)) # Remove duplicities @@ -229,7 +234,7 @@ def get_tree_for_table(tab: str, dic_wf_all: dict, dic_wf_tree=None, case_sensit for p in producers: get_tree_for_workflow(p, dic_wf_all, dic_wf_tree, case_sensitive, 0, levels_max, reverse) else: - print(f'No {"consumers" if reverse else "producers"} found') + print(f"No {'consumers' if reverse else 'producers'} found") return dic_wf_tree @@ -272,7 +277,7 @@ def main(): dest="exclude", type=str, nargs="+", - help="tables and workflows to exclude", + help="name patterns of tables and workflows to exclude", ) parser.add_argument( "-l", @@ -299,7 +304,7 @@ def main(): dic_wf_all_simple = {} for wf, dic_wf in dic_wf_all_full.items(): # Skip excluded workflows - if list_exclude and wf in list_exclude: + if list_exclude and any(re.search(pattern, wf) for pattern in list_exclude): continue dic_wf_all_simple[wf] = {} list_dev = get_devices(dic_wf) @@ -309,8 +314,8 @@ def main(): list_outputs = get_outputs(dic_wf, dev) # Skip excluded tables if list_exclude: - list_inputs = [i for i in list_inputs if i not in list_exclude] - list_outputs = [o for o in list_outputs if o not in list_exclude] + list_inputs = [i for i in list_inputs if not any(re.search(pattern, i) for pattern in list_exclude)] + list_outputs = [o for o in list_outputs if not any(re.search(pattern, o) for pattern in list_exclude)] dic_wf_all_simple[wf][dev]["inputs"] = list_inputs dic_wf_all_simple[wf][dev]["outputs"] = list_outputs # print_workflows(dic_wf_all_simple) @@ -323,9 +328,11 @@ def main(): for t, reverse in zip((tables, tables_rev), (False, True)): if t: for table in t: - print(f"\nTable: {table}\n") if not table: msg_fatal("Bad table") + if "/" not in table: + table = "AOD/" + table + print(f"\nTable: {table}\n") # producers = get_table_producers(table, dic_wf_all_simple, case_sensitive) # if not producers: # print("No producers found") @@ -389,12 +396,12 @@ def main(): inputs = get_workflow_inputs(wf, dic_deps) outputs = get_workflow_outputs(wf, dic_deps) list_tables += inputs + outputs - nodes_in = " ".join(inputs) - nodes_out = " ".join(outputs) + nodes_in = " ".join(inputs).replace("/", "_") + nodes_out = " ".join(outputs).replace("/", "_") dot_deps += f" {{{nodes_in}}} -> {node_wf} -> {{{nodes_out}}}\n" list_tables = list(dict.fromkeys(list_tables)) # Remove duplicities for table in list_tables: - dot_tables += f" {table}\n" + dot_tables += f' {table.replace("/", "_")} [label="{table}"]\n' dot_tables += " }\n" dot_workflows += " }\n" dot += dot_workflows + dot_tables + dot_deps From bffd337f7df7cb060d79840a622362e2794f5f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bilge=20Jin=20=C3=96NEN?= Date: Tue, 14 Apr 2026 22:37:36 +0200 Subject: [PATCH 275/282] [PWGLF] Added a new table producer; Cascadederivedqaanalysis (#15736) Co-authored-by: BilgeTheGray Co-authored-by: ALICE Action Bot Co-authored-by: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> --- .../TableProducer/Strangeness/CMakeLists.txt | 5 + .../Strangeness/cascderivedqaanalysis.cxx | 798 ++++++++++++++++++ 2 files changed, 803 insertions(+) create mode 100755 PWGLF/TableProducer/Strangeness/cascderivedqaanalysis.cxx diff --git a/PWGLF/TableProducer/Strangeness/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/CMakeLists.txt index 08ec72c6913..1522e629b48 100644 --- a/PWGLF/TableProducer/Strangeness/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/CMakeLists.txt @@ -46,6 +46,11 @@ o2physics_add_dpl_workflow(cascqaanalysis PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(cascderivedqaanalysis + SOURCES cascderivedqaanalysis.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(hstrangecorrelationfilter SOURCES hStrangeCorrelationFilter.cxx PUBLIC_LINK_LIBRARIES O2::DCAFitter O2Physics::AnalysisCore O2Physics::EventFilteringUtils diff --git a/PWGLF/TableProducer/Strangeness/cascderivedqaanalysis.cxx b/PWGLF/TableProducer/Strangeness/cascderivedqaanalysis.cxx new file mode 100755 index 00000000000..3fabc04118e --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/cascderivedqaanalysis.cxx @@ -0,0 +1,798 @@ +// Copyright 2019-2025 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. +// +// Author Roman Nepeivoda & Romain Schotter + +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/cascqaanalysis.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/RecoDecay.h" + +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +using DauTracks = soa::Join; +using CascCandidates = soa::Join; +using CascMCCandidates = soa::Join; + +// constants +const float ctauXiPDG = 4.91; // Xi PDG lifetime +const float ctauOmegaPDG = 2.461; // Omega PDG lifetime + +struct CascDerivedQAanalysis { + // Switch between Data/MC-dedicated histograms + bool isMC; + + // for MC + Configurable doMCAssociation{"doMCAssociation", true, "if MC, do MC association"}; + + // Tables to produce + Produces mycascades; + Produces myMCcascades; + + HistogramRegistry histos{"histos"}; + + // Event selection criteria + struct : ConfigurableGroup { + std::string prefix = "eventSelections"; // JSON group name + Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; + Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; + Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border (Run 3 only)"}; + Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border (Run 3 only)"}; + Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "require events with at least one ITS-TPC track (Run 3 only)"}; + Configurable requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", false, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference (Run 3 only)"}; + Configurable requireIsVertexTOFmatched{"requireIsVertexTOFmatched", false, "require events with at least one of vertex contributors matched to TOF (Run 3 only)"}; + Configurable requireIsVertexTRDmatched{"requireIsVertexTRDmatched", false, "require events with at least one of vertex contributors matched to TRD (Run 3 only)"}; + Configurable rejectSameBunchPileup{"rejectSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC (Run 3 only)"}; + Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds (Run 3 only)"}; + Configurable requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds (Run 3 only)"}; + Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds (Run 3 only)"}; + Configurable requireNoCollInROFStd{"requireNoCollInROFStd", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF with mult. above a certain threshold (Run 3 only)"}; + Configurable requireNoCollInROFStrict{"requireNoCollInROFStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF (Run 3 only)"}; + Configurable requireINEL0{"requireINEL0", true, "require INEL>0 event selection"}; + Configurable requireINEL1{"requireINEL1", false, "require INEL>1 event selection"}; + + Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"}; + } eventSelections; + + struct : ConfigurableGroup { + // Selection criteria: acceptance + Configurable rapidityCut{"cascSelections.rapidityCut", 0.5, "rapidity"}; + Configurable daughterEtaCut{"cascSelections.daughterEtaCut", 0.8, "max eta for daughters"}; + + // Standard 6 topological criteria on V0 + Configurable v0cospa{"cascSelections.v0cospa", 0.97, "min V0 CosPA"}; + Configurable dcav0dau{"cascSelections.dcav0dau", 1.0, "max DCA V0 Daughters (cm)"}; + Configurable dcav0topv{"cascSelections.dcav0topv", .05, "min DCA V0 to PV (cm)"}; + Configurable dcapiontopv{"cascSelections.dcapiontopv", .05, "min DCA Pion To PV (cm)"}; + Configurable dcaprotontopv{"cascSelections.dcaprotontopv", .05, "min DCA Proton To PV (cm)"}; + Configurable v0radius{"cascSelections.v0radius", 1.2, "minimum V0 radius (cm)"}; + Configurable v0radiusMax{"cascSelections.v0radiusMax", 1E5, "maximum V0 radius (cm)"}; + + // Standard 6 topological criteria on cascades + Configurable casccospa{"cascSelections.casccospa", 0.97, "min Cascade CosPA"}; + Configurable dcacascdau{"cascSelections.dcacascdau", 1.0, "max DCA Cascade Daughters (cm)"}; + Configurable dcaxybachbaryontopv{"cascSelections.dcaxybachbaryontopv", -1, "DCAxy Bachelor-Baryon to PV (cm)"}; + Configurable bachbaryoncospa{"cascSelections.bachbaryoncospa", -1, "Bachelor-Baryon CosPA"}; + Configurable dcabachtopv{"cascSelections.dcabachtopv", .05, "min DCA Bachelor To PV (cm)"}; + Configurable cascradius{"cascSelections.cascradius", 0.5, "minimum Cascade radius (cm)"}; + Configurable cascradiusMax{"cascSelections.cascradiusMax", 1E5, "maximum Cascade radius (cm)"}; + Configurable cascProperLifeTime{"cascSelections.cascProperLifeTime", 3, "maximum lifetime (ctau)"}; + + // invariant mass selection + Configurable v0MassWindow{"cascSelections.v0MassWindow", 0.008, "#Lambda mass (GeV/#it{c}^{2})"}; + Configurable compMassRejection{"cascSelections.compMassRejection", 0.008, "Competing mass rejection (GeV/#it{c}^{2})"}; + + // Track quality + Configurable minTPCrows{"cascSelections.minTPCrows", 70, "minimum TPC crossed rows"}; + Configurable minITSclusters{"cascSelections.minITSclusters", -1, "minimum ITS clusters"}; + + // PID (TPC/TOF) + Configurable tpcPidNsigmaCut{"cascSelections.tpcPidNsigmaCut", 5, "tpcPidNsigmaCut"}; + Configurable tofPidNsigmaCutLaPr{"cascSelections.tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"cascSelections.tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutXiPi{"cascSelections.tofPidNsigmaCutXiPi", 1e+6, "tofPidNsigmaCutXiPi"}; + Configurable tofPidNsigmaCutOmKa{"cascSelections.tofPidNsigmaCutOmKa", 1e+6, "tofPidNsigmaCutOmKa"}; + + // PID (TOF) + Configurable maxDeltaTimeProton{"cascSelections.maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; + Configurable maxDeltaTimePion{"cascSelections.maxDeltaTimePion", 1e+9, "check maximum allowed time"}; + Configurable maxDeltaTimeKaon{"cascSelections.maxDeltaTimeKaon", 1e+9, "check maximum allowed time"}; + } cascSelections; + + void init(InitContext const&) + { + // Determine if we are dealing with MC or not + if (doprocessMCrec || doprocessMCgen) { + isMC = true; + } else { + isMC = false; + } + + TString hNEventsMCLabels[6] = {"All", "z vrtx", "INEL", "INEL>0", "INEL>1", "Associated with rec. collision"}; + TString hNEventsLabels[13] = {"All", "kIsTriggerTVX", "kNoTimeFrameBorder", "kNoITSROFrameBorder", "kIsVertexITSTPC", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "isVertexTOFmatched", "kNoCollInTimeRangeNarrow", "z vrtx", "INEL", "INEL>0", "INEL>1"}; + + histos.add("hEventSelection", "hEventSelection", kTH1D, {{21, -0.5f, +20.5f}}); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "posZ cut"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeStrict"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeNarrow"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "kNoCollInRofStd"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStrict"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "INEL>0"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "INEL>1"); + + histos.add("hEventPVz", "hEventPVz", kTH1D, {{100, -20.0f, +20.0f}}); + + if (isMC) { + // Gen. lvl + histos.add("hEventPVzMC", "hEventPVzMC", kTH1D, {{100, -20.0f, +20.0f}}); + } + } + + // Manual grouping to avoid iterator subscription over StraMCCollisions + std::vector> cascadesGrouped; + + template + bool isCascadeSelected(TCascade casc, TCollision collision, float rapidity, bool isXi) + + // precalculate this information so that a check is one mask operation, not many + { + // + // Base topological variables + // + + // v0 radius min/max selections + if (casc.v0radius() < cascSelections.v0radius) + return false; + if (casc.v0radius() > cascSelections.v0radiusMax) + return false; + // DCA proton and pion to PV for Lambda and AntiLambda decay hypotheses + if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion + if (std::fabs(casc.dcapostopv()) < cascSelections.dcaprotontopv) + return false; + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcapiontopv) + return false; + } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton + if (std::fabs(casc.dcapostopv()) < cascSelections.dcapiontopv) + return false; + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcaprotontopv) + return false; + } + // V0 cosine of pointing angle + if (casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.v0cospa) + return false; + // DCA between v0 daughters + if (casc.dcaV0daughters() > cascSelections.dcav0dau) + return false; + // DCA V0 to prim vtx + if (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.dcav0topv) + return false; + + // casc radius min/max selections + if (casc.cascradius() < cascSelections.cascradius) + return false; + if (casc.cascradius() > cascSelections.cascradiusMax) + return false; + // DCA bachelor selection + if (std::fabs(casc.dcabachtopv()) < cascSelections.dcabachtopv) + return false; + // Bachelor-baryon cosPA selection + if (casc.bachBaryonCosPA() < cascSelections.bachbaryoncospa) + return false; + // DCA bachelor-baryon selection + if (std::fabs(casc.bachBaryonDCAxyToPV()) < cascSelections.dcaxybachbaryontopv) + return false; + // casc cosine of pointing angle + if (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.casccospa) + return false; + // DCA between casc daughters + if (casc.dcacascdaughters() > cascSelections.dcacascdau) + return false; + + // + // rapidity + // + if (std::fabs(rapidity) > cascSelections.rapidityCut) + return false; + + // + // invariant mass window + // + if (std::fabs(casc.mLambda() - o2::constants::physics::MassLambda0) > cascSelections.v0MassWindow) + return false; + + // + // competing mass rejection + // + if (isXi && std::fabs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < cascSelections.compMassRejection) + return false; + if (!isXi && std::fabs(casc.mXi() - o2::constants::physics::MassXiMinus) < cascSelections.compMassRejection) + return false; + + auto bachTrackExtra = casc.template bachTrackExtra_as(); + auto posTrackExtra = casc.template posTrackExtra_as(); + auto negTrackExtra = casc.template negTrackExtra_as(); + + // + // ITS quality flags + // + if (bachTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + if (posTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + if (negTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + + // + // TPC quality flags + // + if (bachTrackExtra.tpcCrossedRows() < cascSelections.minTPCrows) + return false; + if (posTrackExtra.tpcCrossedRows() < cascSelections.minTPCrows) + return false; + if (negTrackExtra.tpcCrossedRows() < cascSelections.minTPCrows) + return false; + + // + // TPC PID + // + if (isXi && std::fabs(bachTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + if (!isXi && std::fabs(bachTrackExtra.tpcNSigmaKa()) > cascSelections.tpcPidNsigmaCut) + return false; + if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion + if (std::fabs(posTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) + return false; + } + + // + // TOF PID in DeltaT + // Bachelor track + if (bachTrackExtra.hasTOF()) { + if (isXi && std::fabs(casc.bachTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) + return false; + if (!isXi && std::fabs(casc.bachTOFDeltaTOmKa()) > cascSelections.maxDeltaTimeKaon) + return false; + } + // Positive track + if (posTrackExtra.hasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> positive daughter = proton + if (isXi && std::fabs(casc.posTOFDeltaTXiPr()) > cascSelections.maxDeltaTimeProton) + return false; + if (!isXi && std::fabs(casc.posTOFDeltaTOmPr()) > cascSelections.maxDeltaTimeProton) + return false; + } else { // Xi+ or Omega+ --> positive daughter = pion + if (isXi && std::fabs(casc.posTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) + return false; + if (!isXi && std::fabs(casc.posTOFDeltaTOmPi()) > cascSelections.maxDeltaTimePion) + return false; + } + } + // Negative track + if (negTrackExtra.hasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> negative daughter = pion + if (isXi && std::fabs(casc.negTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) + return false; + if (!isXi && std::fabs(casc.negTOFDeltaTOmPi()) > cascSelections.maxDeltaTimePion) + return false; + } else { // Xi+ or Omega+ --> negative daughter = proton + if (isXi && std::fabs(casc.negTOFDeltaTXiPr()) > cascSelections.maxDeltaTimeProton) + return false; + if (!isXi && std::fabs(casc.negTOFDeltaTOmPr()) > cascSelections.maxDeltaTimeProton) + return false; + } + } + + // + // TOF PID in NSigma + // Bachelor track + if (bachTrackExtra.hasTOF()) { + if (isXi && std::fabs(casc.tofNSigmaXiPi()) > cascSelections.tofPidNsigmaCutXiPi) + return false; + if (!isXi && std::fabs(casc.tofNSigmaOmKa()) > cascSelections.tofPidNsigmaCutOmKa) + return false; + } + // Positive track + if (posTrackExtra.hasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> positive daughter = proton + if (isXi && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + if (!isXi && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + } else { // Xi+ or Omega+ --> positive daughter = pion + if (isXi && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + if (!isXi && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + } + } + // Negative track + if (negTrackExtra.hasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> negative daughter = pion + if (isXi && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + if (!isXi && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + } else { // Xi+ or Omega+ --> negative daughter = proton + if (isXi && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + if (!isXi && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + } + } + + // + // proper lifetime + float distOverTotMom = std::sqrt(std::pow(casc.x() - collision.posX(), 2) + std::pow(casc.y() - collision.posY(), 2) + std::pow(casc.z() - collision.posZ(), 2)) / (casc.p() + 1E-10); + if (isXi && distOverTotMom * o2::constants::physics::MassXiMinus / ctauXiPDG > cascSelections.cascProperLifeTime) + return false; + if (!isXi && distOverTotMom * o2::constants::physics::MassOmegaMinus / ctauOmegaPDG > cascSelections.cascProperLifeTime) + return false; + + // + // MC association (if asked) + if (doMCAssociation) { + if constexpr (requires { casc.template cascMCCore_as>(); }) { // check if MC information is available + auto cascMC = casc.template cascMCCore_as>(); + + if (isXi) { + if (casc.sign() < 0) { + if (cascMC.pdgCode() != 3312 || cascMC.pdgCodePositive() != 2212 || cascMC.pdgCodeNegative() != -211 || cascMC.pdgCodeBachelor() != -211) + return false; + } else { + if (cascMC.pdgCode() != -3312 || cascMC.pdgCodePositive() != 211 || cascMC.pdgCodeNegative() != -2212 || cascMC.pdgCodeBachelor() != 211) + return false; + } + } else { + if (casc.sign() < 0) { + if (cascMC.pdgCode() != 3334 || cascMC.pdgCodePositive() != 2212 || cascMC.pdgCodeNegative() != -211 || cascMC.pdgCodeBachelor() != -321) + return false; + } else { + if (cascMC.pdgCode() != -3334 || cascMC.pdgCodePositive() != 211 || cascMC.pdgCodeNegative() != -2212 || cascMC.pdgCodeBachelor() != 321) + return false; + } + } + } + } + + return true; + } + + template + bool isEventAccepted(TCollision collision, bool fillHists) + // check whether the collision passes our collision selections + { + if (fillHists) { + histos.fill(HIST("hEventSelection"), 0. /* all collisions */); + } + + if (eventSelections.requireSel8 && !collision.sel8()) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); + } + + if (eventSelections.requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */); + } + + if (eventSelections.rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */); + } + + if (eventSelections.rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + } + + if (std::abs(collision.posZ()) > eventSelections.maxZVtxPosition) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */); + } + + if (eventSelections.requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */); + } + + if (eventSelections.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 7 /* PV position consistency check */); + } + + if (eventSelections.requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */); + } + + if (eventSelections.requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */); + } + + if (eventSelections.rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */); + } + + if (eventSelections.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/); + } + + if (eventSelections.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 10 microseconds */); + } + + if (eventSelections.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 13 /* No other collision within +/- 2 microseconds */); + } + + if (eventSelections.requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */); + } + + if (eventSelections.requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */); + } + + if (eventSelections.requireINEL0 && collision.multNTracksPVeta1() < 1) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 16 /* INEL > 0 */); + } + + if (eventSelections.requireINEL1 && collision.multNTracksPVeta1() < 2) { + return false; + } + if (fillHists) { + histos.fill(HIST("hEventSelection"), 17 /* INEL > 1 */); + } + + return true; + } + + void processData(soa::Join::iterator const& collision, + CascCandidates const& Cascades, + DauTracks const&) + { + if (!isEventAccepted(collision, true)) { + return; + } + histos.fill(HIST("hEventPVz"), collision.posZ()); + + for (const auto& cascade : Cascades) { // loop over Cascades + if (std::abs(cascade.negativeeta()) > cascSelections.daughterEtaCut || + std::abs(cascade.positiveeta()) > cascSelections.daughterEtaCut || + std::abs(cascade.bacheloreta()) > cascSelections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future + + if (isCascadeSelected(cascade, collision, cascade.yXi(), true) || + isCascadeSelected(cascade, collision, cascade.yOmega(), false)) { + + // Fill table + auto bachTrackExtra = cascade.template bachTrackExtra_as(); + auto posTrackExtra = cascade.template posTrackExtra_as(); + auto negTrackExtra = cascade.template negTrackExtra_as(); + + int bachITSNhits = bachTrackExtra.itsNCls(); + int posITSNhits = posTrackExtra.itsNCls(); + int negITSNhits = negTrackExtra.itsNCls(); + + uint8_t evFlag = 0; + evFlag |= o2::aod::mycascades::EvFlags::EvINEL; + if (collision.multNTracksPVeta1() > 0) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; + } + if (collision.multNTracksPVeta1() > 1) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; + } + + // c x tau + float distOverTotMom = std::sqrt(std::pow(cascade.x() - collision.posX(), 2) + std::pow(cascade.y() - collision.posY(), 2) + std::pow(cascade.z() - collision.posZ(), 2)) / (cascade.p() + 1E-10); + float ctauXi = distOverTotMom * o2::constants::physics::MassXiMinus; + float ctauOmega = distOverTotMom * o2::constants::physics::MassOmegaMinus; + + mycascades(collision.posZ(), + collision.centFT0M(), collision.centFV0A(), + collision.multFT0A() + collision.multFT0C(), collision.multFV0A(), + cascade.sign(), cascade.pt(), cascade.yXi(), cascade.yOmega(), cascade.eta(), + cascade.mXi(), cascade.mOmega(), cascade.mLambda(), cascade.cascradius(), cascade.v0radius(), + cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()), cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), + cascade.dcapostopv(), cascade.dcanegtopv(), cascade.dcabachtopv(), cascade.dcacascdaughters(), cascade.dcaV0daughters(), cascade.dcav0topv(collision.posX(), collision.posY(), collision.posZ()), + cascade.positiveeta(), cascade.negativeeta(), cascade.bacheloreta(), posITSNhits, negITSNhits, bachITSNhits, + ctauXi, ctauOmega, negTrackExtra.tpcNSigmaPr(), posTrackExtra.tpcNSigmaPr(), negTrackExtra.tpcNSigmaPi(), posTrackExtra.tpcNSigmaPi(), bachTrackExtra.tpcNSigmaPi(), bachTrackExtra.tpcNSigmaKa(), + -999.f /*negdau.tofNSigmaPr()*/, -999.f /*posdau.tofNSigmaPr()*/, -999.f /*negdau.tofNSigmaPi()*/, -999.f /*posdau.tofNSigmaPi()*/, cascade.bachTOFDeltaTXiPi(), cascade.bachTOFDeltaTOmKa(), + posTrackExtra.tpcNClsFound(), negTrackExtra.tpcNClsFound(), bachTrackExtra.tpcNClsFound(), + posTrackExtra.tpcCrossedRows(), negTrackExtra.tpcCrossedRows(), bachTrackExtra.tpcCrossedRows(), + posTrackExtra.hasTOF(), negTrackExtra.hasTOF(), bachTrackExtra.hasTOF(), + cascade.positivept(), cascade.negativept(), cascade.bachelorpt(), -1, -1, cascade.bachBaryonCosPA(), cascade.bachBaryonDCAxyToPV(), evFlag, 1e3, 1e3); + } + } + } + + Preslice perMcCollision = aod::mcparticle::mcCollisionId; + + // SONRA: + void processMCrec(soa::Join const& collisions, + CascMCCandidates const& Cascades, + DauTracks const&, + aod::MotherMCParts const&, + soa::Join const& /*mccollisions*/, + soa::Join const& /*cascMCCores*/) + + // SONRA: + { + // Manual grouping to avoid iterator subscription which would require + // CascMCCollRefs to have a sorted fIndexStraMCCollisions index + cascadesGrouped.clear(); + cascadesGrouped.resize(collisions.size()); + for (const auto& cascade : Cascades) { + cascadesGrouped[cascade.straCollisionId()].push_back(cascade.globalIndex()); + } + + for (const auto& collision : collisions) { + if (!isEventAccepted(collision, true)) { + continue; + } + histos.fill(HIST("hEventPVz"), collision.posZ()); + + if (!collision.has_straMCCollision()) { + continue; + } + + const auto& mcCollision = collision.straMCCollision_as>(); // aod::McCentFV0As to be added + histos.fill(HIST("hEventPVzMC"), mcCollision.posZ()); + + // SONRA: + for (auto const& idx : cascadesGrouped[collision.globalIndex()]) { + auto cascade = Cascades.rawIteratorAt(idx); + + if (std::abs(cascade.negativeeta()) > cascSelections.daughterEtaCut || + std::abs(cascade.positiveeta()) > cascSelections.daughterEtaCut || + std::abs(cascade.bacheloreta()) > cascSelections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future + + if (!cascade.has_cascMCCore()) + continue; + + // SONRA: + auto cascadeMC = cascade.cascMCCore_as>(); + + // Check mc association + float lPDG = 1e3; + float ptmc = 1e3; + float ymc = 1e3; + float isPrimary = -1; + if (std::abs(cascadeMC.pdgCode()) == PDG_t::kXiMinus || std::abs(cascadeMC.pdgCode()) == PDG_t::kOmegaMinus) { + lPDG = cascadeMC.pdgCode(); + ptmc = RecoDecay::pt(cascadeMC.pxMC(), cascadeMC.pyMC()); + if (std::fabs(cascadeMC.pdgCode()) == 3312) + ymc = RecoDecay::y(std::array{cascadeMC.pxMC(), cascadeMC.pyMC(), cascadeMC.pzMC()}, o2::constants::physics::MassXiMinus); + else if (std::fabs(cascadeMC.pdgCode()) == 3334) + ymc = RecoDecay::y(std::array{cascadeMC.pxMC(), cascadeMC.pyMC(), cascadeMC.pzMC()}, o2::constants::physics::MassOmegaMinus); + isPrimary = cascadeMC.isPhysicalPrimary() ? 1 : 0; + } + + if (isCascadeSelected(cascade, collision, ymc, true) || + isCascadeSelected(cascade, collision, ymc, false)) { + + auto bachTrackExtra = cascade.template bachTrackExtra_as(); + auto posTrackExtra = cascade.template posTrackExtra_as(); + auto negTrackExtra = cascade.template negTrackExtra_as(); + + int bachITSNhits = bachTrackExtra.itsNCls(); + int posITSNhits = posTrackExtra.itsNCls(); + int negITSNhits = negTrackExtra.itsNCls(); + + uint8_t evFlag = 0; + evFlag |= o2::aod::mycascades::EvFlags::EvINEL; + if (collision.multNTracksPVeta1() > 0) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; + } + if (collision.multNTracksPVeta1() > 1) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; + } + + // c x tau + float distOverTotMom = std::sqrt(std::pow(cascade.x() - collision.posX(), 2) + std::pow(cascade.y() - collision.posY(), 2) + std::pow(cascade.z() - collision.posZ(), 2)) / (cascade.p() + 1E-10); + float ctauXi = distOverTotMom * o2::constants::physics::MassXiMinus; + float ctauOmega = distOverTotMom * o2::constants::physics::MassOmegaMinus; + + mycascades(collision.posZ(), + collision.centFT0M(), collision.centFV0A(), + collision.multFT0A() + collision.multFT0C(), collision.multFV0A(), + cascade.sign(), cascade.pt(), cascade.yXi(), cascade.yOmega(), cascade.eta(), + cascade.mXi(), cascade.mOmega(), cascade.mLambda(), cascade.cascradius(), cascade.v0radius(), + cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()), cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), + cascade.dcapostopv(), cascade.dcanegtopv(), cascade.dcabachtopv(), cascade.dcacascdaughters(), cascade.dcaV0daughters(), cascade.dcav0topv(collision.posX(), collision.posY(), collision.posZ()), + cascade.positiveeta(), cascade.negativeeta(), cascade.bacheloreta(), posITSNhits, negITSNhits, bachITSNhits, + ctauXi, ctauOmega, negTrackExtra.tpcNSigmaPr(), posTrackExtra.tpcNSigmaPr(), negTrackExtra.tpcNSigmaPi(), posTrackExtra.tpcNSigmaPi(), bachTrackExtra.tpcNSigmaPi(), bachTrackExtra.tpcNSigmaKa(), + -999.f /*negdau.tofNSigmaPr()*/, -999.f /*posdau.tofNSigmaPr()*/, -999.f /*negdau.tofNSigmaPi()*/, -999.f /*posdau.tofNSigmaPi()*/, cascade.bachTOFDeltaTXiPi(), cascade.bachTOFDeltaTOmKa(), + posTrackExtra.tpcNClsFound(), negTrackExtra.tpcNClsFound(), bachTrackExtra.tpcNClsFound(), + posTrackExtra.tpcCrossedRows(), negTrackExtra.tpcCrossedRows(), bachTrackExtra.tpcCrossedRows(), + posTrackExtra.hasTOF(), negTrackExtra.hasTOF(), bachTrackExtra.hasTOF(), + cascadeMC.positiveptMC(), cascadeMC.negativeptMC(), cascadeMC.bachelorptMC(), lPDG, isPrimary, cascade.bachBaryonCosPA(), cascade.bachBaryonDCAxyToPV(), evFlag, ptmc, ymc); + + } // isCascadeSelected kapanışı ← girinti 8 boşluk + } // end cascade loop ← girinti 6 boşluk + } // end collision loop ← girinti 4 boşluk + } // processMCrec kapanışı ← girinti 2 boşluk + + void processMCgen(soa::Join const& mcCollisions, + soa::Join const& CascMCCores, + soa::Join const& collisions) + { + + // Manual grouping of CascMCCores per MC collision + cascadesGrouped.clear(); + cascadesGrouped.resize(mcCollisions.size()); + for (auto const& cascMC : CascMCCores) { + if (!cascMC.has_straMCCollision()) + continue; + cascadesGrouped[cascMC.straMCCollisionId()].push_back(cascMC.globalIndex()); + } + + for (const auto& mcCollision : mcCollisions) { + + // Define the type of generated MC collision + histos.fill(HIST("hEventPVzMC"), mcCollision.posZ()); + + uint8_t flagsGen = 0; + flagsGen |= o2::aod::myMCcascades::EvFlags::EvINEL; + // Generated collision is INEL>0 + if (mcCollision.multMCNParticlesEta10() > 0) { + flagsGen |= o2::aod::myMCcascades::EvFlags::EvINELgt0; + } + // Generated collision is INEL>1 + if (mcCollision.multMCNParticlesEta10() > 1) { + flagsGen |= o2::aod::myMCcascades::EvFlags::EvINELgt1; + } + + uint16_t nchFT0 = mcCollision.multMCFT0A() + mcCollision.multMCFT0C(); + uint8_t flagsAssoc = 0; + int nAssocColl = 0; + int biggestNContribs = -1; + float centrality = 100.5f; + for (const auto& collision : collisions) { + if (!isEventAccepted(collision, false)) { + continue; + } + + if (biggestNContribs < collision.multPVTotalContributors()) { + biggestNContribs = collision.multPVTotalContributors(); + centrality = collision.centFT0M(); + } + + if (collision.straMCCollision_as>().globalIndex() == mcCollision.globalIndex()) { + flagsAssoc |= o2::aod::myMCcascades::EvFlags::EvINEL; + if (collision.multNTracksPVeta1() > 0) { + flagsAssoc |= o2::aod::myMCcascades::EvFlags::EvINELgt0; + } + if (collision.multNTracksPVeta1() > 1) { + flagsAssoc |= o2::aod::myMCcascades::EvFlags::EvINELgt1; + } + nAssocColl++; + } + } + + for (auto const& idx : cascadesGrouped[mcCollision.globalIndex()]) { + auto cascMC = CascMCCores.rawIteratorAt(idx); + + if (!cascMC.isPhysicalPrimary()) + continue; + float sign = 0; + if (cascMC.pdgCode() == PDG_t::kXiPlusBar || cascMC.pdgCode() == PDG_t::kOmegaPlusBar) { + sign = 1; + } else if (cascMC.pdgCode() == PDG_t::kXiMinus || cascMC.pdgCode() == PDG_t::kOmegaMinus) { + sign = -1; + } else { + continue; + } + myMCcascades(mcCollision.posZ(), sign, cascMC.pdgCode(), + std::abs(cascMC.pdgCode()) == PDG_t::kXiMinus ? cascMC.rapidityMC(0) : cascMC.rapidityMC(1), RecoDecay::eta(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}), RecoDecay::phi(cascMC.pxMC(), cascMC.pyMC()), cascMC.ptMC(), + cascMC.isPhysicalPrimary(), nAssocColl, + nchFT0, 0, + centrality, 0, // mcCollision.centFV0A() to be added + flagsAssoc, + flagsGen); + + } // end cascade loop + } // end mcCollision loop + } + + PROCESS_SWITCH(CascDerivedQAanalysis, processData, "Process Run 3 data", true); + PROCESS_SWITCH(CascDerivedQAanalysis, processMCrec, "Process Run 3 mc, reconstructed", false); + PROCESS_SWITCH(CascDerivedQAanalysis, processMCgen, "Process Run 3 mc, genereated", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From bbfac97c3eee9501132b22590b43d5ac50ad38cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 14 Apr 2026 23:02:11 +0200 Subject: [PATCH 276/282] [PWGEM] Fix includes and using statements (#15720) --- PWGEM/Dilepton/Core/Dilepton.h | 51 ++-- PWGEM/Dilepton/Core/DileptonHadronMPC.h | 34 +-- PWGEM/Dilepton/Core/DileptonMC.h | 52 ++-- PWGEM/Dilepton/Core/SingleTrackQC.h | 136 ++++----- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 138 ++++----- PWGEM/Dilepton/Tasks/dileptonPolarization.cxx | 1 - PWGEM/Dilepton/Utils/EventHistograms.h | 264 +++++++++--------- PWGEM/PhotonMeson/Core/CutsLibrary.cxx | 2 +- PWGEM/PhotonMeson/Core/DalitzEECut.cxx | 2 +- PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx | 4 +- PWGEM/PhotonMeson/Core/EMCPhotonCut.h | 28 +- PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx | 2 +- PWGEM/PhotonMeson/Core/EmMlResponsePCM.h | 7 +- PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx | 2 +- PWGEM/PhotonMeson/Core/PHOSPhotonCut.cxx | 2 +- PWGEM/PhotonMeson/Core/PairCut.cxx | 2 +- PWGEM/PhotonMeson/Core/PairCut.h | 4 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 2 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 2 +- PWGEM/PhotonMeson/Core/TaggingPi0.h | 13 +- PWGEM/PhotonMeson/Core/TaggingPi0MC.h | 25 +- PWGEM/PhotonMeson/Core/V0PhotonCut.cxx | 2 +- PWGEM/PhotonMeson/Core/V0PhotonCut.h | 36 +-- PWGEM/PhotonMeson/Tasks/gammaConversions.h | 4 +- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 5 + PWGEM/PhotonMeson/Utils/ClusterHistograms.h | 52 ++-- PWGEM/PhotonMeson/Utils/EventHistograms.h | 22 +- PWGEM/PhotonMeson/Utils/NMHistograms.h | 22 +- 28 files changed, 461 insertions(+), 455 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index c31d605078a..5bce11ac26f 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -71,6 +71,7 @@ #include #include +#include #include #include #include @@ -450,23 +451,23 @@ struct Dilepton { leptonM2 = o2::constants::physics::MassMuon; } - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true); if (doprocessTriggerAnalysis) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data()); - fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::HistType::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::HistType::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 } if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); - fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); + fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", o2::framework::HistType::kTH1D, {{100, -50, +50}}, false); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::HistType::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -605,13 +606,13 @@ struct Dilepton { const o2::framework::AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); - fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", o2::framework::kTH2D, {{180, -M_PI, M_PI}, {400, -2, +2}}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", o2::framework::HistType::kTH2D, {{180, -M_PI, M_PI}, {400, -2, +2}}, 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})", o2::framework::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})", o2::framework::kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", o2::framework::kTH2D, {{200, -10, 10.0}, {200, -10, 10}}, true); + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::HistType::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})", o2::framework::HistType::kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", o2::framework::HistType::kTH2D, {{200, -10, 10.0}, {200, -10, 10}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); @@ -630,7 +631,7 @@ struct Dilepton { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_l_ll, axis_cos_theta}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_l_ll, axis_cos_theta}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -643,11 +644,11 @@ struct Dilepton { const o2::framework::AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); - fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); @@ -664,7 +665,7 @@ struct Dilepton { const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; const o2::framework::AxisSpec axis_phi{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; const o2::framework::AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); @@ -672,7 +673,7 @@ struct Dilepton { } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kHFll)) { const o2::framework::AxisSpec axis_dphi_ll{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll const o2::framework::AxisSpec axis_deta_ll{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ll, axis_deta_ll}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ll, axis_deta_ll}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -680,10 +681,10 @@ struct Dilepton { nmod = 2; const o2::framework::AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; const o2::framework::AxisSpec axis_bootstrap{cfgNumBootstrapSamples, 0.5, static_cast(cfgNumBootstrapSamples) + 0.5, "sample"}; // for bootstrap samples - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp, axis_bootstrap}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp, axis_bootstrap}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); - fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistogramsBootstrap(&fRegistry, cfgNumBootstrapSamples); @@ -697,15 +698,15 @@ struct Dilepton { // similar to Eq.1 in PRL 126, 162001 (2021) const o2::framework::AxisSpec axis_ep{4, 0, 2 * M_PI / nmod, Form("#varphi_{ll} #minus #Psi_{%d}^{%s}", nmod, qvec_det_names[cfgQvecEstimator].data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_ep}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_ep}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); - fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); } else { // same as kQC to avoid seg. fault - fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -719,8 +720,8 @@ struct Dilepton { } else { o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); } - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::HistType::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::HistType::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); } void DefineEMEventCut() diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index c7676facbc6..6f9227bde6c 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -426,10 +426,10 @@ struct DileptonHadronMPC { if (doprocessTriggerAnalysis) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value); - fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); - auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); + fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::HistType::kTProfile, {{80000, 520000.5, 600000.5}}, true); + fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", o2::framework::HistType::kTProfile, {{80000, 520000.5, 600000.5}}, true); + fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", o2::framework::HistType::kTProfile, {{80000, 520000.5, 600000.5}}, true); + auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), o2::framework::HistType::kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); } @@ -504,7 +504,7 @@ struct DileptonHadronMPC { static constexpr std::string_view qvec_det_names[7] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg", "FV0A"}; // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); - fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", o2::framework::kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); + fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", o2::framework::HistType::kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; std::string pair_pt_axis_title = "p_{T,ll} (GeV/c)"; @@ -552,10 +552,10 @@ struct DileptonHadronMPC { const o2::framework::AxisSpec axis_pt_trg{ConfPtHadronBins, "p_{T,h} (GeV/c)"}; const o2::framework::AxisSpec axis_eta_trg{40, -2, +2, "#eta_{h}"}; const o2::framework::AxisSpec axis_phi_trg{36, 0, 2 * M_PI, "#varphi_{h} (rad.)"}; - fRegistry.add("Hadron/hs", "hadron", o2::framework::kTHnSparseD, {axis_pt_trg, axis_eta_trg, axis_phi_trg}, false); - fRegistry.add("Hadron/hTrackBit", "track bit", o2::framework::kTH1D, {{65536, -0.5, 65535.5}}, false); + fRegistry.add("Hadron/hs", "hadron", o2::framework::HistType::kTHnSparseD, {axis_pt_trg, axis_eta_trg, axis_phi_trg}, false); + fRegistry.add("Hadron/hTrackBit", "track bit", o2::framework::HistType::kTH1D, {{65536, -0.5, 65535.5}}, false); - fRegistry.add("Dilepton/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Dilepton/same/uls/hs", "dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Dilepton/same/uls/", "Dilepton/same/lspp/"); fRegistry.addClone("Dilepton/same/uls/", "Dilepton/same/lsmm/"); fRegistry.addClone("Dilepton/same/", "Dilepton/mix/"); @@ -563,34 +563,34 @@ struct DileptonHadronMPC { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { const o2::framework::AxisSpec axis_dphi{cfgNbinsDPhi, -M_PI / 2, 3 * M_PI / 2, dphi_axis_title}; // dilepton-hadron - fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); + fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); - fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true); // hadron-hadron const o2::framework::AxisSpec axis_dphi_hh{90, -M_PI / 2, 3 * M_PI / 2, "#Delta#varphi = #varphi_{h}^{ref1} - #varphi_{h}^{ref2} (rad.)"}; - fRegistry.add("HadronHadron/same/hDEtaDPhi", "hadron-hadron 2PC", o2::framework::kTH2D, {axis_dphi_hh, axis_deta_hh}, true); + fRegistry.add("HadronHadron/same/hDEtaDPhi", "hadron-hadron 2PC", o2::framework::HistType::kTH2D, {axis_dphi_hh, axis_deta_hh}, true); fRegistry.addClone("HadronHadron/same/", "HadronHadron/mix/"); - fRegistry.add("HadronHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("HadronHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kCumulant)) { const o2::framework::AxisSpec axis_cos_ndphi{cfgNbinsCosNDPhi, -1, +1, cosndphi_axis_title}; // dilepton-hadron - fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_cos_ndphi}, true); + fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_cos_ndphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); // hadron-hadron const o2::framework::AxisSpec axis_cosndphi_hh{cfgNbinsCosNDPhi, -1, +1, std::format("cos({0:d}(#varphi_{{h}}^{{ref1}} - #varphi_{{h}}^{{ref2}}))", cfgNmod.value)}; - fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", o2::framework::kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true); + fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", o2::framework::HistType::kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true); } - fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true); - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::HistType::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::HistType::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); } void DefineEMEventCut() diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 6194716c508..10a069da32d 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -363,8 +363,8 @@ struct DileptonMC { { // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms(&fRegistry); - fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); - fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; @@ -420,7 +420,7 @@ struct DileptonMC { const o2::framework::AxisSpec axis_dphi_e_ee{cfg_nbin_dphi_e_ee, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; // for kUPC // generated info - fRegistry.add("Generated/sm/PromptPi0/uls/hs", "gen. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); + fRegistry.add("Generated/sm/PromptPi0/uls/hs", "gen. dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); fRegistry.addClone("Generated/sm/PromptPi0/uls/", "Generated/sm/PromptPi0/lspp/"); fRegistry.addClone("Generated/sm/PromptPi0/uls/", "Generated/sm/PromptPi0/lsmm/"); @@ -440,7 +440,7 @@ struct DileptonMC { // fRegistry.addClone("Generated/sm/PromptPi0/", "Generated/sm/Upsilon2S/"); // fRegistry.addClone("Generated/sm/PromptPi0/", "Generated/sm/Upsilon3S/"); - fRegistry.add("Generated/ccbar/c2l_c2l/uls/hs", "generated dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); + fRegistry.add("Generated/ccbar/c2l_c2l/uls/hs", "generated dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); fRegistry.addClone("Generated/ccbar/c2l_c2l/uls/", "Generated/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Generated/ccbar/c2l_c2l/uls/", "Generated/ccbar/c2l_c2l/lsmm/"); @@ -484,7 +484,7 @@ struct DileptonMC { } // evaluate acceptance for polarization - fRegistry.add("Generated/VM/All/Phi/hs", "gen. VM #rightarrow ll", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_cos_theta_pol, axis_phi_pol, axis_quadmom}, true); + fRegistry.add("Generated/VM/All/Phi/hs", "gen. VM #rightarrow ll", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_cos_theta_pol, axis_phi_pol, axis_quadmom}, true); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/Rho/"); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/Omega/"); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/PromptJPsi/"); @@ -492,7 +492,7 @@ struct DileptonMC { fRegistry.addClone("Generated/VM/All/", "Generated/VM/Acc/"); // reconstructed pair info - fRegistry.add("Pair/sm/Photon/uls/hs", "rec. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/sm/Photon/uls/hs", "rec. dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/sm/Photon/uls/", "Pair/sm/Photon/lspp/"); fRegistry.addClone("Pair/sm/Photon/uls/", "Pair/sm/Photon/lsmm/"); @@ -514,25 +514,25 @@ struct DileptonMC { // fRegistry.addClone("Pair/sm/Photon/", "Pair/sm/Upsilon3S/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/sm/Photon/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/sm/Photon/uls/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::HistType::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/uls/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", o2::framework::HistType::kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); for (const auto& strSign : pair_sign_types) { - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::HistType::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::HistType::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::HistType::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::HistType::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::HistType::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::HistType::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::HistType::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::HistType::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::HistType::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::HistType::kTH2F, {axis_dca_track1, axis_dca_track2}, true); } } - fRegistry.add("Pair/ccbar/c2l_c2l/uls/hs", "rec. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/ccbar/c2l_c2l/uls/hs", "rec. dilepton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lsmm/"); @@ -566,15 +566,15 @@ struct DileptonMC { } // for correlated bkg due to mis-identified hadrons, and true combinatorial bkg - fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lspp/"); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lsmm/"); fRegistry.addClone("Pair/corr_bkg_lh/", "Pair/corr_bkg_hh/"); fRegistry.addClone("Pair/corr_bkg_lh/", "Pair/comb_bkg/"); if (doprocessGen_VM) { - fRegistry.add("Generated/VM/Omega/hPtY", "pT vs. y of #omega", o2::framework::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum - fRegistry.add("Generated/VM/Phi/hPtY", "pT vs. y of #phi", o2::framework::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum + fRegistry.add("Generated/VM/Omega/hPtY", "pT vs. y of #omega", o2::framework::HistType::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum + fRegistry.add("Generated/VM/Phi/hPtY", "pT vs. y of #phi", o2::framework::HistType::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum } if (cfgFillUnfolding) { @@ -583,9 +583,9 @@ struct DileptonMC { const o2::framework::AxisSpec axis_pt_gen{ConfPtllBins, "p_{T,ll}^{gen} (GeV/c)"}; const o2::framework::AxisSpec axis_mass_rec{ConfMllBins, "m_{ll}^{rec} (GeV/c^{2})"}; const o2::framework::AxisSpec axis_pt_rec{ConfPtllBins, "p_{T,ll}^{rec} (GeV/c)"}; - fRegistry.add("Unfold/sm/uls/hsRM", "response matrix", o2::framework::kTHnSparseD, {axis_mass_gen, axis_pt_gen, axis_mass_rec, axis_pt_rec}, true); - fRegistry.add("Unfold/sm/uls/hMiss", "missing dilepton", o2::framework::kTH2D, {axis_mass_gen, axis_pt_gen}, true); // e.g. true eta is in acceptance, but reconstructed eta is out of acceptance. - fRegistry.add("Unfold/sm/uls/hFake", "fake dilepton", o2::framework::kTH2D, {axis_mass_rec, axis_pt_rec}, true); // e.g. true eta is out of acceptance, but reconstructed eta is in acceptance. + fRegistry.add("Unfold/sm/uls/hsRM", "response matrix", o2::framework::HistType::kTHnSparseD, {axis_mass_gen, axis_pt_gen, axis_mass_rec, axis_pt_rec}, true); + fRegistry.add("Unfold/sm/uls/hMiss", "missing dilepton", o2::framework::HistType::kTH2D, {axis_mass_gen, axis_pt_gen}, true); // e.g. true eta is in acceptance, but reconstructed eta is out of acceptance. + fRegistry.add("Unfold/sm/uls/hFake", "fake dilepton", o2::framework::HistType::kTH2D, {axis_mass_rec, axis_pt_rec}, true); // e.g. true eta is out of acceptance, but reconstructed eta is in acceptance. fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lspp/"); fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lsmm/"); fRegistry.addClone("Unfold/sm/", "Unfold/ccbar/"); @@ -636,7 +636,7 @@ struct DileptonMC { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::HistType::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index bb37b9ba1e2..487589c4862 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -263,45 +263,45 @@ struct SingleTrackQC { const o2::framework::AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; // track info - fRegistry.add("Track/positive/hs", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true); - fRegistry.add("Track/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::kTH1F, {axis_phiposition}, false); - fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{4000, -20, 20}}, false); - fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); - fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); - fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); - fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); - - fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - - fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - - fRegistry.add("Track/positive/hPIDForTracking", "PID for trackng", o2::framework::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h - fRegistry.add("Track/positive/hProbElBDT", "probability to be e from BDT;p_{in} (GeV/c);BDT score;", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hs", "rec. single electron", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true); + fRegistry.add("Track/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::HistType::kTH1F, {axis_phiposition}, false); + fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::HistType::kTH1F, {{4000, -20, 20}}, false); + fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::HistType::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); + fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::HistType::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); + fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::HistType::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::HistType::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::HistType::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); + fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::HistType::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::HistType::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::HistType::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::HistType::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", o2::framework::HistType::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); + + fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/positive/hPIDForTracking", "PID for trackng", o2::framework::HistType::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h + fRegistry.add("Track/positive/hProbElBDT", "probability to be e from BDT;p_{in} (GeV/c);BDT score;", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::HistType::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::HistType::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::HistType::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { @@ -311,29 +311,29 @@ struct SingleTrackQC { const o2::framework::AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; // track info - fRegistry.add("Track/positive/hs", "rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true); - fRegistry.add("Track/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); - fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); - fRegistry.add("Track/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); - fRegistry.add("Track/positive/hDCAxy", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); - fRegistry.add("Track/positive/hDCAxySigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAx_PosZ", "DCAx vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAy_PosZ", "DCAy vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); - fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); - fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 100}}, false); - fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0.0f, 100}, {200, 0, 0.5}}, false); + fRegistry.add("Track/positive/hs", "rec. single muon", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true); + fRegistry.add("Track/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::HistType::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); + fRegistry.add("Track/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::HistType::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); + fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::HistType::kTH1F, {{1000, -5, 5}}, false); + fRegistry.add("Track/positive/hTrackType", "track type", o2::framework::HistType::kTH1F, {{6, -0.5f, 5.5}}, false); + fRegistry.add("Track/positive/hDCAxy", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::HistType::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); + fRegistry.add("Track/positive/hDCAxySigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::HistType::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAx_PosZ", "DCAx vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::HistType::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAy_PosZ", "DCAy vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::HistType::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::HistType::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::HistType::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", o2::framework::HistType::kTH1F, {{21, -0.5, 20.5}}, false); + fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", o2::framework::HistType::kTH1F, {{11, -0.5, 10.5}}, false); + fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::HistType::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); + fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 100}}, false); + fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", o2::framework::HistType::kTH1F, {{1024, -0.5, 1023.5}}, false); + fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::HistType::kTH2F, {{200, 0.0f, 100}, {200, 0, 0.5}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } } @@ -358,18 +358,18 @@ struct SingleTrackQC { if (doprocessQC_TriggeredData) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data()); - fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::HistType::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::HistType::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::HistType::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 } if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::HistType::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 6882c2e32d0..4abe7e585f7 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -258,8 +258,8 @@ struct SingleTrackQCMC { { // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); - fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); - fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -273,7 +273,7 @@ struct SingleTrackQCMC { const o2::framework::AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; // generated info - fRegistry.add("Generated/PromptLF/hs", "gen. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.add("Generated/PromptLF/hs", "gen. single electron", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptLF/"); fRegistry.addClone("Generated/PromptLF/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptJPsi/"); @@ -282,33 +282,33 @@ struct SingleTrackQCMC { fRegistry.addClone("Generated/PromptLF/", "Generated/b2c2l/"); // track info - fRegistry.add("Track/PromptLF/positive/hs", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hs", "rec. single electron", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); if (fillGenValuesForRec) { - fRegistry.add("Track/PromptLF/positive/hsGenRec", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hsGenRec", "rec. single electron", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); } if (cfgFillQA) { - fRegistry.add("Track/PromptLF/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::kTH1F, {axis_phiposition}, false); - fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{4000, -20, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/PromptLF/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPIDForTracking", "PID for trackng", o2::framework::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::HistType::kTH1F, {axis_phiposition}, false); + fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::HistType::kTH1F, {{4000, -20, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::HistType::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::HistType::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::HistType::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/PromptLF/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::HistType::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::HistType::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::HistType::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::HistType::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::HistType::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::HistType::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hITSClusterMap", "ITS cluster map", o2::framework::HistType::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPIDForTracking", "PID for trackng", o2::framework::HistType::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::HistType::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -318,21 +318,21 @@ struct SingleTrackQCMC { fRegistry.addClone("Track/PromptLF/", "Track/c2l/"); fRegistry.addClone("Track/PromptLF/", "Track/b2l/"); fRegistry.addClone("Track/PromptLF/", "Track/b2c2l/"); - fRegistry.add("Track/Photon/positive/hProdVtx", "production vertex of e from #gamma;p_{T,e}^{rec} (GeV/c);r_{xy}^{gen} (cm);", o2::framework::kTH2F, {axis_pt, {100, 0, 100}}, false); + fRegistry.add("Track/Photon/positive/hProdVtx", "production vertex of e from #gamma;p_{T,e}^{rec} (GeV/c);r_{xy}^{gen} (cm);", o2::framework::HistType::kTH2F, {axis_pt, {100, 0, 100}}, false); fRegistry.addClone("Track/Photon/positive/hProdVtx", "Track/Photon/negative/hProdVtx"); if (cfgFillQA) { - fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::HistType::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::HistType::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::HistType::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::HistType::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.addClone("Track/PID/positive/", "Track/PID/negative/"); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { @@ -343,7 +343,7 @@ struct SingleTrackQCMC { const o2::framework::AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; // generated info - fRegistry.add("Generated/PromptLF/hs", "gen. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.add("Generated/PromptLF/hs", "gen. single muon", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptLF/"); fRegistry.addClone("Generated/PromptLF/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptJPsi/"); @@ -352,37 +352,37 @@ struct SingleTrackQCMC { fRegistry.addClone("Generated/PromptLF/", "Generated/b2c2l/"); // track info - fRegistry.add("Track/PromptLF/positive/hs", "rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hs", "rec. single muon", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); if (fillGenValuesForRec) { - fRegistry.add("Track/PromptLF/positive/hsGenRec", "gen. info of rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hsGenRec", "gen. info of rec. single muon", o2::framework::HistType::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); } if (cfgFillQA) { - fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/PromptLF/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); - fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); - fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", o2::framework::kTH1F, {{100, 0.f, 1.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy2DinSigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAx_PosZ", "DCA_{x} vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAy_PosZ", "DCA_{y} vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{200, 0, 10}, {200, 0.0f, 100}}, false); - fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0.0f, 100}, {200, 0, 0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::HistType::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); + fRegistry.add("Track/PromptLF/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::HistType::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); + fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::HistType::kTH1F, {{1000, -5, 5}}, false); + fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", o2::framework::HistType::kTH1F, {{6, -0.5f, 5.5}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", o2::framework::HistType::kTH1F, {{100, 0.f, 1.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::HistType::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy2DinSigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::HistType::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAx_PosZ", "DCA_{x} vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::HistType::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAy_PosZ", "DCA_{y} vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::HistType::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::HistType::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::HistType::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", o2::framework::HistType::kTH1F, {{21, -0.5, 20.5}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", o2::framework::HistType::kTH1F, {{11, -0.5, 10.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::HistType::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, 0.0f, 100}}, false); + fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", o2::framework::HistType::kTH1F, {{1024, -0.5, 1023.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::HistType::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::HistType::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::HistType::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::HistType::kTH2F, {{200, 0.0f, 100}, {200, 0, 0.5}}, false); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -429,7 +429,7 @@ struct SingleTrackQCMC { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::HistType::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); diff --git a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx index 6f650da4771..919ee9987e7 100644 --- a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx +++ b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx @@ -19,7 +19,6 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index 154441cd5ba..da8d3734794 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -37,7 +37,7 @@ template void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::HistType::kTH1D, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "FT0AND"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No TF border"); @@ -60,147 +60,147 @@ void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) hCollisionCounter->GetXaxis()->SetBinLabel(20, "Calibrated Q vector"); hCollisionCounter->GetXaxis()->SetBinLabel(21, "accepted"); - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1D, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2D, {{200, 0, 200000}, {60, 0, 60000}}, false); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentNTPV", "hCentNTPV;centrality NTPV (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2D, {{110, 0, 110}, {600, 0, 6000}}, false); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2D, {{60, 0, 60000}, {600, 0, 6000}}, false); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2D, {{60, 0, 60000}, {200, 0, 20000}}, false); - fRegistry->add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", o2::framework::kTH2D, {{600, 0, 6000}, {200, 0, 20000}}, false); - fRegistry->add("Event/before/hCorrOccupancy", "occupancy correlation;FT0C occupancy;track occupancy", o2::framework::kTH2D, {{200, 0, 200000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1D, {{100, -50, +50}}, false); + fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::HistType::kTH1D, {{6001, -0.5, 6000.5}}, false); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::HistType::kTH2D, {{200, 0, 200000}, {60, 0, 60000}}, false); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::HistType::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::HistType::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::HistType::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentNTPV", "hCentNTPV;centrality NTPV (%)", o2::framework::HistType::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::HistType::kTH2D, {{110, 0, 110}, {600, 0, 6000}}, false); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::HistType::kTH2D, {{60, 0, 60000}, {600, 0, 6000}}, false); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::HistType::kTH2D, {{60, 0, 60000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", o2::framework::HistType::kTH2D, {{600, 0, 6000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hCorrOccupancy", "occupancy correlation;FT0C occupancy;track occupancy", o2::framework::HistType::kTH2D, {{200, 0, 200000}, {200, 0, 20000}}, false); if constexpr (nmod == 2) { - fRegistry->add("Event/before/hQ2xFT0M_CentFT0C", "hQ2xFT0M_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0M_CentFT0C", "hQ2yFT0M_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFT0A_CentFT0C", "hQ2xFT0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0A_CentFT0C", "hQ2yFT0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFT0C_CentFT0C", "hQ2xFT0C_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0C_CentFT0C", "hQ2yFT0C_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFV0A_CentFT0C", "hQ2xFV0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFV0A_CentFT0C", "hQ2yFV0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBPos_CentFT0C", "hQ2xBPos_CentFT0C;centrality FT0C (%);Q_{2,x}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBPos_CentFT0C", "hQ2yBPos_CentFT0C;centrality FT0C (%);Q_{2,y}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBNeg_CentFT0C", "hQ2xBNeg_CentFT0C;centrality FT0C (%);Q_{2,x}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBNeg_CentFT0C", "hQ2yBNeg_CentFT0C;centrality FT0C (%);Q_{2,y}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBTot_CentFT0C", "hQ2xBTot_CentFT0C;centrality FT0C (%);Q_{2,x}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBTot_CentFT0C", "hQ2yBTot_CentFT0C;centrality FT0C (%);Q_{2,y}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - - fRegistry->add("Event/before/hEP2FT0M_CentFT0C", "2nd harmonics event plane FT0M;centrality FT0C (%);#Psi_{2}^{FT0M} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FT0A_CentFT0C", "2nd harmonics event plane FT0A;centrality FT0C (%);#Psi_{2}^{FT0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FT0C_CentFT0C", "2nd harmonics event plane FT0C;centrality FT0C (%);#Psi_{2}^{FT0C} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FV0A_CentFT0C", "2nd harmonics event plane FV0A;centrality FT0C (%);#Psi_{2}^{FV0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BPos_CentFT0C", "2nd harmonics event plane BPos;centrality FT0C (%);#Psi_{2}^{BPos} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BNeg_CentFT0C", "2nd harmonics event plane BNeg;centrality FT0C (%);#Psi_{2}^{BNeg} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BTot_CentFT0C", "2nd harmonics event plane BTot;centrality FT0C (%);#Psi_{2}^{BTot} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - - fRegistry->add("Event/before/hPrfQ2FT0MQ2BPos_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0MQ2BNeg_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2BPosQ2BNeg_CentFT0C", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ2FT0CQ2BPos_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0CQ2BNeg_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0CQ2BTot_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BPos_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BNeg_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BTot_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2FT0C_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfQ2FV0AQ2BPos_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - - fRegistry->add("Event/before/hPrfCos2_Psi2FT0M_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0M_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2BPos_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{BPos} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{BPos} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2FT0C_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{FT0C}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2FT0C_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{FT0C}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hQ2xFT0M_CentFT0C", "hQ2xFT0M_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0M}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0M_CentFT0C", "hQ2yFT0M_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0M}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0A_CentFT0C", "hQ2xFT0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0A_CentFT0C", "hQ2yFT0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0C_CentFT0C", "hQ2xFT0C_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0C}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0C_CentFT0C", "hQ2yFT0C_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0C}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFV0A_CentFT0C", "hQ2xFV0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FV0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFV0A_CentFT0C", "hQ2yFV0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FV0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBPos_CentFT0C", "hQ2xBPos_CentFT0C;centrality FT0C (%);Q_{2,x}^{BPos}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBPos_CentFT0C", "hQ2yBPos_CentFT0C;centrality FT0C (%);Q_{2,y}^{BPos}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBNeg_CentFT0C", "hQ2xBNeg_CentFT0C;centrality FT0C (%);Q_{2,x}^{BNeg}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBNeg_CentFT0C", "hQ2yBNeg_CentFT0C;centrality FT0C (%);Q_{2,y}^{BNeg}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBTot_CentFT0C", "hQ2xBTot_CentFT0C;centrality FT0C (%);Q_{2,x}^{BTot}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBTot_CentFT0C", "hQ2yBTot_CentFT0C;centrality FT0C (%);Q_{2,y}^{BTot}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + + fRegistry->add("Event/before/hEP2FT0M_CentFT0C", "2nd harmonics event plane FT0M;centrality FT0C (%);#Psi_{2}^{FT0M} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0A_CentFT0C", "2nd harmonics event plane FT0A;centrality FT0C (%);#Psi_{2}^{FT0A} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0C_CentFT0C", "2nd harmonics event plane FT0C;centrality FT0C (%);#Psi_{2}^{FT0C} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FV0A_CentFT0C", "2nd harmonics event plane FV0A;centrality FT0C (%);#Psi_{2}^{FV0A} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BPos_CentFT0C", "2nd harmonics event plane BPos;centrality FT0C (%);#Psi_{2}^{BPos} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BNeg_CentFT0C", "2nd harmonics event plane BNeg;centrality FT0C (%);#Psi_{2}^{BNeg} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BTot_CentFT0C", "2nd harmonics event plane BTot;centrality FT0C (%);#Psi_{2}^{BTot} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + + fRegistry->add("Event/before/hPrfQ2FT0MQ2BPos_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0MQ2BNeg_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2BPosQ2BNeg_CentFT0C", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfQ2FT0CQ2BPos_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0CQ2BNeg_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0CQ2BTot_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BPos_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BNeg_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BTot_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2FT0C_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ2FV0AQ2BPos_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + + fRegistry->add("Event/before/hPrfCos2_Psi2FT0M_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0M_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0M} - #Psi_{2}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2BPos_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{BPos} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{BPos} - #Psi_{2}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0C_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0C} - #Psi_{2}^{BTot}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{BTot}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FT0A_Psi2FT0C_CentFT0C", "cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{FT0C}));centrality FT0C (%);cos(2(#Psi_{2}^{FT0A} - #Psi_{2}^{FT0C}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BPos_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BPos}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BNeg_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BNeg}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2BTot_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BTot}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{BTot}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos2_Psi2FV0A_Psi2FT0C_CentFT0C", "cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{FT0C}));centrality FT0C (%);cos(2(#Psi_{2}^{FV0A} - #Psi_{2}^{FT0C}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } else if constexpr (nmod == 3) { - fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFT0A_CentFT0C", "hQ3xFT0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0A_CentFT0C", "hQ3yFT0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFT0C_CentFT0C", "hQ3xFT0C_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0C_CentFT0C", "hQ3yFT0C_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFV0A_CentFT0C", "hQ3xFV0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFV0A_CentFT0C", "hQ3yFV0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBPos_CentFT0C", "hQ3xBPos_CentFT0C;centrality FT0C (%);Q_{3,x}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBPos_CentFT0C", "hQ3yBPos_CentFT0C;centrality FT0C (%);Q_{3,y}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBNeg_CentFT0C", "hQ3xBNeg_CentFT0C;centrality FT0C (%);Q_{3,x}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBNeg_CentFT0C", "hQ3yBNeg_CentFT0C;centrality FT0C (%);Q_{3,y}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBTot_CentFT0C", "hQ3xBTot_CentFT0C;centrality FT0C (%);Q_{3,x}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBTot_CentFT0C", "hQ3yBTot_CentFT0C;centrality FT0C (%);Q_{3,y}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - - fRegistry->add("Event/before/hEP3FT0M_CentFT0C", "3rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{3}^{FT0M} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FT0A_CentFT0C", "3rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{3}^{FT0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FT0C_CentFT0C", "3rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{3}^{FT0C} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FV0A_CentFT0C", "3rd harmonics event plane FV0A;centrality FT0C (%);#Psi_{3}^{FV0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BPos_CentFT0C", "3rd harmonics event plane BPos;centrality FT0C (%);#Psi_{3}^{BPos} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BNeg_CentFT0C", "3rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{3}^{BNeg} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BTot_CentFT0C", "3rd harmonics event plane BTot;centrality FT0C (%);#Psi_{3}^{BTot} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - - fRegistry->add("Event/before/hPrfQ3FT0MQ3BPos_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0MQ3BNeg_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3BPosQ3BNeg_CentFT0C", "Q_{3}^{BPos} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{BPos} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ3FT0CQ3BPos_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0CQ3BNeg_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0CQ3BTot_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BPos_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfQ3FV0AQ3BPos_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - - fRegistry->add("Event/before/hPrfCos3_Psi3FT0M_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0M_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3BPos_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{BPos} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{BPos} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3FT0C_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{FT0C}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BPos}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BNeg}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BTot}))", o2::framework::kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3FT0C_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{FT0C}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{FT0C}))", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0A_CentFT0C", "hQ3xFT0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0A_CentFT0C", "hQ3yFT0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0C_CentFT0C", "hQ3xFT0C_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0C}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0C_CentFT0C", "hQ3yFT0C_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0C}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFV0A_CentFT0C", "hQ3xFV0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FV0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFV0A_CentFT0C", "hQ3yFV0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FV0A}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBPos_CentFT0C", "hQ3xBPos_CentFT0C;centrality FT0C (%);Q_{3,x}^{BPos}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBPos_CentFT0C", "hQ3yBPos_CentFT0C;centrality FT0C (%);Q_{3,y}^{BPos}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBNeg_CentFT0C", "hQ3xBNeg_CentFT0C;centrality FT0C (%);Q_{3,x}^{BNeg}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBNeg_CentFT0C", "hQ3yBNeg_CentFT0C;centrality FT0C (%);Q_{3,y}^{BNeg}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBTot_CentFT0C", "hQ3xBTot_CentFT0C;centrality FT0C (%);Q_{3,x}^{BTot}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBTot_CentFT0C", "hQ3yBTot_CentFT0C;centrality FT0C (%);Q_{3,y}^{BTot}", o2::framework::HistType::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + + fRegistry->add("Event/before/hEP3FT0M_CentFT0C", "3rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{3}^{FT0M} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0A_CentFT0C", "3rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{3}^{FT0A} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0C_CentFT0C", "3rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{3}^{FT0C} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FV0A_CentFT0C", "3rd harmonics event plane FV0A;centrality FT0C (%);#Psi_{3}^{FV0A} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BPos_CentFT0C", "3rd harmonics event plane BPos;centrality FT0C (%);#Psi_{3}^{BPos} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BNeg_CentFT0C", "3rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{3}^{BNeg} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BTot_CentFT0C", "3rd harmonics event plane BTot;centrality FT0C (%);#Psi_{3}^{BTot} (rad.)", o2::framework::HistType::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + + fRegistry->add("Event/before/hPrfQ3FT0MQ3BPos_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0MQ3BNeg_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3BPosQ3BNeg_CentFT0C", "Q_{3}^{BPos} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{BPos} #upoint Q_{3}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfQ3FT0CQ3BPos_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0CQ3BNeg_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0CQ3BTot_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BTot}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BPos_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ3FV0AQ3BPos_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BPos}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + + fRegistry->add("Event/before/hPrfCos3_Psi3FT0M_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0M_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0M} - #Psi_{3}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3BPos_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{BPos} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{BPos} - #Psi_{3}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0C_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0C} - #Psi_{3}^{BTot}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{BTot}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FT0A_Psi3FT0C_CentFT0C", "cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{FT0C}));centrality FT0C (%);cos(3(#Psi_{3}^{FT0A} - #Psi_{3}^{FT0C}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BPos_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BPos}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BPos}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BNeg_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BNeg}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BNeg}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3BTot_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BTot}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{BTot}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfCos3_Psi3FV0A_Psi3FT0C_CentFT0C", "cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{FT0C}));centrality FT0C (%);cos(3(#Psi_{3}^{FV0A} - #Psi_{3}^{FT0C}))", o2::framework::HistType::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } fRegistry->addClone("Event/before/", "Event/after/"); } void addEventHistogramsBootstrap(o2::framework::HistogramRegistry* fRegistry, int nsamples = 1) { - fRegistry->add("Event/bootstrap/hPoissonWeights", "Poisson Weights per sample;sample;weight", o2::framework::kTH2D, {{nsamples, 0.5, nsamples + 0.5}, {210, -1, 20}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2BPosQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); - fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPoissonWeights", "Poisson Weights per sample;sample;weight", o2::framework::HistType::kTH2D, {{nsamples, 0.5, nsamples + 0.5}, {210, -1, 20}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2BPosQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::HistType::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); } template diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index 6aae90e5d3c..61e39b86d4f 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -13,7 +13,7 @@ /// \brief Source of class for EM photon selection. /// \author daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/Core/CutsLibrary.h" +#include "CutsLibrary.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" diff --git a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx index c0709362278..25645430f27 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx @@ -13,7 +13,7 @@ /// \brief header of class for dalitz ee cuts. /// \author D. Sekihata, daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/Core/DalitzEECut.h" +#include "DalitzEECut.h" #include diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx index 3d911df19e3..9e75d9e558e 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx @@ -13,8 +13,8 @@ /// \brief source of class for emcal photon selection. /// \author M. Hemmer, marvin.hemmer@cern.ch; N. Strangmann, nicolas.strangmann@cern.ch -#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" -// +#include "EMCPhotonCut.h" + #include "PWGJE/DataModel/EMCALClusters.h" #include diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h index 3c262fcb540..bba559ed8cb 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -163,17 +163,17 @@ class EMCPhotonCut : public TNamed const o2::framework::AxisSpec thAxisTime{300, -150, +150, "#it{t}_{cls} (ns)"}; const o2::framework::AxisSpec thAxisEoverP{400, 0, 10., "#it{E}_{cls}/#it{p}_{track} (#it{c})"}; - fRegistry->add("QA/Cluster/before/hE", "E_{cluster};#it{E}_{cluster} (GeV);#it{N}_{cluster}", o2::framework::kTH1D, {thAxisClusterEnergy}, true); - fRegistry->add("QA/Cluster/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{cluster}", o2::framework::kTH1D, {thAxisClusterEnergy}, true); - fRegistry->add("QA/Cluster/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::kTH1D, {{1001, -0.5f, 1000.5f}}, true); - fRegistry->add("QA/Cluster/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::kTH2F, {thAxisEta, thAxisPhi}, true); - fRegistry->add("QA/Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisNCell, thAxisClusterEnergy}, true); - fRegistry->add("QA/Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisM02, thAxisClusterEnergy}, true); - fRegistry->add("QA/Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisTime, thAxisClusterEnergy}, true); + fRegistry->add("QA/Cluster/before/hE", "E_{cluster};#it{E}_{cluster} (GeV);#it{N}_{cluster}", o2::framework::HistType::kTH1D, {thAxisClusterEnergy}, true); + fRegistry->add("QA/Cluster/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{cluster}", o2::framework::HistType::kTH1D, {thAxisClusterEnergy}, true); + fRegistry->add("QA/Cluster/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::HistType::kTH1D, {{1001, -0.5f, 1000.5f}}, true); + fRegistry->add("QA/Cluster/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisEta, thAxisPhi}, true); + fRegistry->add("QA/Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisNCell, thAxisClusterEnergy}, true); + fRegistry->add("QA/Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisM02, thAxisClusterEnergy}, true); + fRegistry->add("QA/Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisTime, thAxisClusterEnergy}, true); fRegistry->addClone("QA/Cluster/before/", "QA/Cluster/after/"); - auto hClusterQualityCuts = fRegistry->add("QA/Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::kTH2F, {{static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 2, -0.5, static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1.5}, thAxisClusterEnergy}, true); + auto hClusterQualityCuts = fRegistry->add("QA/Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::HistType::kTH2F, {{static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 2, -0.5, static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1.5}, thAxisClusterEnergy}, true); hClusterQualityCuts->GetXaxis()->SetBinLabel(1, "In"); hClusterQualityCuts->GetXaxis()->SetBinLabel(2, "Definition"); hClusterQualityCuts->GetXaxis()->SetBinLabel(3, "Energy"); @@ -185,12 +185,12 @@ class EMCPhotonCut : public TNamed hClusterQualityCuts->GetXaxis()->SetBinLabel(9, "Exotic"); hClusterQualityCuts->GetXaxis()->SetBinLabel(10, "Out"); - fRegistry->add("QA/Cluster/hTrackdEtadPhi", "d#eta vs. d#varphi of matched tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisDPhi}, true); - fRegistry->add("QA/Cluster/hTrackdEtaPt", "d#eta vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisMomentum}, true); - fRegistry->add("QA/Cluster/hTrackdPhiPt", "d#varphi vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDPhi, thAxisMomentum}, true); - fRegistry->add("QA/Cluster/hSecTrackdEtadPhi", "d#eta vs. d#varphi of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisDPhi}, true); - fRegistry->add("QA/Cluster/hSecTrackdEtaPt", "d#eta vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisMomentum}, true); - fRegistry->add("QA/Cluster/hSecTrackdPhiPt", "d#varphi vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDPhi, thAxisMomentum}, true); + fRegistry->add("QA/Cluster/hTrackdEtadPhi", "d#eta vs. d#varphi of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisDPhi}, true); + fRegistry->add("QA/Cluster/hTrackdEtaPt", "d#eta vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisMomentum}, true); + fRegistry->add("QA/Cluster/hTrackdPhiPt", "d#varphi vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDPhi, thAxisMomentum}, true); + fRegistry->add("QA/Cluster/hSecTrackdEtadPhi", "d#eta vs. d#varphi of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisDPhi}, true); + fRegistry->add("QA/Cluster/hSecTrackdEtaPt", "d#eta vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisMomentum}, true); + fRegistry->add("QA/Cluster/hSecTrackdPhiPt", "d#varphi vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDPhi, thAxisMomentum}, true); } } diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx index 316b01d9563..f7eaea2fd44 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx @@ -13,7 +13,7 @@ // Class for em photon event selection // -#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "EMPhotonEventCut.h" #include diff --git a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h index 72e3b364a46..7a908cbf4b9 100644 --- a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h +++ b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h @@ -27,10 +27,9 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_PCM(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesPCM::FEATURE) \ - } +#define FILL_MAP_PCM(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesPCM::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE diff --git a/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx b/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx index e54a462e9dc..64e5c5cbd36 100644 --- a/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx @@ -13,7 +13,7 @@ /// \brief Small histogram library for photon and meson analysis. /// \author D. Sekihata, daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/Core/HistogramsLibrary.h" +#include "HistogramsLibrary.h" #include diff --git a/PWGEM/PhotonMeson/Core/PHOSPhotonCut.cxx b/PWGEM/PhotonMeson/Core/PHOSPhotonCut.cxx index f2a2046b120..1fc60c9e30f 100644 --- a/PWGEM/PhotonMeson/Core/PHOSPhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/PHOSPhotonCut.cxx @@ -13,7 +13,7 @@ /// \brief Source of class for phos photon selection. /// \author D. Sekihata, daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PHOSPhotonCut.h" #include diff --git a/PWGEM/PhotonMeson/Core/PairCut.cxx b/PWGEM/PhotonMeson/Core/PairCut.cxx index 3ea3e06acec..5bf8273cb39 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.cxx +++ b/PWGEM/PhotonMeson/Core/PairCut.cxx @@ -13,7 +13,7 @@ // Class for track selection // -#include "PWGEM/PhotonMeson/Core/PairCut.h" +#include "PairCut.h" #include diff --git a/PWGEM/PhotonMeson/Core/PairCut.h b/PWGEM/PhotonMeson/Core/PairCut.h index c514d8946c8..f30f7dae7a9 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.h +++ b/PWGEM/PhotonMeson/Core/PairCut.h @@ -16,10 +16,10 @@ #ifndef PWGEM_PHOTONMESON_CORE_PAIRCUT_H_ #define PWGEM_PHOTONMESON_CORE_PAIRCUT_H_ -#include "Rtypes.h" - #include +#include + class PairCut : public TNamed { public: diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index c89fc48990f..abf51cd17c8 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -402,7 +402,7 @@ struct Pi0EtaToGammaGamma { fRegistry.addClone("Pair/same/", "Pair/rotation/"); emcalGeom = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); } - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true); mRunNumber = 0; d_bz = 0; diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index ee823b4f4b0..905027a8456 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -250,7 +250,7 @@ struct Pi0EtaToGammaGammaMC { f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", TString(fd_k0s_to_pi0), 0.f, 100.f); - fRegistry.add("Event/hNrecPerMCCollision", "Nrec per mc collision;N_{rec} collisions per MC collision", o2::framework::kTH1F, {{21, -0.5f, 20.5f}}, false); + fRegistry.add("Event/hNrecPerMCCollision", "Nrec per mc collision;N_{rec} collisions per MC collision", o2::framework::HistType::kTH1F, {{21, -0.5f, 20.5f}}, false); mRunNumber = 0; d_bz = 0; diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0.h b/PWGEM/PhotonMeson/Core/TaggingPi0.h index ee4f8fc8083..fb562beb382 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -16,8 +16,6 @@ #ifndef PWGEM_PHOTONMESON_CORE_TAGGINGPI0_H_ #define PWGEM_PHOTONMESON_CORE_TAGGINGPI0_H_ -#include "PWGEM/Dilepton/Utils/EMTrack.h" -#include "PWGEM/Dilepton/Utils/EventMixingHandler.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" @@ -26,6 +24,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" +// +#include "PWGEM/Dilepton/Utils/EMTrack.h" +#include "PWGEM/Dilepton/Utils/EventMixingHandler.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" @@ -326,11 +327,11 @@ struct TaggingPi0 { const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); - fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); - fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", o2::framework::kTH2D, {axis_m, axis_pt}, true); + fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", o2::framework::HistType::kTH1D, {axis_pt}, true); + fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::HistType::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); + fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", o2::framework::HistType::kTH2D, {axis_m, axis_pt}, true); fRegistry.addClone("Pair/same/", "Pair/mix/"); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::HistType::kTH1D, {{10001, -0.5, 10000.5}}, true); } void DefineEMEventCut() diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index 17b92c44852..1334a89bf98 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -17,7 +17,6 @@ #ifndef PWGEM_PHOTONMESON_CORE_TAGGINGPI0MC_H_ #define PWGEM_PHOTONMESON_CORE_TAGGINGPI0MC_H_ -#include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" @@ -27,6 +26,8 @@ #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" +// +#include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" @@ -295,17 +296,17 @@ struct TaggingPi0MC { const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity - fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity - fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator - - fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", o2::framework::kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator - fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness - fRegistry.addClone("Pair/primary/", "Pair/fromHS/"); // only for completeness + fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", o2::framework::HistType::kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::HistType::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", o2::framework::HistType::kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::HistType::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator + + fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", o2::framework::HistType::kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator + fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness + fRegistry.addClone("Pair/primary/", "Pair/fromHS/"); // only for completeness } void DefineEMEventCut() diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx index e38aed371f9..03428137217 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx @@ -13,7 +13,7 @@ /// \brief Source of class for V0 photon selection. /// \author D. Sekihata, daiki.sekihata@cern.ch -#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" +#include "V0PhotonCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.h b/PWGEM/PhotonMeson/Core/V0PhotonCut.h index 7ea0be9beb3..a6d64f8338b 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.h @@ -241,30 +241,30 @@ class V0PhotonCut : public TNamed const o2::framework::AxisSpec thAxisChi2{100, 0., +50, "#chi^{2}_{KF}/ndf"}; const o2::framework::AxisSpec thAxisPsiPair{200, -0.1, +0.1, "#Psi_{pair}"}; - fRegistry->add("QA/V0Photon/before/hE", "p_{T};#it{p}_{T} (GeV/#it{c});#it{N}_{#gamma}", o2::framework::kTH1D, {thAxispT}, true); - fRegistry->add("QA/V0Photon/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{#gamma}", o2::framework::kTH1D, {thAxispT}, true); - fRegistry->add("QA/V0Photon/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::kTH1D, {{1001, -0.5f, 1000.5f}}, true); - fRegistry->add("QA/V0Photon/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::kTH2F, {thAxisEta, thAxisPhi}, true); - fRegistry->add("QA/V0Photon/before/hAP", "Armenteros-Podolanski #alpha vs qT", o2::framework::kTH2F, {thAxisAlpha, thAxisQt}, true); - fRegistry->add("QA/V0Photon/before/hConvXY", "Conversion point XY", o2::framework::kTH2F, {thAxisConvX, thAxisConvY}, true); - fRegistry->add("QA/V0Photon/before/hConvZR", "Conversion point ZR", o2::framework::kTH2F, {thAxisConvZ, thAxisConvR}, true); - fRegistry->add("QA/V0Photon/before/hChi2", "Chi2/ndf from KFParticle;#chi^{2}_{KF}/ndf;counts", o2::framework::kTH1D, {thAxisChi2}, true); + fRegistry->add("QA/V0Photon/before/hE", "p_{T};#it{p}_{T} (GeV/#it{c});#it{N}_{#gamma}", o2::framework::HistType::kTH1D, {thAxispT}, true); + fRegistry->add("QA/V0Photon/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{#gamma}", o2::framework::HistType::kTH1D, {thAxispT}, true); + fRegistry->add("QA/V0Photon/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::HistType::kTH1D, {{1001, -0.5f, 1000.5f}}, true); + fRegistry->add("QA/V0Photon/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisEta, thAxisPhi}, true); + fRegistry->add("QA/V0Photon/before/hAP", "Armenteros-Podolanski #alpha vs qT", o2::framework::HistType::kTH2F, {thAxisAlpha, thAxisQt}, true); + fRegistry->add("QA/V0Photon/before/hConvXY", "Conversion point XY", o2::framework::HistType::kTH2F, {thAxisConvX, thAxisConvY}, true); + fRegistry->add("QA/V0Photon/before/hConvZR", "Conversion point ZR", o2::framework::HistType::kTH2F, {thAxisConvZ, thAxisConvR}, true); + fRegistry->add("QA/V0Photon/before/hChi2", "Chi2/ndf from KFParticle;#chi^{2}_{KF}/ndf;counts", o2::framework::HistType::kTH1D, {thAxisChi2}, true); // TODO: add psi_pair once available - // fRegistry->add("QA/V0Photon/before/hPsiPair", "Psi pair;#Psi_{pair};counts", o2::framework::kTH1D, {thAxisPsiPair}, true); + // fRegistry->add("QA/V0Photon/before/hPsiPair", "Psi pair;#Psi_{pair};counts", o2::framework::HistType::kTH1D, {thAxisPsiPair}, true); - fRegistry->add("QA/V0Photon/before/Pos/NSigmaE", "NSigmaE of pos leg vs momentum", o2::framework::kTH2F, {thAxisMomentum, thAxisNSigmaE}, true); - fRegistry->add("QA/V0Photon/before/Pos/NSigmaPi", "NSigmaE of pos leg vs momentum", o2::framework::kTH2F, {thAxisMomentum, thAxisNSigmaPi}, true); - fRegistry->add("QA/V0Photon/before/Pos/hEtaPhi", "eta vs phi of pos leg", o2::framework::kTH2F, {thAxisEta, thAxisPhi}, true); - fRegistry->add("QA/V0Photon/before/Pos/hTPCHits", "NCluster vs NFindable TPC", o2::framework::kTH2F, {thAxisNClusTPC, thAxisNCrossedTPC}, true); - fRegistry->add("QA/V0Photon/before/Neg/NSigmaE", "NSigmaE of neg leg vs momentum", o2::framework::kTH2F, {thAxisMomentum, thAxisNSigmaE}, true); - fRegistry->add("QA/V0Photon/before/Neg/NSigmaPi", "NSigmaE of neg leg vs momentum", o2::framework::kTH2F, {thAxisMomentum, thAxisNSigmaPi}, true); - fRegistry->add("QA/V0Photon/before/Neg/hEtaPhi", "eta vs phi of neg leg", o2::framework::kTH2F, {thAxisEta, thAxisPhi}, true); - fRegistry->add("QA/V0Photon/before/Neg/hTPCHits", "NCluster vs NFindable TPC", o2::framework::kTH2F, {thAxisNClusTPC, thAxisNCrossedTPC}, true); + fRegistry->add("QA/V0Photon/before/Pos/NSigmaE", "NSigmaE of pos leg vs momentum", o2::framework::HistType::kTH2F, {thAxisMomentum, thAxisNSigmaE}, true); + fRegistry->add("QA/V0Photon/before/Pos/NSigmaPi", "NSigmaE of pos leg vs momentum", o2::framework::HistType::kTH2F, {thAxisMomentum, thAxisNSigmaPi}, true); + fRegistry->add("QA/V0Photon/before/Pos/hEtaPhi", "eta vs phi of pos leg", o2::framework::HistType::kTH2F, {thAxisEta, thAxisPhi}, true); + fRegistry->add("QA/V0Photon/before/Pos/hTPCHits", "NCluster vs NFindable TPC", o2::framework::HistType::kTH2F, {thAxisNClusTPC, thAxisNCrossedTPC}, true); + fRegistry->add("QA/V0Photon/before/Neg/NSigmaE", "NSigmaE of neg leg vs momentum", o2::framework::HistType::kTH2F, {thAxisMomentum, thAxisNSigmaE}, true); + fRegistry->add("QA/V0Photon/before/Neg/NSigmaPi", "NSigmaE of neg leg vs momentum", o2::framework::HistType::kTH2F, {thAxisMomentum, thAxisNSigmaPi}, true); + fRegistry->add("QA/V0Photon/before/Neg/hEtaPhi", "eta vs phi of neg leg", o2::framework::HistType::kTH2F, {thAxisEta, thAxisPhi}, true); + fRegistry->add("QA/V0Photon/before/Neg/hTPCHits", "NCluster vs NFindable TPC", o2::framework::HistType::kTH2F, {thAxisNClusTPC, thAxisNCrossedTPC}, true); fRegistry->addClone("QA/V0Photon/before/", "QA/V0Photon/after/"); - auto hPhotonQualityCuts = fRegistry->add("QA/V0Photon/hPhotonQualityCuts", "pT at which v0 photons are removed by a given cut", o2::framework::kTH2F, {{static_cast(V0PhotonCut::V0PhotonCuts::kNCuts) + 2, -0.5, static_cast(V0PhotonCut::V0PhotonCuts::kNCuts) + 1.5}, thAxispT}, true); + auto hPhotonQualityCuts = fRegistry->add("QA/V0Photon/hPhotonQualityCuts", "pT at which v0 photons are removed by a given cut", o2::framework::HistType::kTH2F, {{static_cast(V0PhotonCut::V0PhotonCuts::kNCuts) + 2, -0.5, static_cast(V0PhotonCut::V0PhotonCuts::kNCuts) + 1.5}, thAxispT}, true); hPhotonQualityCuts->GetXaxis()->SetBinLabel(1, "In"); hPhotonQualityCuts->GetXaxis()->SetBinLabel(2, "#it{M}_{ee}"); hPhotonQualityCuts->GetXaxis()->SetBinLabel(3, "#it{p}_{T}"); diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.h b/PWGEM/PhotonMeson/Tasks/gammaConversions.h index 7eb85f26efe..4e985ad524d 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.h +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.h @@ -127,9 +127,9 @@ struct tV0Kind { // todo ugly: remove if (theSuffix) { - if (tHisto.m.config.type == o2::framework::kTH1F) { + if (tHisto.m.config.type == o2::framework::HistType::kTH1F) { appendSuffixToTitleI(lHistPtr, theSuffix); - } else if (tHisto.m.config.type == o2::framework::kTH2F) { + } else if (tHisto.m.config.type == o2::framework::HistType::kTH2F) { appendSuffixToTitleI(lHistPtr, theSuffix); } } diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 43a37569823..d7793efb694 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -43,18 +43,23 @@ #include #include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include +#include #include #include #include #include +#include #include #include +#include +#include #include #include #include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h index dbaeebaf1a7..6e51d09ab40 100644 --- a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h +++ b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h @@ -39,37 +39,37 @@ inline void addClusterHistograms(o2::framework::HistogramRegistry* fRegistry, bo const o2::framework::AxisSpec thAxisEta{320, -0.8, 0.8, "#eta"}; const o2::framework::AxisSpec thAxisPhi{500, 0, o2::constants::math::TwoPI, "#varphi (rad)"}; - fRegistry->add("Cluster/before/hE", "E_{cluster};#it{E}_{cluster} (GeV);#it{N}_{cluster}", o2::framework::kTH1F, {{500, 0.0f, 50}}, true); - fRegistry->add("Cluster/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{cluster}", o2::framework::kTH1F, {{500, 0.0f, 50}}, true); - fRegistry->add("Cluster/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::kTH1F, {{1001, -0.5f, 1000.5f}}, true); - fRegistry->add("Cluster/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::kTH2F, {thAxisEta, thAxisPhi}, true); - fRegistry->add("Cluster/before/hNTracks", "Number of tracks considered for TM;#it{N}_{tracks};#it{N}_{cluster}", o2::framework::kTH1F, {{20, -0.5f, 19.5}}, true); - fRegistry->add("Cluster/before/hNSecTracks", "Number of secondary tracks considered for TM;#it{N}_{tracks};#it{N}_{cluster}", o2::framework::kTH1F, {{20, -0.5f, 19.5}}, true); - fRegistry->add("Cluster/before/hTrackdEtadPhi", "d#eta vs. d#varphi of matched tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisDPhi}, true); - fRegistry->add("Cluster/before/hTrackdEtaPt", "d#eta vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisMomentum}, true); - fRegistry->add("Cluster/before/hTrackdPhiPt", "d#varphi vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDPhi, thAxisMomentum}, true); - fRegistry->add("Cluster/before/hSecTrackdEtadPhi", "d#eta vs. d#varphi of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisDPhi}, true); - fRegistry->add("Cluster/before/hSecTrackdEtaPt", "d#eta vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDEta, thAxisMomentum}, true); - fRegistry->add("Cluster/before/hSecTrackdPhiPt", "d#varphi vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::kTH2F, {thAxisDPhi, thAxisMomentum}, true); + fRegistry->add("Cluster/before/hE", "E_{cluster};#it{E}_{cluster} (GeV);#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{500, 0.0f, 50}}, true); + fRegistry->add("Cluster/before/hPt", "Transverse momenta of clusters;#it{p}_{T} (GeV/c);#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{500, 0.0f, 50}}, true); + fRegistry->add("Cluster/before/hNgamma", "Number of #gamma candidates per collision;#it{N}_{#gamma} per collision;#it{N}_{collisions}", o2::framework::HistType::kTH1F, {{1001, -0.5f, 1000.5f}}, true); + fRegistry->add("Cluster/before/hEtaPhi", "#eta vs #varphi;#eta;#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisEta, thAxisPhi}, true); + fRegistry->add("Cluster/before/hNTracks", "Number of tracks considered for TM;#it{N}_{tracks};#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{20, -0.5f, 19.5}}, true); + fRegistry->add("Cluster/before/hNSecTracks", "Number of secondary tracks considered for TM;#it{N}_{tracks};#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{20, -0.5f, 19.5}}, true); + fRegistry->add("Cluster/before/hTrackdEtadPhi", "d#eta vs. d#varphi of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisDPhi}, true); + fRegistry->add("Cluster/before/hTrackdEtaPt", "d#eta vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisMomentum}, true); + fRegistry->add("Cluster/before/hTrackdPhiPt", "d#varphi vs. track pT of matched tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDPhi, thAxisMomentum}, true); + fRegistry->add("Cluster/before/hSecTrackdEtadPhi", "d#eta vs. d#varphi of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisDPhi}, true); + fRegistry->add("Cluster/before/hSecTrackdEtaPt", "d#eta vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDEta, thAxisMomentum}, true); + fRegistry->add("Cluster/before/hSecTrackdPhiPt", "d#varphi vs. track pT of matched secondary tracks;d#eta;d#varphi (rad.)", o2::framework::HistType::kTH2F, {thAxisDPhi, thAxisMomentum}, true); if (do2DQA) { // Check if 2D QA histograms were selected in em-qc task - fRegistry->add("Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {{26, -0.5, 25.5}, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {{200, 0, 2}, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {{300, -150, 150}, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hTrackdEta", "d#eta vs. E of matched tracks;d#eta;#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisDEta, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hTrackdPhi", "d#phi vs. E of matched tracks;d#varphi (rad.);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisDPhi, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c});#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {{200, 0., 5.}, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hSecTrackdEta", "d#eta vs. E of matched tracks;d#eta;#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisDEta, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hSecTrackdPhi", "d#phi vs. E of matched tracks;d#varphi (rad.);#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {thAxisDPhi, {200, 0, 20}}, true); - fRegistry->add("Cluster/before/hSecTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c});#it{E}_{cluster} (GeV)", o2::framework::kTH2F, {{200, 0., 5.}, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {{26, -0.5, 25.5}, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {{200, 0, 2}, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {{300, -150, 150}, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hTrackdEta", "d#eta vs. E of matched tracks;d#eta;#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisDEta, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hTrackdPhi", "d#phi vs. E of matched tracks;d#varphi (rad.);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisDPhi, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c});#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {{200, 0., 5.}, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hSecTrackdEta", "d#eta vs. E of matched tracks;d#eta;#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisDEta, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hSecTrackdPhi", "d#phi vs. E of matched tracks;d#varphi (rad.);#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {thAxisDPhi, {200, 0, 20}}, true); + fRegistry->add("Cluster/before/hSecTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c});#it{E}_{cluster} (GeV)", o2::framework::HistType::kTH2F, {{200, 0., 5.}, {200, 0, 20}}, true); } else { - fRegistry->add("Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{N}_{cluster}", o2::framework::kTH1F, {{26, -0.5, 25.5}}, true); - fRegistry->add("Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{N}_{cluster}", o2::framework::kTH1F, {{400, 0, 2}}, true); - fRegistry->add("Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{N}_{cluster}", o2::framework::kTH1F, {{600, -150, 150}}, true); - fRegistry->add("Cluster/before/hTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c})", o2::framework::kTH1F, {{200, 0., 5.}}, true); + fRegistry->add("Cluster/before/hNCell", "#it{N}_{cells};N_{cells} (GeV);#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{26, -0.5, 25.5}}, true); + fRegistry->add("Cluster/before/hM02", "Long ellipse axis;#it{M}_{02} (cm);#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{400, 0, 2}}, true); + fRegistry->add("Cluster/before/hTime", "Cluster time;#it{t}_{cls} (ns);#it{N}_{cluster}", o2::framework::HistType::kTH1F, {{600, -150, 150}}, true); + fRegistry->add("Cluster/before/hTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c})", o2::framework::HistType::kTH1F, {{200, 0., 5.}}, true); } - auto hClusterQualityCuts = fRegistry->add("Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::kTH2F, {{static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 2, -0.5, static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1.5}, {500, 0, 50}}, true); + auto hClusterQualityCuts = fRegistry->add("Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::HistType::kTH2F, {{static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 2, -0.5, static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1.5}, {500, 0, 50}}, true); hClusterQualityCuts->GetXaxis()->SetBinLabel(1, "In"); hClusterQualityCuts->GetXaxis()->SetBinLabel(2, "Definition"); hClusterQualityCuts->GetXaxis()->SetBinLabel(3, "Energy"); diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h index dd4c3ca4ac6..6991e399625 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -32,7 +32,7 @@ namespace o2::aod::pwgem::photonmeson::utils::eventhistogram inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool useWeight = false) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{12, 0.5, 12.5}}, useWeight); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::HistType::kTH1D, {{12, 0.5, 12.5}}, useWeight); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "No TF border"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No ITS ROF border"); @@ -67,16 +67,16 @@ inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}, "centrality FT0C (%)"}; - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{220, -11, +11}}, useWeight); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); - fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, useWeight); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1F, {{axis_cent_ft0a}}, useWeight); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1F, {{axis_cent_ft0c}}, useWeight); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1F, {{axis_cent_ft0m}}, useWeight); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, useWeight); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, useWeight); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 10000}}, useWeight); + fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1D, {{220, -11, +11}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::HistType::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::HistType::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::HistType::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, useWeight); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::HistType::kTH1F, {{axis_cent_ft0a}}, useWeight); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::HistType::kTH1F, {{axis_cent_ft0c}}, useWeight); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::HistType::kTH1F, {{axis_cent_ft0m}}, useWeight); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::HistType::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::HistType::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::HistType::kTH2F, {{60, 0, 60000}, {500, 0, 10000}}, useWeight); fRegistry->addClone("Event/before/", "Event/after/"); } diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index 6eb784df2cf..edca1f8c3ed 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -51,18 +51,18 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is const o2::framework::AxisSpec axis_mass{400, 0, 0.8, Form("m_{%s} (GeV/c^{2})", pairname)}; if (isMC) { - fRegistry->add("Pair/Pi0/hs_Primary", "rec. true pi0", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Pi0/hs_FromWD", "rec. true pi0 from weak decay", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Pi0/hs_FromHS", "rec. true pi0 from hadronic shower in material", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Pi0/hs_FromSameGamma", "Two clusters from same gamma that is a pi0 daughter (conversion)", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Eta/hs_Primary", "rec. true eta", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Eta/hs_FromWD", "rec. true eta from weak decay", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Eta/hs_FromHS", "rec. true eta from hadronic shower in material", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); - fRegistry->add("Pair/Eta/hs_FromSameGamma", "Two clusters from same gamma that is a eta daughter (conversion)", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Pi0/hs_Primary", "rec. true pi0", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Pi0/hs_FromWD", "rec. true pi0 from weak decay", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Pi0/hs_FromHS", "rec. true pi0 from hadronic shower in material", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Pi0/hs_FromSameGamma", "Two clusters from same gamma that is a pi0 daughter (conversion)", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Eta/hs_Primary", "rec. true eta", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Eta/hs_FromWD", "rec. true eta from weak decay", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Eta/hs_FromHS", "rec. true eta from hadronic shower in material", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/Eta/hs_FromSameGamma", "Two clusters from same gamma that is a eta daughter (conversion)", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); const o2::framework::AxisSpec axis_rapidity{{0.0, +0.8, +0.9}, "rapidity |y|"}; - fRegistry->add("Generated/Pi0/hPt", "pT;p_{T} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); - fRegistry->add("Generated/Pi0/hPtY", "Generated info", o2::framework::kTH2D, {axis_pt, axis_rapidity}, true); + fRegistry->add("Generated/Pi0/hPt", "pT;p_{T} (GeV/c)", o2::framework::HistType::kTH1D, {axis_pt}, true); + fRegistry->add("Generated/Pi0/hPtY", "Generated info", o2::framework::HistType::kTH2D, {axis_pt, axis_rapidity}, true); fRegistry->addClone("Generated/Pi0/", "Generated/Eta/"); fRegistry->get(HIST("Generated/Pi0/hPt"))->SetXTitle("p_{T} (GeV/c)"); @@ -72,7 +72,7 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is fRegistry->get(HIST("Generated/Eta/hPtY"))->SetXTitle("p_{T} (GeV/c)"); fRegistry->get(HIST("Generated/Eta/hPtY"))->SetYTitle("rapidity |y|"); } else { - fRegistry->add("Pair/same/hs", "diphoton", o2::framework::kTHnSparseD, {axis_mass, axis_pt}, true); + fRegistry->add("Pair/same/hs", "diphoton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); fRegistry->addClone("Pair/same/", "Pair/mix/"); } } From 92043732b9ee0dbf407b8e55936a7a4948ec8af0 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Wed, 15 Apr 2026 10:11:59 +0200 Subject: [PATCH 277/282] [PWGCF] FemtoUniverse: Add ITS PID table in DataModel, fill related PIDNsigmas and QA plots (#15772) Co-authored-by: ALICE Action Bot --- .../Core/FemtoUniverseParticleHisto.h | 40 ++++- .../Core/FemtoUniverseTrackSelection.h | 139 ++++++++++++++++++ PWGCF/FemtoUniverse/DataModel/FemtoDerived.h | 17 +++ .../femtoUniverseProducerTask.cxx | 79 +++++++++- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 48 +++--- 5 files changed, 302 insertions(+), 21 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 508cb8994c4..4b860faae66 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h @@ -70,7 +70,7 @@ class FemtoUniverseParticleHisto // comment template - void init_debug(std::string folderName, T& tempFitVarMomAxis) // o2-linter: disable=name/function-variable + void init_debug(std::string folderName, T& tempFitVarMomAxis, bool isFillITSNsigma) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { @@ -102,6 +102,18 @@ class FemtoUniverseParticleHisto mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{K}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{p}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{d}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + if (isFillITSNsigma) { + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{e}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{K}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{p}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{d}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaCombITSTPC_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITSTPC}^{e}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaCombITSTPC_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITSTPC}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaCombITSTPC_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITSTPC}^{K}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaCombITSTPC_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITSTPC}^{p}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaCombITSTPC_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITSTPC}^{d}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + } } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0) { mHistogramRegistry->add((folderName + folderSuffix + "/hDaughDCA").c_str(), "; DCA^{daugh} (cm); Entries", kTH1F, {{1000, 0, 10}}); mHistogramRegistry->add((folderName + folderSuffix + "/hTransRadius").c_str(), "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); @@ -208,7 +220,7 @@ class FemtoUniverseParticleHisto /// \param tempFitVarBins binning of the tempFitVar (DCA_xy in case of tracks, CPA in case of V0s, etc.) /// \param isMC add Monte Carlo truth histograms to the output file template - void init(HistogramRegistry* registry, T& tempFitVarpTBins, T& tempFitVarBins, bool isMC, int pdgCode, bool isDebug = false, std::optional flexibleFolder = std::nullopt) + void init(HistogramRegistry* registry, T& tempFitVarpTBins, T& tempFitVarBins, bool isMC, int pdgCode, bool isDebug = false, std::optional flexibleFolder = std::nullopt, bool isFillITSNsigma = false) { mPDG = pdgCode; if (registry) { @@ -247,7 +259,7 @@ class FemtoUniverseParticleHisto // Fill here the actual histogramms by calling init_base and init_MC init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); if (isDebug) { - init_debug(folderName, tempFitVarMomAxis); + init_debug(folderName, tempFitVarMomAxis, isFillITSNsigma); } if (isMC) { init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); @@ -512,6 +524,28 @@ class FemtoUniverseParticleHisto } } + template + void fillQAITSPID(T const& part) + { + fillQABaseITSPID(part, HIST(o2::aod::femtouniverseparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType])); + } + + template + void fillQABaseITSPID(T const& part, H const& histFolder) + { + // std::string tempFitVarName; + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaITS_el"), part.p(), part.itsNSigmaEl()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaITS_pi"), part.p(), part.itsNSigmaPi()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaITS_K"), part.p(), part.itsNSigmaKa()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaITS_p"), part.p(), part.itsNSigmaPr()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaITS_d"), part.p(), part.itsNSigmaDe()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaCombITSTPC_el"), part.p(), std::sqrt(part.tpcNSigmaEl() * part.tpcNSigmaEl() + part.itsNSigmaEl() * part.itsNSigmaEl())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaCombITSTPC_pi"), part.p(), std::sqrt(part.tpcNSigmaPi() * part.tpcNSigmaPi() + part.itsNSigmaPi() * part.itsNSigmaPi())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaCombITSTPC_K"), part.p(), std::sqrt(part.tpcNSigmaKa() * part.tpcNSigmaKa() + part.itsNSigmaKa() * part.itsNSigmaKa())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaCombITSTPC_p"), part.p(), std::sqrt(part.tpcNSigmaPr() * part.tpcNSigmaPr() + part.itsNSigmaPr() * part.itsNSigmaPr())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/nSigmaCombITSTPC_d"), part.p(), std::sqrt(part.tpcNSigmaDe() * part.tpcNSigmaDe() + part.itsNSigmaDe() * part.itsNSigmaDe())); + } + /// Templated function to fill particle histograms for data/ Monte Carlo reconstructed and Monte Carlo truth /// Always calls fillQA_base fill histogramms with data/ Monte Carlo reconstructed /// In case of Monte Carlo, calls fillQA_base with Monte Carlo truth info and specialized function fillQA_MC for additional histogramms diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index 3aee759b29b..a7145af2c71 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -23,6 +23,7 @@ #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -135,6 +136,14 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection auto getNsigmaTOF(T const& track, o2::track::PID pid); + /// Computes the n_sigma for a track and a particle-type hypothesis in the TOF + /// \tparam T Data type of the track + /// \param track Track for which PID is evaluated + /// \param pid Particle species for which PID is evaluated + /// \return Value of n_{sigma, TOF} + template + auto getNsigmaITS(T const& track, o2::track::PID pid); + /// Checks whether the most open combination of all selection criteria is fulfilled /// \tparam T Data type of the track /// \param track Track @@ -151,6 +160,18 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection std::array getCutContainer(T const& track); + /// Obtain the bit-wise container for the selections + /// \todo For the moment, PID is separated from the other selections, hence + /// instead of a single value an std::array of size two is returned + /// \tparam CutContainerType Data type of the bit-wise container for the + /// selections + /// \tparam T Data type of the track + /// \param track Track + /// \return The bit-wise container for the selections, separately with all + /// selection criteria, and the PID + template + std::array getCutContainerWithITS(T const& track); + /// Some basic QA histograms /// \tparam part Type of the particle for proper naming of the folders for QA /// \tparam tracktype Type of track (track, positive child, negative child) for proper naming of the folders for QA @@ -329,6 +350,11 @@ void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) mHistogramRegistry->add((folderName + "/hDCAz").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{z} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); mHistogramRegistry->add((folderName + "/hDCA").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA (cm)", kTH2F, {{100, 0, 10}, {301, 0., 1.5}}); mHistogramRegistry->add((folderName + "/hTPCdEdX").c_str(), "; #it{p} (GeV/#it{c}); TPC Signal", kTH2F, {{100, 0, 10}, {1000, 0, 1000}}); + mHistogramRegistry->add((folderName + "/nSigmaITS_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{e}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + "/nSigmaITS_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{#pi}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + "/nSigmaITS_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{K}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + "/nSigmaITS_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{p}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + "/nSigmaITS_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{ITS}^{d}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); mHistogramRegistry->add((folderName + "/nSigmaTPC_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{e}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); mHistogramRegistry->add((folderName + "/nSigmaTPC_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{#pi}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); mHistogramRegistry->add((folderName + "/nSigmaTPC_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{K}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); @@ -394,6 +420,24 @@ auto FemtoUniverseTrackSelection::getNsigmaTOF(T const& track, o2::track::PID pi return o2::aod::pidutils::tofNSigma(pid, track); } +template +auto FemtoUniverseTrackSelection::getNsigmaITS(T const& track, o2::track::PID pid) +{ + if (pid == o2::track::PID::Electron) { + return track.itsNSigmaEl(); + } else if (pid == o2::track::PID::Pion) { + return track.itsNSigmaPi(); + } else if (pid == o2::track::PID::Kaon) { + return track.itsNSigmaKa(); + } else if (pid == o2::track::PID::Proton) { + return track.itsNSigmaPr(); + } else if (pid == o2::track::PID::Deuteron) { + return track.itsNSigmaDe(); + } + // if nothing matched, return default value + return -999.f; +} + template bool FemtoUniverseTrackSelection::isSelectedMinimal(T const& track) { @@ -565,6 +609,101 @@ std::array FemtoUniverseTrackSelection::getCutContainer(T c return {output, outputPID}; } +template +std::array + FemtoUniverseTrackSelection::getCutContainerWithITS(T const& track) +{ + CutContainerType output = 0; + size_t counter = 0; + CutContainerType outputPID = 0; + const auto sign = track.sign(); + const auto pT = track.pt(); + const auto eta = track.eta(); + const auto tpcNClsF = track.tpcNClsFound(); + const auto tpcRClsC = track.tpcCrossedRowsOverFindableCls(); + const auto tpcNClsC = track.tpcNClsCrossedRows(); + const auto tpcNClsS = track.tpcNClsShared(); + const auto tpcNClsFracS = track.tpcFractionSharedCls(); + const auto itsNCls = track.itsNCls(); + const auto itsNClsIB = track.itsNClsInnerBarrel(); + const auto dcaXY = track.dcaXY(); + const auto dcaZ = track.dcaZ(); + const auto dca = std::sqrt(std::pow(dcaXY, 2.) + std::pow(dcaZ, 2.)); + + std::vector pidTPC, pidTOF, pidITS; + for (auto it : kPIDspecies) { + pidTPC.push_back(getNsigmaTPC(track, it)); + pidTOF.push_back(getNsigmaTOF(track, it)); + pidITS.push_back(getNsigmaITS(track, it)); + } + + float observable = 0.; + for (auto& sel : mSelections) { + const auto selVariable = sel.getSelectionVariable(); + if (selVariable == femto_universe_track_selection::kPIDnSigmaMax) { + /// PID needs to be handled a bit differently since we may need more than + /// one species + for (size_t i = 0; i < kPIDspecies.size(); ++i) { + auto pidITSVal = pidITS.at(i); + auto pidTPCVal = pidTPC.at(i) - nSigmaPIDOffsetTPC; + auto pidTOFVal = pidTOF.at(i) - nSigmaPIDOffsetTOF; + auto pidComb = std::sqrt(pidTPCVal * pidTPCVal + pidTOFVal * pidTOFVal); + sel.checkSelectionSetBitPID(pidTPCVal, outputPID); + sel.checkSelectionSetBitPID(pidComb, outputPID); + sel.checkSelectionSetBitPID(pidITSVal, outputPID); + } + } else { + /// for the rest it's all the same + switch (selVariable) { + case (femto_universe_track_selection::kSign): + observable = sign; + break; + case (femto_universe_track_selection::kpTMin): + case (femto_universe_track_selection::kpTMax): + observable = pT; + break; + case (femto_universe_track_selection::kEtaMax): + observable = eta; + break; + case (femto_universe_track_selection::kTPCnClsMin): + observable = tpcNClsF; + break; + case (femto_universe_track_selection::kTPCfClsMin): + observable = tpcRClsC; + break; + case (femto_universe_track_selection::kTPCcRowsMin): + observable = tpcNClsC; + break; + case (femto_universe_track_selection::kTPCsClsMax): + observable = tpcNClsS; + break; + case (femto_universe_track_selection::kTPCfracsClsMax): + observable = tpcNClsFracS; + break; + case (femto_universe_track_selection::kITSnClsMin): + observable = itsNCls; + break; + case (femto_universe_track_selection::kITSnClsIbMin): + observable = itsNClsIB; + break; + case (femto_universe_track_selection::kDCAxyMax): + observable = dcaXY; + break; + case (femto_universe_track_selection::kDCAzMax): + observable = dcaZ; + break; + case (femto_universe_track_selection::kDCAMin): + observable = dca; + break; + case (femto_universe_track_selection::kPIDnSigmaMax): + break; + } + sel.checkSelectionSetBit(observable, output, counter); + } + } + return {output, outputPID}; +} + template void FemtoUniverseTrackSelection::fillQA(T const& track) { diff --git a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h index c9b158ce1b5..8c5614b12ad 100644 --- a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h +++ b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h @@ -123,6 +123,15 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Compute the overall momentum in GeV/c [](float pt, float eta) -> float { return pt * std::cosh(eta); }); + +DECLARE_SOA_COLUMN(ITSNSigmaEl, itsNSigmaEl, float); //! Nsigma separation with the Its detector for electron +DECLARE_SOA_COLUMN(ITSNSigmaPi, itsNSigmaPi, float); //! Nsigma separation with the Its detector for pion +DECLARE_SOA_COLUMN(ITSNSigmaKa, itsNSigmaKa, float); //! Nsigma separation with the Its detector for kaon +DECLARE_SOA_COLUMN(ITSNSigmaPr, itsNSigmaPr, float); //! Nsigma separation with the Its detector for proton +DECLARE_SOA_COLUMN(ITSNSigmaDe, itsNSigmaDe, float); //! Nsigma separation with the Its detector for deuteron +DECLARE_SOA_COLUMN(ITSNSigmaTr, itsNSigmaTr, float); //! Nsigma separation with the Its detector for triton +DECLARE_SOA_COLUMN(ITSNSigmaHe, itsNSigmaHe, float); //! Nsigma separation with the Its detector for helium3 + // debug variables DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the track charge DECLARE_SOA_COLUMN(TpcNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters @@ -222,6 +231,14 @@ DECLARE_SOA_TABLE(FDExtParticles, "AOD", "FDEXTPARTICLE", pidtof_tiny::TOFNSigmaDe); using FDFullParticle = FDExtParticles::iterator; +DECLARE_SOA_TABLE(FDItsParticles, "AOD", "FDITSPARTICLE", + femtouniverseparticle::ITSNSigmaEl, + femtouniverseparticle::ITSNSigmaPi, + femtouniverseparticle::ITSNSigmaKa, + femtouniverseparticle::ITSNSigmaPr, + femtouniverseparticle::ITSNSigmaDe); +using FDItsParticle = FDItsParticles::iterator; + DECLARE_SOA_TABLE(FDCascParticles, "AOD", "FDCASCPARTICLE", o2::soa::Index<>, femtouniverseparticle::FdCollisionId, diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index d73fc6794e5..a49e9c0cdf7 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -39,6 +39,7 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -117,11 +118,13 @@ struct FemtoUniverseProducerTask { Produces outputParts; Produces outputPartsMC; Produces outputDebugParts; + Produces outputDebugITSParts; Produces outputPartsMCLabels; Produces outputDebugPartsMC; Produces outputCascParts; Configurable confIsDebug{"confIsDebug", true, "Enable Debug tables"}; + Configurable confFillITSPid{"confFillITSPid", false, "Fill ITSPid information"}; Configurable confIsUseCutculator{"confIsUseCutculator", true, "Enable cutculator for track cuts"}; // Choose if filtering or skimming version is run // Configurable confIsTrigger{"confIsTrigger", false, "Store all collisions"}; //Commented: not used configurable @@ -201,6 +204,12 @@ struct FemtoUniverseProducerTask { Configurable> confTrkPIDspecies{"confTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID (Pion=2, Kaon=3, Proton=4, Deuteron=5)"}; Configurable confIsOnlyMCTrack{"confIsOnlyMCTrack", false, "Enable filling of only MC Tracks"}; // Numbers from ~/alice/O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h //static constexpr ID Pion = 2; static constexpr ID Kaon = 3; static constexpr ID Proton = 4; static constexpr ID Deuteron = 5; + + Configurable confTrkMinChi2PerClusterTPC{"confTrkMinChi2PerClusterTPC", 0.0, "Lower limit of the Chi2 per TPC Cluster"}; + Configurable confTrkMaxChi2PerClusterTPC{"confTrkMaxChi2PerClusterTPC", 100.0, "Upper limit of the Chi2 per TPC Cluster"}; + Configurable confTrkMaxChi2PerClusterITS{"confTrkMaxChi2PerClusterITS", 100.0, "Upper limit of the Chi2 per ITS Cluster"}; + Configurable confTrkTPCRefit{"confTrkTPCRefit", false, "Enable TPC refit"}; + Configurable confTrkITSRefit{"confTrkITSRefit", false, "Enable ITS refit"}; } ConfTrkSelection; Configurable confTrkPIDnSigmaOffsetTPC{"confTrkPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; @@ -1220,6 +1229,13 @@ struct FemtoUniverseProducerTask { continue; } + if (track.tpcChi2NCl() < ConfTrkSelection.confTrkMinChi2PerClusterTPC || track.tpcChi2NCl() > ConfTrkSelection.confTrkMaxChi2PerClusterTPC) { + continue; + } + if (ConfTrkSelection.confTrkTPCRefit && !track.hasTPC()) { + continue; + } + if (track.pt() > confTOFpTmin) { if (!track.hasTOF()) { continue; @@ -1254,6 +1270,61 @@ struct FemtoUniverseProducerTask { } } + template + void fillTracksITSTPCTOF(TrackType const& tracks) + { + 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 (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)) { + continue; + } + + if (track.tpcChi2NCl() < ConfTrkSelection.confTrkMinChi2PerClusterTPC || track.tpcChi2NCl() > ConfTrkSelection.confTrkMaxChi2PerClusterTPC) { + continue; + } + if (track.itsChi2NCl() > ConfTrkSelection.confTrkMaxChi2PerClusterITS) { + continue; + } + if ((ConfTrkSelection.confTrkTPCRefit && !track.hasTPC()) || (ConfTrkSelection.confTrkITSRefit && !track.hasITS())) { + continue; + } + + if (track.pt() > confTOFpTmin) { + if (!track.hasTOF()) { + continue; + } + } + + trackCuts.fillQA(track); + // the bit-wise container of the systematic variations is obtained + auto cutContainerITS = trackCuts.getCutContainerWithITS(track); + + // now the table is filled + outputParts(outputCollision.lastIndex(), track.pt(), track.eta(), track.phi(), + aod::femtouniverseparticle::ParticleType::kTrack, + cutContainerITS.at( + femto_universe_track_selection::TrackContainerPosition::kCuts), + cutContainerITS.at( + femto_universe_track_selection::TrackContainerPosition::kPID), + track.dcaXY(), childIDs, 0, + track.sign()); // sign getter is mAntiLambda() + + tmpIDtrack.push_back(track.globalIndex()); + fillDebugParticle(track); + outputDebugITSParts(track.itsNSigmaEl(), track.itsNSigmaPi(), + track.itsNSigmaKa(), track.itsNSigmaPr(), + track.itsNSigmaDe()); + if constexpr (isMC) { + fillMCParticle(track, o2::aod::femtouniverseparticle::ParticleType::kTrack); + } + } + } + template void fillV0(CollisionType const& col, V0Type const& fullV0s, TrackType const&) { @@ -2838,11 +2909,17 @@ struct FemtoUniverseProducerTask { getMagneticFieldTesla(bc); const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + auto tracksWithItsPid = soa::Attach, aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe, aod::pidits::ITSNSigmaTr, aod::pidits::ITSNSigmaHe>(tracks); + // fill the tables const auto colcheck = fillCollisionsCentRun3(col); if (colcheck) { fillCollisionsCentRun3ColExtra(col, ir); - fillTracks(tracks); + if (!confFillITSPid) { + fillTracks(tracks); + } else { + fillTracksITSTPCTOF(tracksWithItsPid); + } } } PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index a1891f20ecf..f03ad811289 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -72,7 +72,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { struct : o2::framework::ConfigurableGroup { Configurable confNsigmaCombined{"confNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > confTOFPtMin"}; Configurable confNsigmaTPC{"confNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < confTOFPtMin"}; + Configurable confNsigmaITSTPCCombined{"confNsigmaITSTPCCombined", 3.0f, "ITS and TPC Pion Sigma (combined) for momentum < confTOFPtMin"}; Configurable confIsElReject{"confIsElReject", false, "Is electron rejection activated"}; + Configurable confIsAddITSNsigma{"confIsAddITSNsigma", false, "Is ITS Pions nsigma added"}; Configurable confNsigmaTPCElRejectMin{"confNsigmaTPCElRejectMin", 2.0f, "TPC Electron SigmaMin for momentum < confTOFPtMin"}; Configurable confNsigmaTPCElRejectMax{"confNsigmaTPCElRejectMax", 2.0f, "TPC Electron SigmaMax for momentum < confTOFPtMin"}; Configurable confTOFPtMin{"confTOFPtMin", 0.5f, "Min. Pt for which TOF is required for PID."}; @@ -133,7 +135,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"}; } twotracksconfigs; - using FemtoFullParticles = soa::Join; + using FemtoFullParticles = soa::Join; // Filters for selecting particles (both p1 and p2) Filter trackAdditionalfilter = ((nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax) && (aod::track::dcaXY <= twotracksconfigs.confTrkDCAxyMax) && @@ -145,13 +147,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this optionconfIsCPRkT - using FemtoRecoParticles = soa::Join; + using FemtoRecoParticles = soa::Join; using FilteredFemtoRecoParticles = soa::Filtered; SliceCache cache; Preslice perCol = aod::femtouniverseparticle::fdCollisionId; - using FemtoTruthParticles = soa::Join; + using FemtoTruthParticles = soa::Join; Preslice perColMCTruth = aod::femtouniverseparticle::fdCollisionId; /// Particle 1 @@ -361,7 +363,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } - bool IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCElReject) + bool IsPionNSigma(float mom, float nsigmaITSPi, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCElReject) { //|nsigma_TPC| < 3 for p < 0.5 GeV/c //|nsigma_combined| < 3 for p > 0.5 @@ -378,6 +380,12 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } else { return false; } + } else if (twotracksconfigs.confIsAddITSNsigma) { + if (std::hypot(nsigmaITSPi, nsigmaTPCPi) < twotracksconfigs.confNsigmaITSTPCCombined) { + return true; + } else { + return false; + } } else { if ((std::abs(nsigmaTPCPi) < twotracksconfigs.confNsigmaTPC)) { return true; @@ -396,7 +404,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { return false; } - bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCElReject) + bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaITSPi, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCElReject) { if (particle_number == 1) { switch (trackonefilter.confPDGCodePartOne) { @@ -406,7 +414,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { break; case 211: // Pion+ case -211: // Pion- - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCElReject); + return IsPionNSigma(mom, nsigmaITSPi, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCElReject); break; case 321: // Kaon+ case -321: // Kaon- @@ -424,7 +432,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { break; case 211: // Pion+ case -211: // Pion- - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCElReject); + return IsPionNSigma(mom, nsigmaITSPi, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCElReject); break; case 321: // Kaon+ case -321: // Kaon- @@ -443,9 +451,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { void init(InitContext&) { eventHisto.init(&qaRegistry); - trackHistoPartOne.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, twotracksconfigs.confIsMC, trackonefilter.confPDGCodePartOne, true); + trackHistoPartOne.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, twotracksconfigs.confIsMC, trackonefilter.confPDGCodePartOne, true, std::nullopt, twotracksconfigs.confIsAddITSNsigma); - trackHistoPartTwo.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, twotracksconfigs.confIsMC, tracktwofilter.confPDGCodePartTwo, true); + trackHistoPartTwo.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, twotracksconfigs.confIsMC, tracktwofilter.confPDGCodePartTwo, true, std::nullopt, twotracksconfigs.confIsAddITSNsigma); MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); @@ -535,20 +543,26 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// Histogramming same event if ((contType == PairType::PlusMinus || contType == PairType::PlusPlus) && fillQA) { for (const 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::Electron))) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaITS(part, o2::track::PID::Pion), 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::Electron))) { continue; } trackHistoPartOne.fillQA(part); + if (twotracksconfigs.confIsAddITSNsigma) { + trackHistoPartOne.fillQAITSPID<>(part); + } trackHistoPartOne.fillQAMisIden(part, trackonefilter.confPDGCodePartOne); } } if ((contType == PairType::PlusMinus || contType == PairType::MinusMinus) && fillQA) { for (const 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::Electron))) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaITS(part, o2::track::PID::Pion), 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::Electron))) { continue; } trackHistoPartTwo.fillQA(part); + if (twotracksconfigs.confIsAddITSNsigma) { + trackHistoPartTwo.fillQAITSPID<>(part); + } } } @@ -557,11 +571,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// Now build the combinations for non-identical particle pairs for (const 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::Electron))) { + if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaITS(p1, o2::track::PID::Pion), 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::Electron))) { 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::Electron))) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaITS(p2, o2::track::PID::Pion), 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::Electron))) { continue; } @@ -603,11 +617,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } else { for (const 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::Electron))) { + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaITS(p1, o2::track::PID::Pion), 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::Electron))) { 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::Electron))) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaITS(p2, o2::track::PID::Pion), 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::Electron))) { continue; } @@ -972,11 +986,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { for (const 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::Electron))) { + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaITS(p1, o2::track::PID::Pion), 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::Electron))) { 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::Electron))) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaITS(p2, o2::track::PID::Pion), 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::Electron))) { continue; } From 3b21258ece607f91d3dcbd62372f20776eb9c2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 15 Apr 2026 10:28:04 +0200 Subject: [PATCH 278/282] [PWGJE] Fix includes and using statements (#15722) --- PWGJE/Tasks/jetCorrelationD0.cxx | 20 +++++++++++++------- PWGJE/Tasks/jetFinderQA.cxx | 1 + PWGJE/Tasks/jetLundPlane.cxx | 22 ++++++++++++++-------- PWGJE/Tasks/jetShape.cxx | 25 ++++++++++++++----------- PWGJE/Tasks/jetSpectraEseTask.cxx | 4 ++++ 5 files changed, 46 insertions(+), 26 deletions(-) diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 31b3bfcb944..0196aec6d5b 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -20,14 +20,20 @@ #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -#include #include #include diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 87315fc0819..45110192fa8 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -23,6 +23,7 @@ #include "Common/Core/RecoDecay.h" #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetLundPlane.cxx b/PWGJE/Tasks/jetLundPlane.cxx index eaa2af5b3a6..9839fb19ab6 100644 --- a/PWGJE/Tasks/jetLundPlane.cxx +++ b/PWGJE/Tasks/jetLundPlane.cxx @@ -13,28 +13,34 @@ /// \brief Task for jet Lund plane. Creates histograms for offline unfolding (including QA histos), and optionally tables. /// \author Zoltan Varga -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetFinder.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" #include "Common/Core/RecoDecay.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include +#include #include #include -#include #include +#include +#include #include #include #include diff --git a/PWGJE/Tasks/jetShape.cxx b/PWGJE/Tasks/jetShape.cxx index a5d8e9687a5..887cdad8de5 100644 --- a/PWGJE/Tasks/jetShape.cxx +++ b/PWGJE/Tasks/jetShape.cxx @@ -13,28 +13,31 @@ /// \author Yuto Nishida /// \brief Task for measuring the dependence of the jet shape function rho(r) on the distance r from the jet axis. -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGLF/DataModel/mcCentrality.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index e9e445861e0..0ddc76445c2 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -24,8 +24,10 @@ #include "Common/DataModel/EseTable.h" #include "Common/DataModel/Qvectors.h" +#include #include #include +#include #include #include #include @@ -46,8 +48,10 @@ #include +#include #include #include +#include #include #include #include From 2ffc5cda68bf7b0e4c4a8131a13e77f81ef6d537 Mon Sep 17 00:00:00 2001 From: dyx-11 <1260971129@qq.com> Date: Wed, 15 Apr 2026 17:10:23 +0800 Subject: [PATCH 279/282] [PWGUD] preslice particles (#15776) --- PWGUD/Tasks/flowMcUpc.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PWGUD/Tasks/flowMcUpc.cxx b/PWGUD/Tasks/flowMcUpc.cxx index a927c075658..a068b297d9f 100644 --- a/PWGUD/Tasks/flowMcUpc.cxx +++ b/PWGUD/Tasks/flowMcUpc.cxx @@ -109,6 +109,8 @@ struct FlowMcUpc { return true; } + PresliceUnsorted partPerMcCollision = aod::udmcparticle::udMcCollisionId; + void processMCTrue(aod::UDMcCollisions::iterator const& mcCollision, McParts const& mcParts, aod::BCs const& bcs) { if (bcs.size() == 0) { @@ -122,7 +124,9 @@ struct FlowMcUpc { // event within range histos.fill(HIST("hImpactParameter"), imp); - for (auto const& mcParticle : mcParts) { + auto const& tempParts = mcParts.sliceBy(partPerMcCollision, static_cast(mcCollision.globalIndex())); + + for (auto const& mcParticle : tempParts) { auto momentum = std::array{mcParticle.px(), mcParticle.py(), mcParticle.pz()}; int pdgCode = std::abs(mcParticle.pdgCode()); @@ -147,6 +151,9 @@ struct FlowMcUpc { using MCRecoTracks = soa::Join; using MCRecoCollisions = soa::Join; + // PresliceUnsorted trackPerMcParticle = aod::udmctracklabel::udMcParticleId; + Preslice trackPerCollision = aod::udtrack::udCollisionId; // sorted preslice used because the pair track-collision is already sorted in processDataSG function + void processReco(MCRecoCollisions::iterator const& collision, MCRecoTracks const& tracks) { histos.fill(HIST("RecoProcessEventCounter"), 0.5); @@ -162,7 +169,9 @@ struct FlowMcUpc { float vtxz = collision.posZ(); - for (const auto& track : tracks) { + auto const& tempTracks = tracks.sliceBy(trackPerCollision, static_cast(collision.globalIndex())); + + for (const auto& track : tempTracks) { // focus on bulk: e, mu, pi, k, p auto momentum = std::array{track.px(), track.py(), track.pz()}; double pt = RecoDecay::pt(momentum); From c5d6e87d4d165b2012c1bec972af654737897093 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:38:16 +0200 Subject: [PATCH 280/282] [PWGUD] clean unused code and fix wrong usage (#15759) Co-authored-by: ALICE Action Bot --- PWGUD/Tasks/flowCumulantsUpc.cxx | 660 +++++++++---------------------- 1 file changed, 182 insertions(+), 478 deletions(-) diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index 7d831eb2bf8..726ef6ca87e 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -10,16 +10,15 @@ // or submit itself to any jurisdiction. /// \file flowCumulantsUpc.cxx -/// \author Yongxi Du (yongxi.du@cern.ch), Mingrui Zhao (mingrui.zhao@mail.labz0.org, mingrui.zhao@cern.ch) +/// \author Yongxi Du (yongxi.du@cern.ch), Mingrui Zhao (mingrui.zhao@mail.labz0.org, mingrui.zhao@cern.ch), Zhiyong Lu (zhiyong.lu@cern.ch) /// \since Mar/2025 -/// \brief jira: , task to measure flow observables with cumulant method +/// \brief jira: PWGUD-45, task to measure flow observables with cumulant method -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/UDTables.h" -// #include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" #include "PWGCF/GenericFramework/Core/GFWWeights.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/DataModel/UDTables.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" @@ -59,9 +58,11 @@ #include #include #include +#include #include #include #include +#include #include using namespace o2; @@ -74,62 +75,35 @@ struct FlowCumulantsUpc { O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") O2_DEFINE_CONFIGURABLE(cfgIfVertex, bool, false, "choose vertex or not") - O2_DEFINE_CONFIGURABLE(cfgCentEstimator, int, 0, "0:FT0C; 1:FT0CVariant1; 2:FT0M; 3:FT0A") - O2_DEFINE_CONFIGURABLE(cfgCentFT0CMin, float, 0.0f, "Minimum centrality (FT0C) to cut events in filter") - O2_DEFINE_CONFIGURABLE(cfgCentFT0CMax, float, 100.0f, "Maximum centrality (FT0C) to cut events in filter") O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.1f, "Minimal pT for poi tracks") O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks") O2_DEFINE_CONFIGURABLE(cfgCutPtRefMin, float, 0.1f, "Minimal pT for ref tracks") O2_DEFINE_CONFIGURABLE(cfgCutPtRefMax, float, 3.0f, "Maximal pT for ref tracks") - O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.1f, "Minimal pT for all tracks") - O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 10.0f, "Maximal pT for all tracks") - O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") - O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5f, "max chi2 per TPC clusters") - O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 70.0f, "minimum TPC clusters") - O2_DEFINE_CONFIGURABLE(cfgCutITSclu, float, 5.0f, "minimum ITS clusters") - O2_DEFINE_CONFIGURABLE(cfgCutDCAz, float, 2.0f, "max DCA to vertex z") - O2_DEFINE_CONFIGURABLE(cfgCutDCAxyppPass3Enabled, bool, false, "switch of ppPass3 DCAxy pt dependent cut") - // O2_DEFINE_CONFIGURABLE(cfgCutDCAzPtDepEnabled, bool, false, "switch of DCAz pt dependent cut") - // O2_DEFINE_CONFIGURABLE(cfgTrkSelSwitch, bool, false, "switch for self-defined track selection") - // O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") - // O2_DEFINE_CONFIGURABLE(cfgUseTentativeEventCounter, bool, false, "After sel8(), count events regardless of real event selection") - // O2_DEFINE_CONFIGURABLE(cfgEvSelkNoSameBunchPileup, bool, false, "rejects collisions which are associated with the same found-by-T0 bunch crossing") - // O2_DEFINE_CONFIGURABLE(cfgEvSelkIsGoodZvtxFT0vsPV, bool, false, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference, use this cut at low multiplicities with caution") - // O2_DEFINE_CONFIGURABLE(cfgEvSelkNoCollInTimeRangeStandard, bool, false, "no collisions in specified time range") - // O2_DEFINE_CONFIGURABLE(cfgEvSelkIsGoodITSLayersAll, bool, true, "cut time intervals with dead ITS staves") - // O2_DEFINE_CONFIGURABLE(cfgEvSelkNoCollInRofStandard, bool, false, "no other collisions in this Readout Frame with per-collision multiplicity above threshold") - // O2_DEFINE_CONFIGURABLE(cfgEvSelkNoHighMultCollInPrevRof, bool, false, "veto an event if FT0C amplitude in previous ITS ROF is above threshold") - // O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut") - // O2_DEFINE_CONFIGURABLE(cfgEvSelV0AT0ACut, bool, true, "V0A T0A 5 sigma cut") - // O2_DEFINE_CONFIGURABLE(cfgGetInteractionRate, bool, false, "Get interaction rate from CCDB") - // O2_DEFINE_CONFIGURABLE(cfgUseInteractionRateCut, bool, false, "Use events with low interaction rate") - // O2_DEFINE_CONFIGURABLE(cfgCutMaxIR, float, 50.0f, "maximum interaction rate (kHz)") - // O2_DEFINE_CONFIGURABLE(cfgCutMinIR, float, 0.0f, "minimum interaction rate (kHz)") - O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") + O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "max Eta range for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutTPCCrossedRows, float, 70.0f, "minimum number of crossed TPC Rows") + O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 50.0f, "minimum number of found TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgCutITSclu, float, 5.0f, "minimum number of ITS clusters") + O2_DEFINE_CONFIGURABLE(cfgCutTPCChi2NCl, int, 4, "max chi2 per TPC clusters") O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 30, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, false, "Fill and output NUA weights") O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRefPt, bool, false, "NUA weights are filled in ref pt bins") + O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRunbyRun, bool, false, "NUA weights are filled run-by-run") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") - O2_DEFINE_CONFIGURABLE(cfgAcceptanceList, std::string, "", "CCDB path to acceptance lsit object") - O2_DEFINE_CONFIGURABLE(cfgAcceptanceListEnabled, bool, false, "switch of acceptance list") - O2_DEFINE_CONFIGURABLE(cfgEvSelOccupancy, bool, true, "Occupancy cut") + O2_DEFINE_CONFIGURABLE(cfgEvSelOccupancy, bool, false, "Occupancy cut") O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 1000, "High cut on TPC occupancy") O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy") - O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode") - O2_DEFINE_CONFIGURABLE(cfgIsGoodItsLayers, bool, false, "whether choose itslayers") - O2_DEFINE_CONFIGURABLE(cfgGapSideA, bool, true, "choose gapside A") - O2_DEFINE_CONFIGURABLE(cfgGapSideC, bool, false, "choose gapside C") + O2_DEFINE_CONFIGURABLE(cfgGapSideA, bool, true, "only pass gapside A, otherwise pass A+C") + O2_DEFINE_CONFIGURABLE(cfgGapSideC, bool, false, "only pass gapside C, otherwise pass A+C") + O2_DEFINE_CONFIGURABLE(cfgGlobalTrack, bool, true, "require TPC+ITS track") + O2_DEFINE_CONFIGURABLE(cfgUseNchCorrected, bool, true, "use corrected Nch for X axis") O2_DEFINE_CONFIGURABLE(cfgDcaxy, bool, true, "choose dcaxy") O2_DEFINE_CONFIGURABLE(cfgDcaz, bool, false, "choose dcaz") O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut") - O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size") - O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2") O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 0, "Flag to select consistent events - 0: off, 1: v2{2} gap calculable, 2: v2{4} full calculable, 4: v2{4} gap calculable, 8: v2{4} 3sub calculable") Configurable> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"}; Configurable> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"}; - Configurable> cfgRunRemoveList{"cfgRunRemoveList", std::vector{-1}, "excluded run numbers"}; Configurable> cfgConsistentEventVector{"cfgConsistentEventVector", std::vector{-0.8, -0.5, -0.4, 0.4, 0.5, 0.8}, "eta regions: left(min,max), mid(min,max), right(min,max)"}; struct AcceptedTracks { int nNeg; @@ -140,8 +114,8 @@ struct FlowCumulantsUpc { ConfigurableAxis axisPtHist{"axisPtHist", {100, 0., 10.}, "pt axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, "pt axis for histograms"}; - ConfigurableAxis axisIndependent{"axisIndependent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "X axis for histograms"}; - ConfigurableAxis axisNch{"axisNch", {4000, 0, 4000}, "N_{ch}"}; + ConfigurableAxis axisIndependent{"axisIndependent", {VARIABLE_WIDTH, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}, "X axis for histograms"}; + ConfigurableAxis axisNch{"axisNch", {300, 0, 300}, "N_{ch}"}; ConfigurableAxis axisDCAz{"axisDCAz", {200, -2, 2}, "DCA_{z} (cm)"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -1, 1}, "DCA_{xy} (cm)"}; @@ -155,12 +129,10 @@ struct FlowCumulantsUpc { // Corrections TH1D* mEfficiency = nullptr; GFWWeights* mAcceptance = nullptr; - TObjArray* mAcceptanceList = nullptr; bool correctionsLoaded = false; // Connect to ccdb Service 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 ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Define output @@ -178,118 +150,49 @@ struct FlowCumulantsUpc { TAxis* fPtAxis; TRandom3* fRndm = new TRandom3(0); TRandom3* fRndmMc = new TRandom3(0); - enum CentEstimators { - kCentFT0C = 0, - kCentFT0CVariant1, - kCentFT0M, - kCentFV0A, - // Count the total number of enum - kCount_CentEstimators - }; - int mRunNumber{-1}; - uint64_t mSOR{0}; - double mMinSeconds{-1.}; - std::unordered_map gHadronicRate; - ctpRateFetcher mRateFetcher; - TH2* gCurrentHadronicRate; + int lastRunNumber = -1; + std::vector runNumbers; + std::map> th3sPerRun; // map of TH3 histograms for all runs - // using UdTracks = soa::Join; using UdTracksFull = soa::Join; using UDCollisionsFull = soa::Join; - // Track selection - TrackSelection myTrackSel; - TF1* fPhiCutLow = nullptr; - TF1* fPhiCutHigh = nullptr; - // Additional Event selection cuts - Copy from flowGenericFramework.cxx - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultMultPVCut = nullptr; - TF1* fT0AV0AMean = nullptr; - TF1* fT0AV0ASigma = nullptr; - void init(InitContext const&) { const AxisSpec axisVertex{40, -20, 20, "Vtxz (cm)"}; const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"}; const AxisSpec axisEta{40, -1., 1., "#eta"}; - const AxisSpec axisCentForQA{100, 0, 100, "centrality (%)"}; - const AxisSpec axisT0C{70, 0, 70000, "N_{ch} (T0C)"}; - const AxisSpec axisT0A{200, 0, 200000, "N_{ch} (T0A)"}; ccdb->setURL(ccdbUrl.value); ccdb->setCaching(true); - ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + auto now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); // Add some output objects to the histogram registry // Event QA registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{6, 0, 6}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after gapside selection"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after its selection"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after pt selection"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after occupancy"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after vertex selection"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after occupancy"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after loadcorrection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(6, "after consistency check"); - registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{7, 0, 7}}}); - registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(1, "after event selection"); - registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(2, "PVContributor"); - registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(3, "dcaz"); - registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(4, "dcaxy"); - registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(5, "its clusters"); - registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(6, "tpc chi2"); - registry.add("hEventCountSpecific", "Number of Event;; Count", {HistType::kTH1D, {{10, 0, 10}}}); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(1, "after sel8"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(2, "kNoSameBunchPileup"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(3, "kIsGoodZvtxFT0vsPV"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(4, "kNoCollInTimeRangeStandard"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(5, "kIsGoodITSLayersAll"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(6, "kNoCollInRofStandard"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(7, "kNoHighMultCollInPrevRof"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(8, "occupancy"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(9, "MultCorrelation"); - registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(10, "cfgEvSelV0AT0ACut"); - // if (cfgUseTentativeEventCounter) { - // registry.add("hEventCountTentative", "Number of Event;; Count", {HistType::kTH1D, {{10, 0, 10}}}); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(1, "after sel8"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(2, "kNoSameBunchPileup"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(3, "kIsGoodZvtxFT0vsPV"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(4, "kNoCollInTimeRangeStandard"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(5, "kIsGoodITSLayersAll"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(6, "kNoCollInRofStandard"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(7, "kNoHighMultCollInPrevRof"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(8, "occupancy"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(9, "MultCorrelation"); - // registry.get(HIST("hEventCountTentative"))->GetXaxis()->SetBinLabel(10, "cfgEvSelV0AT0ACut"); - // } + registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{9, 0, 9}}}); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(1, "default UD tracks"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(2, "after PVContributor"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(3, "after ITS+TPC"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(4, "after TPC CrossRow"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(5, "after TPC Clu"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(6, "after TPC chi2"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(7, "after ITS Clu"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(8, "after DCAz"); + registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(9, "after DCAxy"); registry.add("hVtxZ", "Vexter Z distribution", {HistType::kTH1D, {axisVertex}}); + registry.add("hMultWoSel", "Multiplicity distribution", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); registry.add("hMult", "Multiplicity distribution", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); - std::string hCentTitle = "Centrality distribution, Estimator " + std::to_string(cfgCentEstimator); - registry.add("hCent", hCentTitle.c_str(), {HistType::kTH1D, {{90, 0, 90}}}); - if (!cfgUseSmallMemory) { - registry.add("BeforeSel8_globalTracks_centT0C", "before sel8;Centrality T0C;mulplicity global tracks", {HistType::kTH2D, {axisCentForQA, axisNch}}); - registry.add("BeforeCut_globalTracks_centT0C", "before cut;Centrality T0C;mulplicity global tracks", {HistType::kTH2D, {axisCentForQA, axisNch}}); - registry.add("BeforeCut_PVTracks_centT0C", "before cut;Centrality T0C;mulplicity PV tracks", {HistType::kTH2D, {axisCentForQA, axisNch}}); - registry.add("BeforeCut_globalTracks_PVTracks", "before cut;mulplicity PV tracks;mulplicity global tracks", {HistType::kTH2D, {axisNch, axisNch}}); - registry.add("BeforeCut_globalTracks_multT0A", "before cut;mulplicity T0A;mulplicity global tracks", {HistType::kTH2D, {axisT0A, axisNch}}); - registry.add("BeforeCut_globalTracks_multV0A", "before cut;mulplicity V0A;mulplicity global tracks", {HistType::kTH2D, {axisT0A, axisNch}}); - registry.add("BeforeCut_multV0A_multT0A", "before cut;mulplicity T0A;mulplicity V0A", {HistType::kTH2D, {axisT0A, axisT0A}}); - registry.add("BeforeCut_multT0C_centT0C", "before cut;Centrality T0C;mulplicity T0C", {HistType::kTH2D, {axisCentForQA, axisT0C}}); - registry.add("globalTracks_centT0C", "after cut;Centrality T0C;mulplicity global tracks", {HistType::kTH2D, {axisCentForQA, axisNch}}); - registry.add("PVTracks_centT0C", "after cut;Centrality T0C;mulplicity PV tracks", {HistType::kTH2D, {axisCentForQA, axisNch}}); - registry.add("globalTracks_PVTracks", "after cut;mulplicity PV tracks;mulplicity global tracks", {HistType::kTH2D, {axisNch, axisNch}}); - registry.add("globalTracks_multT0A", "after cut;mulplicity T0A;mulplicity global tracks", {HistType::kTH2D, {axisT0A, axisNch}}); - registry.add("globalTracks_multV0A", "after cut;mulplicity V0A;mulplicity global tracks", {HistType::kTH2D, {axisT0A, axisNch}}); - registry.add("multV0A_multT0A", "after cut;mulplicity T0A;mulplicity V0A", {HistType::kTH2D, {axisT0A, axisT0A}}); - registry.add("multT0C_centT0C", "after cut;Centrality T0C;mulplicity T0C", {HistType::kTH2D, {axisCentForQA, axisT0C}}); - registry.add("centFT0CVar_centFT0C", "after cut;Centrality T0C;Centrality T0C Var", {HistType::kTH2D, {axisCentForQA, axisCentForQA}}); - registry.add("centFT0M_centFT0C", "after cut;Centrality T0C;Centrality T0M", {HistType::kTH2D, {axisCentForQA, axisCentForQA}}); - registry.add("centFV0A_centFT0C", "after cut;Centrality T0C;Centrality V0A", {HistType::kTH2D, {axisCentForQA, axisCentForQA}}); - } - // Track QA + // Reco Track QA registry.add("hPhi", "#phi distribution", {HistType::kTH1D, {axisPhi}}); registry.add("hPhiWeighted", "corrected #phi distribution", {HistType::kTH1D, {axisPhi}}); registry.add("hEta", "#eta distribution", {HistType::kTH1D, {axisEta}}); @@ -303,28 +206,21 @@ struct FlowCumulantsUpc { registry.add("hDCAz", "DCAz after cuts; DCAz (cm); Pt", {HistType::kTH2D, {{200, -0.5, 0.5}, {200, 0, 5}}}); registry.add("hDCAxy", "DCAxy after cuts; DCAxy (cm); Pt", {HistType::kTH2D, {{200, -0.5, 0.5}, {200, 0, 5}}}); registry.add("hTrackCorrection2d", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisNch, axisNch}}); - registry.add("hEtaNch2D", "Eta vs Nch; #eta; Nch", {HistType::kTH2D, {axisEta, axisNch}}); - + // Mc track QA registry.add("hPhiMC", "#phi distribution", {HistType::kTH1D, {axisPhi}}); registry.add("hPhiWeightedMC", "corrected #phi distribution", {HistType::kTH1D, {axisPhi}}); registry.add("hEtaMC", "#eta distribution", {HistType::kTH1D, {axisEta}}); registry.add("hPtMC", "p_{T} distribution before cut", {HistType::kTH1D, {axisPtHist}}); registry.add("hPtRefMC", "p_{T} distribution after cut", {HistType::kTH1D, {axisPtHist}}); - registry.add("hChi2prTPCclsMC", "#chi^{2}/cluster for the TPC track segment", {HistType::kTH1D, {{100, 0., 5.}}}); - registry.add("hChi2prITSclsMC", "#chi^{2}/cluster for the ITS track", {HistType::kTH1D, {{100, 0., 50.}}}); - registry.add("hnTPCCluMC", "Number of found TPC clusters", {HistType::kTH1D, {{100, 40, 180}}}); - registry.add("hnITSCluMC", "Number of found ITS clusters", {HistType::kTH1D, {{100, 0, 20}}}); - registry.add("hnTPCCrossedRowMC", "Number of crossed TPC Rows", {HistType::kTH1D, {{100, 40, 180}}}); - registry.add("hDCAzMC", "DCAz after cuts; DCAz (cm); Pt", {HistType::kTH2D, {{200, -0.5, 0.5}, {200, 0, 5}}}); - registry.add("hDCAxyMC", "DCAxy after cuts; DCAxy (cm); Pt", {HistType::kTH2D, {{200, -0.5, 0.5}, {200, 0, 5}}}); registry.add("hTrackCorrection2dMC", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisNch, axisNch}}); // // MC event QA histograms - // registry.add("eventCounterMC", "Number of MC Events;; Count", {HistType::kTH1D, {{5, 0, 5}}}); - // registry.add("hVtxZMC", "Vexter Z distribution (MC)", {HistType::kTH1D, {axisVertex}}); - // registry.add("hMultMC", "Multiplicity distribution (MC)", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); - // registry.add("hCentMC", "Centrality distribution (MC)", {HistType::kTH1D, {{90, 0, 90}}}); - // registry.add("numberOfTracksMC", "Number of MC tracks;; Count", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + if (doprocessSim) { + registry.add("eventCounterMC", "Number of MC Events;; Count", {HistType::kTH1D, {{5, 0, 5}}}); + registry.add("hVtxZMC", "Vexter Z distribution (MC)", {HistType::kTH1D, {axisVertex}}); + registry.add("hMultMC", "Multiplicity distribution (MC)", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + registry.add("numberOfTracksMC", "Number of MC tracks;; Count", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + } o2::framework::AxisSpec axis = axisPt; int nPtBins = axis.binEdges.size() - 1; @@ -404,60 +300,62 @@ struct FlowCumulantsUpc { delete oba; // eta region - fGFW->AddRegion("full", -0.9, 0.9, 1, 1); - fGFW->AddRegion("refN00", -0.9, 0., 1, 1); // gap0 negative region - fGFW->AddRegion("refP00", 0., 0.9, 1, 1); // gap0 positve region - fGFW->AddRegion("refN02", -0.9, -0.1, 1, 1); // gap2 negative region - fGFW->AddRegion("refP02", 0.1, 0.9, 1, 1); // gap2 positve region - fGFW->AddRegion("refN04", -0.9, -0.2, 1, 1); // gap4 negative region - fGFW->AddRegion("refP04", 0.2, 0.9, 1, 1); // gap4 positve region - fGFW->AddRegion("refN06", -0.9, -0.3, 1, 1); // gap6 negative region - fGFW->AddRegion("refP06", 0.3, 0.9, 1, 1); // gap6 positve region - fGFW->AddRegion("refN08", -0.9, -0.4, 1, 1); - fGFW->AddRegion("refP08", 0.4, 0.9, 1, 1); - fGFW->AddRegion("refN10", -0.9, -0.5, 1, 1); - fGFW->AddRegion("refP10", 0.5, 0.9, 1, 1); - fGFW->AddRegion("refN12", -0.9, -0.6, 1, 1); - fGFW->AddRegion("refP12", 0.6, 0.9, 1, 1); - fGFW->AddRegion("refN14", -0.9, -0.7, 1, 1); - fGFW->AddRegion("refP14", 0.7, 0.9, 1, 1); - fGFW->AddRegion("refN", -0.9, -0.4, 1, 1); - fGFW->AddRegion("refP", 0.4, 0.9, 1, 1); + float maxEta = std::fabs(cfgCutEta); + float minEta = -1. * maxEta; + fGFW->AddRegion("full", minEta, maxEta, 1, 1); + fGFW->AddRegion("refN00", minEta, 0., 1, 1); // gap0 negative region + fGFW->AddRegion("refP00", 0., maxEta, 1, 1); // gap0 positve region + fGFW->AddRegion("refN02", minEta, -0.1, 1, 1); // gap2 negative region + fGFW->AddRegion("refP02", 0.1, maxEta, 1, 1); // gap2 positve region + fGFW->AddRegion("refN04", minEta, -0.2, 1, 1); // gap4 negative region + fGFW->AddRegion("refP04", 0.2, maxEta, 1, 1); // gap4 positve region + fGFW->AddRegion("refN06", minEta, -0.3, 1, 1); // gap6 negative region + fGFW->AddRegion("refP06", 0.3, maxEta, 1, 1); // gap6 positve region + fGFW->AddRegion("refN08", minEta, -0.4, 1, 1); + fGFW->AddRegion("refP08", 0.4, maxEta, 1, 1); + fGFW->AddRegion("refN10", minEta, -0.5, 1, 1); + fGFW->AddRegion("refP10", 0.5, maxEta, 1, 1); + fGFW->AddRegion("refN12", minEta, -0.6, 1, 1); + fGFW->AddRegion("refP12", 0.6, maxEta, 1, 1); + fGFW->AddRegion("refN14", minEta, -0.7, 1, 1); + fGFW->AddRegion("refP14", 0.7, maxEta, 1, 1); + fGFW->AddRegion("refN", minEta, -0.4, 1, 1); + fGFW->AddRegion("refP", 0.4, maxEta, 1, 1); fGFW->AddRegion("refM", -0.4, 0.4, 1, 1); - fGFW->AddRegion("poiN", -0.9, -0.4, 1 + fPtAxis->GetNbins(), 2); - fGFW->AddRegion("poiN10", -0.9, -0.5, 1 + fPtAxis->GetNbins(), 2); - fGFW->AddRegion("poifull", -0.9, 0.9, 1 + fPtAxis->GetNbins(), 2); - fGFW->AddRegion("olN", -0.9, -0.4, 1 + fPtAxis->GetNbins(), 4); - fGFW->AddRegion("olN10", -0.9, -0.5, 1 + fPtAxis->GetNbins(), 4); - fGFW->AddRegion("olfull", -0.9, 0.9, 1 + fPtAxis->GetNbins(), 4); + fGFW->AddRegion("poiN", minEta, -0.4, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("poiN10", minEta, -0.5, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("poifull", minEta, maxEta, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("olN", minEta, -0.4, 1 + fPtAxis->GetNbins(), 4); + fGFW->AddRegion("olN10", minEta, -0.5, 1 + fPtAxis->GetNbins(), 4); + fGFW->AddRegion("olfull", minEta, maxEta, 1 + fPtAxis->GetNbins(), 4); // eta region for MC, can be different from data to study the effect of acceptance - fGFWMC->AddRegion("full", -0.8, 0.8, 1, 1); - fGFWMC->AddRegion("refN00", -0.8, 0., 1, 1); // gap0 negative region - fGFWMC->AddRegion("refP00", 0., 0.8, 1, 1); // gap0 positve region - fGFWMC->AddRegion("refN02", -0.8, -0.1, 1, 1); // gap2 negative region - fGFWMC->AddRegion("refP02", 0.1, 0.8, 1, 1); // gap2 positve region - fGFWMC->AddRegion("refN04", -0.8, -0.2, 1, 1); // gap4 negative region - fGFWMC->AddRegion("refP04", 0.2, 0.8, 1, 1); // gap4 positve region - fGFWMC->AddRegion("refN06", -0.8, -0.3, 1, 1); // gap6 negative region - fGFWMC->AddRegion("refP06", 0.3, 0.8, 1, 1); // gap6 positve region - fGFWMC->AddRegion("refN08", -0.8, -0.4, 1, 1); - fGFWMC->AddRegion("refP08", 0.4, 0.8, 1, 1); - fGFWMC->AddRegion("refN10", -0.8, -0.5, 1, 1); - fGFWMC->AddRegion("refP10", 0.5, 0.8, 1, 1); - fGFWMC->AddRegion("refN12", -0.8, -0.6, 1, 1); - fGFWMC->AddRegion("refP12", 0.6, 0.8, 1, 1); - fGFWMC->AddRegion("refN14", -0.8, -0.7, 1, 1); - fGFWMC->AddRegion("refP14", 0.7, 0.8, 1, 1); - fGFWMC->AddRegion("refN", -0.8, -0.4, 1, 1); - fGFWMC->AddRegion("refP", 0.4, 0.8, 1, 1); + fGFWMC->AddRegion("full", minEta, maxEta, 1, 1); + fGFWMC->AddRegion("refN00", minEta, 0., 1, 1); // gap0 negative region + fGFWMC->AddRegion("refP00", 0., maxEta, 1, 1); // gap0 positve region + fGFWMC->AddRegion("refN02", minEta, -0.1, 1, 1); // gap2 negative region + fGFWMC->AddRegion("refP02", 0.1, maxEta, 1, 1); // gap2 positve region + fGFWMC->AddRegion("refN04", minEta, -0.2, 1, 1); // gap4 negative region + fGFWMC->AddRegion("refP04", 0.2, maxEta, 1, 1); // gap4 positve region + fGFWMC->AddRegion("refN06", minEta, -0.3, 1, 1); // gap6 negative region + fGFWMC->AddRegion("refP06", 0.3, maxEta, 1, 1); // gap6 positve region + fGFWMC->AddRegion("refN08", minEta, -0.4, 1, 1); + fGFWMC->AddRegion("refP08", 0.4, maxEta, 1, 1); + fGFWMC->AddRegion("refN10", minEta, -0.5, 1, 1); + fGFWMC->AddRegion("refP10", 0.5, maxEta, 1, 1); + fGFWMC->AddRegion("refN12", minEta, -0.6, 1, 1); + fGFWMC->AddRegion("refP12", 0.6, maxEta, 1, 1); + fGFWMC->AddRegion("refN14", minEta, -0.7, 1, 1); + fGFWMC->AddRegion("refP14", 0.7, maxEta, 1, 1); + fGFWMC->AddRegion("refN", minEta, -0.4, 1, 1); + fGFWMC->AddRegion("refP", 0.4, maxEta, 1, 1); fGFWMC->AddRegion("refM", -0.4, 0.4, 1, 1); - fGFWMC->AddRegion("poiN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); - fGFWMC->AddRegion("poiN10", -0.8, -0.5, 1 + fPtAxis->GetNbins(), 2); - fGFWMC->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2); - fGFWMC->AddRegion("olN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 4); - fGFWMC->AddRegion("olN10", -0.8, -0.5, 1 + fPtAxis->GetNbins(), 4); - fGFWMC->AddRegion("olfull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 4); + fGFWMC->AddRegion("poiN", minEta, -0.4, 1 + fPtAxis->GetNbins(), 2); + fGFWMC->AddRegion("poiN10", minEta, -0.5, 1 + fPtAxis->GetNbins(), 2); + fGFWMC->AddRegion("poifull", minEta, maxEta, 1 + fPtAxis->GetNbins(), 2); + fGFWMC->AddRegion("olN", minEta, -0.4, 1 + fPtAxis->GetNbins(), 4); + fGFWMC->AddRegion("olN10", minEta, -0.5, 1 + fPtAxis->GetNbins(), 4); + fGFWMC->AddRegion("olfull", minEta, maxEta, 1 + fPtAxis->GetNbins(), 4); corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {3 -3}", "ChFull32", kFALSE)); @@ -541,6 +439,10 @@ struct FlowCumulantsUpc { corrconfigsmc.push_back(fGFWMC->GetCorrelatorConfig("refN10 {4 2} refP10 {-4 -2}", "Ch10Gap4242", kFALSE)); corrconfigsmc.push_back(fGFWMC->GetCorrelatorConfig("refN10 {2 2} refP10 {-2 -2}", "Ch10Gap24", kFALSE)); corrconfigsmc.push_back(fGFWMC->GetCorrelatorConfig("poiN10 refN10 | olN10 {2 2} refP10 {-2 -2}", "Ch10Gap24", kTRUE)); + LOGF(info, "Embedded GFW CorrelatorConfig:"); + for (auto icorr = 0; icorr < static_cast(corrconfigs.size()); icorr++) { + LOGF(info, "corrconfigs.at(%d): %s", icorr, corrconfigs.at(icorr).Head.c_str()); + } if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { LOGF(info, "User adding GFW CorrelatorConfig:"); // attentaion: here we follow the index of cfgUserDefineGFWCorr @@ -549,52 +451,23 @@ struct FlowCumulantsUpc { LOGF(fatal, "The names you provided are more than configurations. userDefineGFWName.size(): %d > userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); break; } - LOGF(info, "%d: %s %s", i, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); - corrconfigs.push_back(fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kFALSE)); + if (userDefineGFWCorr.at(i).find("poi") != std::string::npos) { + corrconfigs.push_back(fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kTRUE)); + LOGF(info, "corrconfigs.at(%d): enable pt-Diff for %s %s", corrconfigs.size() - 1, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + } else { + corrconfigs.push_back(fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kFALSE)); + LOGF(info, "corrconfigs.at(%d): %s %s", corrconfigs.size() - 1, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + } } } fGFW->CreateRegions(); - - // 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); - // fMultPVCutLow->SetParameters(3257.29, -121.848, 1.98492, -0.0172128, 6.47528e-05, 154.756, -1.86072, -0.0274713, 0.000633499, -3.37757e-06); - // fMultPVCutHigh = new TF1("fMultPVCutHigh", "[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); - // fMultPVCutHigh->SetParameters(3257.29, -121.848, 1.98492, -0.0172128, 6.47528e-05, 154.756, -1.86072, -0.0274713, 0.000633499, -3.37757e-06); - - // fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - // fMultCutLow->SetParameters(1654.46, -47.2379, 0.449833, -0.0014125, 150.773, -3.67334, 0.0530503, -0.000614061, 3.15956e-06); - // fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 3.*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - // fMultCutHigh->SetParameters(1654.46, -47.2379, 0.449833, -0.0014125, 150.773, -3.67334, 0.0530503, -0.000614061, 3.15956e-06); - - // fT0AV0AMean = new TF1("fT0AV0AMean", "[0]+[1]*x", 0, 200000); - // fT0AV0AMean->SetParameters(-1601.0581, 9.417652e-01); - // fT0AV0ASigma = new TF1("fT0AV0ASigma", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 200000); - // fT0AV0ASigma->SetParameters(463.4144, 6.796509e-02, -9.097136e-07, 7.971088e-12, -2.600581e-17); - // } - - myTrackSel = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default); - myTrackSel.SetMinNClustersTPC(cfgCutTPCclu); - myTrackSel.SetMinNClustersITS(cfgCutITSclu); - if (cfgCutDCAxyppPass3Enabled) - myTrackSel.SetMaxDcaXYPtDep([](float pt) { return 0.004f + 0.013f / pt; }); // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution } - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + void createOutputObjectsForRun(int runNumber) { - double dnx, val; - dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); - if (dnx == 0) { - return; - } - if (!corrconf.pTDif) { - val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (std::fabs(val) < 1) { - registry.fill(tarName, cent, val, dnx); - } - return; - } - return; + const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"}; + std::shared_ptr histPhiEtaVtxz = registry.add(Form("%d/hPhiEtaVtxz", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {axisPhi, {64, -1.6, 1.6}, {40, -10, 10}}}); + th3sPerRun.insert(std::make_pair(runNumber, histPhiEtaVtxz)); } void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) @@ -624,24 +497,6 @@ struct FlowCumulantsUpc { return; } - template - void fillProfileMC(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) - { - double dnx, val; - dnx = fGFWMC->Calculate(corrconf, 0, kTRUE).real(); - if (dnx == 0) { - return; - } - if (!corrconf.pTDif) { - val = fGFWMC->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (std::fabs(val) < 1) { - registry.fill(tarName, cent, val, dnx); - } - return; - } - return; - } - void fillFCMC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) { double dnx, val; @@ -669,12 +524,12 @@ struct FlowCumulantsUpc { return; } - void loadCorrections(uint64_t timestamp, int runNumber) + void loadCorrections(uint64_t timestamp) { if (correctionsLoaded) { return; } - if (!cfgAcceptanceListEnabled && cfgAcceptance.value.empty() == false) { + if (cfgAcceptance.value.empty() == false) { mAcceptance = ccdb->getForTimeStamp(cfgAcceptance, timestamp); if (mAcceptance) { LOGF(info, "Loaded acceptance weights from %s (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance); @@ -682,19 +537,6 @@ struct FlowCumulantsUpc { LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance); } } - if (cfgAcceptanceListEnabled && cfgAcceptanceList.value.empty() == false) { - mAcceptanceList = ccdb->getForTimeStamp(cfgAcceptanceList, timestamp); - if (mAcceptanceList == nullptr) { - LOGF(fatal, "Could not load acceptance weights list from %s", cfgAcceptanceList.value.c_str()); - } - LOGF(info, "Loaded acceptance weights list from %s (%p)", cfgAcceptanceList.value.c_str(), (void*)mAcceptanceList); - - mAcceptance = static_cast(mAcceptanceList->FindObject(Form("%d", runNumber))); - if (mAcceptance == nullptr) { - LOGF(fatal, "Could not find acceptance weights for run %d in acceptance list", runNumber); - } - LOGF(info, "Loaded acceptance weights (%p) for run %d from list (%p)", (void*)mAcceptance, runNumber, (void*)mAcceptanceList); - } if (cfgEfficiency.value.empty() == false) { mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); if (mEfficiency == nullptr) { @@ -723,127 +565,6 @@ struct FlowCumulantsUpc { return true; } - // template - // bool eventSelected(TCollision collision, const int multTrk, const float centrality) - // { - // registry.fill(HIST("hEventCountSpecific"), 0.5); - // if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - // // rejects collisions which are associated with the same "found-by-T0" bunch crossing - // // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof - // return 0; - // } - // // if (cfgEvSelkNoSameBunchPileup) { - // // registry.fill(HIST("hEventCountSpecific"), 1.5); - // // } - // if (cfgEvSelkIsGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - // // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference - // // use this cut at low multiplicities with caution - // return 0; - // } - // if (cfgEvSelkIsGoodZvtxFT0vsPV) { - // registry.fill(HIST("hEventCountSpecific"), 2.5); - // } - // if (cfgEvSelkNoCollInTimeRangeStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - // // no collisions in specified time range - // return 0; - // } - // if (cfgEvSelkNoCollInTimeRangeStandard) { - // registry.fill(HIST("hEventCountSpecific"), 3.5); - // } - // if (cfgEvSelkIsGoodITSLayersAll && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { - // // from Jan 9 2025 AOT meeting - // // cut time intervals with dead ITS staves - // return 0; - // } - // if (cfgEvSelkIsGoodITSLayersAll) { - // registry.fill(HIST("hEventCountSpecific"), 4.5); - // } - // if (cfgEvSelkNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { - // // no other collisions in this Readout Frame with per-collision multiplicity above threshold - // return 0; - // } - // if (cfgEvSelkNoCollInRofStandard) { - // registry.fill(HIST("hEventCountSpecific"), 5.5); - // } - // if (cfgEvSelkNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { - // // veto an event if FT0C amplitude in previous ITS ROF is above threshold - // return 0; - // } - // if (cfgEvSelkNoHighMultCollInPrevRof) { - // registry.fill(HIST("hEventCountSpecific"), 6.5); - // } - // auto multNTracksPV = collision.multNTracksPV(); - // auto occupancy = collision.occupancyInTime(); - // if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) { - // return 0; - // } - // if (cfgEvSelOccupancy) { - // registry.fill(HIST("hEventCountSpecific"), 7.5); - // } - - // if (cfgEvSelMultCorrelation) { - // 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 (cfgEvSelMultCorrelation) { - // registry.fill(HIST("hEventCountSpecific"), 8.5); - // } - - // // V0A T0A 5 sigma cut - // constexpr int kSigmaCut = 5; - // if (cfgEvSelV0AT0ACut && (std::fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > kSigmaCut * fT0AV0ASigma->Eval(collision.multFT0A()))) { - // return 0; - // } - // if (cfgEvSelV0AT0ACut) { - // registry.fill(HIST("hEventCountSpecific"), 9.5); - // } - - // return 1; - // } - - // // template - // // void eventCounterQA(TCollision collision, const int multTrk, const float centrality) - // // { - // // registry.fill(HIST("hEventCountTentative"), 0.5); - // // // Regradless of the event selection, fill the event counter histograms - // // if (collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - // // registry.fill(HIST("hEventCountTentative"), 1.5); - // // } - // // if (collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - // // registry.fill(HIST("hEventCountTentative"), 2.5); - // } - // if (collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - // registry.fill(HIST("hEventCountTentative"), 3.5); - // } - // if (collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { - // registry.fill(HIST("hEventCountTentative"), 4.5); - // } - // if (collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { - // registry.fill(HIST("hEventCountTentative"), 5.5); - // } - // if (collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { - // registry.fill(HIST("hEventCountTentative"), 6.5); - // } - // auto multNTracksPV = collision.multNTracksPV(); - // auto occupancy = collision.trackOccupancyInTimeRange(); - // if (!(occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) { - // registry.fill(HIST("hEventCountTentative"), 7.5); - // } - // if (!((multNTracksPV < fMultPVCutLow->Eval(centrality)) || (multNTracksPV > fMultPVCutHigh->Eval(centrality)) || (multTrk < fMultCutLow->Eval(centrality)) || (multTrk > fMultCutHigh->Eval(centrality)))) { - // registry.fill(HIST("hEventCountTentative"), 8.5); - // } - // // constexpr int kSigmaCut = 5; - // // if (!(std::fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > kSigmaCut * fT0AV0ASigma->Eval(collision.multFT0A()))) { - // // registry.fill(HIST("hEventCountTentative"), 9.5); - // // } - // } - template bool trackSelected(TTrack track) { @@ -853,79 +574,43 @@ struct FlowCumulantsUpc { return false; } registry.fill(HIST("hTrackCount"), 1.5); - if (cfgDcaz && !(std::fabs(track.dcaZ()) < cfgDcazCut)) { + if (cfgGlobalTrack && !(track.hasITS() && track.hasTPC())) { return false; } registry.fill(HIST("hTrackCount"), 2.5); - double dcaLimit = 0.0105 + 0.035 / std::pow(track.pt(), 1.1); - if (cfgDcaxy && !(std::fabs(track.dcaXY()) < dcaLimit)) { + if (track.tpcNClsCrossedRows() < cfgCutTPCCrossedRows) { return false; } registry.fill(HIST("hTrackCount"), 3.5); - if (track.itsClusterSizes() <= cfgItsClusterSize) { + auto tpcClu = track.tpcNClsFindable() - track.tpcNClsFindableMinusFound(); + if (tpcClu < cfgCutTPCclu) { return false; } registry.fill(HIST("hTrackCount"), 4.5); - if (track.tpcChi2NCl() >= cfgMaxTPCChi2NCl) { + if (track.tpcChi2NCl() >= cfgCutTPCChi2NCl) { return false; } registry.fill(HIST("hTrackCount"), 5.5); - return true; - } - - void initHadronicRate(aod::BCsWithTimestamps::iterator const& bc) - { - if (mRunNumber == bc.runNumber()) { - return; + if (track.itsNCls() < cfgCutITSclu) { + return false; } - mRunNumber = bc.runNumber(); - if (gHadronicRate.find(mRunNumber) == gHadronicRate.end()) { - auto runDuration = ccdb->getRunDuration(mRunNumber); - mSOR = runDuration.first; - mMinSeconds = std::floor(mSOR * 1.e-3); /// round tsSOR to the highest integer lower than tsSOR - double maxSec = std::ceil(runDuration.second * 1.e-3); /// round tsEOR to the lowest integer higher than tsEOR - const AxisSpec axisSeconds{static_cast((maxSec - mMinSeconds) / 20.f), 0, maxSec - mMinSeconds, "Seconds since SOR"}; - gHadronicRate[mRunNumber] = registry.add(Form("HadronicRate/%i", mRunNumber), ";Time since SOR (s);Hadronic rate (kHz)", kTH2D, {axisSeconds, {510, 0., 51.}}).get(); + registry.fill(HIST("hTrackCount"), 6.5); + if (cfgDcaz && !(std::fabs(track.dcaZ()) < cfgDcazCut)) { + return false; } - gCurrentHadronicRate = gHadronicRate[mRunNumber]; - } - - template - float getDPhiStar(TTrack const& track1, TTrack const& track2, float radius, int runnum) - { - float charge1 = track1.sign(); - float charge2 = track2.sign(); - - float phi1 = track1.phi(); - float phi2 = track2.phi(); - - float pt1 = track1.pt(); - float pt2 = track2.pt(); - - int fbSign = 1; - - int zzo = 544868; - if (runnum >= zzo) { - fbSign = -1; + registry.fill(HIST("hTrackCount"), 7.5); + double dcaLimit = 0.0105 + 0.035 / std::pow(track.pt(), 1.1); + if (cfgDcaxy && !(std::fabs(track.dcaXY()) < dcaLimit)) { + return false; } + registry.fill(HIST("hTrackCount"), 8.5); - float dPhiStar = phi1 - phi2 - charge1 * fbSign * std::asin(0.075 * radius / pt1) + charge2 * fbSign * std::asin(0.075 * radius / pt2); - - if (dPhiStar > constants::math::PI) - dPhiStar = constants::math::TwoPI - dPhiStar; - if (dPhiStar < -constants::math::PI) - dPhiStar = -constants::math::TwoPI - dPhiStar; - - return dPhiStar; + return true; } - void process(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks) + void processData(UDCollisionsFull::iterator const& collision, UdTracksFull const& tracks) { registry.fill(HIST("hEventCount"), 0.5); - // if(!eventSelected(collision, tracks.size(), 100.0f)) { - // eventCounterQA(collision, tracks.size(), 100.0f); - // return; - // } int gapSide = collision.gapSide(); if (gapSide == 0) { if (!cfgGapSideA) { @@ -956,38 +641,47 @@ struct FlowCumulantsUpc { return; } registry.fill(HIST("hEventCount"), 1.5); - if (cfgIsGoodItsLayers && collision.trs() == 0) { - return; - } - registry.fill(HIST("hEventCount"), 2.5); - float cent = 100; float lRandom = fRndm->Rndm(); float vtxz = collision.posZ(); registry.fill(HIST("hVtxZ"), vtxz); - registry.fill(HIST("hMult"), tracks.size()); - registry.fill(HIST("hCent"), cent); + registry.fill(HIST("hMultWoSel"), tracks.size()); fGFW->Clear(); if (cfgIfVertex && std::abs(vtxz) > cfgCutVertex) { return; } - registry.fill(HIST("hEventCount"), 3.5); + registry.fill(HIST("hEventCount"), 2.5); int occupancy = collision.occupancyInTime(); if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) { return; } + registry.fill(HIST("hEventCount"), 3.5); + + auto currentRunNumber = collision.runNumber(); + auto runDuration = ccdb->getRunDuration(currentRunNumber); + loadCorrections(runDuration.first); + if (cfgOutputNUAWeightsRunbyRun && currentRunNumber != lastRunNumber) { + lastRunNumber = currentRunNumber; + if (std::find(runNumbers.begin(), runNumbers.end(), currentRunNumber) == runNumbers.end()) { + // if run number is not in the preconfigured list, create new output histograms for this run + createOutputObjectsForRun(currentRunNumber); + runNumbers.push_back(currentRunNumber); + } + + if (th3sPerRun.find(currentRunNumber) == th3sPerRun.end()) { + LOGF(fatal, "RunNumber %d not found in th3sPerRun", currentRunNumber); + return; + } + } registry.fill(HIST("hEventCount"), 4.5); + // // track weights float weff = 1, wacc = 1; - double nTracksCorrected = 0; - float independent = cent; - if (cfgUseNch) { - independent = static_cast(tracks.size()); - } + double nTracksRaw = 0.; + double nTracksCorrected = 0.; AcceptedTracks acceptedTracks{0, 0, 0, 0}; std::vector consistentEventVector = cfgConsistentEventVector; for (const auto& track : tracks) { - registry.fill(HIST("hChi2prTPCcls"), track.tpcChi2NCl()); if (!trackSelected(track)) { continue; } @@ -1000,10 +694,14 @@ struct FlowCumulantsUpc { if (cfgOutputNUAWeights) { if (cfgOutputNUAWeightsRefPt) { if (withinPtRef) { - fWeights->fill(phi, eta, vtxz, pt, cent, 0); + fWeights->fill(phi, eta, vtxz, pt, 0., 0); + if (cfgOutputNUAWeightsRunbyRun) + th3sPerRun[currentRunNumber]->Fill(phi, eta, vtxz); } } else { - fWeights->fill(phi, eta, vtxz, pt, cent, 0); + fWeights->fill(phi, eta, vtxz, pt, 0., 0); + if (cfgOutputNUAWeightsRunbyRun) + th3sPerRun[currentRunNumber]->Fill(phi, eta, vtxz); } } if (!setCurrentParticleWeights(weff, wacc, phi, eta, pt, vtxz)) { @@ -1021,12 +719,19 @@ struct FlowCumulantsUpc { acceptedTracks.nPos += 1; } if (withinPtRef) { + registry.fill(HIST("hChi2prTPCcls"), track.tpcChi2NCl()); + registry.fill(HIST("hChi2prITScls"), track.itsChi2NCl()); + auto tpcClu = track.tpcNClsFindable() - track.tpcNClsFindableMinusFound(); + registry.fill(HIST("hnTPCClu"), tpcClu); + registry.fill(HIST("hnITSClu"), track.itsNCls()); + registry.fill(HIST("hnTPCCrossedRow"), track.tpcNClsCrossedRows()); registry.fill(HIST("hPhi"), phi); registry.fill(HIST("hPhiWeighted"), phi, wacc); registry.fill(HIST("hEta"), eta); registry.fill(HIST("hPtRef"), pt); registry.fill(HIST("hDCAz"), track.dcaZ(), track.pt()); registry.fill(HIST("hDCAxy"), track.dcaXY(), track.pt()); + nTracksRaw += 1.; nTracksCorrected += weff; } if (withinPtRef) { @@ -1038,9 +743,14 @@ struct FlowCumulantsUpc { if (withinPtPOI && withinPtRef) { fGFW->Fill(eta, fPtAxis->FindBin(pt) - 1, phi, wacc * weff, 4); } - registry.fill(HIST("hEtaNch2D"), eta, tracks.size()); } - registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected); + registry.fill(HIST("hTrackCorrection2d"), nTracksRaw, nTracksCorrected); + registry.fill(HIST("hMult"), nTracksRaw); + float independent = nTracksRaw; + if (cfgUseNchCorrected) { + independent = nTracksCorrected; + } + if (cfgConsistentEventFlag) { if (cfgConsistentEventFlag & 1) { if (!acceptedTracks.nPos || !acceptedTracks.nNeg) @@ -1064,7 +774,7 @@ struct FlowCumulantsUpc { fillFC(corrconfigs.at(l_ind), independent, lRandom); } } - PROCESS_SWITCH(FlowCumulantsUpc, process, "process", true); + PROCESS_SWITCH(FlowCumulantsUpc, processData, "processData", true); //----------------------------------------------------------------------------------------------------------------------- void processSim(aod::UDMcCollision const& mcCollision, aod::UDMcParticles const& mcParticles) @@ -1072,11 +782,9 @@ struct FlowCumulantsUpc { registry.fill(HIST("eventCounterMC"), 0.5); registry.fill(HIST("hEventCount"), 1.5); - float cent = 100; float vtxz = mcCollision.posZ(); registry.fill(HIST("hVtxZMC"), vtxz); registry.fill(HIST("hMultMC"), mcParticles.size()); - registry.fill(HIST("hCentMC"), cent); auto massPion = o2::constants::physics::MassPionCharged; registry.fill(HIST("numberOfTracksMC"), mcParticles.size()); @@ -1088,10 +796,7 @@ struct FlowCumulantsUpc { // // track weights float weff = 1, wacc = 1; double nTracksCorrected = 0; - float independent = cent; - if (cfgUseNch) { - independent = static_cast(mcParticles.size()); - } + float independent = static_cast(mcParticles.size()); for (const auto& mcParticle : mcParticles) { if (!mcParticle.isPhysicalPrimary()) @@ -1099,8 +804,8 @@ struct FlowCumulantsUpc { std::array momentum = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; double energy = std::sqrt(momentum[0] * momentum[0] + momentum[1] * momentum[1] + momentum[2] * momentum[2] + massPion * massPion); ROOT::Math::LorentzVector> protoMC(momentum[0], momentum[1], momentum[2], energy); - constexpr double kEtaCut = 0.8; - constexpr double kPtCut = 0.1; + double kEtaCut = 0.8; + double kPtCut = 0.1; if (!(std::fabs(protoMC.Eta()) < kEtaCut && protoMC.Pt() > kPtCut)) { continue; } @@ -1113,22 +818,21 @@ struct FlowCumulantsUpc { if (cfgOutputNUAWeights) { if (cfgOutputNUAWeightsRefPt) { if (withinPtRef) { - fWeightsMc->fill(phi, eta, vtxz, pt, cent, 0); + fWeightsMc->fill(phi, eta, vtxz, pt, 0., 0); } } else { - fWeightsMc->fill(phi, eta, vtxz, pt, cent, 0); + fWeightsMc->fill(phi, eta, vtxz, pt, 0., 0); } } if (!setCurrentParticleWeights(weff, wacc, phi, eta, pt, vtxz)) { continue; } + registry.fill(HIST("hPtMC"), pt); if (withinPtRef) { registry.fill(HIST("hPhiMC"), phi); registry.fill(HIST("hPhiWeightedMC"), phi, wacc); registry.fill(HIST("hEtaMC"), eta); registry.fill(HIST("hPtRefMC"), pt); - // registry.fill(HIST("hDCAzMC"), track.dcaZ(), track.pt()); - // registry.fill(HIST("hDCAxyMC"), track.dcaXY(), track.pt()); nTracksCorrected += weff; } if (withinPtRef) { From 414eee006631b5fe9aae2af79b6d5262ebf352ee Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:41:45 +0200 Subject: [PATCH 281/282] =?UTF-8?q?[PWGEM,PWGEM-36,PWGEM-40]=20PM/photonRe?= =?UTF-8?q?soTask:=20remove=20unnecessary=20confi=E2=80=A6=20(#15777)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGEM/PhotonMeson/Tasks/photonResoTask.cxx | 45 ++-------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index a7589d90316..1b462994dca 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -176,31 +176,6 @@ struct PhotonResoTask { Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } mesonConfig; - struct : ConfigurableGroup { - 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 = "rotationConfig"; - Configurable cfgDoRotation{"cfgDoRotation", false, "Flag to enable rotation background method."}; - Configurable cfgDownsampling{"cfgDownsampling", 1, "Calculate rotation background only for every collision."}; - Configurable cfgRotAngle{"cfgRotAngle", std::move(const_cast(o2::constants::math::PIHalf)), "Angle used for the rotation method."}; - Configurable cfgUseWeights{"cfgUseWeights", false, "Flag to enable weights for rotation background method."}; - } rotationConfig; - - 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"}; - Configurable doEMCalCalib{"doEMCalCalib", 0, "Produce output for EMCal calibration"}; - Configurable cfgEnableNonLin{"cfgEnableNonLin", false, "flag to turn extra non linear energy calibration on/off"}; - } correctionConfig; - SliceCache cache; using EMCalPhotons = soa::Join; @@ -224,10 +199,6 @@ struct PhotonResoTask { int mRunNumber{-1}; float dBz{0.f}; - // Usage when cfgEnableNonLin is enabled - std::unique_ptr fEMCalCorrectionFactor; // ("fEMCalCorrectionFactor","(1 + [0]/x + [1]/x^2) / (1 + [2]/x)", 0.3, 100.); - float energyCorrectionFactor = 1.f; - void defineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); @@ -320,7 +291,7 @@ struct PhotonResoTask { const AxisSpec thnAxisPGen{thnConfigAxisPt, "#it{p}_{Gen} (GeV/#it{c})"}; const AxisSpec thnAxisPRec{thnConfigAxisPt, "#it{p}_{Rec} (GeV/#it{c})"}; const AxisSpec thnAxisPRelative{thnConfigAxisXRelative, "#it{p}_{Rec} - #it{p}_{Gen} / #it{p}_{Gen}"}; - const AxisSpec thnAxisEGen{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; + const AxisSpec thnAxisEGen{thnConfigAxisPt, "#it{E}_{Gen} (GeV)"}; const AxisSpec thnAxisERec{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; const AxisSpec thnAxisERelative{thnConfigAxisXRelative, "#it{E}_{Rec} - #it{E}_{Gen} / #it{E}_{Gen}"}; const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; @@ -375,9 +346,6 @@ struct PhotonResoTask { if (mesonConfig.cfgEnableQA.value) { registry.add("mesonQA/hInvMassPt", "Histo for inv pair mass vs pt", HistType::kTH2D, {thnAxisInvMass, thnAxisPtRec}); } - - fEMCalCorrectionFactor = std::make_unique("fEMCalCorrectionFactor", "(1 + [0]/x + [1]/x^2) / (1 + [2]/x)", 0.3, 100.); - fEMCalCorrectionFactor->SetParameters(-5.33426e-01, 1.40144e-02, -5.24434e-01); }; // end init template @@ -571,15 +539,8 @@ struct PhotonResoTask { continue; } - if (correctionConfig.cfgEnableNonLin.value) { - energyCorrectionFactor = fEMCalCorrectionFactor->Eval(g1.e() > MinEnergy ? g1.e() : MinEnergy); - } - if (correctionConfig.cfgEnableNonLin.value) { - energyCorrectionFactor = fEMCalCorrectionFactor->Eval(g2.e() > MinEnergy ? g2.e() : MinEnergy); - } - - ROOT::Math::PtEtaPhiMVector v1(energyCorrectionFactor * g1.pt(), g1.eta(), g1.phi(), 0.); - ROOT::Math::PtEtaPhiMVector v2(energyCorrectionFactor * g2.pt(), g2.eta(), g2.phi(), 0.); + 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 vMeson = v1 + v2; float openingAngle = std::acos(v1.Vect().Dot(v2.Vect()) / (v1.P() * v2.P())); From e87b33e821774532e90bf58aaeb606284428316b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 15 Apr 2026 09:43:20 +0000 Subject: [PATCH 282/282] Please consider the following formatting changes --- .../Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index 3127eb5caf5..98912e29caa 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -192,7 +192,7 @@ struct FemtoUniversePairTaskTrackTrackMultKtExtended { Configurable confRejectGammaPair{"confRejectGammaPair", false, "Additional check to reject e+e- pairs base on theta and minv"}; Configurable confMaxEEMinv{"confMaxEEMinv", 0.002, "Max. minv of e-e+ pair for gamma pair rejection"}; Configurable confMaxDTheta{"confMaxDTheta", 0.008, "Max. DeltaTheta of pair for gamma pair rejection"}; - + ConfigurableAxis confDeltaEtaAxis{"confDeltaEtaAxis", {100, -0.15, 0.15}, "DeltaEta"}; ConfigurableAxis confDeltaPhiStarAxis{"confDeltaPhiStarAxis", {100, -0.15, 0.15}, "DeltaPhiStar"};